/* =============================================================
   From Zero to Live — design system
   Themed to match 7-figure-plan.mikee.ai: warm "paper" canvas,
   clay/coral accent, Newsreader serif + Inter + JetBrains Mono.
   One stylesheet, no build step. Text pairs meet WCAG AA.
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&display=swap');

/* ---------- Tier 1: brand primitives ---------- */
:root {
  --paper:      #faf9f5;   /* warm cream canvas */
  --paper-2:    #f4f2ea;
  --surface:    #f0eee6;   /* warm raised surface */
  --surface-2:  #e8e5d9;
  --line:       #e0ddd0;   /* warm border */
  --line-2:     #d6d2c2;
  --ink:        #1f1e1d;   /* warm near-black */
  --ink-soft:   #55524a;
  --ink-muted:  #6e6b62;
  --ink-faint:  #8f897c;

  --clay:       #d97757;   /* the signature clay/coral accent */
  --clay-deep:  #c1613f;   /* hover */
  --clay-text:  #b0522c;   /* AA-safe clay for inline text on paper */
  --salmon:     #e08a6a;
  --gold:       #bd7b2c;
  --blue:       #4f7cac;   /* steel-blue secondary ("data") */
  --sage:       #6f8f4f;
  --rust:       #c0492b;

  --grid: #1f1e1d0d;       /* faint grid line */
  --clay-glow: 0 0 0 1px #d9775759, 0 14px 34px -14px #d9775773;

  --font-serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.90rem);
  --step-0:  clamp(1.02rem, 0.99rem + 0.20vw, 1.13rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.42rem);
  --step-2:  clamp(1.5rem, 1.34rem + 0.8vw, 2.0rem);
  --step-3:  clamp(1.9rem, 1.6rem + 1.4vw, 2.7rem);
  --step-4:  clamp(2.4rem, 1.9rem + 2.5vw, 3.8rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4rem; --space-9: 6rem;

  --radius: 12px;
  --radius-lg: 20px;
  --prose: 44rem;
  --page: 74rem;

  --shadow-sm: 0 1px 2px #1f1e1d0f, 0 1px 3px #1f1e1d0a;
  --shadow-md: 0 6px 16px #1f1e1d14, 0 2px 6px #1f1e1d0d;
  --shadow-lg: 0 24px 48px -12px #1f1e1d24;
}

/* ---------- Tier 2: semantic tokens (paper — default) ---------- */
:root {
  --bg: var(--paper);
  --bg-soft: var(--paper-2);
  --border: var(--line);
  --border-strong: var(--line-2);
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --text-mute: var(--ink-muted);

  --primary: var(--clay);
  --primary-hover: var(--clay-deep);
  --primary-soft: #d977571f;
  --on-primary: #221a15;
  --link: var(--clay-text);
  --accent: var(--gold);

  --code-bg: #201f1b;
  --code-text: #eceadf;
  --code-inline-bg: var(--surface-2);
  --code-inline-text: var(--clay-text);

  --focus: var(--clay);
  color-scheme: light;
}

/* ---------- Warm dark variant ---------- */
:root[data-theme="dark"] {
  --bg: #1a1917;
  --bg-soft: #201e1c;
  --surface: #232120;
  --surface-2: #2c2a26;
  --border: #37342f;
  --border-strong: #46423b;
  --text: #f5f2ea;
  --text-soft: #cbc5b7;
  --text-mute: #9c9587;

  --primary: var(--salmon);
  --primary-hover: #eaa184;
  --primary-soft: #e08a6a24;
  --on-primary: #1a1917;
  --link: var(--salmon);
  --accent: #e6b45a;

  --grid: #f5f2ea0a;
  --code-bg: #131210;
  --code-text: #e7e3d8;
  --code-inline-bg: #2c2a26;
  --code-inline-text: var(--salmon);

  --focus: var(--salmon);
  color-scheme: dark;
  --clay-glow: 0 0 0 1px #e08a6a4d, 0 16px 36px -14px #e08a6a59;
  --shadow-sm: 0 1px 2px #0000004d;
  --shadow-md: 0 6px 18px #00000059;
  --shadow-lg: 0 26px 52px #00000073;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  min-height: 100vh;
}

/* warm paper background treatment: soft glow blobs + faint grid, vignette-masked */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(42% 34% at 16% 6%, color-mix(in oklab, var(--clay) 15%, transparent), transparent 70%),
    radial-gradient(40% 32% at 86% 3%, color-mix(in oklab, var(--blue) 12%, transparent), transparent 72%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 64px 64px, 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 85% 55% at 50% 22%, #000, transparent 92%);
  mask-image: radial-gradient(ellipse 85% 55% at 50% 22%, #000, transparent 92%);
}

img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }

/* Serif display headings (Newsreader, medium) */
h1, h2, h3, h4,
.hero h1, .section__title, .mod-head h1, .modcard__title,
.card h3, .build-card h3, .planbox__name, .drawer__head h2, .glossary dt {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text);
}

/* Mono labels/eyebrows */
.eyebrow, .modcard__num, .toc__label, .code__label, .pager small,
.crumb, .planbox__tag, .build-badge, .pill {
  font-family: var(--font-mono);
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.skip {
  position: absolute; left: 0; top: 0; transform: translateY(-120%);
  background: var(--primary); color: var(--on-primary);
  padding: var(--space-2) var(--space-4); border-radius: 0 0 var(--radius) 0;
  z-index: 100; font-weight: 700; transition: transform .15s ease;
}
.skip:focus { transform: translateY(0); }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2rem, var(--page)); margin-inline: auto; }
.prose { width: min(100% - 2rem, var(--prose)); margin-inline: auto; }
.stack > * + * { margin-top: var(--space-4); }
.eyebrow {
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--clay-text);
}
:root[data-theme="dark"] .eyebrow { color: var(--salmon); }

/* Gradient emphasis text (clay -> blue), like the reference hero */
.grad {
  background: linear-gradient(105deg, var(--clay) 0%, var(--salmon) 42%, var(--blue) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Mono pill badge */
.pill-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--clay-text);
  padding: 0.35rem 0.8rem; border: 1px solid var(--border-strong);
  border-radius: 999px; background: var(--surface);
}
.pill-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 3px #d9775726; }
:root[data-theme="dark"] .pill-badge { color: var(--salmon); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  display: flex; align-items: center; gap: var(--space-4); height: 60px;
  width: min(100% - 2rem, var(--page)); margin-inline: auto;
}
.brand { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 700; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(150deg, var(--salmon), var(--clay-deep));
  color: #fff; display: grid; place-items: center; font-size: 1.05rem;
  box-shadow: var(--clay-glow);
}
.brand__name { font-family: var(--font-serif); font-weight: 600; font-size: 1.08rem; letter-spacing: -0.01em; }
.brand__name small { display: block; font-family: var(--font-mono); font-size: 0.64rem; font-weight: 500; color: var(--text-mute); letter-spacing: 0.02em; text-transform: none; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: var(--space-2); }

.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text-soft); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.btn-modules {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: .45rem .8rem; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: var(--step--1); cursor: pointer;
}
.btn-modules:hover { border-color: var(--primary); color: var(--primary); }

:root[data-theme="dark"] .i-sun { display: none; }
:root:not([data-theme="dark"]) .i-moon { display: none; }

/* ---------- Module drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.drawer.is-open { display: block; }
.drawer__scrim { position: absolute; inset: 0; background: #1f1e1d59; backdrop-filter: blur(2px); }
.drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(92vw, 380px);
  background: var(--bg); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  padding: var(--space-5); overflow-y: auto; animation: slideIn .18s ease;
}
@keyframes slideIn { from { transform: translateX(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.drawer__head h2 { font-size: var(--step-1); }
.drawer__list { list-style: none; padding: 0; display: grid; gap: 2px; }
.drawer__list a { display: grid; grid-template-columns: 2rem 1fr; gap: var(--space-3); align-items: baseline; padding: var(--space-3); border-radius: 10px; color: var(--text); text-decoration: none; line-height: 1.35; }
.drawer__list a:hover { background: var(--surface); }
.drawer__list a[aria-current="page"] { background: var(--primary-soft); }
.drawer__list .n { font-family: var(--font-mono); font-weight: 700; color: var(--primary); }
.drawer__list small { display: block; color: var(--text-mute); font-size: 0.8rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: .72rem 1.15rem; border-radius: var(--radius);
  font-weight: 600; font-size: var(--step-0); line-height: 1;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .06s ease, background .15s ease, box-shadow .18s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--clay-glow); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--lg { padding: .9rem 1.5rem; font-size: var(--step-1); }

/* ---------- Hero ---------- */
.hero { padding: var(--space-9) 0 var(--space-7); position: relative; }
.hero h1 { font-size: var(--step-4); line-height: 1.06; letter-spacing: -0.02em; font-weight: 500; max-width: 15ch; margin-top: var(--space-4); }
.hero p.lead { font-size: var(--step-1); color: var(--text-soft); max-width: 48ch; margin-top: var(--space-5); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.hero__meta { display: flex; flex-wrap: wrap; gap: var(--space-5); margin-top: var(--space-6); color: var(--text-soft); font-size: var(--step--1); font-family: var(--font-mono); }
.hero__meta b { color: var(--text); font-weight: 700; }

/* ---------- Sections ---------- */
.section { padding: var(--space-7) 0; }
.section__title { font-size: var(--step-2); }
.section__intro { color: var(--text-soft); max-width: 60ch; margin-top: var(--space-3); }

/* ---------- Module grid ---------- */
.modgrid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: var(--space-6); }
.modcard {
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .18s ease, border-color .15s ease; position: relative;
}
.modcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); color: var(--text); }
.modcard__num { font-size: 0.72rem; font-weight: 700; color: var(--clay-text); letter-spacing: 0.1em; }
:root[data-theme="dark"] .modcard__num { color: var(--salmon); }
.modcard__title { font-size: var(--step-1); font-weight: 500; }
.modcard__desc { color: var(--text-soft); font-size: var(--step--1); line-height: 1.55; }
.modcard__foot { margin-top: auto; padding-top: var(--space-3); color: var(--primary); font-weight: 600; font-size: var(--step--1); font-family: var(--font-mono); }

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.card h3 { font-size: var(--step-1); margin-bottom: var(--space-2); }
.card p { color: var(--text-soft); }
.card .card__icon { font-size: 1.6rem; margin-bottom: var(--space-2); }

/* ---------- Article / prose ---------- */
.article { padding: var(--space-6) 0 var(--space-8); }
.article h2 { font-size: var(--step-2); margin-top: var(--space-7); margin-bottom: var(--space-3); scroll-margin-top: 80px; }
.article h2:first-of-type { margin-top: var(--space-4); }
.article h3 { font-size: var(--step-1); margin-top: var(--space-6); margin-bottom: var(--space-2); scroll-margin-top: 80px; }
.article p { margin-bottom: var(--space-4); }
.article ul, .article ol { margin: 0 0 var(--space-4) 1.3rem; }
.article li { margin-bottom: var(--space-2); }
.article li::marker { color: var(--primary); }
.article strong { font-weight: 700; }
.article hr { border: none; border-top: 1px solid var(--border); margin: var(--space-7) 0; }
.article a { font-weight: 600; }
.article .lead { font-size: var(--step-1); color: var(--text-soft); font-family: var(--font-sans); }

.term { border-bottom: 2px dotted var(--gold); cursor: help; font-weight: 600; text-underline-offset: 3px; }

/* ---------- Callouts ---------- */
.callout {
  --c: var(--blue); --cbg: var(--blue);
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-left: 4px solid var(--c);
  background: color-mix(in oklab, var(--c) 8%, var(--surface)); border-radius: var(--radius); margin: var(--space-5) 0;
}
.callout__icon { font-size: 1.3rem; line-height: 1.35; }
.callout__body > *:last-child { margin-bottom: 0; }
.callout__title { font-family: var(--font-mono); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: var(--space-2); color: var(--text); }
.callout p, .callout li { color: var(--text); }
.callout--plain { --c: var(--blue); }
.callout--try   { --c: var(--sage); }
.callout--warn  { --c: var(--rust); }
.callout--note  { --c: var(--clay); }
.callout--money { --c: var(--gold); }

/* ---------- Objective / recap ---------- */
.objective, .recap { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); background: var(--surface); box-shadow: var(--shadow-sm); margin: var(--space-5) 0; }
.objective { border-top: 3px solid var(--primary); }
.objective .eyebrow, .recap .eyebrow { margin-bottom: var(--space-2); }
.recap { background: var(--bg-soft); }
.recap ul { margin: var(--space-2) 0 0 1.2rem; }

/* ---------- Steps ---------- */
.steps { list-style: none; counter-reset: step; margin: var(--space-5) 0; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 var(--space-5) var(--space-7); margin: 0; border-left: 2px solid var(--border); }
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: -0.95rem; top: -0.15rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 0 0 4px var(--bg);
}
.steps > li h4 { font-size: 1.08rem; margin-bottom: var(--space-1); }

/* ---------- Code ---------- */
.code { background: var(--code-bg); border-radius: var(--radius); overflow: hidden; margin: var(--space-4) 0; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.code__head { display: flex; align-items: center; justify-content: space-between; padding: .5rem .9rem; background: #ffffff0a; color: #cfc9ba; font-size: 0.76rem; font-family: var(--font-mono); border-bottom: 1px solid #ffffff12; }
.code__dots { display: flex; gap: 6px; }
.code__dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code__dots i:nth-child(1){ background:#ff5f57; } .code__dots i:nth-child(2){ background:#febc2e; } .code__dots i:nth-child(3){ background:#28c840; }
.code__label { margin-left: var(--space-3); flex: 1; color: #a49d8d; }
.copybtn { background: #ffffff14; color: #efece2; border: none; padding: .25rem .6rem; border-radius: 7px; font-size: 0.75rem; cursor: pointer; font-family: var(--font-sans); font-weight: 600; }
.copybtn:hover { background: #ffffff24; }
.copybtn.copied { background: var(--sage); color: #fff; }
.code pre { margin: 0; padding: var(--space-4) var(--space-5); overflow-x: auto; }
.code code, .article pre code { font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.65; color: var(--code-text); background: none; }
.code .cmt { color: #a49d8d; }
.code .prompt { color: #7fb37a; user-select: none; }
:not(pre) > code { font-family: var(--font-mono); font-size: 0.85em; background: var(--code-inline-bg); color: var(--code-inline-text); padding: .12em .4em; border-radius: 6px; font-weight: 600; }

/* ---------- On-this-page TOC ---------- */
.article-layout { display: grid; gap: var(--space-6); }
@media (min-width: 1024px) { .article-layout { grid-template-columns: 1fr 15rem; align-items: start; } .toc { position: sticky; top: 84px; } }
.toc { border-left: 2px solid var(--border); padding-left: var(--space-4); font-size: var(--step--1); }
.toc__label { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; font-weight: 600; color: var(--text-mute); margin-bottom: var(--space-2); }
.toc ul { list-style: none; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: .25rem 0; color: var(--text-soft); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--primary); }
.toc a.is-active { color: var(--primary); font-weight: 700; }
@media (max-width: 1023px) { .toc { display: none; } }

/* ---------- Breadcrumb + module header ---------- */
.crumb { font-size: var(--step--1); color: var(--text-mute); margin-bottom: var(--space-4); letter-spacing: 0.02em; }
.crumb a { color: var(--text-soft); text-decoration: none; }
.crumb a:hover { color: var(--primary); }
.mod-head { padding: var(--space-6) 0 var(--space-2); border-bottom: 1px solid var(--border); }
.mod-head h1 { font-size: var(--step-3); line-height: 1.08; margin-top: var(--space-2); }
.progress-line { height: 5px; background: var(--surface-2); border-radius: 99px; margin-top: var(--space-5); overflow: hidden; }
.progress-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--clay), var(--gold)); border-radius: 99px; }

/* ---------- Pager ---------- */
.pager { display: grid; gap: var(--space-3); grid-template-columns: 1fr 1fr; margin: var(--space-8) 0 0; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .15s ease, transform .1s ease; }
.pager a:hover { border-color: var(--primary); transform: translateY(-2px); color: var(--text); }
.pager small { color: var(--text-mute); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.pager b { font-family: var(--font-serif); font-weight: 500; font-size: var(--step-0); color: var(--text); }
.pager .next { text-align: right; }
.pager .disabled { opacity: .45; pointer-events: none; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
details.qa { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
details.qa summary { padding: var(--space-4) var(--space-5); font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: "+"; color: var(--primary); font-size: 1.4rem; font-weight: 400; line-height: 1; }
details.qa[open] summary::after { content: "–"; }
details.qa .qa__body { padding: 0 var(--space-5) var(--space-5); color: var(--text-soft); }
details.qa .qa__body > *:last-child { margin-bottom: 0; }

/* ---------- Glossary ---------- */
.glossary { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.glossary dt { font-weight: 600; color: var(--text); font-size: var(--step-1); }
.glossary dd { margin: var(--space-1) 0 var(--space-4); color: var(--text-soft); }
.gloss-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: var(--space-4) 0; }
.gloss-nav a { font-family: var(--font-mono); padding: .2rem .55rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.82rem; color: var(--text-soft); }
.gloss-nav a:hover { border-color: var(--primary); color: var(--primary); }
.gloss-group h2 { scroll-margin-top: 80px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--border); margin-top: var(--space-8); padding: var(--space-7) 0; background: var(--bg-soft); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: var(--space-5); justify-content: space-between; align-items: center; }
.site-foot p { color: var(--text-mute); font-size: var(--step--1); }
.site-foot nav { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.site-foot a { color: var(--text-soft); text-decoration: none; font-weight: 600; font-size: var(--step--1); }
.site-foot a:hover { color: var(--primary); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: .25rem .7rem; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: var(--primary-soft); color: var(--text); }
.pill--time { background: var(--surface-2); color: var(--text-soft); }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.muted { color: var(--text-mute); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.big-emoji { font-size: 2.6rem; line-height: 1; }
.divider-soft { height: 1px; background: var(--border); margin: var(--space-6) 0; border: 0; }

/* ============================================================
   Get-a-VPS: referral CTA, plan spotlight, build grid
   ============================================================ */
.btn-getvps { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: var(--step--1); text-decoration: none; box-shadow: var(--clay-glow); white-space: nowrap; line-height: 1; }
.btn-getvps:hover { background: var(--primary-hover); color: var(--on-primary); }
@media (max-width: 600px) { .brand__name { display: none; } .topbar__inner { gap: var(--space-2); } .btn-modules { padding: .45rem .55rem; } }

.planbox { border: 1.5px solid var(--primary); border-radius: var(--radius-lg); padding: var(--space-6); background: var(--surface); box-shadow: var(--clay-glow); position: relative; overflow: hidden; }
.planbox::before { content: ""; position: absolute; inset: auto -20% -60% -20%; height: 280px; z-index: 0; background: radial-gradient(50% 60% at 30% 0%, color-mix(in oklab, var(--clay) 14%, transparent), transparent 70%); }
.planbox > * { position: relative; z-index: 1; }
.planbox__tag { display: inline-flex; align-items: center; gap: 6px; padding: .3rem .7rem; border-radius: 999px; background: var(--primary-soft); color: var(--clay-text); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
:root[data-theme="dark"] .planbox__tag { color: var(--salmon); }
.planbox__name { font-size: var(--step-2); font-weight: 500; margin-top: var(--space-3); }
.planbox__price { font-family: var(--font-serif); font-size: var(--step-3); font-weight: 600; letter-spacing: -0.02em; line-height: 1; margin-top: var(--space-1); }
.planbox__price small { font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500; color: var(--text-mute); }
.spec-list { list-style: none; padding: 0; margin: var(--space-5) 0; display: grid; gap: 0; }
.spec-list li { display: flex; align-items: baseline; gap: var(--space-3); padding: .65rem 0; border-bottom: 1px solid var(--border); }
.spec-list li:last-child { border-bottom: 0; }
.spec-list .spec-ico { font-size: 1.15rem; width: 1.5rem; text-align: center; }
.spec-list b { font-weight: 700; }
.spec-list .spec-note { color: var(--text-soft); font-size: var(--step--1); margin-left: auto; text-align: right; }

.build-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: var(--space-5); }
.build-card { padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.build-card .bc-ico { font-size: 1.7rem; }
.build-card h3 { font-size: var(--step-0); font-weight: 500; margin: var(--space-2) 0 var(--space-1); }
.build-card p { color: var(--text-soft); font-size: var(--step--1); line-height: 1.55; margin: 0; }
.build-badge { display: inline-flex; align-items: center; gap: 6px; padding: .25rem .7rem; border-radius: 999px; background: var(--primary-soft); color: var(--clay-text); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
:root[data-theme="dark"] .build-badge { color: var(--salmon); }
.cta-band { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); background: var(--bg-soft); text-align: center; margin: var(--space-6) 0; }

/* ============================================================
   MOTION LAYER — scroll reveal, hero load, scenes, micro-fx
   All CSS + a tiny IntersectionObserver. Zero dependencies.
   Hidden states gated on html.js so no-JS shows everything.
   ============================================================ */
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 0 1px #d9775759, 0 10px 30px -14px #d9775766; } 50% { box-shadow: 0 0 0 1px #d9775773, 0 16px 40px -12px #d9775799; } }
@keyframes spinSlow { to { transform: rotate(360deg); } }

/* scroll reveal (auto-applied to content blocks via JS) */
html.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--rd, 0ms); }
html.js .reveal.rv-left { transform: translateX(-26px); }
html.js .reveal.rv-right { transform: translateX(26px); }
html.js .reveal.rv-scale { transform: scale(.93); }
html.js .reveal.is-in { opacity: 1; transform: none; }

/* hero elements animate in on load */
html.js .hero .pill-badge { animation: rise .7s .04s both; }
html.js .hero h1 { animation: rise .8s .12s both; }
html.js .hero p.lead { animation: rise .8s .22s both; }
html.js .hero__cta { animation: rise .8s .32s both; }
html.js .hero + * , html.js .hero ~ p { }
html.js .hero__meta, html.js .hero .wrap > p { animation: rise .8s .42s both; }

/* animated gradient shimmer on emphasis text */
.grad {
  background: linear-gradient(105deg, var(--clay) 0%, var(--salmon) 35%, var(--blue) 70%, var(--clay) 100%);
  background-size: 220% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
html.js .grad { animation: shimmer 7s linear infinite; }

/* floating hero glow blobs (decorative) */
.hero { overflow: clip; }
.hero__glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__glow i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; }
.hero__glow i:nth-child(1) { width: 340px; height: 340px; left: -60px; top: -40px; background: color-mix(in oklab, var(--clay) 45%, transparent); }
.hero__glow i:nth-child(2) { width: 300px; height: 300px; right: 4%; top: -60px; background: color-mix(in oklab, var(--blue) 40%, transparent); }
html.js .hero__glow i { animation: floaty 9s ease-in-out infinite; }
html.js .hero__glow i:nth-child(2) { animation-duration: 11s; animation-direction: reverse; }

/* primary CTA gentle pulse (hero + planbox only) */
html.js .hero__cta .btn--primary, html.js .planbox .btn--primary { animation: pulseGlow 3.4s ease-in-out infinite; }
.btn { transition: transform .08s ease, background .15s ease, box-shadow .18s ease, border-color .15s ease; }
.btn--primary:hover, .btn-getvps:hover { transform: translateY(-1px) scale(1.02); }

/* animated module-progress fill (set --pw inline, JS animates) */
html.js .progress-line span { width: 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1) .2s; }
html.js .progress-line span.fill { width: var(--pw); }

/* count-up numerals use tabular figures so width doesn't jump */
[data-countup], .stat__num { font-variant-numeric: tabular-nums; }

/* ---------- Stats band ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-top: var(--space-6); }
.stat { text-align: center; padding: var(--space-5) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.stat__num { font-family: var(--font-serif); font-weight: 600; font-size: var(--step-3); line-height: 1; color: var(--clay-text); letter-spacing: -0.02em; }
:root[data-theme="dark"] .stat__num { color: var(--salmon); }
.stat__label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mute); margin-top: var(--space-2); }
@media (max-width: 680px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   ANIMATED CONCEPT SCENES ("how it works in 5 moves")
   ============================================================ */
.moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.move { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: var(--space-5); box-shadow: var(--shadow-sm); overflow: hidden; }
.move__stage { height: 108px; border-radius: var(--radius); background: #201f1b; position: relative; overflow: hidden; margin-bottom: var(--space-4); border: 1px solid #ffffff12; }
:root[data-theme="dark"] .move__stage { background: #131210; }
.move__n { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--clay-text); font-weight: 600; }
:root[data-theme="dark"] .move__n { color: var(--salmon); }
.move h3 { font-size: var(--step-0); font-weight: 500; margin: var(--space-1) 0; }
.move p { color: var(--text-soft); font-size: var(--step--1); line-height: 1.5; margin: 0; }

/* shared stage bits */
.stg-grid { position: absolute; inset: 0; background-image: linear-gradient(#ffffff0d 1px, transparent 1px), linear-gradient(90deg, #ffffff0d 1px, transparent 1px); background-size: 18px 18px; opacity: .5; }
.stg-mono { font-family: var(--font-mono); font-size: 0.72rem; color: #eceadf; }

/* Move 1 — server boots: rack + power light + rising bars */
.sc-rent { position: absolute; inset: 0; display: grid; place-items: center; }
.sc-rent .box { width: 62px; height: 58px; border-radius: 8px; background: linear-gradient(160deg,#2c2a26,#201f1b); border: 1px solid #ffffff1f; position: relative; box-shadow: 0 6px 16px #0006; }
.sc-rent .led { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #55524a; }
.scene.is-in .sc-rent .led { background: var(--sage); box-shadow: 0 0 8px var(--sage); animation: blink 1.1s steps(1) 2; }
.sc-rent .bars { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 4px; align-items: flex-end; height: 20px; }
.sc-rent .bars i { flex: 1; background: var(--clay); border-radius: 2px; height: 10%; }
.scene.is-in .sc-rent .bars i { animation: bootBar .9s ease-out forwards; }
.scene.is-in .sc-rent .bars i:nth-child(2) { animation-delay: .1s; } .scene.is-in .sc-rent .bars i:nth-child(3) { animation-delay: .2s; } .scene.is-in .sc-rent .bars i:nth-child(4) { animation-delay: .3s; } .scene.is-in .sc-rent .bars i:nth-child(5) { animation-delay: .4s; }
@keyframes bootBar { to { height: var(--h, 70%); } }

/* Move 2 — terminal types ssh */
.sc-conn { position: absolute; inset: 0; padding: 12px 14px; }
.sc-conn .line { white-space: nowrap; overflow: hidden; width: 0; }
.scene.is-in .sc-conn .line { animation: typing 1.4s steps(24) .2s forwards; }
.sc-conn .cur { color: var(--clay); }
html.js .sc-conn .cur { animation: blink 1s steps(1) infinite; }
@keyframes typing { to { width: 100%; } }

/* Move 3 — code lines draw in + spark */
.sc-build { position: absolute; inset: 0; padding: 12px 14px; display: grid; align-content: center; gap: 6px; }
.sc-build .cl { height: 7px; border-radius: 3px; background: #ffffff1a; transform: scaleX(0); transform-origin: left; }
.sc-build .cl.a { background: var(--clay); } .sc-build .cl.b { background: var(--blue); } .sc-build .cl.c { background: var(--gold); }
.scene.is-in .sc-build .cl { animation: drawLine .5s ease-out forwards; }
.scene.is-in .sc-build .cl:nth-child(2){animation-delay:.15s} .scene.is-in .sc-build .cl:nth-child(3){animation-delay:.3s} .scene.is-in .sc-build .cl:nth-child(4){animation-delay:.45s} .scene.is-in .sc-build .cl:nth-child(5){animation-delay:.6s}
@keyframes drawLine { to { transform: scaleX(1); } }
.sc-build .spark { position: absolute; right: 12px; top: 10px; font-size: 1.1rem; opacity: 0; }
.scene.is-in .sc-build .spark { animation: pop .5s .7s both; }
@keyframes pop { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }

/* Move 4 — go live: domain -> server -> padlock, traveling dot */
.sc-live { position: absolute; inset: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 0 14px; gap: 8px; }
.sc-live .chip { font-family: var(--font-mono); font-size: 0.62rem; color: #eceadf; background: #ffffff14; border: 1px solid #ffffff24; border-radius: 6px; padding: 4px 6px; text-align: center; }
.sc-live .wire { position: relative; height: 2px; background: #ffffff24; border-radius: 2px; }
.sc-live .wire::after { content: ""; position: absolute; top: -2px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 8px var(--clay); }
.scene.is-in .sc-live .wire::after { animation: travel 1.6s ease-in-out .3s infinite; }
@keyframes travel { 0% { left: 0; } 100% { left: calc(100% - 6px); } }
.sc-live .lock { font-size: 1.1rem; filter: grayscale(1); opacity: .5; }
.scene.is-in .sc-live .lock { animation: lockIn .4s 1.4s both; }
@keyframes lockIn { to { filter: none; opacity: 1; transform: scale(1.1); } }

/* Move 5 — keep alive: crash then auto-restart loop */
.sc-alive { position: absolute; inset: 0; display: grid; place-items: center; }
.sc-alive .pulse { width: 68%; height: 26px; display: flex; align-items: center; }
.sc-alive svg { width: 100%; height: 26px; }
.sc-alive path { stroke: var(--sage); stroke-width: 2.5; fill: none; stroke-dasharray: 220; stroke-dashoffset: 220; }
.scene.is-in .sc-alive path { animation: heartbeat 2.2s linear infinite; }
@keyframes heartbeat { to { stroke-dashoffset: -220; } }
.sc-alive .tag { position: absolute; bottom: 8px; font-family: var(--font-mono); font-size: 0.6rem; color: var(--sage); letter-spacing: .08em; }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  html.js .hero .pill-badge, html.js .hero h1, html.js .hero p.lead, html.js .hero__cta, html.js .hero__meta, html.js .hero .wrap > p { animation: none; }
  html.js .grad, html.js .hero__glow i, html.js .hero__cta .btn--primary, html.js .planbox .btn--primary,
  html.js .sc-rent .bars i, html.js .sc-conn .line, html.js .sc-conn .cur, html.js .sc-build .cl, html.js .sc-build .spark,
  html.js .sc-live .wire::after, html.js .sc-live .lock, html.js .sc-alive path, html.js .sc-rent .led { animation: none !important; }
  html.js .sc-conn .line { width: 100%; } html.js .sc-build .cl { transform: scaleX(1); } html.js .progress-line span { width: var(--pw); transition: none; }
}

/* ============================================================
   STICKY OFFER BAR (injected on every page by JS)
   ============================================================ */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  transform: translateY(120%); transition: transform .35s cubic-bezier(.2,.7,.2,1);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(12px); border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px #1f1e1d14;
}
.sticky-bar.show { transform: none; }
.sticky-bar__inner { width: min(100% - 2rem, var(--page)); margin-inline: auto; display: flex; align-items: center; gap: var(--space-4); padding: .7rem 0; }
.sticky-bar__txt { display: flex; flex-direction: column; line-height: 1.2; }
.sticky-bar__txt b { font-family: var(--font-serif); font-weight: 500; font-size: 1.02rem; }
.sticky-bar__txt span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-mute); letter-spacing: .02em; }
.sticky-bar__spacer { flex: 1; }
.sticky-bar__cta { display: flex; gap: var(--space-2); align-items: center; }
.sticky-bar .x { background: none; border: 0; color: var(--text-mute); cursor: pointer; font-size: 1.1rem; padding: .3rem .5rem; border-radius: 8px; }
.sticky-bar .x:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 640px) { .sticky-bar__txt span { display: none; } .sticky-bar__cta .btn { padding: .6rem .9rem; font-size: var(--step--1); } }

/* ============================================================
   EMAIL OPT-IN (Power Kit + updates)
   ============================================================ */
.optin { position: relative; overflow: hidden; border: 1.5px solid var(--primary); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--clay-glow); padding: clamp(1.5rem, 3vw, 2.75rem); }
.optin::before { content: ""; position: absolute; inset: -40% -10% auto -10%; height: 240px; z-index: 0; background: radial-gradient(50% 60% at 30% 0, color-mix(in oklab, var(--clay) 16%, transparent), transparent 70%); }
.optin > * { position: relative; z-index: 1; }
.optin h2 { font-size: var(--step-2); }
.optin p { color: var(--text-soft); max-width: 52ch; margin-top: var(--space-2); }
.optin__form { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-5); max-width: 520px; }
.optin__form input[type=email] { flex: 1; min-width: 220px; padding: .8rem 1rem; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; font-size: var(--step-0); }
.optin__form input[type=email]:focus-visible { outline: 2px solid var(--focus); border-color: var(--primary); }
.optin__note { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-mute); margin-top: var(--space-3); }
.optin__ok { display: none; margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--radius); background: color-mix(in oklab, var(--sage) 12%, var(--surface)); border: 1px solid color-mix(in oklab, var(--sage) 40%, var(--border)); color: var(--text); font-weight: 500; }
.optin.done .optin__form, .optin.done .optin__note { display: none; }
.optin.done .optin__ok { display: block; animation: rise .5s both; }

/* Auto-reveal targets (hidden at paint under html.js; JS toggles .is-in). */
html.js body :is(.section__title, .section__intro, .card, .modcard, .build-card, .callout,
  .objective, .recap, .planbox, .faq details, .steps > li, .cta-band, .scene, .move,
  .pager a, .gloss-group, .article > .article h2, .code, .stats, .stat, .optin) {
  opacity: 0; transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--rd, 0ms);
}
html.js body :is(.section__title, .section__intro, .card, .modcard, .build-card, .callout,
  .objective, .recap, .planbox, .faq details, .steps > li, .cta-band, .scene, .move,
  .pager a, .gloss-group, .article > .article h2, .code, .stats, .stat, .optin).is-in {
  opacity: 1; transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.js body :is(.section__title,.section__intro,.card,.modcard,.build-card,.callout,.objective,.recap,.planbox,.faq details,.steps>li,.cta-band,.scene,.move,.pager a,.gloss-group,.article h2,.code,.stats,.stat,.optin) { opacity: 1 !important; transform: none !important; transition: none; }
}
