/* Chip 101, design option "cards": one stylesheet for the landing page, the catalog and a lesson.
   Dark theme, system fonts only. Every text colour keeps WCAG AA contrast on the surface it sits on. */

:root {
  color-scheme: dark;
  --bg: #0a0b0f;
  --bg-2: #0e1016;
  --surface: #151922;
  --surface-2: #1b202a;
  --surface-3: #262c38;
  --art-bg: #11141b;
  --border: #2a303c;
  --border-strong: #3b4351;
  --lip: #232937;
  --ink: #f3f5f8;
  --muted: #aab2c0;
  --subtle: #8d96a6;
  --brand: #4cdbe3;
  --go: #6de18b;
  --go-hover: #8aeba3;
  --go-deep: #2f9e57;
  --go-ink: #06150c;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: ui-serif, "New York", Georgia, "Noto Serif", "Times New Roman", serif;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.3, 1.45, 0.5, 1);

  /* Lesson pictures paint only with this palette, the same values as the real site. */
  --fig-ink: oklch(0.97 0 0);
  --fig-muted: oklch(0.8 0.01 250);
  --fig-line: oklch(0.62 0.02 250);
  --fig-panel: oklch(0.27 0.015 250);
  --fig-accent: oklch(0.82 0.12 200);
  --fig-accent-2: oklch(0.85 0.14 85);
  --fig-warm: oklch(0.77 0.15 50);
  --fig-good: oklch(0.82 0.16 150);
  --fig-bad: oklch(0.74 0.17 25);
}

/* Section colours: each section of the course keeps one hue everywhere it appears. */
.s1 { --c: #4cdbe3; }
.s2 { --c: #f8c655; }
.s3 { --c: #6de18b; }
.s4 { --c: #bda6ff; }
.s5 { --c: #ff9555; }
.s6 { --c: #7cb4fc; }
.s1, .s2, .s3, .s4, .s5, .s6 {
  --c-tint: color-mix(in oklab, var(--c) 15%, #151922);
  --c-deep: color-mix(in oklab, var(--c) 52%, #05070a);
  --c-light: color-mix(in oklab, var(--c) 45%, #ffffff);
  --c-edge: color-mix(in oklab, var(--c) 45%, #2a303c);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-variant-numeric: lining-nums;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
svg { display: block; flex: none; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html:not(.js) .js-only { display: none !important; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 768px) { .wrap { padding-inline: 32px; } }

/* ---------- Lesson pictures (the real site's classes) ---------- */
.lesson-art { display: block; width: 100%; height: auto; fill: var(--fig-ink); font-family: var(--font-sans); font-size: 22px; }
.fill-fig-ink { fill: var(--fig-ink); }
.fill-fig-muted { fill: var(--fig-muted); }
.fill-fig-line { fill: var(--fig-line); }
.fill-fig-panel { fill: var(--fig-panel); }
.fill-fig-accent { fill: var(--fig-accent); }
.fill-fig-accent-2 { fill: var(--fig-accent-2); }
.fill-fig-warm { fill: var(--fig-warm); }
.fill-fig-good { fill: var(--fig-good); }
.fill-fig-bad { fill: var(--fig-bad); }
.stroke-fig-ink { stroke: var(--fig-ink); }
.stroke-fig-muted { stroke: var(--fig-muted); }
.stroke-fig-line { stroke: var(--fig-line); }
.stroke-fig-panel { stroke: var(--fig-panel); }
.stroke-fig-accent { stroke: var(--fig-accent); }
.stroke-fig-accent-2 { stroke: var(--fig-accent-2); }
.stroke-fig-warm { stroke: var(--fig-warm); }
.stroke-fig-good { stroke: var(--fig-good); }
.stroke-fig-bad { stroke: var(--fig-bad); }
.fill-none { fill: none; }

.art-card {
  display: block;
  padding: 14px;
  border-radius: 20px;
  background: var(--art-bg);
  border: 1px solid var(--border);
}

/* Section pictures: small drawings in the section's colour. */
.sec-art {
  display: grid; place-items: center;
  width: 76px; height: 76px; flex: none;
  border-radius: 22px;
  background: var(--c-tint);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 22%, transparent);
}
.sec-art svg { width: 62px; height: 62px; }
.sa-c { fill: var(--c); }
.sa-d { fill: var(--c-deep); }
.sa-l { fill: var(--c-light); }
.sa-t { fill: var(--c-tint); }
.sa-k { fill: #0b0d12; }
.sa-sc { stroke: var(--c); fill: none; }
.sa-sl { stroke: var(--c-light); fill: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 999px;
  font-weight: 700; font-size: 17px; line-height: 1.2; text-align: center;
  cursor: pointer; user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
}
.btn svg { width: 20px; height: 20px; }
.btn-lg { min-height: 60px; padding: 0 32px; font-size: 19px; }
.btn-go { background: var(--go); color: var(--go-ink); box-shadow: 0 5px 0 var(--go-deep); }
.btn-quiet { background: var(--surface-2); color: var(--ink); box-shadow: 0 5px 0 var(--lip), inset 0 0 0 1px var(--border); }
.btn:active { transform: translateY(4px); }
.btn-go:active { box-shadow: 0 1px 0 var(--go-deep); }
.btn-quiet:active { box-shadow: 0 1px 0 var(--lip), inset 0 0 0 1px var(--border); }
.btn[disabled] { opacity: 0.4; cursor: default; transform: none; box-shadow: inset 0 0 0 1px var(--border); }
@media (hover: hover) {
  .btn-go:hover { background: var(--go-hover); }
  .btn-quiet:not([disabled]):hover { background: var(--surface-3); }
}

/* ---------- Site header ---------- */
.site-head { position: relative; z-index: 50; padding: 12px 12px 0; }
.site-head.is-floating { position: sticky; top: 0; }
/* While the page scrolls under the floating bar, fade it out above and around the bar. */
.site-head.is-floating::before {
  content: ""; position: absolute; inset: 0 0 -18px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, var(--bg) 0%, rgba(10, 11, 15, 0.82) 55%, rgba(10, 11, 15, 0));
}
.nav {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 62px; padding: 6px 6px 6px 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: rgba(18, 21, 29, 0.95);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 10px 0 6px; border-radius: 999px;
  font-weight: 800; font-size: 19px; letter-spacing: -0.01em; color: var(--ink);
}
.mark { width: 30px; height: 30px; color: var(--brand); }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; font-size: 16px; color: var(--ink);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color 0.15s ease;
}
.nav-link[aria-current="page"] { background: transparent; box-shadow: none; color: var(--muted); }
@media (hover: hover) {
  .nav-link:hover { background: var(--surface-3); }
  .nav-link[aria-current="page"]:hover { background: var(--surface-2); color: var(--ink); }
}

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: 14px; font-weight: 650; line-height: 1.4;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 4px rgba(109, 225, 139, 0.16); }
.display {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(42px, 6.6vw, 78px); line-height: 1.04; letter-spacing: -0.025em;
  text-wrap: balance;
}
.display em, .display-2 em { font-style: italic; color: var(--brand); }
.display-2 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -0.02em;
  text-wrap: balance;
}
.lede { font-size: clamp(17px, 1.9vw, 20px); line-height: 1.55; color: var(--muted); max-width: 44ch; text-wrap: pretty; }
.kicker { font-size: 14px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 14px; }
.section { padding: 96px 0; }
.section-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.section-lede { font-size: 18px; color: var(--muted); max-width: 46ch; margin: 18px auto 0; text-wrap: pretty; }
@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 32px; }
}

/* ---------- Landing: hero ---------- */
.hero { position: relative; isolation: isolate; overflow: clip; padding-top: 32px; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: -120px 0 0; z-index: -2;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1.6px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(70% 55% at 50% 32%, #000 20%, transparent 78%);
  mask-image: radial-gradient(70% 55% at 50% 32%, #000 20%, transparent 78%);
}
.hero-copy { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.hero .lede { margin: 0 auto; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 6px; }
.hero-note { font-size: 15px; color: var(--subtle); }

/* The product shot: the four pictures of a real lesson, fanned out like cards. */
.fan { position: relative; height: 410px; max-width: 1280px; margin: 44px auto 0; }
.fan::before {
  content: ""; position: absolute; left: 50%; top: 46%; z-index: -1;
  width: min(980px, 92%); height: 78%; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(76, 219, 227, 0.2), rgba(189, 166, 255, 0.09) 60%, transparent);
  filter: blur(26px);
}
.fan-card {
  --x: 0px; --y: 0px; --r: 0deg; --s: 1; --z: 1;
  position: absolute; left: 50%; top: 22px; z-index: var(--z);
  width: 284px; margin-left: -142px;
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 14px 18px;
  border-radius: 26px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 6px 0 var(--lip), 0 34px 60px -24px rgba(0, 0, 0, 0.75);
  text-align: left;
  transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(var(--s));
  transition: transform 0.4s var(--ease-out), box-shadow 0.2s ease, border-color 0.2s ease;
}
/* Spaced so no card hides the title of its neighbour. */
.fan-card:nth-child(1) { --x: -448px; --y: 46px; --r: -7deg; --z: 1; }
.fan-card:nth-child(2) { --x: -152px; --y: 4px; --r: -3deg; --z: 3; }
.fan-card:nth-child(3) { --x: 152px; --y: 4px; --r: 3deg; --z: 4; }
.fan-card:nth-child(4) { --x: 448px; --y: 46px; --r: 7deg; --z: 2; }
.fan-card .art-card { padding: 8px 6px; border-radius: 16px; }
.fan-card:focus-visible { transform: translate(var(--x), calc(var(--y) - 16px)) rotate(var(--r)) scale(var(--s)); z-index: 9; }
@media (hover: hover) {
  .fan-card:hover {
    transform: translate(var(--x), calc(var(--y) - 16px)) rotate(var(--r)) scale(var(--s));
    z-index: 9; border-color: var(--border-strong);
  }
}
.fan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 0; }
.fan-lesson { font-size: 14px; font-weight: 700; color: var(--muted); }
.fan-count { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pips { display: flex; gap: 5px; padding: 0 4px; }
.pips i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); }
.pips i.on { background: var(--go); }
.fan-title { padding: 0 4px; font-size: 17px; font-weight: 750; line-height: 1.3; }

@media (max-width: 1299px) {
  .fan-card { width: 236px; margin-left: -118px; }
  .fan-card:nth-child(1) { --x: -372px; }
  .fan-card:nth-child(2) { --x: -124px; }
  .fan-card:nth-child(3) { --x: 124px; }
  .fan-card:nth-child(4) { --x: 372px; }
}
/* Phones and tablets: a neat stack, the first picture in front and the next two peeking out above it. */
@media (max-width: 1023px) {
  .fan { height: auto; display: grid; justify-items: center; margin-top: 36px; padding: 30px 0 40px; }
  .fan-card {
    position: relative; grid-area: 1 / 1; left: auto; top: auto; margin: 0;
    width: min(340px, 84vw); transform-origin: 50% 0;
  }
  .fan-card:nth-child(1) { --x: 0px; --y: 0px; --r: 0deg; --s: 1; --z: 4; }
  .fan-card:nth-child(2) { --x: 0px; --y: -13px; --r: 0deg; --s: 0.93; --z: 3; background: #12151d; }
  .fan-card:nth-child(3) { --x: 0px; --y: -26px; --r: 0deg; --s: 0.86; --z: 2; background: #0f1218; }
  .fan-card:nth-child(4) { display: none; }
}

/* ---------- Landing: how a lesson works ---------- */
.how-rows { display: grid; gap: 24px; }
.how-row {
  display: grid; gap: 28px; align-items: center;
  padding: 28px 22px; border-radius: 32px;
  background: var(--bg-2); border: 1px solid var(--border);
}
.how-num {
  display: inline-grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px;
  border-radius: 13px; background: var(--surface-2); color: var(--brand);
  font-weight: 800; font-size: 18px; box-shadow: 0 4px 0 var(--lip), inset 0 0 0 1px var(--border);
}
.how-text h3 { font-size: clamp(25px, 2.8vw, 32px); line-height: 1.15; letter-spacing: -0.015em; font-weight: 750; margin-bottom: 12px; }
.how-text p { font-size: 18px; color: var(--muted); max-width: 38ch; }
/* Phones: no box around each row, so the example card gets the full width. */
@media (max-width: 639px) {
  .how-rows { gap: 64px; }
  .how-row { padding: 0; border: 0; border-radius: 0; background: none; gap: 24px; }
}
@media (min-width: 900px) {
  .how-row { grid-template-columns: 1fr 1.1fr; gap: 64px; padding: 52px 60px; }
  .how-row.is-flip .how-text { order: 2; }
}

.mock {
  display: block; padding: 22px;
  border-radius: 28px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 6px 0 var(--lip), 0 40px 70px -40px rgba(0, 0, 0, 0.9);
}
.mock-crumb { display: block; font-size: 14px; font-weight: 650; color: var(--muted); }
.mock-title { display: block; font-family: var(--font-serif); font-size: clamp(30px, 3.4vw, 38px); line-height: 1.1; margin: 8px 0 18px; }
.answer-box {
  display: block; padding: 16px 18px 18px; border-radius: 20px;
  background: color-mix(in oklab, var(--brand) 9%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--brand) 32%, var(--border));
}
.answer-label { display: block; font-size: 13px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.answer-text { display: block; font-size: 18px; line-height: 1.5; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.meta-chips > * {
  padding: 5px 13px; border-radius: 999px; font-size: 14px; font-weight: 650;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}

.mock-step { display: flex; flex-direction: column; gap: 12px; transition: transform 0.2s var(--ease-out), border-color 0.2s ease; }
.mock-step .art-card { padding: 10px; }
.mock-segs { display: flex; gap: 5px; margin-bottom: 4px; }
.mock-segs i { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); }
.mock-segs i.on { background: var(--go); }
.mock-segs i.now { background: color-mix(in oklab, var(--go) 30%, var(--surface-3)); }
.mock-kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--brand); margin-top: 4px; }
.mock-h { font-size: 21px; font-weight: 750; line-height: 1.25; }
.mock-p { font-size: 16px; line-height: 1.55; color: var(--muted); }
.mock-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; margin-top: 6px; border-radius: 999px;
  background: var(--go); color: var(--go-ink); font-weight: 750; box-shadow: 0 5px 0 var(--go-deep);
}
.mock-btn svg { width: 18px; height: 18px; }
@media (hover: hover) {
  .mock-step:hover { transform: translateY(-3px); border-color: var(--border-strong); }
}

.mock-check { display: grid; gap: 16px; }
.mini-word { padding: 16px 18px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.mini-word dt { font-weight: 800; font-size: 17px; }
.mini-word dd { color: var(--muted); font-size: 16px; margin-top: 4px; }

/* ---------- Check yourself (landing and lesson) ---------- */
.check { border-radius: 22px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 5px 0 var(--lip); overflow: hidden; }
.check summary {
  display: block; padding: 20px 20px 18px; min-height: 44px;
  cursor: pointer; list-style: none;
}
.check summary::-webkit-details-marker { display: none; }
.check-label { display: block; font-size: 13px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.check-q { display: block; font-size: 19px; font-weight: 700; line-height: 1.4; }
.check-hint {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink); font-weight: 700; font-size: 16px;
}
.check-hint svg { width: 18px; height: 18px; }
.check[open] .check-hint { display: none; }
.check-answer {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 20px 20px; border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--go) 10%, var(--surface-2));
}
.check-answer p { font-size: 19px; font-weight: 700; line-height: 1.45; }
.tick { width: 30px; height: 30px; color: var(--go); }
.tick path { stroke-dasharray: 24; stroke-dashoffset: 0; }
.check[open] .check-answer { animation: rise 0.42s var(--ease-spring) both; }
.check[open] .tick path { animation: draw 0.5s 0.12s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }

/* ---------- Landing: the course ---------- */
.course-path { display: grid; gap: 18px; }
.course-path > li { position: relative; }
.course-card {
  display: grid; grid-template-columns: 76px 1fr; gap: 18px; align-items: center; height: 100%;
  padding: 18px; border-radius: 26px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 5px 0 var(--lip);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s ease, border-color 0.18s ease;
}
.course-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--lip); }
.cc-text { display: block; min-width: 0; }
.cc-over { display: block; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c); }
.cc-title { display: block; margin-top: 4px; font-size: 20px; font-weight: 750; line-height: 1.25; }
.cc-blurb { display: block; margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); }
@media (hover: hover) {
  .course-card:hover { transform: translateY(-3px); border-color: var(--c-edge); box-shadow: 0 5px 0 var(--c-deep); }
}
/* Phones: one column joined like a path. */
@media (max-width: 719px) {
  .course-path > li + li::before {
    content: ""; position: absolute; left: 55px; top: -18px; width: 4px; height: 18px;
    border-radius: 2px; background: var(--surface-3);
  }
}
@media (min-width: 720px) {
  .course-path { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .course-card { grid-template-columns: 1fr; align-content: start; padding: 24px; }
  .course-card .sec-art { width: 92px; height: 92px; border-radius: 26px; }
  .course-card .sec-art svg { width: 74px; height: 74px; }
}
@media (min-width: 1040px) { .course-path { grid-template-columns: repeat(3, 1fr); } }
.center { display: flex; justify-content: center; margin-top: 40px; }

/* ---------- Landing: who it is for ---------- */
.who { text-align: center; }
.who .display-2 { max-width: 18ch; margin: 0 auto; }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.facts li {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 650; font-size: 16px;
}
.facts svg { width: 22px; height: 22px; color: var(--go); }

/* ---------- Landing: closing call to action ---------- */
.cta-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 64px 24px; border-radius: 36px; text-align: center;
  background: radial-gradient(120% 130% at 50% 0%, #163039 0%, #121721 48%, #0e1016 100%);
  border: 1px solid var(--border);
}
.cta-card .section-lede { margin: 0 auto; }
.cta-card .btn { margin-top: 8px; }
.cta-mark .mark { width: 60px; height: 60px; filter: drop-shadow(0 0 22px rgba(76, 219, 227, 0.45)); }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--border); padding: 40px 0 56px; margin-top: 24px; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.foot-note { color: var(--muted); font-size: 15px; margin-top: 6px; max-width: 42ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px; }
.foot-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 999px; font-weight: 650; color: var(--ink); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}
@media (hover: hover) { .foot-links a:hover { background: var(--surface-2); } }

/* ---------- Catalog ---------- */
.cat-hero { display: grid; gap: 28px; align-items: end; padding-top: 40px; padding-bottom: 36px; }
.cat-hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.cat-title { font-size: clamp(44px, 6vw, 72px); }
.progress-card {
  padding: 22px 22px 20px; border-radius: 26px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 5px 0 var(--lip);
}
.pc-label { font-size: 13px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--go); }
.pc-count { font-size: 18px; font-weight: 700; margin: 6px 0 14px; }
.pc-count [data-done-count] { font-size: 34px; font-weight: 800; margin-right: 4px; font-variant-numeric: tabular-nums; }
.pc-note { font-size: 14px; color: var(--muted); margin-top: 12px; }
.bar { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--go); transition: width 0.8s var(--ease-out); }
@media (min-width: 900px) {
  .cat-hero { grid-template-columns: 1fr 360px; gap: 56px; padding-top: 56px; padding-bottom: 48px; }
}

.jump {
  position: sticky; top: 0; z-index: 40;
  margin: 0 -20px; background: rgba(10, 11, 15, 0.96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.jump-list {
  position: relative; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 10px 20px; scroll-padding-inline: 20px; scrollbar-width: none;
}
.jump-list::-webkit-scrollbar { display: none; }
.jump-list li { flex: none; scroll-snap-align: start; }
.jump-chip {
  display: flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 4px 18px 4px 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  white-space: nowrap; font-weight: 700; font-size: 15px; color: var(--muted);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.jump-chip .sec-art { width: 40px; height: 40px; border-radius: 999px; }
.jump-chip .sec-art svg { width: 32px; height: 32px; }
.jc-text { display: flex; flex-direction: column; line-height: 1.25; }
.jc-count { display: none; font-size: 13px; font-weight: 650; color: var(--muted); }
.jump-chip[aria-current="location"] { color: var(--ink); border-color: var(--c-edge); background: color-mix(in oklab, var(--c) 10%, var(--surface)); }
@media (hover: hover) { .jump-chip:hover { color: var(--ink); border-color: var(--border-strong); } }
@media (min-width: 768px) { .jump { margin: 0 -32px; } .jump-list { padding: 10px 32px; scroll-padding-inline: 32px; } }

.cat-section { padding-top: 44px; }
.cs-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.cs-over { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c); }
.cs-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(28px, 3.4vw, 36px); line-height: 1.12; letter-spacing: -0.015em; margin-top: 2px; }
.cs-blurb { color: var(--muted); font-size: 16px; margin-top: 6px; max-width: 52ch; }

.lesson-path { display: grid; gap: 14px; }
.lesson-path > li { position: relative; }
.lesson-card {
  position: relative; display: grid; grid-template-columns: 54px 1fr 22px; gap: 16px; align-items: start; height: 100%;
  padding: 18px 18px 20px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 0 var(--lip);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s ease, border-color 0.18s ease;
}
.lesson-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
@media (hover: hover) {
  .lesson-card:hover { transform: translateY(-2px); border-color: var(--c-edge); box-shadow: 0 4px 0 var(--c-deep); }
}
/* The lesson number sits on a little chip, pins and all. */
.chipnum {
  position: relative; display: grid; place-items: center; width: 54px; height: 54px; margin-top: 2px;
  border-radius: 14px; background: var(--c-tint); color: var(--c);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 34%, transparent);
  font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums;
}
.chipnum::before, .chipnum::after { content: ""; position: absolute; pointer-events: none; }
.chipnum::before {
  left: 12px; right: 12px; top: -6px; bottom: -6px;
  background:
    repeating-linear-gradient(90deg, var(--c-edge) 0 4px, transparent 4px 10px) top / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, var(--c-edge) 0 4px, transparent 4px 10px) bottom / 100% 4px no-repeat;
}
.chipnum::after {
  top: 12px; bottom: 12px; left: -6px; right: -6px;
  background:
    repeating-linear-gradient(0deg, var(--c-edge) 0 4px, transparent 4px 10px) left / 4px 100% no-repeat,
    repeating-linear-gradient(0deg, var(--c-edge) 0 4px, transparent 4px 10px) right / 4px 100% no-repeat;
}
.done-badge {
  position: absolute; right: -8px; top: -8px; z-index: 1; display: none; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--go); color: var(--go-ink);
  box-shadow: 0 0 0 3px var(--surface);
}
.done-badge svg { width: 15px; height: 15px; }
.is-done .done-badge { display: grid; }
.lc-body { display: block; min-width: 0; }
.lc-title { display: block; font-size: 18px; font-weight: 750; line-height: 1.3; }
.lc-answer { display: block; margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.lc-go { width: 22px; height: 22px; align-self: center; color: var(--subtle); transition: transform 0.2s var(--ease-out), color 0.2s ease; }
@media (hover: hover) { .lesson-card:hover .lc-go { transform: translateX(3px); color: var(--ink); } }
.tag { display: none; width: max-content; margin-top: 10px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.tag-next { background: var(--go); color: var(--go-ink); }
.tag-done { background: var(--surface-3); color: var(--ink); }
.is-next .tag-next, .is-done .tag-done { display: block; }
.lesson-card.is-next { border-color: color-mix(in oklab, var(--go) 55%, var(--border)); box-shadow: 0 4px 0 var(--go-deep); }
/* Phones: one column, joined like a path; the whole card is the button, so the arrow goes. */
@media (max-width: 759px) {
  .lesson-card { grid-template-columns: 48px 1fr; gap: 14px; padding: 16px 16px 18px; }
  .chipnum { width: 48px; height: 48px; font-size: 17px; border-radius: 12px; }
  .chipnum::before { left: 10px; right: 10px; }
  .chipnum::after { top: 10px; bottom: 10px; }
  .lc-go { display: none; }
  .lesson-path > li + li::before {
    content: ""; position: absolute; left: 39px; top: -14px; width: 4px; height: 14px;
    border-radius: 2px; background: var(--surface-3);
  }
}
@media (min-width: 760px) { .lesson-path { grid-template-columns: 1fr 1fr; gap: 16px; } }

/* Wide screens: the sections become a sticky outline beside the lessons. */
.wrap.wide { max-width: 1280px; }
@media (min-width: 1100px) {
  .cat-layout { display: grid; grid-template-columns: 272px 1fr; gap: 48px; align-items: start; }
  .jump { top: 20px; margin: 44px 0 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .jump-list { flex-direction: column; overflow: visible; padding: 0; gap: 8px; }
  .jump-chip { white-space: normal; border-radius: 20px; padding: 8px 14px 8px 8px; width: 100%; }
  .jump-chip .sec-art { width: 48px; height: 48px; border-radius: 15px; }
  .jump-chip .sec-art svg { width: 38px; height: 38px; }
  .jc-count { display: block; }
  .cat-section { padding-top: 44px; }
}

/* ---------- Lesson ---------- */
.lesson-page { min-height: 100vh; display: flex; flex-direction: column; }
.lesson-bar { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid transparent; }
.lb-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.icon-btn {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none;
  border-radius: 14px; color: var(--muted); transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn .mark { width: 28px; height: 28px; color: var(--brand); }
@media (hover: hover) { .icon-btn:hover { background: var(--surface-2); color: var(--ink); } }
.lb-close { margin-left: auto; }
.segs { flex: 1; display: flex; gap: 6px; }
.seg { position: relative; flex: 1; height: 12px; border-radius: 999px; background: var(--surface-3); }
.seg > i {
  position: absolute; inset: 0; border-radius: inherit; background: var(--go);
  transform: scaleX(0); transform-origin: left center; transition: transform 0.5s var(--ease-spring);
}
.seg.is-full > i { transform: scaleX(1); }
.seg.is-now { box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--go) 45%, var(--surface-3)); }
.seg.pop { animation: seg-glow 0.8s 0.2s ease-out; }
@keyframes seg-glow {
  from { box-shadow: 0 0 0 0 rgba(109, 225, 139, 0.55); }
  to { box-shadow: 0 0 0 9px rgba(109, 225, 139, 0); }
}
.spark { position: absolute; right: 0; top: 50%; width: 0; height: 0; pointer-events: none; }
.spark i {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--go); opacity: 0; animation: spark 0.7s 0.28s ease-out forwards;
}
.spark i:nth-child(even) { background: var(--fig-accent-2); }
@keyframes spark {
  from { opacity: 1; transform: rotate(var(--a)) translateX(2px) scale(1); }
  to { opacity: 0; transform: rotate(var(--a)) translateX(22px) scale(0.4); }
}

.lesson { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 20px 64px; overflow-x: clip; }
.step + .step { margin-top: 72px; }
html.js .step + .step { margin-top: 0; }
.step:focus { outline: none; }
html.js:not(.is-stepper) .step + .step { display: none; }
.is-stepper .step { padding-bottom: 24px; }
.step.enter-fwd { animation: enter-fwd 0.36s var(--ease-out) both; }
.step.enter-back { animation: enter-back 0.36s var(--ease-out) both; }
@keyframes enter-fwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

.crumb {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 15px; font-weight: 650; color: var(--muted); border-radius: 10px;
}
.crumb svg { width: 18px; height: 18px; }
@media (hover: hover) { .crumb:hover { color: var(--ink); } }
.lesson-title {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(42px, 7vw, 64px); line-height: 1.04; letter-spacing: -0.025em;
  margin: 10px 0 24px;
}
.answer-box.big .answer-text { font-size: clamp(19px, 2.4vw, 22px); }

.outline { margin-top: 32px; }
.step .outline-title { font-size: 13px; line-height: 1.4; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.outline ol { position: relative; }
.outline ol::before { content: ""; position: absolute; left: 21px; top: 24px; bottom: 24px; width: 2px; background: var(--surface-3); }
.outline a {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 48px;
  padding: 4px 12px 4px 6px; border-radius: 14px; font-weight: 650; font-size: 16px;
}
@media (hover: hover) { .outline a:hover { background: var(--surface); } }
.o-dot {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: var(--surface-2); color: var(--muted);
  box-shadow: inset 0 0 0 2px var(--surface-3); font-size: 14px; font-weight: 800;
}
.o-dot svg { width: 16px; height: 16px; }

.picture { display: flex; flex-direction: column; }
.picture .art-card { padding: clamp(14px, 3vw, 24px); border-radius: 26px; box-shadow: 0 6px 0 var(--lip); }
.step-kicker { font-size: 14px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--brand); margin: 26px 0 8px; }
.step h2 { font-size: clamp(26px, 4vw, 34px); line-height: 1.18; letter-spacing: -0.015em; font-weight: 750; }
.step-text { font-size: clamp(18px, 2.3vw, 21px); line-height: 1.55; margin-top: 12px; }
.step-words .step-kicker, .step-work .step-kicker, .step-check .step-kicker { margin-top: 18px; }

.words { display: grid; gap: 14px; margin-top: 22px; }
.word {
  padding: 18px 20px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 0 var(--lip);
}
.word dt { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; }
.word dt::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--k, var(--fig-accent)); flex: none; }
.word:nth-child(2) { --k: var(--fig-accent-2); }
.word:nth-child(3) { --k: var(--fig-warm); }
.word:nth-child(4) { --k: var(--fig-good); }
.word dd { margin-top: 6px; font-size: 17px; color: var(--muted); }
@media (min-width: 640px) { .words { grid-template-columns: 1fr 1fr; } }

.work-card {
  display: grid; gap: 18px; margin-top: 22px; padding: 26px 24px;
  border-radius: 26px; border: 1px solid color-mix(in oklab, var(--fig-accent-2) 30%, var(--border));
  background: color-mix(in oklab, var(--fig-accent-2) 7%, var(--surface));
  box-shadow: 0 6px 0 var(--lip);
}
.work-icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
  background: color-mix(in oklab, var(--fig-accent-2) 18%, var(--surface)); color: var(--fig-accent-2);
}
.work-icon svg { width: 28px; height: 28px; }
.work-card p { font-size: clamp(18px, 2.3vw, 21px); line-height: 1.6; }
.step-check .check { margin-top: 22px; }
.step-check .check-q { font-size: clamp(20px, 2.6vw, 24px); }

.celebrate { text-align: center; padding: 18px 0 36px; }
.ring { position: relative; width: 120px; height: 120px; margin: 0 auto 18px; }
.ring svg { width: 120px; height: 120px; }
.ring-track { stroke: color-mix(in oklab, var(--go) 22%, var(--surface)); }
.ring-arc { stroke: var(--go); stroke-dasharray: 327; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 60px 60px; }
.ring-tick { stroke: var(--go); stroke-dasharray: 60; stroke-dashoffset: 0; }
.is-celebrating .ring-arc { animation: ring 0.8s var(--ease-out) both; }
.is-celebrating .ring-tick { animation: tick 0.45s 0.55s ease-out both; }
@keyframes ring { from { stroke-dashoffset: 327; } to { stroke-dashoffset: 0; } }
@keyframes tick { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.burst i {
  position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 3px;
  background: var(--k); opacity: 0;
}
.is-celebrating .burst i { animation: burst 1s 0.5s var(--ease-out) both; }
@keyframes burst {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(-40px) scale(0.4); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-92px) scale(1); }
}
.celebrate-title { font-family: var(--font-serif); font-size: clamp(36px, 6vw, 48px); line-height: 1.1; letter-spacing: -0.02em; }
.celebrate-sub { color: var(--muted); font-size: 18px; margin-top: 8px; }
.course-meter { max-width: 360px; margin: 26px auto 0; text-align: left; }
.course-meter p { font-size: 15px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.course-meter [data-done-count] { color: var(--ink); }

.step-end h2 { margin-bottom: 18px; }
.pager { display: grid; gap: 14px; }
.pager a {
  display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 18px 20px;
  border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 0 var(--lip);
  transition: transform 0.18s var(--ease-out), border-color 0.18s ease;
}
.pager a:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.pager-next { text-align: right; align-items: flex-end; border-color: color-mix(in oklab, var(--go) 50%, var(--border)) !important; }
.pg-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 750; color: var(--muted); }
.pg-label svg { width: 16px; height: 16px; }
.pg-title { font-size: 19px; font-weight: 750; line-height: 1.3; }
@media (hover: hover) { .pager a:hover { transform: translateY(-2px); border-color: var(--border-strong); } }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.related { margin-top: 40px; }
.related h3 { font-size: 19px; font-weight: 750; margin-bottom: 12px; }
.related ul { display: grid; gap: 10px; }
.related a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px;
  padding: 12px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  font-weight: 650;
}
.related a svg { width: 18px; height: 18px; color: var(--subtle); }
@media (hover: hover) { .related a:hover { border-color: var(--border-strong); } }
.all-lessons { margin-top: 36px; }

.lesson-actions {
  position: sticky; bottom: 0; z-index: 30;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-top: 1px solid var(--border);
}
.la-inner { max-width: 720px; margin: 0 auto; display: flex; gap: 12px; }
.btn-back { width: 60px; min-height: 60px; padding: 0; flex: none; }
.btn-back svg { width: 24px; height: 24px; }
.btn-next { flex: 1; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
