:root {
  --paper: oklch(0.972 0.012 80);
  --paper-deep: oklch(0.952 0.016 76);
  --paper-shade: oklch(0.928 0.020 74);
  --ink: oklch(0.20 0.018 268);
  --ink-soft: oklch(0.32 0.018 268);
  --mute: oklch(0.50 0.012 268);
  --rule: oklch(0.85 0.018 78);
  --rule-soft: oklch(0.90 0.014 78);
  --accent: oklch(0.46 0.155 28);
  --accent-deep: oklch(0.36 0.13 25);
  --accent-soft: oklch(0.62 0.085 28);
  --highlight: oklch(0.94 0.06 88);
  --code-bg: oklch(0.935 0.014 76);
  --code-ink: oklch(0.24 0.022 268);
  --browser: oklch(0.65 0.13 235);
  --terminal: oklch(0.50 0.10 150);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.1875rem;
  line-height: 1.65;
  font-feature-settings: 'liga' on, 'kern' on, 'onum' on, 'calt' on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.15 0 0 0 0 0.12 0 0 0 0 0.10 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.32; mix-blend-mode: multiply;
}

.atmosphere {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 90% 70% at 15% -5%, oklch(0.98 0.025 60 / 0.7), transparent 65%),
    radial-gradient(ellipse 70% 80% at 95% 105%, oklch(0.95 0.04 28 / 0.35), transparent 70%);
}

main, header, footer, .topbar { position: relative; z-index: 1; }

/* ====== TOP PROGRESS BAR ====== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: oklch(0.972 0.012 80 / 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 1.5rem;
}

.topbar-inner {
  max-width: 78rem; margin: 0 auto;
  display: flex; align-items: center; gap: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mute);
}

.topbar-brand {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 24, 'SOFT' 60, 'WONK' 1;
  font-style: italic; font-weight: 400; font-size: 0.95rem;
  color: var(--ink); text-decoration: none;
  letter-spacing: -0.005em;
}

.topbar-brand:hover { color: var(--accent); }

.steps-track {
  flex: 1; display: flex; gap: 0.4rem; align-items: center;
}

.step-dot {
  flex: 1; height: 3px; background: var(--rule);
  position: relative; transition: background 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.step-dot.done { background: var(--accent); }
.step-dot.current { background: var(--ink); }

.steps-label {
  white-space: nowrap;
  font-weight: 500; color: var(--ink);
}

@media (max-width: 700px) {
  .topbar-inner { gap: 1rem; }
  .topbar-brand { font-size: 0.85rem; }
  .steps-track { gap: 0.25rem; }
}

/* ====== HERO ====== */
.hero {
  padding: 5rem 2rem 4rem;
  max-width: 64rem;
  margin: 0 auto;
}

.hero-rule {
  width: 4rem; height: 1px;
  background: var(--accent);
  margin-bottom: 2rem;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent);
  font-weight: 500; display: block; margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
  font-weight: 350;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 0.96; letter-spacing: -0.025em;
  margin-bottom: 1.75rem; color: var(--ink); max-width: 18ch;
}

.hero h1 em {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 80, 'WONK' 1;
  color: var(--accent); font-weight: 350;
}

.hero .lede {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 50;
  font-weight: 300; font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  line-height: 1.45; color: var(--ink-soft);
  max-width: 36rem; margin-bottom: 2.5rem;
}

.hero-meta {
  display: flex; gap: 2.5rem; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--mute);
  padding-top: 1.5rem; border-top: 1px solid var(--rule);
}

.hero-meta div strong {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 30, 'WONK' 1;
  color: var(--ink); font-weight: 400; font-size: 1.4rem;
  display: block; margin-top: 0.4rem; letter-spacing: -0.01em;
}

/* ====== MAIN ARTICLE ====== */
main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  flex: 1;
}

article p {
  margin-bottom: 1.4rem;
  max-width: 38rem;
}

article h2 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 72, 'SOFT' 40, 'WONK' 1;
  font-weight: 400;
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  line-height: 1.1; letter-spacing: -0.02em;
  margin: 4rem 0 1.5rem; color: var(--ink); max-width: 26ch;
}

article h3 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 30, 'WONK' 1;
  font-weight: 500;
  font-size: 1.5rem; line-height: 1.25;
  margin: 2.5rem 0 1rem; color: var(--ink);
  letter-spacing: -0.01em; max-width: 30ch;
}

article h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent);
  font-weight: 500; margin: 2rem 0 0.75rem;
}

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

a {
  color: var(--accent); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 0.15em;
  text-decoration-color: oklch(0.46 0.155 28 / 0.4);
  transition: text-decoration-color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

a:hover { text-decoration-color: var(--accent); }

article ul { margin: 0 0 1.4rem 0; padding-left: 0; list-style: none; max-width: 42rem; }
article ul li { padding-left: 1.4rem; position: relative; margin-bottom: 0.6rem; }
article ul li::before {
  content: ""; position: absolute; left: 0; top: 0.7em;
  width: 0.5rem; height: 1px; background: var(--accent);
}

article ol { padding-left: 0; counter-reset: olist; list-style: none; max-width: 42rem; margin-bottom: 1.4rem; }
article ol > li {
  counter-increment: olist; padding-left: 2.5rem; position: relative;
  margin-bottom: 0.7rem; line-height: 1.55;
}
article ol > li::before {
  content: counter(olist, decimal-leading-zero);
  position: absolute; left: 0; top: 0.05em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; color: var(--accent);
  font-weight: 500; letter-spacing: 0.04em;
}

/* ====== COACH (large coaching text) ====== */
.coach {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 60, 'SOFT' 50, 'WONK' 1;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  line-height: 1.35;
  color: var(--ink);
  max-width: 42rem;
  margin: 3rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--accent);
}

.coach.big {
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-style: normal;
  font-weight: 350;
  font-variation-settings: 'opsz' 96, 'SOFT' 30, 'WONK' 1;
  line-height: 1.15;
  letter-spacing: -0.015em;
  border-left: none;
  padding-left: 0;
  margin: 3rem 0 2.5rem;
}

.coach.big em {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: 'opsz' 96, 'SOFT' 80, 'WONK' 1;
}

/* ====== CODE ====== */
pre {
  background: var(--code-bg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem; line-height: 1.6;
  padding: 1.5rem 1.85rem; margin: 2rem 0;
  overflow-x: auto; color: var(--code-ink);
  border-left: 2px solid var(--accent);
  max-width: 48rem; white-space: pre;
}
pre code { font-family: inherit; }
p code, li code, small code, td code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em; background: var(--code-bg);
  padding: 0.1em 0.4em; color: var(--code-ink); font-weight: 500;
}

/* ====== ROUTE TOGGLE ====== */
.route-toggle {
  display: inline-flex;
  background: var(--paper-deep);
  padding: 0.3rem; margin: 1.5rem 0 2rem;
  border: 1px solid var(--rule);
}
.route-toggle button {
  background: transparent; border: none;
  padding: 0.6rem 1.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--mute);
  cursor: pointer; transition: all 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
.route-toggle button:hover { color: var(--ink); }
.route-toggle button.active { background: var(--ink); color: var(--paper); }

.route-only { display: none; }
body.route-terminal .route-terminal-only { display: block; }
body.route-browser .route-browser-only { display: block; }

.route-banner {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 500;
  margin: 2rem 0 0.75rem; display: inline-block;
  padding: 0.3rem 0.7rem;
}
.route-banner.browser {
  background: oklch(0.65 0.13 235 / 0.12);
  color: var(--browser);
}
.route-banner.terminal {
  background: oklch(0.50 0.10 150 / 0.12);
  color: var(--terminal);
}

/* ====== CHROME-STEP LIST (Browser route specific) ====== */
.chrome-steps {
  list-style: none; padding: 0; margin: 1rem 0 2.5rem;
  max-width: 48rem; counter-reset: cstep;
}
.chrome-steps > li {
  counter-increment: cstep;
  padding: 1.1rem 0 1.1rem 3.5rem;
  position: relative;
  border-bottom: 1px dotted var(--rule);
  font-size: 1.075rem;
  line-height: 1.55;
}
.chrome-steps > li::before { display: none; }
.chrome-steps > li > .step-num {
  position: absolute; left: 0; top: 1.05rem;
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--browser);
  background: oklch(0.65 0.13 235 / 0.06);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 24, 'SOFT' 30, 'WONK' 1;
  font-weight: 500; font-size: 1rem;
  color: var(--browser);
}
.chrome-steps > li > .step-num::before {
  content: counter(cstep, decimal-leading-zero);
}

.chrome-steps strong {
  background: var(--highlight);
  padding: 0.05em 0.35em;
  font-weight: 600;
}

/* ====== ACCOUNT CARDS ====== */
.accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
}
.account-card {
  border: 1px solid var(--rule);
  padding: 1.5rem;
  background: var(--paper-deep);
  display: flex; flex-direction: column;
  gap: 0.75rem;
}
.account-card .name {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 30, 'WONK' 1;
  font-weight: 500; font-size: 1.4rem;
  letter-spacing: -0.01em; color: var(--ink);
}
.account-card .why {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-soft);
  flex: 1;
}
.account-card .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mute);
}
.account-card .signup-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.06em;
  background: var(--ink); color: var(--paper);
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  text-align: center;
  transition: background 200ms;
  text-transform: lowercase;
}
.account-card .signup-link:hover { background: var(--accent); text-decoration: none; }

.account-card .ack {
  border-top: 1px dotted var(--rule);
  padding-top: 0.75rem;
  display: flex; align-items: center; gap: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}
.acct-check {
  width: 1.2rem; height: 1.2rem; border: 1px solid var(--rule);
  background: transparent; cursor: pointer; padding: 0;
  flex-shrink: 0; position: relative;
  transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.acct-check:hover { border-color: var(--accent); }
.acct-check.on { background: var(--accent); border-color: var(--accent); }
.acct-check.on::after {
  content: ""; position: absolute; left: 0.3rem; top: 0.05rem;
  width: 0.35rem; height: 0.65rem;
  border: solid var(--paper); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.account-card.done { opacity: 0.55; }
.account-card.done .name { text-decoration: line-through; }

/* ====== PERSONA BUILDER ====== */
.builder {
  background: var(--paper-deep);
  padding: 2.5rem 2rem;
  margin: 3rem 0; max-width: 48rem;
  border-top: 2px solid var(--accent);
}
.builder-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
  display: block; margin-bottom: 0.4rem;
}
.builder-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 30, 'WONK' 1;
  font-weight: 400; font-size: 1.6rem;
  line-height: 1.1; margin: 0 0 1.5rem 0; color: var(--ink);
}
.builder-row {
  display: grid; grid-template-columns: 7rem 1fr;
  gap: 1.5rem; align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px dotted var(--rule);
}
.builder-row:last-of-type { border-bottom: none; }
.builder-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mute);
}
.builder-input {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.4rem 0;
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 24, 'SOFT' 30;
  font-size: 1.05rem; font-weight: 400;
  color: var(--ink); outline: none;
  transition: border-color 200ms;
}
.builder-input:focus { border-bottom-color: var(--accent); }
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  background: transparent; border: 1px solid var(--rule);
  padding: 0.35rem 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.04em;
  text-transform: lowercase; color: var(--ink-soft);
  cursor: pointer; transition: all 200ms;
}
.pill:hover { border-color: var(--accent-soft); color: var(--ink); }
.pill.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.builder-output { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.builder-output-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.75rem;
  display: block; font-weight: 500;
}
.builder-output pre {
  margin: 0; background: var(--paper);
  border-left: 2px solid var(--accent);
  font-size: 0.78rem; white-space: pre-wrap;
}

/* ====== TABLES ====== */
.usage-table {
  margin: 2rem 0 3rem; width: 100%;
  max-width: 56rem; border-collapse: collapse;
  font-size: 0.98rem;
}
.usage-table thead tr {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.usage-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink);
  font-weight: 500; padding: 0.85rem 1rem; text-align: left;
}
.usage-table th:not(:first-child),
.usage-table td:not(:first-child) {
  text-align: right; font-variant-numeric: tabular-nums;
}
.usage-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px dotted var(--rule);
  font-family: 'EB Garamond', Georgia, serif;
  color: var(--ink-soft);
}
.usage-table td:last-child {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 24, 'SOFT' 30, 'WONK' 1;
  font-weight: 500; color: var(--ink);
}

/* ====== COST HEADLINE ====== */
.cost-headline {
  display: grid; grid-template-columns: auto 1fr;
  gap: 2.5rem; align-items: center;
  margin: 2.5rem 0 1.5rem; max-width: 56rem;
  padding: 2rem 2.5rem;
  background: var(--paper-deep);
  border-top: 2px solid var(--accent);
}
.cost-headline-num {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
  font-weight: 350; font-size: clamp(3.5rem, 8vw, 5.5rem);
  line-height: 0.85; color: var(--ink);
  letter-spacing: -0.04em; font-style: italic;
}
.cost-headline-meta span {
  display: block; font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 24, 'SOFT' 30;
  font-weight: 400; font-size: 1.15rem;
  line-height: 1.3; color: var(--ink); margin-bottom: 0.3rem;
}
.cost-headline-meta small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--mute); font-style: normal;
}

@media (max-width: 720px) {
  .cost-headline { grid-template-columns: 1fr; gap: 1rem; padding: 1.5rem; }
  .cost-headline-num { font-size: 3.5rem; }
}

/* ====== ARCHETYPES ====== */
.archetypes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem 2rem;
  margin: 2rem 0 3rem;
  max-width: 64rem;
}
.archetype { padding: 1.25rem 0; border-top: 1px solid var(--rule); }
.archetype .name {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 60, 'WONK' 1;
  font-weight: 400; font-style: italic;
  font-size: 1.4rem; line-height: 1.1;
  color: var(--accent); margin-bottom: 0.4rem;
}
.archetype .desc { font-size: 0.93rem; line-height: 1.5; color: var(--ink-soft); margin-bottom: 0.6rem; }
.archetype .voice {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mute);
}

/* ====== PULL QUOTE / WARNING ====== */
.pullquote {
  margin: 2.5rem 0; padding: 0 0 0 1.75rem;
  border-left: 2px solid var(--accent);
  max-width: 42rem;
}
.pullquote .label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.7rem;
  display: block; font-weight: 500;
}
.pullquote p {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 60, 'WONK' 1;
  font-weight: 400; font-style: italic;
  font-size: 1.3rem; line-height: 1.4; color: var(--ink);
  margin-bottom: 0;
}

/* ====== PREV/NEXT NAV ====== */
.page-nav {
  max-width: 64rem; margin: 4rem auto 5rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.page-nav a {
  text-decoration: none; padding: 1.5rem 1.75rem;
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: all 250ms cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--ink);
}
.page-nav a:hover {
  background: var(--paper-shade);
  border-top-color: var(--accent);
  text-decoration: none;
}
.page-nav .nav-dir {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--mute);
}
.page-nav .nav-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 30, 'WONK' 1;
  font-weight: 500; font-size: 1.25rem;
  line-height: 1.15; color: var(--ink);
  letter-spacing: -0.01em;
}
.page-nav .next { text-align: right; }
.page-nav .prev:only-child { grid-column: 1; }
.page-nav .next:only-child { grid-column: 2; }

@media (max-width: 600px) {
  .page-nav { grid-template-columns: 1fr; }
}

/* ====== FOOTER ====== */
footer {
  margin-top: auto;
  border-top: 1px solid var(--rule);
  padding: 2.5rem 2rem;
}
.foot-inner {
  max-width: 78rem; margin: 0 auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mute);
  display: flex; justify-content: space-between; gap: 2rem;
  flex-wrap: wrap;
}

/* ====== PROGRESS WIDGET ====== */
.progress-widget {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 60;
  background: var(--paper-deep); border: 1px solid var(--rule);
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 8px 32px oklch(0.20 0.018 268 / 0.08), 0 2px 8px oklch(0.20 0.018 268 / 0.06);
  transition: all 350ms cubic-bezier(0.22, 1, 0.36, 1);
  max-width: calc(100vw - 3rem);
}
.progress-pill {
  padding: 0.85rem 1.1rem; display: flex;
  align-items: center; gap: 0.85rem; cursor: pointer;
  transition: background 200ms;
}
.progress-pill:hover { background: var(--paper-shade); }
.progress-bar {
  width: 5rem; height: 4px; background: var(--rule);
  position: relative; overflow: hidden;
}
.progress-bar-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--accent); width: 0%;
  transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-text {
  font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink); font-weight: 500;
}
.progress-toggle {
  background: transparent; border: none; padding: 0;
  font-family: inherit; font-size: 0.95rem;
  color: var(--mute); cursor: pointer; margin-left: 0.3rem;
}
.progress-panel {
  display: none; padding: 1.25rem 1.4rem 1.4rem;
  border-top: 1px solid var(--rule);
  width: 22rem; max-width: 88vw;
}
.progress-widget.expanded .progress-panel { display: block; }
.progress-panel-label {
  font-size: 0.62rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.85rem; font-weight: 500;
}
.progress-checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.progress-checklist li {
  padding: 0.5rem 0; display: flex; align-items: center; gap: 0.7rem;
  border-bottom: 1px dotted var(--rule);
}
.progress-checklist li:last-child { border-bottom: none; }
.progress-checkbox {
  width: 1rem; height: 1rem;
  border: 1px solid var(--rule); cursor: pointer;
  flex-shrink: 0; position: relative;
  background: transparent; padding: 0;
}
.progress-checkbox.on { background: var(--accent); border-color: var(--accent); }
.progress-checkbox.on::after {
  content: ""; position: absolute; left: 0.22rem; top: 0.05rem;
  width: 0.28rem; height: 0.5rem;
  border: solid var(--paper); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.progress-checklist a {
  flex: 1; font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.92rem; letter-spacing: 0;
  text-decoration: none; color: var(--ink);
  text-transform: none;
}
.progress-checklist a:hover { color: var(--accent); }
.progress-checklist li.done a { color: var(--mute); text-decoration: line-through; }
.progress-checklist li.current a { color: var(--accent); font-weight: 600; }

.progress-actions { display: flex; gap: 0.75rem; }
.progress-actions button {
  background: transparent; border: 1px solid var(--rule);
  padding: 0.5rem 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
  cursor: pointer; transition: all 200ms;
}
.progress-actions button:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 720px) {
  .progress-widget { bottom: 1rem; right: 1rem; }
  .progress-panel { width: calc(100vw - 2rem); }
}

/* ====== REVEAL ====== */
.reveal {
  opacity: 0; transform: translateY(12px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .hero { padding: 3rem 1.5rem 2.5rem; }
  main { padding: 0 1.5rem 3rem; }
  .page-nav { padding: 0 1.5rem; margin-top: 3rem; }
  pre { font-size: 0.74rem; padding: 1rem 1.25rem; }
  .chrome-steps > li { padding-left: 3rem; font-size: 1rem; }
  .chrome-steps > li > .step-num { width: 2rem; height: 2rem; font-size: 0.85rem; }
  .builder-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .builder-key { padding-top: 0.5rem; }
}

/* ====== PASSWORD GATE ====== */
html.locked body > *:not(#gate) { display: none !important; }

#gate {
  position: fixed; inset: 0; z-index: 200;
  background: var(--paper);
  display: none;
  align-items: center; justify-content: center;
  padding: 2rem;
}

html.locked #gate { display: flex; }

#gate::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 15% -5%, oklch(0.98 0.025 60 / 0.7), transparent 65%),
    radial-gradient(ellipse 70% 80% at 95% 105%, oklch(0.95 0.04 28 / 0.35), transparent 70%);
  pointer-events: none;
}

#gate::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.15 0 0 0 0 0.12 0 0 0 0 0.10 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.32; mix-blend-mode: multiply; pointer-events: none;
}

.gate-card {
  position: relative; z-index: 1;
  max-width: 28rem; width: 100%;
  text-align: left;
}

.gate-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent);
  font-weight: 500; display: block; margin-bottom: 1.5rem;
}

.gate-card h1 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
  font-weight: 350;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 0.96; letter-spacing: -0.025em;
  margin-bottom: 1rem; color: var(--ink);
}

.gate-card h1 em {
  font-style: italic; color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 80, 'WONK' 1;
}

.gate-card p {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 24, 'SOFT' 50;
  font-weight: 300; font-style: italic;
  font-size: 1.1rem; line-height: 1.5;
  color: var(--ink-soft); margin-bottom: 2rem;
}

.gate-form {
  display: flex; flex-direction: column;
  gap: 1rem; margin-top: 1rem;
}

.gate-input {
  background: transparent; border: none;
  border-bottom: 1px solid var(--ink);
  padding: 0.6rem 0;
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 30;
  font-size: 1.4rem; font-weight: 400;
  color: var(--ink); outline: none;
  transition: border-color 200ms;
}

.gate-input:focus { border-bottom-color: var(--accent); }
.gate-input::placeholder {
  color: var(--mute); font-style: italic;
  font-size: 1.1rem;
}

.gate-submit {
  background: var(--ink); color: var(--paper);
  border: none; padding: 0.85rem 1.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 500;
  cursor: pointer; align-self: flex-start;
  transition: background 200ms;
  margin-top: 0.5rem;
}

.gate-submit:hover { background: var(--accent); }

.gate-msg {
  min-height: 1.2em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.5rem;
}

.gate-msg.error { color: var(--accent-deep); }

.gate-foot {
  margin-top: 3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mute);
}
