/* flamingo-show — The Garden Inspection
   Drenched sun-baked fields; bone paper is a material inside scenes, never the page. */

@font-face {
  font-family: "Young Serif";
  src: url("fonts/YoungSerif-Regular.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("fonts/Bricolage-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("fonts/Bricolage-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Soge";
  src: url("fonts/Soge-Regular.woff") format("woff");
  font-display: swap;
}

:root {
  /* fields */
  --clay: oklch(0.60 0.115 42);
  --clay-deep: oklch(0.42 0.085 38);
  --dusk: oklch(0.36 0.06 35);
  --rain: oklch(0.52 0.045 250);
  --olive: oklch(0.55 0.085 122);
  --olive-deep: oklch(0.38 0.055 120);
  --ochre: oklch(0.72 0.115 70);
  --pink: oklch(0.76 0.10 28);
  /* materials */
  --bone: oklch(0.945 0.018 80);
  --bone-shade: oklch(0.89 0.025 78);
  --ink: oklch(0.27 0.035 45);
  --ink-soft: oklch(0.40 0.04 45);
  --accent-green: oklch(0.47 0.09 135);
  --accent-red: oklch(0.50 0.16 30);
  /* type */
  --display: "Young Serif", Georgia, serif;
  --body: "Bricolage", system-ui, sans-serif;
  --hand: "Soge", cursive;
  /* z */
  --z-bg: 0; --z-thread: 2; --z-content: 3; --z-rail: 10; --z-toggle: 11; --z-hint: 9;
}

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

html { scroll-behavior: auto; }
body {
  font-family: var(--body);
  color: var(--bone);
  background: var(--clay);
  overflow-x: hidden;
}
.motion-reduced body, body.motion-reduced { scroll-behavior: auto; }

::selection { background: var(--pink); color: var(--ink); }

/* ---------- ambient background ---------- */
#field {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: var(--z-bg); pointer-events: none;
}
/* reduced mode: canvas hidden, scenes carry their own field color */
.motion-reduced #field { display: none; }
.motion-reduced .scene { background: var(--scene-field, var(--clay)); }
.motion-full .scene { background: transparent; }

/* ---------- scenes ---------- */
main { position: relative; z-index: var(--z-content); }
.scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(2.5rem, 5vh, 5rem) clamp(2.5rem, 7vw, 8rem);
  overflow: hidden;
}
.scene-inner { position: relative; width: min(1240px, 100%); z-index: 2; }

/* the connecting thread */
.thread-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none; overflow: visible;
}
.thread {
  fill: none;
  stroke: color-mix(in oklab, var(--bone) 72%, transparent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thread-detail {
  fill: none;
  stroke: color-mix(in oklab, var(--bone) 55%, transparent);
  stroke-width: 2.25;
  stroke-linecap: round;
}

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; }
.display-xl { font-size: clamp(3rem, 7.2vw, 5.8rem); line-height: 1.04; letter-spacing: -0.015em; }
.display-l  { font-size: clamp(2.1rem, 4.2vw, 3.4rem); line-height: 1.1; }
.display-m  { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.18; }
p { text-wrap: pretty; }
.lede { font-size: clamp(1.06rem, 1.45vw, 1.3rem); line-height: 1.62; max-width: 62ch; }
.body-s { font-size: 0.95rem; line-height: 1.6; }
.hand { font-family: var(--hand); font-weight: 400; }
.window-caption {
  font-size: 0.82rem; line-height: 1.5; letter-spacing: 0.01em;
  opacity: 0.85;
}

/* ---------- paper material ---------- */
.paper {
  background:
    radial-gradient(120% 90% at 18% 8%, color-mix(in oklab, var(--bone) 96%, var(--ochre)) 0%, var(--bone) 55%, var(--bone-shade) 100%);
  color: var(--ink);
  border-radius: 10px;
  box-shadow:
    0 1px 0 color-mix(in oklab, var(--ink) 18%, transparent),
    0 18px 50px -18px color-mix(in oklab, var(--ink) 55%, transparent);
  padding: clamp(1.6rem, 2.6vw, 2.8rem);
  position: relative;
}
.paper::after { /* deckled top edge */
  content: ""; position: absolute; left: 0; right: 0; top: -5px; height: 6px;
  background: inherit; border-radius: 10px 10px 0 0;
  clip-path: polygon(0 100%, 2% 30%, 5% 80%, 9% 20%, 13% 75%, 18% 35%, 23% 85%, 28% 25%, 34% 70%, 40% 30%, 46% 80%, 52% 20%, 58% 72%, 64% 28%, 70% 78%, 76% 30%, 82% 70%, 88% 22%, 94% 75%, 100% 40%, 100% 100%);
  opacity: 0.9;
}
.paper .window-caption { color: var(--ink-soft); opacity: 1; }

/* ---------- chapter mark (hand-drawn, earned: findings are a ranked sequence) ---------- */
.chapter-mark {
  display: inline-flex; align-items: center; gap: 0.7rem;
  margin-bottom: 1.1rem;
}
.chapter-mark svg { width: 52px; height: 52px; flex: none; }
.chapter-mark .hand { font-size: 1.35rem; opacity: 0.95; }

/* ---------- pending / measuring ---------- */
.pending-slot {
  display: inline-grid; place-items: center;
  min-width: 2.4em; height: 2.1em; padding: 0 0.3em;
  border: 2.5px dashed color-mix(in oklab, currentColor 65%, transparent);
  border-radius: 12px;
  font-family: var(--display);
}
.pending-slot .hand { font-size: 0.5em; line-height: 1.1; opacity: 0.9; }
.measure-tag {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--hand); font-size: 1.15rem;
}
.measure-tag .dot {
  width: 0.55em; height: 0.55em; border-radius: 50%;
  background: currentColor; opacity: 0.85;
}
.motion-full .measure-tag .dot { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.45); opacity: 0.45; } }

.runs { display: flex; gap: 1.4rem; margin-top: 1.2rem; flex-wrap: wrap; }
.run {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.95rem;
}
.run .tick {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  display: grid; place-items: center;
}
.run .tick svg { width: 16px; height: 16px; display: none; }
.run.done .tick svg { display: block; }
.run:not(.done) { opacity: 0.62; }

/* ---------- scorecard ---------- */
.score-rows { display: grid; gap: 0; margin-top: 1.6rem; }
.score-row {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 1.5rem;
  padding: 0.95rem 0.2rem;
  border-top: 1.5px solid color-mix(in oklab, var(--ink) 22%, transparent);
  align-items: baseline;
}
.score-row:last-child { border-bottom: 1.5px solid color-mix(in oklab, var(--ink) 22%, transparent); }
.score-row .k { font-size: 1.02rem; line-height: 1.45; }
.score-row .v { font-family: var(--display); font-size: 1.12rem; line-height: 1.4; }
.score-row .v .window-caption { font-family: var(--body); display: block; margin-top: 0.2rem; }
.score-row .v.pending { font-family: var(--hand); font-size: 1.15rem; opacity: 0.78; }

.ninety { margin-top: 2rem; }
.ninety ol { margin: 0.9rem 0 0 1.3rem; display: grid; gap: 0.8rem; }
.ninety li { font-size: 1.02rem; line-height: 1.55; padding-left: 0.3rem; }
.ninety li::marker { font-family: var(--display); color: var(--accent-green); }

/* ---------- counterposed slots (FE-SOR) ---------- */
.versus {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center; justify-items: center;
  margin: 2.4rem 0 1rem;
}
.versus .side { text-align: center; }
.versus .who { font-size: 1.05rem; margin-bottom: 0.8rem; }
.versus .slot {
  width: clamp(150px, 16vw, 220px); height: clamp(150px, 16vw, 220px);
  border-radius: 50%;
  border: 3px dashed color-mix(in oklab, var(--bone) 70%, transparent);
  display: grid; place-items: center; align-content: center; gap: 0.3rem;
  font-family: var(--display);
}
.versus .slot .hand { font-size: 1.25rem; opacity: 0.9; }
.versus .slot .of { font-family: var(--body); font-size: 0.9rem; opacity: 0.8; }
.versus .slot.filled { border-style: solid; font-size: clamp(3.4rem, 6vw, 5.2rem); }
.versus .vs { font-family: var(--hand); font-size: 1.7rem; opacity: 0.9; }

/* ---------- evidence + lens ---------- */
.evidence {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
}
.evidence .evidence-zoom { transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; }
.evidence:hover .evidence-zoom,
.evidence:focus-visible .evidence-zoom { transform: scale(1.7); }
.motion-reduced .evidence .evidence-zoom { transition: none; }
.evidence img { display: block; width: 100%; height: auto; }
.evidence-pending {
  display: grid; place-items: center; text-align: center;
  min-height: 230px; padding: 2rem;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, color-mix(in oklab, var(--ink) 7%, transparent) 14px 16px),
    var(--bone-shade);
  color: var(--ink-soft);
}
.evidence-pending .hand { font-size: 1.3rem; margin-bottom: 0.4rem; }

.verify {
  display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start;
  margin-top: 1.5rem;
}
.verify .stamp { width: 74px; height: 74px; flex: none; }
.verify .stamp svg { width: 100%; height: 100%; }
.verify .hand-label { font-family: var(--hand); font-size: 1.45rem; line-height: 1; margin-bottom: 0.35rem; }
.verify p { font-size: 0.98rem; line-height: 1.55; max-width: 56ch; }
.verify a {
  display: inline-block; margin-top: 0.5rem;
  color: inherit; font-size: 0.92rem;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.verify a:hover { text-decoration-thickness: 2.5px; }

/* wow reveal */
.wow-frame { margin-top: 1.4rem; }
.wow-frame .reveal-btn {
  font-family: var(--body); font-size: 0.95rem;
  background: var(--ink); color: var(--bone);
  border: none; border-radius: 999px;
  padding: 0.7rem 1.3rem; cursor: pointer;
}
.wow-frame .reveal-btn:hover { background: var(--ink-soft); }
.wow-frame img.wow-gif { margin-top: 1rem; border-radius: 8px; }

/* ---------- de-escalation note ---------- */
.not-note {
  margin-top: 1.4rem; padding: 1rem 1.2rem;
  border: 1.5px solid color-mix(in oklab, var(--ink) 30%, transparent);
  border-radius: 8px;
  font-size: 0.95rem; line-height: 1.55;
  max-width: 64ch;
}
.not-note .hand { font-size: 1.2rem; display: block; margin-bottom: 0.25rem; }

/* ---------- finding layout ---------- */
.finding { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 4vw, 4.5rem); align-items: center; }
.finding .art { position: relative; }
.finding .art svg.illus { width: 100%; height: auto; }
.action-line { margin-top: 1.5rem; font-size: 1rem; line-height: 1.55; max-width: 60ch; }
.action-line .hand { font-size: 1.25rem; display: block; margin-bottom: 0.2rem; }
.meta-line { margin-top: 0.8rem; font-size: 0.88rem; opacity: 0.92; }

/* big stat trio (petrichor) */
.stat-trio { display: flex; gap: clamp(1.6rem, 4vw, 3.5rem); margin: 1.8rem 0 0.4rem; flex-wrap: wrap; }
.stat { display: grid; gap: 0.15rem; }
.stat .n { font-family: var(--display); font-size: clamp(2.6rem, 4.6vw, 4rem); line-height: 1; }
.stat .l { font-size: 0.92rem; opacity: 0.92; }

/* ---------- roadmap ---------- */
.road-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.6rem, 3vw, 3rem); align-items: start; }
.quick-list { display: grid; gap: 1rem; margin-top: 1.1rem; }
.quick-item { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: start; }
.quick-item .leaf { width: 30px; height: 30px; flex: none; margin-top: 0.1rem; }
.quick-item .t { font-size: 1rem; line-height: 1.5; }
.quick-item .m { font-size: 0.85rem; opacity: 0.85; margin-top: 0.15rem; }
.grow-list { display: grid; gap: 1.05rem; margin-top: 1.1rem; }
.grow-item .name { font-family: var(--display); font-size: 1.06rem; }
.grow-item .d { font-size: 0.95rem; line-height: 1.5; margin-top: 0.2rem; }
.grow-item .status { font-size: 0.85rem; font-weight: 600; margin-top: 0.25rem; opacity: 0.8; }
.checkpoints { margin-top: 1.8rem; }
.checkpoints p { font-size: 0.98rem; line-height: 1.55; max-width: 70ch; margin-top: 0.5rem; }

/* ---------- ruled out ---------- */
.ruled-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.2rem, 2.5vw, 2rem); margin-top: 2rem; align-items: stretch; }
.specimen { position: relative; padding: 1.5rem 1.4rem; }
.specimen .x-mark { position: absolute; top: -16px; right: -12px; width: 64px; height: 64px; }
.specimen .claim { font-family: var(--display); font-size: 1.12rem; line-height: 1.3; margin-bottom: 0.7rem; padding-right: 2rem; }
.specimen .verdict-word { font-family: var(--hand); font-size: 1.35rem; color: var(--accent-red); }
.specimen p { font-size: 0.92rem; line-height: 1.55; margin-top: 0.45rem; }

/* ---------- closing ---------- */
.closing-quote {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.3;
  max-width: 24ch; margin-inline: auto; text-wrap: balance;
}
.closing-next { margin-top: 2.2rem; font-weight: 600; font-size: clamp(1.05rem, 1.5vw, 1.3rem); opacity: 0.95; }
.protocol-note { margin-top: 3rem; font-size: 0.82rem; line-height: 1.6; max-width: 78ch; opacity: 0.8; }

/* ---------- chrome: rail, toggle, hint ---------- */
.rail {
  position: fixed; right: clamp(0.9rem, 1.6vw, 1.8rem); top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-rail);
  display: grid; gap: 0.85rem; justify-items: center;
}
.rail button {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--bone); background: transparent;
  cursor: pointer; padding: 0; position: relative;
}
.rail button.active { background: var(--bone); }
.rail button .tip {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  font-family: var(--hand); font-size: 1.05rem; color: var(--bone);
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease-out;
}
.rail button:hover .tip, .rail button:focus-visible .tip { opacity: 1; }

.motion-toggle {
  position: fixed; left: clamp(0.9rem, 1.6vw, 1.8rem); bottom: clamp(0.9rem, 1.8vh, 1.6rem);
  z-index: var(--z-toggle);
  font-family: var(--hand); font-size: 1.1rem;
  color: var(--bone); background: color-mix(in oklab, var(--ink) 45%, transparent);
  border: 1.5px solid color-mix(in oklab, var(--bone) 55%, transparent);
  border-radius: 999px; padding: 0.5rem 1.1rem; cursor: pointer;
}
.motion-toggle:hover { background: color-mix(in oklab, var(--ink) 70%, transparent); }

.scroll-hint {
  position: fixed; left: 50%; bottom: 1.3rem; transform: translateX(-50%);
  z-index: var(--z-hint);
  font-family: var(--hand); font-size: 1.15rem; color: var(--bone);
  opacity: 0.9; pointer-events: none;
  transition: opacity 0.5s ease-out;
}
.scroll-hint.gone { opacity: 0; }

/* ---------- per-scene fields & ink/bone choice ---------- */
#s0 { --scene-field: var(--clay); }
#s1 { --scene-field: var(--clay-deep); }
#s2 { --scene-field: var(--dusk); }
#s3 { --scene-field: var(--rain); }
#s4 { --scene-field: var(--clay); }
#s5 { --scene-field: var(--olive); }
#s6 { --scene-field: var(--ochre); color: var(--ink); }
#s6 .thread, #s6 .thread-detail { stroke: color-mix(in oklab, var(--ink) 55%, transparent); }
#s7 { --scene-field: var(--olive-deep); }
#s8 { --scene-field: var(--clay); }

/* cover specifics */
#s0 .scene-inner { text-align: center; }
#s0 .subtitle { font-size: clamp(1rem, 1.5vw, 1.25rem); margin-top: 1.4rem; letter-spacing: 0.04em; }
#s0 .byline { margin-top: 2.6rem; font-size: 0.92rem; opacity: 0.92; max-width: 72ch; margin-inline: auto; line-height: 1.6; }

/* sor specifics */
#s2 .scene-inner { text-align: center; }
#s2 .sor-kicker { font-family: var(--hand); font-size: 1.3rem; opacity: 0.9; }
#s2 .lede { margin-inline: auto; }
#s2 .runs { justify-content: center; }
#s2 .per-engine { margin-top: 1.6rem; font-size: 0.92rem; opacity: 0.85; }

/* focus visibility */
a:focus-visible, button:focus-visible, .evidence:focus-visible {
  outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 4px;
}

/* small-window safety only (not a mobile design) */
@media (max-width: 980px) {
  .finding, .road-grid { grid-template-columns: 1fr; }
  .ruled-grid { grid-template-columns: 1fr; }
  .versus { grid-template-columns: 1fr; gap: 1.2rem; }
}
