/* Ellie Lab — tutorial site
   Visual direction: deep woodland ink + honey accent (Ellie’s mustard),
   paper grain, storybook type. */

:root {
  --ink: #0c1612;
  --forest: #13241c;
  --moss: #1e3a2f;
  --leaf: #2f5a45;
  --mist: #c8d6cc;
  --paper: #e8efe8;
  --honey: #d4a24a;
  --honey-deep: #b07e2e;
  --cream: #f3f0e6;
  --danger: #c45c4a;
  --ok: #5a9a72;
  --font-display: "Fraunces", "Palatino Linotype", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 72rem;
  --read: 42rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 0.35rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 5px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(212, 162, 74, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(47, 90, 69, 0.45), transparent 50%),
    linear-gradient(165deg, var(--ink) 0%, var(--forest) 45%, #0a1210 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

a {
  color: var(--honey);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--cream);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* —— Story figures —— */
.chapter-figure {
  margin: 1.5rem 0 2rem;
  max-width: 18rem;
}

.chapter-figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 214, 204, 0.14);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.chapter-figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: var(--mist);
  line-height: 1.4;
}

.shot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0 2rem;
}

.shot-gallery figure {
  margin: 0;
}

.shot-gallery img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid rgba(200, 214, 204, 0.14);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.shot-gallery a:hover img,
.shot-gallery figure:hover img {
  transform: translateY(-2px);
  border-color: rgba(232, 196, 120, 0.45);
}

.shot-gallery figcaption {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--leaf);
  line-height: 1.3;
}

.story-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 1.75rem 0 0.5rem;
}

.story-strip img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 0.45rem;
  border: 1px solid rgba(200, 214, 204, 0.12);
  opacity: 0.92;
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease);
}

.story-strip a:hover img {
  opacity: 1;
  transform: translateY(-3px);
}

.story-strip-note {
  margin: 0.75rem 0 0;
  color: var(--mist);
  font-size: 0.95rem;
}

@media (max-width: 860px) {
  .story-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .story-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapter-figure {
    max-width: 14rem;
  }
}

/* —— Shell —— */
.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(200, 214, 204, 0.12);
  backdrop-filter: blur(10px);
  background: rgba(12, 22, 18, 0.55);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--honey);
  font-style: italic;
  font-weight: 500;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  font-size: 0.92rem;
}

.topnav a {
  color: var(--mist);
  text-decoration: none;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  color: var(--honey);
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--honey-deep), var(--honey));
  z-index: 40;
  transition: width 0.15s linear;
}

/* —— Landing hero —— */
.hero {
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
  border-bottom: 1px solid rgba(200, 214, 204, 0.15);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(16rem, 24vw, 19rem);
  grid-template-areas: "intro video" "notes video";
  align-items: center;
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
  max-width: var(--max);
  margin: 0 auto;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 22, 18, 0.94) 0%, rgba(12, 22, 18, 0.82) 40%, rgba(12, 22, 18, 0.55) 100%),
    url("images/01-everyday-ellie.webp") center top / cover no-repeat;
  z-index: -1;
}

@media (max-width: 760px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "video" "notes";
    gap: 1.5rem;
  }

  .hero-backdrop {
    bottom: auto;
    height: min(100%, 38rem);
    /* Frame the upper-right illustration, keeping the lower contact-sheet row out of view. */
    background-image:
      linear-gradient(0deg, var(--ink) 0%, rgba(12, 22, 18, 0.85) 35%, rgba(12, 22, 18, 0.65) 100%),
      url("images/01-everyday-ellie.webp");
    background-size: 100% 100%, auto 200%;
    background-position: center, right top;
  }
}

.hero-inner {
  grid-area: intro;
  align-self: end;
  max-width: 36rem;
  animation: rise 0.9s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

.hero .brand-mark {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--cream);
  margin: 0 0 1rem;
}

.hero .brand-mark em {
  font-style: italic;
  color: var(--honey);
  font-weight: 500;
}

.hero h1 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  color: var(--mist);
  margin: 0 0 1.75rem;
  max-width: 28rem;
  line-height: 1.45;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--honey);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--cream);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(200, 214, 204, 0.35);
}

.btn-ghost:hover {
  border-color: var(--honey);
  color: var(--honey);
}

/* —— Finished Short within the landing hero —— */
.watch-copy {
  grid-area: notes;
  align-self: start;
}

.watch-copy h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--cream);
  margin: 0 0 0.25rem;
}

.starter-kit h3 {
  font-family: var(--font-display);
  color: var(--cream);
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

.watch-notes {
  list-style: none;
  padding: 0;
  margin: 0;
}

.watch-notes li {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(200, 214, 204, 0.15);
}

.watch-notes a {
  font-weight: 600;
}

.watch-notes li > span {
  display: block;
  margin-top: 0.1rem;
  color: var(--mist);
  font-size: 0.95rem;
}

.short-video {
  grid-area: video;
  width: 100%;
  max-width: 19rem;
  margin: 0 auto;
}

.short-video > .chapter-kicker {
  text-align: center;
  margin-bottom: 0.6rem;
}

.short-player {
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid rgba(212, 162, 74, 0.35);
  border-radius: 0.85rem;
  background: #000;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
}

.short-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.short-video figcaption {
  margin-top: 0.85rem;
  text-align: center;
  color: var(--mist);
  font-size: 0.88rem;
}

.starter-kit {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  margin: 2rem 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(212, 162, 74, 0.3);
  border-radius: var(--radius);
  background: rgba(212, 162, 74, 0.05);
}

.starter-kit h3 {
  margin-top: 0;
}

.starter-kit p:last-child {
  margin-bottom: 0;
}

.starter-note {
  color: var(--mist);
  font-size: 0.9rem;
}

.starter-kit .btn {
  flex-direction: column;
  gap: 0.1rem;
}

.download-size {
  font-size: 0.8rem;
  font-weight: 400;
}

@media (max-width: 760px) {
  .starter-kit {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* —— Chapter layout —— */
.chapter-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  gap: 2rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  width: 100%;
}

@media (max-width: 860px) {
  .chapter-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc {
    position: static !important;
  }
}

.toc {
  position: sticky;
  top: 5rem;
  align-self: start;
  font-size: 0.9rem;
}

.toc h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--honey);
  margin: 0 0 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-left: 1px solid rgba(200, 214, 204, 0.18);
  padding-left: 0.9rem;
}

.toc a {
  color: var(--mist);
  text-decoration: none;
  display: block;
  padding: 0.2rem 0;
}

.toc a:hover,
.toc a[aria-current="page"] {
  color: var(--cream);
}

.toc a[aria-current="page"] {
  border-left: 2px solid var(--honey);
  margin-left: -0.9rem;
  padding-left: calc(0.9rem - 2px);
  color: var(--honey);
}

.chapter {
  min-width: 0;
  max-width: var(--read);
}

.chapter-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--honey);
  margin: 0 0 0.6rem;
}

.chapter h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--cream);
}

.lede {
  font-size: 1.2rem;
  color: var(--mist);
  margin: 0 0 2rem;
}

.chapter h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 2.4rem 0 0.75rem;
  color: var(--cream);
}

.chapter h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--honey);
}

.chapter p,
.chapter li {
  color: var(--paper);
}

.chapter ul,
.chapter ol {
  padding-left: 1.2rem;
}

.chapter li + li {
  margin-top: 0.4rem;
}

.chapter code,
.inline-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.12em 0.4em;
  border-radius: 0.25rem;
  color: #dce8df;
}

pre {
  overflow-x: auto;
  padding: 1rem 1.15rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(200, 214, 204, 0.12);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: #dce8df;
}

pre code {
  background: none;
  padding: 0;
}

/* Callouts */
.callout {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--honey);
  background: rgba(30, 58, 47, 0.55);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout.why { border-left-color: var(--honey); }
.callout.tradeoff { border-left-color: var(--danger); }
.callout.try { border-left-color: var(--ok); }

.callout .label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--honey);
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.callout.tradeoff .label { color: #e8a090; }
.callout.try .label { color: #8fd0a8; }

.callout p:last-child {
  margin-bottom: 0;
}

/* Pipeline diagram */
.flow {
  display: grid;
  gap: 0.55rem;
  margin: 1.5rem 0 2rem;
}

.flow-step {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem 1rem;
  background: rgba(19, 36, 28, 0.75);
  border: 1px solid rgba(200, 214, 204, 0.1);
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(0.6rem);
  animation: rise 0.7s var(--ease) forwards;
}

.flow-step:nth-child(1) { animation-delay: 0.05s; }
.flow-step:nth-child(2) { animation-delay: 0.12s; }
.flow-step:nth-child(3) { animation-delay: 0.19s; }
.flow-step:nth-child(4) { animation-delay: 0.26s; }
.flow-step:nth-child(5) { animation-delay: 0.33s; }
.flow-step:nth-child(6) { animation-delay: 0.4s; }

.flow-num {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--honey);
  line-height: 1;
}

.flow-step strong {
  display: block;
  color: var(--cream);
  margin-bottom: 0.15rem;
}

.flow-step span {
  color: var(--mist);
  font-size: 0.95rem;
}

/* Pathway charts and revision gates */
.pathways-page {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.pathways-intro {
  max-width: 48rem;
}

.pathways-page h1,
.pathways-page h2,
.pathways-page h3 {
  font-family: var(--font-display);
  color: var(--cream);
  line-height: 1.2;
}

.pathways-page h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin: 0 0 1rem;
}

.pathways-page h2 {
  font-size: 1.8rem;
  margin: 3rem 0 1rem;
}

.pathways-page h3 {
  font-size: 1.3rem;
  margin: 0 0 0.75rem;
}

.pathway-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
}

.pathway-picker {
  min-inline-size: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  border: 0;
}

.pathway-picker legend {
  padding: 0;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.pathway-picker > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.pathway-picker > label {
  padding: 1rem;
  border: 1px solid rgba(200, 214, 204, 0.35);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--cream);
  font-weight: 600;
}

.pathway-picker > label span {
  display: block;
  margin-top: 0.25rem;
  color: var(--mist);
  font-size: 0.85rem;
  font-weight: 400;
}

.pathway-picker > input:checked + label {
  border-color: var(--honey);
  box-shadow: inset 0 3px var(--honey);
  background: rgba(212, 162, 74, 0.12);
}

.pathway-picker > input:focus-visible + label {
  outline: 2px solid var(--cream);
  outline-offset: 4px;
}

.pathway-panel {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 1.5rem 0;
}

#route-plan:checked ~ .pathway-panel:not(.pathway-panel-plan),
#route-editor:checked ~ .pathway-panel:not(.pathway-panel-editor),
#route-code:checked ~ .pathway-panel:not(.pathway-panel-code) {
  display: none;
}

.pathway-panel > p,
.pathway-transcript {
  max-width: 48rem;
}

.pathway-figure {
  margin: 1.5rem 0;
}

.diagram-scroll {
  max-width: 100%;
  overflow-x: auto;
  background: #101f18;
  border: 1px solid rgba(200, 214, 204, 0.25);
  border-radius: var(--radius);
}

.diagram-scroll img {
  width: 100%;
  min-width: 40rem;
  max-width: 42rem;
  margin: 0 auto;
}

.pathway-figure figcaption {
  margin-top: 0.75rem;
  color: var(--mist);
  font-size: 0.9rem;
}

.pathway-transcript summary,
.revision-list summary {
  cursor: pointer;
  color: var(--honey);
  font-weight: 600;
  padding: 0.75rem 0;
}

.pathway-transcript li + li {
  margin-top: 0.75rem;
}

.gate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.gate-card {
  padding: 1.25rem;
  border: 1px solid rgba(212, 162, 74, 0.35);
  border-radius: var(--radius);
  background: rgba(212, 162, 74, 0.04);
}

.revision-list details {
  border-bottom: 1px solid rgba(200, 214, 204, 0.2);
  padding: 0.25rem 0;
}

.revision-list p {
  max-width: 48rem;
  margin-top: 0;
}

@media (max-width: 640px) {
  .pathway-picker,
  .gate-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Compare table */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.25rem 0 2rem;
}

.compare th,
.compare td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(200, 214, 204, 0.14);
  vertical-align: top;
}

.compare th {
  color: var(--honey);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compare td:first-child {
  color: var(--cream);
  font-weight: 600;
  white-space: nowrap;
}

/* Chapter footer nav */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(200, 214, 204, 0.15);
}

.chapter-nav a {
  text-decoration: none;
  color: var(--mist);
  max-width: 16rem;
}

.chapter-nav a:hover {
  color: var(--honey);
}

.chapter-nav .dir {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  color: var(--leaf);
}

.chapter-nav .title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: inherit;
}

.site-footer {
  margin-top: auto;
  padding: 1.5rem;
  border-top: 1px solid rgba(200, 214, 204, 0.1);
  color: var(--mist);
  font-size: 0.88rem;
  text-align: center;
}

.site-footer a {
  color: var(--mist);
}

/* Landing chapters grid (not hero cards — interaction list) */
.curriculum {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.curriculum h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 0.5rem;
  color: var(--cream);
}

.curriculum > p {
  color: var(--mist);
  max-width: 36rem;
  margin: 0 0 2rem;
}

.lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(200, 214, 204, 0.15);
}

.lesson-list a {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.15rem 0.25rem;
  border-bottom: 1px solid rgba(200, 214, 204, 0.12);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.25s var(--ease), background 0.25s;
}

.lesson-list a:hover {
  padding-left: 0.5rem;
  background: linear-gradient(90deg, rgba(212, 162, 74, 0.08), transparent 60%);
}

.lesson-list .num {
  font-family: var(--font-display);
  color: var(--honey);
  font-size: 1.25rem;
}

.lesson-list .name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--cream);
}

.lesson-list .blurb {
  display: block;
  grid-column: 2;
  color: var(--mist);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.lesson-list .go {
  color: var(--honey);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-self: center;
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 9rem;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .topnav {
    gap: 0.35rem 1rem;
  }
  .lesson-list a {
    grid-template-columns: 2.25rem 1fr;
  }
  .lesson-list .go {
    display: none;
  }
}

.reveal {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.reveal-pending {
  opacity: 0;
  transform: translateY(0.75rem);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal.reveal-pending {
    opacity: 1;
    transform: none;
  }
}

/* —— Prose helpers —— */
.credits-page,
.credit-line {
  overflow-wrap: anywhere;
}

.chapter p + p {
  margin-top: 1rem;
}

.callout.harness {
  border-left-color: #6a9cc9;
  background: rgba(24, 40, 52, 0.65);
}

.callout.harness .label {
  color: #9ec4e8;
}

.prose-note {
  font-size: 0.98rem;
  color: var(--mist);
  border-top: 1px solid rgba(200, 214, 204, 0.12);
  margin-top: 2rem;
  padding-top: 1rem;
}

/* —— Tooltips —— */
.tip {
  border-bottom: 1px dotted rgba(212, 162, 74, 0.85);
  cursor: help;
  color: inherit;
  text-decoration: none;
}

.tip:hover,
.tip:focus {
  color: var(--honey);
  outline: none;
}

.tip-bubble {
  position: fixed;
  z-index: 50;
  max-width: min(22rem, calc(100vw - 1.5rem));
  padding: 0.7rem 0.85rem;
  background: #0a1210;
  color: var(--cream);
  border: 1px solid rgba(212, 162, 74, 0.45);
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.tip-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}

.tip-bubble .tip-term {
  display: block;
  font-family: var(--font-display);
  color: var(--honey);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

/* —— Glossary —— */
.glossary-search {
  width: 100%;
  max-width: 28rem;
  margin: 0 0 1.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 214, 204, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
}

.glossary-search::placeholder {
  color: rgba(200, 214, 204, 0.55);
}

.glossary-search:focus {
  outline: 2px solid rgba(212, 162, 74, 0.55);
  outline-offset: 2px;
}

.glossary-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.glossary-list > li {
  padding: 1.15rem 0;
  border-bottom: 1px solid rgba(200, 214, 204, 0.12);
}

.glossary-list dt {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--cream);
  margin: 0 0 0.35rem;
}

.glossary-list dt code {
  font-size: 0.85em;
}

.glossary-list dd {
  margin: 0;
  color: var(--mist);
}

.glossary-list .aka {
  display: block;
  font-size: 0.85rem;
  color: rgba(200, 214, 204, 0.65);
  margin-bottom: 0.35rem;
}

.letter-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
}

.letter-jump a {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--mist);
  border: 1px solid rgba(200, 214, 204, 0.18);
  border-radius: 0.25rem;
  font-size: 0.85rem;
}

.letter-jump a:hover {
  color: var(--honey);
  border-color: var(--honey);
}
