/* =========================================================
   Grow Curious — site styles
   Palette measured from the channel art in Assets/Channel_Assests:
   the cream watercolour paper, the sage frame band and its brown
   rule, the wordmark's brown, gumnut rust, golden-leaf ochre and
   the river blue. Lesson layouts still being compared are switched
   by data-attributes on <html> (see the Design lab in site.js).
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #f9f0e1;              /* the art's paper, a shade deeper so cards lift off it */
  --bg-alt: #f1e5d1;
  --surface: #fffaf1;
  --surface-2: #f4e9d7;
  --ink: #432e21;             /* body text: gum-bark brown */
  --ink-head: #5c3b2a;        /* headings: the wordmark's brown, a shade deeper */
  --ink-soft: #725a47;
  --ink-faint: #7f6957;
  --line: #e7d8c1;
  --line-strong: #d5c1a3;

  /* the channel art's frame: a sage band, a cream gap, a brown rule (see .banded) */
  --paper: #fdf3e5;
  --band: #8ca17d;
  --rule: #5a4131;

  /* Sage leads (it's the "Grow"). Rust (the gumnuts) is kept for YouTube and the discussion boxes. */
  --accent: #56704f;          /* deep sage */
  --accent-hover: #46603f;
  --accent-ink: #fffaf1;
  --accent-soft: #e0e8d6;
  --rust: #b0583a;
  --rust-hover: #9a4a2f;
  --rust-soft: #f3dccf;

  --sage: #8ca17d;
  --sage-deep: #5f7a56;
  --sage-soft: #e3e9d8;
  --ochre: #d9a45f;
  --ochre-deep: #a57631;
  --ochre-soft: #f6e6c9;
  --clay: #c98b6b;
  --clay-soft: #f3ddd0;
  /* "teal" is the river and sky blue now; the name stays so the lesson kit doesn't change */
  --teal: #7193a6;
  --teal-deep: #456779;
  --teal-soft: #dde8ed;

  --code-bg: #2f2925;
  --code-ink: #f1e6d6;

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;
  /* layered paper, like the banner: a crisp edge underneath, no blur */
  --shadow-s: 0 2px 0 rgba(63, 50, 42, .08);
  --shadow: 0 3px 0 rgba(63, 50, 42, .10);
  --shadow-l: 0 6px 0 rgba(63, 50, 42, .12);

  --font-head: "Young Serif", Georgia, serif;
  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --maxw: 1180px;
  --header-h: 68px;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-synthesis: none;
}
/* soft paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
  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 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.005em;
  margin: 0 0 .5em;
  color: var(--ink-head);
  font-optical-sizing: auto;
}
h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: inherit; }
img { max-width: 100%; display: block; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); padding: .12em .4em; border-radius: 6px; }
.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.18em; }
.icon.fill { fill: currentColor; stroke: none; }

.wrap { width: min(var(--maxw), 100% - 32px); margin-inline: auto; }
body.page-lesson { --maxw: 1380px; }  /* lessons get more room */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .95rem; font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: .5rem;
}
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .8em 1.35em;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 var(--accent-hover); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.btn-yt { background: var(--rust); box-shadow: 0 2px 0 var(--rust-hover); }
.btn-primary.btn-yt:hover { background: var(--rust-hover); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-faint); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: var(--line); }
.btn-sm { padding: .55em 1em; font-size: .9rem; }
.btn-lg { padding: 1em 1.6em; font-size: 1.05rem; }
.btn .icon { width: 1.15em; height: 1.15em; }
.btn-yt .icon.fill { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
/* the channel badge and wordmark (Assets/brand/, made by tools/brand_assets.py) */
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; flex: none; }
.brand-icon { width: 44px; height: 44px; transition: transform .3s ease; }
.brand-word { width: auto; height: 22px; }
.brand:hover .brand-icon { transform: rotate(-6deg); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { text-decoration: none; padding: .5em .85em; border-radius: 999px; color: var(--ink-soft); font-weight: 500; font-size: .96rem; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav .btn { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; color: var(--ink); cursor: pointer; }
.nav-toggle .icon { width: 26px; height: 26px; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px 16px 18px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav .btn { margin: 8px 0 0; }
}

/* the Series menu (built by site.js: initSeriesMenu) */
.nav-series { position: relative; display: flex; align-items: center; }
.nav-series > a { display: inline-flex; align-items: center; gap: .3em; }
.nav-series .ns-caret { width: .95em; height: .95em; transition: transform .2s; }
.nav-series:hover .ns-caret, .nav-series:focus-within .ns-caret { transform: rotate(180deg); }
.nav-menu {
  position: absolute; top: 100%; left: 50%; z-index: 60; min-width: 270px;
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 14px 32px -14px rgba(63, 50, 42, .4);
  opacity: 0; visibility: hidden; transform: translate(-50%, 10px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; } /* keeps hover alive across the gap */
.nav-series:hover .nav-menu, .nav-series:focus-within .nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 4px); }
.nav .nav-menu a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--ink); font-weight: 600; }
.nm-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--c-soft); color: var(--c-deep); }
.nm-icon .icon { width: 20px; height: 20px; }
.nm-text { display: flex; flex-direction: column; line-height: 1.25; }
.nm-text small { font-size: .8rem; font-weight: 500; color: var(--ink-faint); }
@media (max-width: 820px) {
  .nav-series { flex-direction: column; align-items: stretch; }
  .nav-series .ns-caret { display: none; }
  .nav-menu, .nav-series:hover .nav-menu, .nav-series:focus-within .nav-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; padding: 2px 0 6px 14px; background: none; border: 0; box-shadow: none;
  }
  .nm-icon { width: 30px; height: 30px; }
}

/* ---------- Sections ---------- */
section { padding: clamp(64px, 9vw, 112px) 0; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; }
/* home page "Continue where you left off" shelf: books standing on a wooden plank */
.shelf-section { padding: 0 0 clamp(48px, 6vw, 72px); }
.shelf-empty { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 14px; padding: 18px 22px; border: 1.5px dashed var(--line-strong); border-radius: 10px; color: var(--ink-soft); }
.shelf-empty strong { color: var(--ink-head); }
.shelf-empty .btn .icon, .shelf-empty .btn svg { width: 1em; height: 1em; }
.shelf-title { font-size: clamp(1.4rem, 2.2vw, 1.8rem); margin: 0 0 18px; }
.shelf { position: relative; padding: 0 18px; }
.shelf::after { /* the plank */
  content: ""; display: block; height: 14px; margin: 0 -18px; border-radius: 4px;
  background: linear-gradient(#a87a55, #8a5e3d); box-shadow: 0 6px 0 #6e4a30, 0 14px 18px -8px rgba(63, 50, 42, .45);
}
.shelf-books { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; align-items: flex-end; overflow-x: auto; padding-top: 10px; scrollbar-width: thin; }
.book { position: relative; flex: 0 0 210px; }
.book-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-left: 8px solid var(--c); border-radius: 4px 10px 10px 4px; box-shadow: var(--shadow-s); overflow: hidden; transition: transform .2s; }
.book-link:hover { transform: translateY(-4px); }
.book-link:focus-visible { outline: 2px solid var(--c-deep); outline-offset: 3px; }
.book-cover { display: block; aspect-ratio: 16 / 9; background: var(--c-soft); overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover .th-illo { display: grid; place-items: center; height: 100%; color: var(--c-deep); }
.book-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.book-series { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c-deep); }
.book-title { font-family: var(--font-head); font-size: 1rem; line-height: 1.25; color: var(--ink-head); }
.book-meta { font-size: .82rem; color: var(--ink-soft); }
.book .lc-prog i { background: var(--c); }
.book-remove { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 250, 241, .92); color: var(--ink); box-shadow: var(--shadow-s); cursor: pointer; opacity: .85; }
.book-remove:hover, .book-remove:focus-visible { opacity: 1; background: var(--surface); outline: 2px solid var(--ink-faint); }
.book-remove svg { width: 16px; height: 16px; }
.shelf-undo { margin: 14px 0 0; font-size: .92rem; color: var(--ink-soft); }
.shelf-undo[hidden] { display: none; }
.shelf-undo button { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* home page series intro: the paragraph, with the green "brand new" note beside it */
.series-head { max-width: none; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 48px; align-items: center; margin-bottom: 32px; }
.series-head .lead { margin: 0; }
.new-note { margin: 0; padding-left: 20px; border-left: 2px solid var(--accent); color: var(--accent); font-weight: 600; font-size: 1rem; }
@media (max-width: 820px) { .series-head { grid-template-columns: 1fr; gap: 16px; } }
.section-alt { background: var(--bg-alt); }

/* ---------- The channel art's frame ----------
   A sage band, a cream gap and a brown rule across the top and bottom,
   as on the banner. Add .banded to anything that should look like a
   piece of the channel art (the hero, a series banner, the subscribe panel). */
.banded { position: relative; }
.banded::before, .banded::after {
  content: ""; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none;
  height: var(--band-h, 18px);
  background: linear-gradient(var(--band) 0 66%, var(--paper) 66% 83%, var(--rule) 83%);
}
.banded::before { top: 0; }
.banded::after { bottom: 0; transform: scaleY(-1); }

/* the watercolour scene behind a .banded block */
.scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Hero: the channel banner, built live ----------
   The scene, badge and wordmark are separate images so the banner can
   crop to any screen and the badge and wordmark stay large on phones. */
.hero { padding: 0 0 clamp(44px, 6vw, 72px); }
.hero-scene {
  --band-h: 18px;
  height: clamp(300px, 29vw, 440px);   /* change this to make the banner taller or shorter */
  background: var(--paper);
  display: grid; place-items: center;
  padding-bottom: 5%;           /* the clear sky sits a little above the middle */
  overflow: hidden;
}
/* Parallax: the scene is taller than its window and drifts down more slowly than the
   page scrolls; the badge and wordmark drift less, so they float in front of it.
   site.js sets --p from 0 (page at the top) to 1 (banner scrolled out of view). */
.hero-scene .scene {
  top: -20%; bottom: auto; height: 124%;
  object-position: center 47%;  /* a short, wide window: the gumnuts at the top, the hills along the bottom */
  transform: translate3d(0, calc(var(--p, 0) * 15%), 0);
  will-change: transform;
}
/* very wide screens see an even thinner strip: keep the hills so the trees stand on something */
@media (min-width: 1600px) { .hero-scene .scene { object-position: center 60%; } }
@media (min-width: 2200px) { .hero-scene .scene { object-position: center 74%; } }
.lockup {
  position: relative; z-index: 1; margin: 0; display: flex; align-items: center; gap: clamp(14px, 1.6vw, 26px);
  transform: translate3d(0, calc(var(--p, 0) * 35%), 0);
}
.lockup-icon { width: clamp(100px, 10vw, 156px); height: auto; }
.lockup-word { width: clamp(230px, 27vw, 420px); height: auto; }

/* on load, the badge then the wordmark settle in (individual translate/scale
   properties, so they don't fight the parallax transforms) */
@media (prefers-reduced-motion: no-preference) {
  .lockup-icon { animation: settle .9s cubic-bezier(.2, .7, .2, 1) both; }
  .lockup-word { animation: settle .9s .15s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-scene .scene { animation: scene-in 1.4s ease both; }
}
@keyframes settle { from { opacity: 0; translate: 0 14px; scale: .97; } }
@keyframes scene-in { from { opacity: .3; scale: 1.03; } }

.hero-copy { margin-top: clamp(36px, 4.5vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: clamp(32px, 4vw, 56px); align-items: center; }
.hero-statement { font: 400 clamp(1.5rem, 2.4vw, 2.1rem)/1.25 var(--font-head); color: var(--ink-head); margin: 0; text-wrap: balance; }
/* "BIG" turned on its side (reads bottom to top), with the three lines beside it */
.big-stack { display: flex; align-items: center; gap: .25em; line-height: 1.15; font-size: clamp(1.7rem, 2.9vw, 2.5rem); }
.big-word { writing-mode: vertical-rl; transform: rotate(180deg); text-transform: uppercase; font-size: 1.92em; line-height: .78; letter-spacing: 0; color: var(--accent); text-align: center; }
.big-lines { align-self: center; }
@media (max-width: 1000px) {
  .hero-copy { grid-template-columns: 1fr; text-align: center; }
  .big-stack { justify-content: center; text-align: left; }
  .big-stack { width: max-content; margin: 0 auto; }
  .hero-statement { margin: 0 auto; max-width: 30ch; }
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* the flowchart under the mission: YouTube, then this site */
.flow { list-style: none; padding: 0; margin: 0 auto; max-width: 860px; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; counter-reset: flow; text-align: left; }
.flow-step { position: relative; counter-increment: flow; display: flex; flex-direction: column; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 20px 24px 22px; }
.flow-yt { border-top: 4px solid var(--rust); }
.flow-site { border-top: 4px solid var(--accent); }
.flow-place { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.flow-place svg { width: 20px; height: 20px; color: var(--rust); }
.flow-place img { width: 20px; height: 20px; }
.flow-step h3 { font-size: 1.3rem; margin: 10px 0 .3em; }
.flow-step h3::before { content: counter(flow) ". "; color: var(--accent); }
.flow-yt h3::before { color: var(--rust); }
.flow-step p { font-size: 1rem; color: var(--ink-soft); margin: 0 0 18px; flex: 1; }
/* the arrow between the two boxes */
.flow-step + .flow-step::before {
  content: ""; position: absolute; left: -44px; top: 50%; width: 32px; height: 32px; transform: translateY(-50%);
  background: var(--ink-faint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 720px) {
  .flow { grid-template-columns: 1fr; gap: 48px; }
  .flow-step + .flow-step::before { left: 50%; top: -40px; transform: translateX(-50%) rotate(90deg); }
}

@media (max-width: 760px) {
  /* a shorter window and less overscan, so the scene isn't zoomed past the gum trees at the sides */
  .hero-scene { --band-h: 14px; height: clamp(300px, 82vw, 400px); padding-bottom: 12%; }
  .hero-scene .scene { top: -8%; height: 112%; object-position: 50% 60%; transform: translate3d(0, calc(var(--p, 0) * 7%), 0); }
  .lockup { flex-direction: column; gap: 10px; }
  .lockup-icon { width: clamp(80px, 22vw, 108px); }
  .lockup-word { width: min(66vw, 280px); }
}


/* ---------- Latest video ---------- */
.feature {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  background: var(--surface); border-radius: var(--radius-l); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.feature .thumb { position: relative; min-height: 300px; background: var(--sage-soft); }
.feature .feature-body { padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; }
.feature h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.tags { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 4px 0 22px; }
.tag { display: inline-flex; align-items: center; gap: .4em; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.tag .icon { width: 1em; height: 1em; }
@media (max-width: 820px) { .feature { grid-template-columns: 1fr; } .feature .thumb { min-height: 220px; } }

/* illustrated thumbnail (pure CSS/SVG so we don't need real thumbnails yet) */
.illo { position: absolute; inset: 0; width: 100%; height: 100%; }
.play {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--accent);
  display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .2s;
  border: 0; cursor: pointer;
}
.play .icon { width: 30px; height: 30px; margin-left: 4px; }
a:hover .play, .play:hover { transform: scale(1.06); }

/* ---------- Folders of lesson cards ----------
   One markup (see content.js: folder() and lessonCard()). On the home page the
   first three cards peek out of the top of each folder. */
:where(.folder, .open-folder, .series-banner, .nm-item, .book) {
  --c: var(--sage); --c-soft: var(--sage-soft); --c-deep: var(--sage-deep);
}
[data-color="ochre"] { --c: var(--ochre); --c-soft: var(--ochre-soft); --c-deep: var(--ochre-deep); }
[data-color="clay"] { --c: var(--clay); --c-soft: var(--clay-soft); --c-deep: var(--rust); }
[data-color="teal"] { --c: var(--teal); --c-soft: var(--teal-soft); --c-deep: var(--teal-deep); }

.folder { --back: color-mix(in srgb, var(--c-soft) 78%, var(--c) 22%); position: relative; }
.folder-tab {
  display: inline-flex; align-items: center; gap: .55em;
  border: 0; cursor: pointer; font: 700 .86rem/1 var(--font-body); color: var(--c-deep);
  background: var(--back); padding: .8em 1.4em .7em 1.1em; border-radius: 14px 14px 0 0;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
  padding-right: 2.2em; position: relative; z-index: 1;
}
.folder-tab .ft-icon { display: grid; place-items: center; }
.folder-tab .icon { width: 1.15em; height: 1.15em; }
.folder-tab .ft-count { display: none; }
.folder-body { background: var(--back); border-radius: 0 var(--radius) var(--radius) var(--radius); position: relative; }
.folder-front { position: relative; z-index: 2; background: var(--c-soft); border-radius: var(--radius); padding: 26px 24px 22px; }
.folder-front .ff-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--surface); color: var(--c-deep); box-shadow: var(--shadow-s); margin-bottom: 14px; }
.folder-front .ff-icon .icon { width: 26px; height: 26px; stroke-width: 1.6; }
.folder-front h3 { margin: 0 0 6px; font-size: 1.4rem; }
.folder-front p { color: var(--ink-soft); font-size: .95rem; margin: 0 0 16px; }
.ff-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .85rem; font-weight: 700; color: var(--c-deep); }
.ff-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ff-link { display: flex; text-decoration: none; color: var(--c-deep); }
/* an optional second button (e.g. "Why Christianity?"); sits above the folder-wide link */
.ff-why { position: relative; z-index: 3; display: inline-flex; align-items: center; padding: calc(.6em - 1.5px) 1.1em; border: 1.5px solid var(--c-deep); border-radius: 999px; color: var(--c-deep); text-decoration: none; background: var(--surface); transition: background .2s; }
.ff-why:hover { background: color-mix(in srgb, var(--c-soft) 50%, var(--surface)); }
.ff-why:focus-visible { outline: 2px solid var(--c-deep); outline-offset: 3px; }

/* the About page */
.about-page { padding-top: 32px; }
.about-page .wrap { max-width: 720px; }
.about-page h2 { margin-top: 2.2em; scroll-margin-top: calc(var(--header-h) + 24px); }
.about-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 8px; }
.about-jump a { padding: .45em 1em; border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .92rem; font-weight: 600; }
.about-jump a:hover { background: var(--surface); }
.ff-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
/* "Open the series" reads as a button, so it's clear the folder opens */
.ff-go {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--c-deep); color: var(--surface); padding: .6em 1em .6em 1.1em; border-radius: 999px;
  transition: background .2s;
}
.ff-go .icon { width: 1.05em; height: 1.05em; transition: transform .2s; }
.folder:hover .ff-go { background: color-mix(in srgb, var(--c-deep) 82%, var(--ink)); }
.folder:hover .ff-go .icon { transform: translateX(4px); }
.folder-front { transition: transform .2s; }
.folder:hover .folder-front { transform: translateY(-2px); }
.ff-link:focus-visible .ff-go { outline: 2px solid var(--c-deep); outline-offset: 3px; }
/* lesson card */
.lcard {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; overflow: hidden;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-s); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  transition: transform .25s ease, box-shadow .25s ease;
}
a.lcard:hover { box-shadow: var(--shadow); }
.lc-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; flex: none; }
.lc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.th-illo {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--c-deep);
  background: color-mix(in srgb, var(--c-soft) 70%, var(--c) 30%);
}
.th-illo .icon { width: 34%; height: auto; max-width: 64px; stroke-width: 1.4; opacity: .8; }
.th-illo b { font-family: var(--font-head); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; font-weight: 400; }
.chip { position: absolute; left: 8px; top: 8px; font-size: .74rem; font-weight: 700; padding: .3em .65em; border-radius: 6px; background: var(--surface); color: var(--ink-soft); box-shadow: var(--shadow-s); }
.st-live .chip { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.st-making .chip { background: var(--ochre-soft); color: var(--ochre-deep); }
.lcard.st-idea { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--c-deep) 35%, transparent); box-shadow: none; }
.lcard.st-idea .lc-thumb { opacity: .55; }
.lc-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; min-height: 0; }
.lc-title { font-family: var(--font-head); font-weight: 400; font-size: 1.02rem; line-height: 1.25; }
.lc-blurb { font-size: .86rem; color: var(--ink-soft); line-height: 1.45; }
.lc-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: .74rem; font-weight: 600; color: var(--ink-faint); align-items: center; margin-top: 2px; }
.lc-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.lc-prog { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.lc-prog i { display: block; height: 100%; background: var(--sage); }

/* home page: cards peek out of the top of each folder */
.folders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 28px; }
.folders .folder-body { padding: 16px 14px 0; }
.folders .folder-cards { display: flex; gap: 10px; height: 150px; padding: 0 8px; }
.folders .lc-thumb { aspect-ratio: 16 / 8; }
.folders .lcard { flex: 1 1 0; min-width: 0; height: 190px; transform: translateY(10px) rotate(calc((var(--k) - 1) * 1.6deg)); }
.folders .lcard:nth-child(n+4) { display: none; }
.folders .lc-blurb, .folders .lc-meta { display: none; }
.folders .lc-title { font-size: .84rem; }
.folders .lc-body { padding: 8px 10px; }
.folders .folder:hover .lcard { transform: translateY(-8px) rotate(calc((var(--k) - 1) * 2.4deg)); }
.folders .folder:hover .lcard:hover { transform: translateY(-18px) rotate(0); }
.folders .folder-front { box-shadow: 0 -10px 22px -14px rgba(63, 50, 42, .45); margin: 0 -14px; border-radius: var(--radius); }
@media (max-width: 640px) {
  .folders { grid-template-columns: minmax(0, 1fr); }
  .folders .folder-cards { height: 120px; }
  .folders .chip { display: none; }
}
.chip { white-space: nowrap; }

/* other series, at the bottom of a series page */
.folders-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px 20px; }
.folders-mini .folder-cards { display: none; }
.folders-mini .folder-body { padding: 0; }
.folders-mini .folder-front { box-shadow: 0 -8px 18px -14px rgba(63, 50, 42, .4); height: 100%; display: flex; flex-direction: column; transition: transform .2s; }
.folders-mini .ff-row { margin-top: auto; }
.folders-mini .folder { display: flex; flex-direction: column; }
.folders-mini .folder-tab { align-self: flex-start; }
.folders-mini .folder-body { flex: 1; }

/* series page: the lessons as an open folder */
.open-folder { --back: color-mix(in srgb, var(--c-soft) 78%, var(--c) 22%); }
.of-tab { display: inline-flex; align-items: center; gap: .6em; font-weight: 700; color: var(--c-deep); background: var(--c-soft); padding: .85em 2.4em .75em 1.2em; border-radius: 16px 16px 0 0; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 100%, 0 100%); }
.of-tab .icon { width: 1.2em; height: 1.2em; }
.of-body { background: var(--c-soft); border-radius: 0 var(--radius-l) var(--radius-l) var(--radius-l); padding: clamp(18px, 3.4vw, 36px); }
.of-group { font-family: var(--font-body); font-size: .95rem; font-weight: 700; color: var(--c-deep, var(--ink-faint)); margin: 26px 0 14px; display: flex; align-items: center; gap: 12px; }
.of-group::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--c-deep, var(--ink-faint)) 25%, transparent); }
.of-body > .of-group:first-child { margin-top: 0; }
.of-empty { margin: 0; color: var(--ink-soft); }
.of-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
a.lcard:hover { border-color: var(--line-strong); }
.of-cards .lc-title { font-size: 1.15rem; }
.of-cards .lc-body { padding: 16px 18px 18px; gap: 8px; }
.of-cards .lc-blurb { font-size: .92rem; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: step; }
.step-card { border-top: 2px solid var(--ink); padding-top: 14px; }
.step-card::before { counter-increment: step; content: counter(step); display: block; font: 400 2.6rem/1 var(--font-head); color: var(--accent); margin-bottom: 14px; }
.step-card h3 { font-size: 1.3rem; margin-bottom: .3em; }
.step-card p { font-size: .98rem; color: var(--ink-soft); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* ---------- About ----------
   The badge sits between the two words it stands for: the gum tree (Grow)
   and the question mark (Curious). */
.about-grid { display: grid; grid-template-columns: 1fr minmax(170px, 250px) 1fr; gap: 28px; }
.about-badge { margin: 0; align-self: center; }
.about-badge img { width: 100%; height: auto; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-badge { order: -1; width: min(200px, 56vw); margin: 0 auto 4px; }
}
.about-card { background: var(--surface); border-radius: var(--radius-l); padding: clamp(28px, 4vw, 44px); border: 1px solid var(--line); position: relative; overflow: hidden; }
.about-card .word { font-family: var(--font-head); font-size: clamp(2.6rem, 5vw, 3.6rem); font-weight: 400; line-height: 1; margin-bottom: 18px; }
.about-card.grow .word { color: var(--sage-deep); }
.about-card.curious .word { color: var(--rust); }
.about-card .verse { font-family: var(--font-head); font-style: italic; color: var(--ink-soft); border-left: 3px solid var(--sage); padding-left: 14px; margin-top: 18px; }
/* ---------- Subscribe panel: a framed strip of channel paper, like the banner ---------- */
.cta-band {
  background: var(--paper);
  padding: clamp(46px, 6vw, 68px) clamp(22px, 5vw, 60px);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(20px, 3vw, 36px); align-items: center;
}
.cta-icon { width: clamp(76px, 8vw, 104px); height: auto; }
.cta-band h2 { margin-bottom: .25em; }
.cta-band p { color: var(--ink-soft); margin: 0; max-width: 52ch; }
@media (max-width: 760px) {
  .cta-band { grid-template-columns: 1fr; justify-items: start; gap: 16px; }
}

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 40px; color: var(--ink-soft); font-size: .92rem; border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer .brand-icon { width: 38px; height: 38px; }
.site-footer .brand-word { height: 19px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* =========================================================
   Series page
   ========================================================= */
/* the series name in the clear sky of the channel scene, then the intro under it */
.series-hero { padding: 28px 0 48px; }
.series-banner {
  height: clamp(250px, 24vw, 330px); background: var(--paper); overflow: hidden;
  display: grid; place-items: center; text-align: center; padding: 30px 16px 40px;
}
.series-banner .scene { object-position: center 44%; }
.sb-title { position: relative; z-index: 1; max-width: min(40%, 520px); }
.sb-icon { width: 54px; height: 54px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--c-soft); color: var(--c-deep); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--c); margin-bottom: 12px; }
.sb-icon .icon { width: 26px; height: 26px; stroke-width: 1.6; }
.series-banner h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin: 0 0 .15em; text-wrap: balance; }
.sb-count { margin: 0; font-weight: 600; font-size: .95rem; color: var(--ink-soft); }
.series-intro { margin-top: 28px; }
.series-intro .lead { margin-bottom: 14px; }
@media (max-width: 760px) {
  .series-banner { height: 300px; }
  .sb-title { max-width: 62%; }
}

.crumbs { font-size: .88rem; color: var(--ink-faint); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--ink-soft); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }


/* =========================================================
   Lesson page
   ========================================================= */
.lesson-hero { padding: 32px 0 24px; }
.lesson-hero .grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.lesson-hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
.lesson-hero .tags { margin-bottom: 24px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-l); background: var(--sage-soft); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame .soon-note { position: absolute; left: 16px; bottom: 14px; background: var(--surface); color: var(--ink-soft); font-size: .8rem; font-weight: 600; padding: .35em .8em; border-radius: 999px; }
@media (max-width: 900px) { .lesson-hero .grid { grid-template-columns: 1fr; gap: 28px; } }

.lesson-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 900px);
  justify-content: center;
  gap: 56px;
  padding-bottom: 80px;
}
.lesson-main { grid-column: 2; min-width: 0; }

/* --- progress rail --- */
.rail { grid-column: 1; position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.rail ol { list-style: none; margin: 0; padding: 0; position: relative; }
.rail ol::before { content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 2px; background: var(--line); border-radius: 2px; }
.rail .rail-fill { position: absolute; left: 9px; top: 12px; width: 2px; background: var(--sage); border-radius: 2px; transition: height .4s ease; }
.rail li { position: relative; }
.rail a { display: flex; align-items: center; gap: 14px; padding: 9px 0; text-decoration: none; color: var(--ink-faint); font-size: .9rem; font-weight: 500; line-height: 1.25; }
.rail .dot {
  width: 20px; height: 20px; border-radius: 50%; flex: none; position: relative; z-index: 1;
  background: var(--bg); border: 2px solid var(--line-strong);
  display: grid; place-items: center; transition: all .25s ease;
}
.rail .dot .icon { width: 11px; height: 11px; stroke-width: 3; opacity: 0; color: #fff; }
.rail a:hover { color: var(--ink); }
.rail a:hover .dot { border-color: var(--ink-faint); }
.rail li.done .dot { background: var(--sage); border-color: var(--sage); }
.rail li.done .dot .icon { opacity: 1; }
.rail li.current a { color: var(--ink); font-weight: 700; }
.rail li.current .dot { background: var(--ochre); border-color: var(--ochre); box-shadow: 0 0 0 5px var(--ochre-soft); transform: scale(1.1); }
.rail li.current.done .dot .icon { opacity: 1; }
.rail .label small { display: block; font-size: .76rem; font-weight: 600; opacity: .75; margin-bottom: 1px; }
.rail-summary { margin-top: 22px; font-size: .82rem; color: var(--ink-soft); padding-left: 2px; }
.rail-summary .track { height: 6px; border-radius: 99px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.rail-summary .fill { height: 100%; width: 0; background: var(--sage); transition: width .4s; }
/* "Clear my progress": quiet until clicked once, then asks for a second click */
.clear-lesson { border: 0; background: none; padding: 0; font: inherit; font-size: .82rem; color: var(--ink-faint); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.clear-lesson:hover { color: var(--ink); }
.clear-lesson.is-armed { color: var(--rust); font-weight: 700; }
.rail-summary .clear-lesson { margin-top: 12px; }
.part-done .clear-lesson { margin-left: auto; }

@media (max-width: 1020px) {
  .lesson-shell, :root .lesson-shell { grid-template-columns: minmax(0, 1fr) !important; gap: 0; }
  .lesson-main { grid-column: 1; grid-row: 2; }
  .rail {
    grid-column: 1; grid-row: 1; top: var(--header-h); z-index: 20;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line); margin: 0 -16px 24px; padding: 12px 16px;
  }
  .rail ol { display: flex; justify-content: space-between; }
  .rail ol::before { left: 10px; right: 10px; top: 50%; bottom: auto; width: auto; height: 2px; transform: translateY(-1px); }
  .rail .rail-fill { display: none; }
  .rail a { padding: 0; }
  .rail .label { display: none; }
  .rail-summary { display: none; }
}

/* --- lesson parts ---
   Each part is a light "paper" sheet: a numbered header with a thin rule under the
   title, the content, then the Back / Next row. */
.lesson-main { display: flex; flex-direction: column; gap: 56px; }
.part { position: relative; display: flex; flex-direction: column; transition: border-color .3s, box-shadow .3s; }
.part::after { content: ""; flex: 1 0 0; order: 98; }
.part > .part-done { order: 99; }
.part > .next-card { order: 100; }
.part-head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; position: relative; }
.ph-num {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface); color: var(--accent); border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font: 400 1.6rem/1 var(--font-head); transition: background .3s, color .3s, border-color .3s;
}
.ph-num .icon { width: 24px; height: 24px; }
.part.is-current .ph-num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.part.is-done .ph-num { background: var(--sage-soft); color: var(--sage-deep); border-color: var(--sage-soft); }
.part.is-done .part-head::after {
  content: "Done ✓"; margin-left: auto; align-self: flex-start; font-size: .85rem; font-weight: 700;
  color: var(--sage-deep); white-space: nowrap;
}
.part-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 600; color: var(--ink-faint); margin-bottom: 2px; }
.part-kicker .pill { display: none; }  /* the number beside the heading already says which part */
.part h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 2px 0 0; }
.part ul, .part ol { padding-left: 1.3em; }
.part li { margin-bottom: .4em; }
.part > p, .part > h3, .part > ul, .part > ol, .part > .callout { max-width: 72ch; }
.part > h3 { font-size: 1.35rem; margin: 1.4em 0 .5em; }
.part .box { margin: 28px 0; }
.part .box-head { padding: 16px 22px 0; }
.part .box-body { padding: 12px 22px 22px; }
.part .stepper { margin: 26px 0; padding: 22px; }
.part .output { margin: 22px 0; }
.part .three-ways { gap: 14px; margin: 22px 0; }
.part .pair { margin: 22px 0; }
.part .math { margin: 22px 0; font-size: 1.25rem; }
.part .mode { margin-top: 40px; }
@media (min-width: 1100px) {
  /* a big figure with its caption beside it */
  .part > .output.wide { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; }
  .part > .output.wide figcaption strong { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 6px; }
  .part .pair { gap: 18px; }
  /* step-through diagram: picture left, words right, so Next stays on screen */
  .part .stepper { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px 32px; align-items: center; }
  .part .stepper-panels { padding: 0; min-height: 0; }
  .part .st-panel h4 { font-size: 1.45rem; margin-bottom: 8px; }
  .part .stepper-nav { grid-column: 1 / -1; margin-top: 4px; }
}
@media (max-width: 560px) {
  .lesson-main { gap: 36px; }
  .part-head { gap: 14px; }
  .ph-num { width: 44px; height: 44px; font-size: 1.3rem; }
  .ph-num .icon { width: 20px; height: 20px; }
  .part .box-head { padding: 14px 16px 0; }
  .part .box-body { padding: 10px 16px 18px; }
  .part .stepper { padding: 12px; }
  .part .output { padding: 14px; }
}

/* paper sheet */
.part {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s);
  padding: clamp(20px, 3.4vw, 44px);
}
.part.is-current { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.part-head { padding-bottom: 22px; border-bottom: 1px solid var(--line); }


.mode {
  display: flex; align-items: center; gap: 10px; margin: 36px 0 14px;
  font-family: var(--font-body); font-size: .95rem; font-weight: 700; color: var(--ink-soft);
}
.mode .ico { display: grid; place-items: center; color: var(--ink-soft); }
.mode .ico .icon { width: 17px; height: 17px; }
.mode::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mode.read .ico { color: var(--ochre-deep); }
.mode.colab .ico { color: var(--teal-deep); }
.mode.see .ico { color: var(--sage-deep); }
.mode.reflect .ico { color: var(--rust); }
.mode.try .ico { color: var(--rust); }

.callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 20px 0; }
.callout.key { background: var(--ochre-soft); border-color: transparent; }
.callout.key strong:first-child { font-family: var(--font-head); font-weight: 400; font-size: 1.1rem; }
.callout p:last-child { margin-bottom: 0; }

.colab-task {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--teal);
  border-radius: var(--radius); padding: 20px 22px; margin: 16px 0;
}
.colab-task .task-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.colab-task .task-head strong { font-size: 1.02rem; }
.colab-task ol { margin: 0; }

.codeblock { position: relative; margin: 16px 0; border-radius: var(--radius); overflow: hidden; background: var(--code-bg); box-shadow: var(--shadow-s); }
.codeblock .cb-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 10px 18px; background: color-mix(in srgb, var(--code-bg) 85%, #fff); color: #c7b8a6; font: 600 .78rem/1 var(--font-body); letter-spacing: .04em; }
.codeblock .cb-head .lights { display: flex; gap: 6px; margin-right: 12px; }
.codeblock .cb-head .lights i { width: 10px; height: 10px; border-radius: 50%; background: #5a4d44; display: block; }
.codeblock .cb-head .left { display: flex; align-items: center; }
.copy-btn { background: transparent; border: 1px solid #5a4d44; color: #e8dccb; border-radius: 8px; padding: 5px 10px; font: 600 .75rem/1 var(--font-body); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.copy-btn:hover { background: #4a3f38; }
.codeblock pre { margin: 0; padding: 18px 20px; overflow-x: auto; color: var(--code-ink); font: .86rem/1.65 var(--font-mono); }
.codeblock pre code { background: none; padding: 0; font-size: inherit; }
.tok-c { color: #a8977f; font-style: italic; }
.tok-k { color: #e6a57e; }
.tok-s { color: #b9cc9b; }
.tok-f { color: #e8c77d; }
.tok-n { color: #d8a8c8; }
.tok-todo { color: #fff; background: var(--rust); border-radius: 4px; padding: 0 4px; font-style: normal; }

details.reveal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); margin: 10px 0; overflow: hidden; }
details.reveal summary { cursor: pointer; padding: 12px 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; list-style: none; font-size: .95rem; }
details.reveal summary::-webkit-details-marker { display: none; }
details.reveal summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; line-height: 1; color: var(--ink-faint); transition: transform .2s; }
details.reveal[open] summary::after { transform: rotate(45deg); }
details.reveal .reveal-body { padding: 0 16px 14px; }
details.reveal .reveal-body .codeblock { margin: 6px 0 4px; }
details.reveal.solution summary { color: var(--accent); }

.output { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.output.wide { grid-template-columns: 1fr; }
.output img { border-radius: 10px; max-height: 300px; width: auto; }
.output.wide img { max-height: none; width: 100%; }
.output img { height: auto; }
.output pre { margin: 0; font: .82rem/1.6 var(--font-mono); white-space: pre-wrap; color: var(--ink-soft); background: var(--surface-2); padding: 12px 14px; border-radius: 10px; }
.output figcaption { font-size: .9rem; color: var(--ink-soft); }
.output figcaption strong { color: var(--ink); display: block; margin-bottom: 4px; }
@media (max-width: 640px) { .output { grid-template-columns: 1fr; } .output img { max-height: none; width: 100%; } }

.think { display: grid; gap: 14px; }
.think-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.think-q p { margin: 0 0 10px; font-weight: 600; }
.think-q p .qn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--clay-soft); color: var(--rust); font-size: .82rem; margin-right: 8px; }
.think-q textarea {
  width: 100%; min-height: 84px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg);
  padding: 12px 14px; font: inherit; font-size: .95rem; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.think-q textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.think-q .saved { font-size: .78rem; color: var(--ink-faint); margin-top: 6px; min-height: 1.2em; }
.think-note { font-size: .82rem; color: var(--ink-faint); display: flex; gap: 6px; align-items: center; }

.part-done { display: flex; align-items: center; gap: 12px; margin-top: 48px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface-2); flex-wrap: wrap; }
.part-done .btn.is-done { background: var(--sage); color: #fff; box-shadow: none; }
.part-done .next-btn { margin-left: auto; padding: .95em 1.5em; font-size: 1.02rem; }
.part-done .next-btn .icon { transition: transform .2s; }
.part-done .next-btn:hover .icon { transform: translateX(4px); }

/* moving on: one part at a time; each new part slides in */
.part.entering { animation: part-in .6s cubic-bezier(.2, .7, .2, 1); }
@keyframes part-in { from { opacity: 0; transform: translateY(40px); } }

/* setup steps */
.setup-steps { list-style: none; padding: 0 !important; counter-reset: s; display: grid; gap: 14px; margin: 18px 0; }
.setup-steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 !important; }
.setup-steps li::before { content: counter(s); width: 40px; height: 40px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-deep); display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); font-size: 1.1rem; }
.setup-steps strong { display: block; margin-bottom: 2px; }
.setup-steps p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.kbd { font: 600 .82em var(--font-mono); background: var(--surface-2); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: .1em .45em; white-space: nowrap; }
.menu-path { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: .9em; background: var(--teal-soft); color: var(--teal-deep); padding: .15em .6em; border-radius: 6px; }
.download-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }

/* ---------- Lesson kit ---------- */
.feature .thumb-img, .video-frame .vf-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Activity boxes */
.box { --bx: var(--ink-soft); --bx-soft: var(--surface-2); margin: 22px 0; border-radius: var(--radius); position: relative; }
.box-check { --bx: var(--sage-deep); --bx-soft: var(--sage-soft); }
.box-predict { --bx: var(--ochre-deep); --bx-soft: var(--ochre-soft); }
.box-discuss { --bx: var(--rust); --bx-soft: var(--clay-soft); }
.box-device { --bx: var(--teal-deep); --bx-soft: var(--teal-soft); }
.box-play { --bx: var(--rust); --bx-soft: var(--rust-soft); }
.box-key { --bx: var(--ochre-deep); --bx-soft: var(--ochre-soft); }
.box-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px 0; }
.box-ico { display: grid; place-items: center; color: var(--bx); flex: none; }
.box-ico .icon { width: 20px; height: 20px; }
.box-label { font-size: 1rem; font-weight: 700; color: var(--bx); }
.box-meta { font-size: .85rem; color: var(--ink-soft); }
.box-body { padding: 12px 18px 18px; }
.box-body > :last-child { margin-bottom: 0; }
.box .think-q { background: var(--surface); }
.box-body ol:not(.setup-steps):not(.discuss-list) { padding-left: 1.3em; }
/* soft tint */
.box { background: color-mix(in srgb, var(--bx-soft) 70%, var(--surface)); }

/* three ways */
.three-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.three-ways > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: .93rem; }
.three-ways > div.on { border: 2px solid var(--sage-deep); background: var(--sage-soft); }
.three-ways strong { display: block; font-family: var(--font-head); font-weight: 400; font-size: 1.2rem; margin: 0 0 4px; }
.three-ways p { margin: 0; color: var(--ink-soft); }
.tw-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--c-soft); color: var(--c-deep); }
.tw-ico[data-color="sage"] { --c-soft: var(--sage-soft); --c-deep: var(--sage-deep); }
@media (max-width: 700px) { .three-ways { grid-template-columns: 1fr; } }

/* quick check */
.qcheck { display: grid; gap: 10px; }
.qc-item { background: var(--surface); border-radius: var(--radius-s); padding: 12px 14px; border: 1px solid var(--line); }
.qc-item > p:first-child { margin: 0 0 8px; font-weight: 600; }
.qc-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.qc-opts button, .pr-opts button {
  border: 1.5px solid var(--line-strong); background: var(--bg); color: var(--ink); border-radius: 999px;
  padding: .5em 1em; font: 600 .86rem/1.2 var(--font-body); cursor: pointer; transition: all .15s;
}
.qc-opts button:hover, .pr-opts button:hover:not(:disabled) { border-color: var(--ink-faint); }
.qc-opts button.right { background: var(--sage); border-color: var(--sage); color: #fff; }
.qc-opts button.wrong { background: var(--clay-soft); border-color: var(--clay); text-decoration: line-through; }
.qc-fb { margin: 8px 0 0; font-size: .9rem; color: var(--ink-soft); min-height: 0; }
.qc-fb:empty { display: none; }
.qc-item.right { border-color: var(--sage); }

/* predict */
.pq { font-weight: 600; margin-bottom: 12px; }
.pr-opts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.pr-opts button { border-radius: 12px; text-align: left; }
.pr-opts button[aria-pressed="true"] { border-color: var(--bx); background: var(--surface); box-shadow: 0 0 0 3px var(--bx-soft); }
.pr-opts button:disabled { cursor: default; opacity: .6; }
.pr-opts button.correct { opacity: 1; background: var(--sage); border-color: var(--sage); color: #fff; box-shadow: none; }
.pr-opts button.missed { opacity: 1; text-decoration: line-through; }
.pr-reveal { background: var(--surface); border-radius: var(--radius-s); padding: 14px 16px; animation: fold-in .3s ease; }
@keyframes fold-in { from { opacity: 0; transform: translateY(6px); } }
.pr-reveal p:last-child { margin: 0; }
.pr-verdict { font-size: .95rem; font-weight: 700; color: var(--bx); margin: 0 0 6px; }

/* stepper */
.stepper { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; margin: 20px 0; outline: none; }
.stepper-stage { background: var(--bg); border-radius: var(--radius); padding: 8px; }
.loop-svg { width: 100%; height: auto; display: block; color: var(--ink-faint); }
.loop-svg .lp { transition: opacity .3s; }
.loop-svg .lp.off { opacity: .28; }
.lp-box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 2; }
.lp.on .lp-box { stroke: var(--accent); stroke-width: 3; }
.lp-agent { fill: var(--sage-soft); }
.lp-env { fill: var(--ochre-soft); }
.lp-sheet { fill: var(--surface); }
.lp-t { font: 600 20px var(--font-head); fill: var(--ink); text-anchor: middle; }
.lp-s { font: 600 13px var(--font-body); fill: var(--ink-soft); text-anchor: middle; }
.lp-emoji { font-size: 34px; text-anchor: middle; }
.lp-cells rect { fill: var(--surface-2); stroke: var(--line-strong); }
.lp-cells rect.hot { fill: var(--sage); }
.lp-link { stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 3 4; }
.lp-arrow { fill: none; stroke: currentColor; stroke-width: 3; }
.lp.on .lp-arrow { color: var(--accent); }
.lp.on .lp-lab { fill: var(--accent); }
.stepper-panels { min-height: 112px; padding: 16px 4px 4px; }
.st-panel h4 { font-family: var(--font-head); font-size: 1.2rem; margin: 0 0 4px; }
.st-panel p { margin: 0; }
.stepper-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.stepper-nav .btn:disabled { opacity: .4; cursor: default; transform: none; }
.stepper-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.stepper-dots button { border: 0; background: var(--surface-2); color: var(--ink-soft); border-radius: 999px; padding: .4em .8em; font: 600 .78rem/1 var(--font-body); cursor: pointer; }
.stepper-dots button.seen { background: var(--sage-soft); color: var(--sage-deep); }
.stepper-dots button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 560px) { .stepper-dots { flex-wrap: nowrap; gap: 5px; } .stepper-dots button span { display: none; } .stepper-dots button { width: 10px; height: 10px; padding: 0; flex: none; } .stepper-nav { gap: 8px; } .stepper-nav .btn { padding: .55em .8em; } .stepper { padding: 12px; } }

/* Biscuit's yard */
.yard-prompt { font-size: .95rem; transition: opacity .3s; }
.yard-prompt.answered { opacity: .55; }
.yard-wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.yard {
  display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(4, 1fr); gap: 4px;
  background: #b58a5a; padding: 6px; border-radius: 12px; aspect-ratio: 6 / 4; box-shadow: inset 0 0 0 2px #9a7148;
}
.ycell {
  --good: 0%; --bad: 0%;
  position: relative; border-radius: 6px; display: grid; place-items: center; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, color-mix(in srgb, #4f9a4a var(--good), #9fca7f) calc(100% - var(--bad)), #b0613d);
  transition: background .3s; cursor: default; overflow: hidden; min-width: 0;
}
.ycell[role="button"] { cursor: pointer; }
.ycell .ar { font-size: clamp(.9rem, 2.4vw, 1.3rem); font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); line-height: 1; }
.ycell .v { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); font: 700 clamp(.55rem, 1.4vw, .72rem)/1 var(--font-mono); background: rgba(255,255,255,.85); color: #3f322a; padding: 2px 4px; border-radius: 4px; }
.ycell .v:empty { display: none; }
.ycell.shed { background: repeating-linear-gradient(0deg, #c2553a 0 9px, #a94530 9px 11px); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ycell.bone { background: #d8c08a; }
.ycell.bone .ic { font-size: clamp(1.2rem, 3vw, 1.8rem); }
.ycell.mud { background: #9fca7f; }
.ycell.mud .blob { width: 64%; height: 46%; background: #7a5233; border-radius: 48% 52% 45% 55%; box-shadow: inset -3px -3px 0 rgba(0,0,0,.15); }
.ycell.door { box-shadow: inset 4px 0 0 #7a5233; }
.ycell .dog { position: absolute; font-size: clamp(1.1rem, 3vw, 1.7rem); z-index: 2; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.ycell.pin::after { content: "📍"; position: absolute; top: 2px; right: 3px; font-size: .9rem; }
.ycell.first { outline: 3px solid var(--ochre); outline-offset: -3px; animation: ring 1.2s ease 2; }
@keyframes ring { 50% { outline-color: #fff; } }
.yard-stats { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; margin-bottom: 12px; }
.yard-stats div { background: var(--surface); border-radius: 10px; padding: 8px 12px; }
.yard-stats span { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-faint); }
.yard-stats b { font-size: .95rem; }
.yard-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.yard-btns .btn:disabled { opacity: .5; cursor: default; transform: none; }
.yard-set { display: grid; gap: 8px; }
.yard-set label { display: grid; grid-template-columns: 1fr auto; font-size: .84rem; font-weight: 600; gap: 2px 8px; }
.yard-set input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.yard-set output { font-family: var(--font-mono); font-size: .82rem; }
.yard-legend { font-size: .76rem; color: var(--ink-soft); margin: 12px 0 0; line-height: 1.5; }
.yard-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; vertical-align: -1px; margin-right: 3px; }
.lg-good { background: #4f9a4a; }
.lg-bad { background: #b0613d; }
.yard-msg { margin: 14px 0 0; font-size: .95rem; }
.yard-msg:empty { display: none; }
@media (max-width: 760px) { .yard-wrap { grid-template-columns: 1fr; } }

/* Colab form preview */
.colab-form { background: #fff; color: #202124; border: 1px solid #dadce0; border-radius: 10px; margin: 14px 0; font: 14px/1.4 Roboto, Arial, sans-serif; overflow: hidden; }
.cf-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-weight: 500; font-size: 15px; border-bottom: 1px solid #eee; }
.cf-run { width: 26px; height: 26px; border-radius: 50%; background: #e8eaed; color: #444; display: grid; place-items: center; font-size: 11px; }
.cf-hint { margin-left: auto; font-size: 12px; color: #80868b; font-style: italic; }
.cf-row { display: grid; grid-template-columns: 190px 1fr 40px; gap: 12px; align-items: center; padding: 6px 14px; font-size: 13px; }
.cf-row input { width: 100%; accent-color: #f9ab00; }
.cf-row output { font-family: var(--font-mono); font-size: 12px; text-align: right; }
.cf-foot { padding: 8px 14px 10px; font-size: 12px; color: #1a73e8; }
.cf-row select { width: 100%; font: inherit; padding: 3px 6px; border: 1px solid #dadce0; border-radius: 4px; background: #fff; }
.cf-row input[type="checkbox"] { width: auto; justify-self: start; }
@media (max-width: 560px) {
  .cf-row { grid-template-columns: 1fr 40px; } .cf-row :is(input, select) { grid-column: 1 / -1; grid-row: 2; } .cf-hint { display: none; }
  .cf-row input[type="checkbox"] { grid-column: auto; grid-row: auto; justify-self: end; } .cf-row output:empty { display: none; }
}

/* bits and pieces */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.pair .output { margin: 0; }
@media (max-width: 700px) { .pair { grid-template-columns: 1fr; } }
.checklist { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 8px; }
.checklist li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px 10px 40px; position: relative; font-size: .95rem; margin: 0 !important; }
.checklist li::before { content: "?"; position: absolute; left: 12px; top: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--sage-soft); color: var(--sage-deep); display: grid; place-items: center; font-weight: 700; font-size: .78rem; }
.mini-table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; background: var(--surface); border-radius: var(--radius-s); overflow: hidden; font-size: .95rem; }
.mini-table th, .mini-table td { padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.mini-table th { font-size: .88rem; color: var(--ink-soft); }
.mini-table tr:last-child td { border-bottom: 0; }
.discuss-list { counter-reset: d; list-style: none; padding: 0 !important; display: grid; gap: 10px; margin: 4px 0 16px; }
.discuss-list li { counter-increment: d; position: relative; padding: 12px 14px 12px 50px; background: var(--surface); border-radius: var(--radius-s); margin: 0 !important; font-weight: 500; }
.discuss-list li::before { content: counter(d); position: absolute; left: 12px; top: 11px; width: 26px; height: 26px; border-radius: 50%; background: var(--bx); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.pending-note { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ochre-deep); background: var(--ochre-soft); padding: 8px 14px; border-radius: var(--radius-s); }
[data-pending] { opacity: .75; }
details.reveal.teacher summary { color: var(--teal-deep); }

/* case studies */
.cases { display: grid; gap: 10px; margin: 18px 0; }
.case { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s; }
.case[open] { box-shadow: var(--shadow); border-color: var(--line-strong); }
.case summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.case summary::-webkit-details-marker { display: none; }
.case summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; color: var(--ink-faint); transition: transform .2s; }
.case[open] summary::after { transform: rotate(45deg); }
.case-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.case summary strong { display: block; font-size: 1.05rem; }
.case summary small { color: var(--ink-faint); font-size: .8rem; }
.case-body { padding: 0 18px 16px 76px; }
.case-q { background: var(--clay-soft); border-radius: var(--radius-s); padding: 10px 14px; margin: 0; }
@media (max-width: 560px) { .case-body { padding-left: 18px; } }

/* glossary */
.glossary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0; }
.glossary div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px; font-size: .93rem; color: var(--ink-soft); }
.glossary dt, .glossary strong { color: var(--ink); font-weight: 700; display: block; margin-bottom: 2px; }
@media (max-width: 640px) { .glossary { grid-template-columns: 1fr; } }

.next-card { display: flex; align-items: center; gap: 20px; background: var(--sage-soft); border-radius: var(--radius-l); padding: 26px 28px; margin-top: 24px; text-decoration: none; color: inherit; }
.next-card .ico { width: 56px; height: 56px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--sage-deep); flex: none; }
.next-card small { font-weight: 700; color: var(--sage-deep); font-size: .9rem; }
.next-card h3 { margin: 2px 0 0; font-size: 1.25rem; }

/* math */
.math { font-family: var(--font-head); font-size: 1.2rem; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 18px 0; overflow-x: auto; }
.math var { font-style: italic; }
.math .g { color: var(--sage-deep); font-weight: 600; }
.math .t { color: var(--rust); }

/* =========================================================
   Lesson layout: "Read, then do"
   Tighter spacing than the rules above (":root" just keeps these ahead of them).
   On wide screens lesson.js puts each part in .part-cols: the reading first,
   then the things to do together under "Your turn", side by side.
   ========================================================= */
@media (min-width: 1021px) { :root .rail a { padding: 6px 0; font-size: .86rem; } }
@media (max-width: 900px) { :root .lesson-hero .grid { grid-template-columns: 1fr; gap: 20px; } }
@media (max-width: 1100px) { :root .glossary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { :root .setup-steps, :root .glossary { grid-template-columns: 1fr; } :root .qc-item { grid-template-columns: 1fr; } :root .case-body { padding-left: 14px; } }

/* read, then do (":root .part" keeps these ahead of the spacing rules above) */
:root .part .part-cols { display: grid; grid-template-columns: minmax(0, 1fr); }
:root .part .part-cols > :empty { display: none; }
:root .part .pc-read > :first-child, :root .part .pc-do > :first-child { margin-top: 0; }
:root .part .pc-read > :last-child, :root .part .pc-do > :last-child { margin-bottom: 0; }
:root .part .pc-read > :is(p, h3, ul, ol) { max-width: 82ch; }
:root .part .pc-read > .output.wide { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; }
:root .part .pc-read .output.wide img { max-height: 48vh; }
:root .part .part-cols:not(.one-col) .stepper { display: block; }
:root .part .pc-do {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start;
  margin-top: 20px; padding-top: 14px; border-top: 2px solid var(--line);
}
:root .part .pc-do::before { content: "Your turn"; flex: 1 1 100%; font: 400 1.2rem/1.2 var(--font-head); color: var(--ink); }
:root .part .pc-do:empty { display: none; }  /* a part with nothing to do: no "Your turn" */
:root .part .pc-do > * { flex: 1 1 calc(50% - 8px); min-width: 0; margin: 0; }
:root .part .pc-do > :is(.box-check, .cases, .think-note, details.reveal) { flex-basis: 100%; }
:root .part .pc-do .setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:root .part .see-group > .mode { margin: 0 0 8px; }
:root .part .see-group > .output { margin: 0; grid-template-columns: minmax(0, 1fr); gap: 10px; }
:root .part .see-group .output img { max-height: 40vh; width: 100%; object-fit: contain; }
@media (min-width: 1021px) {
  /* the dots stay on the left; the part gets more width beside them */
  :root .lesson-shell { grid-template-columns: 180px minmax(0, 1180px); gap: 32px; }
  .yard-wrap { max-width: 860px; }
}

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600; opacity: 0; transition: all .2s; z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0s !important; }
}


/* ---------- Lesson tag problems ----------
   js/lesson-blocks.js shows one of these where a lesson tag is used wrongly, saying what to fix. */
.tag-warning { background: var(--rust-soft); color: #7a2f17; border: 2px dashed var(--rust); border-radius: var(--radius-s); padding: 10px 14px; margin: 12px 0; font-size: .92rem; max-width: 72ch; }
