/* thud.css — THUD's own layer over Frappuccino's material (frap.css). Loaded after it on both pages.
   It draws what is new to THUD and nothing of the engine's: the display type, the briefing's frame
   (First Light; thud-def.css dresses it), the ram in the drill and on Review's rest, Field mode (Night
   watch) and Low power, and a strategy's cover. THUD's hill, its village and its shelf of painted
   tiles left with THUD DEF's home (thud-def.css), and their rules with them (2026-10-10).
   Colour is written on frap.css's semantic tokens (the Carpathian palette is the default), so the
   contrast gate (scripts/verify_contrast.py) holds every ink here as it holds frap.css's.
   A literal white or gold below is a LIGHT (a window, a star, a spark), never an ink. */

:root {
  --display: "Literata", "Iowan Old Style", Georgia, serif;
  --win: 255, 206, 120;           /* a lantern's light (Review's rest) */
}

/* ── display type: Literata (TypeTogether, OFL; Ukrainian complete, in fonts/) for what is read as
   a title; the system face stays for the interface ───────────────────────────────────── */
.t-display { font-family: var(--display); font-size: clamp(34px, 9.6vw, 46px); line-height: 1.04; font-weight: 600; letter-spacing: -.022em; }
.t-display--s { font-size: clamp(27px, 7.4vw, 34px); line-height: 1.08; }
.t-large, .t-title, .t-head, .phead h1, .sheet .t-title, .sheet h2, .ss__head h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.018em; }

/* ── THE COMPANION's two motions: it breathes, and it arrives on a spring (the drill's peek, Review's rest, the Debrief) */
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.022); } }
@keyframes arrive { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }

/* ── FIRST LIGHT ─────────────────────────────────────────────────────────────────────── */
.fl { position: relative; }
/* the briefing ends at the foot of the screen (2026-11-09): the view's foot is room for the tab bar, away while it is up,
   and each step fills the screen itself (.fl__step); it scrolled 116 px of nothing on a phone */
#view:has(> .fl) { padding-bottom: 0; }
.fl__world { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.fl__world img { width: 100%; height: 100%; object-fit: cover; object-position: center 70%; transform: scale(1.06); filter: saturate(1.05); }
.fl:not([data-step="1"]) .fl__world img { object-position: center 96%; transform: scale(1.18); transform-origin: 50% 100%; }
.fl__world::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--ground-rgb), .15) 0%, rgba(var(--ground-rgb), .2) 40%, rgba(var(--ground-rgb), .82) 78%, var(--ground) 100%); }
.fl[data-step="1"] .fl__world::after { background: linear-gradient(180deg, rgba(var(--ground-rgb), .05) 0%, rgba(var(--ground-rgb), .1) 50%, rgba(var(--ground-rgb), .88) 80%, var(--ground) 100%); }
.fl__step { display: none; flex-direction: column; min-height: calc(100dvh - var(--sat) - var(--sab) - 40px); }
.fl[data-step="1"] .fl__step[data-s="1"], .fl[data-step="2"] .fl__step[data-s="2"],
.fl[data-step="3"] .fl__step[data-s="3"], .fl[data-step="4"] .fl__step[data-s="4"], .fl[data-step="6"] .fl__step[data-s="6"] { display: flex; animation: fl-in .6s var(--ease-out) both; }
@keyframes fl-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.fl__hello { justify-content: flex-end; text-align: left; }
.fl__sub { margin-top: 12px; color: var(--ink-2); max-width: 22em; }
.fl__go { margin-top: 26px; padding-bottom: 6px; }
.fl__fine { margin-top: 14px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.fl__who, .fl__level, .fl__ready { padding-top: 8px; }
.fl__who .eyebrow, .fl__level .eyebrow { margin: 8px 0 10px; }
.fl__rows { display: grid; gap: 10px; margin-top: 22px; }
.who { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px 12px 12px; text-align: left; color: inherit; font: inherit; border: 0; cursor: pointer; --r: var(--r-row); }
.who .art { --s: 52px; border-radius: 14px; }
.who__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.who__main b { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.who__main span { font-size: 14px; color: var(--ink-2); }
.who:active { transform: scale(.98); }
.fl__back { display: inline-flex; align-items: center; gap: 4px; margin: 18px auto 0; padding: 10px 14px; min-height: 44px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 15px; cursor: pointer; }
.fl__back .i { width: 18px; height: 18px; }
.fl__note { margin-top: 10px; }
.fl__level .levels { margin-top: 18px; }
.fl__go--stick { position: sticky; bottom: calc(var(--sab) + 8px); margin-top: auto; padding-top: 18px; text-align: center; }
/* the list scrolls under Continue and Back: a ground fades in behind them, so a level under them is not read
   through them (LEVELS.md box 7, 2026-10-09: the switcher's line put «Back» over «Mastery» at 428×746) */
.fl__go--stick { z-index: 1; isolation: isolate; }
.fl__go--stick::before { content: ''; position: absolute; z-index: -1; pointer-events: none;
  inset: 0 -16px calc(-8px - var(--sab)) -16px;
  background: linear-gradient(180deg, rgba(var(--ground-rgb), 0) 0%, rgba(var(--ground-rgb), .9) 30%, var(--ground) 62%); }
.fl__ready { justify-content: flex-end; text-align: center; align-items: center; }
.fl__joy { width: min(70vw, 330px); height: auto; margin-bottom: 8px; -webkit-mask: linear-gradient(180deg, #000 78%, transparent 99%); mask: linear-gradient(180deg, #000 78%, transparent 99%); filter: drop-shadow(0 24px 36px rgba(0, 0, 0, .45)); animation: leap 1.1s var(--spring) both; }
@keyframes leap { 0% { opacity: 0; transform: translateY(120px) scale(.8); } 60% { opacity: 1; transform: translateY(-14px) scale(1.03); } 100% { transform: none; } }
.fl__ready .fl__sub { margin-left: auto; margin-right: auto; }
.fl__ready .fl__go { width: 100%; }
/* THE OPENING'S FACTS AND ITS FIRST DAY (frap-open.js, 2026-11-16; COURSE.md §6). The welcome's «what is inside» and
   Ready's «your plan»: a number in the display face over its name in the caps, a hairline between two, no motion of
   their own (the step's own rise carries them; Field mode, Low power and reduced motion have nothing to still). The
   term stands before its number for a reader (dt, dd) and under it for the eye (column-reverse). Ready's arms give
   way by the screen's height, so the first day, the plan, the name and «Start» stand on one screen at 428×746. */
.fl__facts { display: flex; margin: 16px 0 0; padding: 0; }
.fl__fact { display: flex; flex-direction: column-reverse; gap: 3px; min-width: 0; padding: 0 16px; border-left: 1px solid rgba(var(--tint), .2); }
.fl__fact:first-child { padding-left: 0; border-left: 0; }
.fl__fact dd { margin: 0; font-family: var(--display); font-size: clamp(20px, 5.6vw, 26px); font-weight: 600; line-height: 1.05; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fl__fact dt { font-family: var(--caps); font-weight: 700; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.fl__ready .fl__facts { justify-content: center; margin-top: 14px; }
.fl__ready .fl__fact:last-child { padding-right: 0; }
.fl__plan { width: min(100%, 300px); margin: 10px auto 0; }
.fl__plan:empty, .fl__given:empty { display: none; }
.fl__plan .ofig { max-width: none; margin: 0; }
.fl__given { width: 100%; }
.fl__change { margin: 10px 0 0; color: var(--ink-3); font-size: 12.5px; }
.brief .fl__ready .fl__joy { width: auto; height: clamp(104px, calc(100dvh - 612px), 330px); max-width: min(60vw, 290px); object-fit: contain; }

/* ── THE COMPANION IN THE DRILL: the bird peeks over the card's top edge (thud.js places it) ── */
.peek { position: absolute; z-index: 6; width: 84px; height: 64px; margin: -64px 0 0 -84px; pointer-events: none; opacity: 0; transform: translateY(26px); transition: opacity .35s ease, transform .6s var(--spring); }
.peek--on { opacity: 1; transform: none; }
/* his window: 80 px of room above for his leaps, 40 to the left, 10 to the right so he never runs past the screen's edge
   (a box past it lets a phone's page slide sideways: RAM.md R7), cut at the card's edge; his burst flies inside it */
.peek__ram { position: absolute; inset: -80px -10px 0 -40px; overflow: hidden; }
.peek__ram > .peek__burst { left: 82px; top: 99px; }
.fr-res__top:has(> .cheer) { overflow-x: clip; }
.peek__fig { position: absolute; left: 40px; top: 84px; width: 84px; transform-origin: 50% 70%; }
.peek__ram img { display: block; width: 100%; height: auto; transform-origin: 50% 70%; animation: breathe 3.6s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }

/* his moods (thud.js §3 draws thud-ram.js's): motions by the Web Animations API from wherever he stands; still under
   «Calm», reduced motion, Low power and Night watch; the horns' glow through a run of five, in the skin's light */
.peek--still .peek__ram img { animation: none !important; }
.peek__ram img { transition: filter .6s ease; }
.peek--glow .peek__ram img { filter: drop-shadow(0 0 7px var(--ram-glow, rgba(255, 186, 84, .8))) drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
[data-ram="steam"] { --ram-glow: rgba(255, 196, 110, .8); }
[data-ram="cyber"] { --ram-glow: rgba(70, 230, 255, .85); }
[data-ram="ray"] { --ram-glow: rgba(90, 240, 220, .85); }
[data-ram="west"] { --ram-glow: rgba(240, 186, 100, .85); }
[data-ram="silk"] { --ram-glow: rgba(130, 230, 185, .85); }
/* his size by the width (RAM.md §10): 84 px on a phone, 96 between, 112 on a desk */
@media (min-width: 561px) { .peek { scale: 1.14; transform-origin: 100% 100%; } }
@media (min-width: 1100px) { .peek { scale: 1.33; } }
/* on a phone the round's topic line keeps clear of him, on one line, so a card never moves for its length */
/* the topic's line stays centred (QUIZ.md 4d): the same room on both sides, so it never runs under him */
@media (max-width: 560px) { body.ram-on #card > #tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } body.ram-on #card > #tag.tag--clear { padding-left: 72px; padding-right: 72px; } body.ram-on #card > #tag.tag--long { padding-left: 0; padding-right: 76px; } }
/* (thud.js place(): clear only where he stands at the line's height; long, the room on his side only) */
html.ram-calm .cheer img { animation: none !important; }
.peek--still .peek__fig { animation: none !important; }
html.ram-calm .cheer .peek__burst, html.ram-calm .peek__burst { display: none; }
/* the petals: Petrykivka's colours, thrown from the bird on a run and at the end of a round */
.peek__burst { position: absolute; left: 50%; top: 30%; width: 0; height: 0; }
.petal {
  position: absolute; left: -5px; top: -7px; width: 10px; height: 14px; border-radius: 80% 0 80% 0; opacity: 0;
  animation: petal 1.1s var(--ease-out) var(--dl, 0s) both;
}
.petal.p0 { background: #e9c169; } .petal.p1 { background: #2f55c8; } .petal.p2 { background: #c8323a; } .petal.p3 { background: #e8b5a6; }
@keyframes petal {
  0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(.4); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); }
}

/* the end of a round: he stands at the arc's right, his mood the round's (thud.js) */
.fr-res__top { position: relative; }
.cheer { position: absolute; right: 0; top: 18px; width: 92px; height: 120px; pointer-events: none; z-index: 2; }
/* where no arc stands (Hear and write's end, 2026-11-17) he stood over the round's sentence, its head under his wings
   (Chrome read 1.1:1): there he stands in the tiles' empty third place, on the row's foot, under the sentence's plate
   (his tallest pose is 150 px at 92 wide, and over the gap it reached a calm skin's wider head: 1.2:1) */
.fr-res__top:not(:has(> .fr-arc)):has(+ .fr-tiles > .fr-tile:nth-child(2):last-child) > .cheer { top: auto; bottom: -86px; height: 98px; right: calc((100% - 20px) / 6 - 46px); }
.fr-res__top:not(:has(> .fr-arc)):has(+ .fr-tiles > .fr-tile:nth-child(2):last-child) > .cheer img { right: 0; width: auto; height: 100%; margin: 0 auto; }
.cheer img { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; -webkit-mask: linear-gradient(180deg, #000 80%, transparent 99%); mask: linear-gradient(180deg, #000 80%, transparent 99%); filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .4)); }
/* the bird (the stork since run 7, the firebird since 2026-11-11): it flies in from above and lands, wings still spread,
   for a strong round; walks in for a fair one; and settles beside a hard one; it breathes once arrived (RAM.md §8) */
.cheer--smile img { animation: arrive 1s var(--spring) .25s both, breathe 3.6s ease-in-out 1.3s infinite; }
.cheer--leap img { transform-origin: 50% 90%; animation: stork-land 1.25s cubic-bezier(.2, .8, .25, 1) .2s both, breathe 3.6s ease-in-out 1.6s infinite; }
@keyframes stork-land {
  0% { opacity: 0; transform: translate(46px, -86px) rotate(-12deg) scale(.7); }
  55% { opacity: 1; transform: translate(-4px, 6px) rotate(3deg) scale(1.02); }
  78% { transform: translate(0, -3px) rotate(-1deg); }
  100% { transform: none; } }
.cheer--stand img { animation: arrive 1.4s var(--ease-out) .3s both; -webkit-mask: linear-gradient(180deg, #000 82%, transparent 99%); mask: linear-gradient(180deg, #000 82%, transparent 99%); }
.cheer .peek__burst { top: 30%; left: 30%; }

/* ── NIGHT WATCH: a red veil, multiplied over everything, and a dimmer ───────────────── */
#watch-veil { display: none; position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; }
html[data-watch="on"] #watch-veil { display: block; background: #ff2a00; mix-blend-mode: multiply; }
html[data-watch="on"] #watch-veil::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .42); }
/* FIELD MODE'S INKS (THUD DEF, round two §4). Under the veil only red light is left, so an ink reads as
   well as its red is bright and a hue says nothing: the inks and the accent become warm, high-red
   values, and the still field's lights go out beneath them. verify_contrast.py prices every ink through the veil
   (its red and its dimmer, read from the two rules above) against the contract's own bars. Field
   mode is always the night register (frap-app.js milk()): Dawn's whites under the veil would light a face. */
html[data-watch="on"] {
  --ink: #ffffff; --ink-2: #f6eee8; --ink-3: #e6d6ca; --gauge-ink: #ffffff;
  --acc-ink: #ffdcc6; --wrong-ink: #ffd2c0;
  --acc-1: #ffe8dc; --acc-2: #ffd4bc; --acc-3: #ffbe9c; --acc-4: #ffa880; --on-acc: #160500;
}
html[data-watch="on"].no-field { background: var(--ground); }   /* Field mode holds the field (gate 8): its lights go out too */

/* ── LOW POWER: nothing idles; the frost becomes an opaque fill ──────────────────────── */
html[data-low="on"] .peek__ram img:not([class]) { animation: none !important; }
html[data-low="on"] .glass, html[data-low="on"] .opt-btn, html[data-low="on"] #card .prompt-box { background-color: var(--frost-off) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html[data-low="on"] .glass--strong { background-color: var(--frost-off-strong) !important; }

/* ── DONE FOR TODAY: the bird at rest, on the review's empty state ──────── */
.empty--rest { position: relative; overflow: hidden; padding-top: 8px; }
.empty--rest::before { content: ""; position: absolute; left: 50%; top: 36px; width: 220px; height: 160px; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--win), .22), transparent); pointer-events: none; }
.rest-ram { position: relative; display: block; width: min(62%, 240px); height: auto; margin: 0 auto 6px; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .4)); animation: breathe 4.6s ease-in-out infinite; transform-origin: 50% 100%; }
.rest-ram--stork { width: min(44%, 170px); animation: arrive 1s var(--spring) .1s both; -webkit-mask: linear-gradient(180deg, #000 80%, transparent 100%); mask: linear-gradient(180deg, #000 80%, transparent 100%); }   /* a figure the frame cut at its foot fades out there */

/* the moon on the home's header: Night watch in one tap */
.chip--watch { min-width: 44px; padding: 0 12px !important; justify-content: center; }
.chip--watch[aria-pressed="true"] { background: rgba(var(--acc-rgb), .18); box-shadow: inset 0 0 0 1px rgba(var(--acc-rgb), .55); color: var(--acc-ink); }

/* ── THE STRATEGY'S COVER: its painting full width under the bar, the title on its foot ── */
/* the words under it start clear of the painting's foot (2026-10-16, the owner: «in between the picture and the first
   word, there's no margin»): the title stands 92px into the painting, so a short one left the lede at its edge */
.phead { position: relative; display: block; margin: calc(-1 * (var(--sat) + 76px)) 0 18px; min-height: calc(min(52vh, 380px) + 8px); }
.phead .art {
  --s: auto; position: relative; z-index: 0; width: 100vw; height: min(52vh, 380px); margin-left: calc(50% - 50vw);
  border-radius: 0; box-shadow: none;
}
.phead .art img { object-position: center 42%; }
.phead .art::before { display: none; }
.phead .art > img + * { display: none; }
.phead::after {                            /* the painting melts into the page */
  content: ""; position: absolute; left: calc(50% - 50vw); width: 100vw; top: 0; height: min(52vh, 380px); pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--ground-rgb), .55) 0%, transparent 22%, transparent 48%, rgba(var(--ground-rgb), .7) 78%, var(--ground) 100%);
}
.phead__main { position: relative; z-index: 2; margin-top: -92px; padding: 0 2px; }
.phead h1 { font-size: clamp(32px, 9vw, 42px); line-height: 1.04; text-shadow: 0 2px 18px rgba(var(--shade), calc(.5 * var(--sk))); }
@media (min-width: 1100px) {
  .phead .art, .phead::after { width: calc(100% + 2 * var(--gutter)); margin-left: calc(-1 * var(--gutter)); left: calc(-1 * var(--gutter)); border-radius: 0 0 28px 28px; }
}

/* HOW THUD WORKS (FLOW.md F5): the sheet (frap.js howSheet), its «?» on Learn and the Grammar place, its way from the
   briefing's last step, and the card under Learn's hero naming the book until it has been opened once */
.chip--how { min-width: 44px; padding: 0 12px !important; justify-content: center; }
.fl__how { gap: 8px; margin-top: 4px; }
.how__half { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 12px; padding: 14px; border-radius: var(--r-tile, 18px); }
.how__day { grid-template-columns: minmax(0, 1fr); }
.how__half h3 { margin: 2px 0 8px; color: var(--acc-ink); }
.how__half p, .how__half li { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.how__half ul { margin: 4px 0 0; padding-left: 18px; }
.how__half b { color: var(--ink); font-weight: 650; }
.how__ic { display: grid; place-items: center; color: var(--acc-ink); background: rgba(var(--tint), .08); }   /* Reading with no cover of its skin: Learn's book */
.how__ic .i { width: 24px; height: 24px; }
.how__flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 !important; }
.how__flow span { padding: 3px 10px; border-radius: 999px; background: rgba(var(--tint), .08); box-shadow: inset 0 0 0 1px rgba(var(--tint), .14); color: var(--ink); font-size: 13px; font-weight: 600; }
.how__flow i { color: var(--ink-3); font-style: normal; }
.how__foot { margin: 14px 4px 0; }
.halves { display: flex; align-items: center; gap: 14px; margin: 14px 0 0; padding: 12px 16px; border-radius: var(--r-tile, 18px); color: inherit; text-decoration: none; }
.halves__main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.halves__main .caps { color: var(--acc-ink); }
.halves__main b { font-size: 15px; line-height: 1.3; font-weight: 650; }
.halves .i--chev { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
html[data-palette="steam"] .halves__main b { font-family: var(--display); font-weight: 700; }
/* on a desk Learn's header gives way to the sidebar (frap.css), but for the switch and the «?»: Words and the book stay
   one tap apart there too */
@media (min-width: 1100px) {
  .top--learn:has(.modes) { display: flex; justify-content: center; align-items: center; gap: 10px; }
  .top--learn:has(.modes) > :not(.modes):not(.chip--how):not(.chip--look) { display: none; }   /* THUD CORE: and the look's palette (frap-look.js) */
  .top--learn:has(.modes) .modes { order: 0; margin: 0; }
}

/* ── THE COMPANION IN THE TOP BAR (thud.js place(); the owner, 2026-10-17: «awkwardly placed … a bit aggressive»): a round face
   where the run's flame stood, beside its count; gentle moods (KF_BAR), and a ring of light for a run in place of a burst */
body.ram-bar.ram-on.twl-in-session #streak > svg { display: none; }
html body.ram-bar.ram-on.twl-in-session #frap-top #streak { padding-left: 36px !important; }   /* his slot, inside the bar's own room */
.peek.peek--bar { position: fixed; z-index: 30; width: 30px; height: 30px; margin: -15px 0 0 0; border-radius: 50%; overflow: hidden; scale: 1 !important; transform: none; background: rgba(var(--tint), .1); box-shadow: inset 0 0 0 1px rgba(var(--tint), .22); transition: opacity .4s ease, box-shadow .6s ease; }
.peek--bar .peek__ram { inset: 0; border-radius: 50%; }
.peek--bar .peek__fig { left: -10px; top: -3px; width: 50px; transform-origin: 50% 55%; }
.peek--bar .peek__ram img { animation: none; filter: none; }
.peek--bar .peek__burst { display: none !important; }
.peek--bar.peek--glow { box-shadow: inset 0 0 0 1.5px var(--ram-glow, rgba(255, 186, 84, .8)), 0 0 10px var(--ram-glow, rgba(255, 186, 84, .55)); }
.peek--bar.peek--pop { animation: ram-ring 1.1s ease-out; }
@keyframes ram-ring { 0% { box-shadow: inset 0 0 0 1px rgba(var(--tint), .22), 0 0 0 0 var(--ram-glow, rgba(255, 186, 84, .7)); } 40% { box-shadow: inset 0 0 0 1.5px var(--ram-glow, rgba(255, 186, 84, .9)), 0 0 0 7px rgba(0, 0, 0, 0); } 100% { box-shadow: inset 0 0 0 1px rgba(var(--tint), .22), 0 0 0 10px rgba(0, 0, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .peek--bar.peek--pop { animation: none; } }
html[data-watch="on"] .peek--bar.peek--pop { animation: none; }
