/* Zero to VA — black and graphite, teal for progress, brass for the automation module and rewards. */

@font-face { font-family: "Fraunces Display"; src: url(fonts/fraunces-display.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fraunces Text"; src: url(fonts/fraunces-text.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #000000;
  --surface: #121314;
  --surface-2: #1b1c1e;
  --surface-3: #25272a;
  --line: #2a2c2f;
  --line-strong: #44474b;
  --text: #f1f0ec;
  --text-2: #b9bbbd;
  --text-3: #8a8e92;
  --teal: #4cc9b8;
  --teal-2: #2f9a8c;
  --teal-3: #1f6b62;
  --teal-ink: #001a17;
  --brass: #d6a660;
  --brass-2: #a87a39;
  --brass-ink: #1c1203;
  --danger: #ff8a7a;
  --danger-bg: #3a1410;

  /* stair faces */
  --blk-top: #2c2f32;
  --blk-0: #1b1d1f;
  --blk-1: #131415;
  --blk-2: #232528;
  --blk-3: #17181a;
  --blk-edge: rgba(255, 255, 255, .07);
  --extrude-1: #2b2d30;
  --extrude-2: #1b1c1e;

  --font-display: "Fraunces Display", "Fraunces Text", Georgia, "Times New Roman", serif;
  --font-head: "Fraunces Text", "Fraunces Display", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --rail: 300px;
  --gutter: 16px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #e9e9e6; --surface: #f6f6f4; --surface-2: #ffffff; --surface-3: #dcdcd8;
    --line: #d0d0cc; --line-strong: #a3a4a0;
    --text: #0a0a0a; --text-2: #35373a; --text-3: #575a5e;
    --teal: #0b7466; --teal-2: #13897a; --teal-3: #7cc9bd; --teal-ink: #ffffff;
    --brass: #85561a; --brass-2: #b07f3a; --brass-ink: #ffffff;
    --danger: #b3261e; --danger-bg: #fbe3df;
    --blk-top: #f4f4f2; --blk-0: #cfcfcb; --blk-1: #b9b9b5; --blk-2: #dcdcd8; --blk-3: #c4c4c0; --blk-edge: rgba(0, 0, 0, .08);
    --extrude-1: #c9c9c5; --extrude-2: #b6b6b2;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #e9e9e6; --surface: #f6f6f4; --surface-2: #ffffff; --surface-3: #dcdcd8;
  --line: #d0d0cc; --line-strong: #a3a4a0;
  --text: #0a0a0a; --text-2: #35373a; --text-3: #575a5e;
  --teal: #0b7466; --teal-2: #13897a; --teal-3: #7cc9bd; --teal-ink: #ffffff;
  --brass: #85561a; --brass-2: #b07f3a; --brass-ink: #ffffff;
  --danger: #b3261e; --danger-bg: #fbe3df;
  --blk-top: #f4f4f2; --blk-0: #cfcfcb; --blk-1: #b9b9b5; --blk-2: #dcdcd8; --blk-3: #c4c4c0; --blk-edge: rgba(0, 0, 0, .08);
  --extrude-1: #c9c9c5; --extrude-2: #b6b6b2;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: var(--ease-out); }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.62 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
p a, li a, td a, dd a { color: var(--text); }
strong { font-weight: 650; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.1rem, 6.4vw, 3.5rem); line-height: 1.02; letter-spacing: -.025em; }
h2 { font-size: clamp(1.45rem, 3.4vw, 1.85rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--teal); color: var(--teal-ink); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: 12px; z-index: 100; padding: 10px 16px; border-radius: var(--r-sm); background: var(--text); color: var(--bg); font-weight: 600; transform: translateY(-160%); transition: transform .2s var(--ease-out); }
.skip:focus { transform: none; }

/* ---------- background texture ---------- */
.fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fx::before {
  content: ""; position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .09;
}
.fx::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60rem 36rem at 85% -10%, color-mix(in srgb, var(--text) 7%, transparent), transparent 70%),
    radial-gradient(40rem 30rem at -10% 110%, color-mix(in srgb, var(--teal) 6%, transparent), transparent 70%);
}
.fx-spot {
  position: absolute; left: 0; top: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--text) 6%, transparent), transparent);
  opacity: 0; transition: opacity .6s var(--ease-out);
  will-change: transform;
}
.has-spot .fx-spot { opacity: 1; }

/* ---------- shell ---------- */
.shell { display: block; }
main { display: block; padding: 28px var(--gutter) 64px; max-width: 50rem; margin: 0 auto; }
main:focus { outline: none; }
.foot { padding: 28px var(--gutter) calc(32px + env(safe-area-inset-bottom)); color: var(--text-3); font-size: .875rem; border-top: 1px solid var(--line); }
.foot p { max-width: 46rem; margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 var(--gutter); padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  view-transition-name: topbar;
}
.topbar .brand { margin-right: auto; }
.top-pct { font: 600 .9375rem/1 var(--font-head); color: var(--text-2); font-variant-numeric: tabular-nums; }
.strip {
  position: sticky; top: 58px; z-index: 29;
  display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; padding: 0 var(--gutter) 8px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  view-transition-name: strip;
}
.seg { --p: 0; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; position: relative; }
.seg::after { content: ""; position: absolute; inset: 0; background: var(--teal); transform-origin: left; transform: scaleX(var(--p)); transition: transform .5s var(--ease-out); }
.seg.is-key { background: color-mix(in srgb, var(--brass) 35%, var(--surface-3)); }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.125rem/1 var(--font-display); letter-spacing: -.01em; }
.mark { width: 26px; height: 26px; }
.mark .m1 { fill: var(--line-strong); }
.mark .m2 { fill: var(--text-3); }
.mark .m3 { fill: var(--teal); }

.icon-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  cursor: pointer; font-weight: 600; font-size: .9375rem;
  transition: transform .14s var(--ease-out), background-color .2s ease;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn:active { transform: scale(.96); }

/* ---------- rail (desktop) and sheet (mobile) ---------- */
.rail { display: none; }
.rail, .sheet nav { --gap: 4px; }
.mod-list, .page-list { list-style: none; margin: 0; padding: 0; }
.overall { --p: 0; display: flex; align-items: center; gap: 14px; margin: 26px 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.overall .ring { flex: none; }
.overall p { display: grid; }
.overall-pct { font: 700 1.6rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.overall-lbl { color: var(--text-3); font-size: .8125rem; }

.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring-trk { stroke: var(--surface-3); }
.ring-bar { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; opacity: 0; transition: stroke-dashoffset .6s var(--ease-out), opacity .2s ease; }

.mod-link {
  display: flex; align-items: center; gap: 12px; padding: 7px 10px; margin: 0 -10px;
  border-radius: var(--r-sm); text-decoration: none; position: relative;
  transition: background-color .2s ease;
}
.mod-link[aria-current="page"] { background: var(--surface-2); }
.mod-link[aria-current="page"]::before { content: ""; position: absolute; left: -2px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--text); }
.mod-ring { position: relative; flex: none; width: 36px; height: 36px; display: grid; place-items: center; }
.mod-ring .ring { position: absolute; inset: 0; }
.mod-n { font: 600 .9375rem/1 var(--font-head); color: var(--text-2); transition: opacity .2s ease; }
.mod-done { position: absolute; inset: 4px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: opacity .25s var(--ease-out), transform .35s var(--ease-out); }
.mod-done svg { width: 16px; height: 16px; fill: none; stroke: var(--teal-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mod-link[data-state="done"] .mod-done { opacity: 1; transform: none; }
.mod-link[data-state="done"] .mod-n { opacity: 0; }
.mod-link[data-state="progress"] .mod-n { color: var(--text); }
.mod-txt { display: grid; min-width: 0; }
.mod-title { font-size: .9375rem; line-height: 1.3; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-ms { font-size: .8125rem; color: var(--text-3); }
.mod-link.is-key .mod-n { color: var(--brass); }
.mod-link.is-key .ring-trk { stroke: color-mix(in srgb, var(--brass) 40%, var(--surface-3)); }
.mod-link.is-key .mod-ms { color: var(--brass); }

.page-list { margin: 18px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.page-list a { display: block; padding: 8px 0; text-decoration: none; color: var(--text-2); font-weight: 550; font-size: .9375rem; }
.page-list a[aria-current="page"] { color: var(--text); }
.page-list a[aria-current="page"]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--teal); vertical-align: middle; }

.data-tools { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.tools-lbl { width: 100%; color: var(--text-3); font-size: .8125rem; margin-bottom: 2px; }
.theme-pick { display: flex; gap: 4px; margin: 16px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 999px; min-width: 0; }
.theme-pick legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.theme-pick label { flex: 1; position: relative; }
.theme-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-pick span { display: block; text-align: center; padding: 6px 0; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--text-3); transition: background-color .2s ease, color .2s ease; }
.theme-pick input:checked + span { background: var(--surface-3); color: var(--text); }
.theme-pick input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 1px; }

.sheet {
  margin: 0; padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); border: 0; border-right: 1px solid var(--line);
  width: min(88vw, 360px); max-width: none; height: 100dvh; max-height: none;
  background: var(--bg); color: var(--text); overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-100%);
  transition: transform .32s var(--ease-drawer), display .32s allow-discrete, overlay .32s allow-discrete;
}
.sheet[open] { transform: none; }
@starting-style { .sheet[open] { transform: translateX(-100%); } }
.sheet::backdrop { background: rgba(0, 0, 0, 0); transition: background-color .32s ease, display .32s allow-discrete, overlay .32s allow-discrete; }
.sheet[open]::backdrop { background: rgba(0, 0, 0, .6); }
@starting-style { .sheet[open]::backdrop { background: rgba(0, 0, 0, 0); } }
.sheet-close { position: absolute; right: 14px; top: 14px; padding: 0; width: 44px; justify-content: center; }
.sheet .brand { min-height: 44px; }

@media (min-width: 960px) {
  .topbar, .strip { display: none; }
  .shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
  .rail {
    display: block; position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
    padding: 26px 24px 28px; border-right: 1px solid var(--line);
    view-transition-name: rail; scrollbar-width: thin;
  }
  main { padding: 56px clamp(24px, 5vw, 72px) 96px; margin: 0 auto; max-width: 62rem; width: 100%; }
  .foot { margin-left: var(--rail); padding-left: clamp(24px, 5vw, 72px); }
  @media (hover: hover) and (pointer: fine) {
    .mod-link:hover { background: var(--surface); }
    .mod-link[aria-current="page"]:hover { background: var(--surface-2); }
    .page-list a:hover { color: var(--text); }
  }
}

/* ---------- buttons ---------- */
.btn, .btn-quiet {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px; cursor: pointer;
  font-weight: 650; font-size: .9375rem; text-decoration: none; white-space: nowrap;
  transition: transform .14s var(--ease-out), background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn { background: var(--text); color: var(--bg); border: 1px solid var(--text); }
.btn svg, .btn-quiet svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-quiet { background: transparent; border: 1px solid var(--line-strong); color: var(--text); }
.data-tools .btn-quiet { min-height: 38px; padding: 0 14px; font-size: .8125rem; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #160302; }
.btn:active, .btn-quiet:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
  .btn-quiet:hover { background: var(--surface-2); border-color: var(--text-3); }
}

/* ---------- home hero ---------- */
.hero { display: grid; gap: 8px; margin: 0 0 40px; }
.hero-title {
  font-size: clamp(4.2rem, 21vw, 8.6rem); line-height: .86; letter-spacing: -.045em;
  margin: 4px 0 18px;
}
.hero-title .ln { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .ln > span { display: inline-block; }
.hero-sub { font: 600 clamp(1.15rem, 3.6vw, 1.4rem)/1.3 var(--font-head); color: var(--text); max-width: 26ch; text-wrap: balance; }
.hero-tag { margin-top: 10px; color: var(--text-3); font-size: .9375rem; }
.hero-progress { margin-top: 26px; display: grid; gap: 12px; max-width: 26rem; }
.hp-row { display: flex; align-items: baseline; gap: 12px; }
.hp-pct { font: 700 2.4rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.hp-lbl { color: var(--text-3); font-size: .9375rem; }
.bar { --p: 0; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-2), var(--teal)); border-radius: inherit; transform-origin: left; transform: scaleX(var(--p)); transition: transform .8s var(--ease-out); }
.hero-progress .btn { justify-self: start; margin-top: 6px; }

/* 3D staircase: one column per module, built from CSS faces */
.stair-wrap { position: relative; margin: 8px calc(var(--gutter) * -1) 0; }
.stair {
  --u: 27px;
  height: calc(var(--u) * 10.5);
  display: grid; place-items: center;
  perspective: 1600px; perspective-origin: 50% 30%;
  overflow: hidden;
}
.stair-plane {
  position: relative; width: calc(var(--u) * 9.7); height: var(--u);
  transform-style: preserve-3d;
  transform: translateY(calc(var(--u) * var(--lift-y, 1.6))) rotateX(var(--rx, 58deg)) rotateZ(var(--rz, -38deg));
}
.ground {
  position: absolute; left: calc(var(--u) * -2); top: calc(var(--u) * -3); width: calc(var(--u) * 13.7); height: calc(var(--u) * 7);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: calc(var(--u) * 1.08) calc(var(--u) * 1.08);
  background-position: calc(var(--u) * 2) calc(var(--u) * 3);
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent);
  mask-image: radial-gradient(closest-side, #000 30%, transparent);
  transform: translateZ(-1px);
  pointer-events: none;
}
.col {
  --x: calc(var(--i) * var(--u) * 1.08);
  --hh: calc(var(--h) * var(--u));
  position: absolute; left: 0; top: 0; width: var(--u); height: var(--u);
  transform-style: preserve-3d; transform: translate3d(var(--x), 0, 0);
  transition: transform .3s var(--ease-out);
  text-decoration: none; outline: none; z-index: 1;
}
.grow { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 50% 0; }
.face { position: absolute; left: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: inset 0 0 0 1px var(--blk-edge); }
.face.top {
  top: 0; width: var(--u); height: var(--u); background: var(--blk-top);
  transform: translateZ(var(--hh)); display: grid; place-items: center;
}
.face-n { font: 700 calc(var(--u) * .5)/1 var(--font-display); color: var(--text-3); transform: rotate(38deg); }
.face.s0, .face.s1, .face.s2, .face.s3 {
  width: var(--u); height: var(--hh); top: calc(var(--u) / 2 - var(--hh));
  transform-origin: 50% 100%; overflow: hidden;
}
.face.s0 { background: var(--blk-0); transform: rotateZ(0deg) translateY(calc(var(--u) / 2)) rotateX(-90deg); }
.face.s1 { background: var(--blk-1); transform: rotateZ(90deg) translateY(calc(var(--u) / 2)) rotateX(-90deg); }
.face.s2 { background: var(--blk-2); transform: rotateZ(180deg) translateY(calc(var(--u) / 2)) rotateX(-90deg); }
.face.s3 { background: var(--blk-3); transform: rotateZ(270deg) translateY(calc(var(--u) / 2)) rotateX(-90deg); }
.face.s0::after, .face.s1::after, .face.s2::after, .face.s3::after {
  content: ""; position: absolute; inset: 0; transform-origin: 50% 100%; transform: scaleY(var(--p, 0));
  transition: transform .9s var(--ease-out);
}
.face.s0::after { background: var(--teal-2); }
.face.s1::after { background: var(--teal-3); }
.face.s2::after { background: var(--teal); }
.face.s3::after { background: color-mix(in srgb, var(--teal-3) 70%, var(--teal-2)); }
.col[data-state="done"] .face.top { background: var(--teal); }
.col[data-state="done"] .face-n { color: var(--teal-ink); }
.col[data-state="progress"] .face.top { box-shadow: inset 0 0 0 2px var(--teal), inset 0 0 0 1px var(--blk-edge); }
.col.is-key .face.top { box-shadow: inset 0 0 0 2px var(--brass); }
.col.is-key .face-n { color: var(--brass); }
.col.is-key[data-state="done"] .face-n { color: var(--teal-ink); }
.col:focus-visible .face.top { box-shadow: inset 0 0 0 3px var(--text); }
.col:focus-visible { transform: translate3d(var(--x), 0, calc(var(--u) * .35)); }
@media (hover: hover) and (pointer: fine) {
  .col:hover { transform: translate3d(var(--x), 0, calc(var(--u) * .35)); }
}
.pin {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; display: none;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--hh) + var(--u) * 1.3)) rotateZ(38deg) rotateX(-58deg);
}
.col[data-current] .pin { display: block; }
.pin-in {
  position: absolute; left: 0; bottom: 0; transform: translateX(-50%);
  white-space: nowrap; padding: 5px 10px 6px; border-radius: 999px;
  background: var(--text); color: var(--bg); font: 650 .75rem/1 var(--font-body);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  animation: bob 2.6s var(--ease-in-out) infinite alternate;
}
.pin-in::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: calc(var(--u) * 1.3); margin-left: -1px; background: var(--text); }
@keyframes bob { from { translate: 0 -2px; } to { translate: 0 -10px; } }

.stair-cap { min-height: 1.5em; margin: -4px var(--gutter) 0; text-align: center; color: var(--text-3); font-size: .875rem; transition: opacity .2s ease; }
.stair-cap strong { color: var(--text); font-weight: 600; }

/* page-load sequence — one orchestrated moment */
.js .hero-title .ln > span { animation: rise-line .9s var(--ease-out) both; }
.js .hero-title .ln:nth-child(2) > span { animation-delay: .08s; }
.js .hero-sub, .js .hero-tag, .js .hero-progress { animation: fade-up .7s var(--ease-out) both; }
.js .hero-sub { animation-delay: .18s; }
.js .hero-tag { animation-delay: .24s; }
.js .hero-progress { animation-delay: .3s; }
.js .grow { animation: grow-col .9s var(--ease-out) both; animation-delay: calc(.25s + var(--i) * 70ms); }
.js .pin-in { animation: pin-drop .5s var(--ease-out) 1.15s both, bob 2.6s var(--ease-in-out) 1.65s infinite alternate; }
@keyframes rise-line { from { transform: translateY(105%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes grow-col { from { transform: scale3d(1, 1, .02); } }
@keyframes pin-drop { from { opacity: 0; translate: 0 -26px; } }

@media (min-width: 640px) {
  .stair { --u: 34px; }
}
@media (min-width: 1180px) {
  .stair { --lift-y: 2.6; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 0 12px; margin-bottom: 64px; }
  .stair-wrap { margin: 0 -40px 0 -60px; }
  .stair { --u: 38px; height: 500px; }
}

/* ---------- prose ---------- */
.prose { max-width: 42rem; }
.prose > * + * { margin-top: 1rem; }
.prose h2 { margin-top: 2.6rem; }
.prose h3 { margin-top: 2rem; }
.prose h2 + *, .prose h3 + * { margin-top: .75rem; }
.prose p { color: var(--text-2); }
.prose strong { color: var(--text); }
.bullets { padding-left: 1.2rem; color: var(--text-2); }
.bullets li + li { margin-top: .5rem; }
.bullets li::marker { color: var(--text-3); }
.accept { list-style: none; padding: 0; display: grid; gap: 10px; }
.accept li { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); }
.accept strong { display: block; color: var(--text); font: 600 1.0625rem/1.35 var(--font-head); margin-bottom: 4px; }
.intro { margin-bottom: 28px; }

.callout { margin: 1.5rem 0; padding: 18px 20px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.callout p { color: var(--text-2); }
.callout p + p { margin-top: .6rem; }
.callout-title { color: var(--text) !important; font: 600 1.125rem/1.3 var(--font-head); }
.callout-line { color: var(--text) !important; border-left: 3px solid var(--teal); }
.callout-warn { border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); background: color-mix(in srgb, var(--brass) 7%, var(--surface)); }
.callout-warn .callout-title { color: var(--brass) !important; }

/* ---------- tables (desktop table, phone cards) ---------- */
.table-wrap { margin: 1rem 0 0; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th { text-align: left; font-weight: 600; color: var(--text-3); font-size: .8125rem; }
.data th, .data td { padding: 12px 14px; vertical-align: top; }
.data thead th { border-bottom: 1px solid var(--line-strong); }
.data tbody tr { border-bottom: 1px solid var(--line); }
.data td { color: var(--text-2); }
.data td:first-child { color: var(--text); }
.data a { font-weight: 600; }

@media (max-width: 719px) {
  table.stack, .stack thead, .stack tbody, .stack tr, .stack th, .stack td { display: block; }
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack tbody { display: grid; gap: 10px; }
  .stack tbody tr { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 6px 16px 10px; }
  .stack td, .stack tbody th { padding: 8px 0; border: 0; }
  .stack td + td { border-top: 1px solid var(--line); }
  .stack td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--text-3); margin-bottom: 2px; }
}
@media (min-width: 720px) {
  .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
  .data thead th { background: var(--surface-2); }
  .data tbody tr:last-child { border-bottom: 0; }
}

@media (max-width: 719px) {
  .ref .data td:first-child::before { display: none; }
  .ref .data td:first-child { font: 600 1.1rem/1.3 var(--font-head); }
}

/* module overview */
.overview .ov-n { display: inline-flex; align-items: center; gap: 10px; font: 600 1.05rem/1 var(--font-head); }
.badge { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--text-3); }
.overview a { text-decoration: none; color: var(--text); font-family: var(--font-head); font-size: 1.0625rem; }
.overview td:nth-child(4) { white-space: nowrap; min-width: 130px; }
.ov-bar { display: inline-block; vertical-align: middle; width: 70px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-right: 10px; }
.ov-bar > span { display: block; height: 100%; background: var(--teal); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .6s var(--ease-out); }
.ov-pct { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: .875rem; }
.overview tr[data-state="done"] .badge { color: var(--teal); }
.overview tr.is-key { background: color-mix(in srgb, var(--brass) 8%, transparent); box-shadow: inset 3px 0 0 var(--brass); }
.overview tr.is-key .badge { color: var(--brass); }
.key-tag { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; font: 650 .75rem/1.5 var(--font-body); color: var(--brass-ink); background: var(--brass); vertical-align: 2px; }
.ov-wrap { margin-bottom: 44px; }
@media (max-width: 719px) {
  .overview tbody tr { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; padding: 14px 16px; }
  .overview td { padding: 0 !important; border: 0 !important; }
  .overview td::before { display: none !important; }
  .overview td:nth-child(1) { grid-row: span 3; }
  .overview td:nth-child(1) .ov-n span { display: none; }
  .overview td:nth-child(1) .badge { width: 28px; height: 28px; margin-top: 2px; }
  .overview td:nth-child(3) { font-size: .875rem; margin: 4px 0 10px; }
  .overview a::before { content: "Module " attr(data-n) ": "; }
  .overview tr.is-key { box-shadow: inset 3px 0 0 var(--brass); }
}

@media (max-width: 719px) {
  .fill tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 14px 16px; }
  .fill td { min-width: 0; }
  .fill input[type="date"] { min-width: 0; }
  .fill td, .fill tbody th { border: 0 !important; padding: 0 !important; }
  .fill .c-span { grid-column: 1 / -1; }
  .prog td:nth-child(1) { display: none; }
  .prog td:nth-child(2)::before, .prog td:nth-child(3)::before { display: none !important; }
  .prog td:nth-child(2) { grid-column: 1 / -1; font-family: var(--font-head); font-size: 1.05rem; }
  .prog td:nth-child(2) a::before { content: attr(data-n) ". "; }
  .prog td:nth-child(3) { grid-column: 1 / -1; margin-top: -8px; font-size: .875rem; color: var(--text-3); }
  .prog td:nth-child(6) { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-direction: row-reverse; justify-content: flex-end; }
  .prog td:nth-child(6)::before { margin: 0 !important; font-size: .875rem !important; font-weight: 500 !important; color: var(--text-2) !important; }
  .skills tbody th, .skills td:nth-child(2), .skills td:nth-child(3) { grid-column: 1 / -1; }
  .skills tbody th::before { display: none !important; }
}

/* milestone rewards */
.rewards { padding: 22px 20px; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--brass) 35%, var(--line)); background: color-mix(in srgb, var(--brass) 6%, var(--surface)); }
.rewards h2 { display: flex; gap: 12px; align-items: center; font-size: 1.25rem; }
.rewards h2 svg, .reward h2 svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--brass); stroke-width: 1.6; stroke-linejoin: round; }
.rewards ul { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.rewards li { display: grid; gap: 6px; }
@media (min-width: 720px) { .rewards li { grid-template-columns: 15rem 1fr; align-items: center; } }
.rewards label { color: var(--text-2); font-size: .9375rem; }

input[type="text"], input[type="date"], select {
  width: 100%; min-height: 44px; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 1rem; transition: border-color .2s ease, background-color .2s ease;
}
input::placeholder { color: var(--text-3); }
input[type="text"]:focus, input[type="date"]:focus, select:focus { border-color: var(--teal); background: var(--surface); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent); }
input[type="date"] { min-width: 9.5rem; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.5); cursor: pointer; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ---------- module page ---------- */
.m-hero { display: grid; gap: 4px 28px; align-items: end; margin-bottom: 28px; }
.numeral { perspective: 700px; line-height: 0; }
.numeral-in {
  display: inline-block; font: 700 clamp(8rem, 40vw, 13rem)/.8 var(--font-display); letter-spacing: -.06em;
  color: var(--text);
  text-shadow:
    1px 1px 0 var(--extrude-1), 2px 2px 0 var(--extrude-1), 3px 3px 0 var(--extrude-1), 4px 4px 0 var(--extrude-1),
    5px 5px 0 var(--extrude-2), 6px 6px 0 var(--extrude-2), 7px 7px 0 var(--extrude-2), 8px 8px 0 var(--extrude-2),
    9px 9px 0 var(--extrude-2), 10px 10px 0 var(--extrude-2), 22px 26px 40px rgba(0, 0, 0, .45);
  transform: rotateY(var(--ty, -12deg)) rotateX(var(--tx, 6deg));
  transform-origin: 40% 60%;
  transition: color .6s var(--ease-out);
  padding: .08em .12em 0 0;
}
.module.is-key .numeral-in { color: var(--brass); }
.module[data-state="done"] .numeral-in { color: var(--teal); }
.js .numeral-in { animation: numeral-in 1s var(--ease-out) both; }
@keyframes numeral-in { from { opacity: 0; transform: rotateY(-50deg) rotateX(18deg) translateY(10%); } }
.js .m-head > * { animation: fade-up .7s var(--ease-out) both; }
.js .m-head > :nth-child(2) { animation-delay: .06s; }
.js .m-head > :nth-child(3) { animation-delay: .12s; }
.js .m-head > :nth-child(4) { animation-delay: .18s; }
.m-kicker { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 600; font-size: .9375rem; margin-bottom: 10px; }
.m-kicker .badge { color: var(--text); width: 24px; height: 24px; }
.module.is-key .m-kicker .badge { color: var(--brass); }
.m-head .key-tag { margin: 12px 0 0; }
.m-prog { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--text-2); font-size: .9375rem; font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .m-hero { grid-template-columns: auto 1fr; } }

.brief { display: grid; gap: 1px; margin: 0 0 8px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.brief > div { padding: 18px 20px; background: var(--surface); }
.brief dt { font: 600 .8125rem/1 var(--font-body); color: var(--text-3); margin-bottom: 8px; }
.brief dd { margin: 0; font: 600 1.125rem/1.4 var(--font-head); }
@media (min-width: 720px) { .brief { grid-template-columns: 1.6fr 1fr; } }
.module.is-key .brief { border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); background: color-mix(in srgb, var(--brass) 45%, var(--line)); }

.sec { margin-top: 48px; }
.sec > h2, .sec > h3 { margin-bottom: 18px; }
.sec > h3 { font-size: clamp(1.35rem, 3.2vw, 1.7rem); }
.cl-head h3 { font-size: 1.3rem; }

/* modules with parts (Module 5) */
.part-nav { display: grid; gap: 8px; margin-top: 18px; }
.part-nav a { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-decoration: none; font: 600 1.05rem/1.25 var(--font-head); transition: border-color .2s ease, transform .14s var(--ease-out); }
.part-nav a span { font: 600 .8125rem/1 var(--font-body); color: var(--brass); }
.part-nav a:active { transform: scale(.98); }
@media (min-width: 720px) { .part-nav { grid-template-columns: 1fr 1fr; } }
@media (hover: hover) and (pointer: fine) { .part-nav a:hover { border-color: var(--brass); } }
.part-head { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line-strong); }
.part-head h2 { display: grid; gap: 6px; }
.part-n { font: 650 .875rem/1 var(--font-body); color: var(--brass); }
.part-name { font: 700 clamp(2rem, 6vw, 3rem)/1.02 var(--font-display); letter-spacing: -.02em; }
.brief-part { margin-top: 18px; }

/* prompt library */
.prompt-list { display: grid; gap: 14px; margin-top: 14px; }
.prompt { margin: 0; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.prompt figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); font: 600 1rem/1.3 var(--font-head); }
.prompt pre { margin: 0; padding: 14px 16px 16px; max-height: 22rem; overflow: auto; font: 400 .875rem/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt pre:focus-visible { outline-offset: -3px; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font: 650 .8125rem/1 var(--font-body); color: var(--text); transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .14s var(--ease-out); }
.copy-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.copy-btn:active { transform: scale(.95); }
.copy-btn.is-copied { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
@media (hover: hover) and (pointer: fine) { .copy-btn:hover { border-color: var(--text-3); } }

.videos { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.video {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; transition: border-color .2s ease, background-color .2s ease, transform .14s var(--ease-out);
}
.video:active { transform: scale(.985); }
.play { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); transition: background-color .2s ease, transform .3s var(--ease-out); }
.play svg { width: 18px; height: 18px; fill: var(--text); margin-left: 2px; transition: fill .2s ease; }
.v-txt { display: grid; gap: 3px; min-width: 0; }
.v-title { font-weight: 600; line-height: 1.35; }
.v-by { color: var(--text-3); font-size: .875rem; }
.v-ext svg { width: 20px; height: 20px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; transition: transform .25s var(--ease-out), stroke .2s ease; }
@media (hover: hover) and (pointer: fine) {
  .video:hover { border-color: var(--line-strong); background: var(--surface-2); }
  .video:hover .play { background: var(--text); transform: scale(1.06); }
  .video:hover .play svg { fill: var(--bg); }
  .video:hover .v-ext svg { transform: translate(2px, -2px); stroke: var(--text); }
}

.lessons { list-style: none; counter-reset: l; padding: 0; margin: 0; display: grid; gap: 0; }
.lessons li { counter-increment: l; position: relative; padding: 16px 0 16px 56px; border-top: 1px solid var(--line); color: var(--text-2); max-width: 44rem; }
.lessons li:last-child { border-bottom: 1px solid var(--line); }
.lessons li::before { content: counter(l); position: absolute; left: 0; top: 10px; font: 700 2rem/1 var(--font-display); color: var(--text-3); width: 40px; text-align: right; }
.lessons strong { color: var(--text); }

.checklist { padding: 22px 18px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.cl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.cl-head h2 { font-size: 1.35rem; }
.cl-count { color: var(--text-3); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li + li { border-top: 1px solid var(--line); }
.check { display: flex; align-items: flex-start; gap: 14px; padding: 14px 8px; margin: 0 -8px; border-radius: var(--r-sm); cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent; }
.check input, .mini-check input { position: absolute; opacity: 0; width: 28px; height: 28px; margin: 0; cursor: pointer; }
.box {
  flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line-strong); background: var(--surface-2);
  display: grid; place-items: center;
  transition: background-color .2s ease, border-color .2s ease, transform .16s var(--ease-out);
}
.box svg { width: 18px; height: 18px; fill: none; stroke: var(--teal-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .26s var(--ease-out); }
.check:active .box, .mini-check:active .box { transform: scale(.88); }
input:checked + .box { background: var(--teal); border-color: var(--teal); }
input:checked + .box svg { stroke-dashoffset: 0; transition-delay: .04s; }
input:focus-visible + .box { outline: 2px solid var(--teal); outline-offset: 3px; }
.check-txt { padding-top: 2px; transition: color .25s ease; }
.check input:checked ~ .check-txt { color: var(--text-3); }
@media (hover: hover) and (pointer: fine) {
  .check:hover { background: var(--surface-2); }
  .check:hover .box { border-color: var(--text-3); }
  .check:hover input:checked + .box { border-color: var(--teal); }
}
.module.is-key .checklist { border-color: color-mix(in srgb, var(--brass) 40%, var(--line)); }

.done-card {
  display: none; grid-template-columns: auto 1fr; gap: 16px; align-items: center;
  margin-top: 14px; padding: 18px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--teal) 12%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--teal) 45%, transparent);
  perspective: 600px;
}
.module[data-state="done"] .done-card { display: grid; }
.done-badge { width: 64px; height: 64px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; box-shadow: 0 0 0 6px color-mix(in srgb, var(--teal) 18%, transparent); }
.badge-lg { width: 32px; height: 32px; fill: none; stroke: var(--teal-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.done-title { font: 700 1.35rem/1.15 var(--font-display); }
.done-ms { color: var(--text-2); margin-top: 2px; }
.done-meaning { color: var(--text-3); font-size: .9375rem; margin-top: 4px; }
.done-card.is-new { animation: card-in .5s var(--ease-out) both; }
.done-card.is-new .done-badge { animation: badge-flip .8s var(--ease-out) .1s both; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes badge-flip { from { transform: rotateY(-180deg) scale(.8); } }

.reward { margin-top: 28px; padding: 20px; border-radius: var(--r-lg); border: 1px dashed color-mix(in srgb, var(--brass) 45%, var(--line)); transition: border-color .4s ease, background-color .4s ease; }
.reward h2 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin-bottom: 8px; color: var(--brass); }
.reward p { font-style: italic; color: var(--text-2); }
.module[data-state="done"] .reward { border-style: solid; border-color: var(--brass); background: color-mix(in srgb, var(--brass) 9%, var(--surface)); }
.module[data-state="done"] .reward p { color: var(--text); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 44px; }
.pg { display: flex; align-items: center; gap: 10px; padding: 14px 16px; min-height: 64px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; background: var(--surface); transition: border-color .2s ease, transform .14s var(--ease-out); }
.pg:active { transform: scale(.98); }
.pg span { display: grid; font-weight: 600; line-height: 1.25; }
.pg small { color: var(--text-3); font-weight: 500; font-size: .8125rem; }
.pg svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease-out); }
.pg.next { justify-content: flex-end; text-align: right; grid-column: 2; }
@media (hover: hover) and (pointer: fine) {
  .pg:hover { border-color: var(--line-strong); }
  .pg.prev:hover svg { transform: translateX(-3px); }
  .pg.next:hover svg { transform: translateX(3px); }
}

/* ---------- page heads (trackers, resources, rates) ---------- */
.page-head { margin-bottom: 8px; }
.page-head h1 { font-size: clamp(2.6rem, 9vw, 4.4rem); }
.lede { margin-top: 14px; color: var(--text-2); font-size: 1.0625rem; max-width: 40rem; }
.caption { color: var(--text-3); font-style: italic; margin: -6px 0 4px; max-width: 42rem; }
.hint { color: var(--text-3); font-size: .875rem; margin-top: 10px; }
.js .page-head > * { animation: fade-up .6s var(--ease-out) both; }
.js .page-head > :nth-child(2) { animation-delay: .06s; }

/* ---------- trackers ---------- */
.tracker > h2 { margin-bottom: 14px; }
.fill td { vertical-align: middle; }
.fill input[type="text"], .fill input[type="date"] { min-height: 40px; }
.fill tr[data-state="done"] .badge { color: var(--teal); }
.mini-check { position: relative; display: inline-grid; cursor: pointer; }
.skills tbody th { font-weight: 550; color: var(--text); font-size: .9375rem; min-width: 12rem; }
.inline-input { display: inline-block; width: auto !important; min-width: 8rem; margin-top: 6px; }
.dots { display: flex; gap: 6px; border: 0; padding: 0; margin: 0; }
.dots label { position: relative; }
.dots input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.dots span {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); font-size: .8125rem; font-weight: 650; color: var(--text-3);
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .16s var(--ease-out);
}
.dots label:active span { transform: scale(.9); }
.dots input:checked + span { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
.dots input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

.app-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-bottom: 12px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.app-stats p { padding: 12px 14px; background: var(--surface); color: var(--text-3); font-size: .8125rem; }
.app-stats span { display: block; font: 700 1.7rem/1.1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .app-stats { grid-template-columns: repeat(4, 1fr); } }

.edit th, .edit td { padding: 0; }
.edit thead th { padding: 10px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.edit tbody tr { border-bottom: 1px solid var(--line); }
.edit td + td { border-left: 1px solid var(--line); }
.edit input[type="text"], .edit input[type="date"], .edit select { border: 0; border-radius: 0; background: transparent; min-height: 44px; min-width: 8rem; }
.edit input[type="text"]:focus, .edit input[type="date"]:focus, .edit select:focus { box-shadow: inset 0 0 0 2px var(--teal); background: var(--surface-2); }
.edit td.c-check { text-align: center; vertical-align: middle; min-width: 6rem; }
.edit td.c-check .mini-check { margin: 8px auto; }
.row-x { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; color: var(--text-3); border-radius: var(--r-sm); transition: color .2s ease, background-color .2s ease; }
.row-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) { .row-x:hover { color: var(--danger); background: var(--danger-bg); } }
.edit tr.is-new { animation: row-in .35s var(--ease-out) both; }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 719px) {
  .edit tbody tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; gap: 0 10px; padding: 38px 14px 12px; }
  .edit td { min-width: 0; }
  .edit input[type="date"] { min-width: 0; }
  .edit tbody tr::before { content: attr(data-title); position: absolute; left: 14px; top: 12px; font: 600 .9375rem/1 var(--font-head); color: var(--text); }
  .edit td + td { border-left: 0; border-top: 0 !important; }
  .edit td { padding: 4px 0 !important; }
  .edit td.c-wide { grid-column: 1 / -1; }
  .edit td.c-x { position: absolute; right: 4px; top: 2px; padding: 0 !important; }
  .edit td.c-x::before { display: none; }
  .edit input[type="text"], .edit input[type="date"], .edit select { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
  .edit td.c-check { text-align: left; }
  .edit td.c-check .mini-check { margin: 6px 0; }
}
.table-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.row-count { color: var(--text-3); font-size: .875rem; }
.csv-row { margin-top: 14px; }
.move { padding: 22px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.move p { color: var(--text-2); margin: 8px 0 16px; max-width: 40rem; }
.move-btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- reference pages ---------- */
.ref h2 { padding-top: 22px; border-top: 1px solid var(--line); }
.ref .table-wrap { margin-top: 1rem; }
.ref td:first-child a { font-family: var(--font-head); }
.rates > p:first-child { font-size: 1.125rem; color: var(--text); }
.page-head + .prose { margin-top: 20px; }
.rates strong { color: var(--brass); }
.rates .callout strong, .rates .callout-title { color: var(--text); }

/* ---------- certificate ---------- */
.cert-frame { padding: 10px; border-radius: 6px; background: linear-gradient(135deg, var(--line-strong), var(--surface-3) 40%, var(--line-strong)); }
.cert {
  position: relative; text-align: center; padding: 44px 22px 34px; border-radius: 3px;
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 0 6px var(--surface), inset 0 0 0 7px var(--line);
}
.seal { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); transition: background-color .6s ease, border-color .6s ease; }
.seal .mark { width: 36px; height: 36px; }
.cert-h { font: 700 clamp(1.3rem, 4.6vw, 1.9rem)/1.1 var(--font-display); letter-spacing: .02em; }
.cert-certifies { font-style: italic; color: var(--text-3); margin-top: 16px; }
.cert-name input {
  text-align: center; font: 700 clamp(1.7rem, 7vw, 2.8rem)/1.2 var(--font-display); letter-spacing: -.01em;
  border: 0 !important; border-bottom: 1.5px solid var(--line-strong) !important; border-radius: 0 !important; background: transparent !important;
  box-shadow: none !important; max-width: 30rem; margin: 6px auto 0; display: block; min-height: 64px;
}
.cert-name input:focus { border-bottom-color: var(--teal) !important; }
.cert-body { color: var(--text-2); margin: 18px auto 22px; max-width: 34rem; }
.cert-mss { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-weight: 650; font-size: .8125rem; max-width: 36rem; margin: 0 auto; }
.cert-mss + .cert-mss { margin-top: 6px; }
.cert-ms { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-3); transition: color .4s ease, border-color .4s ease, background-color .4s ease; }
.cert-ms[data-state="done"] { color: var(--teal-ink); background: var(--teal); border-color: var(--teal); }
.cert-dot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cert-name input::placeholder { font-size: .62em; font-family: var(--font-body); font-weight: 500; letter-spacing: 0; }
.cert-fields { display: grid; gap: 10px; max-width: 26rem; margin: 26px auto 0; text-align: left; }
.cert-field { display: grid; grid-template-columns: 7rem 1fr; align-items: center; gap: 10px; color: var(--text-2); }
.cert-field input { border-width: 0 0 1.5px !important; border-radius: 0 !important; background: transparent !important; }
.cert-status { margin-top: 18px; color: var(--text-3); text-align: center; }
.cert-actions { display: flex; justify-content: center; margin-top: 14px; }
.cert-page.is-complete .seal { background: var(--teal); border-color: var(--teal); }
.cert-page.is-complete .seal .mark rect { fill: var(--teal-ink); }
.cert-page.is-complete .cert-frame { background: linear-gradient(135deg, var(--teal-2), var(--surface-3) 45%, var(--brass-2)); }
.js .cert-frame { animation: cert-in .9s var(--ease-out) both; }
@keyframes cert-in { from { opacity: 0; transform: perspective(900px) rotateX(14deg) translateY(16px); } }

/* ---------- dialogs, toast, warnings ---------- */
.confirm {
  width: min(92vw, 26rem); padding: 24px; border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
  opacity: 0; transform: scale(.96);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), display .2s allow-discrete, overlay .2s allow-discrete;
}
.confirm[open] { opacity: 1; transform: none; }
@starting-style { .confirm[open] { opacity: 0; transform: scale(.96); } }
.confirm::backdrop { background: rgba(0, 0, 0, .6); }
.confirm h2 { font-size: 1.4rem; }
.confirm p { color: var(--text-2); margin: 10px 0 20px; }
.confirm-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  padding: 12px 14px 12px 18px; border-radius: 16px; background: var(--text); width: max-content; max-width: min(28rem, calc(100vw - 32px)); color: var(--bg);
  font-weight: 600; font-size: .9375rem; box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
  transform: translate(-50%, calc(100% + 40px)); opacity: 0; pointer-events: none;
  transition: transform .3s var(--ease-out), opacity .2s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-act { border: 0; background: transparent; color: var(--bg); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; padding: 0 6px; }
.toast-act:focus-visible { outline-color: var(--bg); }

.store-warn { margin: 0 0 22px; padding: 14px 16px; border-radius: var(--r-md); background: var(--danger-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); font-size: .9375rem; }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

/* scroll-linked reveal, compositor-only, where supported */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .video, .lessons li, .accept li, .overview tbody tr, .reward, .pager, .prompt {
      animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 40%;
    }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .sheet, .toast { transition-property: opacity; }
  .numeral-in { transform: none; }
}

/* ---------- print: certificate and trackers only ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --text-2: #222; --text-3: #555; --line: #bbb; --line-strong: #888; }
  .topbar, .strip, .rail, .foot, .fx, .cert-actions, .cert-status, .toast, .skip, .table-actions, .csv-row, .move, .row-x, .store-warn { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .cert-pg main { display: grid; place-items: center; min-height: 95vh; }
  .cert-frame { animation: none !important; }
  input { border: 0 !important; background: transparent !important; }
}

/* wider working area for the editable trackers */
@media (min-width: 960px) { .trk-page main { max-width: 78rem; } }
@media (min-width: 720px) {
  .edit td.c-wide input { min-width: 15rem; }
  .edit select { min-width: 10.5rem; }
}

/* ---------- wide screens: centred content, larger type, module side panel ---------- */
.m-side { display: none; }
@media (min-width: 1280px) {
  .home main { max-width: 80rem; }
  .mod-page main { max-width: 80rem; }
  .m-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 0 clamp(40px, 4vw, 72px); align-items: start; }
  .m-side { display: grid; gap: 14px; position: sticky; top: 40px; }
  .m-hero { margin-bottom: 36px; }
}
@media (min-width: 1600px) {
  html { font-size: 112.5%; }
  :root { --rail: 330px; }
  .stair { --u: 46px; height: 600px; }
}
@media (min-width: 2200px) {
  html { font-size: 125%; }
  :root { --rail: 360px; }
  .stair { --u: 54px; height: 700px; }
}

.side-card { display: grid; justify-items: center; gap: 6px; padding: 22px 18px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); text-align: center; }
.module.is-key .side-card { border-color: color-mix(in srgb, var(--brass) 40%, var(--line)); }
.side-ring { position: relative; width: 96px; height: 96px; display: grid; place-items: center; }
.side-ring .ring { position: absolute; inset: 0; }
.side-ring .ring circle { stroke-width: 2.6; }
.side-pct { font: 700 1.6rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.side-count { color: var(--text-2); font-size: .9375rem; font-variant-numeric: tabular-nums; margin-top: 6px; }
.side-ms { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: .875rem; font-weight: 600; }
.side-ms .badge { width: 18px; height: 18px; }
.module[data-state="done"] .side-ms, .module[data-state="done"] .side-ms .badge { color: var(--teal); }
.module.is-key .side-ms .badge { color: var(--brass); }

.toc { padding: 16px 8px 12px; border-radius: var(--r-lg); border: 1px solid var(--line); }
.toc-h { padding: 0 12px 8px; color: var(--text-3); font-size: .8125rem; font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { position: relative; display: block; padding: 7px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--text-2); font-size: .9375rem; transition: color .2s ease, background-color .2s ease; }
.toc a::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 1px; background: var(--teal); transform: scaleY(0); transition: transform .25s var(--ease-out); }
.toc a.is-here { color: var(--text); background: var(--surface-2); }
.toc a.is-here::before { transform: none; }
.toc-part a { margin-top: 6px; color: var(--brass); font-size: .8125rem; font-weight: 650; }
.toc-part:first-child a { margin-top: 0; }
@media (hover: hover) and (pointer: fine) { .toc a:hover { color: var(--text); background: var(--surface); } }

.side-next { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .2s ease, transform .14s var(--ease-out); }
.side-next small { color: var(--text-3); font-size: .8125rem; }
.side-next span { font: 600 1rem/1.3 var(--font-head); }
.side-next:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .side-next:hover { border-color: var(--line-strong); } }
@media (min-width: 1280px) {
  .home .intro { max-width: none; }
  .home .intro > :not(.accept) { max-width: 46rem; }
  .home .accept { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .prose.ref { max-width: none; }
  .ref > p, .ref > ul, .ref > h2 { max-width: 46rem; }
  .ref h2 { max-width: none; }
}
