/* WEBDEVCAVEMAN portfolio · R7 "the mage's book", static page (thread 9). No effects: they come section by section. */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 16px/1.6 var(--font-body); }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 12px; }
.skip:focus { top: 12px; }
.prop { outline: 1px dashed #E0533A; outline-offset: 2px; }   /* ?prop=1: copy proposals */
.stat { font-family: var(--font-head); font-variant-numeric: oldstyle-nums; }

.btn { display: inline-block; background: var(--cyan); color: var(--ink); font: 700 14px var(--font-sc); letter-spacing: .08em; padding: 13px 20px;
  border-radius: 3px; border: 0; text-decoration: none; cursor: pointer;
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease; }   /* developer 2026-11-18: hover transitions ≥ 300 ms everywhere */
.btn:not(:disabled):hover, .btn:focus-visible { background: #7FE1FF; box-shadow: 0 0 0 3px rgba(0, 194, 255, .28); }   /* flat 2D: lighter fill + soft ring */
.btn--sm { font-size: 13px; padding: 9px 14px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ===== nav: over the title page it is transparent and white (accepted hero layout); after the hero it gets paper ===== */
.nav { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: var(--nav-h); display: flex; align-items: center; gap: 22px;
  padding: 0 4vw; color: #F4F1EA; font: 700 13px var(--font-sc); letter-spacing: .12em;
  background-color: transparent; border-bottom: 1px solid transparent;
  /* paper fades in and out both ways (was an instant switch); text colour keeps the hero's .6s */
  transition: background-color .7s ease, border-color .7s ease, backdrop-filter .7s ease, color .6s ease; }
.nav.is-solid { background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); color: var(--text); border-bottom: 1px solid var(--rule); }
html[data-sketch] .nav:not(.is-solid) { color: #1B2433; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; transition: opacity .3s ease; }
.brand:hover { opacity: .72; }   /* thread 25: the last links without a hover (brand, weaknesses, IV preview window, privacy) */
.nav__links { margin-left: auto; display: flex; gap: 22px; }
.nav__links a { text-decoration: none; letter-spacing: .08em; }
.nav__links a, .lang button:not([aria-pressed="true"]) { text-decoration: underline 1px transparent; text-underline-offset: 4px; transition: text-decoration-color .3s ease, opacity .3s ease; }
.nav__links a:hover, .lang button:not([aria-pressed="true"]):hover { text-decoration-color: currentColor; opacity: 1; }
.lang { display: flex; align-items: center; gap: 4px; font: 600 12px var(--font-body); letter-spacing: 0; }
.lang button { background: none; border: 0; color: inherit; font: inherit; padding: 6px 4px; cursor: pointer; opacity: .75; }
.lang button[aria-pressed="true"] { opacity: 1; text-decoration: underline 2px var(--cyan); text-underline-offset: 5px; }
.nav .btn { white-space: nowrap; }
@media (max-width: 860px) { .nav__links { display: none; } .lang { margin-left: auto; } }
@media (max-width: 420px) { .nav { gap: 12px; } .nav .btn { font-size: 12px; padding: 8px 10px; letter-spacing: .04em; } .brand { gap: 8px; letter-spacing: .06em; } }

/* ===== title page (hero): layout 1:1 from review/hero-reveal.html, final (coloured) state ===== */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #0B111A; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 100% 50%; }
.hero__scrim { position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(7,9,13,.82) 0%, rgba(7,9,13,.62) 22%, rgba(7,9,13,.18) 40%, rgba(7,9,13,0) 50%),
  linear-gradient(180deg, rgba(7,9,13,.55) 0%, rgba(7,9,13,0) 14%); }
.hero__copy { position: absolute; z-index: 2; left: 4vw; top: 25%; max-width: min(36vw, 620px); color: #F4F1EA; }
.hero__eyebrow { font: 700 14px var(--font-sc); letter-spacing: .08em; color: var(--cyan); margin-bottom: 14px; }
.hero h1 { font: 800 clamp(34px, 4.6vw, 76px)/1.02 var(--font-head); text-shadow: 0 2px 18px rgba(0,0,0,.55); }
.hero__sub { margin: 14px 0 16px; font: 600 clamp(16px, 1.35vw, 21px)/1.4 var(--font-body); max-width: 42ch; color: #DCE6F0; text-shadow: 0 1px 10px rgba(0,0,0,.6); }
.hero__art { position: absolute; inset: 0; transform-origin: 72% 35%; }
/* reveal: the colour frame sits on the sketch behind one radial mask from the staff orb; soft 140 px edge = the front of the living water.
   --ox/--oy/--r are set by main.js; r = 0 hides the colour completely. The mask is dropped once the water has covered the hero. */
html[data-reveal] .hero__img--col {
  -webkit-mask-image: radial-gradient(circle at var(--ox) var(--oy), #000 calc(var(--r, 0px) - 140px), transparent var(--r, 0px));
          mask-image: radial-gradient(circle at var(--ox) var(--oy), #000 calc(var(--r, 0px) - 140px), transparent var(--r, 0px)); }
.hero__ring { display: none; position: absolute; left: var(--ox); top: var(--oy); width: calc(var(--r, 0px) * 2 - 140px); height: calc(var(--r, 0px) * 2 - 140px);
  transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid rgba(125,232,255,.9); opacity: var(--ro, 0); pointer-events: none;
  box-shadow: 0 0 22px 6px rgba(0,194,255,.45), inset 0 0 22px 4px rgba(0,194,255,.35); }
html[data-reveal] .hero__ring { display: block; }
/* the staff orb, alive (CSS only, desktop): the halo breathes; the core (a copy of the frame, masked to the inside of the sphere,
   feathered into the painted rim) turns slowly, so the painted whirl spins. Starts when the colour is in; off for RM and phones
   (on the phone crop the orb sits 51 px past the edge). */
.hero__orb { display: none; position: absolute; left: var(--ox); top: var(--oy); width: 0; height: 0; pointer-events: none; animation: orb-in 1.2s ease-out both; }
.hero__orb::before { content: ""; position: absolute; width: calc(var(--orb) * 3.6); height: calc(var(--orb) * 3.6); left: calc(var(--orb) * -1.8); top: calc(var(--orb) * -1.8);
  border-radius: 50%; background: radial-gradient(circle closest-side, rgba(170,240,255,.85) 40%, rgba(0,194,255,.45) 58%, rgba(0,194,255,.12) 78%, rgba(0,194,255,0) 100%);
  mix-blend-mode: screen; animation: orb-breathe 2.8s ease-in-out infinite alternate; }
.hero__orb i { position: absolute; width: calc(var(--orb) * 1.5); height: calc(var(--orb) * 1.5); left: calc(var(--orb) * -.75); top: calc(var(--orb) * -.75);
  border-radius: 50%; background: var(--orb-img) var(--bx) var(--by) / var(--dw) var(--dh) no-repeat;
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 72%); mask-image: radial-gradient(circle, #000 55%, transparent 72%);
  animation: orb-spin 14s linear infinite; }
@keyframes orb-in { from { opacity: 0; } }
@keyframes orb-breathe { from { opacity: .3; transform: scale(.85); } to { opacity: 1; transform: scale(1.25); } }
@keyframes orb-spin { to { transform: rotate(-360deg); } }
@media (min-width: 701px) and (prefers-reduced-motion: no-preference) { html:not([data-sketch]) .hero__orb { display: block; } }
/* ink → white as the water passes (flat colour fades, no motion) */
.hero__scrim { transition: opacity .6s; }
.hero__copy, .hero__eyebrow, .hero__sub, .hero h1 { transition: color .6s, text-shadow .6s; }
/* sketch state (also ?p=0): ink on paper */
html[data-sketch] .hero__scrim { opacity: 0; }
html[data-sketch] .hero__copy { color: #141B26; }
html[data-sketch] .hero__eyebrow { color: #0A7FB0; }
html[data-sketch] .hero h1 { text-shadow: none; }
html[data-sketch] .hero__sub { color: #2A3442; text-shadow: none; }
@media (max-width: 700px) {
  .hero { height: auto; min-height: 0; aspect-ratio: 4 / 5; }
  .hero__img { object-position: 80% 50%; }
  .hero__scrim { background: linear-gradient(180deg, rgba(7,9,13,.45) 0%, rgba(7,9,13,0) 16%, rgba(7,9,13,0) 42%, rgba(7,9,13,.9) 72%); }
  .hero__copy { left: 16px; right: 16px; top: auto; bottom: 18px; max-width: none; }
  .hero h1 { font-size: 34px; }
  .hero__sub { margin: 10px 0 16px; }
}

/* ===== chapter = a page of the book: margin (numeral + note) | text ===== */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.ch { padding: 96px 0 104px; border-top: 1px solid var(--rule); }
.page { display: grid; grid-template-columns: var(--margin-col) minmax(0, 1fr); gap: 28px; }
.margin { font: italic 400 15px/1.45 var(--font-head); color: var(--note); border-right: 1px solid var(--rule); padding-right: 16px; }
.margin .no { display: block; font: 700 40px/1 var(--font-head); font-style: normal; color: var(--cyan-big); margin-bottom: 8px; }
.chap { font: 700 14px var(--font-sc); letter-spacing: .1em; color: var(--cyan-ink); margin-bottom: 12px; }
.ch h2 { font: 800 clamp(30px, 3.6vw, 50px)/1.06 var(--font-head); color: var(--text); max-width: 21ch; margin-bottom: 14px; text-wrap: balance; }
.body { font-size: 17px; color: var(--text-2); max-width: 62ch; }
.body + p { margin-top: 14px; }
/* ===== "ink of the book": the page's one entrance language (thread 14). JS sets html.ink (not with RM) and adds
   .is-in once per element when it enters the view. Chapter head: the margin rule grows down, the numeral follows,
   the label and H2 are inked in from the left like a pen line, the lead paragraph fades in after. Boxes ([data-ink-box])
   shift in 14 px, one after another (--i). Flat 2D, transform / opacity / clip-path only. */
.ink .ch .page { position: relative; }
.ink .ch .margin { border-right-color: transparent; position: relative; }
.ink .ch .margin::after { content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 1px; background: var(--rule); transform: scaleY(0); transform-origin: top; transition: transform .7s cubic-bezier(.65,0,.35,1); }
.ink .ch .margin .no { opacity: 0; translate: 0 -6px; transition: opacity .4s ease .25s, translate .4s ease .25s; }
.ink .ch .chap, .ink .ch h2 { clip-path: inset(-10% 100% -10% 0); transition: clip-path .6s cubic-bezier(.65,0,.35,1) .15s; }
.ink .ch h2 { transition-delay: .3s; }
.ink .ch .page .body { opacity: 0; transition: opacity .6s ease .65s; }
.ink .ch .page.is-in .margin::after { transform: scaleY(1); }
.ink .ch .page.is-in .margin .no { opacity: 1; translate: 0 0; }
.ink .ch .page.is-in .chap, .ink .ch .page.is-in h2 { clip-path: inset(-10% -2% -10% 0); }
.ink .ch .page.is-in .body { opacity: 1; }
.ink [data-ink-box] { opacity: 0; translate: 0 14px; transition: opacity .55s ease calc(var(--i, 0) * 90ms), translate .55s cubic-bezier(.2,.7,.2,1) calc(var(--i, 0) * 90ms); }
.ink [data-ink-box].is-in { opacity: 1; translate: 0 0; }
@media (max-width: 700px) { .ink .ch .margin { border-bottom-color: var(--rule); } .ink .ch .margin::after { display: none; } }
.grp { font: 700 14px var(--font-sc); letter-spacing: .1em; color: var(--text-2); margin: 48px 0 16px; }
.link { font: 700 15px var(--font-sc); letter-spacing: .06em; color: var(--cyan-ink); text-decoration: underline 1px transparent; }
.link, .lk { text-underline-offset: 4px; transition: text-decoration-color .3s ease; }
.link:hover, .lk:hover { text-decoration-color: currentColor; }
@media (max-width: 700px) {
  .ch { padding: 56px 0 64px; }
  .page { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .margin { border-right: 0; border-bottom: 1px solid var(--rule); padding: 0 0 8px; }
  .margin .no { display: inline; font-size: 26px; margin-right: 8px; }
  .body { font-size: 16px; }
  .grp { margin: 36px 0 12px; }
}

/* ===== I · Raróg, phase 1: the glowing egg (thread 13). Pencil lines on the paper (multiply by day; a light-on-navy copy at night,
   screen), the ember is its own layer. Unlike the hero orb (cyan halo, scale, 2.8 s even): light only inside the shell, no scale,
   5.6 s uneven breath (rise 40 %, fall 60 %), deep red → amber. --heat 0–6 = the six "Cleared" ticks warming it (JS). ===== */
.egg { position: relative; float: right; width: 150px; margin: 4px -4px 10px 16px; shape-outside: ellipse(48% 46% at 55% 52%); shape-margin: 16px; --heat: 6; }
.egg img { display: block; width: 100%; height: auto; }
.egg__ln { mix-blend-mode: multiply; }
[data-theme="night"] .egg__ln { mix-blend-mode: normal; }   /* night file = silver line with alpha (w22-silver.py --rgba) */
[data-theme="night"] .egg .day, [data-theme="day"] .egg .night { display: none; }
.egg__em { position: absolute; inset: 0; opacity: calc(.4 + var(--heat) * .1); transition: opacity .5s ease; }
.egg figcaption { position: absolute; right: 0; top: -8px; font: 600 11px var(--font-sc); letter-spacing: .06em; color: var(--blue-text); white-space: nowrap; }
.egg.is-js { --heat: 0; }
@media (prefers-reduced-motion: no-preference) {
  .egg.is-js .egg__em img { animation: ember-breathe 5.6s ease-in-out infinite; animation-play-state: paused; }
  .egg.is-js.is-on .egg__em img { animation-play-state: running; }
  .egg.is-flare .egg__em { animation: ember-flare 1.2s ease-out; }
}
@keyframes ember-breathe {
  0%, 100% { opacity: .6; filter: brightness(.78) saturate(1.15) hue-rotate(-10deg); }
  40% { opacity: 1; filter: brightness(1.12) saturate(1.2) hue-rotate(6deg); }
}
@keyframes ember-flare { 0% { filter: brightness(1); } 25% { filter: brightness(1.35) saturate(1.15); } 100% { filter: brightness(1); } }
@media (min-width: 701px) { .egg { width: 170px; } }
@media (min-width: 701px) { #work .qlog { margin-top: 64px; } }   /* room under the egg before the frame's size mark */
@media (min-width: 1180px) {
  /* the egg gets its own column: the title and subtitle stop ~44 px before it */
  #work .page { position: relative; min-height: 190px; }   /* the egg (6 + 155 px) is taller than the title block */
  #work .page > div { padding-right: 264px; }
  .egg { position: absolute; right: 0; top: 6px; width: 220px; float: none; margin: 0; shape-outside: none; }
}

/* ===== plate = the colour engraving, wider than the text column. Placeholder until the section's media exist:
   paper with pencil hatching, a blue construction frame and a caption. ===== */
.plate { position: relative; margin-top: 36px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.plate--todo { background:
  repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in srgb, var(--graphite) 9%, transparent) 11px 12px), var(--paper-2); }
.plate--todo::before { content: ""; position: absolute; inset: 7%; border: 1.5px dashed var(--blue); }
.plate--todo::after { content: ""; position: absolute; left: 7%; right: 7%; top: 62%; border-top: 1.5px dashed var(--blue); }
.plate figcaption { position: absolute; z-index: 2; left: 12px; bottom: 10px; font: 600 12px var(--font-body); color: #fff; background: rgba(7,9,13,.65); padding: 4px 8px; border-radius: 2px; }
.plate--sketch { box-shadow: none; border: 1px solid var(--rule); }
.plate--tall { aspect-ratio: 4 / 5; }
.plate--card { aspect-ratio: 16 / 10; margin: 0; }
.plate--mini { aspect-ratio: 4 / 3; margin: 0; box-shadow: none; border: 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 700px) {
  .plate { aspect-ratio: 4 / 5; margin-top: 24px; }
  .plate--tall, .plate--card { aspect-ratio: 16 / 10; }
  .plate--mini { aspect-ratio: 4 / 3; }
}

/* ===== window (system panel on the page) ===== */
.win { background: var(--win); color: var(--win-text); border: 1px solid var(--cyan); border-radius: 2px; box-shadow: 0 0 18px rgba(0,194,255,.22); font-size: 14px; }
.win__bar { display: flex; align-items: baseline; gap: 8px; font: 700 13px var(--font-sc); letter-spacing: .08em; color: var(--cyan); padding: 10px 14px; border-bottom: 1px solid var(--win-line); }
.win__bar::before { content: "◆"; }
.win__host { margin-left: auto; font: 600 12px var(--font-body); letter-spacing: 0; color: #9FB0C4; }
.win .row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--win-line); }
.win .row:first-child { border-top: 0; }
.win dd { color: #7DE8FF; text-align: right; }

/* ===== I · quest log + The Mountain ===== */
.qlog { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; margin-top: 40px; align-items: start; }
.qlog__list { border-top: 1px solid var(--rule); }
.qlog__list button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 0 8px; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--rule); padding: 12px 10px; color: var(--text); font: 700 15px var(--font-body); cursor: pointer; }
.qlog__list small { grid-column: 1; font: 500 13px var(--font-sc); color: var(--text-2); }
.qlog__list .cleared { grid-column: 2; grid-row: 1 / 3; align-self: center; font: 700 12px var(--font-sc); color: var(--cyan-ink); }
.qlog__list button[aria-pressed="true"] { background: var(--paper-2); box-shadow: inset 3px 0 var(--cyan); }
.qlog__list button { position: relative; transition: background-color .3s ease, box-shadow .3s ease; }
.qlog__list button:not([aria-pressed="true"]):hover { background: var(--paper-2); box-shadow: inset 3px 0 var(--rule); }
/* ideas under the list (desktop: column 1 under the list, the window spans both rows; phone: under the window) */
.qlog { position: relative; grid-template-areas: "list view" "ideas view"; grid-template-rows: auto 1fr; }
.qlog__list { grid-area: list; } .qlog__view { grid-area: view; } .qlog__ideas { grid-area: ideas; padding-top: 10px; }
.qlog__ideas-h { font: 700 12px var(--font-sc); letter-spacing: .1em; color: var(--cyan-ink); margin-bottom: 10px; }
.qlog__idea { font: italic 400 16.5px/1.35 var(--font-head); color: var(--text-2); max-width: 214px; }
.qlog__idea + .qlog__idea { margin-top: 14px; }
.qlog__ideas.is-new p { animation: ink .35s ease both; }
@keyframes ink { from { opacity: 0; } }
/* construction lines (JS draws them in px): frame + width mark draw in once with the ticks, leaders follow the notes */
.qlog__frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.qlog__frame line { stroke: var(--blue); stroke-width: 1; }
.qlog__frame .x, .qlog__frame .y, .qlog__frame .lead line { stroke-dasharray: 6 6; }
.qlog__frame circle { fill: var(--blue); }
.qlog__frame text { font: 600 12px var(--font-sc); letter-spacing: .06em; fill: var(--blue); text-anchor: middle; }
.qlog__frame .x, .qlog__frame .y { transform-box: fill-box; transition: transform .8s cubic-bezier(.65, 0, .35, 1) var(--d); }
.qlog__frame .x { transform-origin: left; } .qlog__frame .x.end { transform-origin: right; }
.qlog__frame .y { transform-origin: top; } .qlog__frame .y.end { transform-origin: bottom; }
.qlog__frame .mark { transition: opacity .5s ease .6s; }
.qlog.is-js:not(.is-in) .qlog__frame .x { transform: scaleX(0); }
.qlog.is-js:not(.is-in) .qlog__frame .y { transform: scaleY(0); }
.qlog.is-js:not(.is-in) .qlog__frame .mark, .qlog.is-js:not(.is-in) .qlog__frame .lead { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .qlog__ideas.is-new p { animation: none; } }
/* auto-advance: a thin bar under the playing entry fills with the clip; ticks come in one by one on the first view (JS only) */
.qlog__bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; opacity: 0; }
.qlog.is-auto [aria-pressed="true"] .qlog__bar { opacity: 1; }
.qlog__bar i { display: block; height: 100%; background: var(--cyan); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .3s linear; }
.qlog.is-js:not(.is-in) .cleared { opacity: 0; transform: scale(.6); }
.qlog.is-js .cleared { transition: opacity .35s ease, transform .35s ease; transition-delay: calc(var(--i) * 90ms + 150ms); }
.qlog__pause { margin-left: 10px; background: none; border: 1px solid var(--win-line); color: #C8D3E0; font: 600 12px var(--font-body); padding: 2px 8px; border-radius: 2px; cursor: pointer; transition: border-color .3s ease, color .3s ease; }
.qlog__pause:hover, .qlog__pause:focus-visible { border-color: var(--cyan); color: #fff; }
@media (max-width: 599px) { .qlog__view .win__host { display: none; } .qlog__pause { margin-left: auto; } }
.qlog__screen { position: relative; aspect-ratio: 16 / 10; background: #000; overflow: hidden; }
.qlog__screen > * { width: 100%; height: 100%; object-fit: cover; }
.qlog__layer { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
.qlog__layer.is-on { opacity: 1; }
.qlog__layer img, .qlog__layer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) { .qlog__layer { transition: none; } }
.qlog__body { padding: 14px 16px 18px; display: grid; gap: 10px; color: #C8D3E0; font-size: 15px; }
.qlog__body b { display: block; font: 700 12px var(--font-sc); letter-spacing: .06em; color: var(--cyan); }
.mountain { margin-top: 48px; display: grid; background: #0B0F16; color: #F3EEE6; border: 1px solid #22405F; }
.mountain__shot img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.mountain__body { padding: clamp(20px, 3vw, 44px); align-self: center; display: grid; gap: 12px; }
.mountain__body > p { color: #B9C4D2; }
.mountain__label { font: 700 13px var(--font-sc); letter-spacing: .1em; color: var(--cyan) !important; }
.mountain h3 { font: 800 clamp(26px, 2.6vw, 36px)/1.1 var(--font-head); }
.mountain__note { font: italic 400 17px var(--font-head); }
@media (min-width: 900px) { .mountain { grid-template-columns: 1.3fr 1fr; } }
/* The Mountain: the cursor is the torch (JS sets --tx/--ty); without hover the light wanders (thread 3, accepted).
   Warm glow (screen) + a soft shade that only dims (.72); the radius flickers unevenly (8 s). Burns only while in view. RM: lit. */
@property --tx { syntax: "<length-percentage>"; inherits: true; initial-value: 50%; }
@property --ty { syntax: "<length-percentage>"; inherits: true; initial-value: 50%; }
@property --f { syntax: "<number>"; inherits: true; initial-value: 1; }
.mountain__shot { position: relative; overflow: hidden; --r: clamp(8rem, 17vw, 15rem); }
.mountain__shot::before, .mountain__shot::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  animation: torch 16s ease-in-out infinite alternate, flicker 8s ease-in-out infinite; animation-play-state: paused; }
.mountain.is-lit .mountain__shot::before, .mountain.is-lit .mountain__shot::after { animation-play-state: running; }
/* accent (developer 2026-11-15, "subtle, the torch sets the mood"): a warm torch-coloured hairline whose faint halo
   flickers with the same 8 s rhythm; the cyan window above stays the magic ink, The Mountain is fire. RM: still. */
.mountain { border-color: rgba(214, 122, 52, .6); box-shadow: 0 0 calc(14px * var(--f)) rgba(255, 140, 40, calc(.16 * var(--f))); }
.mountain.is-lit { animation: flicker 8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .mountain.is-lit { animation: none; } }
.mountain__shot::before { z-index: 1; mix-blend-mode: screen;
  background: radial-gradient(circle at var(--tx) var(--ty), rgba(255, 150, 50, .34) 0, rgba(252, 105, 0, .14) calc(var(--r) * var(--f) * .4), rgba(252, 105, 0, 0) calc(var(--r) * var(--f) * .85)); }
.mountain__shot::after { z-index: 1;
  background: radial-gradient(circle at var(--tx) var(--ty), rgba(6, 8, 12, 0) 0, rgba(6, 8, 12, .1) calc(var(--r) * var(--f) * .35), rgba(6, 8, 12, .5) calc(var(--r) * var(--f) * .8), rgba(6, 8, 12, .72) calc(var(--r) * var(--f) * 1.3)); }
.mountain__shot.is-held::before, .mountain__shot.is-held::after { animation: flicker 8s ease-in-out infinite; }
@keyframes torch { 0% { --tx: 28%; --ty: 62%; } 35% { --tx: 52%; --ty: 48%; } 70% { --tx: 40%; --ty: 30%; } 100% { --tx: 70%; --ty: 58%; } }
@keyframes flicker { 0% { --f: 1; } 13% { --f: .94; } 22% { --f: 1.04; } 37% { --f: .97; } 51% { --f: 1.06; } 64% { --f: .93; } 78% { --f: 1.02; } 90% { --f: .96; } 100% { --f: 1; } }
@media (prefers-reduced-motion: reduce) { .mountain__shot::before, .mountain__shot::after { display: none; } }
@media (max-width: 700px) {
  .qlog { grid-template-columns: minmax(0, 1fr); margin-top: 24px; gap: 14px; grid-template-areas: "list" "view" "ideas"; grid-template-rows: auto; }
  .qlog__ideas { padding-top: 4px; }
  .qlog__idea { max-width: none; }
  .qlog__list { display: flex; gap: 6px; overflow-x: auto; border: 0; padding-bottom: 4px; scroll-snap-type: x mandatory; }
  .qlog__list li { flex: 0 0 auto; scroll-snap-align: start; }
  .qlog__list button { border: 1px solid var(--rule); padding: 8px 12px; font-size: 14px; }
  .qlog__list small, .qlog__list .cleared { display: none; }
  .mountain { margin-top: 32px; }
}

/* ===== II · two studies (sketch, flat colour) above the finished plate; wider than the text column (1296 at 1440) ===== */
.how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; width: min(1296px, 100% - 2 * var(--gutter)); margin: 40px auto 0; }
.how__final { grid-column: 1 / -1; }
/* captions above their pictures, like a note with a leader line (thread 15): a faint rule runs from the chip down the
   caption's left edge to the picture's top edge; a cyan rule draws over it top → bottom when the ability unlocks.
   --lead = the gap caption → picture (the bridge's plate sets its own, measured, on the last one). */
.how__cap { position: relative; padding-left: 16px; --lead: 26px; }
.how__cap::before, .how__cap::after { content: ""; position: absolute; left: 0; top: 4px; bottom: calc(-1 * var(--lead)); width: 1px; }
.how__cap::before { background: color-mix(in srgb, var(--text-2) 40%, transparent); }
.how__cap::after { background: var(--cyan); transform-origin: top; transition: transform .7s cubic-bezier(.3, .6, .3, 1) .15s; }
.how__cap:has(.is-locked)::after { transform: scaleY(0); }
.how__fig { position: relative; margin: 26px 0 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.how__fig img { display: block; width: 100%; height: 100%; object-fit: cover; }
.how__fig--sketch { box-shadow: none; border: 1px solid var(--rule); }
/* E1 "living water flows" (thread 15, replaces the Kling loop): a layer with only the brook, spring and veins, brightened.
   A repeating ring mask runs out from the spring (57% / 72% of the plate), one lit band every 16% of the gradient ray,
   so the light travels along the water and nowhere else. The layer's strength drifts over 11 s, so the rhythm is uneven.
   Direction, not pulse: no halo, no scale (the hero orb spins and pulses, the egg breathes). Starts with the third unlock. */
@property --flow { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.how__water { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  -webkit-mask-image: repeating-radial-gradient(circle at 57% 72%, transparent var(--flow), #000 calc(var(--flow) + 4%), transparent calc(var(--flow) + 8%), transparent calc(var(--flow) + 16%));
  mask-image: repeating-radial-gradient(circle at 57% 72%, transparent var(--flow), #000 calc(var(--flow) + 4%), transparent calc(var(--flow) + 8%), transparent calc(var(--flow) + 16%)); }
.is-flowing > .how__water { animation: water-flow 5.4s linear infinite, water-in 1.4s ease-out, water-drift 11s ease-in-out 1.4s infinite; opacity: 1; } /* developer: slower (was 2.7 s / 7.3 s) */
.is-paused > .how__water { animation-play-state: paused; }
@keyframes water-flow { to { --flow: 16%; } }
@keyframes water-in { from { opacity: 0; } }
@keyframes water-drift { 40% { opacity: .55; } 75% { opacity: .8; } }
/* night (thread 16): the water is the main light, so the flow stays stronger (.7–1 instead of .55–1) */
[data-theme="night"] .is-flowing > .how__water { animation-name: water-flow, water-in, water-drift-night; }
@keyframes water-drift-night { 40% { opacity: .7; } 75% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .how__water, .how__fig .how__water { display: none; } } /* beats .how__fig img */
[data-theme="night"] .how .day, [data-theme="day"] .how .night { display: none; }
/* night: the pencil study becomes light lines on the navy page (graphite → pale, blue guides stay blue) */
/* night sketch file = silver line on night paper (thread 22, w22-silver.py), no CSS negative */
.unlocked { display: inline-block; font: 700 12px var(--font-sc); letter-spacing: .06em; background: var(--cyan); color: var(--ink); padding: 3px 8px; border-radius: 2px; margin-bottom: 8px; transition: background-color .25s, color .25s, box-shadow .25s; }
.unlocked.is-locked { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-2) 55%, transparent); }
.unlocked.is-new { animation: unlock-pop .35s ease-out; }
@keyframes unlock-pop { from { transform: scale(.94); } }
.how h3 { font: 700 20px/1.2 var(--font-head); }
.how__cap > p:last-child { color: var(--text-2); font-size: 15px; margin-top: 4px; }
@media (max-width: 700px) {
  .how { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 24px; }
  /* phone: the plate as a square window on the mage, the stag and the spring */
  .how__fig--plate { aspect-ratio: 1 / 1; }
  .how__fig--plate img { object-position: 22% 50%; } /* thread 15 plate and its night (0.0% shift): mage, stag and spring in x 12–68% */
}

/* ===== II → III bridge: pinned full-bleed stage (JS sets html.has-bridge on desktop without RM) ===== */
.bridge { display: none; }
/* thread 15: the stage starts on the page's paper with chapter II's plate in its column (JS sizes and moves .bridge__a) */
.has-bridge .bridge { display: block; position: relative; height: var(--bridge-h, 320svh); background: var(--paper); }
.bridge__stage { position: sticky; top: var(--nav-h); height: calc(100svh - var(--nav-h)); overflow: hidden; background: var(--paper); }
.bridge__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform, opacity, filter; }
.bridge__a { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform, opacity, filter; background: var(--paper-2); }
.bridge__a img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* on desktop the bridge shows the plate, so the in-flow copy is for screen readers only and its caption leads into the plate */
.has-bridge .how__final .how__fig--plate { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); box-shadow: none; }
.has-bridge #process { padding-bottom: 0; position: relative; z-index: 1; } /* its last leader line reaches into the bridge */
[data-theme="night"] .bridge .day, [data-theme="day"] .bridge .night { display: none; }
.bridge__img--b { opacity: 0; }
.bridge__black { position: absolute; inset: 0; background: #07090d; opacity: 0; }
.bridge__title { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 var(--gutter); opacity: 0; }
.bridge__title .chap { color: var(--cyan); margin-bottom: 14px; }
.bridge__h { font: 800 clamp(34px, 4.4vw, 64px)/1.05 var(--font-head); color: #E6ECF3; }
.bridge__body { margin: 18px auto 0; max-width: 58ch; font-size: 17px; color: #b9c4d2; }
/* with the bridge, chapter III's own head is read by screen readers but shown by the bridge */
.has-bridge #product { border-top: 0; padding-top: 56px; }
.has-bridge #product .page { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ===== III · armour, part by part ===== */
/* the plate: as wide as II's (1296 at 1440); the six pins sit on the parts in frame fractions (2688 × 1520 source) */
.iii { position: relative; width: min(1296px, 100% - 2 * var(--gutter)); margin: 40px auto 0; aspect-ratio: 16 / 9; overflow: hidden; background: #07090d; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.iii__img { display: block; width: 100%; height: 100%; object-fit: cover; }
[data-theme="night"] .iii .day, [data-theme="day"] .iii .night { display: none; } /* thread 16: night T3 (same geometry, 0.0%) */
.iii__pins li { position: absolute; left: var(--x); top: var(--y); translate: -50% -50%; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font: 700 12px/1 var(--font-head); color: #fff; background: rgba(7,9,13,.72); box-shadow: 0 0 0 1.5px var(--cyan); }
#product .armour { margin-top: 28px; }
/* pinned (desktop, JS adds .is-pin): the wrapper gives the scroll length, the stage sticks under the nav;
   the plate shrinks to leave room for the step list under it */
.iii-pin.is-pin { height: var(--pin-h, 500svh); }
.is-pin .iii-stage { position: sticky; top: var(--nav-h); height: calc(100svh - var(--nav-h)); display: flex; flex-direction: column; justify-content: center; }.is-pin .iii { width: min(1296px, 100% - 2 * var(--gutter), (100svh - var(--nav-h) - 190px) * 16 / 9); margin-top: 0; }
.is-pin .armour { margin-top: 18px; }
.iii__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.is-pin .iii__img { visibility: hidden; }
.is-pin .iii__pins li { opacity: 0; scale: .6; transition: opacity .35s ease, scale .35s ease; }
.is-pin .iii__pins li.is-on { opacity: 1; scale: 1; }
.is-pin .iii__pins li.is-now { box-shadow: 0 0 0 2px var(--cyan), 0 0 14px rgba(0,194,255,.55); }
/* technical callout: leader from the pin to a label in the calm wall left of the mage (labels end at ~49 % of the plate) */
.iii__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.iii__lines line { stroke: #cfe9ff; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.iii__note { position: absolute; right: 51%; top: var(--y); translate: 0 -50%; text-align: right; color: #e9f4ff; opacity: 0; transition: opacity .3s ease;
  font: 600 13px/1.3 var(--font-body); text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.iii__note b { display: block; font: 700 22px/1 var(--font-head); color: var(--cyan); }
.iii__note span { display: block; font: italic 400 13px var(--font-head); color: #bcd3e6; }
.iii__note.is-on { opacity: 1; }
.is-pin .parts li { opacity: .38; transition: opacity .3s ease; }
.is-pin .parts li.is-on { opacity: 1; }
/* thread 16: a bold that keeps the text width. The pinned block shrinks to its text (flex column + auto margins), so a real
   font-weight change on 05, the longest part, widened it and moved the columns by 2–8 px */
.is-pin .parts li.is-now { opacity: 1; color: var(--cyan-ink); text-shadow: .45px 0 0 currentColor, -.15px 0 0 currentColor; }
/* finale: the real product, on the dark "window" surface like the quest log (the app's own screens are dark) */
.advance { margin-top: 56px; background: var(--win); color: var(--win-text); border-top: 3px solid var(--cyan); padding: 28px 28px 24px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.advance__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: end; margin-bottom: 22px; }
.advance__k { grid-column: 1 / -1; font: 700 13px var(--font-sc); letter-spacing: .1em; color: var(--cyan); }
.advance__h { font: 800 clamp(26px, 2.6vw, 34px)/1.1 var(--font-head); }
.advance__d { grid-column: 1; color: #b9c4d2; max-width: 62ch; font-size: 15.5px; }
.advance__p { grid-column: 2; grid-row: 2 / 4; align-self: end; font: 600 13px var(--font-body); color: var(--win-text); border: 1px solid var(--win-line); padding: 6px 10px; white-space: nowrap; }
.advance__shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.advance__shots figure { margin: 0; }
.advance__shots img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--win-line); }
.advance__shots figcaption { margin-top: 8px; font-size: 14px; color: #b9c4d2; }
.advance__shots figcaption b { color: var(--cyan); font: 700 13px var(--font-sc); letter-spacing: .08em; margin-right: 6px; }
@media (max-width: 700px) {
  .advance { margin-top: 36px; padding: 20px 16px; }
  .advance__head { grid-template-columns: minmax(0, 1fr); }
  .advance__p { grid-column: 1; grid-row: auto; justify-self: start; }
  .advance__shots { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 700px) {
  /* phone: a 4:5 window on the mage (he spans ~50–100 % of the frame); the list below names the parts, so no pins */
  .iii { aspect-ratio: 4 / 5; width: 100%; margin-top: 24px; }
  .iii__img { object-position: 94% 50%; }
  .iii__pins { display: none; }
}
.armour { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.armour > li { border-top: 3px solid var(--cyan); padding-top: 10px; }
.armour h3 { font: 700 15px var(--font-sc); letter-spacing: .08em; color: var(--cyan-ink); }
.armour > li > p { color: var(--text-2); font-size: 15px; }
.parts { margin-top: 8px; display: grid; gap: 4px; font-size: 14.5px; }
.parts .stat { color: var(--cyan-ink); font-weight: 700; margin-right: 8px; }
@media (max-width: 700px) { .armour { grid-template-columns: minmax(0, 1fr); gap: 18px; } }

/* ===== IV · bestiary ===== */
/* subsection titles (Active quests, Next quests, Cleared): centred like a heading in the book, rules fading out, a small rhombus
   (the L1 mark) at each end of the words; only in IV (.grp is shared with VI) */
:is(#products, #client) .grp, #colophon > .grp { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 80px 0 32px; text-align: center;
  font: 700 22px/1.2 var(--font-sc); letter-spacing: .12em; color: var(--text); }
/* Shape = clip-path (a 1 px rule + a rhombus); colour = one gradient: rule fades in from the outside, the rhombus is cyan ink. */
:is(#products, #client) .grp::before, :is(#products, #client) .grp::after, #colophon > .grp::before, #colophon > .grp::after { content: ""; flex: 0 1 180px; height: 9px; --r: color-mix(in srgb, var(--text-2) 55%, transparent); }
:is(#products, #client) .grp::before, #colophon > .grp::before { background: linear-gradient(90deg, transparent, var(--r) calc(100% - 9px), var(--cyan-ink) calc(100% - 8px));
  clip-path: polygon(0 4px, calc(100% - 8px) 4px, calc(100% - 4px) 0, 100% 4.5px, calc(100% - 4px) 9px, calc(100% - 8px) 5px, 0 5px); }
:is(#products, #client) .grp::after, #colophon > .grp::after { background: linear-gradient(270deg, transparent, var(--r) calc(100% - 9px), var(--cyan-ink) calc(100% - 8px));
  clip-path: polygon(100% 4px, 8px 4px, 4px 0, 0 4.5px, 4px 9px, 8px 5px, 100% 5px); }
#products [data-group="active"] .grp { margin-top: 56px; }
:is(#products, #client) .grp small { font: inherit; color: var(--text-2); }
:is(#products, #client) .grp small::before { content: " · "; }
.bests { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
/* between two fights: a short rule with a cyan rhombus in the middle, like a section break in a book */
.bests > .battle + .battle::before { content: ""; display: block; width: min(320px, 70%); height: 13px; margin: 64px auto;
  --r: color-mix(in srgb, var(--text-2) 55%, transparent);
  background: linear-gradient(90deg, transparent, var(--r) 30%, var(--r) calc(50% - 8px), var(--cyan-ink) calc(50% - 8px), var(--cyan-ink) calc(50% + 8px),
    var(--r) calc(50% + 8px), var(--r) 70%, transparent);
  clip-path: polygon(0 6px, calc(50% - 7px) 6px, 50% 0, calc(50% + 7px) 6px, 100% 6px, 100% 7px, calc(50% + 7px) 7px, 50% 13px, calc(50% - 7px) 7px, 0 7px); }
.entry { padding-top: 14px; }
.entry h3 { font: 800 26px/1.15 var(--font-head); color: var(--text); margin: 2px 0 2px; }
.hab { font: 600 13px var(--font-sc); letter-spacing: .05em; color: var(--text-2); }
/* HP in segments, one per roadmap item (thread 17); built ones go out from the right end after the cut */
/* lost HP = an empty segment with a thin red outline, on the same line as the rest (no drop: it read as a broken bar) */
.hp { display: flex; gap: 3px; height: 10px; margin: 12px 0 6px; }
.hp i { flex: 1; background: #D2402F; box-shadow: inset 0 0 0 1px #D2402F; transition: background-color .25s; transition-delay: calc(var(--k) * 60ms); }
.hp i.off { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, #D2402F 45%, transparent); }
.battle:has(.fight.is-armed:not(.is-cut)) .hp i.off { background: #D2402F; transition: none; }
.battle--plate .entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 24px; }
.entry__side > .v2 { margin-top: 20px; }
/* the landing, alive: a recording in a plain browser frame (thread 17) */
.site { margin: 0; }
.site__win { display: block; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: #07090D; box-shadow: 0 10px 28px rgba(0,0,0,.18); transition: border-color .3s ease, box-shadow .3s ease; }
.site__win:hover { border-color: var(--cyan-ink); box-shadow: 0 10px 28px rgba(0,0,0,.18), 0 0 0 3px rgba(0, 194, 255, .22); }
.site__bar { display: flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.site__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--rule); }
.site__bar b { margin-left: 8px; font: 500 11.5px var(--font-body); color: var(--text-2); }
.site video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.site figcaption { margin-top: 8px; font: 600 13px var(--font-sc); letter-spacing: .05em; color: var(--text-2); }
/* beasts in the shadow: the landing's poster sits in the plate's lower right corner (36 % of the card); on hover / tap it pops
   out of the card as a large preview (480 px on desktop, the card's width on a phone) right under the beast's sketch, over the
   card's text and its neighbours, and plays: the reader sees the landing without clicking. Positions in card widths (cqw):
   the plate is 4:3, so it is 75cqw tall. Lives in the card, not in the plate, because the plate clips. */
.shadow .card { position: relative; container-type: inline-size; }
.card__site { position: absolute; z-index: 3; right: 10px; top: calc(75cqw - 22.5cqw - 10px); width: 36cqw; height: auto; aspect-ratio: 16 / 10;
  display: block; overflow: hidden; background: #07090D; border: 1px solid var(--rule); border-radius: 3px; box-shadow: 0 4px 12px rgba(0,0,0,.25);
  transition: width .35s ease, top .35s ease, right .35s ease, box-shadow .35s ease; }
.card__site video { display: block; width: 100%; height: 100%; object-fit: cover; }
.shadow .card.is-lift { z-index: 5; }
.card.is-lift .card__site { max-width: none; width: max(100cqw, min(480px, 92vw)); top: calc(75cqw + 8px); right: calc(50cqw - max(100cqw, min(480px, 92vw)) / 2);
  border-radius: 4px; box-shadow: 0 18px 48px rgba(7,9,13,.45); }
/* edge columns grow inwards so the preview never leaves the window (4 columns above 960 px, 2 below) */
@media (min-width: 961px) {
  .shadow .card:nth-child(4n+1).is-lift .card__site { right: calc(100cqw - max(100cqw, min(480px, 92vw))); }
  .shadow .card:nth-child(4n).is-lift .card__site { right: 0; } }
@media (min-width: 701px) and (max-width: 960px) {
  .shadow .card:nth-child(2n+1).is-lift .card__site { right: calc(100cqw - max(100cqw, min(480px, 92vw))); }
  .shadow .card:nth-child(2n).is-lift .card__site { right: 0; } }
/* phone: the row scrolls sideways (it would clip a wider preview), so the preview takes exactly the card's width */
@media (max-width: 700px) { .card.is-lift .card__site { width: 100cqw; right: 0; } }
/* the sketch of the beast still in the shadow (thread 17): night = its own file, a silver line on night paper (thread 22,
   _source/qa/w22-silver.py; the CSS negative turned the hatching into a glow) */
.plate--beast { background: #F2F2F0; }
.card__beast { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[data-theme="night"] .card .day, [data-theme="day"] .card .night { display: none; }
[data-theme="night"] .plate--beast { background: var(--paper); isolation: isolate; }
/* the shadow rises from the bottom; lifting the card (hover / tap) lets it fall away, and the weakness underlines in cyan */
.card__shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity .6s ease;
  background: linear-gradient(0deg, rgba(7,9,13,.82), rgba(7,9,13,.5) 45%, rgba(7,9,13,.08) 100%); }
.card.is-lift .card__shade { opacity: .12; }
.card__weak span { background: linear-gradient(var(--cyan-ink), var(--cyan-ink)) left bottom / 0 1.5px no-repeat; transition: background-size .6s ease; }
.card.is-lift .card__weak span { background-size: 100% 1.5px; }
.shadow .card:has(.card__site) { cursor: pointer; }

/* the fight plate: colour, the sketch over it (clipped in fight()), the cut line, the damage. Full width of the window. */
#products { overflow-x: clip; }
.fight { position: relative; width: 100vw; margin: 0 calc(50% - 50vw); aspect-ratio: 2560 / 1448; overflow: hidden; background: var(--paper-2); }
.fight img, .fight__sk { position: absolute; inset: 0; width: 100%; height: 100%; }
.fight img { object-fit: cover; object-position: 50% 50%; }
[data-theme="night"] .fight .day, [data-theme="day"] .fight .night { display: none; }
[data-theme="night"] .fight__sk { background: var(--paper); }   /* night file = silver line on night paper (w22-silver.py) */
.fight__fall { display: none; }
.fight.is-armed .fight__fall { display: block; }
.fight[data-mage="left"] { --fx: -24px; }
.fight[data-mage="right"] { --fx: 24px; }
.fight.is-cut .fight__fall { transform: translate(var(--fx), 24px); opacity: 0; transition: transform .4s ease-in, opacity .4s; }
.fight.is-clear .fight__sk, .fight.is-clear .fight__cut { display: none; }
.fight__cut { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fight__cut line { stroke: #7DE8FF; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px #00C2FF); transition: stroke-dashoffset .18s linear; }
.fight.is-armed:not(.is-drawn) .fight__cut line { stroke-dashoffset: 1; }
.fight.is-impact { filter: invert(1) grayscale(1) contrast(1.8); }   /* impact frame, 120 ms, flat */
.fight.is-cut:not(.is-done) { animation: fight-shake .22s linear; }
@keyframes fight-shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
.fight__dmg { position: absolute; left: var(--hx); top: var(--hy); transform: translate(-50%, -50%); font: 800 clamp(34px, 4.6vw, 68px)/1 var(--font-head);
  color: #fff; -webkit-text-stroke: 2px #07090D; paint-order: stroke; opacity: 0; pointer-events: none; }
.fight.is-cut:not(.is-done) .fight__dmg { animation: fight-dmg 1.5s ease-out; }
@keyframes fight-dmg { 0% { opacity: 0; translate: 0 12px; } 18% { opacity: 1; translate: 0 -8px; } 70% { opacity: 1; translate: 0 -18px; } 100% { opacity: 0; translate: 0 -36px; } }
@media (max-width: 700px) {
  .fight { aspect-ratio: 4 / 5; }
  .fight img { object-position: var(--pos) 50%; }
  .battle--plate .entry { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
.hp__txt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--text-2); }
.hp__txt b { color: var(--text); font-size: 17px; margin-left: 2px; }
.kv { margin-top: 14px; font-size: 14.5px; color: var(--text-2); }
.kv > b, .kv summary b { display: block; font: 700 13px var(--font-sc); letter-spacing: .04em; color: var(--text); margin-bottom: 4px; }
.kv summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.kv summary b { text-decoration: underline 1px transparent; text-underline-offset: 4px; transition: text-decoration-color .3s ease; }
.kv summary:hover b { text-decoration-color: currentColor; }
.kv summary::-webkit-details-marker { display: none; }
.kv .more { font: 700 13px var(--font-sc); color: var(--cyan-ink); white-space: nowrap; }
.kv[open] .more { display: none; }
.ticks { display: grid; gap: 3px; }
.ticks li { position: relative; padding-left: 20px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--cyan-ink); font-weight: 700; }
.v2 .ticks li::before { content: "◇"; }
.hint { margin-top: 8px; font: italic 400 15px var(--font-head); color: var(--note); }
.lk { display: inline-block; margin-top: 14px; font: 700 14px var(--font-sc); letter-spacing: .04em; color: var(--cyan-ink); text-decoration: underline 1px transparent; }
.shadow, .chronicle { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { border: 1px solid var(--rule); background: var(--paper); }
.card .entry { padding: 12px; }
.card .entry h3 { font-size: 20px; }
.card .kv { margin-top: 8px; font-size: 14px; }
@media (max-width: 960px) { .shadow, .chronicle { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .bests > .battle + .battle::before { margin: 44px auto; }
  :is(#products, #client) .grp { font-size: 19px; gap: 12px; margin: 56px 0 24px; }
  :is(#products, #client) .grp::before, :is(#products, #client) .grp::after { flex-basis: 48px; }
  :is(#products, #client) .grp small { display: block; margin-top: 4px; font-size: 13px; letter-spacing: .1em; }
  :is(#products, #client) .grp small::before { content: none; }
  .shadow, .chronicle { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .card { flex: 0 0 74%; scroll-snap-align: start; }
}

/* ===== V · log of lost directions, VI and VII · windows over the plate ===== */
/* V (thread 18): the abandoned page sits on the book's paper (white ground normalised in the file → multiply by day; night =
   inverted + screen like the sketches of IV). Phone: 4:3 crop over the finished left 75 % (mage + empty staff). */
.plate--lost { box-shadow: none; background: transparent; }
.plate--lost img { display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
[data-theme="night"] .plate--lost .night { mix-blend-mode: normal; }   /* silver line on night paper (w22-silver.py) */
[data-theme="night"] .plate--lost .day, [data-theme="day"] .plate--lost .night { display: none; }   /* night = its own sketch with the moon */
@media (max-width: 700px) { .plate--lost { aspect-ratio: 4 / 3; } .plate--lost img { object-position: 0 50%; } }

/* The log: Raróg phase 2 perches on its top edge (the ledge he stands on, 91.4 % of his height, lies on the window's border).
   --ember 0–1 = his ember (JS: 1 → .34, then .5); at night never below .45 so it still reads on navy. */
.log { position: relative; max-width: 640px; margin-top: 236px; --fw: 140px; --ember: 1; }   /* bird 140 px (thread 22, was 110): 197 px above the window */
.log dd { color: #FF8A8A; }
.fledg { position: absolute; right: 28px; bottom: calc(100% - var(--fw) * 1.5385 * .086); width: var(--fw); aspect-ratio: 520 / 800; margin: 0; pointer-events: none; }
.fledg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fledg__ln { mix-blend-mode: multiply; }
[data-theme="night"] .fledg__ln { mix-blend-mode: normal; }   /* silver line with alpha (w22-silver.py --rgba) */
[data-theme="night"] .fledg .day, [data-theme="day"] .fledg .night { display: none; }
.fledg__em { opacity: var(--ember); transition: opacity .6s ease, filter .6s ease; }
[data-theme="night"] .fledg__em { opacity: max(var(--ember), .45); }
.log.is-flare .fledg__em { filter: brightness(1.25); }
@media (prefers-reduced-motion: no-preference) { .log.is-done .fledg__em { transition-duration: 1.4s; } }   /* it smoulders back slowly, not a switch; RM: at once */
@media (prefers-reduced-motion: reduce) { .fledg__em { transition: none; } }
/* his age, in the same "age · stage · fact" line as the egg (I) and the grown bird (IX); left of him, over the window's edge */
.fledg figcaption { position: absolute; right: calc(100% + 12px); bottom: 14%; width: max-content; text-align: right; font: 600 11px/1.35 var(--font-sc); letter-spacing: .06em; color: var(--blue-text); }
@media (max-width: 700px) { .fledg figcaption { max-width: 210px; text-wrap: balance; } }
.fledg__drop { position: absolute; left: 79%; top: 89%; width: 3px; height: 5px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #8FB4CF; opacity: 0; }
/* the erased direction: the text stays at 55 % (5.0:1 on the window) under a soft graphite smear; the full-colour copy on top is
   rubbed away left → right in three strokes, the eraser riding its edge. Verdicts stay whole. */
.log dt { position: relative; display: inline-block; }
.log dt::before, .log dt::after { position: absolute; pointer-events: none; }
.log .is-erased dt, .log.is-done dt { color: rgba(230, 236, 243, .55); filter: blur(.3px); background: radial-gradient(ellipse 60% 50% at 50% 55%, rgba(160, 170, 185, .2), transparent 75%) no-repeat; }
@media (prefers-reduced-motion: no-preference) {
  .log.is-on .fledg__drop { animation: drip 4.2s ease-in 1.2s infinite; }
  .log .is-erased dt::before { content: attr(data-t) / ""; left: 0; top: 0; white-space: nowrap; color: var(--win-text); animation: rub 1.1s linear forwards; }
  .log .is-erased dt::after { content: ""; left: 0; top: 50%; width: 12px; height: 20px; margin-top: -10px; border-radius: 2px; background: #D9C7C2; box-shadow: inset 0 -5px 0 #B9A7A2; opacity: 0; animation: eraser 1.1s linear forwards; }
  .log.is-done dt::before, .log.is-done dt::after { content: none; }
}
@keyframes drip { 0% { opacity: .9; transform: translateY(0); } 20% { opacity: 0; transform: translateY(32px); } 100% { opacity: 0; transform: translateY(32px); } }
@keyframes rub { 0% { clip-path: inset(-20% 0 -20% 0); } 30%, 45% { clip-path: inset(-20% 0 -20% 40%); } 75%, 85% { clip-path: inset(-20% 0 -20% 82%); } 100% { clip-path: inset(-20% 0 -20% 100%); } }
@keyframes eraser { 0% { opacity: 1; transform: translateX(0); } 30% { transform: translate(calc(var(--w) * .4), -2px); } 45% { transform: translate(calc(var(--w) * .2), 2px); }
  75% { transform: translate(calc(var(--w) * .82), -2px); } 85% { transform: translate(calc(var(--w) * .6), 1px); } 97% { opacity: 1; transform: translateX(var(--w)); } 100% { opacity: 0; transform: translateX(var(--w)); } }
/* ≥ 1280 px (developer's idea, trial): the page runs the full width of the window and the log sits in its unfinished right part
   (blank paper from ~72 %), so Raróg perches in the world that was never drawn. Rows stack in the narrow window. The log's left
   edge stays right of the empty staff head (≤ 71 %): 1280 → 71.4 %, 1440 → 72 %, 1920 → 75 %; narrower screens keep the column. */
@media (min-width: 1280px) {
  .lost { position: relative; width: 100vw; margin: 36px calc(50% - 50vw) 0; }
  .lost .plate--lost { margin: 0; }
  .lost .log { position: absolute; right: 2vw; bottom: 6%; width: clamp(340px, 26vw, 440px); margin: 0; }
  .lost .log .row { display: block; }
  .lost .log dd { text-align: left; margin-top: 2px; }
}
@media (max-width: 700px) {
  .log { margin-top: 196px; --fw: 112px; }
  .log .row { display: block; }
  .log dd { text-align: left; margin-top: 2px; }
  .fledg { right: 16px; }
}
.plate-wrap { position: relative; }
.over { position: absolute; z-index: 3; right: 3%; top: calc(36px + 4%); width: min(340px, 42%); }
@media (max-width: 700px) { .over { position: static; width: auto; margin-top: 12px; } }

/* ===== VI · Cleared (thread 19): one card per live app, screens lead, the beast as a pencil note ===== */
#client [data-group="personal"] .grp { margin-top: 56px; }
.trophies { display: grid; gap: 112px; }
.trophy { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.trophy--mir { grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); }
.trophy--mir .trophy__view { order: 2; }
.trophy__view { position: relative; }
.browser { border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 22px 44px -24px rgba(7, 9, 13, .45); }
.browser__bar { display: flex; gap: 6px; align-items: center; height: 24px; padding: 0 10px; background: color-mix(in srgb, var(--text) 7%, var(--paper)); }
.browser__bar i { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--text) 22%, var(--paper)); }
.stage { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--rule); }
.stage img, .stage video { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
/* the loop lies over the screen; a thumb with a screen hides it (data-view) */
.stage__loop { position: absolute; inset: 0; z-index: 1; }
.stage:not([data-view="loop"]) .stage__loop { display: none; }
/* the strips ("pasy"): 7 slices of the frame after the fight, alternate sides, 0.42 s each + 40 ms apart; RM = cross-fade */
.strips { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.strips > div { position: absolute; left: 0; right: 0; overflow: hidden; translate: -101% 0;
  transition: translate .42s cubic-bezier(.6, 0, .3, 1) calc(var(--k) * 40ms); }
.strips > div:nth-child(even) { translate: 101% 0; }
.stage.is-beast .strips > div { translate: 0 0; }
.stage .strips img { position: absolute; left: 0; width: 100%; object-position: 50% 50%; }
@media (prefers-reduced-motion: reduce) {
  .strips > div, .strips > div:nth-child(even) { translate: 0 0; opacity: 0; transition: opacity .25s; }
  .stage.is-beast .strips > div { opacity: 1; }
}
.tshots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }   /* breathing room under the stage (developer 2026-11-17) */
.thumb { padding: 0; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: none; cursor: pointer; opacity: .78; transition: opacity .3s ease; }
.thumb:hover, .thumb[aria-pressed="true"] { opacity: 1; }
.thumb[aria-pressed="true"] { outline: 2px solid var(--cyan-ink); outline-offset: 2px; }
.thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.thumb--loop { position: relative; }
.thumb--loop span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  background: rgba(7, 9, 13, .18); }
.pshots { display: none; }
/* the seal: pressed into the page corner once, when 60 % of the stage is in view (.fx = effects on, no RM); cyan ink of the book */
/* on the outer top corner of the stage (away from the facts column: developer 2026-11-17, "too tight" at the right corner) */
.seal { position: absolute; z-index: 3; top: -22px; left: -18px; rotate: -4deg; padding: 6px 12px; background: var(--paper); border: 2px solid var(--cyan-ink);
  color: var(--cyan-ink); font: 700 12px/1.3 var(--font-sc); letter-spacing: .1em; text-align: center; }
.seal span { display: block; font-size: 16px; letter-spacing: .14em; }
.trophy--mir .seal { left: auto; right: -18px; rotate: 4deg; }
.fx .seal { opacity: 0; }
.fx .seal.is-in { animation: seal .34s cubic-bezier(.2, 1.6, .4, 1) .15s both; }
@keyframes seal { from { opacity: 0; scale: 1.45; } 60% { opacity: 1; } to { opacity: 1; scale: 1; } }
/* the demo: a native dialog over the page, the film with EN / PL subtitles (the page language) */
.demo { width: min(1120px, 94vw); padding: 0; border: 0; background: transparent; overflow: visible; }
.demo::backdrop { background: rgba(5, 8, 14, .86); }
.demo video { display: block; width: 100%; aspect-ratio: 16 / 10; background: #000; border-radius: 6px; }
.demo video::cue { font: 600 18px/1.4 var(--font-body); color: #fff; background: rgba(7, 9, 13, .72); }
.demo__x { position: absolute; right: 0; top: -40px; background: none; border: 0; color: #fff; font: 700 14px var(--font-sc); letter-spacing: .1em; cursor: pointer; }
.trophy__date { font: 700 13px var(--font-sc); letter-spacing: .08em; color: var(--text-2); }
.trophy h3 { font: 700 38px/1.05 var(--font-head); margin: 6px 0 10px; }
.trophy__one { margin-bottom: 14px; }
.trophy__now { list-style: disc; padding-left: 18px; display: grid; gap: 3px; font-size: 15px; margin-bottom: 12px; }
.trophy__now li::marker { color: var(--cyan-ink); }
.trophy__stack { font-size: 13.5px; color: var(--text-2); margin-bottom: 20px; }
.trophy__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.btn--ghost:not(:disabled):hover, .btn--ghost:focus-visible { background: var(--text); color: var(--paper); box-shadow: inset 0 0 0 1px var(--text); }
/* the beast: a pencil note in the book, not a button of the app (graphite drawing, italic hand, cyan only on the call) */
.beastnote { display: flex; gap: 16px; align-items: center; width: 100%; margin-top: 30px; padding: 18px 0 0; border: 0; border-top: 1px solid var(--rule);
  background: none; color: var(--text-2); text-align: left; cursor: pointer; font: inherit; }
.beastnote__img { width: 84px; height: 84px; flex: none; background: var(--text-2); transition: background-color .3s;
  -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }   /* image inline: a url() in a custom property resolves against this stylesheet */
.beastnote em { display: block; font: italic 400 17px/1.3 var(--font-head); }
.beastnote b { display: block; font: 700 26px/1.1 var(--font-head); color: var(--text); }
.beastnote small { display: block; font-size: 13px; margin-top: 2px; }
.beastnote__see { display: inline-block; margin-top: 6px; font: 700 15px var(--font-sc); letter-spacing: .12em; color: var(--cyan-ink);
  text-decoration: underline wavy color-mix(in srgb, var(--cyan-ink) 45%, transparent); text-underline-offset: 4px; }
/* hover: the graphite lines take the cyan ink of the book (a mask, so the paper around them stays untouched) */
.beastnote:hover .beastnote__img, .beastnote[aria-pressed="true"] .beastnote__img { background: var(--cyan-ink); }
@media (max-width: 960px) { .trophy, .trophy--mir { grid-template-columns: minmax(0, 1fr); gap: 28px; } .trophy--mir .trophy__view { order: 0; } }
@media (max-width: 700px) {
  .trophies { gap: 80px; }
  .stage { aspect-ratio: 4 / 5; } .tshots, .stage__loop { display: none !important; }
  .stage .strips img { object-position: var(--px) 50%; }
  .pshots { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .pshots li { flex: 0 0 72%; scroll-snap-align: start; }
  .pshots img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border: 1px solid var(--rule); border-radius: 4px; }
  .seal, .trophy--mir .seal { left: 6px; right: auto; top: -14px; }
  .trophy h3 { font-size: 32px; }
}

/* ===== VIII · helpers ===== */
.switch { display: inline-flex; margin-top: 32px; border: 1px solid var(--text-2); border-radius: 3px; }
.switch button { font: 700 13px var(--font-sc); letter-spacing: .06em; padding: 9px 16px; border: 0; background: transparent; color: var(--text); cursor: pointer; transition: background-color .3s ease, color .3s ease; }
.switch button:not([aria-pressed="true"]):hover { background: rgba(0, 194, 255, .18); }
.switch button[aria-pressed="true"] { background: var(--cyan); color: var(--ink); }
.proof-main { margin-top: 14px; font: 700 22px/1.3 var(--font-head); color: var(--text); }
.proof-main b, .proofs b { display: block; font: 700 13px var(--font-sc); letter-spacing: .06em; color: var(--cyan-ink); }
.proofs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.proofs li { border-top: 2px solid var(--rule); padding-top: 8px; font-size: 15px; color: var(--text-2); }
@media (max-width: 700px) { .proofs { grid-template-columns: minmax(0, 1fr); gap: 14px; } .proof-main { font-size: 19px; } }
/* VIII · helpers (thread 21): the switch bar sits on the plate, so a click and its result are in one view; the plate
   shrinks with short windows (bar + plate fit: 1440 × 540 → 718 px wide). B's objects enter one after another
   (--d × 0.25 s, the mage last); back = reversed and quicker. Flat 2D only: opacity + 1 % rise. */
.hv { margin-top: 36px; }
@media (min-width: 701px) { .hv { width: min(100%, calc((100svh - 136px) * 16 / 9)); margin-inline: auto; } }
.hv__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; background: var(--win); color: var(--win-text); border: 1px solid var(--win-line); border-bottom: 0; border-radius: 2px 2px 0 0; padding: 9px 14px; }
.hv__lbl { font: 700 13px var(--font-sc); letter-spacing: .08em; color: var(--cyan); }
.hv .switch { margin: 0; border-color: #2C6B80; }
.hv .switch button { color: var(--win-text); }
.hv .switch button[aria-pressed="true"] { color: var(--ink); }
.hv .proof-main { margin: 0 0 0 auto; font: 600 15px/1.35 var(--font-body); color: var(--win-text); text-align: right; }
.hv .proof-main b { display: inline; margin-right: 8px; color: var(--cyan); }
.hv__scene { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: #0D1222; }
.hv__scene > picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hv__fx { position: absolute; inset: 0; pointer-events: none; }
.hv__l { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0;
  transition: opacity .3s ease-out calc((5 - var(--d)) * .1s), transform .3s ease-out calc((5 - var(--d)) * .1s); }
.hv__l--fig { transform: translateY(1%); }
#bubble[data-mode="auto"] .hv__l { opacity: 1; transform: none;
  transition: opacity .45s ease-out calc(var(--d) * .25s), transform .45s ease-out calc(var(--d) * .25s); }
#bubble[data-mode="auto"] .hv__l--mage { transition-duration: .35s; }   /* thread 21: 0.2 s and a "fade the old pose first" were tried and dropped */
/* motion 2: the stream flows. A lifted copy of the ribbon's own pixels, shown only under a light band that slides from
   the staff to the shelves (6 s, linear; developer: stronger and faster than the first 9 s); only in view and only when
   Automated; reduced motion = none. */
.hv__flow { -webkit-mask: linear-gradient(90deg, transparent 32%, #000 46%, #000 54%, transparent 68%) 100% 0 / 250% 100% no-repeat;
  mask: linear-gradient(90deg, transparent 32%, #000 46%, #000 54%, transparent 68%) 100% 0 / 250% 100% no-repeat; }
@keyframes hvflow { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
#bubble.is-live[data-mode="auto"] .hv__flow { animation: hvflow 6s linear infinite; }
@media (prefers-reduced-motion: reduce) { .hv__flow { display: none; } }
/* motion 3: the candle's smoke (8 s) and the cup's steam (7 s, a different pace) rise ~2.8 % and dissolve; two copies
   half a cycle apart, so the wisp never vanishes; the painted roots at the wick and the rim stay still on the plate.
   (A single copy was tried and dropped by the developer.) */
.hv__wisp { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
@keyframes hvwisp { 0% { opacity: 0; transform: translate(0, 1.2%); } 30% { opacity: 1; transform: translate(.12%, .3%); }
  70% { opacity: .85; transform: translate(-.08%, -.8%); } 100% { opacity: 0; transform: translate(.06%, -1.6%); } }
#bubble.is-live .hv__wisp { animation: hvwisp 8s ease-in-out infinite; }
#bubble.is-live .hv__wisp--2 { animation-delay: -4s; }
#bubble.is-live .hv__wisp--steam { animation-duration: 7s; }
#bubble.is-live .hv__wisp--steam.hv__wisp--2 { animation-delay: -3.5s; }
#bubble:not(.is-live) .hv__wisp:not(.hv__wisp--2) { opacity: 1; }   /* off screen / RM: the still wisp as painted */
@media (prefers-reduced-motion: reduce) { #bubble .hv__wisp { animation: none !important; } #bubble .hv__wisp:not(.hv__wisp--2) { opacity: 1; } }
[data-theme="night"] .hv__wisp:not(.hv__wisp--steam) { display: none; }   /* night: the candle burns, no smoke */
/* the summon in the margin (R8 "przywołanie"): pencil → his colour comes in (0.4 s) → he goes to the plate, a faint sketch
   stays (.3); back to By hand: the pencil returns. Lines multiply on the paper (screen at night), like the Raróg phases. */
.imp { display: block; position: relative; width: 120px; aspect-ratio: 300 / 505; margin-top: 16px; }
.imp img { position: absolute; inset: 0; width: 100%; height: 100%; }
.imp__ln { mix-blend-mode: multiply; transition: opacity .4s ease-out; }
[data-theme="night"] .imp__ln { mix-blend-mode: normal; }   /* silver line with alpha (w22-silver.py --rgba) */
[data-theme="night"] .imp__ln.day, [data-theme="day"] .imp__ln.night { display: none; }
.imp__col { opacity: 0; }
@keyframes impgo { 0% { opacity: 0; } 25%, 55% { opacity: 1; } 100% { opacity: 0; } }
#bubble[data-mode="auto"] .imp__col { animation: impgo 1.6s ease-in-out forwards; }
#bubble[data-mode="auto"] .imp__ln { opacity: .3; }
@media (max-width: 700px) { .imp { float: right; width: 64px; margin: -34px 0 0 12px; } }
@media (prefers-reduced-motion: reduce) { #bubble .imp__col { animation: none; } .imp__ln { transition: none; } }
@media (max-width: 700px) {
  .hv__scene { aspect-ratio: 4 / 5; }
  .hv__fx { right: auto; left: -57.48%; width: 221.05%; }   /* phone file = x 26–71 % of the frame (699 / 1216 px) */
  .hv__bar { padding: 8px; } .hv__lbl { display: none; }
  .hv .switch { width: 100%; } .hv .switch button { flex: 1; }
  .hv .proof-main { margin: 0; width: 100%; text-align: left; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .hv__l { transition: none !important; } }

/* ===== IX · character sheet ===== */
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px; margin-top: 40px; align-items: start; }
.sheet .plate { margin: 0; }
.grp--in { margin: 0 0 10px; }
.stats { border: 1px solid var(--rule); padding: 4px 16px; margin-bottom: 28px; }
.stats .row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--rule); padding: 8px 0; font-size: 14.5px; color: var(--text-2); }
.stats .row:last-child { border-bottom: 0; }
.stats dd { font-size: 20px; color: var(--text); line-height: 1.2; }
.eras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.eras li { border-top: 2px solid var(--rule); padding-top: 6px; font-size: 14px; color: var(--text-2); }
.eras b { display: block; font: 700 16px var(--font-head); color: var(--text); }
@media (max-width: 700px) { .sheet { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 24px; } }

/* thread 22 · the herbarium sheet: a lighter card on the book's paper; the keeper's plate fades into it (edges masked),
   the stats with pencil rules, Raróg phase 3 on his own, and the class history as pressed plants. Only the current period loads. */
.herb { grid-template-columns: auto minmax(0, 1fr); gap: 32px 56px; background: color-mix(in srgb, var(--paper) 55%, #fff); border: 1px solid var(--rule);
  box-shadow: 0 18px 40px -30px rgba(0,0,0,.35); padding: 36px 40px 40px; }
[data-theme="night"] .herb { background: var(--paper-2); }
[data-theme="night"] .herb .day, [data-theme="day"] .herb .night { display: none; }
.herb__mage { position: relative; margin: 0; width: min(380px, (100svh - 140px) * .8); }   /* fits a 540 px window next to the stats */
.herb__mage img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5;
  -webkit-mask: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 7%, #000 90%, transparent);
  -webkit-mask-composite: source-in; mask: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 7%, #000 90%, transparent);
  mask-composite: intersect; }
/* effect 3: the orb's cyan light breathes, on the orb and on the page it lights (their own pixels, brightened); 7 s, in view only */
.herb__mage .herb__orb { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .herb__mage.is-live .herb__orb { animation: orb-breathe 7s ease-in-out infinite; }
}
@keyframes orb-breathe { 0%, 100% { opacity: 0; } 45% { opacity: .8; } }
.herb__label { position: absolute; left: -10px; bottom: 18px; background: var(--paper); border: 1px solid var(--text-2); padding: 6px 12px; transform: rotate(-2deg);
  box-shadow: 3px 3px 0 var(--rule); font-size: 12.5px; line-height: 1.35; color: var(--text-2); }
.herb__label b { display: block; font: 700 15px var(--font-head); color: var(--text); }
.herb .stats { border: 0; padding: 0; }
.herb .stats .row { border-bottom: 1px dashed color-mix(in srgb, var(--text-2) 55%, transparent); }
.herb .stats .row:last-child { border-bottom: 1px dashed color-mix(in srgb, var(--text-2) 55%, transparent); }
/* Raróg phase 3: pencil under, the colour on top; every layer shares one crop box (900 × 558) */
.herb__rarog { display: flex; align-items: center; gap: 32px; margin: 8px 0 0; }
.rg { position: relative; flex: none; width: min(360px, 62%); aspect-ratio: 900 / 558; }
.rg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.rg__ln { mix-blend-mode: multiply; }
[data-theme="night"] .rg__ln { mix-blend-mode: normal; }   /* silver line with alpha (w22-silver.py) */
/* the colour, grown out of the ember and stopping before the wingtips (ellipse wider to the right: the right wing is longer).
   --rg 0 → 1: the ellipse grows from the ember (44.4 % / 51.9 % of the crop) to its end place (53 % / 47 %). Once, on entry (JS);
   RM / no JS: the end state. */
@property --rg { syntax: "<number>"; inherits: true; initial-value: 1; }
.rg__col { --m: radial-gradient(ellipse calc(41% * var(--rg)) calc(34% * var(--rg)) at calc(44.4% + 8.6% * var(--rg)) calc(51.9% - 4.9% * var(--rg)), #000 72%, transparent 100%);
  -webkit-mask: var(--m); mask: var(--m); }
.herb__rarog.is-js { --rg: .001; }
.herb__rarog.is-js.is-on { --rg: 1; transition: --rg 2.4s cubic-bezier(.3, .6, .3, 1); }
/* effect 2: the painted ember lines on the feather edges (their own pixels, brightened) light up as a soft ring passes from the
   ember outwards, once every 8 s; only inside the colour, only after it has grown and while the bird is on screen. RM: none. */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.rg__gl { opacity: 0; --ring: radial-gradient(circle at 44.4% 51.9%, transparent calc(var(--p) * 64% - 9%), #000 calc(var(--p) * 64%), transparent calc(var(--p) * 64% + 9%));
  -webkit-mask: var(--ring), var(--m); -webkit-mask-composite: source-in; mask: var(--ring), var(--m); mask-composite: intersect;
  --m: radial-gradient(ellipse 41% 34% at 53% 47%, #000 72%, transparent 100%); }
@media (prefers-reduced-motion: no-preference) {
  .herb__rarog.is-on.is-live .rg__gl { opacity: .85; animation: rg-ring 8s cubic-bezier(.35, 0, .4, 1) 2.6s infinite; }
}
@keyframes rg-ring { 0% { --p: 0; opacity: 0; } 12% { opacity: .85; } 70% { opacity: .85; } 100% { --p: 1; opacity: 0; } }
.herb__rarog figcaption { font-size: 13px; line-height: 1.4; color: var(--text-2); text-wrap: balance; }
.herb__rarog figcaption b { display: block; font: 700 20px var(--font-head); color: var(--text); }
.herb .yr { display: block; font: 600 11px var(--font-sc); letter-spacing: .07em; color: var(--blue-text); }
.herb__eras { grid-column: 1 / -1; border-top: 1px dashed color-mix(in srgb, var(--text-2) 55%, transparent); padding-top: 24px; }
.pressed { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.pressed li { border-top: 0; padding-top: 0; }
/* the pressed plants are pencil vignettes, one per square (thread 22): pencil on the sheet by day, silver line with alpha by night */
.pressed img { display: block; width: 100%; max-width: 240px; height: auto; aspect-ratio: 1; margin: 0 0 10px; mix-blend-mode: multiply; }
[data-theme="night"] .pressed img { mix-blend-mode: normal; }
/* effect 4: laid on the sheet one after another, once, when the row is on screen (2D: fade + 8 px drop; 0.6 s apart). RM / no JS: there. */
/* (the children move, not the li: opacity / transform on the parent would isolate the multiply vignette → white square, lesson V) */
.pressed.is-js li > * { opacity: 0; transform: translateY(8px); transition: opacity .9s ease-out, transform .9s ease-out; }
.pressed.is-js.is-on li > * { opacity: 1; transform: none; }
.pressed.is-js.is-on li:nth-child(2) > * { transition-delay: .6s; }
.pressed.is-js.is-on li:nth-child(3) > * { transition-delay: 1.2s; }
.pressed.is-js.is-on li:nth-child(4) > * { transition-delay: 1.8s; }
@media (max-width: 960px) { .herb { grid-template-columns: minmax(0, 1fr); padding: 24px; } .herb__mage { width: min(380px, 100%); justify-self: center; } }
@media (max-width: 700px) {
  .herb { padding: 18px 14px 22px; gap: 24px; }
  .herb__mage { width: 100%; }
  .herb__rarog { flex-direction: column; align-items: flex-start; gap: 8px; }
  .rg { width: 100%; }
  .pressed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
}

/* ===== X · new quest ===== */
/* thread 23: the clearing fills the screen under the chapter page; the quest window floats over the calm right part.
   Every layer is a whole frame with one object-fit / object-position, so the sketch stays on the painting in any box. */
.start { padding-bottom: 0; }
.start__stage { position: relative; height: calc(100svh - var(--nav-h)); min-height: 520px; margin-top: 40px; overflow: hidden; background: #0b1622; }
.start__scene { position: absolute; inset: 0; margin: 0; }
.start__scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }   /* 40 %: wreath (9 %) and feet (86 %) stay in wide windows */
[data-theme="night"] .start .day, [data-theme="day"] .start .night { display: none; }
[data-theme="night"] .start__lines img, [data-theme="night"] .start__draw { mix-blend-mode: screen; opacity: .7; }   /* thread 23 (B): moonlight drawing, not a silver sticker */
.start__draw { position: absolute; display: none; pointer-events: none; }
.start__stage.is-draw .start__lines { display: none; }
.start__stage.is-draw .start__draw { display: block; }   /* effect 1: the canvas replaces the still pencil layer */
/* effect 2 (thread 23): N1 a band of light runs along the painted dew (its own pixels added once more), N2 the leaves fade in */
@property --run { syntax: "<percentage>"; inherits: false; initial-value: -10%; }
.start__dew, .start__leaf { display: none; }
.start__stage.is-rewarded .start__dew, .start__stage.is-rewarded .start__leaf { display: block; }
[data-theme="night"] .start .start__dew.day, [data-theme="day"] .start .start__dew.night,
[data-theme="night"] .start .start__leaf.day, [data-theme="day"] .start .start__leaf.night { display: none; }
.start__dew img { mix-blend-mode: plus-lighter; opacity: 0;   /* the trail in the element: x 27 → 47 % of the frame (phone 14 → 60 %) */
  -webkit-mask-image: linear-gradient(90deg, transparent calc(var(--run) - 9%), #000 calc(var(--run) - 1%), transparent calc(var(--run) + 1.5%));
          mask-image: linear-gradient(90deg, transparent calc(var(--run) - 9%), #000 calc(var(--run) - 1%), transparent calc(var(--run) + 1.5%)); }
.start__stage.is-rewarded .start__dew img { animation: dew-run 3.2s cubic-bezier(.35, 0, .45, 1) forwards; }
@keyframes dew-run { 0% { --run: 25%; opacity: 0; } 12% { opacity: 1; } 82% { opacity: 1; } 100% { --run: 50%; opacity: 0; } }
.start__stage.is-rewarded .start__leaf img { animation: leaf-in 2.4s ease 2.2s both; }   /* 2.2 s: the light reaches the seed first; an animation, since display:none → block skips transitions */
@keyframes leaf-in { from { opacity: 0; } to { opacity: 1; } }
/* the colour climbs the tree (developer 2026-11-18: "sporo koloru, ale nadal mnóstwo szkicu"): first leaves 2.2 s → crown leaves 3.4 s → windows 4.4 s → pennant 5.2 s */
.start__stage.is-rewarded .start__leaf--crown img { animation-duration: 2s; animation-delay: 3.4s; }
.start__stage.is-rewarded .start__leaf--windows img { animation-duration: 1.4s; animation-delay: 4.4s; }
.start__stage.is-rewarded .start__leaf--pennant img { animation-duration: 1.4s; animation-delay: 5.2s; }
.start__dew.day img { filter: drop-shadow(0 0 3px #FFF4D6) drop-shadow(0 0 9px rgba(255, 226, 160, .85)); }   /* by day the drops are already white: the light shows as a warm halo of their own pixels */
.start__dew.night img { filter: drop-shadow(0 0 5px rgba(200, 225, 255, .7)); }
@media (max-width: 700px) { @keyframes dew-run { 0% { --run: 12%; opacity: 0; } 12% { opacity: 1; } 82% { opacity: 1; } 100% { --run: 62%; opacity: 0; } } }
@media (prefers-reduced-motion: reduce) { .start__stage.is-rewarded .start__dew img, .start__stage.is-rewarded .start__leaf img { animation: none; } }
.start__win { position: absolute; z-index: 1; right: max(var(--gutter), 6vw); top: 57%; transform: translateY(-50%); width: 380px; }   /* 57 %: clear of the right stork (y 22–28 % of the frame) */
/* below 1360 px or in low windows the window would cover the sketch (tower at 64.8 % of the frame): the whole frame
   is scaled into a 16:9 box and the window sits beside it on the paper (L2, thread 23) */
@media (min-width: 701px) and (max-width: 1359px), (min-width: 701px) and (max-height: 620px) {
  .start__stage { height: auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 0 var(--gutter) 32px; background: none; }
  .start__scene { position: relative; inset: auto; flex: none; aspect-ratio: 16 / 9; width: min(100% - 408px, (100svh - var(--nav-h) - 32px) * 16 / 9); }
  .start__win { position: static; transform: none; flex: none; }
}
@media (min-width: 701px) and (max-height: 620px) { .start .form__note { display: none; } .start .form textarea { height: 64px; } }
.form { display: grid; gap: 6px; padding-bottom: 18px; }
.form.is-sent > :not(.win__bar):not(.form__done) { display: none; }
.form__done small { display: block; margin-top: 10px; font-size: 12.5px; color: #8FA2B8; }
.form > :not(.win__bar) { margin: 0 16px; }
.form label { margin-top: 8px; font: 700 12px var(--font-sc); letter-spacing: .06em; color: #AFC0D3; }
.form input, .form textarea { font: 400 15px var(--font-body); padding: 10px; border: 1px solid #2A3A52; background: #0A0F18; color: var(--win-text); border-radius: 2px; width: auto; }
.form textarea { resize: vertical; }
.form .btn { justify-self: start; margin-top: 12px; }
.form__note { font-size: 13px; color: #9FB0C4; }
.form__err { font-size: 13px; color: #FFA877; }   /* on the dark window only (orange is never text on paper) */
.form__done b { display: block; font: 800 22px var(--font-head); color: var(--cyan); }
.form__done span { font-size: 14px; color: #C8D3E0; }
.platform { padding-bottom: 18px; }
.platform > p:not(.win__bar) { margin: 14px 16px 0; color: #C8D3E0; }
.platform .platform__big { font: 800 24px/1.2 var(--font-head); color: var(--win-text); }
@media (max-width: 700px) {   /* phone: 4:5 crop x 20.5–65.5 % (own files), the window under it */
  .start__stage { height: auto; min-height: 0; margin-top: 24px; background: none; }
  .start__scene { position: relative; inset: auto; aspect-ratio: 4 / 5; }
  .start__win { position: static; transform: none; width: auto; margin: 16px var(--gutter) 48px; }
}

/* ===== colophon ===== */
/* thread 24: the last colour plate as a 21:9 band (phone: its own 4:5 crop), credits, Raróg phase 4 and its feather,
   every chapter as a pencil thumbnail. Static = the end state (also RM); the roll and the departure are added on top. */
.colophon { position: relative; padding: 80px 0 0; text-align: center; overflow-x: clip; }
#colophon > .grp { margin: 0 0 80px; padding: 0 var(--gutter); }   /* the IV / VI heading style (shared rule above); centred in the gap: 80 px above and below (the plate's 20 px margin collapses into it) */
[data-theme="night"] .colophon .day, [data-theme="day"] .colophon .night { display: none; }
.colo__end { position: relative; margin: 20px 0 0; height: min(calc(100vw / 2.39), calc(100svh - var(--nav-h))); }
.colo__end img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.colo__end::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 24%; background: linear-gradient(to bottom, transparent, var(--paper)); pointer-events: none; }
.colo__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 640px) minmax(0, 1fr); gap: 24px; max-width: var(--wrap); margin: 8px auto 0; padding: 0 var(--gutter); align-items: start; }
.colo__roll { grid-column: 2; }
/* (a) the roll: the whole block waits one box-height below and rises into place at a steady 42 px/s (duration set in JS);
   lines surface through a soft lower edge; when it stops the mask goes, so the end state is the plain static layout */
.colo__roll.is-js { overflow: hidden; padding-bottom: 64px; -webkit-mask-image: linear-gradient(#000 calc(100% - 64px), transparent); mask-image: linear-gradient(#000 calc(100% - 64px), transparent); }
.colo__roll.is-js .colo__rollin { transform: translateY(calc(100% + 64px)); }
.colo__roll.is-on .colo__rollin { transform: none; transition: transform 10s linear; }   /* only here, or hiding it would animate too */
.colo__roll.is-done { overflow: visible; -webkit-mask-image: none; mask-image: none; }
/* (b) the departure: the feather waits unseen until it falls (JS), the bird is gone after it rises; RM / no JS = both static */
.colophon.is-js .colo__feather { opacity: 0; }
.colophon.is-landed .colo__feather { opacity: 1; }
.colophon.is-gone .colo__rarog img { opacity: 0; }
.colophon.is-landed.is-live .colo__feather { animation: colo-ember 7s ease-in-out infinite; }   /* its own ember brightens, calm */
@keyframes colo-ember { 0%, 100% { filter: none; } 50% { filter: brightness(1.16) saturate(1.2); } }
.credits { display: grid; gap: 18px; margin: 0; }
.credits dt { font: 700 12.5px var(--font-sc); letter-spacing: .09em; color: var(--text-2); }
.credits dd { margin: 2px 0 0; font: 500 19px/1.35 var(--font-head); color: var(--text); text-wrap: balance; }
.credits__next { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 40px 0 0; font: italic 500 24px/1.25 var(--font-head); color: var(--cyan-ink); }
.colo__feather { width: 110px; height: auto; flex: none; }
.colo__rarog { grid-column: 3; justify-self: end; width: 220px; margin: 0; text-align: right; }
.colo__rarog img { display: block; width: 100%; height: auto; }
.colo__rarog figcaption { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--text-2); text-wrap: balance; }
.colo__rarog figcaption b { display: block; font: 700 18px var(--font-head); color: var(--text); }
.colo__rarog .yr { display: block; font: 600 11px var(--font-sc); letter-spacing: .07em; color: var(--blue-text); }
.colo__map { max-width: var(--wrap); margin: 56px auto 0; padding: 0 var(--gutter); }
.colo__map .grp { margin: 0 0 18px; }
.thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 14px; margin: 0; padding: 0; list-style: none; }
.thumbs li { flex: 0 0 calc((100% - 5 * 14px) / 6); }
.thumbs a { display: block; color: inherit; text-decoration: none; }
.thumbs .th { display: block; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--rule); background: #fff; transition: border-color .3s ease; }
[data-theme="night"] .thumbs .th { background: #0C1726; }
.thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumbs b { display: block; margin-top: 6px; font: 700 13px var(--font-sc); letter-spacing: .06em; color: var(--cyan-ink); }
.thumbs small { display: block; font: italic 500 13px/1.25 var(--font-head); color: var(--text-2); text-decoration: underline 1px transparent; text-underline-offset: 3px; transition: text-decoration-color .3s ease; }
.thumbs a:hover .th, .thumbs a:focus-visible .th { border-color: var(--cyan-ink); }
.thumbs a:hover small, .thumbs a:focus-visible small { text-decoration-color: currentColor; }
.fine { margin: 40px 0 0; padding: 0 var(--badge-clear) 72px; font-size: 13px; color: var(--text-2); }
.fine a { text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; transition: text-decoration-color .3s ease; }
.fine a:hover { text-decoration-color: currentColor; }
@media (max-width: 700px) {
  .colophon { padding-top: 48px; }
  #colophon > .grp { padding: 0 16px; margin-bottom: 48px; }   /* 48 above and below */
  .colo__end { height: auto; aspect-ratio: 4 / 5; }
  .colo__body { grid-template-columns: 1fr; gap: 8px; padding: 0 16px; }
  .colo__roll { grid-column: 1; }
  .colo__rarog { grid-column: 1; order: -1; width: 160px; }
  .credits dd { font-size: 17px; }
  .credits__next { font-size: 21px; }
  .colo__feather { width: 84px; }
  .colo__map { padding: 0 16px; }
  .thumbs { gap: 16px 10px; }
  .thumbs li { flex-basis: calc((100% - 10px) / 2); }
  .fine { padding: 0 16px 110px; }
}

/* ===== VII · the lake (thread 20): one full-screen plate (100svh, no pin), day / night by the time in Poland. The head and
   the "Safe zone" window stand in one column over the plate's dark bottom-left (measured: median 26 there vs 76 in the hero).
   Phone: the plate is a 4:5 crop (x 42–87 % of the frame, its own file) with the column under it on paper. ===== */
.rest { position: relative; height: 100svh; min-height: 520px; padding: 0; border-top: 0; overflow: hidden; background: #06111c; }
.rest__scene { position: absolute; inset: 0; margin: 0; }
.rest__scene img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }   /* 30 %: in low windows the staff head stays clear of the nav */
[data-theme="night"] .rest .day, [data-theme="day"] .rest .night { display: none; }
.rest__scene::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(4, 8, 14, .74), rgba(4, 8, 14, .3) 30%, transparent 50%),
              linear-gradient(to right, rgba(4, 8, 14, .4), transparent 36%); }
.rest__col { position: absolute; z-index: 1; left: max(var(--gutter), 5.5vw); bottom: max(28px, 6svh); width: min(400px, 30vw); }
.rest .page { display: block; }
.rest .chap { color: #7DE8FF; margin-bottom: 8px; text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .7); }
.rest h2 { color: #F4F1EA; margin-bottom: 10px; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
.rest .body { color: rgba(244, 241, 234, .9); font-size: 16px; margin-bottom: 18px; }
.rest__win { max-width: 320px; background: rgba(14, 21, 32, .9); }
.rest__hp { display: flex; gap: 3px; padding: 11px 14px 2px; }
.rest__hp i { flex: 1; height: 8px; border: 1px solid #2c6b80; }
.rest__hp i.on { border-color: var(--cyan); background: var(--cyan); }
.rest__hp i.re { animation: rest-refill .38s ease-out both; }   /* (a) a segment refills: white-cyan flash, then cyan */
@keyframes rest-refill { 0% { background: transparent; } 55% { background: #CFF6FF; box-shadow: 0 0 10px var(--cyan); } 100% { background: var(--cyan); box-shadow: none; } }
.rest__win .rest__lbl { padding-top: 2px; font-size: 13px; color: #9AA7B8; }
.rest__saved { display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-top: 1px solid var(--win-line); font: 700 12px var(--font-sc); letter-spacing: .08em; color: #7DE8FF; }
.rest__saved i { width: 8px; height: 8px; border: 1.5px solid currentColor; transform: rotate(45deg); }
.rest__win:not(.is-saved) .rest__saved { opacity: 0; }   /* space kept, no jump */
.rest__win.is-saved .rest__saved { transition: opacity .5s ease; }
.rest__win.is-saved .rest__saved i { animation: rest-turn 1.1s cubic-bezier(.4, 0, .2, 1); }
@keyframes rest-turn { from { transform: rotate(-135deg); } to { transform: rotate(45deg); } }
@media (prefers-reduced-motion: reduce) { .rest__hp i.re, .rest__win.is-saved .rest__saved i { animation: none; } }
/* (b) drop + rings, in frame fractions measured on the 2688 × 1520 source: the ball spans x 64.4–68.9 %, so the drop runs
   off its right edge (68.6 %, from 25.5 %) and lands on open water at 64.3 % (the roots start at 66.4 %, the pier corner at
   68.8 % / 69.7 %); the painted rings sit to the right (centre 71.8 % / 66.6 %). Extra drawn rings were tried and dropped
   (developer: "looks like a bug"): only the painted rings answer, as a glow. One 6 s loop: fall ≈ 1.1 s, glow ≈ 0.9 s up and 2.5 s down, then a pause. */
.rest__fx { position: absolute; pointer-events: none; }
[data-theme="night"] .rest__fx .day, [data-theme="day"] .rest__fx .night { display: none; }
.rest__fx > * { position: absolute; animation: 6s infinite paused; }   /* slowed (developer): 2.8 → 6 s */
.rest.is-live .rest__fx > * { animation-play-state: running; }
.rest__fx > .rest__rings { left: 61.756%; top: 62.5%; width: 28.274%; height: 10.526%; opacity: 0; animation-name: rest-glow; animation-timing-function: ease-out; } /* ".rest__fx >": ".rest__scene img" (100 % × 100 %) outranked the bare class and blew the rings up over the text (fixed thread 23) */
.rest__drop { left: 68.6%; top: 25.5%; width: .34%; aspect-ratio: 3 / 5; translate: -50% 0; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 68%, #fff, #7DE8FF 55%, var(--cyan)); box-shadow: 0 0 8px var(--cyan), 0 0 2px #fff; opacity: 0;
  animation-name: rest-fall; animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
.rest__drop::before { content: ""; position: absolute; left: 30%; right: 30%; bottom: 60%; height: 420%; border-radius: 2px;
  background: linear-gradient(to bottom, transparent, rgba(125, 232, 255, .75)); }   /* a short trail, only while it falls */
@keyframes rest-fall { 0% { top: 25.5%; opacity: 0; } 2% { opacity: 1; } 18% { top: 64.3%; opacity: 1; } 18.8%, 100% { top: 64.3%; opacity: 0; } }   /* fall ≈ 1.1 s */
@keyframes rest-glow { 0%, 19% { opacity: 0; } 34% { opacity: .85; } 75%, 100% { opacity: 0; } }
/* (c) day only: the far water just under the shore (y 47.1–50.1 %, cut from its own bright pixels: the reflections of
   the birches and the oak, mage and staff left out) shimmers; bright bands drift slowly to the right, 18 s. */
.rest__fx > .rest__glint { left: 0; top: 47.105%; width: 100%; height: 3.026%; filter: brightness(1.35);
  -webkit-mask: repeating-linear-gradient(90deg, transparent 0 2.5%, #000 4.5%, transparent 6.5% 11%) 0 0 / 200% 100%;
          mask: repeating-linear-gradient(90deg, transparent 0 2.5%, #000 4.5%, transparent 6.5% 11%) 0 0 / 200% 100%;
  animation: rest-shimmer 18s linear infinite paused; }   /* slowed (developer): 9 → 18 s */
.rest.is-live .rest__fx > .rest__glint { animation-play-state: running; }
@keyframes rest-shimmer { to { -webkit-mask-position: 100% 0; mask-position: 100% 0; } }
/* (d) night only, "the mage's sight": the cyan line along the catfish's head and back (cut by hue in x 66.2–100 %,
   y 46.1–62.4 %, above the rings) breathes, 7 s, in the same calm rhythm. */
.rest__fx > .rest__sight { left: 66.22%; top: 46.05%; width: 33.78%; height: 16.32%; opacity: 0;
  animation: rest-sight 7s ease-in-out infinite paused; }
.rest.is-live .rest__fx > .rest__sight { animation-play-state: running; }
@keyframes rest-sight { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .rest__fx { display: none; } }
/* low windows (the column would climb onto the bright far shore): no paragraph, no HP / next-period rows */
@media (min-width: 701px) and (max-height: 620px) { .rest .body, .rest__win .rest__lbl, .rest__win .rest__next { display: none; } .rest h2 { font-size: clamp(28px, 3vw, 40px); } }
@media (max-width: 700px) {
  .rest { height: auto; min-height: 0; background: var(--paper); }
  .rest__scene { position: relative; aspect-ratio: 4 / 5; }
  .rest__scene img { object-position: 50% 50%; }
  .rest__scene::after { display: none; }
  .rest__col { position: static; width: auto; padding: 28px var(--gutter) 64px; }
  .rest .chap { color: var(--cyan-ink); text-shadow: none; }   /* thread 25: the plate's black glow smudged the label on paper */
  .rest h2 { color: var(--text); text-shadow: none; }
  .rest .body { color: var(--text-2); }
  .rest__win { max-width: none; }
}
