:root {
  --ink: #f7f2e9;
  --ink-soft: #eee5d8;
  --paper: #302b27;
  --paper-soft: #574f48;
  --stone: #766e65;
  --champagne: #996f3e;
  --champagne-soft: #b18e61;
  --line: rgba(48, 43, 39, 0.14);
  --line-strong: rgba(48, 43, 39, 0.28);
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 72px;
  --space-8: 96px;
  --page-pad: 20px;
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 1px solid var(--champagne); outline-offset: 4px; }
button:disabled { cursor: default; }

.site-shell {
  position: relative;
  min-height: 100svh;
  padding: 0 var(--page-pad) var(--space-7);
  overflow: clip;
  background:
    radial-gradient(circle at 82% 5%, rgba(178, 142, 97, 0.18), transparent 30rem),
    radial-gradient(circle at 8% 72%, rgba(188, 160, 126, 0.1), transparent 34rem),
    linear-gradient(145deg, #fbf8f2 0%, var(--ink) 56%, #f0e7da 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0.045;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(70,56,43,.28) 0 .4px, transparent .6px),
    radial-gradient(circle at 78% 65%, rgba(70,56,43,.2) 0 .35px, transparent .55px),
    radial-gradient(circle at 40% 82%, rgba(255,255,255,.7) 0 .45px, transparent .65px);
  background-size: 5px 7px, 7px 5px, 6px 6px;
}

.eyebrow, .panel-label {
  margin: 0;
  color: var(--stone);
  font-size: 12px;
  letter-spacing: 0.21em;
  line-height: 1.4;
  text-transform: uppercase;
}

.opening {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  place-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-7) 0;
  text-align: center;
}
.opening-inner { width: min(100%, 860px); }
.opening-kicker {
  margin: 0 0 var(--space-5);
  color: var(--champagne);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .24em;
  line-height: 1.4;
  text-transform: uppercase;
}
.chapter-heading .eyebrow, .fragment-reveal .eyebrow { color: var(--champagne); }
h1, h2, h3, blockquote { font-family: var(--serif); font-weight: normal; letter-spacing: -0.035em; }
.couple-name { margin: 0; font-size: clamp(58px, 17vw, 128px); line-height: .84; letter-spacing: -.055em; }
.couple-name i { display: block; margin: 14px 0 10px; color: var(--champagne); font-size: .3em; font-weight: normal; line-height: 1; }
.day-count { letter-spacing: -.04em; }
.day-count i { margin-top: 16px; font-size: clamp(24px, 6vw, 38px); letter-spacing: .01em; }
.opening-rule { width: 1px; height: 52px; margin: var(--space-5) auto; background: var(--champagne-soft); opacity: .72; }
.opening-invitation { margin: 0 0 var(--space-5); color: var(--paper-soft); font-family: var(--serif); font-size: clamp(18px, 4.5vw, 23px); line-height: 1.45; }
.opening-action {
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--ink);
  background: var(--paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}
.opening-action span:last-child { font-size: 17px; font-weight: normal; }
.opening-action:hover { color: var(--paper); background: var(--champagne); transform: translateY(-2px); }
.opening-action:active { transform: scale(.98); }
.chapter-intro-copy p:last-child, .fragment-copy p:last-child { margin-bottom: 0; }
.primary-action {
  width: min(100%, 520px);
  min-height: 64px;
  margin-left: auto;
  border: 1px solid var(--paper);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .2em;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}
.primary-action:not(:disabled):hover { color: var(--paper); background: var(--champagne); transform: translateY(-2px); }

.chapter-page { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 64px 0 var(--space-5); }
.chapter-heading { max-width: 720px; margin-bottom: var(--space-6); }
.chapter-heading .eyebrow { margin-bottom: var(--space-3); }
.chapter-heading h2 { margin: 0; max-width: 680px; font-size: clamp(46px, 12vw, 88px); line-height: .94; text-wrap: balance; }
.chapter-intro-copy {
  max-width: 620px;
  margin: var(--space-4) 0 0;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: clamp(18px, 4.5vw, 23px);
  line-height: 1.5;
}
.chapter-intro-copy p { margin: 0 0 var(--space-1); }
.section-rule {
  padding: var(--space-3) 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  border-bottom: 1px solid var(--line);
  color: var(--stone);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.section-rule span:last-child { text-align: right; }

.timeline { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.timeline > * { min-width: 0; }
.timeline .section-rule {
  grid-column: 1;
  grid-row: 1;
  min-height: 50px;
  padding: 0;
  display: flex;
  align-items: center;
}
.timeline .section-rule span { color: var(--champagne); }
.timeline .memory-gallery, .timeline .interaction-note { grid-column: 1 / -1; }
.memory-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-3);
  align-items: start;
  padding: var(--space-4) 2px;
}
.memory-card {
  --tilt: -0.8deg;
  position: relative;
  min-width: 0;
  padding: 8px 8px 48px;
  background: #fffaf2;
  box-shadow: 0 14px 30px rgba(61, 49, 37, .12), 0 2px 5px rgba(61, 49, 37, .08);
  transform: rotate(var(--tilt));
  cursor: default;
  transition: opacity 250ms ease, box-shadow 250ms ease, transform 250ms ease;
}
.memory-card:nth-child(3n + 2) { --tilt: 0.7deg; }
.memory-card:nth-child(3n) { --tilt: -0.25deg; }
.memory-card.selected { box-shadow: 0 0 0 2px var(--champagne), 0 18px 34px rgba(61, 49, 37, .16); transform: translateY(-3px) rotate(var(--tilt)); }
.memory-photo-button { width: 100%; border: 0; padding: 0; display: block; background: transparent; cursor: pointer; }
.memory-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e7ddcf;
}
.memory-image::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(48,43,39,.08); pointer-events: none; }
.memory-image img { width: 100%; height: 100%; display: block; object-fit: contain; }
.order-controls { position: absolute; right: 9px; bottom: 8px; display: flex; gap: 6px; }
.order-controls button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--paper-soft);
  background: transparent;
  cursor: pointer;
}
.order-controls button:disabled { opacity: .2; }
.timeline.is-complete .memory-card { cursor: default; }
.timeline-assist {
  grid-column: 2;
  grid-row: 1;
  min-height: 50px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding-left: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}
.timeline-assist button {
  min-height: 48px;
  border: 0;
  padding: 0 5px;
  color: var(--paper-soft);
  background: transparent;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}
.timeline-assist .help-toggle { border-bottom: 1px solid var(--line-strong); }
.timeline-assist .sort-timeline { padding-inline: 16px; color: var(--ink); background: var(--paper); }
.sort-timeline span { margin-left: var(--space-2); }
.interaction-note { margin: var(--space-4) 0 0; color: var(--paper-soft); text-align: center; font-size: 15px; line-height: 1.55; }

.crossword-layout { display: grid; gap: var(--space-6); align-items: start; }
.crossword-grid-wrap {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  overflow: visible;
}
.crossword-grid {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: clamp(1px, .65vw, 3px);
  transition: transform 180ms ease;
}
.crossword-grid.has-error { animation: nudge 320ms ease; }
.crossword-empty, .crossword-cell { aspect-ratio: 1; min-width: 0; }
.crossword-cell { position: relative; display: block; background: #e9e3d9; }
.crossword-cell small { position: absolute; z-index: 2; top: 1px; left: 2px; color: #625d56; font-size: clamp(7px, 1.8vw, 12px); }
.crossword-cell input {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 5px 0 0;
  color: #20211d;
  background: transparent;
  text-align: center;
  text-transform: uppercase;
  font-family: var(--serif);
  font-size: clamp(14px, 4.5vw, 27px);
  caret-color: var(--champagne-soft);
}
.crossword-cell:focus-within { background: #cbbd9f; }
.crossword-cell.word-complete { background: #dce9d8; box-shadow: inset 0 0 0 1px rgba(76, 113, 74, .26); }
.crossword-cell.word-complete:focus-within { background: #cadfc5; }
.clue-panel { max-width: 560px; margin: 0 auto; }
.clue-panel .panel-label { margin-bottom: 16px; color: var(--champagne); }
.clue-panel ol { list-style: none; margin: 0; padding: 0; }
.clue-panel li { border-top: 1px solid var(--line); }
.clue-panel li:last-child { border-bottom: 1px solid var(--line); }
.clue-panel li button {
  width: 100%;
  min-height: 58px;
  border: 0;
  padding: 14px 6px;
  display: grid;
  grid-template-columns: 28px 1fr;
  color: var(--stone);
  background: transparent;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
  transition: color 180ms ease, padding 180ms ease;
}
.clue-panel li button span { color: #625d56; font-size: 12px; }
.clue-panel li.selected button { padding-left: 10px; color: var(--paper); }
.clue-panel li.selected button span { color: var(--champagne); }
.clue-panel li.complete button { color: #4f704f; }
.clue-panel li.complete button span { color: #4f704f; }
.validation-message { min-height: 24px; margin: var(--space-3) 0 0; color: var(--stone); font-size: 14px; line-height: 1.6; }
.validation-message.error { color: #c19787; }
.puzzle-actions { margin-top: var(--space-4); display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.secondary-action, .solid-action {
  min-height: 56px;
  border: 1px solid var(--line-strong);
  padding: 0 14px;
  color: var(--paper-soft);
  background: transparent;
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
}
.solid-action { border-color: var(--champagne-soft); color: #1b1c18; background: var(--champagne); }

.horse-game { margin-top: var(--space-1); }
.horse-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5) 14px; align-items: start; }
.horse-card { position: relative; min-width: 0; }
.horse-card > button { width: 100%; border: 0; padding: 0; color: var(--paper); background: transparent; text-align: left; cursor: pointer; }
.horse-card img { width: 100%; height: auto; aspect-ratio: 4 / 5; display: block; object-fit: contain; object-position: center; border-radius: 2px; background: #e7ddcf; filter: saturate(.72) sepia(.04) contrast(.96); transition: filter 300ms ease, opacity 300ms ease; }
.horse-card > button::after { content: ""; position: absolute; inset: 8px 8px auto; aspect-ratio: 4/5; border: 1px solid transparent; pointer-events: none; }
.horse-card .horse-index { display: block; margin: var(--space-2) 0 4px; color: var(--stone); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; }
.horse-card strong { display: block; font-family: var(--serif); font-size: 20px; line-height: 1.15; font-weight: normal; }
.horse-card.selected img { filter: saturate(.85) contrast(1); }
.horse-card.selected > button::after { border-color: var(--champagne); }
.horse-card.locked img { opacity: .58; }
.horse-card.locked strong { color: var(--champagne); }
.breed-picker {
  margin-top: var(--space-6);
  padding: var(--space-5) 0 0;
  display: grid;
  gap: var(--space-4);
  border-top: 1px solid var(--line);
}
.breed-picker .panel-label { color: var(--champagne); }
.breed-picker .validation-message { margin-top: 6px; }
.breed-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-1); }
.breed-options button {
  min-height: 56px;
  border: 1px solid var(--line);
  color: var(--paper-soft);
  background: transparent;
  font-family: var(--serif);
  font-size: 17px;
  cursor: pointer;
}
.breed-options button:not(:disabled):hover { border-color: var(--champagne); }
.breed-options button:disabled { opacity: .38; }
.horse-options { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.horse-options .breed-options { grid-template-columns: 1fr; gap: 6px; }
.horse-options .breed-options button { min-height: 48px; padding: 8px; font-size: 16px; line-height: 1.2; }
.horse-options .validation-message { margin-top: var(--space-2); }
.hint-link { min-height: 48px; justify-self: start; border: 0; border-bottom: 1px solid var(--line-strong); padding: 8px 0; color: var(--stone); background: transparent; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }

.cooking-puzzle { max-width: 960px; margin-left: auto; }
.question-heading { max-width: 620px; margin-bottom: var(--space-5); }
.question-heading .panel-label { color: var(--champagne); margin-bottom: 15px; }
.question-heading h3 { margin: 0; font-size: clamp(32px, 8vw, 54px); line-height: 1.05; }
.ingredient-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); }
.ingredient-grid button {
  min-height: 68px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--stone);
  background: transparent;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.ingredient-grid button:nth-child(2n) { border-right: 0; }
.ingredient-grid button i { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-style: normal; }
.ingredient-grid button.selected { color: var(--paper); background: rgba(187,168,130,.07); }
.ingredient-grid button.selected i { border-color: var(--champagne); color: var(--champagne); }
.ingredient-grid.locked button { cursor: default; }
.ingredient-grid.locked button:not(.selected) { opacity: .25; }
.ingredient-footer { margin-top: var(--space-4); }
.dish-question { max-width: 620px; margin: 64px 0 0 auto; }
.dish-question > label { display: block; margin-bottom: var(--space-4); font-family: var(--serif); font-size: clamp(30px, 8vw, 48px); }
.dish-question > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(255, 250, 242, .38);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.dish-question > div:focus-within {
  border-color: var(--champagne);
  background: rgba(255, 250, 242, .7);
  box-shadow: 0 0 0 3px rgba(153, 111, 62, .12);
}
.dish-question input {
  width: 100%;
  min-width: 0;
  min-height: 60px;
  border: 0;
  padding: 14px 18px;
  color: var(--paper);
  background: transparent;
  font-family: var(--serif);
  font-size: 21px;
}
.dish-question input::placeholder { color: var(--stone); opacity: 1; }
.dish-question input:focus-visible { outline: 0; }
.dish-question button {
  min-width: 104px;
  min-height: 60px;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 18px;
  color: var(--champagne);
  background: transparent;
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.dish-question button:hover { color: var(--ink); background: var(--champagne); }

.fragment-reveal {
  position: relative;
  margin: var(--space-8) calc(var(--page-pad) * -1) 0;
  padding: var(--space-7) var(--page-pad) 64px;
  border-top: 1px solid rgba(187,168,130,.35);
  background: #eee4d6;
}
.fragment-reveal::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 38px; background: var(--champagne); }
.fragment-reveal > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.fragment-reveal blockquote {
  margin-top: var(--space-4);
  margin-bottom: 28px;
  overflow-wrap: anywhere;
  color: var(--paper);
  font-size: clamp(27px, 7vw, 52px);
  line-height: 1.15;
}
.fragment-reveal mark { border-bottom: 1px solid var(--champagne); color: var(--champagne); background: transparent; }
.fragment-copy { color: var(--stone); font-size: 15px; line-height: 1.65; }
.fragment-copy p { margin: 0 0 4px; }
.fragment-reveal .primary-action { margin-top: var(--space-5); }

.all-fragments { max-width: 920px; margin: 0 0 80px auto; border-top: 1px solid var(--line); }
.all-fragments p { margin: 0; padding: 19px 0; display: grid; grid-template-columns: 44px 1fr; border-bottom: 1px solid var(--line); color: var(--paper-soft); font-family: var(--serif); font-size: clamp(18px, 4vw, 24px); line-height: 1.45; transition: opacity 450ms ease, transform 450ms ease; }
.all-fragments p span { color: var(--champagne-soft); font-family: var(--sans); font-size: 12px; letter-spacing: .14em; }
.all-fragments.transforming p { opacity: .06; transform: translateY(-6px); }
.cipher-discovery { max-width: 760px; margin: 0 auto; }
.cipher-clue { max-width: 660px; margin: 0 auto 40px; color: var(--paper-soft); text-align: center; font-family: var(--serif); font-size: clamp(24px, 6vw, 38px); line-height: 1.35; }
.mapping-reveal { margin-top: 0; }
.mapping-reveal > .panel-label { margin-bottom: 18px; color: var(--champagne); }
.mapping-help { max-width: 640px; margin: 0 0 24px; color: var(--paper-soft); font-size: 16px; line-height: 1.7; }
.mapping-help strong { color: var(--paper); font-family: var(--serif); font-size: 18px; font-weight: normal; }
.alphabet-map { overflow-x: auto; padding: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.34); }
.alphabet-map code { display: block; width: max-content; min-width: 100%; white-space: nowrap; color: var(--paper-soft); font-size: clamp(12px, 2.4vw, 14px); line-height: 1.9; letter-spacing: .12em; }
.alphabet-map code:last-child { color: var(--champagne); }
.alphabet-map span { display: block; width: 100%; height: 1px; background: var(--line); }
.decode-sentence { margin-top: 56px; padding: var(--space-5) 0; display: grid; gap: var(--space-5); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sentence-prompt .panel-label { margin-bottom: var(--space-2); }
.sentence-prompt strong { display: block; overflow-wrap: anywhere; font-family: var(--serif); font-size: clamp(28px, 7vw, 42px); line-height: 1.18; font-weight: normal; }
.sentence-prompt > p:last-child { margin: var(--space-2) 0 0; color: var(--stone); font-size: 15px; }
.sentence-answer > label { display: block; margin-bottom: var(--space-2); color: var(--stone); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.sentence-answer > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--line-strong); }
.sentence-answer input { min-width: 0; border: 0; padding: 16px 0; color: var(--paper); background: transparent; font-family: var(--serif); font-size: clamp(18px, 4vw, 22px); }
.sentence-answer button { min-width: 84px; border: 0; padding: 0 12px; color: var(--champagne); background: transparent; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.decode-note { grid-column: 1 / -1; margin: 0; color: var(--stone); font-size: 14px; }
.mapping-reveal .primary-action { margin-top: 46px; }

.final-screen {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--space-7) var(--space-4) 88px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(178,142,97,.2), transparent 30rem),
    linear-gradient(160deg, #fbf8f2, #eee4d6);
}
.final-message { position: relative; z-index: 1; width: min(100%, 820px); }
.final-message .eyebrow { margin-bottom: 40px; color: var(--champagne); opacity: 0; animation: finalLine 900ms ease forwards; }
.final-message > p:not(.eyebrow) { margin: 0 0 18px; opacity: 0; transform: translateY(10px); color: var(--paper); font-family: var(--serif); font-size: clamp(28px, 7.4vw, 54px); line-height: 1.2; letter-spacing: -.025em; animation: finalLine 1s ease forwards; }
.final-message > p:nth-of-type(3) { margin-top: 44px; }
.final-message footer { margin: 54px 0 0 auto; opacity: 0; color: var(--champagne); text-align: right; font-family: var(--serif); font-size: 20px; line-height: 1.6; animation: finalLine 1s ease forwards; }
.final-message footer span { font-size: 22px; }
.real-life { position: absolute; z-index: 1; bottom: 22px; left: 24px; right: 24px; margin: 0; color: #656159; text-align: center; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.final-reset { position: absolute; z-index: 5; top: 18px; right: 20px; width: 48px; height: 48px; border: 0; padding: 10px; color: #5e5b54; background: transparent; letter-spacing: .12em; cursor: pointer; }

.screen-enter { animation: enter 360ms ease-out both; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }
@keyframes nudge { 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
@keyframes finalLine { to { opacity: 1; transform: translateY(0); } }

@media (min-width: 560px) {
  :root { --page-pad: 4vw; }
  .memory-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 42px var(--space-4); }
  .horse-grid { grid-template-columns: repeat(3, 1fr); gap: 40px 16px; }
  .horse-options .breed-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .breed-options { grid-template-columns: repeat(3, 1fr); }
  .ingredient-grid { grid-template-columns: repeat(3, 1fr); }
  .ingredient-grid button:nth-child(2n) { border-right: 1px solid var(--line); }
  .ingredient-grid button:nth-child(3n) { border-right: 0; }
}

@media (min-width: 820px) {
  :root { --page-pad: 6vw; }
  .opening { min-height: 100svh; padding-top: var(--space-7); }
  .chapter-page { padding-top: clamp(72px, 9svh, 112px); }
  .chapter-heading { max-width: 720px; margin: 0 0 56px; display: block; }
  .chapter-heading .eyebrow { margin-bottom: var(--space-3); }
  .chapter-heading h2 { max-width: 680px; font-size: clamp(64px, 6.5vw, 82px); }
  .chapter-intro-copy { max-width: 660px; margin: 20px 0 0; padding: 0; font-size: 20px; line-height: 1.55; }
  .memory-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px var(--space-5); }
  .crossword-layout { grid-template-columns: minmax(420px, 1fr) minmax(330px, .8fr); gap: 7vw; }
  .crossword-grid-wrap { position: sticky; top: 96px; }
  .horse-grid { gap: var(--space-6) var(--space-4); }
  .breed-picker { grid-template-columns: .8fr 1.6fr; align-items: start; }
  .hint-link { grid-column: 2; }
  .ingredient-grid button { min-height: 70px; padding-inline: 20px; font-size: 15px; }
  .ingredient-footer { display: flex; justify-content: space-between; align-items: start; }
  .ingredient-footer .puzzle-actions { width: 400px; }
  .fragment-reveal { padding-block: var(--space-8) 88px; }
  .decode-sentence { grid-template-columns: .9fr 1.2fr; align-items: end; }
}

@media (min-width: 1024px) {
  .horse-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
  .horse-card img { height: clamp(210px, 27svh, 300px); }
  .horse-card > button::after { height: clamp(194px, calc(27svh - 16px), 284px); aspect-ratio: auto; }
  .horse-card .horse-index { margin-top: var(--space-1); }
  .horse-card strong { font-size: 20px; }
  .horse-options .breed-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .breed-picker { margin-top: var(--space-5); padding-top: var(--space-4); gap: var(--space-3); }
}

@media (hover: hover) {
  .memory-card { cursor: grab; }
  .memory-card:active { cursor: grabbing; }
  .memory-card:hover { box-shadow: 0 20px 38px rgba(61, 49, 37, .16), 0 3px 7px rgba(61, 49, 37, .1); transform: translateY(-4px) rotate(var(--tilt)); }
  .ingredient-grid button:hover { color: var(--paper); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
