/* Ciudad de Ángeles — the blend. PLAN step 15.
   Direction 2's snapshot warmth + direction 1's selective motion, over the existing tokens.

   This file is ADDITIVE. It loads after site.css and never redefines a brand colour,
   a font or a spacing scale. Every value below is either an existing token, a value
   derived from one, or a geometry number.

   Governing idea — "everybody says one line". In her film (About Us 2026) each person,
   child and house parent stands flat against one of the campus's own painted walls and
   says a single sentence to camera. The site is that relay: a face, a wall, a sentence.
   The photographs are shown as physical prints because that is how a family keeps them.

   What moves: the hero headline once, the hero print once, and the wall behind the
   relay as you scroll past it.
   What does NOT move, deliberately: the navigation, the pinned prints (their tilt is
   set at rest and stays), every giving action, and anything inside a form. */

/* ---------- tokens: semantic additions only ---------- */
:root {
  /* Small coral text on paper measured 4.06:1 and fails AA. The brand already carries a
     darker coral (--coral-hover). Named for where it goes, so the failing pair cannot be
     reached by reflex. Measured: 5.81:1 on --paper, 5.46:1 on --paper-2, 6.28:1 on --surface. */
  --coral-text: var(--coral-hover);

  /* a photograph, as an object */
  --print-bg: #fff;
  --print-pad: clamp(9px, 1vw, 13px);
  --print-shadow: 0 14px 26px -16px rgba(23, 19, 16, .5), 0 2px 4px -2px rgba(23, 19, 16, .18);
  --print-radius: 3px;

  /* Direction 2 pinned things at ±7deg. On her material that read young — her word was
     "cute", and she worried it was "too young of a feel". Same gesture at a fifth of the
     angle keeps the hand and loses the playroom. */
  --tilt-1: -1.5deg;
  --tilt-2: 1.1deg;
  --tilt-3: -0.7deg;
  --tilt-4: 1.6deg;

  --board-dot: rgba(18, 58, 92, .15);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- the contrast fix, applied where the failing pair actually occurs ---------- */
.kicker { color: var(--coral-text); }
.tlink:hover { color: var(--coral-text); }
.nav .links > a:not(.btn):hover { color: var(--coral-text); }
.needs { color: var(--coral-text); }
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--coral-text);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-blue :where(a, button):focus-visible,
.section.blue :where(a, button):focus-visible { outline-color: var(--gold); }

/* The footer sits on --ink. .meta is --ink-2, which is 1.90:1 there and fails.
   Measured, not eyeballed. */
.footer .meta { color: rgba(255, 255, 255, .74); }

/* The closing band was --coral-cta #CF4429. Pure white on it is 4.65:1, which
   leaves no room at all: the two lines set at 82% and 90% white measured 3.61
   and 4.05 and failed. Same fix as the text token, applied to a surface —
   the darker coral the brand already defines. White on it is 6.66:1. */
.section.coral { background: var(--coral-hover); }
.section.coral .meta,
.section.coral p { color: #fff; }

/* Nav links and inline arrow links were 24-25px tall. The text is the whole hit
   target, so the pointer area is grown with a pseudo-element rather than by
   changing the type. Inline-flex + relative keeps the ::after anchored. */
.nav .links > a:not(.btn),
.nav .drop > .trigger,
.tlink { position: relative; display: inline-flex; align-items: center; min-height: 24px; }
.nav .links > a:not(.btn)::after,
.nav .drop > .trigger::after,
.tlink::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 44px;
  translate: 0 -50%;
}

/* ---------- a photograph, as a print ---------- */
.snap {
  margin: 0;
  background: var(--print-bg);
  padding: var(--print-pad) var(--print-pad) calc(var(--print-pad) * 1.5);
  border-radius: var(--print-radius);
  box-shadow: var(--print-shadow);
  rotate: var(--tilt, 0deg);
  position: relative;
  max-width: 100%;
}
.snap > img {
  width: 100%;
  height: auto;
  border-radius: 1px;
  background: var(--paper-2);
}
.snap.crop-43 > img { aspect-ratio: 4 / 3; object-fit: cover; }
.snap.crop-34 > img { aspect-ratio: 3 / 4; object-fit: cover; }
.snap.crop-11 > img { aspect-ratio: 1; object-fit: cover; }
.snap.crop-169 > img { aspect-ratio: 16 / 9; object-fit: cover; }

/* The caption is handwriting, so it is decoration that happens to be readable — never the
   only place a fact lives. Floor of 20px because Caveat below that stops being legible. */
.snap figcaption {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(20px, 1.9vw, 27px);
  line-height: 1.15;
  color: var(--brand-deep);
  padding: calc(var(--print-pad) * .9) 2px 0;
  text-wrap: pretty;
}
.snap figcaption .where {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 6px;
}

/* One piece of tape, once per board. Any more and it is a scrapbook. */
.snap.taped::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 92px;
  height: 26px;
  translate: -50% 0;
  rotate: 2.5deg;
  background: color-mix(in srgb, var(--gold) 72%, transparent);
  box-shadow: 0 1px 2px rgba(23, 19, 16, .14);
}

/* ---------- the noticeboard ---------- */
/* Direction 2 positioned every card absolutely with hard-coded tops, then spent twelve
   media-query overrides putting them back. This is a grid: the tilt is decoration, the
   layout is real, and it reflows at 320px without a single magic number. */
.board {
  position: relative;
  background-color: var(--paper);
  background-image: radial-gradient(var(--board-dot) .8px, transparent .8px);
  background-size: 17px 17px;
  padding: clamp(40px, 6vw, 92px) var(--pad);
  border-block: 1px solid var(--line);
}
.board-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 2.6vw, 40px);
  align-items: start;
}
.board-head { grid-column: 1 / -1; max-width: 46ch; margin-bottom: clamp(8px, 1.5vw, 20px); }
.board-head h2 { font-size: clamp(38px, 5.4vw, 74px); text-wrap: balance; }
.board-head p { margin-top: 20px; font-size: 1.1rem; text-wrap: pretty; }

/* Column spans carry the rhythm; the small vertical offsets are what makes it read as
   pinned rather than laid out. */
.b-a { grid-column: span 5; --tilt: var(--tilt-1); }
.b-b { grid-column: span 4; --tilt: var(--tilt-2); margin-top: clamp(24px, 4vw, 64px); }
.b-c { grid-column: span 3; --tilt: var(--tilt-3); margin-top: clamp(8px, 1.6vw, 22px); }
.b-d { grid-column: span 4; --tilt: var(--tilt-4); }
.b-e { grid-column: span 5; --tilt: var(--tilt-3); margin-top: clamp(0px, 1vw, 16px); }
.b-f { grid-column: span 3; --tilt: var(--tilt-2); margin-top: clamp(20px, 3vw, 48px); }

/* A written note, not a photograph. */
.note {
  padding: clamp(20px, 2.2vw, 30px);
  border-radius: var(--print-radius);
  rotate: var(--tilt, 0deg);
  box-shadow: var(--print-shadow);
  background: var(--brand-tint);
  color: var(--brand-deep);
}
.note.gold { background: var(--gold-tint); }
.note p {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.12;
  font-size: clamp(21px, 2vw, 29px);
  margin: 0;
  text-wrap: balance;
}
.note .hand {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.1;
  color: var(--brand);
  display: block;
  margin-bottom: 10px;
}

/* ---------- the relay: one sticky sequence, the only scroll-driven thing on the page ---------- */
.relay {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  background: var(--brand-deep);
  color: #fff;
}
.relay-walls { position: sticky; top: 0; height: 100svh; align-self: start; overflow: hidden; }
/* margin:0 is load-bearing — the UA default figure margin is `1em 40px`, which
   pushed each frame 40px off-axis and overflowed the viewport at 320px. */
.relay-frame { position: relative; height: 100%; width: 100%; margin: 0; }
.relay-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.relay-frame figcaption {
  position: absolute;
  inset: auto 20px 20px;
  background: color-mix(in srgb, var(--brand-deep) 88%, transparent);
  color: #fff;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.5;
}
.relay-lines > article {
  min-height: 100svh;
  padding: clamp(72px, 9vw, 112px) clamp(24px, 5vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}
.relay-lines .num {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .18em;
  color: var(--gold);
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .28);
}
/* These are sentences spoken to camera in her own film, set as sentences. */
.relay-lines blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.02;
  font-size: clamp(34px, 4.4vw, 66px);
  text-wrap: balance;
}
.relay-lines .who {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}

/* Without JS, and before JS runs, every wall is simply stacked and visible. */
.relay-walls { display: flex; flex-direction: column; }
body.motion-on .relay-walls { display: block; }
body.motion-on .relay-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
}
body.motion-on .relay-frame.is-active { opacity: 1; }

/* ---------- the three asks, as a tear-off strip ---------- */
.tearoffs {
  display: flex;
  border-top: 2px dashed var(--brand);
  background: var(--surface);
}
.tearoffs > a {
  flex: 1;
  min-width: 0;
  padding: clamp(24px, 3vw, 38px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  border-right: 2px dashed var(--brand);
  transition: background .18s;
}
.tearoffs > a:last-child { border-right: 0; }
.tearoffs > a:hover { background: var(--paper-2); }
.tearoffs strong {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.04;
  font-size: clamp(23px, 2.3vw, 31px);
  color: var(--brand-deep);
}
.tearoffs span { font-size: 1rem; color: var(--ink-2); max-width: 30ch; text-wrap: pretty; }
.tearoffs .go { margin-top: auto; align-self: flex-start; font-weight: 700; color: var(--coral-text); }

/* ---------- motion ---------- */
/* Page-load choreography runs once, so it sits above the 300ms interaction ceiling on
   purpose. Everything below animates transform, opacity or clip-path only. */
@keyframes line-in {
  from { clip-path: inset(0 0 102% 0); transform: translateY(14px); }
  to   { clip-path: inset(0 0 -2% 0);  transform: none; }
}
@keyframes print-in {
  from { clip-path: inset(6%); opacity: .55; }
  to   { clip-path: inset(0);  opacity: 1; }
}
body.motion-on .reveal-line { animation: line-in .74s var(--ease-out) both; animation-delay: var(--d, 0s); }
body.motion-on .reveal-print { animation: print-in 1.05s var(--ease-out) both; animation-delay: .18s; }

/* Scroll-driven polish, only where the browser supports it, and only as an addition to a
   state that is already correct without it. */
@supports (animation-timeline: view()) {
  body.motion-on .hero-print {
    animation: hero-settle linear both;
    animation-timeline: view();
    animation-range: exit 0% exit 85%;
  }
  @keyframes hero-settle { from { scale: 1; } to { scale: 1.03; } }
}

.motion-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}
.motion-toggle:hover { background: #fff; }

/* On a phone the fixed control sat on top of the hero's giving button. A floating
   control may overlay decoration; it may not overlay a call to action. Below 768
   it stops floating and lives at the end of the page instead. */
@media (max-width: 767px) {
  .motion-toggle {
    position: static;
    display: block;
    margin: 20px auto 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.motion-on .reveal-line,
  body.motion-on .reveal-print { animation: none; }
  body.motion-on .relay-frame { transition-duration: .2s; }
  html { scroll-behavior: auto; }
}

/* ---------- the film ---------- */
.film { margin: 0; position: relative; }
.film-shell {
  position: relative;
  background: var(--brand-deep);
  border-radius: var(--print-radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.film-shell > img, .film-shell > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.film-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
.film-play .disc {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--paper);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .55);
  transition: scale .18s var(--ease-out);
}
.film-play .disc svg { width: 30px; height: 30px; fill: var(--coral-cta); stroke: none; margin-left: 4px; }
.film-play:hover .disc { scale: 1.06; }
.film-play .sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.film figcaption {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 14px;
  line-height: 1.6;
}

/* ---------- the drawn faces ---------- */
/* 39 line portraits of the actual children and staff, drawn in one hand, already on a pale
   ground. They are the one image set that needs no veto, because a drawing of a child is
   not a photograph of a child. */
.faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 1vw, 16px); }

/* Each drawing is now real vector line, traced from her original, so it draws
   itself rather than fading in. Every path carries pathLength="1", which means
   stroke-dasharray works in normalised units and no JavaScript has to measure
   anything. --f is the drawing's place in the grid, --i the stroke's place in
   the drawing; together they make the hand move across the wall in order. */
.faces .face { display: block; width: 100%; aspect-ratio: 3 / 4; }
.faces .face path { fill: var(--ink); }

body.motion-on .faces .face path {
  fill: transparent;               /* a colour, so it can animate to ink */
  stroke: var(--ink);
  stroke-width: 10;                /* the traced group is scaled 0.1, so 10 = 1px */
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
body.motion-on .faces.is-drawn .face path {
  animation:
    ink-draw .85s cubic-bezier(.33, 0, .2, 1) forwards,
    ink-fill .3s ease-out forwards;
  animation-delay:
    calc(var(--f) * .16s + var(--i) * .006s),
    calc(var(--f) * .16s + var(--i) * .006s + .68s);
}
@keyframes ink-draw { to { stroke-dashoffset: 0; } }
@keyframes ink-fill { to { fill: var(--ink); } }

/* Reduced motion, or the pause control, and the drawings are simply already
   drawn — the base rule above is the finished state, not a hidden one. */
@media (prefers-reduced-motion: reduce) {
  body.motion-on .faces .face path {
    fill: var(--ink);
    stroke: none;
    stroke-dashoffset: 0;
    animation: none;
  }
}
@media (max-width: 767px) { .faces { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* visible to a screen reader, not to the eye */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#redraw-faces[disabled] { opacity: .5; cursor: default; }
#redraw-faces[disabled]:hover { background: transparent; color: var(--ink); border-color: var(--line-2); }

/* a content tag. NOT .needs — that class marks copy that is still missing, and
   borrowing it for finished content would make the unfinished markers unfindable. */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--brand-deep);
  background: var(--brand-tint);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-radius: 3px;
  padding: .3em .6em;
}

/* ---------- layout utilities ---------- */
/* These were inline grid styles. Inline wins over a media query, so at 320px the
   three- and four-column rows never collapsed and their words ran off the screen.
   Classes, so the breakpoints can actually reach them. */
.g2, .g3, .g4 { display: grid; gap: clamp(18px, 3vw, 44px); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 32px); }
.split { display: grid; gap: clamp(28px, 4vw, 64px); align-items: start; }
.split.hero { grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); }
.split.need { grid-template-columns: minmax(0, 1fr) minmax(0, .86fr); }
.split.stew { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; }
.split.faces-row { grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); }
.g3 > *, .g4 > *, .g2 > *, .split > * { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 1023px) {
  .split.hero, .split.need, .split.stew, .split.faces-row { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .b-a, .b-e { grid-column: span 7; }
  .b-b, .b-d { grid-column: span 5; }
  .b-c, .b-f { grid-column: span 5; }
  .relay { grid-template-columns: 1fr; }
  .relay-walls { height: 46svh; }
  .relay-lines > article { min-height: 68svh; scroll-margin-top: 46svh; }
  .relay-lines blockquote { font-size: clamp(30px, 5.4vw, 46px); }
}
@media (max-width: 767px) {
  .board-inner { gap: 22px 14px; }
  .b-a, .b-b, .b-c, .b-d, .b-e, .b-f { grid-column: span 6; margin-top: 0; }
  .b-a, .b-e { grid-column: span 12; }
  .tearoffs { flex-direction: column; }
  .tearoffs > a { border-right: 0; border-bottom: 2px dashed var(--brand); }
  .tearoffs > a:last-child { border-bottom: 0; }
  .snap.taped::before { width: 70px; height: 22px; top: -11px; }
  body.motion-on .relay-walls { display: flex; }
  body.motion-on .relay-frame { position: relative; opacity: 1; }
  .relay-walls { position: static; height: auto; }
  .film-play .disc { width: 64px; height: 64px; }
}
@media (max-width: 380px) {
  .b-a, .b-b, .b-c, .b-d, .b-e, .b-f { grid-column: span 12; }
}

/* ---------- crossing between pages (added 2026-09-22, Ben's motion choice 2) ---------- */
/* A cross-document fade, so moving from the home page to a sub-page does not blink white.
   Browsers without it navigate exactly as before; it is off when reduced motion is asked for.
   Its twin is in pages.css, which the seven other pages load. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
