/* wrenfield.brightkidzhub.com
 *
 * THESIS. The site is Wrenfield's own display wall, not an app-store landing
 * page. It refuses the category default -- a pastel gradient, a glossy phone
 * mockup and a grid of feature icons -- because that page could sell any
 * app, and this one has to show a painted village and a face worth reading.
 *
 * OWN-WORLD. Inherited from Wrenfield's DESIGN.md, not invented here:
 * saturated sugar-paper grounds, one per place (street tangerine, rec green,
 * classroom blue, hall violet, kitchen red, gate slate); one cream card
 * (#FFFDF7) with a snipped edge and a red drawing pin carries the words; the
 * pictures are the app's own paintings, framed by a crimped sunflower border;
 * one paper shadow, one direction; Andika, the app's reading face. No
 * rounded corners, no gradients, no glass, no glow, no dark mode (sugar
 * paper has no dark counterpart -- DESIGN.md records why).
 *
 * STORY. A parent sees the exact moment the free story opens on, understands
 * in one card what their child will do, walks through the four questions
 * with the real screen text, meets the six children, and plays the story.
 *
 * FIRST VIEWPORT. Street-tangerine paper. The pinned card on the left:
 * title line, the question as the headline, one paragraph, the Play button.
 * On the right, the painted high street with Jonah and Dara, in a crimped
 * sunflower frame the card overlaps. On a phone: picture, then the card
 * pulled up over its lower edge.
 *
 * FORM. Cut-paper display wall, the app's committed world, extended to a
 * Persuade surface. Brief-pinned (a sibling of brightkidzhub.com carrying
 * Wrenfield's own world), so no concept roll. The BrightKidz family marks --
 * six-ink hairline and publisher footer -- close every page, as on the apex
 * and the library.
 */

@font-face {
  font-family: "Andika";
  src: url("/static/fonts/Andika-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Andika";
  src: url("/static/fonts/Andika-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --card: #FFFDF7;
  --ink: #1E1B18;
  --ink-soft: #4a433c;
  --paper-classroom: #2C4EB8;
  --paper-gate: #3E4B5E;
  --paper-hall: #6A3B8F;
  --paper-kitchen: #B7433B;
  --paper-rec: #1F7A47;
  --paper-street: #D9701A;
  --sunflower: #FFC72C;
  --poppy: #E8453C;

  /* The library's six subject inks, for the family hairline only. */
  --s1: #12676f; --s2: #5b3fa8; --s3: #1d7533;
  --s4: #935824; --s5: #b8324c; --s6: #3a5794;

  --paper: var(--paper-street);
  --on-paper: var(--card);

  --cut-edge: polygon(
    0% 1.2%, 12% 0%, 27% 1.4%, 41% 0.2%, 58% 1.6%, 73% 0.3%, 88% 1.5%, 100% 0.4%,
    99% 14%, 100% 31%, 98.8% 48%, 100% 66%, 98.9% 83%, 100% 98.6%,
    87% 100%, 71% 98.5%, 55% 100%, 39% 98.6%, 24% 100%, 9% 98.7%, 0% 100%,
    1.2% 82%, 0% 65%, 1.3% 47%, 0.2% 30%, 1.1% 15%
  );
  --shadow-card: drop-shadow(0 3px 0 rgb(30 27 24 / .24)) drop-shadow(0 12px 14px rgb(30 27 24 / .22));
  --shadow-paper: drop-shadow(0 3px 0 rgb(30 27 24 / .22));
  --crimp: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --target: 56px;
  --measure: 66ch;
  --font: "Andika", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

/* The per-place grounds, and the label colour Wrenfield measured for each
   (tokens.css --paper-label-*): white on every ground but the street, ink
   on the street. */
[data-paper="classroom"] { --paper: var(--paper-classroom); --on-paper: #FFFFFF; }
[data-paper="gate"]      { --paper: var(--paper-gate);      --on-paper: #FFFFFF; }
[data-paper="hall"]      { --paper: var(--paper-hall);      --on-paper: #FFFFFF; }
[data-paper="kitchen"]   { --paper: var(--paper-kitchen);   --on-paper: #FFFFFF; }
[data-paper="rec"]       { --paper: var(--paper-rec);       --on-paper: #FFFFFF; }
[data-paper="street"]    { --paper: var(--paper-street);    --on-paper: var(--ink); }

@media (prefers-contrast: more) {
  :root { --card: #FFFFFF; --shadow-card: none; --shadow-paper: none; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .16em; text-decoration-thickness: .08em; }
.card a { color: #1d3f9e; }
.card a:hover { color: var(--ink); }
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--sunflower);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 30;
  background: var(--card); color: var(--ink);
  padding: .8rem 1.2rem; font-weight: 700;
}
.skip-link:focus { left: .6rem; top: .6rem; }

/* ── the masthead: a sunflower strip cut with pinking shears ─────────── */

.mast {
  background: var(--sunflower);
  padding-bottom: var(--crimp);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(var(--crimp) * 2) 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(var(--crimp) * 2) 100%;
  position: relative; z-index: 2;
}
.mast-in {
  max-width: 76rem; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem;
  padding: .9rem clamp(1rem, 4vw, 2.5rem) .7rem;
}
.mark { display: inline-flex; min-height: var(--target); align-items: center; }
.mark svg { width: clamp(11rem, 26vw, 15.5rem); height: auto; filter: drop-shadow(0 2px 0 rgb(30 27 24 / .22)); }
.mast nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.mast nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: .35rem .9rem; text-decoration: none; font-weight: 700;
  color: var(--ink); background: var(--card);
  clip-path: var(--cut-edge);
}
.mast nav a:hover { background: #fff; text-decoration: underline; }
.mast nav a[aria-current="page"] { background: var(--ink); color: var(--card); }

/* THE TWO TITLES. One button per title, each a plain link to that title's
   own page, its age band as a small second line. At phone width the brand
   and "Why Wrenfield" share the first row and the two titles take the
   second, half the width each, so neither crowds the mark. (Three titles
   would not fit this way; build.py says what replaces it.) */
.mast nav.pages { margin-left: auto; }
.mast nav.titles { margin-left: 0; gap: .5rem; }
.mast nav.titles a.title-btn {
  flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 52px; padding: .3rem .9rem; line-height: 1.15;
}
.title-btn .t { font-weight: 700; font-size: 1rem; }
.title-btn .a { font-weight: 400; font-size: .85rem; color: var(--ink-soft); }
.mast nav a.title-btn[aria-current="page"] .a { color: var(--card); }
@media (max-width: 39.99rem) {
  .mast-in { column-gap: .5rem; }
  .mark svg { width: 10.5rem; }
  .mast nav.pages a { padding-inline: .6rem; font-size: 1rem; }
  .mast nav.titles { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .mast nav.titles a.title-btn { padding-inline: .55rem; }
  .title-btn .t { font-size: .95rem; }
}

/* THE PLAY ENTRY ON A STORY PAGE'S FIRST PICTURE. A sunflower tab on the
   picture; its ::after stretches over the whole frame, so the picture is the
   link too, while the picture keeps its own description for a screen
   reader and the link keeps a short name. */
.hero-picture { position: relative; }
.play-badge {
  position: absolute; left: 50%; bottom: calc(var(--crimp) + 1rem); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap;
  min-height: var(--target); padding: .6rem 1.2rem .6rem 1rem;
  background: var(--sunflower); color: var(--ink); font-weight: 700; font-size: 1.1rem;
  text-decoration: none; box-shadow: 0 4px 0 var(--ink);
}
.play-badge svg { width: 1.3rem; height: 1.3rem; fill: var(--ink); flex: none; }
.play-badge::after { content: ""; position: absolute; inset: -100vmax; }
.hero-picture { overflow: hidden; }
.play-badge:hover { background: #ffd65c; }
.play-badge:focus-visible { outline-offset: 4px; }

/* ── cards: cream paper, snipped edge, red pin, one shadow ──────────────── */

.card {
  position: relative; isolation: isolate;
  padding: clamp(1.4rem, 3.5vw, 2.2rem) clamp(1.2rem, 3.5vw, 2.2rem);
  filter: var(--shadow-card);
  color: var(--ink);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--card); clip-path: var(--cut-edge);
}
.pin {
  position: absolute; top: -12px; left: 50%; width: 28px; height: 28px;
  margin-left: -14px; z-index: 2;
  filter: drop-shadow(1px 2px 0 rgb(30 27 24 / .3));
}
.card > :last-child { margin-bottom: 0; }

h1, h2, h3 { font-weight: 700; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); margin: .2rem 0 1rem; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.3rem); margin: 0 0 1rem; }
h3 { font-size: 1.3rem; margin: 0 0 .6rem; }
p { margin: 0 0 1rem; }
.kicker { font-weight: 700; font-size: 1rem; color: var(--ink-soft); margin-bottom: .4rem; }
.lede { font-size: clamp(1.15rem, 1.7vw, 1.3rem); }

/* ── buttons: a sunflower tab you could peel off the wall ─────────────── */

.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.4rem 0 1rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--target); padding: .7rem 1.4rem;
  font-weight: 700; font-size: 1.1rem; text-decoration: none;
  color: var(--ink) !important;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.button.go {
  background: var(--sunflower);
  box-shadow: 0 4px 0 var(--ink);
}
.button.go:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.button.go:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.button.quiet { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.button.quiet:hover { background: #fff3cc; }
.soon, .fine { font-size: .98rem; color: var(--ink-soft); }

/* ── the hero ──────────────────────────────────────────────────────────── */

.hero {
  max-width: 76rem; margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 4vw, 2.5rem) clamp(2.5rem, 6vw, 4.5rem);
  display: grid; align-items: center;
}
.hero-picture, .rec {
  margin: 0; background: var(--sunflower); padding: var(--crimp) 10px;
  -webkit-mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--crimp) * 2) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--crimp) * 2) 51% repeat-x;
          mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--crimp) * 2) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--crimp) * 2) 51% repeat-x;
}
/* The hero is the story's own first picture, a screenshot from the engine
   (tools/capture_stills.mjs) taken with a picture band wide enough that both
   children stand whole inside it. It is shown WHOLE at every width -- never
   cropped -- because the right-hand child stands near the edge and any crop
   would cut her off again. */
.hero-picture img { width: 100%; height: auto; }
.hero-card { margin: -1.2rem .4rem 0; transform: rotate(-.8deg); }
.hero h1 span { display: block; }

@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 36rem); }
  .hero-picture { grid-column: 2; grid-row: 1; }
  /* A small overlap only: Jonah stands at the picture's left edge. */
  .hero-card { grid-column: 1 / span 1; grid-row: 1; margin: 0 -1.5rem 0 0; z-index: 1; }
}

/* THE ONE AUTHORED MOMENT: the card is pinned up. It starts where it ends --
   visible, in place -- and only its last half-degree of settle is animated,
   so reduced motion, a failed animation or no CSS animation support all show
   the same finished wall. */
@media (prefers-reduced-motion: no-preference) {
  .hero-card { animation: pin-up .9s var(--ease) .15s backwards; }
  .hero-card .pin { animation: pin-in .5s var(--ease) .75s backwards; }
}
@keyframes pin-up {
  from { transform: translateY(-14px) rotate(-3deg); filter: drop-shadow(0 18px 18px rgb(30 27 24 / .28)); }
  to   { transform: rotate(-.8deg); }
}
@keyframes pin-in {
  from { transform: translateY(-10px) scale(1.25); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ── bands: one ground per place ──────────────────────────────────────── */

.band { background: var(--paper); color: var(--on-paper); padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band-in { max-width: 76rem; margin-inline: auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.label { color: var(--on-paper); font-size: clamp(1.8rem, 4.4vw, 3rem); max-width: 22ch; margin-bottom: 1rem; }
.band-lede { max-width: 60ch; font-size: 1.2rem; margin-bottom: 2.4rem; }
.band .after { max-width: 60ch; margin-top: 2.4rem; font-size: 1.15rem; }
.band .after a { color: var(--on-paper); font-weight: 700; }

.split { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 60rem) { .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.framed { margin: 0; background: var(--card); padding: 10px 10px 0; filter: var(--shadow-card); }
.framed img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.framed figcaption { color: var(--ink); font-size: 1rem; padding: .7rem .3rem .9rem; font-weight: 700; }
.framed.tilt { transform: rotate(1.4deg); }
/* Engine stills are shown whole (never cover-cropped): a child standing near
   the edge of the picture must not be cut off by the layout. */
.framed.whole { max-width: 32rem; justify-self: center; }
.framed.whole img { aspect-ratio: auto; object-fit: fill; }
.card.wide { max-width: 46rem; }
.card.wide p, .card.wide li { max-width: var(--measure); }

/* The four questions. Numbered because the ORDER is the lesson. */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.6rem 1.6rem; }
@media (min-width: 40rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 70rem) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } .step h3 { font-size: 1.15rem; } }
.step:nth-child(1) { transform: rotate(-1.1deg); }
.step:nth-child(2) { transform: rotate(.9deg) translateY(.8rem); }
.step:nth-child(3) { transform: rotate(-.5deg); }
.step:nth-child(4) { transform: rotate(1.2deg) translateY(.6rem); }
.step h3 { display: flex; gap: .6rem; align-items: flex-start; }
.n {
  flex: none; display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; background: var(--sunflower); color: var(--ink);
  font-size: 1.1rem; clip-path: var(--cut-edge);
}
.step img { width: 5.5rem; margin: .4rem auto 0; }
.said { list-style: none; padding: 0; margin: .8rem 0 0; }
.said li {
  padding: .45rem 0 .45rem 1.4rem; position: relative;
  border-top: 2px dashed rgb(30 27 24 / .22); font-size: 1.02rem;
}
.said li::before { content: "\201C"; position: absolute; left: 0; top: .25rem; font-weight: 700; font-size: 1.3rem; color: var(--paper-kitchen); }

.rules { padding-left: 1.2rem; }
.rules li { margin: .7rem 0; }

/* The village. */
.rec { margin: 0 0 2.8rem; padding-inline: 10px; }
.rec img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.cast {
  list-style: none; margin: 0 0 3.5rem; padding: 0;
  display: grid; gap: 2rem 1.2rem; grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 40rem) { .cast { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 70rem) { .cast { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.cast li { display: grid; justify-items: start; gap: .5rem; align-content: start; }
.cast img { height: 11rem; width: auto; filter: var(--shadow-paper); }
.cast .who {
  background: var(--card); color: var(--ink); font-weight: 700; font-size: 1.15rem;
  padding: .25rem .9rem; clip-path: var(--cut-edge);
}
.cast .line { font-size: 1.02rem; line-height: 1.45; color: var(--on-paper); max-width: 26ch; }

.places {
  list-style: none; margin: 0; padding: 0 0 1rem;
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 20rem);
  gap: 1.2rem; overflow-x: auto; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}
.places li { scroll-snap-align: start; position: relative; filter: var(--shadow-paper); }
.places li:nth-child(odd) { transform: rotate(-.7deg); }
.places li:nth-child(even) { transform: rotate(.6deg); }
.places img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 8px solid var(--card); border-bottom-width: 2.6rem; }
.places span { position: absolute; left: 10px; right: 10px; bottom: .45rem; color: var(--ink); font-weight: 700; font-size: 1rem; }
@media (min-width: 60rem) {
  .places { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
}

/* The play band: the card, and the phone the story plays on. */
.phones { margin: 0; position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 30rem; justify-self: center; }
.phones img { width: 100%; background: var(--sunflower); padding: 8px; filter: var(--shadow-card); }
.phones .p1 { transform: rotate(-2.5deg); }
.phones .p2 { transform: rotate(2deg) translateY(1.6rem); }
.phones figcaption { grid-column: 1 / -1; margin-top: 2.2rem; text-align: center; font-weight: 700; color: var(--on-paper); }

.facts { display: grid; gap: 2.4rem 2rem; }
@media (min-width: 56rem) { .facts { grid-template-columns: 1fr 1fr; } }
.facts .card:nth-child(1) { transform: rotate(-.6deg); }
.facts .card:nth-child(2) { transform: rotate(.7deg); }
.facts ul { padding-left: 1.2rem; margin: 0; }
.facts li { margin: .6rem 0; }
.soon-card { transform: rotate(-.5deg); }

/* ── Your child's choices ─────────────────────────────────────────────────
   The illustration is drawn in HTML, not a screenshot: the feature's screen
   does not exist yet, so the page shows what one story's entry HOLDS, and
   says in its caption that it is an illustration. A ruled sheet, the rules falling between the entries. */
.ycc .lede { font-size: 1.2rem; font-weight: 700; }
.ycc-sample { margin: 0; justify-self: center; width: min(100%, 26rem); transform: rotate(1.2deg); }
.ycc-page {
  background: #FFFDF7;
  border-left: 6px solid var(--poppy);
  padding: 1.3rem 1.3rem 1.1rem 1.4rem; color: var(--ink); filter: var(--shadow-card);
}
.ycc-story { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-weight: 700; font-size: 1.25rem; margin: 0 0 .6rem; }
.ycc-story span { font-size: .9rem; font-weight: 700; background: var(--sunflower); padding: .1rem .55rem; }
.ycc-page dl { margin: 0; }
.ycc-page dl div { padding: .5rem 0; border-top: 1px solid rgb(29 63 158 / .2); }
.ycc-page dt { font-size: .9rem; font-weight: 700; color: var(--ink-soft); }
.ycc-page dd { margin: 0; font-size: 1.1rem; }
.ycc-talk { margin: .8rem 0 0; padding: .8rem .9rem; background: #FFF3C4; border: 2px dashed var(--ink); font-size: 1.05rem; }
.ycc-talk span { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .2rem; }
.ycc-sample figcaption { margin-top: 1rem; font-weight: 700; color: var(--on-paper); text-align: center; }
@media (forced-colors: active) { .ycc-page { border: 1px solid CanvasText; } }

/* ── The Clubhouse: a printed notice, taped up rather than pinned ─────────
   Title B's cards borrow its first episode's object: the council's notice, taped to
   a door. Two strips of paper tape instead of the red pin, so a
   parent can tell the older title's pages at a glance; everything else is
   the same wall. Tape is paper, cut straight across with a torn end, one
   shadow, no gradient. */
.notice-card .tape {
  position: absolute; top: -11px; z-index: 2;
  width: 5.5rem; height: 1.55rem;
  background: rgb(255 238 186 / .9);
  clip-path: polygon(0 10%, 7% 0, 93% 6%, 100% 0, 96% 50%, 100% 100%, 6% 92%, 0 100%, 4% 50%);
  filter: drop-shadow(0 1px 0 rgb(30 27 24 / .2));
}
.notice-card .tape-l { left: 1.1rem; transform: rotate(-7deg); }
.notice-card .tape-r { right: 1.1rem; transform: rotate(6deg); }
@media (forced-colors: active) { .notice-card .tape { background: CanvasText; } }

/* The Clubhouse's people: under a group picture, as title A's cast sits
   under the rec, with each child's age now and then. */
.group-title { color: var(--on-paper); font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 2.6rem 0 .6rem; }
.band-in > .label + .group-title { margin-top: .6rem; }
.band .band-lede a { color: var(--on-paper); font-weight: 700; }
.cast .age { font-size: .88rem; color: var(--on-paper); opacity: .92; }
.new-split { align-items: start; }
.new-split .framed { margin-top: 1rem; }
.cast.cast-new { grid-template-columns: 1fr; gap: 1.8rem; margin: 1rem 0 0; }
@media (min-width: 40rem) { .cast.cast-new { grid-template-columns: 1fr 1fr; } }
@media (min-width: 60rem) {
  .new-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .cast.cast-new { grid-template-columns: 1fr; }
}

/* The Clubhouse's places: a few that carry the story, one row each, the
   painting with its name and one line saying what happens there. */
.told {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: grid; gap: 1.6rem 1.2rem; grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 60rem) { .told { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.told li { display: grid; gap: .3rem; align-content: start; }
.told img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 6px solid var(--card); filter: var(--shadow-paper); margin-bottom: .4rem; }
.told li:nth-child(odd) img { transform: rotate(-.7deg); }
.told li:nth-child(even) img { transform: rotate(.6deg); }
.told .where { font-weight: 700; font-size: 1.1rem; color: var(--on-paper); }
.told .what { font-size: 1rem; line-height: 1.4; color: var(--on-paper); max-width: 30ch; }

/* On a phone a story page says what it is before it shows it: the card,
   with the kicker and the headline, comes first and the picture follows
   (title A's home keeps its picture-first hero). */
@media (max-width: 59.99rem) {
  .hero-story .hero-card { order: -1; margin: .4rem .4rem 1.4rem; }
}

/* ── the Play page ─────────────────────────────────────────────────────── */

.stage {
  max-width: 80rem; margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) clamp(3rem, 6vw, 4.5rem);
  display: grid; gap: 2.5rem; justify-items: center;
}
.stage-card { transform: rotate(-.5deg); max-width: 46rem; }
.stage-card h2.small { font-size: 1.2rem; margin: 1.4rem 0 .4rem; }
.ready { padding-left: 1.2rem; }
.ready li { margin: .5rem 0; }

/* THE PLAYABLE FRAME. The engine lays itself out by the shape it is given:
   a landscape frame gets its two-pane tablet layout (picture left, words and
   choices right), a portrait frame its tall one. So the frame is 16:10 on a
   landscape screen and 3:4 on a portrait tablet, as large as the screen
   allows without scrolling (the viewport height, less room to breathe), and
   capped at 72rem so a 4K monitor does not get a billboard. A phone opens
   the story full screen instead, which is what it is designed for. */
.device {
  --frame-h: calc(100svh - 6rem);
  width: min(100%, 72rem, calc(var(--frame-h) * 1.6));
  background: var(--sunflower); padding: 12px; filter: var(--shadow-card);
  scroll-margin: 1rem;
}
.device-screen { aspect-ratio: 16 / 10; background: var(--ink); position: relative; }
@media (orientation: portrait) {
  .device { width: min(100%, 48rem, calc(var(--frame-h) * .75)); }
  .device-screen { aspect-ratio: 3 / 4; }
}
.device-screen iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--card); }
.poster { position: absolute; inset: 0; display: block; }
.poster img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.poster-play {
  position: absolute; left: 50%; top: 50%; width: 5.5rem; height: 5.5rem;
  margin: -2.75rem 0 0 -2.75rem; display: grid; place-items: center;
  background: var(--sunflower); box-shadow: 0 5px 0 var(--ink);
  clip-path: var(--cut-edge);
}
.poster-play svg { width: 2.6rem; fill: var(--ink); }
.poster:hover .poster-play { background: #ffd65c; }
@media (max-width: 43.99rem) { .device { display: none; } }

/* ── documents: long reading on one pinned sheet ───────────────────────── */

.doc { max-width: 76rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem) clamp(.6rem, 3vw, 2.5rem) clamp(3rem, 6vw, 5rem); }
.doc .sheet {
  position: relative; isolation: isolate; max-width: 50rem; margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.6rem) clamp(1.3rem, 5vw, 3.6rem);
  filter: var(--shadow-card);
}
/* A long sheet gets a snipped edge measured in PIXELS: the card's percentage
   edge scales with height, and on a 3,000px page 1.6% is a 48px notch. */
.doc .sheet::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--card);
  clip-path: polygon(
    0 6px, 12% 0, 27% 7px, 41% 1px, 58% 8px, 73% 1px, 88% 7px, 100% 2px,
    calc(100% - 5px) 14%, 100% 31%, calc(100% - 6px) 48%, 100% 66%, calc(100% - 5px) 83%, 100% calc(100% - 7px),
    87% 100%, 71% calc(100% - 7px), 55% 100%, 39% calc(100% - 7px), 24% 100%, 9% calc(100% - 6px), 0 100%,
    6px 82%, 0 65%, 6px 47%, 1px 30%, 5px 15%);
}
.doc h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); }

.doc .feedback-sheet { max-width: 43rem; }
.feedback-form { margin-top: 1.6rem; }
.feedback-form label { display: block; font-weight: 700; margin: 1rem 0 .3rem; }
.feedback-form :is(select, textarea, input[type="email"]) {
  display: block;
  width: 100%;
  min-height: var(--target);
  padding: .55rem .75rem;
  border: 2px solid var(--ink-soft);
  border-radius: .25rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.feedback-form textarea { resize: vertical; }
.feedback-form label.feedback-confirm {
  display: flex;
  align-items: center;
  min-height: var(--target);
  gap: .6rem;
  cursor: pointer;
}
.feedback-confirm input { width: 1.2rem; height: 1.2rem; accent-color: var(--ink); }
.doc .feedback-hint { margin: 0 0 .45rem; color: var(--ink-soft); font-size: .95rem; }
.feedback-form button { margin-top: .8rem; border: 0; cursor: pointer; font-family: inherit; }
.feedback-form button:disabled { opacity: .7; cursor: wait; }
#feedback-result:not(:empty) { margin-top: 1.5rem; font-weight: 700; }
.doc h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin: 2.8rem 0 .7rem; }
.doc p, .doc li { max-width: var(--measure); }
.doc ul, .doc ol { padding-left: 1.3rem; }
.doc li { margin: .5rem 0; }
.doc a { color: #1d3f9e; }
.doc code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; background: #f3eee2; padding: .05em .3em; }

/* ── the family footer: shared with brightkidzhub.com and the library ─── */

.foot { background: var(--card); color: var(--ink); }
.inks { display: flex; height: 4px; }
.inks span { flex: 1; }
.ink1 { background: var(--s1); } .ink2 { background: var(--s2); } .ink3 { background: var(--s3); }
.ink4 { background: var(--s4); } .ink5 { background: var(--s5); } .ink6 { background: var(--s6); }
.foot .inner { max-width: 76rem; margin-inline: auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 2.6rem; font-size: 1rem; line-height: 1.55; }
.foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0 0 1rem; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.foot p { margin: 0 0 .4rem; max-width: 52rem; }
.foot .family a { font-weight: 700; color: #1d3f9e; }
.foot .reg { color: var(--ink-soft); }

/* A clip-path clips the focus ring with it, so a focused tab drops its snipped
   edge rather than hide where the keyboard is. */
.mast nav a:focus-visible { clip-path: none; }

/* Official Google Play badge: locally served with its original clear space. */
.google-play-link { display: inline-flex; align-items: center; align-self: center; flex: 0 0 auto; width: 180px; max-width: 100%; min-height: 44px; }
.google-play-link img { display: block; width: 100%; height: auto; }

.store-availability, .store-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; margin: .75rem 0; }
.store-availability > p { flex: 1 1 10rem; margin: 0; line-height: 1.4; }
.store-actions > a { align-self: center; }
.store-availability > .soon { flex: 0 1 auto; }

/* The village game shares the site's pinned paper cards and sunflower frame. */
.lantern-feature { display: grid; grid-template-columns: 1.08fr 1fr; gap: clamp(1rem, 4vw, 3.2rem); align-items: center; }
.lantern-feature > img { display: block; width: 100%; height: auto; border: .4rem solid var(--sunflower); }
.lantern-copy { position: relative; padding: clamp(1.3rem, 4vw, 2.5rem); }
.lantern-copy h1, .lantern-copy h2 { margin: .15em 0 .35em; line-height: 1.1; }
.lantern-copy h1 { font-size: clamp(2.2rem, 5vw, 3.9rem); }
.lantern-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.lantern-grid .card { padding: 1.3rem; }
.lantern-grid h3 { margin: 0 0 .45em; }
.lantern-titles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lantern-privacy { margin-top: 1.2rem; }
.lantern-privacy a { color: inherit; }
.lantern-play { max-width: 81rem; margin-inline: auto; padding: clamp(1rem, 3vw, 2rem); color: var(--card); }
.lantern-play-bar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1.5rem; margin-bottom: 1rem; }
.lantern-play-bar h1 { font-size: clamp(1.65rem, 4vw, 2.6rem); line-height: 1.15; margin: .3rem 0 0; }
.lantern-play a { color: inherit; }
#lantern-fullscreen { font-family: inherit; cursor: pointer; }
#lantern-fullscreen[hidden] { display: none; }
#lantern-player { display: block; width: 100%; height: clamp(33rem, 77svh, 54rem); border: 4px solid var(--sunflower); background: var(--paper-gate); }
#lantern-viewport:fullscreen, #lantern-viewport.lantern-expanded {
  display: grid; grid-template-rows: auto minmax(0, 1fr); width: 100%; height: 100dvh;
  margin: 0; padding: 0; background: var(--paper-gate); overflow: hidden;
}
#lantern-viewport.lantern-expanded { position: fixed; inset: 0; z-index: 100; }
.lantern-playing-fullscreen { overflow: hidden; }
#lantern-viewport:fullscreen iframe, #lantern-viewport.lantern-expanded iframe {
  height: 100%; min-height: 0; border: 0;
}
#lantern-exit { justify-self: end; min-height: 44px; margin: .25rem max(.5rem, env(safe-area-inset-right)) .25rem .5rem;
  padding: .35rem .8rem; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
#lantern-exit[hidden] { display: none; }
.lantern-play-links { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: .9rem; }
.games-intro { position: relative; padding: clamp(1.4rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
.games-intro h1 { max-width: 18ch; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.08; margin: .3em 0; }
.games-intro p { max-width: 65ch; }
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.game-card { overflow: hidden; }
.game-card > img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.game-card-copy { padding: clamp(1.2rem, 3vw, 2rem); }
.game-card h2 { line-height: 1.15; margin: .3em 0; }
.game-links { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.game-links a, .game-title-links a { display: inline-flex; align-items: center; min-height: 44px; }
.game-title-links { padding: 0; margin: .85rem 0; list-style: none; border-top: 1px solid #e3d8bf; }
.game-title-links li { border-bottom: 1px solid #e3d8bf; margin: 0; }
.game-title-links a { display: flex; width: 100%; padding: .35rem 0; font-weight: 700; }
@media (max-width: 48rem) {
  .lantern-feature, .lantern-grid, .games-grid { grid-template-columns: 1fr; }
}
