/* ==========================================================================
   MATES HELPING MATES — wanted-poster stylesheet
   --------------------------------------------------------------------------
   Contents
     1. DESIGN TOKENS ... every colour, font and size knob lives here.
                          Light/dark values are paired with light-dark();
                          dark mode = same palette at night, lit by a lamp.
     2. THE WALL ......... the page background the poster is nailed to.
     3. THE POSTER ....... the paper sheet; torn edges are two CSS masks
                          intersected via nesting (.poster-clip tears
                          top/bottom, .poster tears left/right).
     4. HEADER ........... flags + wanted-style menu.
     5. HERO ............. WANTED headline, portrait slot, blurb, reward.
     6. SECTIONS ......... story / charges / posse / send word.
     7. FOOTER
     8. ANIMATION ........ keyframes, scroll reveals, reduced-motion.

   Conventions
     · Evergreen browsers only: native nesting, light-dark(), color-mix(),
      clamp(), aspect-ratio, CSS masks.
     · To retheme, edit section 1 only.
     · JS toggles [data-theme="light|dark"] on <html>; with no attribute
      the site follows the OS via `color-scheme: light dark`.
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* -- palette: light value first, night value second ---------------------- */
  --wall:        light-dark(#46331f, #08090e);  /* timber wall / night street  */
  --paper:       light-dark(#e9d8ab, #7a683f);  /* aged poster stock           */
  --ink:         light-dark(#382510, #190f04);  /* printer's sepia ink         */
  --ink-soft:    color-mix(in oklab, var(--ink) 72%, var(--paper));
  --accent:      light-dark(#8f2b1c, #7c2617);  /* stamp red                   */
  --rule:        color-mix(in oklab, var(--ink) 45%, var(--paper));

  /* -- lantern lighting: these go fully transparent in daylight -------------
     At night the page sits under a dark veil with a lantern-shaped hole in
     it, plus a warm glow blended over the lit patch. The lantern follows
     the pointer on desktop (script.js updates --lantern-x/y); on touch
     devices it is pinned to the viewport centre (media query below) so the
     poster stays lit as you scroll. */
  --veil:          light-dark(transparent, rgb(4 5 12 / .84));    /* the darkness  */
  --lantern-light: light-dark(transparent, rgb(255 199 110 / .20)); /* warm glow   */
  --lantern-x: 50%;
  --lantern-y: 45%;
  /* circle slightly narrower than the poster (--poster-max is 68rem) */
  --lantern-rx: min(30rem, 46vw);
  --lantern-ry: min(30rem, 46vw);
  /* how much of the lantern's radius stays fully lit before the shadow
     feathers in — bigger = a wider bright core, softer numbers = moodier */
  --lantern-lit: 45%;

  /* -- type ----------------------------------------------------------------- */
  --font-display: "Rye", "Playbill", "Copperplate", serif;
  --font-body:    "Special Elite", "Courier New", ui-monospace, monospace;

  /* -- geometry -------------------------------------------------------------- */
  --fray: 24px;                       /* depth of the torn edge (mask tiles)  */
  --fray-period: 460px;               /* distance before the tear repeats; the
                                         220-unit tiles stretch to this, so a
                                         bigger number = gentler, rarer jags */
  --poster-max: 68rem;
  --pad-inline: clamp(2.5rem, 7vw, 5.5rem);

  /* -- torn-edge mask tiles (opaque = paper survives) -------------------------
     Each tile repeats seamlessly along its edge (the curve starts and ends
     at the same offset). The line is mostly gentle bezier undulation with
     the odd sharp L-segment cluster — a rip or divot — like paper torn by
     hand rather than cut with pinking shears. To re-cut the tear, edit the
     path points (across stays within 0–24, along within 0–220). */
  --fray-left:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 220' preserveAspectRatio='none'%3E%3Cpath d='M24,0H8Q6,10,7,20Q9,30,7,40Q6,46,8,50L15,55,9,58,17,62,8,66Q4,78,6,90Q8,102,5,114Q3,126,7,136L11,140,6,143Q8,154,5,164Q4,172,6,178L3,183,9,187Q12,198,7,208Q6,214,8,220H24Z'/%3E%3C/svg%3E");
  --fray-right:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 220' preserveAspectRatio='none'%3E%3Cpath d='M0,0H16Q18,10,17,20Q15,30,17,40Q18,46,16,50L9,55,15,58,7,62,16,66Q20,78,18,90Q16,102,19,114Q21,126,17,136L13,140,18,143Q16,154,19,164Q20,172,18,178L21,183,15,187Q12,198,17,208Q18,214,16,220H0Z'/%3E%3C/svg%3E");
  --fray-top:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 24' preserveAspectRatio='none'%3E%3Cpath d='M0,24V8Q10,6,20,7Q30,9,40,7Q46,6,50,8L55,15,58,9,62,17,66,8Q78,4,90,6Q102,8,114,5Q126,3,136,7L140,11,143,6Q154,8,164,5Q172,4,178,6L183,3,187,9Q198,12,208,7Q214,6,220,8V24Z'/%3E%3C/svg%3E");
  --fray-bottom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 24' preserveAspectRatio='none'%3E%3Cpath d='M0,0V16Q10,18,20,17Q30,15,40,17Q46,18,50,16L55,9,58,15,62,7,66,16Q78,20,90,18Q102,16,114,19Q126,21,136,17L140,13,143,18Q154,16,164,19Q172,20,178,18L183,21,187,15Q198,12,208,17Q214,18,220,16V0Z'/%3E%3C/svg%3E");

  /* -- paper grain: faint turbulence noise, tiled -------------------------- */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");

  /* -- blotch: low-frequency turbulence remapped to sepia — the cloudy
        water-stain mottling over the whole sheet ---------------------------- */
  --blotch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='500' height='500'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.009 0.013' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.28 0 0 0 0 0.18 0 0 0 0 0.05 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='500' height='500' filter='url(%23b)' opacity='0.2'/%3E%3C/svg%3E");

  /* -- edge grime: handled and weathered around the perimeter --------------- */
  --grime: rgb(62 40 12 / .26);
}

/* JS-set explicit themes override the OS preference. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* Touch / no-hover devices: no pointer to follow, so the lantern hangs at
   the viewport centre and stays there while scrolling. It's a circle
   spanning the screen's larger side (50vmax radius); --lantern-lit is THE
   knob — the fraction of that radius at full brightness, so 70% lights at
   least 70% of the view before the bleed feathers out past the poster. */
@media (hover: none), (pointer: coarse) {
  :root {
    --lantern-x: 50%;
    --lantern-y: 50%;
    --lantern-rx: 50vmax;
    --lantern-ry: 50vmax;
    --lantern-lit: 70%;
  }
}

/* Typing the lantern coordinates lets them transition, so the light swings
   after the pointer like a carried lamp rather than snapping. Browsers
   without @property just skip the easing — everything else still works. */
@property --lantern-x { syntax: "<length-percentage>"; inherits: true; initial-value: 50%; }
@property --lantern-y { syntax: "<length-percentage>"; inherits: true; initial-value: 45%; }
:root { transition: --lantern-x .18s ease-out, --lantern-y .18s ease-out; }


/* ==========================================================================
   2. THE WALL
   ========================================================================== */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  /* Nothing should ever scroll sideways. Transforms (the stamp-in starts
     at scale 1.6; stamps, flags and un-revealed sections sit rotated)
     extend the scrollable area past the viewport on narrow screens, and
     phones will happily scroll into it. Declared twice on purpose:
     `hidden` is the fallback for browsers that don't know `clip` (which
     would otherwise drop the declaration and leave no constraint at all);
     `clip` then wins where supported and avoids creating a scroll
     container. Body gets the same pair so the transformed content is
     contained before it ever reaches the viewport's scroll region. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: hidden; /* see the html rule above */
  overflow-x: clip;
  padding: clamp(1rem, 4vw, 3.5rem) clamp(.5rem, 3vw, 2rem);
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--wall);
  background-image:
    var(--grain),
    /* timber plank seams */
    repeating-linear-gradient(90deg,
      rgb(0 0 0 / .18) 0 2px, transparent 2px 9rem),
    /* broad top-light on the wall */
    linear-gradient(180deg, rgb(255 255 255 / .05), transparent 40%);
}

/* The lantern, in two fixed viewport layers (both invisible in daylight
   because their colours are transparent there, and both pointer-events
   none). ::before is the darkness — a veil over everything with a soft
   lantern-shaped hole; the gradient's last colour extends to cover the
   whole viewport. ::after is the warm light itself, screen-blended over
   whatever the lantern falls on, flickering gently like a flame. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(
    ellipse var(--lantern-rx) var(--lantern-ry)
    at var(--lantern-x) var(--lantern-y),
    transparent var(--lantern-lit), var(--veil) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  mix-blend-mode: screen;
  background: radial-gradient(
    ellipse calc(var(--lantern-rx) * .85) calc(var(--lantern-ry) * .85)
    at var(--lantern-x) var(--lantern-y),
    var(--lantern-light), transparent 70%);
  animation: lantern-flicker 7s linear infinite;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

a { color: inherit; }

:focus-visible {
  outline: 3px double var(--accent);
  outline-offset: 3px;
}


/* ==========================================================================
   3. THE POSTER
   ========================================================================== */

/* The tear is an INTERSECTION of two masks, one per nesting level:
   .poster tears the left/right edges, .poster-clip tears the top/bottom.
   Because a child's rendering passes through its parent's mask, paper only
   survives inside all four tear lines — so at each corner the two torn
   edges simply meet, like a real sheet, with no overhangs or patches.
   Each mask is: two repeating tear strips + a solid band covering the
   middle (slightly oversized to avoid hairline seams). The drop shadow
   sits on the outermost wrapper so it hugs the final torn silhouette. */
.poster-shadow {
  max-width: var(--poster-max);
  margin-inline: auto;
  filter: drop-shadow(0 18px 30px rgb(0 0 0 / .45));
}

.poster-clip {
  mask-image: var(--fray-top), var(--fray-bottom), linear-gradient(#000 0 0);
  mask-repeat: repeat-x, repeat-x, no-repeat;
  mask-position: left top, left bottom, center;
  mask-size:
    var(--fray-period) var(--fray),
    var(--fray-period) var(--fray),
    100% calc(100% - 2 * var(--fray) + 4px);
}

.poster {
  position: relative;
  padding: calc(var(--fray) + 1.5rem) var(--pad-inline) calc(var(--fray) + 2rem);

  background-color: var(--paper);
  background-image:
    var(--grain),
    var(--blotch),
    /* grime bands hugging the torn perimeter, heaviest in the corners */
    linear-gradient(90deg,  var(--grime), transparent 5rem),
    linear-gradient(270deg, var(--grime), transparent 5rem),
    linear-gradient(180deg, var(--grime), transparent 4rem),
    linear-gradient(0deg,   var(--grime), transparent 4rem),
    radial-gradient(10rem 8rem at 0% 0%,     var(--grime), transparent 70%),
    radial-gradient(10rem 8rem at 100% 0%,   var(--grime), transparent 70%),
    radial-gradient(10rem 8rem at 0% 100%,   var(--grime), transparent 70%),
    radial-gradient(10rem 8rem at 100% 100%, var(--grime), transparent 70%),
    /* foxing stains and handling marks */
    radial-gradient(30rem 18rem at 15% 8%,  rgb(120 80 20 / .10), transparent 70%),
    radial-gradient(24rem 20rem at 88% 30%, rgb(110 70 15 / .08), transparent 70%),
    radial-gradient(34rem 26rem at 30% 85%, rgb(100 65 15 / .10), transparent 70%),
    radial-gradient(10rem 6rem  at 70% 60%, rgb(90 55 10 / .06),  transparent 70%);

  /* The torn edges: four seamlessly-tiling jagged strips plus a solid centre
     panel. Layers union together (mask-composite: add is the default), so
     the paper survives wherever any layer paints. */
  mask-image: var(--fray-left), var(--fray-right), linear-gradient(#000 0 0);
  mask-repeat: repeat-y, repeat-y, no-repeat;
  mask-position: left top, right top, center;
  mask-size:
    var(--fray) var(--fray-period),
    var(--fray) var(--fray-period),
    calc(100% - 2 * var(--fray) + 4px) 100%;
}

/* A soft vignette on the paper itself, in both themes. Night-time light
   and shade come entirely from the lantern layers on body::before/after. */
.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(130% 110% at 50% 25%, transparent 55%,
                              rgb(80 50 15 / .16) 100%);
}

/* The bent nail holding it up (the SVG lives in index.html). The shadow
   is a filter so it hugs the nail's actual silhouette, cast down-left as
   if lit from the upper right — kept tight so the hard edges stay hard. */
.nail {
  position: absolute;
  top: calc(var(--fray) + 2px);
  left: 50%;
  translate: -50% 0;
  width: 38px;
  height: 46px;
  rotate: -4deg;
  filter: drop-shadow(-2.5px 3.5px 1.5px rgb(0 0 0 / .5));
  z-index: 1;
}
.nail svg { display: block; width: 100%; height: 100%; }


/* ==========================================================================
   4. HEADER — flags + menu
   ========================================================================== */

.poster-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 1rem;
  padding-top: 1.5rem;
}

.flag {
  display: inline-block; /* width must bite even when not a grid item */
  width: clamp(3rem, 7vw, 4.5rem);
  filter: sepia(.45) saturate(.75) drop-shadow(2px 3px 3px rgb(0 0 0 / .35));
  transform-origin: 50% 0;
  animation: flag-wave 4.5s ease-in-out infinite alternate;
}
.flag img { display: block; width: 100%; height: auto; }
.flag--eureka { rotate: -2.5deg; }
.flag--aussie { rotate: 2.5deg; animation-delay: -2.2s; }

.poster-head__centre { text-align: center; }

.proclamation {
  margin: 0 0 .75rem;
  font-size: clamp(.65rem, 1.6vw, .8rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: clamp(.9rem, 3vw, 2.2rem);
  row-gap: .35rem;
  font-family: var(--font-display);
  font-size: clamp(.8rem, 2vw, 1.05rem);
  letter-spacing: .06em;

  a {
    position: relative;
    text-decoration: none;
    padding: .15em .1em;
    transition: rotate .25s ease, color .25s ease;
  }
  /* hand-inked underline that draws itself on hover */
  a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -.1em;
    height: 2px;
    background: currentColor;
    border-radius: 2px 40% 3px 50%;
    scale: 0 1;
    transform-origin: left;
    transition: scale .3s ease;
  }
  a:hover, a:focus-visible {
    rotate: -1.5deg;
    color: var(--accent);
    &::after { scale: 1 1; }
  }
  /* star separators between menu items (dropped when the menu wraps
     on narrow screens — a star stranded at a line start looks scrappy) */
  @media (min-width: 641px) {
    a + a::before {
      content: "★";
      position: absolute;
      left: calc(-.5 * clamp(.9rem, 3vw, 2.2rem));
      translate: -50% 0;
      font-size: .6em;
      color: var(--ink-soft);
      pointer-events: none;
    }
  }
}

.theme-toggle {
  font: inherit;
  font-size: 1.1em;
  /* a fixed square with the glyph grid-centred: guarantees a true circle
     and dead-centre icons regardless of padding, line-height or which
     fallback font supplies ◐ ☾ ☀ */
  inline-size: 2em;
  aspect-ratio: 1;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: none;
  border: 2px solid var(--ink);
  border-radius: 50%;
  rotate: 3deg;
  cursor: pointer;
  transition: rotate .25s ease, background-color .25s ease, color .25s ease;

  &:hover, &:focus-visible {
    rotate: -6deg;
    background-color: var(--ink);
    color: var(--paper);
  }
  &:active { scale: .92; }
}


/* ==========================================================================
   5. HERO
   ========================================================================== */

.hero { text-align: center; }

.hero__title {
  margin: 2.5rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.2rem, 13vw, 8rem);
  line-height: .95;
  letter-spacing: .08em;
  animation: stamp-in .7s cubic-bezier(.2, 1.6, .35, 1) .15s both;
}

.hero__sub {
  margin: .6rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3.6vw, 2rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  animation: fade-up .6s ease-out .45s both;
}

.hero__note {
  margin: .9rem 0 0;
  font-size: clamp(.75rem, 2vw, .95rem);
  letter-spacing: .12em;
  color: var(--ink-soft);
  animation: fade-up .6s ease-out .6s both;
}
/* rule lines either side of the note */
.hero__note::before { content: "—— "; }
.hero__note::after  { content: " ——"; }

/* -- the portrait: roughly the middle 30% of the hero ----------------------- */
.portrait {
  width: clamp(12rem, 32%, 21rem);
  margin: clamp(1.5rem, 4vw, 2.5rem) auto 0;
}

.portrait__frame {
  aspect-ratio: 4 / 5;
  padding: .5rem;
  border: 3px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 4px;
  /*background: color-mix(in oklab, var(--paper) 88%, var(--ink));*/
  background: #a28a62;
  box-shadow: inset 0 0 2.5rem rgb(60 35 5 / .25);
  rotate: -1deg;
  transition: rotate .4s ease;
}
.portrait:hover .portrait__frame { rotate: .5deg; }

/* The rider gets the etching treatment; contain (not cover) so the hat
   and stockwhip stay in frame — the PNG's transparency means there's no
   visible letterboxing, just paper. */
.portrait__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: sepia(.35) contrast(1.05);
}

.portrait figcaption {
  margin-top: .8rem;
  font-size: .8rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* -- blurb & reward ---------------------------------------------------------- */
.hero__blurb {
  max-width: 34ch;
  margin: clamp(1.8rem, 4vw, 2.8rem) auto 0;

  p {
    margin: 0;
    font-size: clamp(1.25rem, 3.4vw, 1.9rem);
    line-height: 1.45;
    text-wrap: balance;
  }
}

.hero__reward {
  display: inline-block;
  margin: clamp(2rem, 4.5vw, 3rem) auto 0;
  padding: .7em 1.4em;
  border: 4px double var(--accent);
  rotate: -2deg;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(.95rem, 2.6vw, 1.35rem);
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: rotate .3s ease, scale .3s ease;

  strong { font-weight: 400; }
  &:hover { rotate: 1deg; scale: 1.03; }
}


/* ==========================================================================
   6. SECTIONS
   ========================================================================== */

.divider {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin: clamp(2.5rem, 6vw, 4.5rem) auto;
  max-width: 36rem;
  color: var(--rule);

  &::before, &::after {
    content: "";
    flex: 1;
    border-top: 2px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    height: 3px;
  }
  span { font-size: 1.1rem; }
}

.sheet-section {
  max-width: 56ch;
  margin-inline: auto;
  text-align: center;

  h2 {
    margin: 0 0 1.2rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.7rem, 5vw, 2.6rem);
    letter-spacing: .12em;
    text-transform: uppercase;
    text-wrap: balance;
  }
  h2::before { content: "✦ "; color: var(--accent); }
  h2::after  { content: " ✦"; color: var(--accent); }

  p { line-height: 1.8; margin: 0 0 1.1em; }
}

.section-lede { color: var(--ink-soft); font-style: italic; }

/* -- the charges, set like a list of offences ------------------------------- */
.charges {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  text-align: left;
  counter-reset: charge;

  li {
    counter-increment: charge;
    padding: .8em 0 .8em 3.4em;
    position: relative;
    line-height: 1.7;
    border-top: 1px dashed var(--rule);

    &:last-child { border-bottom: 1px dashed var(--rule); }
    &::before {
      content: "No." counter(charge);
      position: absolute;
      left: 0;
      top: .9em;
      font-family: var(--font-display);
      font-size: .85em;
      color: var(--accent);
    }
  }
}

.fine-print {
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* -- posse cards -------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: clamp(1rem, 3vw, 1.8rem);
  margin-top: 2rem;
  text-align: center;
}

.card {
  padding: 1.5rem 1.2rem;
  border: 2px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 3px;
  background: color-mix(in oklab, var(--paper) 92%, var(--ink));
  transition: rotate .35s ease, translate .35s ease;

  &:nth-child(odd)  { rotate: -1deg; }
  &:nth-child(even) { rotate: 1deg; }
  &:hover { rotate: 0deg; translate: 0 -4px; }

  h3 {
    margin: 0 0 .8rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.15rem;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  p { margin: 0; font-size: .9rem; line-height: 1.7; }
}

/* -- send word ----------------------------------------------------------------- */
.telegram {
  font-style: normal;
  p { margin: 0 0 .6em; }
  a { text-decoration-style: dotted; text-underline-offset: .25em; }
  a:hover { color: var(--accent); }
}

.serious-note {
  max-width: 42ch;
  margin: 2rem auto 0;
  padding: 1.1em 1.4em;
  border: 2px solid var(--accent);
  color: color-mix(in oklab, var(--ink) 80%, var(--accent));
  font-size: .9rem;
  line-height: 1.8;

  strong { color: var(--accent); white-space: nowrap; }
}


/* ==========================================================================
   7. FOOTER
   ========================================================================== */

/* Same shape as the header: a flag either side, words in the middle. */
.poster-foot {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-top: 1.5rem;
  border-top: 3px double var(--rule);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: clamp(1rem, 3vw, 2rem);
  text-align: center;
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--ink-soft);

  p { grid-column: 2; margin: 0 0 .5em; }
  .flag { grid-row: 1 / span 2; }
  .flag:last-child { grid-column: 3; }
}


/* ==========================================================================
   8. ANIMATION
   ========================================================================== */

/* headline slams down like a rubber stamp */
@keyframes stamp-in {
  from { opacity: 0; scale: 1.6; rotate: -3deg; }
  70%  { opacity: 1; scale: .97; rotate: .5deg; }
  to   { scale: 1; rotate: 0deg; }
}

@keyframes fade-up {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: 1; translate: 0 0; }
}

/* flags stirring in a light breeze */
@keyframes flag-wave {
  from { transform: rotate(-1.6deg) skewX(-1deg); }
  to   { transform: rotate(1.6deg)  skewX(1.5deg); }
}

/* the lantern flame breathes, almost imperceptibly */
@keyframes lantern-flicker {
  0%, 100% { opacity: 1; }
  38%      { opacity: 1; }
  40%      { opacity: .82; }
  42%      { opacity: .95; }
  44%      { opacity: 1; }
  71%      { opacity: .9; }
  75%      { opacity: 1; }
}

/* Scroll reveals: elements with [data-reveal] start settled slightly low
   and askew; script.js adds .is-visible as they enter the viewport. */
[data-reveal] {
  opacity: 0;
  translate: 0 26px;
  rotate: .6deg;
  transition: opacity .7s ease-out, translate .7s ease-out, rotate .7s ease-out;

  &.is-visible {
    opacity: 1;
    translate: 0 0;
    rotate: 0deg;
  }
}
/* stagger cards inside a group */
.card.is-visible:nth-child(2) { transition-delay: .12s; }
.card.is-visible:nth-child(3) { transition-delay: .24s; }

/* No-JS / pre-JS safety net: never hide content unless the script arrived
   and can reveal it. script.js sets .js on <html> at startup. */
html:not(.js) [data-reveal] {
  opacity: 1;
  translate: 0 0;
  rotate: 0deg;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; translate: 0 0; rotate: 0deg; }
}
