/* Walk With Me — the page is a contact sheet, so the surface is paper and the
   art is ink. Contrast comes from panel edges, the red band, and one full-bleed
   black frame, not from tinting text. Mobile is the design target: every rule
   here is written for a 390px viewport first and widened afterwards. */

@font-face {
  font-family: 'Hand';
  src: url('assets/fonts/ComicRelief-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --paper: #faf7f0;
  --paper-2: #f2ede1;
  --card: #fffdf8;
  --ink: #141414;
  --ink-2: #55504a;
  --ink-3: #8b857c;
  --band: #d8232a;
  --band-ink: #a3161c;
  --black: #0b0b0b;
  --rule: #1414141f;

  --hand: 'Hand', 'Comic Relief', 'Comic Sans MS', ui-rounded, sans-serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --pad: 1.15rem;
  --max: 44rem;
  --radius: 3px;
  --player-h: 4.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom, 0px));
  /* faint ruled paper, so the surface is a surface and not just a colour */
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 100% 2.75rem, 2.75rem 100%;
  background-position: 0 -1px;
}

h1, h2, h3, .hand { font-family: var(--hand); font-weight: 400; letter-spacing: .01em; }
p { margin: 0 0 1em; }
a { color: var(--band-ink); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--band); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.narrow { max-width: 32rem; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper);
  padding: .7rem 1rem; z-index: 100;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ---- masthead ------------------------------------------------------------ */
.masthead {
  border-bottom: 3px solid var(--ink);
  background: var(--card);
  padding: 1.6rem 0 1.3rem;
}
.masthead .kicker {
  font-family: var(--hand); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 .35rem;
}
.masthead h1 {
  font-size: clamp(2.5rem, 13vw, 4.6rem); line-height: .94; margin: 0 0 .1rem;
  text-transform: uppercase;
}
.masthead h1 .q { color: var(--band); }
.masthead .sub {
  font-family: var(--hand); font-size: clamp(1.05rem, 4.6vw, 1.35rem);
  line-height: 1.35; margin: .55rem 0 0; max-width: 26rem; color: var(--ink);
}
.meta-strip {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: 1rem;
  font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2);
  font-family: var(--hand);
}
.meta-strip span { display: inline-flex; align-items: center; gap: .35rem; }
.meta-strip span::before { content: ''; width: .45rem; height: .45rem; background: var(--band); border-radius: 50%; }

/* ---- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.9rem; padding: .6rem 1.1rem;
  font-family: var(--hand); font-size: 1rem; line-height: 1;
  background: var(--card); color: var(--ink); border: 2.5px solid var(--ink);
  border-radius: var(--radius); box-shadow: 3px 3px 0 var(--ink); cursor: pointer;
  text-decoration: none; transition: transform .09s ease, box-shadow .09s ease;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--band); color: #fff; border-color: var(--ink); }
.btn-ghost { box-shadow: none; border-width: 2px; }
.btn[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }

/* ---- section rhythm ------------------------------------------------------
   Widths and padding deliberately vary section to section so the page has a
   composition instead of one column of equal blocks. */
.section { padding: 2.6rem 0; }
.section-head { margin-bottom: 1.4rem; }
.section-num {
  font-family: var(--hand); font-size: .82rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--band-ink); margin: 0 0 .25rem;
}
.section-head h2 { font-size: clamp(1.7rem, 7.5vw, 2.5rem); line-height: 1.05; margin: 0; }
.section-head p { margin: .6rem 0 0; color: var(--ink-2); max-width: 34rem; }
.rule { height: 3px; background: var(--ink); border: 0; margin: 0; }

/* ---- panels -------------------------------------------------------------- */
.walk { padding-top: 1.6rem; }
.panel {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 #14141412;
  margin: 0 0 1.5rem;
  overflow: hidden;
  scroll-margin-top: 1rem;
}
.panel:nth-child(odd)  { transform: rotate(-.25deg); }
.panel:nth-child(even) { transform: rotate(.28deg); }
@media (prefers-reduced-motion: reduce) { .panel { transform: none !important; } }

.panel-head {
  display: flex; align-items: baseline; gap: .55rem;
  padding: .7rem .9rem .55rem; border-bottom: 2px solid var(--ink);
}
.panel-n {
  font-family: var(--hand); font-size: 1.05rem; color: var(--band-ink);
  min-width: 1.6rem;
}
.panel-head h3 { font-size: 1.15rem; margin: 0; flex: 1; }

.stage { position: relative; background: var(--paper); border-bottom: 2px solid var(--ink); }
.stage svg { display: block; width: 100%; height: auto; }
.stage svg { --paper: var(--card); --ink: #141414; --band: #d8232a; }
.fig-dim { opacity: .42; }
.sign-t { font-family: var(--hand); font-size: 19px; fill: var(--ink); stroke: none; }

/* Speech lives in the sky the stage reserves for it, stacked in order, so no
   bubble ever covers a face regardless of how long the line runs. */
.bubbles {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: .35rem; padding: .6rem 3.5% .85rem;
}
.bubble {
  position: relative; max-width: 78%; margin: 0;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 14px;
  padding: .45rem .65rem; font-family: var(--hand); font-size: clamp(.84rem, 3.6vw, 1.02rem);
  line-height: 1.25; box-shadow: 3px 3px 0 #1414140f;
}
.bubble.left  { align-self: flex-start; }
.bubble.right { align-self: flex-end; }
/* outlined tail: ink wedge behind, card wedge in front */
.bubble::before, .bubble::after {
  content: ''; position: absolute; width: 0; height: 0; border: 8px solid transparent;
  display: none;
}
.bubble.tail::before, .bubble.tail::after { display: block; }
.bubble::after  { bottom: -16px; border-top-color: var(--ink); }
.bubble::before { bottom: -11px; border-top-color: var(--card); z-index: 1; border-width: 7px; }
.bubble.left::after  { left: 16%; }
.bubble.left::before { left: calc(16% + 1px); }
.bubble.right::after  { right: 16%; }
.bubble.right::before { right: calc(16% + 1px); }
.bubble .L { color: var(--band-ink); font-weight: 400; border-bottom: 2px solid var(--band); }
.panel[data-revealed='false'] .bubble { opacity: 0; transform: translateY(6px) scale(.97); }
.bubble { opacity: 1; transition: opacity .38s ease, transform .38s ease; }

.panel-foot { padding: .8rem .9rem 1rem; }
.caption { margin: 0; font-size: .98rem; }
.beat {
  margin: .6rem 0 0; font-family: var(--hand); font-size: .92rem;
  color: var(--band-ink); border-left: 3px solid var(--band); padding-left: .6rem;
}

/* ---- step meter ---------------------------------------------------------- */
.meter {
  position: sticky; top: 0; z-index: 30;
  background: var(--card);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 3px 0 #14141410;
}
.meter-in {
  display: flex; align-items: center; gap: .7rem;
  max-width: var(--max); margin-inline: auto; padding: .5rem var(--pad);
}
.meter-label { font-family: var(--hand); font-size: .85rem; white-space: nowrap; }
.meter-track { flex: 1; height: 8px; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--band); transition: width .35s ease; }
.meter-jump {
  font-family: var(--hand); font-size: .85rem; background: none; border: 0; cursor: pointer;
  color: var(--band-ink); padding: .4rem .2rem; text-decoration: underline;
}

/* ---- the reader's turn --------------------------------------------------- */
.turn {
  border: 3px dashed var(--ink); border-radius: var(--radius);
  background: var(--paper-2); padding: 1rem .95rem 1.1rem; margin: 0 0 1.5rem;
}
.turn h4 { font-family: var(--hand); font-size: 1.1rem; margin: 0 0 .2rem; }
.turn .turn-tag {
  font-family: var(--hand); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--band-ink); margin: 0 0 .4rem;
}
.opts { display: grid; gap: .55rem; margin-top: .85rem; }
.opt {
  text-align: left; font: inherit; font-size: .97rem; line-height: 1.4;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
  padding: .7rem .8rem; cursor: pointer; min-height: 2.9rem;
  box-shadow: 3px 3px 0 #14141412; transition: transform .09s ease, box-shadow .09s ease;
}
.opt:active { transform: translate(3px, 3px); box-shadow: none; }
.opt[aria-pressed='true'] { background: var(--ink); color: var(--paper); box-shadow: none; transform: translate(3px, 3px); }
.opt[aria-pressed='true'] .L { color: #ff9a9e; border-color: #ff9a9e; }
.turn-reply {
  margin: .9rem 0 0; font-family: var(--hand); font-size: 1rem; line-height: 1.35;
  border-left: 3px solid var(--band); padding-left: .65rem;
}
.turn-reply[hidden] { display: none; }

/* ---- full-bleed black frame (storyboard frame 10) ------------------------ */
.blackframe { background: var(--black); color: #f6f2ea; padding: 3.4rem 0 3.6rem; }
.blackframe .inner { max-width: 34rem; margin-inline: auto; padding-inline: var(--pad); }
.blackframe p.line {
  font-family: var(--hand); font-size: clamp(1.4rem, 6.4vw, 2.1rem); line-height: 1.3;
  margin: 0 0 .35rem;
}
.blackframe .punch {
  font-family: var(--hand); font-size: clamp(2.3rem, 12vw, 3.8rem); line-height: 1.05;
  margin: 1.5rem 0 0; color: #fff;
}
.blackframe .punch::after { content: ''; display: block; width: 4.5rem; height: 4px; background: var(--band); margin-top: 1rem; }

/* ---- tagline card -------------------------------------------------------- */
.tagline { padding: 3rem 0; text-align: center; }
.tagline .main {
  font-family: var(--hand); font-size: clamp(1.3rem, 5.6vw, 1.9rem); line-height: 1.35;
  max-width: 26rem; margin-inline: auto;
}
.tagline hr { width: 6rem; border: 0; border-top: 2px solid var(--ink); margin: 1.4rem auto; }
.tagline .sub { font-family: var(--hand); color: var(--ink-2); margin: 0; line-height: 1.4; }

/* ---- the six moves ------------------------------------------------------- */
.moves { display: grid; gap: .8rem; }
.move {
  background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: 4px 4px 0 #14141410; overflow: hidden;
}
.move > summary {
  display: flex; align-items: center; gap: .7rem; cursor: pointer; list-style: none;
  padding: .85rem .9rem; min-height: 3rem;
}
.move > summary::-webkit-details-marker { display: none; }
.move-n {
  flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--band); color: #fff;
  display: grid; place-items: center; font-family: var(--hand); font-size: .95rem;
}
.move-t { font-family: var(--hand); font-size: 1.05rem; line-height: 1.2; flex: 1; }
.move-chev { flex: none; transition: transform .18s ease; color: var(--ink-2); }
.move[open] .move-chev { transform: rotate(90deg); }
.move-body { padding: 0 .9rem 1rem; border-top: 2px dotted var(--rule); }
.move-body p { margin: .8rem 0 0; font-size: .97rem; }
.move-tell { font-family: var(--hand); color: var(--band-ink); }
.move-link {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: .7rem;
  font-family: var(--hand); font-size: .9rem; background: none; border: 0; padding: .4rem 0;
  color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-style: dotted;
}

/* ---- label workbench ----------------------------------------------------- */
.bench {
  background: var(--paper-2); border-block: 3px solid var(--ink);
  padding: 2.4rem 0 2.6rem;
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.chip {
  font-family: var(--hand); font-size: .95rem; min-height: 2.6rem; padding: .45rem .8rem;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 99px; cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink); transition: transform .09s ease, box-shadow .09s ease;
}
.chip:active { transform: translate(2px, 2px); box-shadow: none; }
.chip[aria-pressed='true'] { background: var(--band); color: #fff; box-shadow: 2px 2px 0 var(--ink); }
.chip-note { margin: .7rem 0 0; font-size: .9rem; color: var(--ink-2); min-height: 1.4em; }
.custom { display: flex; gap: .5rem; margin-top: 1.1rem; flex-wrap: wrap; }
.custom label { flex: 1 1 12rem; font-family: var(--hand); font-size: .9rem; }
.custom input {
  width: 100%; margin-top: .3rem; font: inherit; font-size: 1rem; min-height: 2.9rem;
  padding: .5rem .7rem; background: var(--card); border: 2.5px solid var(--ink);
  border-radius: var(--radius); color: var(--ink);
}
.bench-preview {
  margin-top: 1.3rem; background: var(--card); border: 2.5px solid var(--ink);
  border-radius: var(--radius); padding: .9rem;
}
.bench-preview p { font-family: var(--hand); font-size: 1.05rem; margin: 0 0 .55rem; }
.bench-preview p:last-child { margin-bottom: 0; }
.bench-preview .who {
  display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); font-family: var(--sans);
}

/* ---- share tiles --------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-top: 1.2rem; }
@media (min-width: 30rem) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 46rem) { .tiles { grid-template-columns: repeat(5, 1fr); } }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  min-height: 5rem; padding: .7rem .4rem; text-align: center; text-decoration: none;
  background: var(--card); color: var(--ink); border: 2.5px solid var(--ink);
  border-radius: var(--radius); box-shadow: 3px 3px 0 #14141412; cursor: pointer;
  font-family: var(--hand); font-size: .82rem; line-height: 1.1;
  transition: transform .09s ease, box-shadow .09s ease, background .15s ease;
}
.tile:active { transform: translate(3px, 3px); box-shadow: none; }
.tile svg { width: 1.45rem; height: 1.45rem; fill: currentColor; }
.tile[data-done='true'] { background: var(--ink); color: var(--paper); }
.share-quote {
  font-family: var(--hand); font-size: 1.05rem; background: var(--card);
  border: 2.5px dashed var(--ink); border-radius: var(--radius); padding: .9rem; margin: 0;
}

/* ---- narration player ---------------------------------------------------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--card); border-top: 3px solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.player-bar {
  display: flex; align-items: center; gap: .6rem;
  max-width: var(--max); margin-inline: auto; padding: .55rem var(--pad);
  min-height: var(--player-h);
}
.play {
  flex: none; width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--band); color: #fff; border: 2.5px solid var(--ink); cursor: pointer;
  display: grid; place-items: center; box-shadow: 2px 2px 0 var(--ink);
}
.play svg { width: 1.3rem; height: 1.3rem; fill: currentColor; }
.play:active { transform: translate(2px, 2px); box-shadow: none; }
.player-mid { flex: 1; min-width: 0; }
.player-title {
  font-family: var(--hand); font-size: .95rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; display: block;
}
.player-sub { font-size: .74rem; color: var(--ink-2); display: flex; gap: .5rem; }
.seek {
  width: 100%; margin: .3rem 0 0; height: 1.2rem; -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer;
}
.seek::-webkit-slider-runnable-track { height: 6px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 99px; }
.seek::-moz-range-track { height: 6px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 99px; }
.seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 1.05rem; height: 1.05rem; margin-top: -.36rem;
  background: var(--band); border: 2px solid var(--ink); border-radius: 50%;
}
.seek::-moz-range-thumb { width: 1.05rem; height: 1.05rem; background: var(--band); border: 2px solid var(--ink); border-radius: 50%; }
.player-btn {
  flex: none; min-width: 2.75rem; min-height: 2.75rem; background: none; border: 0; cursor: pointer;
  color: var(--ink); display: grid; place-items: center; border-radius: var(--radius);
  font-family: var(--hand); font-size: .78rem;
}
.player-btn[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.player-btn svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }

.chapters {
  max-width: var(--max); margin-inline: auto; padding: 0 var(--pad) .9rem;
  max-height: 52vh; overflow-y: auto; border-top: 2px dotted var(--rule);
}
.chapters[hidden] { display: none; }
.chapters ol { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; }
.chap {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  font: inherit; font-size: .95rem; min-height: 2.9rem; padding: .5rem .6rem;
  background: var(--paper); border: 2px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.chap:hover { border-color: var(--rule); }
.chap[aria-current='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chap-n { font-family: var(--hand); font-size: .85rem; color: var(--band); min-width: 1.4rem; }
.chap[aria-current='true'] .chap-n { color: #ff8f95; }
.chap-t { flex: 1; }
.chap-d { font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chap[aria-current='true'] .chap-d { color: #b9b2a8; }

/* the caption line the narration is currently speaking */
.cue-live {
  max-width: var(--max); margin-inline: auto; padding: 0 var(--pad) .6rem;
  font-family: var(--hand); font-size: .95rem; line-height: 1.3; color: var(--ink-2);
}
.cue-live[hidden] { display: none; }
.cue-live b { color: var(--band-ink); font-weight: 400; }
.cue-hit { background: #ffe9a8; box-shadow: 0 0 0 .18em #ffe9a8; border-radius: 2px; }

/* ---- footer -------------------------------------------------------------- */
.foot { border-top: 3px solid var(--ink); background: var(--card); padding: 2rem 0 2.4rem; }
.foot .strap {
  font-family: var(--hand); font-size: clamp(1.15rem, 5.2vw, 1.6rem); text-align: center;
  margin: 0 0 1.4rem;
}
.foot .strap b { color: var(--band); font-weight: 400; }
.foot p { font-size: .87rem; color: var(--ink-2); }
.foot .links { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; font-size: .87rem; margin-bottom: .9rem; }

/* ---- reveal animation ----------------------------------------------------
   Gated on html.js, which an inline script in <head> sets. If the module fails
   to load or throws, nothing is ever hidden — the skit still reads. */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1); }
/* keep the taped-to-the-wall tilt after the reveal finishes */
.js .panel.reveal.in:nth-child(odd)  { transform: rotate(-.25deg); }
.js .panel.reveal.in:nth-child(even) { transform: rotate(.28deg); }
.js .reveal.in { transform: none; }
.js .panel.reveal.in:nth-child(odd)  { transform: rotate(-.25deg); }
.js .panel.reveal.in:nth-child(even) { transform: rotate(.28deg); }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: none; }
  .btn, .opt, .chip, .tile { transition: none; }
}

/* ---- wider screens ------------------------------------------------------- */
@media (min-width: 48rem) {
  :root { --pad: 2rem; }
  body { font-size: 1.1rem; }
  .section { padding: 3.6rem 0; }
  .panel { margin-bottom: 2rem; }
  .panel-head { padding: .9rem 1.1rem .7rem; }
  .panel-foot { padding: 1rem 1.1rem 1.2rem; }
  .moves { grid-template-columns: 1fr 1fr; align-items: start; }
  .bubble { font-size: 1.05rem; }
}
@media (min-width: 64rem) {
  .walk .panel:nth-child(3n+1) { margin-left: -3rem; }
  .walk .panel:nth-child(3n+2) { margin-right: -3rem; }
}

/* visually hidden but announced */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
