/* ============================================================
   DebloatMe - design tokens
   ============================================================ */

:root {
  --bg: #131217;
  --bg-raised: #1b1a22;
  --bg-inset: #0d0c11;
  --border: #2a2733;
  --border-strong: #3a3545;
  --text: #eeecf2;
  --text-dim: #a9a5b3;
  --text-faint: #6f6a7a;
  --accent: #9c7cff;
  --accent-solid: #4800f1;
  --accent-solid-hover: #5f1eff;
  --accent-dim: #3d2b8f;
  --accent-bg: rgba(72, 0, 241, 0.14);
  --danger: #c96f5c;
  --ok: #7fa66b;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 6px;
  --content-width: 920px;
}

/* ---------- light theme ---------- */
:root[data-theme="light"] {
  --bg: #f7f5f2;
  --bg-raised: #ffffff;
  --bg-inset: #edeae4;
  --border: #ddd7cd;
  --border-strong: #c7bfb2;
  --text: #1c1a1f;
  --text-dim: #55505c;
  --text-faint: #857f8a;
  --accent: #5b2fe0;
  --accent-solid: #4800f1;
  --accent-solid-hover: #5f1eff;
  --accent-dim: #cabcf7;
  --accent-bg: rgba(72, 0, 241, 0.08);
  --danger: #b23b28;
  --ok: #3f7a2c;
}

:root[data-theme="light"] .btn-primary { color: #ffffff; }
:root[data-theme="light"] .skip-link { color: #ffffff; }

/* ---------- "???" theme ---------- */
:root[data-theme="high"] {
  --bg: #170b08;
  --bg-raised: #241209;
  --bg-inset: #0d0604;
  --border: #3a1f12;
  --border-strong: #5a2f18;
  --text: #ffe9d6;
  --text-dim: #d9b79a;
  --text-faint: #a3806a;
  --accent: #ff8a5c;
  --accent-solid: #ff5722;
  --accent-solid-hover: #ff8a50;
  --accent-dim: #8a3b1a;
  --accent-bg: rgba(255, 87, 34, 0.18);
  --danger: #ff6b6b;
  --ok: #d9a83b;
}

:root[data-theme="high"] body {
  animation: dm-high-drift 9s linear infinite;
}

:root[data-theme="high"] .terminal,
:root[data-theme="high"] .btn-primary,
:root[data-theme="high"] .mascot-strip {
  animation: dm-high-glow 3.5s ease-in-out infinite;
}

:root[data-theme="high"] h1,
:root[data-theme="high"] h2 {
  text-shadow: 0 0 22px var(--accent-bg);
}

@keyframes dm-high-drift {
  0%   { filter: hue-rotate(0deg) saturate(1) brightness(1); }
  25%  { filter: hue-rotate(90deg) saturate(1.35) brightness(1.05); }
  50%  { filter: hue-rotate(180deg) saturate(1.5) brightness(1.1); }
  75%  { filter: hue-rotate(270deg) saturate(1.35) brightness(1.05); }
  100% { filter: hue-rotate(360deg) saturate(1) brightness(1); }
}

@keyframes dm-high-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 87, 34, 0); transform: scale(1); }
  50% { box-shadow: 0 0 46px rgba(255, 87, 34, 0.4); transform: scale(1.01); }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme="high"] body,
  :root[data-theme="high"] .terminal,
  :root[data-theme="high"] .btn-primary,
  :root[data-theme="high"] .mascot-strip {
    animation: none;
  }
}

/* ---------- theme toggle button ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  cursor: pointer;
  margin-right: 10px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--text); border-color: var(--text-dim); }
.theme-toggle-icon { font-size: 0.95rem; line-height: 1; }

@media (max-width: 720px) {
  .theme-toggle { margin-right: 8px; padding: 6px 10px; }
  .theme-toggle-label { display: none; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }

p { color: var(--text-dim); max-width: 68ch; }

code, pre, .mono { font-family: var(--mono); }

/* ---------- layout ---------- */

.wrap { max-width: var(--content-width); margin: 0 auto; padding: 0 24px; }

section { padding: 72px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ---------- nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(22, 24, 27, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1080px;
}

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand .logo-mark { height: 30px; width: auto; display: block; }
.footer-brand .logo-mark { height: 26px; width: auto; display: block; margin-bottom: 10px; }

.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text-dim); font-size: 0.92rem; transition: color 0.15s ease; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--border); }
  .nav-links li:first-child { border-top: none; }
  .nav-links a { display: block; padding: 14px 24px; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent-solid); color: #f5f1ff; }
.btn-primary:hover { background: var(--accent-solid-hover); }

.btn-secondary { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--text-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- hero ---------- */

.hero { padding-top: 96px; padding-bottom: 88px; }

.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero h1 { margin-bottom: 18px; }
.hero .lede { font-size: 1.08rem; margin-bottom: 32px; }

.mascot-strip {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 48px auto 0;
  opacity: 0.9;
  transform: rotate(-0.6deg);
}

.hero-note {
  max-width: 480px;
  margin: 18px auto 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-faint);
  font-style: italic;
}

/* ---------- terminal window ---------- */

.terminal {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px -30px rgba(0,0,0,0.6);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.terminal-bar .label { margin-left: 8px; font-family: var(--mono); font-size: 0.75rem; color: var(--text-faint); }

.terminal-body { padding: 20px; font-family: var(--mono); font-size: 0.88rem; line-height: 1.7; }
.terminal-body .prompt { color: var(--accent); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--text-faint); }
.terminal-body .rule { color: var(--ok); }

/* ---------- code blocks & copy ---------- */

.code-row {
  display: flex;
  align-items: stretch;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-row code { flex: 1; padding: 14px 16px; font-size: 0.86rem; color: var(--text); overflow-x: auto; white-space: pre; }

.copy-btn {
  border: none;
  border-left: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-dim);
  padding: 0 16px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.8rem;
  white-space: nowrap;
}

.copy-btn:hover { color: var(--text); background: var(--bg-inset); }
.copy-btn.copied { color: var(--ok); }

pre.script-block {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.65;
  max-height: 480px;
}

.script-actions { display: flex; gap: 10px; margin: 14px 0 22px; flex-wrap: wrap; }

/* ---------- steps ---------- */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 40px; }

@media (max-width: 780px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

.step { border-top: 2px solid var(--border-strong); padding-top: 16px; }
.step .num { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; display: block; margin-bottom: 10px; }
.step h3 { margin-bottom: 6px; }
.step p { font-size: 0.92rem; }

/* ---------- platform grid ---------- */

.group-label { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); margin: 40px 0 16px; }
.group-label:first-child { margin-top: 0; }

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (max-width: 780px) { .platform-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .platform-grid { grid-template-columns: 1fr; } }

.platform-card {
  background: var(--bg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 2px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-decoration: none;
  color: var(--text);
}

.platform-card:hover, .platform-card:focus-visible { border-left-color: var(--accent); background: var(--bg-raised); }

.platform-card .name { font-family: var(--mono); font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.platform-card .badge {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.68rem;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  background: var(--accent-bg);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.platform-card .desc { color: var(--text-dim); font-size: 0.88rem; margin: 0; }
.platform-card .changes { color: var(--text-faint); font-size: 0.8rem; margin: 0; }
.platform-card .go { margin-top: auto; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }

/* ---------- safety callout ---------- */

.callout {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--danger);
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.callout h3 { margin-bottom: 10px; }
.callout ul { margin: 12px 0 0; padding-left: 20px; color: var(--text-dim); }
.callout li { margin-bottom: 6px; font-size: 0.94rem; }
.callout.ok { border-left-color: var(--ok); }

/* ---------- doc page layout ---------- */

.doc-header { padding-top: 56px; padding-bottom: 32px; }

.doc-header .kicker { font-family: var(--mono); font-size: 0.85rem; color: var(--text-faint); margin-bottom: 10px; }

.variant-toggle {
  display: inline-flex;
  gap: 6px;
  margin-top: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
}

.variant-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.variant-btn.active { background: var(--accent-solid); color: #f5f1ff; }
.variant-btn:not(.active):hover { color: var(--text); }

.doc-section h2 { margin-bottom: 16px; }
.doc-section { padding: 48px 0; }

.check-list, .plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-list li, .plain-list li { padding-left: 22px; position: relative; color: var(--text-dim); font-size: 0.95rem; }
.check-list li::before { content: "-"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); }
.plain-list li::before { content: "-"; position: absolute; left: 0; color: var(--text-faint); font-family: var(--mono); }

.stays-box { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }

/* ---------- footer ---------- */

footer { padding: 48px 0 60px; }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand .brand { margin-bottom: 8px; }
.footer-brand p { font-size: 0.88rem; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-links h4 { font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); margin-bottom: 12px; font-weight: 500; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a { text-decoration: none; color: var(--text-dim); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 0.82rem; }

/* ---------- misc ---------- */

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #191113; padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
