/* Spellscript's page: night purple, and lines of light in the game's own sign colours (scripts/game.gd
   SHAPE_COLORS), over the tower paintings from the title screen. Glow is kept for drawn light only (the slate and the
   sign glyphs), as in the game. Shares the fonts and the gold hairline with the first game's page
   (assets/landing.css) so it reads as the same family; shares no rules with it. The header and footer are the
   site's (assets/site-frame.css). */
@font-face {
  font-family: "Alegreya";
  src: url("../assets/fonts/Alegreya-Variable.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../assets/fonts/AlegreyaSans-Medium.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* Stand-ins sized to Alegreya's width, so text drawn before the fonts arrive takes the same room and does not jump
   when they swap in. Each weight has its own stand-in, because a bold drawn from the regular face is a different width.
   Sizes measured on the hero's words against Alegreya (headings 800, body 500, labels 700 drawn in Sans Medium), on
   Helvetica Neue; Arial, the stand-in where it is missing, is close enough at the same size. */
@font-face {
  font-family: "Alegreya Fallback";
  src: local("Georgia");
  font-weight: 400 600;
  size-adjust: 92%;
}
@font-face {
  font-family: "Alegreya Fallback";
  src: local("Georgia Bold"), local("Georgia-Bold");
  font-weight: 700 900;
  size-adjust: 80%;
}
@font-face {
  font-family: "Alegreya Sans Fallback";
  src: local("Helvetica Neue"), local("HelveticaNeue"), local("Arial"), local("ArialMT");
  font-weight: 400 600;
  size-adjust: 86%;
}
@font-face {
  font-family: "Alegreya Sans Fallback";
  src: local("Helvetica Neue Bold"), local("HelveticaNeue-Bold"), local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 700 900;
  size-adjust: 80%;
}

:root {
  --night: #120c24;
  --deck: #1b1434;
  --slate: #0d0819;
  --slate-glow: #1d1438;      /* the slate's lit middle; slate-fx.js paints the same gradient under its light */
  --hair: #c9a24a;
  --hair-faint: rgba(201, 162, 74, 0.35);
  --cream: #f3ead6;
  --ink: #e4ddd0;
  --muted: #b4abc9;
  --gold: #f2c14e;
  /* The sign colours, as the game draws each stroke (the loop and the squiggle share one there). spellscript.js reads
     them for the slate, by sign name. */
  --bolt: #ffd933;
  --shield: #4de6ff;
  --stun: #bf73ff;
  --parry: #ff73bf;
  --lance: #fff097;
  --finisher: #bf73ff;
  --unread: #8a8496;           /* a stroke the reader could not name */
  --gutter: 20px;
  --section: 64px;
  --max: 1120px;
  --fits-screen-px: calc(100svh - 120px);   /* the tallest a slate or clip may stand: the screen less room for words */
  --clip-aspect: 0.5625;      /* a recorded fight's width over its height (1080 x 1920) */
  --sky-strip-px: 128px;      /* the strip of five skies above the hours */
  --face-px: 76px;            /* an enemy's round portrait in the hours */
  --card-share: 74%;          /* on a phone, an open hour's card takes this much of the row, the next one peeking in */
  --card-aspect: 1.5;         /* a card's picture is half again as tall as it is wide (720 x 1080) */
  --picture-fade-in: 0.5s ease-out;   /* a picture fading in once it has loaded */
  --poster-crossfade: 0.8s ease-in-out;   /* a clip's still poster giving way to the clip itself */
  --slate-hint-fade: 0.4s ease-out;   /* the slate's opening words leaving as the first stroke starts */
  --sign-rail-px: 52px;       /* on a phone, the rail of signs beside the slate, and the list's glyph column under it */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--night); color: var(--ink);
  font: 500 1.125rem/1.55 "Alegreya Sans", "Alegreya Sans Fallback", system-ui, sans-serif;
}
img, video, canvas { display: block; max-width: 100%; }
/* A picture still loading is hidden, and fades in once it can be drawn whole, instead of popping in (spellscript.js
   sets these, and only on pictures that were not ready when the page was read, so nothing on screen blinks out). */
img.is-loading { opacity: 0; }
img.is-fading-in { transition: opacity var(--picture-fade-in); }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p, figure { margin: 0; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

h1, h2, h3 { font-family: "Alegreya", "Alegreya Fallback", Georgia, serif; color: var(--cream); margin: 0; font-weight: 800; line-height: 1.12; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); text-wrap: balance; }
.lede { max-width: 46ch; margin-top: 12px; }

/* The HUD's small-caps voice, for labels. */
.family, .soon, .hour h3 i {
  font: 700 0.8125rem/1.2 "Alegreya Sans", "Alegreya Sans Fallback", system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; font-style: normal;
}
.soon { color: var(--gold); }

/* ---------- The tower at dusk ---------- */
/* The site's header (--site-head-px, ../assets/site-frame.css) stands above the painting, and the two fill the screen. */
.hero { position: relative; overflow: hidden; min-height: min(100svh - var(--site-head-px) - env(safe-area-inset-top), 900px); display: grid; isolation: isolate; }
.hero .tower { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 100%; z-index: -1; }
/* The sky fades into the page's night at the foot, so the next section continues the painting. */
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 22%; background: linear-gradient(transparent, var(--night)); z-index: -1; }
.hero-copy {
  align-self: start; justify-self: center; display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: max(24px, env(safe-area-inset-top)) var(--gutter) 0; width: min(100%, 520px);
}
.family { color: var(--cream); text-decoration: none; padding-bottom: 4px; border-bottom: 1px solid var(--hair); }
.family:hover, .family:focus-visible { color: var(--gold); }
.hero .logo { width: min(80vw, 440px); height: auto; }
/* A dark halo behind the words keeps them readable over the bright sky; it is shadow, not glow. On a phone a
   feathered pool of night also lies behind them, calming the painting there: it reaches past the words by
   --shade-reach-x/-y, as padding the negative margin takes back, so the layout does not move. */
.hero h1 {
  --shade-reach-x: 70px; --shade-reach-y: 38px;
  font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.125rem); text-shadow: 0 1px 14px rgba(18, 12, 36, 0.8); /* unslop-ignore */
  padding: var(--shade-reach-y) var(--shade-reach-x); margin: calc(-1 * var(--shade-reach-y)) calc(-1 * var(--shade-reach-x));
  background: radial-gradient(closest-side, rgba(18, 12, 36, 0.88), rgba(18, 12, 36, 0.72) 45%, rgba(18, 12, 36, 0.38) 75%, rgba(18, 12, 36, 0));
}
.hero h1 span { display: block; }
.hero .soon { text-shadow: 0 0 2px rgb(18, 12, 36), 0 0 10px rgba(18, 12, 36, 0.95); } /* unslop-ignore */

/* ---------- The slate: draw a sign and it is named ---------- */
.slate-section { padding: var(--section) 0 0; }
.slate-layout { display: grid; gap: 24px; }
.slate { display: grid; gap: 12px; width: min(100%, 400px); justify-self: center; }
.slate canvas {
  width: 100%; height: auto; aspect-ratio: 1; touch-action: none; cursor: crosshair;
  background: radial-gradient(circle at 50% 50%, var(--slate-glow) 0, var(--slate) 70%); border: 1px solid var(--hair); border-radius: 4px;
}
/* The opening words sit over the slate and let every touch through to the canvas; they fade as the first stroke starts. */
.slate-board { position: relative; }
.slate-hint {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 0 12%; margin: 0;
  text-align: center; pointer-events: none; transition: opacity var(--slate-hint-fade);
}
.slate-hint b { font: 800 1.5rem/1.15 "Alegreya", "Alegreya Fallback", Georgia, serif; color: var(--cream); }   /* the same headline as .reading b, below */
.slate-hint span { color: var(--muted); }
.slate-hint.is-gone { opacity: 0; }
/* Empty until the first stroke, the reading takes no room; once it names a sign it keeps room for its longest
   words, so later readings do not move what lies below. The list below moves down once, on the first stroke. */
.reading:has([data-spell]:not(:empty)) { min-height: 4.6em; }
.reading b { display: block; font: 800 1.5rem/1.15 "Alegreya", "Alegreya Fallback", Georgia, serif; color: var(--sign, var(--cream)); }
.reading span { font-size: 1rem; line-height: 1.45; }

.signbook { display: grid; border-top: 1px solid var(--hair-faint); }
.signbook li {
  --sign: var(--cream);
  display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; align-items: start;
  padding: 12px 10px; border-bottom: 1px solid var(--hair-faint); border-left: 3px solid transparent;
}
.signbook li[data-sign="bolt"] { --sign: var(--bolt); }
.signbook li[data-sign="shield"] { --sign: var(--shield); }
.signbook li[data-sign="stun"] { --sign: var(--stun); }
.signbook li[data-sign="lance"] { --sign: var(--lance); }
.signbook li[data-sign="parry"] { --sign: var(--parry); }
.signbook li[data-sign="finisher"] { --sign: var(--finisher); }
.signbook svg { grid-row: span 2; width: 40px; height: 40px; overflow: visible; }
/* Drawn light, as the game draws strokes: the one place on the page that glows. */
.signbook path, .signbook circle {
  fill: none; stroke: var(--sign); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 3px var(--sign)); /* unslop-ignore */
}
.signbook .tap { fill: var(--sign); stroke: none; }
.signbook b { font: 800 1.1875rem/1.2 "Alegreya", "Alegreya Fallback", Georgia, serif; color: var(--cream); }
.signbook span { font-size: 1rem; line-height: 1.45; }
/* The sign the reader just named. */
.signbook li.lit { background: var(--deck); border-left-color: var(--sign); }
.signbook li.lit b { color: var(--sign); }

/* ---------- The slate on an upright phone: a rail of the six signs beside it ----------
   sign-rail.js sets .has-sign-rail on the slate's layout (phones only, not with reduced motion), gives each glyph
   a track from its place in the rail down to its place in its row, and sets each row's --row-reveal (0 to 1) as the
   row nears its glyph. The glyph is sticky in its track: it holds still on the screen until its row comes up and
   carries it off. The list moves only once, when the first reading opens room under the slate. */
.sign-track { display: contents; }  /* off the rail a track is no box, and the glyph is laid out as the page means */
.has-sign-rail.slate-layout { grid-template-columns: minmax(0, 1fr) var(--sign-rail-px); column-gap: 12px; }
/* The heading spans the rail too. */
.has-sign-rail .slate-words { display: contents; }
.has-sign-rail .slate-words > * { grid-column: 1 / -1; }
/* 400px is the slate's own widest (.slate, above); here it is also kept no taller than the screen. */
.has-sign-rail .slate { grid-column: 1; justify-self: start; width: min(100%, 400px, var(--fits-screen-px)); }
/* Room for a three-line reading in the narrower column, so naming a second sign does not push the list down. */
.has-sign-rail .reading:has([data-spell]:not(:empty)) { min-height: 6.1em; }
.has-sign-rail .signbook { grid-column: 1 / -1; border-top-color: transparent; }
/* A row: its words on the left, its glyph on the right, in the rail's column. The row's own lines and lit ground are
   drawn by ::before, so they can fade in with the words while the glyph (which is already showing) does not. It is
   set out by the row's own border widths (3px left, 1px below), so the drawn lines land where the real ones were. */
.has-sign-rail .signbook li, .has-sign-rail .signbook li.lit { grid-template-columns: minmax(0, 1fr) var(--sign-rail-px);
  column-gap: 0; padding-right: 0; position: relative; isolation: isolate; background: none; border-color: transparent; }
.has-sign-rail .signbook li::before { content: ""; position: absolute; z-index: -1; inset: 0 0 -1px -3px; pointer-events: none;
  border-bottom: 1px solid var(--hair-faint); border-left: 3px solid transparent; opacity: var(--row-reveal, 1); }
.has-sign-rail .signbook li:first-child::before { top: -1px; border-top: 1px solid var(--hair-faint); }
.has-sign-rail .signbook li.lit::before { background: var(--deck); border-left-color: var(--sign); }
.has-sign-rail .signbook b { grid-column: 1; grid-row: 1; opacity: var(--row-reveal, 1); }
.has-sign-rail .signbook span { grid-column: 1; grid-row: 2; opacity: var(--row-reveal, 1); }
.has-sign-rail .sign-track { display: block; position: absolute; right: 0; width: var(--sign-rail-px); pointer-events: none; }
.has-sign-rail .signbook svg { position: sticky; display: block; margin: 0 auto; border-radius: 6px;
  width: var(--sign-glyph-px); height: var(--sign-glyph-px); }   /* sign-rail.js sets the size: the list's, or less on a small phone */
/* In the rail a lit row's ground cannot be seen, so the glyph of the sign just named carries the light itself. */
.has-sign-rail .signbook li.lit svg { background: var(--deck); box-shadow: 0 0 0 1px var(--sign); }

/* ---------- Three recorded fights ---------- */
.duels { padding: var(--section) 0 0; }
.clips {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(72vw, 300px); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 28px var(--gutter) 4px; scroll-padding-inline: var(--gutter);
}
.clips::-webkit-scrollbar { display: none; }
.clips:focus-visible { outline: 2px solid var(--cream); outline-offset: -2px; }
.clips li { scroll-snap-align: start; display: grid; gap: 12px; align-content: start; }
.phone { position: relative; aspect-ratio: 1080 / 1920; border-radius: 20px; overflow: hidden; background: #000; border: 1px solid var(--hair); }
.phone video { width: 100%; height: 100%; object-fit: cover; }
/* spellscript.js lays the poster over its clip and takes it away, slowly, once the clip is playing underneath.
   .phone in front: it outranks the picture fade's own transition (img.is-fading-in), so the crossfade keeps its pace. */
.phone .clip-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none;
  transition: opacity var(--poster-crossfade); }
.phone .clip-poster.is-gone { opacity: 0; }
.clips p { font-size: 1rem; line-height: 1.45; }
.clips b { display: block; font: 800 1.1875rem/1.2 "Alegreya", "Alegreya Fallback", Georgia, serif; color: var(--cream); margin-bottom: 2px; }

/* ---------- The Long Night: one strip of sky, then the enemies hour by hour ---------- */
.night { padding: var(--section) 0 0; }
/* The five title paintings as thin slices, dusk to dawn: the night passing, told once. */
.sky-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-top: 24px; border-radius: 4px; overflow: hidden; }
.sky-strip li { position: relative; }
.sky-strip img { width: 100%; height: var(--sky-strip-px); object-fit: cover; object-position: 78% 34%; }  /* each painting's tower stands right of centre */
.sky-strip span {
  position: absolute; inset: auto 0 6px; text-align: center; color: var(--cream);
  font: 700 0.6875rem/1 "Alegreya Sans", "Alegreya Sans Fallback", system-ui, sans-serif; letter-spacing: 0.1em; text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(18, 12, 36, 0.9); /* unslop-ignore: a dark halo so the label reads over the sky */
}
.hours { display: grid; gap: 0; margin-top: 8px; }
.hour { position: relative; padding: 24px 0; border-bottom: 1px solid transparent; }
/* The line under each hour is drawn on its own, over the hour's own (unseen) border, so hour-cards.js can slide it
   down with what lies below while the hour opens. */
.hour::after { content: ""; position: absolute; inset: auto 0 -1px; border-bottom: 1px solid var(--hair-faint); }
/* Each hour opens (a native <details>) onto a painted card for each of its enemies; hour-cards.js turns each round
   portrait into its card and back. */
.hour summary { display: grid; gap: 16px; cursor: pointer; list-style: none; border-radius: 4px; }
.hour summary::-webkit-details-marker { display: none; }
.hour summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
/* iPhone Safari greys the whole title block for a moment on a tap; the hour answers the tap by moving instead. */
.hour summary { -webkit-tap-highlight-color: transparent; }
.up-close { justify-self: start; color: var(--gold); font: 700 0.8125rem/1 "Alegreya Sans", "Alegreya Sans Fallback", system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.up-close::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-3px) rotate(45deg); }
.to-close, details[open] .to-open { display: none; }
details[open] .to-close { display: inline; }
details[open] .up-close::after { transform: translateY(0) rotate(225deg); }
.hour summary:hover .up-close { color: var(--cream); }
/* A touch screen keeps :hover on whatever was last tapped, so the label would turn cream at the first tap and stay. */
@media (hover: none) { .hour summary:hover .up-close { color: var(--gold); } }
.hour h3 { font-size: 1.6rem; display: grid; gap: 4px; }
.hour h3 i { color: var(--gold); }
.foes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.foe { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; }
/* A portrait is its card's own picture, scaled and masked to a circle on the face. Where the face is on each card:
   --face-x and --face-y are its middle and --face-size its width, as shares of the picture's width and height (width,
   for the size). One rule per enemy, on its portrait and its card alike, so the two always agree. They are here and
   not in style attributes because the site's Content-Security-Policy (_headers) blocks inline styles.
   hour-cards.js reads them to widen the same mask over the same picture, so nothing changes but the size. */
[data-enemy="brute"] { --face-x: 0.42; --face-y: 0.195; --face-size: 0.43; }
[data-enemy="duelist"] { --face-x: 0.576; --face-y: 0.241; --face-size: 0.41; }
[data-enemy="keeper_dusk"] { --face-x: 0.449; --face-y: 0.182; --face-size: 0.449; }
[data-enemy="familiars"] { --face-x: 0.4; --face-y: 0.155; --face-size: 0.4; }
[data-enemy="warlock"] { --face-x: 0.485; --face-y: 0.32; --face-size: 0.4; }
[data-enemy="keeper_lamplight"] { --face-x: 0.52; --face-y: 0.29; --face-size: 0.4; }
[data-enemy="mirror_adept"] { --face-x: 0.52; --face-y: 0.21; --face-size: 0.42; }
[data-enemy="stone_warden"] { --face-x: 0.51; --face-y: 0.24; --face-size: 0.36; }
[data-enemy="keeper_midnight"] { --face-x: 0.54; --face-y: 0.34; --face-size: 0.4; }
[data-enemy="hexer"] { --face-x: 0.39; --face-y: 0.32; --face-size: 0.4; }
[data-enemy="mimic"] { --face-x: 0.5; --face-y: 0.43; --face-size: 0.42; }
[data-enemy="keeper_darkest"] { --face-x: 0.5; --face-y: 0.335; --face-size: 0.4; }
[data-enemy="tyrant"] { --face-x: 0.51; --face-y: 0.31; --face-size: 0.42; }
.foes .face { position: relative; display: block; width: var(--face-px); height: var(--face-px); border-radius: 50%;
  overflow: hidden; margin-bottom: 6px; }
.foes .face img { position: absolute; max-width: none;
  width: calc(var(--face-px) / var(--face-size)); height: calc(var(--face-px) / var(--face-size) * var(--card-aspect));
  left: calc(var(--face-px) * (0.5 - var(--face-x) / var(--face-size)));
  top: calc(var(--face-px) * (0.5 - var(--face-y) * var(--card-aspect) / var(--face-size))); }
.foes b { font: 800 1.0625rem/1.15 "Alegreya", "Alegreya Fallback", Georgia, serif; color: var(--cream); }
.foes .keeper .face { box-shadow: 0 0 0 2px var(--gold); }
.foes .keeper b { color: var(--gold); }
/* Before Dawn: the one hour with a single fight, so the Tyrant stands alone, beside the title. */
.hour-last summary { grid-template-columns: auto 1fr; column-gap: 20px; align-items: center; }
.hour-last h3, .hour-last .last-word, .hour-last .up-close { grid-column: 2; }
/* The portrait spans the rows; the heading, its line and the cue sit together beside its middle. */
.hour-last h3 { align-self: end; }
.hour-last .up-close { align-self: start; }
.hour-last .foes { grid-column: 1; grid-row: 1 / span 3; grid-template-columns: 1fr; }
/* Open, the portraits are the cards, so on a phone they give up their row. The last hour's portrait keeps its column
   (empty), so its title, beside the portrait, never jumps left. */
.hour details[open] .foes { display: none; }
.hour-last details[open] .foes { display: grid; visibility: hidden; }

/* An open hour's cards. Phones: a row to swipe through, each most of the screen wide; wider screens set them side by
   side (below). The card's gilt and plate colours are set on the card itself, so a copy floated out of this row by
   hour-cards.js keeps them. */
.foe-cards {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--card-share); gap: 14px; margin: 18px 0 0; padding: 6px 2px 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.foe-cards::-webkit-scrollbar { display: none; }
.foe-cards li { scroll-snap-align: center; }

/* The card: a bevelled gilt edge with cut corners, the art inside it, a name plate over the art's foot. */
.foe-card { --frame: #b98a3e; --frame-hi: #f2c14e; --plate: #120c24; --cut: 14px; position: relative; padding: 3px;
  background: linear-gradient(160deg, #6d4c22, var(--frame) 30%, #fbe3a0 50%, var(--frame) 70%, #5a3d18);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  filter: drop-shadow(0 12px 22px rgba(0,0,0,0.5)); transition: transform 0.25s ease; }
.foe-card-art { position: relative; aspect-ratio: 1 / var(--card-aspect); overflow: hidden; background: var(--plate);
  clip-path: polygon(calc(var(--cut) - 2px) 0, calc(100% - var(--cut) + 2px) 0, 100% calc(var(--cut) - 2px),
    100% calc(100% - var(--cut) + 2px), calc(100% - var(--cut) + 2px) 100%, calc(var(--cut) - 2px) 100%, 0 calc(100% - var(--cut) + 2px), 0 calc(var(--cut) - 2px)); }
.foe-card-art > img { position: absolute; inset: 0; width: 100%; height: 100%;
  transition: transform 0.6s ease, opacity var(--picture-fade-in); }   /* opacity: the fade-in, which this rule would override */
.foe-card-art::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(transparent 48%, rgba(18,12,36,0.7) 66%, var(--plate) 88%);
  box-shadow: inset 0 0 0 1px rgba(242,193,78,0.35), inset 0 0 40px rgba(0,0,0,0.5); }
@media (hover: hover) { .foe-card:hover { transform: translateY(-4px); } .foe-card:hover .foe-card-art > img { transform: scale(1.04); } }

.foe-card figcaption { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 0 14px 16px; display: grid;
  justify-items: center; gap: 6px; text-align: center; }
.foe-card .tag { font: 600 0.68rem/1.2 "Alegreya Sans", "Alegreya Sans Fallback", system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--frame-hi); opacity: 0.85; }
.foe-card .name { font: 800 1.35rem/1.05 "Alegreya", "Alegreya Fallback", Georgia, serif; color: var(--cream); text-shadow: 0 2px 10px #000; }
.foe-card .rule { width: 60%; height: 1px; background: linear-gradient(90deg, transparent, var(--frame-hi), transparent); margin: 2px 0; }
.foe-card .stats { display: flex; gap: 14px; font: 600 0.78rem/1 "Alegreya Sans", "Alegreya Sans Fallback", system-ui, sans-serif; color: var(--ink); }
.foe-card .stats b { color: var(--cream); font-weight: 800; }
.foe-card .answers { display: flex; gap: 8px; align-items: center; font: 600 0.7rem/1 "Alegreya Sans", "Alegreya Sans Fallback", system-ui, sans-serif; color: var(--ink); opacity: 0.9; }
.foe-card .sign { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, #2a1d48, #120c24); box-shadow: 0 0 0 1px var(--frame), 0 0 10px rgba(242,193,78,0.25); }
.foe-card .sign svg { width: 20px; height: 20px; fill: none; stroke: var(--frame-hi); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }

/* The hour's keeper: a brighter edge, a gem at the top, its title on the plate. */
.foe-card.keeper { background: linear-gradient(160deg, #8a5d1e, #f2c14e 30%, #fff1c4 50%, #f2c14e 70%, #7a5216); }
.foe-card.keeper::before { content: ""; position: absolute; z-index: 2; top: 0; left: 50%; width: 18px; height: 18px;
  transform: translate(-50%, -2px) rotate(45deg); background: radial-gradient(circle at 35% 35%, #ffd27a, #c2410c 70%);
  box-shadow: 0 0 0 2px #f2c14e, 0 0 14px rgba(255,170,60,0.8); }
.foe-card.keeper .name { color: var(--gold); }

/* While an hour opens or closes, hour-cards.js floats copies of its cards in a layer over the page: over everything,
   clipping nothing, never in the way of a tap. A holder glides, the round window inside it widens and the card inside
   that grows; the copy keeps the card's own look (cut corners, frame) but not its shadow or its hover, which the
   window would cut. */
/* The layer lies in the page (hour-cards.js sets its place: over the screen where the movement starts), so it scrolls
   with the page. Its sides are cut at the screen's edges: a copy gliding in from off the side (the third card, on a
   phone) would otherwise widen the page, and a phone's browser shifts the whole page to make room. */
.iris-layer { position: absolute; z-index: 30; pointer-events: none; overflow-x: clip; overflow-y: visible; }
/* The window the copies show through covers that screen, so hour-cards.js can cut its sides off in screen measures. */
.iris-window { position: absolute; inset: 0; }
.iris-holder { position: absolute; will-change: transform; }
.iris-aperture { position: absolute; border-radius: 50%; overflow: hidden; will-change: transform; }
.iris-steady { position: absolute; will-change: transform; }
.iris-holder .foe-card { filter: none; transition: none; }
/* A moving copy is a clone, which the fade never hears from: it shows its picture as soon as it has one. */
.iris-layer img.is-loading { opacity: 1; }

/* ---------- Coming soon ---------- */
.finale { margin-top: var(--section); background: var(--slate); border-block: 1px solid var(--hair); padding: 32px 0 36px; }
.finale .wrap { display: grid; justify-items: center; gap: 14px; text-align: center; }
/* 22.37%: iOS's icon corner radius, as a share of the side. */
.app-icon { width: 76px; height: 76px; border-radius: 22.37%; }
.finale p + p { margin-top: 6px; }
.finale a { color: var(--gold); text-underline-offset: 0.18em; }

/* ---------- Larger screens ----------
   Three steps. From 640 px wide (tablet portrait, a phone on its side): each hour is one row, its name beside its
   faces, the clips stand in one row and the slate beside its list, each sized so it fits the screen's height. Any screen on its
   side from 600 px: the hero puts the words beside the tower. From 900 px: the desktop layout. */
@media (min-width: 640px) {
  .slate-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "words words" "slate book"; column-gap: 32px; align-items: start; }
  .slate-words { grid-area: words; }
  .slate { grid-area: slate; width: min(100%, var(--fits-screen-px)); }
  .signbook { grid-area: book; }
  .clips { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; padding-inline: 0; gap: 20px; }
  .clips li { justify-items: center; }
  .clips p { width: 100%; }
  /* A clip is never taller than the screen: its width follows from the height left beside the caption. */
  .phone { width: min(100%, var(--fits-screen-px) * var(--clip-aspect)); }
  /* One hour a row, its name and cue to the left of its three faces, so an hour opened shows its cards full width
     beneath without pushing its neighbours about (two to a row left a hole beside an open one). */
  .hour summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); column-gap: 40px; align-items: center; }
  .hour summary h3 { align-self: end; }
  .hour summary .up-close { grid-column: 1; align-self: start; }
  .hour summary .foes { grid-column: 2; grid-row: 1 / span 2; }
  .hour-last summary { grid-template-columns: auto 1fr; }
  .hour-last summary .foes { grid-column: 1; grid-row: 1 / span 3; }
  .hour-last summary .up-close { grid-column: 2; }
  /* Open, the portraits keep their place beside the title (empty), so the title does not move when they come back. */
  .hour details[open] .foes { display: grid; visibility: hidden; }
  .foe-cards { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; gap: 18px; }
  .finale .wrap { grid-template-columns: auto auto; justify-content: center; text-align: left; gap: 22px; }
}
@media (min-width: 900px), (orientation: landscape) and (min-width: 600px) {
  .hero { padding: 0 max(var(--gutter), (100% - var(--max)) / 2); }
  .hero .tower { object-position: 50% 70%; }   /* the wide painting (index.html's <picture>): keep the crag, let the top sky go */
  .hero-copy { align-self: center; justify-self: start; justify-items: start; text-align: left; padding: 0; width: min(100%, 460px); }
  .hero .logo { width: min(44vw, 440px); }
  .hero h1 { padding: 0; margin: 0; background: none; }   /* the wide painting's open sky needs no pool of night */
}
@media (min-width: 900px) {
  :root { --section: 96px; --sky-strip-px: 180px; --face-px: 96px; }
  .slate-layout { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "words slate" "book slate"; column-gap: 64px; row-gap: 24px; }
  .slate { position: sticky; top: 24px; }
  .clips { gap: 32px; }
}
@media (min-width: 1500px) {
  .hero-copy { width: min(100%, 560px); }
  .hero .logo { width: 560px; }
  .hero h1 { font-size: 2.5rem; }
}
