/* rezza-site-styles · poppy.css
   Poppy & Bell's case page (CASE-PAGES.md; round seven, 2026-11-04: one argument told in order, one thing to a view).
   The game's plum-brown ink for the words, Grandstander for the big lines and the game's own controls. One grammar for
   every block: a name in the margin, its text in the text column, then the picture. The game's grounds as plates as wide
   as the screen where the sheep and the cast stand (the barn, the meadow, the barn again for the story, the hills for the
   voice); the paper where the screens and the drawings are. The page is alive on the game's modules (poppy.js). Scoped
   by html[data-project="poppy"]. */

/* the game's face, self-hosted from Google Fonts' own files and ranges (SIL Open Font License 1.1:
   fonts/OFL-Grandstander.txt); one variable file per subset gives all three weights */
@font-face { font-family: "Grandstander"; src: url("fonts/grandstander-wght-normal-latin-ext.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: block; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grandstander"; src: url("fonts/grandstander-wght-normal-latin.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: block; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Grandstander"; src: url("fonts/grandstander-wght-normal-latin-ext.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: block; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grandstander"; src: url("fonts/grandstander-wght-normal-latin.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: block; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Grandstander"; src: url("fonts/grandstander-wght-normal-latin-ext.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: block; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grandstander"; src: url("fonts/grandstander-wght-normal-latin.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: block; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

html[data-project="poppy"] {
  --ink: #6B4039;
  --ink-2: rgb(107 64 57 / 0.8);
  --rule: rgb(107 64 57 / 0.18);
  --accent: #E2457A;
  --cream: #FFF8EC;
  --radius: 22px;
  --display: "Grandstander", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --fig-gap: clamp(80px, 9vw, 136px);
}

/* the bar: the site's glass (his rule 2026-11-04, every case page), with the game's round button for the sound before About */
[data-project="poppy"] .top { background: rgb(238 237 232 / 0.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background-color 300ms ease, color 300ms ease; }
[data-project="poppy"] .top .links { align-items: center; }
[data-project="poppy"] .top .sound { width: 32px; height: 32px; --nw-hud-icon: 16px; --nw-lip: 2px; margin-right: 4px; }
[data-project="poppy"] .top .sound[aria-pressed="true"] { background: var(--cream); }

[data-project="poppy"] .five-hero .reel > span { text-decoration-color: rgb(107 64 57 / 0.3); }
[data-project="poppy"] .five-hero .blank:hover .reel > span,
[data-project="poppy"] .five-hero .blank:focus-visible .reel > span { text-decoration-color: var(--ink); }

[data-project="poppy"] .rows::after { background: var(--rule); }
[data-project="poppy"] .row { background-image: linear-gradient(var(--rule), var(--rule)); color: var(--ink-2); }
[data-project="poppy"] .row.is-on, [data-project="poppy"] .row:hover, [data-project="poppy"] .row:focus-within { color: var(--ink); }
[data-project="poppy"] .facts div { border-top-color: var(--rule); }
[data-project="poppy"] .facts dt { color: var(--ink-2); }
[data-project="poppy"] .story h2, [data-project="poppy"] .story .text, [data-project="poppy"] .fig .fd, .both .say, .ph .cap { text-wrap: pretty; }
[data-project="poppy"] .foot { background-image: linear-gradient(var(--rule), var(--rule)); }

[data-project="poppy"] .nw-jbtn { font-family: var(--display); text-decoration: none; }
[data-project="poppy"] .nw-jbtn:hover { text-decoration: none; }
[data-project="poppy"] .nw-jbtn .lbl { letter-spacing: 0; }
[data-project="poppy"] .sheep .sv { width: 100%; height: auto; margin: 0; }
.sh .bubnw { zoom: var(--kb, 1); }           /* the game's rule: the bubble scales with its sheep */
.sh .bubnw:empty { display: none; }

/* ---- a plate: one of the game's grounds, as wide as the screen, the page's grid inside it ---- */
.band { position: relative; margin-inline: calc(-1 * var(--margin)); padding: clamp(48px, 5vw, 72px) var(--margin); background-color: #EDC772; background-position: center; background-size: cover; }
.band.barn { background-image: url("img/poppy/ground-barn.webp"); }
.band.meadow { background-image: url("img/poppy/ground-meadow.webp"); background-color: #B7D486; }
.band.hills { background-image: url("img/poppy/ground-hills.webp"); background-color: #B2BF9C; }
.band .in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; }

/* ---- the opener: a trailer's screen split in two. on the left a flat cream area, edge to margin, for the name, the line
   and the main button; on the right the barn's ground at dawn with the pair big, facing each other and singing ---- */
[data-project="poppy"] .case-intro { margin-top: clamp(40px, 5vw, 64px); }
.case-intro .media { grid-column: 1 / -1; }
.trailer { display: grid; grid-template-columns: 5fr 7fr; margin-inline: calc(-1 * var(--margin)); }
.trailer .area { min-width: 0; }
.trailer .words { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 22px; padding: clamp(40px, 4vw, 64px) clamp(32px, 4vw, 64px) clamp(40px, 4vw, 64px) var(--margin); background: var(--cream); }
.trailer .name { width: 100%; max-width: 440px; }
.trailer .name svg { display: block; width: 100%; height: auto; overflow: visible; }
.trailer .words p { font-family: var(--display); font-weight: 700; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.4; color: var(--ink); max-width: 22em; }
.trailer .field { position: relative; background: url("img/poppy/ground-barn.webp") center / cover #EDC772; display: flex; align-items: flex-end; justify-content: center; }
.trailer .scene { --s: clamp(220px, 22vw, 320px); --kb: 3.6; position: relative; display: flex; align-items: flex-end; justify-content: center; gap: calc(var(--s) * 0.12); padding: calc(var(--s) * 0.5 + 36px) 24px 28px; }
.trailer .scene .sh { position: relative; width: var(--s); }
.trailer .scene .heart { position: absolute; left: 50%; bottom: calc(28px + var(--s) * 0.93); width: calc(var(--s) * 0.2); margin-left: calc(var(--s) * -0.1); }
.trailer .scene .heart svg { display: block; width: 100%; height: auto; }
@media (max-width: 1300px) { .trailer .scene { --kb: 2.9; } }

/* ---- the standfirst as a magazine sets it, big, the full measure, the facts under it in two columns (his rule
   2026-11-04, every case page) ---- */
[data-project="poppy"] .case-lede { margin-top: clamp(64px, 8vw, 112px); align-items: start; }
[data-project="poppy"] .case-lede .lede { grid-column: 1 / 12; font-size: clamp(30px, 3.5vw, 56px); font-weight: 500; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
[data-project="poppy"] .case-lede .facts { grid-column: 1 / 9; grid-row: 2; margin-top: clamp(36px, 4vw, 56px); padding-top: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gutter); }

/* ---- the story in three ---- */
.story { margin-top: clamp(96px, 12vw, 176px); align-items: start; }
.story .kicker { grid-column: 1 / 5; grid-row: 1; display: flex; gap: 12px; align-items: baseline; margin-bottom: 20px; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.story .kicker .n { font-variant-numeric: tabular-nums; }
.story .colrule { grid-column: 5 / 6; grid-row: 2 / 4; justify-self: start; align-self: stretch; width: 1px; margin-left: calc(-0.5 * var(--gutter)); background: var(--rule); }
.story h2 { grid-column: 1 / 5; grid-row: 2; margin-right: calc(-0.5 * var(--gutter)); padding-right: calc(0.5 * var(--gutter)); padding-top: 14px; border-top: 1px solid var(--rule); font-size: clamp(20px, 1.7vw, 24px); font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; }
.story .big { grid-column: 5 / 13; grid-row: 2; margin-left: calc(-0.5 * var(--gutter)); padding-left: calc(0.5 * var(--gutter)); padding-top: 12px; border-top: 1px solid var(--rule); font-family: var(--display); font-weight: 800; font-size: clamp(30px, 3.5vw, 52px); line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
.story .text { grid-column: 5 / 11; grid-row: 3; margin-top: 28px; font-size: 20px; line-height: 1.5; letter-spacing: -0.005em; color: var(--ink-2); }
/* the reading measure: a running text stops at about seventy characters a line, however wide the screen */
.story .text, .fig .fd { max-width: 34em; }
.story .reader { grid-column: 1 / 4; grid-row: 3; margin-top: 28px; align-self: start; cursor: pointer; outline: none; }
.story .reader .pb-who, .both .who .pb-who, .voice .who .pb-who { display: block; }
.story .reader svg, .both .who svg, .voice .who svg { display: block; width: 100%; height: auto; overflow: visible; }
.story .reader:focus-visible, .both .who:focus-visible { outline: 2px solid var(--ink); outline-offset: 8px; border-radius: 12px; }

/* a line being read: every word on the page from the start, faint, each syllable lit as it is said, so a reader can
   always read ahead of the voice */
.js [data-read] .sy, .js .both .say .sy, .js .voice .says .sy { opacity: 0.38; transition: opacity 90ms ease-out; }
.js [data-read] .sy.on, .js .both .say .sy.on, .js .voice .says .sy.on, .rm [data-read] .sy, .rm .both .say .sy, .rm .voice .says .sy { opacity: 1; }

/* ---- the figures, set as a chapter is set: the number and the name in the margin, one text in the text column, then
   the picture; one thing to a view ---- */
[data-project="poppy"] .fig { margin-top: var(--fig-gap); row-gap: 0; align-items: start; }
.fig .fn { grid-column: 1 / 5; grid-row: 1; display: flex; gap: 12px; align-items: baseline; font-size: 17px; line-height: 24px; font-weight: 500; color: var(--ink); }
.fig .fn .n { font-weight: 400; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.fig .fd { grid-column: 5 / 11; grid-row: 1; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.fig .media { grid-column: 1 / -1; grid-row: 2; margin-top: 32px; min-width: 0; }
.fig.phones .media, .fig.matrix .media, .fig.book .media { grid-column: 5 / 13; }
[data-project="poppy"] .fig .media img { display: block; width: 100%; height: auto; }

/* 01 the sheep on the meadow */
.fig.flock .band { padding-block: clamp(84px, 9vw, 128px) clamp(24px, 3vw, 40px); }
.fig.flock .flock-row { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-end; gap: 0 2%; }
.fig.flock .sh { position: relative; width: 9.5%; --kb: 1.5; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.fig.flock .sh:focus-visible { outline: 2px solid var(--ink); outline-offset: 8px; border-radius: 12px; }

/* 02 three phones (the site's own frame), each named under */
.phones-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); align-items: start; max-width: 880px; }
.ph { position: relative; container-type: inline-size; }
.ph .screen { position: absolute; left: 6.027%; top: 2.653%; width: 88.049%; height: 94.643%; overflow: hidden; border-radius: 7.86cqw; background: var(--top, #F7E6CD); z-index: 1; }
/* the films were recorded without the phone's top inset: each starts a little under the notch, on a strip of its own
   top colour (poppy.py reads it off the poster), so nothing of the game sits under the frame; only ground leaves at the foot.
   the films carry rounded corners of their own, dark outside the curve, which a rounder clip hides; each engine draws a
   film a shade off its poster, so the strip fades into the film rather than meeting it at an edge */
.ph .screen::before { content: ""; position: absolute; inset: 0 0 auto 0; height: calc(2.5% + 8px); background: linear-gradient(var(--top, #F7E6CD) calc(100% - 8px), rgb(255 255 255 / 0)); z-index: 1; pointer-events: none; }
.ph .screen img, .ph .screen video { position: relative; top: 2.5%; border-radius: 9.5cqw; display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ph .ph-frame { position: relative; display: block; width: 100%; height: auto; z-index: 2; pointer-events: none; }
.phone .cap { margin-top: 14px; text-align: center; font-size: 14px; line-height: 20px; color: var(--ink-2); }

/* 03 both sides of one story, on the barn's ground: Nokhod at the left, Lubia at the right, both facing in, their lines
   between them in the game's bubbles; the line when they meet under, and the heart */
.fig.both .band { padding-block: clamp(56px, 6vw, 88px); }
.both .in { row-gap: clamp(40px, 4vw, 56px); align-items: start; }
.both .side { display: flex; align-items: flex-end; gap: clamp(16px, 2vw, 28px); min-width: 0; }
.both .side.nokhod { grid-column: 1 / 7; }
.both .side.lubia { grid-column: 7 / 13; }
.both .who { flex: 0 0 auto; width: clamp(84px, 7.5vw, 116px); cursor: pointer; outline: none; }
.both .said { flex: 1; min-width: 0; }
.both .when { margin-bottom: 4px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink); }
.both .say { margin-top: 10px; padding: 12px 16px 10px; font-family: var(--display); font-weight: 700; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.35; color: var(--ink); background: var(--cream); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 0 3px 0 var(--ink); }
.both .nokhod .say { border-bottom-left-radius: 6px; }
.both .lubia .said { text-align: right; }
.both .lubia .say { text-align: left; border-bottom-right-radius: 6px; }
.both .meet { grid-column: 4 / 10; display: flex; flex-direction: column; align-items: center; text-align: center; }
.both .meet .say { display: inline-block; margin-top: 6px; }
.both .meet .heart { width: 44px; margin-bottom: 12px; }
.both .meet .heart svg { display: block; width: 100%; height: auto; }
.js .both .meet .heart { transform: scale(0); transition: transform 520ms cubic-bezier(0.34, 1.45, 0.64, 1); }
.js .both .meet .heart.on, .rm .both .meet .heart { transform: scale(1); }

/* 04 the hard level as the script reads it, on the paper */
.fig.matrix .mx { display: flex; justify-content: flex-start; }
.fig.matrix .grid-mx { display: grid; gap: 3px; --c: 34px; }
.fig.matrix .grid-mx .ax { display: grid; place-items: center; width: var(--c); height: var(--c); }
.fig.matrix .grid-mx .ax .sheep { width: 32px; }
.fig.matrix .grid-mx .ce { width: var(--c); height: var(--c); border-radius: 8px; background: rgb(107 64 57 / 0.07); display: grid; place-items: center; }
.fig.matrix .grid-mx .ce.diag { background: transparent; }
.fig.matrix .grid-mx .ce.one::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgb(107 64 57 / 0.45); }
.fig.matrix .grid-mx .ce.pair svg { width: 20px; height: 20px; display: block; }
.fig.matrix .grid-mx .ce.sol { background: rgb(226 69 122 / 0.14); box-shadow: inset 0 0 0 2px var(--accent); }

/* 05 a voice made of numbers, on the hills: Nokhod at the left facing in, the line big and editable, how he feels, and
   the melody drawn wide under it */
.fig.voice .band { padding-block: clamp(56px, 6vw, 88px); }
.voice .in { align-items: center; }
.voice .stage { grid-column: 1 / 4; display: flex; justify-content: center; }
.voice .stage .who { width: clamp(120px, 12vw, 170px); }
.voice .panel { grid-column: 5 / 13; min-width: 0; }
.voice .says { padding-bottom: 12px; border-bottom: 2px dashed rgb(107 64 57 / 0.4); font-family: var(--display); font-weight: 800; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.2; color: var(--ink); outline: none; caret-color: var(--accent); cursor: text; text-wrap: balance; }
.voice .says:focus { border-bottom-color: var(--ink); }
.voice .feels { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.voice .feel { font-family: var(--display); font-weight: 700; font-size: 15px; padding: 6px 14px 4px; --nw-lip: 3px; }
.voice .feel[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.voice .go { margin-left: 6px; min-width: 0; padding-inline: 22px; }
.voice .go .lbl { font-size: 16px; }
.voice .melody { margin-top: 24px; }
.voice .melody svg { display: block; width: 100%; height: auto; overflow: visible; }
.voice .melody .staff { stroke: rgb(107 64 57 / 0.25); stroke-width: 1; }
.voice .melody path { opacity: 0.3; transition: opacity 90ms ease-out; }
.voice .melody path.on, .rm .voice .melody path { opacity: 1; }

/* 06 the book: one page of the kit, as it is */
.fig.book .media img { border-radius: 12px; border: 1px solid var(--rule); }

/* the way on: every other project under a quiet title, as the index lists them (his rule 2026-11-04, every case page) */
[data-project="poppy"] .more { margin-top: clamp(96px, 12vw, 176px); padding-bottom: 14px; }
[data-project="poppy"] .more h2 { grid-column: 1 / -1; font-size: 14px; line-height: 20px; color: var(--ink-2); }
[data-project="poppy"] .more-rows { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  [data-project="poppy"] .nw-jbtn.pop { animation: none; }
}

@media (max-width: 900px) {
  html[data-project="poppy"] { --radius: 18px; }
  .trailer { grid-template-columns: 1fr; min-height: 0; }
  .trailer .words { padding: 36px var(--margin); }
  .trailer .name { max-width: 300px; }
  .trailer .scene { --s: min(150px, calc((100vw - 52px) / 2)); --kb: 1.7; gap: 20px; padding: 100px 16px 20px; }
  .trailer .scene .heart { bottom: calc(20px + var(--s) * 0.93); }
  [data-project="poppy"] .case-lede .lede { grid-column: 1 / -1; font-size: clamp(28px, 7.6vw, 40px); }
  [data-project="poppy"] .case-lede .facts { grid-column: 1 / -1; margin-top: 32px; grid-template-columns: 1fr; }
  .story .kicker { grid-column: 1 / -1; grid-row: auto; margin-bottom: 16px; }
  .story .colrule { display: none; }
  .story h2 { grid-column: 1 / -1; grid-row: auto; margin-right: 0; padding-right: 0; }
  .story .big { grid-column: 1 / -1; grid-row: auto; margin: 24px 0 0; padding: 0; border-top: 0; font-size: clamp(28px, 7vw, 40px); }
  .story .reader { grid-column: 1 / 6; grid-row: auto; margin-top: 24px; }
  .story .text { grid-column: 1 / -1; grid-row: auto; margin-top: 20px; font-size: 18px; }
  .fig .fn, .fig .fd { grid-column: 1 / -1; grid-row: auto; }
  .fig .fd { margin-top: 8px; }
  .fig .media, .fig.phones .media, .fig.matrix .media, .fig.book .media { grid-column: 1 / -1; grid-row: auto; margin-top: 24px; }
  .phones-row { display: flex; gap: 16px; padding: 0 0 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--margin)); padding-inline: var(--margin); max-width: none; }
  .phones-row::-webkit-scrollbar { display: none; }
  .phones-row .phone { flex: 0 0 68%; scroll-snap-align: center; }
  .fig.matrix .mx { justify-content: center; }
  /* fifteen columns (level 43's fourteen sheep and the axis) that shrink to fit a 320 px screen, so it never scrolls sideways */
  .fig.matrix .grid-mx { --c: min(21px, calc((100vw - 2 * var(--margin) - 14px) / 15)); gap: 1px; }
  .fig.matrix .grid-mx .ax .sheep { width: min(20px, calc(var(--c) - 1px)); }
  .fig.matrix .grid-mx .ce.pair svg { width: min(13px, calc(var(--c) - 8px)); height: min(13px, calc(var(--c) - 8px)); }
  [data-project="poppy"] .top .crumbs.wide { grid-column: 1 / 7; }
  [data-project="poppy"] .top .links { grid-column: 7 / 13; }
  [data-project="poppy"] .top .crumb.root, [data-project="poppy"] .top .leaf .sep { display: none; }   /* the mark is the way back; the name keeps its room beside the sound button */
  .fig.flock .band { padding-top: 96px; }
  .fig.flock .flock-row { flex-wrap: wrap; justify-content: center; gap: 64px 6%; }
  .fig.flock .sh { width: 26%; --kb: 1.3; }
  .both .side.nokhod, .both .side.lubia, .both .meet { grid-column: 1 / -1; }
  .both .who { width: 76px; }
  .both .say { font-size: 16px; }
  .voice .in { row-gap: 24px; }
  .voice .stage { grid-column: 1 / -1; }
  .voice .stage .who { width: 110px; }
  .voice .panel { grid-column: 1 / -1; }
  .voice .says { font-size: clamp(22px, 6vw, 28px); }
  .voice .feel { font-size: 14px; padding: 5px 12px 3px; }
}
/* a portrait tablet keeps the phone layout, but nothing stands taller than about seven tenths of its screen */
@media (min-width: 641px) and (max-width: 900px) {
  .phones-row .phone { flex-basis: min(68%, 35vh); }
}
@media (max-width: 640px) {
  .phones-row .phone { flex-basis: 76%; }
}
