/* ==========================================================================
   Delta Farms — Regenerative Animal Husbandry Academy
   Brand: Cormorant Garamond (display) + Avenir/Nunito Sans (text)
   Palette: clay #AE887B · ink #2E2E2E · forest #424E42 · olive #4E522E
            sage #90AB8C · khaki #9C9A81 · cream #EFE7DC
   ========================================================================== */

:root {
  /* brand */
  --clay: #AE887B;
  --clay-deep: #8A6355;
  --ink: #2E2E2E;
  --forest: #424E42;
  --olive: #4E522E;
  --sage: #90AB8C;
  --khaki: #9C9A81;
  --cream: #EFE7DC;

  /* semantic — light */
  --paper: #FBF8F2;
  --paper-2: #F5F0E6;
  --surface: #FFFFFF;
  --text: #2B2E2A;
  --text-muted: #5C6157;
  --text-faint: #666B61;   /* 5.2:1 on --paper, 4.8:1 on --paper-2 — AA at small sizes on both surfaces */
  --heading: #3A463A;
  --accent: var(--clay-deep);
  --link: #4A5230;
  --link-hover: var(--clay-deep);
  --rule: #E2DBCB;
  --rule-strong: #CFC6B2;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(46, 46, 46, .04), 0 8px 24px -12px rgba(66, 78, 66, .16);

  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-text: 'Avenir Next', 'Avenir', 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --wrap: 1180px;
  --measure: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171B17;
    --paper-2: #1C211C;
    --surface: #1F251F;
    --text: #E9E4D9;
    --text-muted: #AFB6A9;
    --text-faint: #8B9287;
    --heading: #E4E9DF;
    --accent: #C79E8D;
    --link: #A9C4A4;
    --link-hover: #C79E8D;
    --rule: #2E362E;
    --rule-strong: #414A40;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--forest); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.4rem); }

/* ─────────────────────────────────────────────────────────── typography ── */

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--heading); font-weight: 600; line-height: 1.14; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.72rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1.15em; }

.eyebrow {
  font-family: var(--font-text);
  font-size: .715rem; font-weight: 700; letter-spacing: .17em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .85rem;
}
.eyebrow a { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; }

.lede, .page-lede, .hero-lede, .section-lede {
  font-size: clamp(1.06rem, 1.6vw, 1.22rem);
  color: var(--text-muted);
  line-height: 1.62;
  max-width: 62ch;
}

/* ────────────────────────────────────────────────────────────── header ── */

.progress-rail { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; background: transparent; pointer-events: none; }
.progress-rail-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--clay)); transition: width .1s linear; }

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.head-inner { display: flex; align-items: center; gap: 1.2rem; min-height: 68px; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; margin-right: auto; }
.brand img { width: 42px; height: auto; }
@media (prefers-color-scheme: dark) { .brand img, .hero-logo, .foot-brand img { filter: invert(1) hue-rotate(180deg) saturate(.6) brightness(1.35); } }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-size: 1.24rem; font-weight: 600; letter-spacing: .06em; color: var(--heading); }
.brand-sub { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }

.site-nav { display: flex; gap: .35rem; }
.site-nav a {
  padding: .5rem .85rem; border-radius: var(--radius); text-decoration: none;
  font-size: .87rem; font-weight: 600; color: var(--text-muted); letter-spacing: .01em;
}
.site-nav a:hover { background: var(--paper-2); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--heading); background: var(--paper-2); }

.nav-toggle { display: none; background: none; border: 0; padding: .6rem; cursor: pointer; flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--text); transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: .5rem clamp(1.1rem, 4vw, 2.4rem) 1rem;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .8rem .2rem; border-bottom: 1px solid var(--rule); border-radius: 0; }
}

/* ──────────────────────────────────────────────────────────────── hero ── */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--sage) 22%, transparent), transparent 62%),
    linear-gradient(180deg, var(--paper-2), var(--paper));
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image: url('brand/pattern.webp');
  background-size: 620px auto; opacity: .05; mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) { .hero-bg::after { opacity: .06; mix-blend-mode: screen; filter: invert(1) brightness(1.4); } }

.hero-inner { position: relative; text-align: center; padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-logo { margin: 0 auto 1.8rem; width: clamp(160px, 22vw, 225px); }
.hero h1 { margin-bottom: .35em; }
.hero-lede { margin-inline: auto; max-width: 66ch; }

.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: 2.1rem 0 0; }

.btn {
  display: inline-flex; align-items: center; gap: .55rem; justify-content: center;
  font-family: var(--font-text); font-weight: 700; font-size: .9rem; letter-spacing: .02em;
  padding: .82rem 1.6rem; border-radius: var(--radius); text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest); color: #F6F3EC; }
.btn-primary:hover { background: #354035; color: #fff; }
.btn-ghost { border-color: var(--rule-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 1rem 2rem; font-size: .98rem; }

.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(1.4rem, 5vw, 3.4rem); justify-content: center; margin: 3rem 0 0; padding: 0; }
.hero-stats > div { text-align: center; }
.hero-stats dt { font-size: .68rem; letter-spacing: .15em; text-transform: uppercase; color: var(--text-faint); margin-bottom: .28rem; }
.hero-stats dd { margin: 0; font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; color: var(--heading); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }

.hero-resume { margin-top: 2rem; font-size: .92rem; color: var(--text-muted); }
.hero-resume a { font-weight: 700; }

/* ─────────────────────────────────────────────────────────── sections ── */

.section { padding: clamp(3rem, 7vw, 5.4rem) 0; }
.section-head { max-width: 74ch; margin-bottom: 2.4rem; }
.band { background: var(--paper-2); border-block: 1px solid var(--rule); }
.band-inner { padding: clamp(3rem, 7vw, 5.4rem) 0; }

.page-head { padding: clamp(2.6rem, 6vw, 4.4rem) 0 clamp(1.6rem, 3vw, 2.4rem); border-bottom: 1px solid var(--rule); background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
.page-head h1 { margin-bottom: .3em; }
.page-meta { display: flex; gap: .6rem; font-size: .85rem; color: var(--text-faint); margin-top: 1rem; }

.cta-final { text-align: center; border-top: 1px solid var(--rule); }
.cta-final p { color: var(--text-muted); margin-bottom: 1.7rem; }

/* ─────────────────────────────────────────────────── module card grid ── */

.mod-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); }

.mod-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.35rem; text-decoration: none; color: inherit;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.mod-card:hover { border-color: var(--sage); transform: translateY(-2px); box-shadow: var(--shadow); }
.mod-num { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.mod-card h3 { margin: .55rem 0 .5rem; font-size: 1.42rem; }
.mod-strap { font-size: .9rem; color: var(--text-muted); line-height: 1.55; margin: 0 0 1.1rem; flex: 1; }
.mod-meta { display: flex; gap: .45rem; font-size: .78rem; color: var(--text-faint); margin-bottom: .8rem; }
.mod-progress { height: 3px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.mod-progress-bar { height: 100%; width: 0; background: var(--sage); transition: width .35s ease; }
.mod-progress-text { font-size: .7rem; color: var(--text-faint); margin-top: .45rem; min-height: 1em; letter-spacing: .04em; }

/* ───────────────────────────────────────────────────────────── pillars ── */

.pillars { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.pillar h3 { font-size: 1.24rem; margin: .8rem 0 .45rem; }
.pillar p { font-size: .91rem; color: var(--text-muted); margin: 0; line-height: 1.6; }
.pillar-icon { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 50%; background: color-mix(in srgb, var(--sage) 26%, transparent); color: var(--heading); }
.pillar-icon svg { width: 20px; height: 20px; }

/* ────────────────────────────────────────────────────── curriculum list ── */

.curr-mod { padding: clamp(2rem, 4vw, 3rem) 0; border-bottom: 1px solid var(--rule); }
.curr-mod:last-child { border-bottom: 0; }
.curr-mod-head h2 { margin: .4rem 0 .4rem; }
.curr-mod-head h2 a { text-decoration: none; color: inherit; }
.curr-mod-head h2 a:hover { color: var(--accent); }
.curr-mod-head p { color: var(--text-muted); max-width: 72ch; font-size: .96rem; }

.curr-list { list-style: none; padding: 0; margin: 1.4rem 0 0; border-top: 1px solid var(--rule); }
.curr-list li { border-bottom: 1px solid var(--rule); }
.curr-list a {
  display: grid; grid-template-columns: 2.6rem 1fr auto 1.4rem; align-items: center; gap: .9rem;
  padding: .95rem .5rem; text-decoration: none; color: inherit; transition: background .14s;
}
.curr-list a:hover { background: var(--paper-2); }
.curr-n { font-family: var(--font-display); font-size: 1.02rem; color: var(--text-faint); font-variant-numeric: lining-nums tabular-nums; }
.curr-body { display: flex; flex-direction: column; gap: .18rem; min-width: 0; }
.curr-title { font-weight: 600; font-size: 1rem; color: var(--heading); }
.curr-sum { font-size: .845rem; color: var(--text-muted); line-height: 1.5; }
.curr-objs { display: flex; flex-wrap: wrap; gap: .3rem .7rem; margin-top: .35rem; }
.curr-objs span { font-size: .74rem; color: var(--text-faint); padding-left: .8rem; position: relative; }
.curr-objs span::before { content: '·'; position: absolute; left: .2rem; }
.curr-min { font-size: .76rem; color: var(--text-faint); white-space: nowrap; }
.curr-tick { width: 17px; height: 17px; border: 1.5px solid var(--rule-strong); border-radius: 50%; display: inline-block; }
.curr-tick.is-done { background: var(--sage); border-color: var(--sage); position: relative; }
.curr-tick.is-done::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #1B201B; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.curr-list-lg a { padding: 1.2rem .5rem; }

.overall-progress { display: flex; align-items: center; gap: .9rem; margin-top: 1.6rem; max-width: 460px; }
.overall-bar { flex: 1; height: 5px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.overall-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--khaki)); transition: width .4s ease; }
.overall-progress span { font-size: .78rem; color: var(--text-faint); white-space: nowrap; letter-spacing: .04em; }

/* ─────────────────────────────────────────────────────────────── lesson ── */

.lesson-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; padding-block: clamp(1.8rem, 4vw, 3rem); }
.lesson-wrap > * { min-width: 0; }
@media (max-width: 980px) {
  .lesson-wrap { grid-template-columns: minmax(0, 1fr); }
  .lesson-side { position: static; max-height: none; overflow: visible; padding-right: 0; margin-bottom: 1.5rem; }
}

.lesson-side { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; overflow-x: hidden; font-size: .87rem; padding-right: .4rem; min-width: 0; }
.lesson-side * { min-width: 0; }
.side-eyebrow { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 .4rem; }
.side-eyebrow-2 { margin-top: 1.8rem; }
.side-title { font-family: var(--font-display); font-size: 1.16rem; margin: 0 0 .9rem; line-height: 1.25; }
.side-title a { color: var(--heading); text-decoration: none; }
.side-title a:hover { color: var(--accent); }
.side-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.side-list a { display: grid; grid-template-columns: 1.7rem 1fr 1rem; gap: .45rem; align-items: baseline; padding: .42rem .6rem; text-decoration: none; color: var(--text-muted); font-size: .845rem; line-height: 1.4; border-left: 2px solid transparent; margin-left: -1px; }
.side-list a:hover { color: var(--text); background: var(--paper-2); }
.side-list .is-current > a { color: var(--heading); font-weight: 700; border-left-color: var(--clay); background: var(--paper-2); }
.side-n { font-family: var(--font-display); color: var(--text-faint); font-size: .9rem; font-variant-numeric: lining-nums tabular-nums; }
.side-list .curr-tick { width: 13px; height: 13px; }
.side-list .curr-tick.is-done::after { left: 3.5px; top: 1px; width: 3px; height: 6.5px; border-width: 0 1.5px 1.5px 0; }
.side-toc { list-style: none; margin: 0; padding: 0 0 0 .1rem; border-left: 1px solid var(--rule); }
.side-toc a { display: block; padding: .3rem .7rem; color: var(--text-muted); text-decoration: none; font-size: .82rem; line-height: 1.4; }
.side-toc a:hover { color: var(--accent); }

.lesson { max-width: 74ch; }
.lesson-head { border-bottom: 1px solid var(--rule); padding-bottom: 1.7rem; margin-bottom: 2.2rem; }
.lesson-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
.lesson-lede { font-size: 1.16rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.1rem; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .8rem; color: var(--text-faint); }
.lesson-tags { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.lesson-tags a { font-size: .72rem; padding: .16rem .55rem; border: 1px solid var(--rule-strong); border-radius: 100px; text-decoration: none; color: var(--text-muted); }
.lesson-tags a:hover { border-color: var(--accent); color: var(--accent); }

.objectives { margin-top: 1.7rem; padding: 1.15rem 1.3rem; background: var(--paper-2); border-radius: var(--radius); border: 1px solid var(--rule); }
.objectives-h { font-family: var(--font-text); font-size: .68rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin: 0 0 .6rem; font-weight: 700; }
.objectives ul { margin: 0; padding-left: 1.15rem; }
.objectives li { margin-bottom: .35rem; font-size: .92rem; color: var(--text-muted); }
.objectives li:last-child { margin-bottom: 0; }

/* ──────────────────────────────────────────────────────────────── prose ── */

.prose { max-width: var(--measure); }
.prose-wide { max-width: 78ch; }
.prose > h2 { margin-top: 2.6em; font-size: clamp(1.55rem, 3vw, 2.05rem); }
.prose > h2:first-child { margin-top: 0; }
.prose > h3 { margin-top: 2em; font-size: clamp(1.16rem, 2vw, 1.34rem); }
.prose p { margin: 0 0 1.25em; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.35em; }
.prose li { margin-bottom: .5em; }
.prose li > ul, .prose li > ol { margin-top: .5em; margin-bottom: .5em; }
.prose strong { font-weight: 700; color: var(--heading); }
.prose em { font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.6em 0; }

.prose blockquote {
  margin: 1.8em 0; padding: .2em 0 .2em 1.4em;
  border-left: 2px solid var(--clay); color: var(--text-muted);
  font-family: var(--font-display); font-size: 1.24rem; line-height: 1.5; font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em; background: var(--paper-2); padding: .13em .38em; border-radius: 3px;
  border: 1px solid var(--rule);
}
.prose pre { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; overflow-x: auto; margin: 0 0 1.5em; }
.prose pre code { background: none; border: 0; padding: 0; font-size: .84rem; line-height: 1.6; }

.anchor { position: absolute; margin-left: -1.1em; opacity: 0; text-decoration: none; color: var(--clay); font-weight: 400; }
.prose h2, .prose h3 { position: relative; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; }

.table-wrap { overflow-x: auto; margin: 0 0 1.7em; border: 1px solid var(--rule); border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-size: .875rem; margin: 0; }
.prose th, .prose td { padding: .62rem .85rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose thead th { background: var(--paper-2); font-weight: 700; color: var(--heading); font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: color-mix(in srgb, var(--paper-2) 60%, transparent); }

/* ──────────────────────────────────────────────────────────── callouts ── */

.callout {
  margin: 1.9em 0; border: 1px solid var(--rule); border-left: 3px solid var(--khaki);
  border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.3rem 1rem;
}
.callout-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .6rem; }
.callout-icon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; color: var(--accent); flex: none; }
.callout-icon svg { width: 17px; height: 17px; }
.callout-label { font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.callout-body > :last-child { margin-bottom: 0; }
.callout-body { font-size: .945rem; }
.callout-body ul, .callout-body ol { margin-bottom: .9em; }

.callout-key { border-left-color: var(--clay); background: color-mix(in srgb, var(--clay) 7%, var(--surface)); }
.callout-sa { border-left-color: var(--sage); background: color-mix(in srgb, var(--sage) 10%, var(--surface)); }
.callout-sa .callout-icon, .callout-sa .callout-label { color: #48633F; }
.callout-do { border-left-color: var(--olive); background: color-mix(in srgb, var(--olive) 7%, var(--surface)); }
.callout-do .callout-icon, .callout-do .callout-label { color: var(--olive); }
.callout-warn { border-left-color: #B4552F; background: color-mix(in srgb, #B4552F 7%, var(--surface)); }
.callout-warn .callout-icon, .callout-warn .callout-label { color: #9C4526; }
.callout-law { border-left-color: var(--forest); background: color-mix(in srgb, var(--forest) 7%, var(--surface)); }
.callout-law .callout-icon, .callout-law .callout-label { color: var(--forest); }
.callout-money { border-left-color: var(--khaki); background: color-mix(in srgb, var(--khaki) 12%, var(--surface)); }
.callout-debate { border-left-color: #7A7F8C; background: color-mix(in srgb, #7A7F8C 8%, var(--surface)); }
.callout-debate .callout-icon, .callout-debate .callout-label { color: #5F6472; }
.callout-story { border-left-color: var(--clay); background: transparent; font-family: var(--font-display); }
.callout-story .callout-body { font-size: 1.12rem; line-height: 1.6; }

@media (prefers-color-scheme: dark) {
  .callout-sa .callout-icon, .callout-sa .callout-label { color: #A9C4A4; }
  .callout-do .callout-icon, .callout-do .callout-label { color: #B4BC86; }
  .callout-warn { border-left-color: #D97A50; }
  .callout-warn .callout-icon, .callout-warn .callout-label { color: #E59470; }
  .callout-law .callout-icon, .callout-law .callout-label { color: #A9C4A4; }
  .callout-debate .callout-icon, .callout-debate .callout-label { color: #A9AEBC; }
}

/* ─────────────────────────────────────────────────────────────── quiz ── */

.quiz { margin: 2.4em 0; border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--paper-2); padding: 1.4rem 1.5rem 1.2rem; }
.quiz-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.quiz-head h3 { margin: 0; font-size: 1.3rem; }
.quiz-sub { margin: .1rem 0 0; font-size: .78rem; color: var(--text-faint); }
.quiz-score { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: .04em; white-space: nowrap; }
.quiz-list { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.quiz-q + .quiz-q { margin-top: 1.6rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.quiz-prompt { font-weight: 600; margin: 0 0 .85rem; display: flex; gap: .6rem; align-items: baseline; color: var(--heading); }
.quiz-num { font-family: var(--font-display); color: var(--accent); font-size: 1.15rem; font-weight: 700; flex: none; font-variant-numeric: lining-nums tabular-nums; min-width: 1ch; }
.quiz-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.quiz-opt {
  display: flex; gap: .7rem; align-items: flex-start; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .66rem .85rem; font: inherit; font-size: .92rem; color: inherit; cursor: pointer;
  transition: border-color .14s, background .14s;
}
.quiz-opt:hover:not([disabled]) { border-color: var(--sage); }
.quiz-opt[disabled] { cursor: default; }
.quiz-opt-mark { width: 15px; height: 15px; border: 1.5px solid var(--rule-strong); border-radius: 50%; flex: none; margin-top: .27rem; position: relative; }
.quiz-opt-text { flex: 1; }
.quiz-opt.is-correct { border-color: #5E8A52; background: color-mix(in srgb, #5E8A52 12%, var(--surface)); }
.quiz-opt.is-correct .quiz-opt-mark { background: #5E8A52; border-color: #5E8A52; }
.quiz-opt.is-correct .quiz-opt-mark::after { content: ''; position: absolute; left: 4.5px; top: 1.4px; width: 3.5px; height: 7px; border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(45deg); }
.quiz-opt.is-wrong { border-color: #B4552F; background: color-mix(in srgb, #B4552F 10%, var(--surface)); }
.quiz-opt.is-wrong .quiz-opt-mark { background: #B4552F; border-color: #B4552F; }
.quiz-opt.is-wrong .quiz-opt-mark::after { content: '×'; position: absolute; inset: 0; color: #fff; font-size: 12px; line-height: 13px; text-align: center; }
.quiz-why { margin-top: .8rem; padding: .7rem .9rem; background: var(--surface); border: 1px dashed var(--rule-strong); border-radius: var(--radius); font-size: .875rem; color: var(--text-muted); }
.quiz-why strong { color: var(--heading); }

/* ────────────────────────────────────────────────────── lesson footer ── */

.lesson-sources { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--rule); }
.lesson-sources h2 { font-size: 1.15rem; font-family: var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: .9rem; }
.lesson-sources ol { padding-left: 1.3rem; font-size: .845rem; color: var(--text-muted); }
.lesson-sources li { margin-bottom: .45rem; }
.src-note { color: var(--text-faint); }

.lesson-done { margin: 2.4rem 0 0; }
.btn-done { border: 1px solid var(--rule-strong); background: var(--surface); color: var(--text); width: 100%; padding: .95rem 1.4rem; }
.btn-done:hover { border-color: var(--sage); }
.btn-done .done-box { width: 17px; height: 17px; border: 1.5px solid var(--rule-strong); border-radius: 4px; flex: none; position: relative; }
.btn-done.is-done { background: color-mix(in srgb, var(--sage) 18%, var(--surface)); border-color: var(--sage); }
.btn-done.is-done .done-box { background: var(--sage); border-color: var(--sage); }
.btn-done.is-done .done-box::after { content: ''; position: absolute; left: 5.3px; top: 1.6px; width: 4px; height: 8px; border: solid #1B201B; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.lnav { display: flex; flex-direction: column; gap: .25rem; padding: 1.05rem 1.25rem; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: inherit; transition: border-color .15s, background .15s; }
.lnav:hover { border-color: var(--sage); background: var(--paper-2); }
.lnav span { font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.lnav strong { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; color: var(--heading); line-height: 1.25; }
.lnav-next { text-align: right; }
@media (max-width: 620px) { .lesson-nav { grid-template-columns: 1fr; } .lnav-next { text-align: left; } }

/* ────────────────────────────────────────────────────────────── search ── */

.search-form { margin-top: 1.6rem; max-width: 560px; }
.search-form input {
  width: 100%; font: inherit; font-size: 1.05rem; padding: .85rem 1.1rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.search-form input:focus { border-color: var(--sage); outline: 2px solid color-mix(in srgb, var(--sage) 45%, transparent); outline-offset: 1px; }
.search-count { font-size: .8rem; color: var(--text-faint); margin: 1.8rem 0 .6rem; letter-spacing: .04em; }
.search-results { padding-bottom: 4rem; }
.sr-item { display: block; padding: 1.05rem .4rem; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.sr-item:hover { background: var(--paper-2); }
.sr-mod { font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.sr-item h3 { margin: .3rem 0 .3rem; font-size: 1.25rem; }
.sr-item p { margin: 0; font-size: .87rem; color: var(--text-muted); }
.sr-item mark { background: color-mix(in srgb, var(--khaki) 45%, transparent); color: inherit; padding: 0 .12em; border-radius: 2px; }

/* ───────────────────────────────────────────────────────────── sources ── */

.source-list { padding: 0 0 4rem 1.4rem; font-size: .92rem; }
.source-list li { margin-bottom: 1.05rem; }
.source-list > li > a { font-weight: 600; }
.src-host { display: inline-block; font-size: .7rem; color: var(--text-faint); margin-left: .5rem; padding: .1rem .45rem; border: 1px solid var(--rule); border-radius: 100px; }
.src-used { display: block; font-size: .78rem; color: var(--text-faint); margin-top: .18rem; }

.about-prose { padding-block: clamp(2rem, 5vw, 3.4rem) 4rem; }
.about-prose h2 { margin-top: 2.4em; }
.about-prose h2:first-child { margin-top: 0; }

/* ────────────────────────────────────────────────────────────── footer ── */

.site-foot { border-top: 1px solid var(--rule); background: var(--paper-2); margin-top: 0; }
.foot-inner { padding: clamp(2.6rem, 6vw, 4rem) 0 2.4rem; }
.foot-brand img { width: 150px; margin-bottom: .6rem; }
.foot-tag { font-family: var(--font-display); font-size: 1.14rem; color: var(--text-muted); font-style: italic; margin: 0; }
.foot-cols { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 2rem; margin: 2.4rem 0 2rem; }
@media (max-width: 640px) { .foot-cols { grid-template-columns: 1fr; } }
.foot-cols h4 { font-family: var(--font-text); font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin-bottom: .7rem; }
.foot-cols a { display: block; font-size: .88rem; color: var(--text-muted); text-decoration: none; padding: .2rem 0; }
.foot-cols a:hover { color: var(--accent); }
.foot-note { font-size: .85rem; color: var(--text-muted); max-width: 62ch; margin: 0; line-height: 1.6; }
.foot-legal { font-size: .76rem; color: var(--text-faint); border-top: 1px solid var(--rule); padding-top: 1.4rem; margin: 0; }

/* ─────────────────────────────────────────────────────────────── print ── */

@media print {
  .site-head, .site-foot, .lesson-side, .lesson-nav, .lesson-done, .quiz-opt, .progress-rail, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .lesson-wrap { grid-template-columns: 1fr; }
  .callout { break-inside: avoid; border: 1px solid #999; }
  a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: 8pt; color: #555; word-break: break-all; }
}

/* ───────────────────────────────────────────────────────── animals index ── */

.animals-wrap { padding-bottom: 4rem; }
.animal-group { padding-top: clamp(2rem, 4vw, 3rem); }
.animal-group h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); padding-bottom: .5rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.4rem; }
.animal-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.animal-card { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--sage); border-radius: var(--radius-lg); padding: 1.25rem 1.35rem 1.1rem; }
.animal-card h3 { font-size: 1.24rem; margin: 0 0 .2rem; }
.animal-count { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 .85rem; }
.animal-card ul { list-style: none; margin: 0; padding: 0; }
.animal-card li { padding: .34rem 0; border-top: 1px solid var(--rule); }
.animal-card li:first-child { border-top: 0; }
.animal-card a { font-size: .89rem; text-decoration: none; font-weight: 600; display: block; line-height: 1.4; }
.animal-card a:hover { text-decoration: underline; }
.animal-mod { display: block; font-size: .7rem; color: var(--text-faint); margin-top: .1rem; }
.animal-more a { font-weight: 400; font-style: italic; color: var(--text-muted); }
.animals-empty { padding: 3rem 0 5rem; color: var(--text-muted); font-size: 1.05rem; }
