/* All Things Medical Billing - site styles
   ---------------------------------------------------------------------------
   One stylesheet for 424 pages, in direction A: "Claim Form". The visual system
   is taken from the CMS-1500 - numbered field blocks, hairline rules at a single
   weight, carbon-copy cyan, tabular figures. Directions B and C were reviewed
   and dropped; commit c95890d holds them.

   Type is set in system stacks rather than webfonts. On a reference site with
   this many pages that buys zero layout shift and zero font requests.

   Selector discipline: components are styled once, through tokens. There are no
   type-based overrides fighting element-based ones over spacing - vertical
   rhythm comes from flow gaps on the container, never per-element margins. */

/* ============================================================ TOKENS */
:root {
  --paper:      #fbfbf9;
  --surface:    #ffffff;
  --ink:        #12233a;
  --ink-2:      #46586d;
  --ink-3:      #6b7c8d;
  --rule:       #ccd6df;
  --rule-2:     #e6ecf1;
  --accent:     #0e7c9b;
  --accent-ink: #0a6a85;
  --accent-pale:#e8f3f7;
  --warm:       #a8630a;
  --warm-pale:  #fff8ef;

  --font-display: "Bahnschrift SemiCondensed", "Segoe UI Semibold", "Franklin Gothic Medium", "Helvetica Neue", sans-serif;
  --font-body:    "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono:    Consolas, "Cascadia Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --display-weight: 600;
  --radius: 3px;
  --radius-lg: 4px;

  /* scale */
  --step--1: .875rem;
  --step-0:  1rem;
  --step-1:  1.125rem;
  --step-2:  clamp(1.25rem, 1.9vw, 1.4rem);
  --step-3:  clamp(1.5rem, 2.6vw, 1.9rem);
  --step-4:  clamp(1.85rem, 3.6vw, 2.6rem);
  --step-5:  clamp(2.1rem, 4.4vw, 3.15rem);

  --wrap: 1120px;
  --measure: 68ch;
  --flow: 1.15rem;

  /* Motion. Defined once here and referenced everywhere, so nothing on the site
     animates linearly. ease-out for things arriving, ease-in-out for things
     moving between states, spring reserved for the two moments that should feel
     grabbable (the CTA press and the cycle token settling). */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.46, .64, 1);
  --dur-fast: 170ms;
  --dur-base: 420ms;
  --dur-slow: 700ms;
  --stagger: 90ms;

  /* Semantic colours. Tied to meaning, never spent as decoration: a clean claim
     is "good", a denial is "needs work". Direction is what matters, not the raw
     number - see the cycle diagram legend. */
  --good: #12795c;
  --good-pale: #e4f2ed;
  --attn: #a8630a;
  --attn-pale: #fdf3e6;
}

/* A is a light design, so it gets a real dark mode rather than an inversion. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141a20; --surface: #1b232c; --ink: #e6edf4; --ink-2: #a9b8c6;
    --ink-3: #8d9dac; --rule: #2c3945; --rule-2: #222c37;
    --accent: #56c2dd; --accent-ink: #7ed3e9; --accent-pale: #17303a;
    --warm: #e0a54e; --warm-pale: #2a2113;
  }
}
:root[data-theme="dark"] {
  --paper: #141a20; --surface: #1b232c; --ink: #e6edf4; --ink-2: #a9b8c6;
  --ink-3: #8d9dac; --rule: #2c3945; --rule-2: #222c37;
  --accent: #56c2dd; --accent-ink: #7ed3e9; --accent-pale: #17303a;
  --warm: #e0a54e; --warm-pale: #2a2113;
}
:root[data-theme="light"] {
  --paper: #fbfbf9; --surface: #fff; --ink: #12233a; --ink-2: #46586d;
  --ink-3: #6b7c8d; --rule: #ccd6df; --rule-2: #e6ecf1;
  --accent: #0e7c9b; --accent-ink: #0a6a85; --accent-pale: #e8f3f7;
  --warm: #a8630a; --warm-pale: #fff8ef;
}

/* ============================================================ BASE */
*, *::before, *::after { box-sizing: border-box; }
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 {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img, svg, video, iframe { max-width: 100%; }
img, video { height: auto; }
a { color: var(--accent-ink); text-underline-offset: .16em; text-decoration-thickness: from-font; }
a:hover { color: var(--ink); }
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px;
}
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .7rem 1.1rem;
}
.skip:focus { left: .5rem; top: .5rem; }
.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ============================================================ HEADER / NAV */
.topbar {
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .01em;
}
.topbar .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: .45rem; }
.topbar a { color: inherit; }

.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); position: relative; }
.masthead .wrap { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.2rem); padding-block: 1.05rem; }
.brand { display: flex; align-items: center; gap: .7rem; margin-right: auto; }
.brand__mark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  color: var(--ink);
}
.brand__mark .mark { display: block; }
.brand__name {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 1.05rem; line-height: 1.15; letter-spacing: -.005em; color: var(--ink);
}
.brand a { color: inherit; text-decoration: none; }
.brand__name span {
  display: block; font-family: var(--font-mono); font-size: .63rem;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
  font-weight: 400; margin-top: .16rem;
}

.nav > ul { display: flex; gap: clamp(.9rem, 2vw, 1.55rem); list-style: none; margin: 0; padding: 0; }
.nav li { position: relative; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: .89rem; font-weight: 500; padding-block: .4rem; display: inline-block; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent-ink); }
.nav ul ul {
  position: absolute; top: 100%; left: -.7rem; min-width: 15rem; z-index: 30;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  list-style: none; margin: 0; padding: .4rem; display: none;
  box-shadow: 0 14px 34px -14px rgb(0 0 0 / .28);
}
.nav li:hover > ul, .nav li:focus-within > ul { display: block; }
.nav ul ul a { display: block; padding: .42rem .6rem; font-size: .86rem; border-radius: 2px; }
.nav ul ul a:hover { background: var(--accent-pale); }

.navtoggle {
  display: none; appearance: none; background: transparent; border: 1px solid var(--rule);
  border-radius: var(--radius); color: var(--ink); padding: .45rem .6rem; cursor: pointer;
}

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  cursor: pointer; position: relative;
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: .9rem; letter-spacing: .01em; text-decoration: none;
  padding: .7rem 1.25rem; border-radius: var(--radius);
  min-height: 44px;  /* touch target */
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 65%, transparent);
}
/* A press state so the click reads as registered. Spring, not ease, because this
   is one of the two moments that should feel physical. */
.btn:active { transform: translateY(0) scale(.984); transition-duration: 90ms; }
.btn svg { transition: transform var(--dur-fast) var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }

/* Label swap on the primary CTA: the second label answers the hesitation that
   peaks at the moment of intent, rather than repeating the first. */
.btn--swap { overflow: hidden; }
.btn--swap .btn__stack { display: grid; text-align: center; }
.btn--swap .btn__a, .btn--swap .btn__b {
  grid-area: 1 / 1; display: flex; align-items: center; gap: .5rem;
  justify-content: center; white-space: nowrap;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.btn--swap .btn__b { transform: translateY(115%); opacity: 0; }
.btn--swap:hover .btn__a, .btn--swap:focus-visible .btn__a { transform: translateY(-115%); opacity: 0; }
.btn--swap:hover .btn__b, .btn--swap:focus-visible .btn__b { transform: translateY(0); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .btn--swap .btn__b { display: none; }
  .btn:hover { transform: none; }
}
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--sm { font-size: .82rem; padding: .48rem .85rem; }

/* ============================================================ REVEAL
   One staggered-reveal treatment, defined once and reused wherever a group of
   things enters together. The delay is set per element by JS as --d so the eye
   is led through the group in reading order rather than everything flashing at
   once. Content is legible with or without the motion: opacity is the only thing
   that starts at 0, and the no-JS/reduced-motion path shows everything. */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-base) var(--ease-out) var(--d, 0ms),
    transform var(--dur-base) var(--ease-out) var(--d, 0ms);
}
.no-js [data-reveal] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============================================================ BREADCRUMBS */
.crumbs { border-bottom: 1px solid var(--rule-2); background: var(--surface); }
.crumbs ol {
  display: flex; flex-wrap: wrap; gap: .3rem .55rem; list-style: none; margin: 0; padding: 0;
  font-size: .8rem; color: var(--ink-3);
}
.crumbs .wrap { padding-block: .6rem; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--rule); }
.crumbs [aria-current="page"] { color: var(--ink-3); }

/* ============================================================ ARTICLE LAYOUT */
.page { padding-block: clamp(1.8rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem); }
.page .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
.page--full .wrap { grid-template-columns: minmax(0, 1fr); }

.masthead-block { margin-bottom: 1.6rem; }
.eyebrow {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-ink);
  display: flex; align-items: center; gap: .6rem; margin-bottom: .85rem;
}
.eyebrow::after { content: ""; height: 1px; flex: 1; background: var(--rule-2); }
h1.title {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: var(--step-4); line-height: 1.1; letter-spacing: -.02em;
  margin: 0; text-wrap: balance; color: var(--ink);
}
.byline {
  margin-top: .9rem; font-size: .84rem; color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center;
}
.byline b { color: var(--ink-2); font-weight: 600; }

/* ---- prose: the migrated bodies ---- */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--flow); }
.prose > * { margin-bottom: 0; margin-top: 0; }
.prose > * + * { margin-top: var(--flow); }
.prose p { margin: 0; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display); font-weight: var(--display-weight);
  line-height: 1.2; letter-spacing: -.014em; color: var(--ink);
  text-wrap: balance; margin: 0;
}
.prose > h2 { font-size: var(--step-3); margin-top: 2.4rem; }
.prose > h3 { font-size: var(--step-2); margin-top: 1.9rem; }
.prose > h4 { font-size: var(--step-1); margin-top: 1.6rem; }
.prose > h2 + *, .prose > h3 + *, .prose > h4 + * { margin-top: .7rem; }
.prose > h2 {
  padding-bottom: .4rem; border-bottom: 1px solid var(--rule-2);
}
.prose ul, .prose ol { margin: 0; padding-left: 1.35rem; }
.prose li + li { margin-top: .38rem; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.35rem; }
.prose ul > li::before {
  content: ""; position: absolute; left: .28rem; top: .62em;
  width: .38rem; height: .38rem; border-radius: 50%; background: var(--accent);
}
.prose ol { list-style: decimal; }
.prose ol > li::marker { color: var(--accent); font-family: var(--font-mono); font-size: .85em; }
.prose strong { font-weight: 650; color: var(--ink); }
.prose blockquote {
  margin: 0; padding: .2rem 0 .2rem 1.2rem;
  border-left: 3px solid var(--accent); color: var(--ink-2);
  font-size: var(--step-1);
}
.prose figure { margin: 0; }
.prose figure img { border-radius: var(--radius); border: 1px solid var(--rule-2); }
.prose figcaption {
  font-size: .8rem; color: var(--ink-3); margin-top: .5rem;
  padding-left: .7rem; border-left: 2px solid var(--rule);
}
.prose hr { border: 0; border-top: 1px solid var(--rule-2); margin-block: 2rem; }
.prose code, .prose kbd {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--accent-pale); padding: .1em .35em; border-radius: 2px;
}

/* ---- description lists: the glossary pages ---- */
.prose dl {
  margin: 0; display: grid; gap: 0;
  border-top: 1px solid var(--rule-2);
}
.prose dt {
  font-family: var(--font-display); font-weight: 650; color: var(--ink);
  font-size: var(--step-1); line-height: 1.3; padding-top: 1.05rem;
  scroll-margin-top: 5rem;
}
.prose dd {
  margin: .35rem 0 0; padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--rule-2); color: var(--ink-2);
}

/* ---- tables ---- */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
.prose caption {
  caption-side: top; text-align: left; font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); padding: .8rem .9rem .55rem;
}
.prose th, .prose td {
  text-align: left; padding: .68rem .9rem; vertical-align: top;
  border-bottom: 1px solid var(--rule-2);
}
.prose thead th {
  background: var(--surface); font-family: var(--font-mono);
  font-size: .67rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); font-weight: 600; border-bottom: 1.5px solid var(--rule);
  position: sticky; top: 0;
}
.prose tbody th[scope="row"] { font-weight: 650; color: var(--ink); width: 34%; }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose tbody tr:hover > * { background: var(--accent-pale); }
.prose td:has(+ td:last-child), .prose .num { font-variant-numeric: tabular-nums; }

/* ============================================================ SIDEBAR */
.aside { display: grid; gap: 1.1rem; position: sticky; top: 1.2rem; }
.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); padding: 1.15rem 1.2rem;
}
.card h2, .card h3 {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 .75rem;
  font-weight: 600;
}
.card--course { border-top: 3px solid var(--accent); }
.card--course .name {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: var(--step-1); line-height: 1.25; color: var(--ink); margin: 0 0 .5rem;
}
.card--course p { margin: 0 0 .9rem; font-size: .875rem; color: var(--ink-2); }
.card--course .price {
  display: flex; align-items: baseline; gap: .45rem; margin-bottom: .9rem;
  font-family: var(--font-mono); font-size: .82rem; color: var(--ink-3);
}
.card--course .price b { font-size: 1.35rem; color: var(--ink); font-weight: 700; }
.card--course .price s { color: var(--ink-3); }
.card--course .btn { width: 100%; justify-content: center; }
.card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .875rem; }
.card ul a { color: var(--ink-2); text-decoration: none; }
.card ul a:hover { color: var(--accent-ink); text-decoration: underline; }

.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .42rem; counter-reset: toc; font-size: .85rem; }
.toc li { counter-increment: toc; display: flex; gap: .5rem; }
.toc li::before {
  content: counter(toc, decimal-leading-zero); font-family: var(--font-mono);
  font-size: .68rem; color: var(--accent); padding-top: .18em; flex: none;
}
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent-ink); text-decoration: underline; }

/* ============================================================ CYCLE DIAGRAM */
.cycle {
  margin: 0; border: 1px solid var(--rule); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden;
}
.cycle__head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap; padding: .75rem 1rem; border-bottom: 1px solid var(--rule);
}
.cycle__head h2, .cycle__head p {
  font-family: var(--font-mono); font-size: .69rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin: 0; font-weight: 600;
}
.cycle__legend { display: flex; gap: .95rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: .66rem; color: var(--ink-3); }
.cycle__legend span { display: flex; align-items: center; gap: .35rem; }
.cycle__legend i { width: 8px; height: 8px; border-radius: 2px; }
.cycle__body { padding: 1.2rem 1rem; overflow-x: auto; }
.cycle svg { min-width: 700px; display: block; margin-inline: auto; }
.cycle-node rect { fill: var(--paper); stroke: var(--rule); }
.cycle-node:hover rect { stroke: var(--accent); fill: var(--accent-pale); }
.cycle-num { font-family: var(--font-mono); font-size: 9px; fill: var(--accent); letter-spacing: .07em; }
.cycle-lab { font-family: var(--font-body); font-size: 11.5px; font-weight: 600; fill: var(--ink); }
.cycle-sub { font-family: var(--font-mono); font-size: 8.5px; fill: var(--ink-3); }
.cycle-flow { stroke: var(--good); stroke-width: 1.5; fill: none; opacity: .8; }
.cycle-loop { stroke: var(--attn); stroke-width: 1.5; fill: none; stroke-dasharray: 4 3; }
.cycle-loop-lab { font-family: var(--font-body); font-size: 10.5px; font-weight: 600; fill: var(--attn); }

/* The claim itself. Job: demonstrate that the course covers the whole cycle
   rather than claiming "comprehensive". Three beats - it travels the path once
   on scroll-into-view (demo), settles on stage 1 with a soft pulse (invite),
   and stops for good the moment the visitor touches a stage (yield). */
.cycle-token { opacity: 0; transition: opacity var(--dur-base) var(--ease-out); }
.cycle.is-playing .cycle-token, .cycle.is-settled .cycle-token { opacity: 1; }
.cycle-token circle { fill: var(--good); }
.cycle-token .halo {
  fill: none; stroke: var(--good); stroke-width: 1.5; opacity: 0;
  transform-box: fill-box; transform-origin: center;
}
.cycle.is-settled .cycle-token .halo { animation: cyc-invite 2.6s var(--ease-in-out) infinite; }
.cycle.is-yielded .cycle-token .halo { animation: none; opacity: 0; }
.cycle.is-yielded .cycle-token { opacity: .45; }
@keyframes cyc-invite {
  0%, 70%, 100% { opacity: 0; r: 5; }
  18%           { opacity: .55; r: 5; }
  55%           { opacity: 0; r: 13; }
}
/* Only the active stage is highlighted, so the eye follows one thing. */
.cycle-node rect { transition: fill var(--dur-base) var(--ease-out), stroke var(--dur-base) var(--ease-out); }
.cycle-node.is-active rect { stroke: var(--good); fill: var(--good-pale); }
.cycle-node { cursor: pointer; }
.cycle-node:focus-visible rect { stroke: var(--accent); stroke-width: 2; }
.cycle__stage {
  font-family: var(--font-mono); font-size: .69rem; color: var(--ink-2);
  min-height: 1.2em; transition: color var(--dur-fast) var(--ease-out);
}
.cycle__stage b { color: var(--good); }
@media (prefers-reduced-motion: reduce) {
  .cycle-token { opacity: 1; }
  .cycle.is-settled .cycle-token .halo { animation: none; }
}

/* ============================================================ FOOTER */
.footer { background: var(--ink); color: var(--paper); margin-top: auto; }
.footer .wrap { padding-block: clamp(2.2rem, 5vw, 3.2rem); }
.footer__grid {
  display: grid; grid-template-columns: 1.3fr repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2.4rem);
}
.footer__brand p { font-size: .875rem; opacity: .78; margin: .8rem 0 0; max-width: 32ch; }
.footer h2 {
  font-family: var(--font-mono); font-size: .67rem; letter-spacing: .12em;
  text-transform: uppercase; opacity: .62; margin: 0 0 .8rem; font-weight: 600;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer a { color: inherit; text-decoration: none; opacity: .84; font-size: .875rem; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.footer__base {
  border-top: 1px solid rgb(255 255 255 / .14); margin-top: 2.2rem; padding-top: 1.2rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .72rem; opacity: .68;
}

/* ============================================================ HOME */
.hero { border-bottom: 1px solid var(--rule); }
:root .hero {
  background: linear-gradient(90deg, var(--rule-2) 1px, transparent 1px) 0 0 / 68px 100%, var(--paper);
}

.hero .wrap {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 3.5rem); align-items: center;
  padding-block: clamp(2.4rem, 6vw, 3.8rem);
}
.hero--stack .wrap { grid-template-columns: minmax(0, 1fr); }
.hero h1 {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: var(--step-5); line-height: 1.06; letter-spacing: -.024em;
  margin: 0; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin: 1.15rem 0 0; font-size: var(--step-1); color: var(--ink-2); max-width: 46ch; }
.hero__cta { display: flex; gap: .7rem; margin-top: 1.8rem; flex-wrap: wrap; align-items: center; }
.priceline {
  margin: 1.3rem 0 0; font-family: var(--font-mono); font-size: .8rem;
  color: var(--ink-2); display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
.priceline b { color: var(--ink); font-size: 1rem; font-weight: 700; }
.priceline s { opacity: .7; }
.priceline .tag {
  background: var(--accent-pale); color: var(--accent-ink);
  padding: .12rem .45rem; border-radius: 2px; font-weight: 600;
}

/* coverage map - direction A */
.formcard {
  border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--surface);
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--ink) 8%, transparent);
}
.formcard__head {
  border-bottom: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: .5rem .8rem; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: .67rem; letter-spacing: .1em; text-transform: uppercase;
}
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); }
.fgrid > div {
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .7rem .75rem .8rem; min-height: 78px;
}
.fgrid > div:nth-child(3n) { border-right: 0; }
.fgrid > div:nth-last-child(-n+3) { border-bottom: 0; }
.fgrid .num { font-family: var(--font-mono); font-size: .6rem; color: var(--accent); letter-spacing: .06em; display: block; margin-bottom: .3rem; }
.fgrid .lbl { font-size: .78rem; font-weight: 600; line-height: 1.32; display: block; }
.fgrid .val { font-family: var(--font-mono); font-size: .63rem; color: var(--ink-3); margin-top: .28rem; display: block; }
.fgrid > div.on { background: var(--accent-pale); }

/* story card - direction B */
.storycard {
  background: var(--paper); color: var(--ink); border-radius: var(--radius);
  padding: 1.85rem; border-top: 3px solid var(--accent);
  box-shadow: 0 24px 56px -22px rgb(0 0 0 / .45); margin: 0;
}
.storycard .avatar {
  width: 60px; height: 60px; border-radius: 50%; background: var(--accent-pale);
  display: grid; place-items: center; color: var(--accent); margin-bottom: 1rem;
}
.storycard blockquote {
  font-family: var(--font-display); font-size: var(--step-1); line-height: 1.5;
  font-style: italic; color: var(--ink); margin: 0; padding: 0; border: 0;
}
.storycard figcaption {
  margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--rule-2);
  font-size: .85rem; color: var(--ink-2);
}
.storycard figcaption b { display: block; color: var(--ink); font-family: var(--font-body); font-weight: 650; font-size: .93rem; }

/* stat strip */

/* home sections */
.sec { padding-block: clamp(2.4rem, 5.5vw, 4rem); border-bottom: 1px solid var(--rule); }
.sec--surface { background: var(--surface); }
.sechead { max-width: 60ch; margin-bottom: 2.1rem; }
.sechead h2 {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: var(--step-3); line-height: 1.13; letter-spacing: -.018em;
  margin: 0; text-wrap: balance;
}
.sechead p { color: var(--ink-2); margin: .7rem 0 0; }

.authority .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 4vw, 3rem); align-items: center; }
.authority blockquote {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: var(--step-2); line-height: 1.42; letter-spacing: -.012em;
  margin: 0; padding: 0; border: 0; text-wrap: balance;
}
.authority .who { margin-top: 1.15rem; display: flex; gap: .8rem; align-items: center; }
.authority .who .av {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--accent-pale); border: 1px solid var(--rule);
  display: grid; place-items: center; color: var(--accent-ink);
}
.authority blockquote .qmark {
  color: var(--accent); opacity: .55; vertical-align: .28em; margin-right: .25rem;
}
.hero__lead { display: grid; align-content: center; }
.authority .who b { display: block; font-size: .94rem; }
.authority .who span { font-size: .82rem; color: var(--ink-3); }
.factlist { display: grid; gap: 1px; background: var(--rule-2); border: 1px solid var(--rule-2); border-radius: var(--radius-lg); overflow: hidden; }
.factlist div { background: var(--surface); padding: .92rem 1.05rem; display: flex; gap: .75rem; align-items: flex-start; font-size: .89rem; }
.factlist svg { flex: none; margin-top: .2rem; color: var(--accent); }

.finalcta { background: var(--ink); color: var(--paper); border: 0; }
.finalcta .wrap {
  padding-block: clamp(2.4rem, 5vw, 3.4rem); display: flex;
  justify-content: space-between; align-items: center; gap: 2.2rem; flex-wrap: wrap;
}
.finalcta h2 {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: var(--step-3); line-height: 1.15; letter-spacing: -.018em;
  margin: 0; max-width: 30ch; text-wrap: balance;
}
.finalcta p { margin: .5rem 0 0; opacity: .8; font-size: .93rem; }
.finalcta .btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.finalcta .btn:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }

/* ============================================================ BEFORE / AFTER
   Job: make a layperson understand what they will be able to DO. Four raw
   figures (9 / 35 / $200 / 420) are insider trivia; a before-and-after is a
   comparison, which is what people actually grasp. */
.transform { border-bottom: 1px solid var(--rule); background: var(--surface); }
.transform .wrap {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: clamp(1.2rem, 3vw, 2.6rem); align-items: stretch;
  padding-block: clamp(2rem, 4vw, 2.9rem);
}
.tcol { display: grid; gap: .7rem; align-content: start; }
.tcol__label {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .13em;
  text-transform: uppercase; display: flex; align-items: center; gap: .5rem;
}
.tcol--before .tcol__label { color: var(--ink-3); }
.tcol--after .tcol__label { color: var(--good); }
.tcol ul { display: grid; gap: .5rem; }
.tcol li {
  display: flex; gap: .6rem; align-items: flex-start;
  font-size: .93rem; line-height: 1.5; padding-left: 0;
}
.tcol li::before { content: none; }
.tcol li svg { flex: none; margin-top: .22rem; }
.tcol--before li { color: var(--ink-3); }
.tcol--before li svg { color: var(--rule); }
.tcol--after li { color: var(--ink); }
.tcol--after li svg { color: var(--good); }
.tcol--after li b { font-weight: 650; }
.tarrow { display: grid; place-items: center; color: var(--accent); }
.tarrow svg { transition: transform var(--dur-slow) var(--ease-out); }
.transform.is-in .tarrow svg { transform: translateX(4px); }

/* ============================================================ FIGURES ROW
   Real counts, kept as secondary evidence under the before/after. Deliberately
   not rounded: 83 and 420 are the actual numbers, and specific figures read as
   measured where round ones read as invented. */
.figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rule-2); }
.fig-cell { background: var(--paper); padding: 1.15rem 1.2rem; display: grid; gap: .25rem; }
.fig-cell .n {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 1.75rem; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.fig-cell .k { font-size: .82rem; color: var(--ink-2); line-height: 1.42; }
.fig-cell .src { font-family: var(--font-mono); font-size: .64rem; color: var(--ink-3); }

/* ============================================================ CURRICULUM ACCORDION
   Progressive disclosure: 83 lesson names would bury the page, and hiding them
   entirely makes the course look thin. The topic is the always-visible layer;
   its lessons open on demand. Native <details> so it works without JS and is
   keyboard-operable for free. */
.curric { display: grid; gap: .5rem; }
.topic {
  border: 1px solid var(--rule); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.topic[open] { border-color: var(--accent); box-shadow: 0 8px 24px -14px color-mix(in srgb, var(--ink) 40%, transparent); }
.topic:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--rule)); }
.topic > summary {
  cursor: pointer; list-style: none; padding: .95rem 1.1rem;
  display: grid; grid-template-columns: 2.6rem 1fr auto auto; gap: .9rem;
  align-items: center;
}
.topic > summary::-webkit-details-marker { display: none; }
.topic > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.topic__n {
  font-family: var(--font-mono); font-size: .72rem; color: var(--accent);
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.topic__name {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: var(--step-1); line-height: 1.25; color: var(--ink);
}
.topic__name small {
  display: block; font-family: var(--font-body); font-weight: 400;
  font-size: .84rem; color: var(--ink-2); margin-top: .18rem; line-height: 1.45;
}
.topic__count { font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3); white-space: nowrap; }
.topic__chev { color: var(--ink-3); transition: transform var(--dur-base) var(--ease-out); }
.topic[open] .topic__chev { transform: rotate(180deg); color: var(--accent); }
.topic__body { padding: 0 1.1rem 1.05rem 4.6rem; }
.topic__body ul {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .4rem .9rem; border-top: 1px solid var(--rule-2); padding-top: .85rem;
}
.topic__body li {
  font-size: .875rem; color: var(--ink-2); padding-left: .95rem;
  position: relative; line-height: 1.45;
}
.topic__body li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: .3rem; height: .3rem; border-radius: 50%; background: var(--accent);
}
.topic--bonus .topic__n { color: var(--attn); }
.topic--bonus[open] { border-color: var(--attn); }
.topic--bonus .topic__tag {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--attn); background: var(--attn-pale);
  padding: .12rem .4rem; border-radius: 2px; margin-left: .5rem;
}

/* ============================================================ RISK REVERSAL
   Job: dismantle the three specific hesitations this audience actually has -
   "is it a subscription", "do I have to pay to find out", "am I technical
   enough" - at the point of intent rather than in a paragraph elsewhere. */
.reassure {
  display: flex; flex-wrap: wrap; gap: .5rem .5rem; margin-top: 1rem;
  align-items: center;
}
.reassure span {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--ink-2);
  background: var(--good-pale); border: 1px solid color-mix(in srgb, var(--good) 22%, transparent);
  padding: .3rem .6rem; border-radius: 999px;
}
.reassure svg { color: var(--good); flex: none; }

/* ============================================================ SECTION TRANSITIONS
   Direction A is a claim form, so the hairline rule between sections is the
   point rather than a default to soften away. What makes it deliberate is that
   the rule is the only divider used, at one weight, everywhere. */

/* ============================================================ 404 / SEARCH */
.notfound { padding-block: clamp(3rem, 8vw, 6rem); text-align: center; }
.notfound h1 { font-size: var(--step-4); }
.notfound p { color: var(--ink-2); max-width: 52ch; margin-inline: auto; }
.pagelist { columns: 2; column-gap: 2.5rem; list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.pagelist li { break-inside: avoid; margin-bottom: .45rem; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1000px) {
  .page .wrap { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 860px) {
  .hero .wrap, .authority .wrap { grid-template-columns: minmax(0, 1fr); }
  /* Before/after stacks, and the arrow rotates to point down the page. */
  .transform .wrap { grid-template-columns: minmax(0, 1fr); }
  .tarrow { justify-self: start; }
  .tarrow svg { transform: rotate(90deg); }
  .transform.is-in .tarrow svg { transform: rotate(90deg) translateX(4px); }
  .figs { grid-template-columns: repeat(2, 1fr); }
  .topic > summary { grid-template-columns: 2.2rem 1fr auto; row-gap: .4rem; }
  .topic__count { grid-column: 2 / -1; }
  .topic__body { padding-left: 1.1rem; }
  .navtoggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    box-shadow: 0 18px 34px -18px rgb(0 0 0 / .3);
  }
  .nav[data-open="true"] { display: block; }
  .nav > ul { flex-direction: column; gap: 0; padding: .5rem clamp(1.1rem, 4vw, 2rem) 1rem; }
  .nav > ul > li { border-bottom: 1px solid var(--rule-2); }
  .nav > ul > li:last-child { border-bottom: 0; }
  .nav a { padding-block: .7rem; font-size: .95rem; }
  .nav ul ul { position: static; display: block; border: 0; box-shadow: none; padding: 0 0 .5rem .8rem; min-width: 0; background: transparent; }
}
@media (max-width: 620px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .aside { grid-template-columns: minmax(0, 1fr); }
  .fgrid { grid-template-columns: repeat(2, 1fr); }
  .fgrid > div:nth-child(3n) { border-right: 1px solid var(--rule); }
  .fgrid > div:nth-child(2n) { border-right: 0; }
  .pagelist { columns: 1; }
  .prose tbody th[scope="row"] { width: auto; }
  .figs { grid-template-columns: minmax(0, 1fr); }
  .topic__body ul { grid-template-columns: minmax(0, 1fr); }
  .reassure { gap: .4rem; }
  .reassure span { font-size: .76rem; }
  .finalcta .wrap { align-items: flex-start; }
  .finalcta .btn { width: 100%; }
}

/* ============================================================ PRINT */
@media print {
  .topbar, .nav, .navtoggle, .aside, .footer, .finalcta,   body { background: #fff; color: #000; font-size: 11pt; }
  .page .wrap { grid-template-columns: 1fr; }
  .prose a::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}

/* ============================================================ INTERIOR PAGES
   The homepage got the design pass first; these are the treatments that carry
   it across the other 423 pages. Same tokens, same motion system, no new
   colours - what changes is that reference content has different jobs from a
   sales page: it is scanned, returned to, and read at length. */

/* Opening paragraph as a lede. Gives every page a typographic entry point,
   which matters most on the 119 pages that have no headings to break them up. */
.prose > p:first-of-type {
  font-size: var(--step-1);
  line-height: 1.58;
  color: var(--ink);
}
.prose > p:first-of-type::first-letter { font-weight: 650; }

/* Reading time, not raw word count. "618 words" is a fact about the document;
   "3 min read" is a fact the reader can act on. */
.byline .rt { display: inline-flex; align-items: center; gap: .35rem; }
.byline .rt svg { color: var(--ink-3); }

/* ---- glossary index --------------------------------------------------------
   The four terminology pages carry 170 <dt> between them with no way in. This
   is an A-Z jump bar built from the terms actually present, so a letter is only
   offered when it leads somewhere. Sticky, because the whole point is to use it
   from halfway down. */
.azbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: .25rem;
  padding: .6rem 0; margin-bottom: 1.4rem;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule-2);
}
.azbar a {
  font-family: var(--font-mono); font-size: .78rem; font-weight: 600;
  min-width: 1.9rem; min-height: 1.9rem; padding: 0 .35rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--ink-2); text-decoration: none; background: var(--surface);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.azbar a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.azbar .n { color: var(--ink-3); border-style: dashed; pointer-events: none; opacity: .45; }
.prose h2.azletter {
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .16em;
  color: var(--accent); border-bottom: 1px solid var(--rule);
  padding-bottom: .35rem; margin-top: 2.2rem;
}

/* ---- question and answer ---------------------------------------------------
   22 pages are reader questions with Gina's reply. Marking the reply visually
   tells you at a glance where the question stops and the answer starts, which
   the migrated markup did not. */
.qa-note {
  display: flex; gap: .7rem; align-items: flex-start;
  background: var(--accent-pale); border-left: 3px solid var(--accent);
  padding: .85rem 1.05rem; margin-bottom: 1.4rem;
  font-size: .9rem; color: var(--ink-2); border-radius: 0 var(--radius) var(--radius) 0;
}
.qa-note svg { flex: none; margin-top: .18rem; color: var(--accent); }
.qa-note b { color: var(--ink); }
.page--qa .prose > h2 {
  display: flex; align-items: center; gap: .55rem;
}
.page--qa .prose > h2::before {
  content: ""; width: .55rem; height: .55rem; flex: none;
  background: var(--good); border-radius: 50%;
}

/* ---- sidebar --------------------------------------------------------------- */
.card--course .price s { opacity: .75; }
.card--course .reassure { margin-top: .8rem; }
.card--course .reassure span {
  font-size: .74rem; padding: .22rem .5rem;
  background: transparent; border-color: var(--rule);
}
.aside .card { transition: border-color var(--dur-fast) var(--ease-out); }
.aside .card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); }

/* ---- end-of-article call to action -----------------------------------------
   A reader who finishes a reference page has just demonstrated interest in the
   subject the course teaches. This is the one place on an interior page that
   asks for anything. */
.endcta {
  margin-top: 2.6rem; padding: 1.4rem 1.5rem;
  border: 1px solid var(--rule); border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg); background: var(--surface);
  display: grid; gap: .7rem;
}
.endcta h2 {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: var(--step-2); line-height: 1.2; margin: 0; text-wrap: balance;
}
.endcta p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.endcta .row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; margin-top: .3rem; }

@media (max-width: 620px) {
  .azbar { gap: .2rem; padding: .5rem 0; }
  .azbar a { min-width: 1.75rem; font-size: .74rem; }
  .endcta { padding: 1.15rem 1.15rem; }
}
