/* Growing, not building: a seed packet on a kraft-paper bag. */

:root {
  --kraft: #cba977;      /* the bag: page ground */
  --kraft-light: #dcc298;
  --paper: #f3ead7;      /* packet label paper */
  --soil: #3a2617;       /* ink */
  --soil-soft: #55392a;
  --leaf: #2e5e3e;
  --beet: #8c2246;
  --squash: #e0a01b;
  --cornflower: #3d5a8a;

  --slab: "Alfa Slab One", "Rockwell", "Roboto Slab", serif;
  --text: "Atkinson Hyperlegible", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 64px);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}

body {
  background-color: #c6a274;
  /* Tilled soil (media/bg/dirt.svg, from brag/bgtiles.py): the ground the growing chapters stand on. */
  background-image: url("media/bg/dirt.svg");
  background-size: 640px 640px;
  color: var(--soil);
  font-family: var(--text);
  font-size: clamp(17px, 1.15vw + 6px, 24px);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; }
a:focus-visible, .packet:focus-visible {
  outline: 3px solid var(--soil);
  outline-offset: 4px;
}
code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 0.86em; }

/* ── Chapters ─────────────────────────────────────────────────────────────────────────────── */

.chapter {
  --crop: var(--leaf);
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(28px, 6vh, 72px) var(--gutter) clamp(40px, 8vh, 96px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.5vh, 44px);
  position: relative;
}
.chapter[data-crop="beet"] { --crop: var(--beet); }
.chapter[data-crop="squash"] { --crop: #b07a06; }   /* squash, darkened enough to read on kraft */
.chapter[data-crop="cornflower"] { --crop: var(--cornflower); }

/* The crop colour runs down the left edge like the seam of a bag. */
.chapter::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 10px;
  background: var(--crop);
}

.chapter-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(14px, 2.5vw, 40px);
  align-items: start;
  max-width: 1400px;
}

.chapter-no {
  font-family: var(--slab);
  font-size: clamp(64px, 11vw, 180px);
  line-height: 0.8;
  color: var(--crop);
  min-width: 1.2ch;
}

h1, h2, h3, h4 { font-family: var(--slab); font-weight: 400; }

h2 {
  font-size: clamp(40px, 5.6vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.sub {
  margin-top: 0.6em;
  max-width: 60ch;
  font-size: 1.05em;
  color: var(--soil-soft);
}

.small { font-size: 0.85em; color: var(--soil-soft); }

/* ── Title page ───────────────────────────────────────────────────────────────────────────── */

.title-page {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 96px);
}

.kicker { font-size: 1em; color: var(--soil-soft); }

h1 {
  font-size: clamp(64px, 11vw, 200px);
  line-height: 0.86;
  letter-spacing: -0.02em;
  margin: 0.15em 0 0.3em;
  /* Stamped: ink that didn't quite reach every fibre. */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.2 3.05'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23s)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.2 3.05'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23s)'/%3E%3C/svg%3E");
}

.lede { max-width: 44ch; font-size: 1.12em; }

.title-packet { max-width: 420px; justify-self: center; --tilt: 3deg; }
.title-packet .packet-name { font-size: clamp(36px, 3.6vw, 60px); }
.title-packet .packet-variety { display: block; font-family: var(--text); font-size: 0.7em; opacity: 0.85; margin-top: 0.2em; }
.pumpkin { width: 62%; display: block; margin: 0 auto 12px; }

/* ── Seed packets: the one loud thing ─────────────────────────────────────────────────────── */

.packets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: clamp(18px, 2.4vw, 34px) clamp(14px, 2vw, 28px);
  max-width: 1600px;
}
.packets-small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 178px), 1fr)); gap: 16px 14px; }
.packets-small .packet-head { min-height: 2.9em; padding: 10px 12px 8px; }
.packets-small .packet-name { font-size: 1em; }
.packets-small .packet-body { font-size: 0.7em; padding: 8px 12px 10px; gap: 8px; }
.packet-name { overflow-wrap: anywhere; hyphens: auto; }

.packet {
  --pc: var(--crop);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--soil);
  background: var(--paper);
  transform: rotate(var(--tilt, 0deg));
  box-shadow: 1px 2px 0 rgba(58, 38, 23, 0.35), 4px 8px 14px -6px rgba(58, 38, 23, 0.45);
  /* Crimped top edge, like a sealed paper packet. */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 0 / 12px 7px repeat-x,
                linear-gradient(#000 0 0) 0 6px / 100% calc(100% - 6px) no-repeat;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 0 / 12px 7px repeat-x,
        linear-gradient(#000 0 0) 0 6px / 100% calc(100% - 6px) no-repeat;
  padding-top: 6px;
}
.packet[data-crop="squash"] { --pc: var(--squash); }
a.packet:hover { transform: rotate(0deg) translateY(-3px); }
a.packet { transition: transform 0.18s ease-out; }

.packet-head {
  background: var(--pc);
  color: var(--paper);
  padding: 14px 16px 12px;
  min-height: 3.6em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.packet[data-crop="squash"] .packet-head { color: var(--soil); }
.packet-name {
  font-family: var(--slab);
  font-size: 1.22em;
  line-height: 1.05;
}
.packet-body {
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  font-size: 0.82em;
  line-height: 1.4;
}
.packet-body p { flex: 1; }
.packet-body video { width: 100%; display: block; }

/* Where a link works: printed like the "sow by" box on the back of a packet. */
.where {
  align-self: flex-start;
  font-size: 0.82em;
  padding: 1px 8px 2px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}
.where.public { color: var(--leaf); }
.where.tailscale { color: var(--cornflower); border-style: dashed; }
.where.source { color: var(--soil-soft); }
.where.local { color: var(--soil-soft); border-style: dotted; }
.where.personal { color: var(--soil-soft); border-style: dotted; }

/* ── Layout helpers ───────────────────────────────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 56px);
  align-items: start;
  max-width: 1600px;
}

.video-frame {
  background: var(--soil);
  padding: 10px 10px 8px;
  box-shadow: 4px 8px 18px -8px rgba(58, 38, 23, 0.6);
}
.video-frame video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; }
.video-frame figcaption { color: var(--paper); font-size: 0.8em; padding: 8px 4px 2px; }

.row-links { display: flex; flex-wrap: wrap; gap: 14px 32px; }
.big-link {
  font-family: var(--slab);
  font-size: clamp(20px, 1.8vw, 30px);
  text-decoration-color: var(--crop);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}
.big-link.tailscale::after { content: " (on my network)"; font-family: var(--text); font-size: 0.6em; color: var(--soil-soft); }

/* ── 1: Fab Academy strip ─────────────────────────────────────────────────────────────────── */

.fab-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 1500px;
}
.fab-week {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--soil);
  text-decoration: none;
}
.fab-week img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(0.25) contrast(1.05); }
.fab-week span {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 6px 4px;
  font-size: clamp(11px, 0.85vw, 16px);
  line-height: 1.15;
  color: var(--paper);
  background: linear-gradient(transparent, rgba(58, 38, 23, 0.92));
}
.fab-week:hover img { filter: none; }

/* ── 3: harvest ───────────────────────────────────────────────────────────────────────────── */

.harvest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: end;
  max-width: 1500px;
}
.tally { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 32px; }
.tally div { border-top: 3px solid var(--soil); padding-top: 6px; }
.tally dd { font-family: var(--slab); font-size: clamp(44px, 5vw, 92px); line-height: 1; order: -1; }
.tally div { display: flex; flex-direction: column; }
.tally dt { color: var(--soil-soft); }

.chart figcaption { color: var(--soil-soft); margin-bottom: 10px; }
.months ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  align-items: end;
  gap: 8px;
  height: clamp(200px, 36vh, 380px);
}
.months li { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.months li::before {
  content: "";
  order: 1;
  width: 100%;
  height: var(--h);
  background: var(--crop);
}
.months .n { order: 0; font-size: 0.75em; }
.months .m { order: 2; font-size: 0.8em; color: var(--soil-soft); }

/* ── 5: tending ───────────────────────────────────────────────────────────────────────────── */

.tending-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px);
  max-width: 1600px;
}
.kinds ol { list-style: none; display: grid; gap: 8px; }
.kinds li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 0.85em; }
.kinds .bar { grid-column: 1 / -1; height: 12px; width: var(--w); background: var(--crop); }
.kinds .pct { font-weight: 700; }

.quotes { list-style: none; display: grid; gap: 14px; align-content: start; }
.quotes q {
  display: block;
  font-family: var(--slab);
  font-size: clamp(18px, 1.5vw, 28px);
  line-height: 1.15;
  quotes: "“" "”";
}
.quotes span { font-size: 0.8em; color: var(--crop); font-weight: 700; }

/* ── 4: plant ─────────────────────────────────────────────────────────────────────────────── */

.plant { display: flex; flex-direction: column; gap: 14px; max-width: 34ch; }
.plant-link {
  font-family: var(--slab);
  font-size: clamp(28px, 3.2vw, 56px);
  line-height: 1.05;
  color: var(--crop);
  text-decoration-thickness: 4px;
  text-underline-offset: 6px;
  overflow-wrap: anywhere;
}

/* ── 6: kitchen garden, no backend ────────────────────────────────────────────────────────── */

.chapter.tall { min-height: auto; }
.no-backend {
  margin-top: clamp(12px, 3vh, 40px);
  background: var(--paper);
  padding: clamp(18px, 3vw, 44px);
  max-width: 1600px;
  display: grid;
  gap: clamp(20px, 3vh, 36px);
  box-shadow: 4px 8px 18px -10px rgba(58, 38, 23, 0.5);
}
.no-backend h3 { font-size: clamp(26px, 2.6vw, 46px); line-height: 1.05; color: var(--crop); }
.trick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 48px);
  align-items: start;
  border-top: 2px solid var(--kraft);
  padding-top: clamp(14px, 2vh, 26px);
}
.trick h4 { font-size: clamp(22px, 1.8vw, 32px); margin-bottom: 8px; }
.trick p { font-size: 0.9em; max-width: 52ch; }

.flow { list-style: none; display: flex; flex-wrap: wrap; margin-top: 14px; font-size: 0.82em; font-weight: 700; }
.flow li { padding: 4px 12px; background: var(--kraft-light); }
.flow li + li { margin-left: 20px; position: relative; }
.flow li + li::before {
  content: "";
  position: absolute;
  left: -16px; top: 50%;
  border: 6px solid transparent;
  border-left: 9px solid var(--crop);
  transform: translateY(-50%);
}

.code {
  background: var(--soil);
  color: #f0e2c4;
  padding: 16px 18px;
  font-size: clamp(12px, 0.85vw, 16px);
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre;
}
.code .c { color: #c2a57a; }

/* ── 8: greenhouse ────────────────────────────────────────────────────────────────────────── */

.stack { max-width: 1100px; }
.stack svg { width: 100%; height: auto; display: block; }
.stack rect { fill: var(--paper); stroke: var(--soil); stroke-width: 2.5; }
.stack .hl rect { fill: var(--crop); stroke: var(--crop); }
.stack .hl text { fill: var(--paper); }
.stack .dim rect { fill: transparent; stroke-dasharray: 6 5; }
.stack text { font-family: var(--slab); font-size: 24px; text-anchor: middle; fill: var(--soil); }
.stack text.s { font-family: var(--text); font-size: 16px; }
.stack .arrows path { stroke: var(--soil); stroke-width: 3; fill: none; marker-end: none; }

/* ── 10: close ────────────────────────────────────────────────────────────────────────────── */

.lessons { list-style: none; counter-reset: l; display: grid; gap: clamp(14px, 2.5vh, 28px); max-width: 1100px; }
.lessons li { counter-increment: l; font-size: clamp(20px, 1.9vw, 34px); line-height: 1.3; padding-left: 2.2em; position: relative; }
.lessons li::before {
  content: counter(l);
  position: absolute; left: 0; top: -0.1em;
  font-family: var(--slab);
  font-size: 1.5em;
  color: var(--crop);
}
.lessons strong { font-family: var(--slab); font-weight: 400; }
.last-line {
  margin-top: auto;
  font-family: var(--slab);
  font-size: clamp(30px, 4vw, 72px);
  line-height: 1.05;
  color: var(--leaf);
}

/* ── Navigation chrome ───────────────────────────────────────────────────────────────────── */

.progress {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}
.progress ol { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.progress a {
  display: block;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--soil);
  font-size: 0;
}
.progress li.on a { background: var(--soil); }

.keys {
  position: fixed;
  right: 14px; bottom: 10px;
  font-size: 12px;
  color: var(--soil-soft);
  opacity: 0.7;
}

/* ── Smaller screens: phones in the audience ─────────────────────────────────────────────── */

@media (max-width: 900px) {
  html { scroll-snap-type: none; }
  .chapter { min-height: auto; padding-top: 40px; padding-bottom: 48px; }
  .title-page, .split, .harvest-grid, .tending-grid, .trick { grid-template-columns: minmax(0, 1fr); }
  .title-page { min-height: 100svh; }
  .fab-strip { grid-template-columns: repeat(3, 1fr); }
  .fab-week span { font-size: 11px; }
  .progress, .keys { display: none; }
  .chapter-head { grid-template-columns: 1fr; gap: 4px; }
  .chapter::before { width: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a.packet, a.packet:hover { transition: none; }
}

.tending-left { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(18px, 3vh, 32px); align-content: start; }
.split.wide-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
@media (max-width: 900px) { .split.wide-right { grid-template-columns: minmax(0, 1fr); } }

/* Short screens (a 1280×720 projector, a laptop): smaller headings and seeds so a chapter fits. */
@media (min-width: 901px) and (max-height: 860px) {
  body { font-size: clamp(15px, 0.9vw + 5px, 20px); }
  .chapter { padding-top: 24px; padding-bottom: 32px; gap: 18px; }
  .chapter-no { font-size: clamp(56px, 7vw, 110px); }
  h2 { font-size: clamp(36px, 4.2vw, 64px); }
  .sub { margin-top: 0.35em; }
  .fab-strip { max-width: 1050px; }
  .packets-small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 10px; }
  .packets-small .packet-head { min-height: 2.5em; padding: 8px 10px 6px; }
  .packets-small .packet-body { font-size: 0.66em; padding: 6px 10px 8px; gap: 6px; }
  .kinds ol { gap: 4px; }
  .kinds .bar { height: 9px; }
  .stack { max-width: 820px; }
  .months ol { height: 28vh; }
}

/* ── Packets with a picture and a film ───────────────────────────────────────────────────── */
.packet { position: relative; }
.packet.linked { transition: transform 0.18s ease-out; }
.packet.linked:hover { transform: rotate(0deg) translateY(-3px); }
a.packet-name { color: inherit; text-decoration: none; }
a.packet-name::after { content: ""; position: absolute; inset: 0; }   /* the whole card opens the project */
.packet:has(a.packet-name:focus-visible) { outline: 3px solid var(--soil); outline-offset: 4px; }

.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--soil); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--paper); color: var(--soil);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(30, 18, 8, 0.5);
}
.play svg { width: 20px; height: 20px; fill: currentColor; margin-left: 2px; }
.play:hover, .play:focus-visible { background: var(--pc); color: var(--paper); }
.play:focus-visible { outline: 3px solid var(--soil); outline-offset: 2px; }

.shelf { max-width: 1600px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: clamp(6px, 2vh, 24px); }
.shelf h3 { font-size: clamp(24px, 2.2vw, 40px); color: var(--crop); }

.join {
  max-width: 1100px; margin-top: clamp(8px, 2vh, 28px);
  background: var(--paper); padding: clamp(18px, 3vw, 40px);
  display: grid; gap: 14px;
  box-shadow: 4px 8px 18px -10px rgba(58, 38, 23, 0.5);
}
.join h3 { font-size: clamp(28px, 3vw, 52px); line-height: 1.05; color: var(--crop); }
.join p:not(.small) { font-size: 1.05em; max-width: 60ch; }

dialog#player {
  border: 0; padding: 0; width: min(1240px, 94vw);
  background: var(--soil); color: var(--paper); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog#player::backdrop { background: rgba(30, 18, 8, 0.74); }
dialog#player form { position: absolute; right: 10px; top: 10px; z-index: 3; }
dialog#player .close { background: var(--paper); color: var(--soil); border: 0; border-radius: 4px; padding: 6px 14px; font: 700 0.85em var(--text); cursor: pointer; }
dialog#player video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }
.player-cap { padding: 12px 18px 14px; font-size: 0.9em; }
.player-cap a { margin-left: 14px; }

@media (max-width: 900px) { .play { width: 36px; height: 36px; } }

.split.wide-right { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.7fr); }
.leap-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 56px); align-items: start; max-width: 1600px; }
.leap-grid .join { margin-top: 0; }
.leap-grid .packets { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
@media (max-width: 900px) { .leap-grid { grid-template-columns: minmax(0, 1fr); } .split.wide-right { grid-template-columns: minmax(0, 1fr); } }
.split.packets-first { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 900px) { .split.packets-first { grid-template-columns: minmax(0, 1fr); } }
dialog#player { margin: auto; max-height: 96vh; }

/* ── From building to growing ─────────────────────────────────────────────────────────────────
   The page starts as a brick wall. --grow (0 to 1, set from talk.js for the chapter on screen and
   eased with a transition) wipes the wall away from below and lifts a field of sprouts in its place:
   half and half at Game Babies, a full field from the knowledge-farm chapter on. */
@property --grow { syntax: "<number>"; inherits: true; initial-value: 0; }
body { --grow: 0; transition: --grow 1.8s cubic-bezier(.4, 0, .2, 1); }

body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: -2; pointer-events: none;
  background: url("media/bg/bricks.svg") 0 0 / 540px 288px;
  --edge: calc((1 - var(--grow)) * 130%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(var(--edge) - 30%), transparent var(--edge));
  mask-image: linear-gradient(to bottom, #000 calc(var(--edge) - 30%), transparent var(--edge));
}
body::after {
  content: "";
  position: fixed; left: 0; right: 0; bottom: 0;
  height: clamp(80px, 17vh, 180px);
  z-index: -1; pointer-events: none;
  background: url("media/bg/field.svg") repeat-x left bottom / auto 100%;
  transform: translateY(calc((1 - var(--grow)) * 100%));
}
@media (prefers-reduced-motion: reduce) { body { transition: none; } }

.title-packet .wall { width: 62%; display: block; margin: 0 auto 12px; }

/* The turn: a row of bricks that becomes a row of sprouts. */
.turn { max-width: 1400px; }
.turn-strip { display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.turn-strip i {
  flex: 1;
  height: calc(14px + var(--t) * 16px);
  background: color-mix(in srgb, #a9573c calc((1 - var(--t)) * 100%), #2e5e3e);
  border-radius: calc(var(--t) * 90%) 0 calc(var(--t) * 90%) 0;
}
.turn p { display: flex; justify-content: space-between; font-size: 0.7em; font-weight: 700; color: var(--soil-soft); margin-top: 4px; letter-spacing: 0.04em; }


/* No chapter numbers: the heading stands alone. */
.chapter-head { grid-template-columns: 1fr; }
.video-frame.wide { width: min(100%, calc(58vh * 16 / 9)); }

/* The quiet years: a washed-out stretch of wall, a timeline, and the loop the AI slowly takes over. */
.chapter.gap {
  min-height: 240vh;
  background: linear-gradient(to bottom, transparent, rgba(243, 234, 215, .9) 9%, rgba(243, 234, 215, .9) 92%, transparent);
}
.chapter.gap::before { display: none; }
.gap-head { max-width: 1100px; margin-left: clamp(0px, 10vw, 200px); }
.gap-head h2 { color: var(--soil); }
.legend { margin-top: 1em; font-size: .8em; color: var(--soil-soft); display: flex; flex-wrap: wrap; gap: .4em 1.2em; align-items: center; }
.legend span::before { content: ""; display: inline-block; width: 1.4em; height: .6em; border-radius: 3px; margin-right: .4em; vertical-align: middle; }
.legend .me::before { background: var(--me-deep); }
.legend .ai::before { background: var(--ai-deep); }
:root { --me: #a9573c; --ai: #3d5a8a; }

.gap-track { list-style: none; position: relative; margin-left: clamp(0px, 10vw, 200px); max-width: 1100px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 9vh; }
.gap-track::before { content: ""; position: absolute; left: calc(7.5em + 22px); top: 0; bottom: 0; border-left: 4px dotted var(--soil-soft); }
.gap-track .row { display: grid; grid-template-columns: 7.5em 1fr; gap: 0 44px; align-items: center; position: relative; }
.gap-track .row::after { content: ""; position: absolute; left: calc(7.5em + 16px); top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--soil-soft); }
.gap-track .when { font-family: var(--slab); text-align: right; font-size: clamp(22px, 2.2vw, 40px); line-height: 1; color: var(--soil); opacity: .35; }
.gap-track .mark .when, .gap-track .end .when { opacity: 1; color: var(--cornflower); }
.gap-track .made p { color: var(--soil-soft); max-width: 46ch; }
.gap-track .made p::before { content: "made: "; font-weight: 700; font-size: .8em; letter-spacing: .05em; color: var(--me); }
.gap-track .stage .what { display: flex; gap: clamp(14px, 2vw, 32px); align-items: center; }
.gap-track .stage h3 { font-size: clamp(24px, 2.4vw, 42px); line-height: 1.05; color: var(--ai); }
.gap-track .stage p { max-width: 50ch; }
.gap-track .stage q { font-weight: 700; }
.gap-track .end h3 { color: var(--beet); }

.loop { flex: none; width: clamp(130px, 11vw, 200px); aspect-ratio: 1; }
.loop svg { width: 100%; height: 100%; display: block; overflow: visible; }
.loop .seg { fill: none; stroke-width: 26; }
.loop .seg.me { stroke: var(--me-deep); }
.loop .seg.ai { stroke: var(--ai-deep); }
.loop text { font-family: var(--text); font-size: 13px; font-weight: 800; letter-spacing: .02em; fill: #fff; text-anchor: middle; dominant-baseline: central; }
.loop .hub { font-family: var(--slab); font-size: 20px; fill: var(--soil); font-weight: 400; }
:root { --me-deep: #84391f; --ai-deep: #263f6b; }

/* vonk and paws: two spec plates, then why they mattered. */
.gap-track .rigs .what { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: clamp(16px, 2.4vw, 36px); align-items: start; }
.rig { background: var(--paper); color: var(--soil); box-shadow: 1px 2px 0 rgba(58, 38, 23, .35), 4px 8px 14px -6px rgba(58, 38, 23, .45); display: flex; flex-direction: column; }
.rig-vonk { --rc: var(--ai-deep); transform: rotate(-.6deg); }
.rig-paws { --rc: var(--me-deep); transform: rotate(.5deg); }
.rig img { display: block; width: 100%; height: auto; background: #fff; }
.rig-head { background: var(--rc); color: #fff; padding: 10px 16px 9px; }
.rig-head h4 { font-family: var(--slab); font-weight: 400; font-size: clamp(26px, 2.2vw, 36px); line-height: 1; }
.rig-head p { font-size: .8em; font-weight: 700; letter-spacing: .02em; margin-top: 4px; }
.rig-specs { list-style: none; padding: 10px 16px 0; font-size: .8em; line-height: 1.35; }
.rig-specs li { padding: 4px 0; border-bottom: 1.5px dotted rgba(58, 38, 23, .35); }
.rig-role { padding: 10px 16px 14px; font-size: .8em; font-weight: 700; color: var(--rc); }
.rig-credit { grid-column: 1 / -1; font-size: .6em; color: var(--soil-soft); opacity: .8; }

.gap-track .free .what { max-width: 40em; }
.gap-track { margin-bottom: 14vh; }
.gap-track .free h3 { font-size: clamp(30px, 3.4vw, 60px); line-height: 1; color: var(--beet); }
.gap-track .free p { margin-top: .5em; }
.gap-track .free .free-rule { font-family: var(--slab); font-size: clamp(22px, 2vw, 34px); line-height: 1.15; color: var(--soil); margin-top: .6em; }
.gap-track .free .free-next { font-weight: 700; color: var(--cornflower); }

@media (max-width: 700px) {
  .gap-track .rigs .what { grid-template-columns: 1fr; }
  .gap-head, .gap-track { margin-left: 0; }
  .gap-track::before { left: calc(4.5em + 14px); }
  .gap-track .row { grid-template-columns: 4.5em 1fr; gap: 0 30px; }
  .gap-track .row::after { left: calc(4.5em + 8px); }
  .gap-track .stage .what { flex-direction: column; align-items: flex-start; }
}

/* The turn, between Game Babies and the seed: big type, the brick-to-sprout strip. */
.turn-page { justify-content: center; }
.turn-line { font-family: var(--slab); font-size: clamp(44px, 6.4vw, 120px); line-height: .98; max-width: 16ch; }
.turn-line em { font-style: normal; color: var(--leaf); }
.turn-page .turn-strip { height: 64px; }
.turn-page .turn-strip i { height: calc(18px + var(--t) * 46px); }
.turn-page .turn p { font-size: .9em; }

/* ── The whole farm: the setup map ───────────────────────────────────────────────────────── */
.split.farm { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; }
.farm-map { margin: 0; background: var(--paper); padding: 10px; box-shadow: 4px 8px 18px -8px rgba(58, 38, 23, 0.6); }
.farm-map img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: contain; }
.farm-map figcaption { font-size: 0.8em; color: var(--soil-soft); padding: 8px 4px 2px; }
@media (max-width: 900px) { .split.farm { grid-template-columns: 1fr; } }

/* ── Editing in place (edit.js; press e) ─────────────────────────────────────────────────── */
body.editing [data-t] { outline: 1.5px dashed color-mix(in srgb, var(--soil) 45%, transparent); outline-offset: 3px; cursor: text; }
body.editing [data-t]:hover { outline-color: var(--soil); }
body.editing a.packet-name::after { display: none; }   /* the card-wide link would cover the line */
.edit-bar ~ main, body.editing main { padding-bottom: 96px; }
body.editing [data-t]:focus { outline: 2px solid var(--crop, #2e5e3e); background: color-mix(in srgb, var(--paper) 70%, transparent); }
body.editing .edit-changed { outline: 2px solid #c27a1a; }
.edit-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: calc(100vw - 32px);
  padding: 10px 14px; background: var(--paper); color: var(--soil); border: 2px solid var(--soil);
  box-shadow: 4px 8px 18px -8px rgba(58, 38, 23, 0.6); font-family: var(--text); font-size: 15px;
}
.edit-bar[hidden] { display: none; }
.edit-bar button { font: inherit; padding: 5px 12px; border: 1.5px solid var(--soil); background: transparent; color: var(--soil); cursor: pointer; }
.edit-bar button.edit-primary { background: var(--soil); color: var(--paper); }
.edit-bar button:disabled { opacity: 0.45; cursor: default; }
.edit-bar button[hidden], .edit-bar label[hidden] { display: none; }
.edit-bar input { font: inherit; width: 14ch; padding: 4px 6px; border: 1.5px solid var(--soil); background: #fff; }
.edit-count { color: var(--soil-soft); }
.edit-msg { flex-basis: 100%; font-size: 13px; color: var(--soil-soft); }
.edit-msg:empty { display: none; }

/* ── Grow logs: the section at the end of the talk, and one page per project ─────────────────── */
.log-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2.4vh, 26px) clamp(14px, 2vw, 28px); max-width: 1500px; }
.log-list a {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; height: 100%;
  padding: 14px 20px 16px; background: var(--paper); color: var(--soil); text-decoration: none;
  border-left: 10px solid var(--crop);
  box-shadow: 1px 2px 0 rgba(58, 38, 23, .3), 4px 8px 14px -8px rgba(58, 38, 23, .45);
  transition: transform .18s ease-out;
}
.log-list a:hover { transform: translateY(-3px); }
.log-list a:focus-visible { outline: 3px solid var(--soil); outline-offset: 4px; }
.log-name { font-family: var(--slab); font-size: clamp(22px, 2vw, 36px); line-height: 1.05; color: var(--crop); }
.log-line { font-size: .9em; }
.log-list a { grid-template-rows: auto auto 1fr; }
.log-bar { align-self: end; }
.log-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: auto; padding-top: 8px; font-size: .75em; font-weight: 700; color: var(--soil-soft); }
.log-bar i { flex: none; height: 12px; width: calc(var(--w) * .6); min-width: 6px; background: var(--crop); }
.log-bar b { font-weight: 700; }

body.log-page { --grow: 1; transition: none; }
.log-page main { max-width: 1280px; margin: 0 auto; padding: clamp(10px, 3vh, 36px) clamp(0px, 2vw, 24px) 22vh; display: grid; gap: clamp(18px, 4vh, 40px); }
.log-page .chapter { min-height: auto; background: var(--paper); box-shadow: 4px 8px 18px -10px rgba(58, 38, 23, .55); scroll-snap-align: none; }
.log-page h3 { font-size: clamp(30px, 3.4vw, 56px); line-height: 1; color: var(--crop); }
.log-page .kicker { font-weight: 700; color: var(--crop); }
.log-page h2 { font-size: clamp(48px, 7vw, 120px); }
.log-nav a { font-size: .85em; font-weight: 700; color: var(--soil-soft); text-decoration-color: var(--crop); }

.log-numbers { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr); gap: clamp(20px, 4vw, 64px); align-items: end; }
.log-numbers .tally dd { font-size: clamp(38px, 4vw, 72px); }
.log-numbers .tally dd.span { font-size: clamp(20px, 1.8vw, 30px); padding-top: .3em; }
.activity { margin: 0; }
.activity figcaption { font-size: .8em; color: var(--soil-soft); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; }
.activity .key { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.activity .key i { display: inline-block; width: 12px; height: 12px; margin-left: 8px; }
.activity i.r { background: var(--crop); }
.activity i.c { background: var(--soil); }
.days { list-style: none; display: flex; align-items: stretch; height: clamp(120px, 22vh, 220px); gap: 1px; border-bottom: 2px solid var(--soil); }
.days li { flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center; gap: 1px; }
.days li:hover { background: var(--kraft-light); }
.days i { display: block; flex: 1; max-width: 22px; }
.axis, .peak { display: flex; justify-content: space-between; font-size: .7em; color: var(--soil-soft); margin-top: 4px; }
.peak { justify-content: flex-end; margin-top: 0; }

.seed-when { font-weight: 700; color: var(--soil-soft); }
.seed-prompt { background: var(--soil); color: #f3ead7; padding: clamp(16px, 2.4vw, 32px); display: grid; gap: 14px; max-width: 1100px; box-shadow: 4px 8px 18px -8px rgba(58, 38, 23, .6); }
.prompt, .asks q { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; }
.prompt { font-size: clamp(14px, 1vw + 4px, 19px); line-height: 1.55; padding-left: 1.6em; position: relative; }
.prompt::before { content: "›"; position: absolute; left: 0; color: var(--squash); font-weight: 700; }
.seed-note { max-width: 60ch; color: var(--soil-soft); font-style: italic; }

.log-track { list-style: none; display: grid; gap: clamp(22px, 4vh, 40px); position: relative; }
.log-track::before { content: ""; position: absolute; left: calc(8.5em + 18px); top: 6px; bottom: 6px; border-left: 4px dotted var(--kraft); }
.phase { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 0 40px; position: relative; }
.phase::after { content: ""; position: absolute; left: calc(8.5em + 12px); top: .35em; width: 16px; height: 16px; border-radius: 50%; background: var(--crop); }
.phase .when { font-family: var(--slab); text-align: right; font-size: clamp(16px, 1.2vw, 22px); line-height: 1.15; color: var(--crop); padding-top: .15em; }
.phase h4 { font-size: clamp(22px, 2vw, 34px); line-height: 1.05; }
.phase .what > p { margin-top: .35em; max-width: 62ch; }
.asks { list-style: none; display: grid; gap: 8px; margin-top: 12px; max-width: 70ch; }
.asks li { background: color-mix(in srgb, var(--kraft-light) 55%, var(--paper)); border-left: 4px solid var(--crop); padding: 8px 14px; }
.asks q { display: block; font-size: .78em; line-height: 1.5; quotes: none; }
.asks q::before { content: "› "; color: var(--crop); font-weight: 700; }

.care { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(14px, 2vw, 24px); }
.care li { border-top: 5px solid var(--crop); padding-top: 10px; }
.care h4 { font-size: clamp(20px, 1.6vw, 28px); line-height: 1.1; margin-bottom: 6px; }
.care p { font-size: .88em; }
.log-more { margin-top: clamp(10px, 3vh, 30px); border-top: 2px solid var(--kraft); padding-top: 16px; }
.log-more h4 { font-size: 1em; color: var(--soil-soft); margin-bottom: 8px; }
.log-more ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.log-more a { display: inline-block; padding: 4px 14px 5px; border: 2px solid var(--crop, var(--soil)); font-weight: 700; text-decoration: none; color: var(--soil); }
.log-more a:hover { background: var(--crop, var(--soil)); color: var(--paper); }

/* Grow-log screenshots: one wide, a before/after pair, or a row of three. */
.shots { display: grid; gap: 14px; margin-top: 16px; max-width: 980px; }
.shots.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shots.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shot a { display: block; background: var(--paper); padding: 6px; box-shadow: 0 1px 0 var(--kraft), 3px 4px 0 color-mix(in srgb, var(--crop) 35%, transparent); transition: transform .15s; }
.shot a:hover, .shot a:focus-visible { transform: translateY(-2px) rotate(-.3deg); }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.shots:not(.pair):not(.trio) .shot img { aspect-ratio: auto; }
.shot figcaption { font-size: .72em; line-height: 1.35; margin-top: 6px; }
.shots.pair .shot + .shot figcaption::before { content: "→ "; color: var(--crop); font-weight: 700; }

@media (max-width: 900px) {
  .log-list { grid-template-columns: minmax(0, 1fr); }
  .log-numbers { grid-template-columns: minmax(0, 1fr); }
  .log-track::before { left: 7px; }
  .phase { grid-template-columns: minmax(0, 1fr); padding-left: 34px; }
  .phase::after { left: 1px; top: .2em; }
  .phase .when { text-align: left; }
  .shots.trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .shots.pair, .shots.trio { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .log-list a, .shot a { transition: none; } }
