/* Project Trinity: the site's one stylesheet.
   The look is the game's: the Wayfarers' Book, the General's ledger turned into a scrapbook of the party's adventures.
   Paper pages on a lilac sky (Day) or blue paper on the night sky (Night), Caveat Brush lettering for names and titles,
   round stickers in each hero's own colour, photos taped in, the gold brush stroke for what you're on.
   Colours are the game's own tokens (unity-b/Assets/UI/Theme/TrinityTokens.uss, the Book's build spec book.css).
   Drawn marks (paper, tape, brush strokes, stamps, clouds) are the game's own Book plates, in /img/book.
   Fonts are the game's own, self-hosted (SIL OFL; licences in /fonts). */

@font-face {
  font-family: "Caveat Brush";
  src: url("../fonts/CaveatBrush-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-Semibold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------
   Colour theory: the paper is the dominant (cream by Day, blue by Night), on a lilac sky; the gold brush is the one
   accent (gold sits opposite the sky's violet); the coral underline marks a title; each hero brings their own colour to
   their own card only. Enemies are cold, never gold. Names after TrinityTokens.uss: --book-* is --trinity-color-book-*. */
:root {
  --sky-top: #c3b3ea;                 /* book-sky-top */
  --sky-low: #f7c9d7;                 /* book-sky-low */
  --sky-rgb: 195, 179, 234;
  --cover: #b8475b;                   /* book-cover: the book's own edge */
  --paper: #f7ecd6;                   /* book-paper */
  --paper-deep: #ead8b6;              /* book-paper-deep */
  --paper-image: url("../img/book/paper-day.webp");
  --paper-rgb: 247, 236, 214;
  --paper-size: 1024px 1024px;        /* the paper is a seamless 2048 px tile, drawn at twice the screen's density */
  --ink: #2b2452;                     /* book-ink */
  --ink-soft: #625a86;                /* book-ink-soft */
  --rule: rgba(43, 36, 82, 0.16);     /* book-rule */
  --wash: rgba(176, 156, 226, 0.34);  /* book-wash: lilac behind a value */
  --focus: #f2b53c;                   /* book-focus: the gold brush */
  --focus-star: #fff4cf;              /* book-focus-star */
  --focus-wash: rgba(242, 181, 60, 0.45);
  --stamp: #c8323c;                   /* book-stamp */
  --photo: #fdfaf2;                   /* a photo's border */
  --shadow: rgba(30, 20, 60, 0.32);   /* book-shadow, a touch lighter for the web */
  --cold: #6f7cff;                    /* book-shout-glow: the enemy's cold */
  --link: #5b3db0;
  --on-sky: #2b2452;
  --on-sky-soft: #4a4275;

  /* each friend's own colour (friend-*), for their card only */
  --bastion: #b3262a;
  --oracle: #7fc4ff;
  --reaver: #d0182c;
  --asha: #ff46b8;

  /* over a picture: the same by Day and Night */
  --film-text: #fbf5ea;
  --film-soft: #e6dcf2;

  --font-hand: "Caveat Brush", "Segoe Print", "Comic Sans MS", cursive;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  --measure: 62ch;
  --page: 68.75rem;                   /* 1100 px at the base size; grows with the type on large screens */
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;

  color-scheme: light;
}

/* Night: dark blue paper, chalk writing */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky-top: #12163a;
    --sky-low: #3b2f68;
    --sky-rgb: 18, 22, 58;
    --cover: #2c2960;
    --paper: #222a5a;
    --paper-deep: #181e45;
    --paper-image: url("../img/book/paper-night.webp");
    --paper-rgb: 34, 42, 90;
    --ink: #efe9f8;
    --ink-soft: #aea8d2;
    --rule: rgba(239, 233, 248, 0.16);
    --wash: rgba(150, 132, 230, 0.30);
    --photo: #e9e4f4;
    --shadow: rgba(4, 4, 16, 0.5);
    --link: #f5c768;
    --on-sky: #efe9f8;
    --on-sky-soft: #c9c2e8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sky-top: #12163a;
  --sky-low: #3b2f68;
  --sky-rgb: 18, 22, 58;
  --cover: #2c2960;
  --paper: #222a5a;
  --paper-deep: #181e45;
  --paper-image: url("../img/book/paper-night.webp");
  --paper-rgb: 34, 42, 90;
  --ink: #efe9f8;
  --ink-soft: #aea8d2;
  --rule: rgba(239, 233, 248, 0.16);
  --wash: rgba(150, 132, 230, 0.30);
  --photo: #e9e4f4;
  --shadow: rgba(4, 4, 16, 0.5);
  --link: #f5c768;
  --on-sky: #efe9f8;
  --on-sky-soft: #c9c2e8;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
/* Large screens: the type, and the page and post widths set in rem with it, step up so nothing reads tiny
   (his note, 2026-11-25); a post's line stays near 70 characters. */
@media (min-width: 1600px) { html { font-size: 106.25%; } }
@media (min-width: 2000px) { html { font-size: 112.5%; } }
@media (min-width: 2560px) { html { font-size: 125%; } }

body {
  margin: 0;
  color: var(--on-sky);
  background-color: var(--sky-top);
  /* the Book's painted sky at the head of the page, melting into the sky's own lilac and rose below */
  /* The sky is drawn at 4K with its lilac veil and its fade to clear built in (tools/make-textures.py), so it melts into
     the colour beneath at any width. (A veil of fixed height laid over it ended in a hard band on wide screens.) */
  background-image:
    url("../img/book/sky-day-3840.webp"),
    linear-gradient(180deg, var(--sky-top) 0, var(--sky-top) 1400px, var(--sky-low) 100%);
  background-repeat: no-repeat;
  background-position: top center, 0 0;
  background-size: max(100%, 2400px) auto, 100% 100%;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
/* Night: the clouds dim and a few stars come out */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background-image:
      radial-gradient(1.4px 1.4px at 12% 18%, rgba(255, 244, 207, 0.85), transparent 60%),
      radial-gradient(1px 1px at 78% 9%, rgba(255, 244, 207, 0.7), transparent 60%),
      radial-gradient(1.6px 1.6px at 41% 33%, rgba(255, 244, 207, 0.8), transparent 60%),
      radial-gradient(1px 1px at 88% 46%, rgba(255, 244, 207, 0.6), transparent 60%),
      radial-gradient(1.2px 1.2px at 63% 84%, rgba(255, 244, 207, 0.7), transparent 60%),
      linear-gradient(180deg, var(--sky-top) 0%, var(--sky-low) 100%);
    background-repeat: repeat, repeat, repeat, repeat, repeat, no-repeat;
    background-size: 640px 640px, 640px 640px, 640px 640px, 640px 640px, 640px 640px, 100% 100%;
    background-position: 0 0;
  }
}
:root[data-theme="dark"] body {
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(255, 244, 207, 0.85), transparent 60%),
    radial-gradient(1px 1px at 78% 9%, rgba(255, 244, 207, 0.7), transparent 60%),
    radial-gradient(1.6px 1.6px at 41% 33%, rgba(255, 244, 207, 0.8), transparent 60%),
    radial-gradient(1px 1px at 88% 46%, rgba(255, 244, 207, 0.6), transparent 60%),
    radial-gradient(1.2px 1.2px at 63% 84%, rgba(255, 244, 207, 0.7), transparent 60%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-low) 100%);
  background-repeat: repeat, repeat, repeat, repeat, repeat, no-repeat;
  background-size: 640px 640px, 640px 640px, 640px 640px, 640px 640px, 640px 640px, 100% 100%;
  background-position: 0 0;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-hand);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  letter-spacing: 0.01em;
}

p { margin: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 60;
  padding: 0.5rem 1rem;
  background: var(--focus);
  color: #2b2452;
  font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Paper: every card, sheet and slip is a piece of the Book's paper ---- */
.paper,
.card,
.post-row,
.study,
.contact-aside {
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--paper-image);
  background-size: var(--paper-size);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(120, 90, 60, 0.18), 4px 10px 22px -6px var(--shadow);
}

/* a title: hand lettering with the coral brush underline and the gold star */
.title-mark {
  position: relative;
  display: inline-block;
  padding: 0 0.15em 0.32em 0;
}
.title-mark::after {
  content: "";
  position: absolute;
  left: 0.2em; right: -0.2em; bottom: -0.12em;
  height: 0.42em;
  background: url("../img/book/underline-coral.webp") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
.title-star::before {
  content: "";
  position: absolute;
  right: -0.72em; top: -0.32em;
  width: 0.7em; height: 0.72em;
  background: url("../img/book/focus-star.webp") 0 0 / 100% 100% no-repeat;
  transform: rotate(4deg);
}

/* ---- Buttons ------------------------------------------------------------
   The gold brush is the one accent: it marks the thing to press. The quiet button is a paper slip. */
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.35rem 1.4rem 0.4rem;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  line-height: 1.1;
  text-decoration: none;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  isolation: isolate;
}
.button svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.button-gold {
  color: #2b2452;
  background: transparent;
  padding-left: 2rem;
  padding-right: 2.2rem;
}
.button-gold::before {
  content: "";
  position: absolute;
  inset: -6px -10px;
  z-index: -1;
  background: url("../img/book/focus-brush.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(1px 3px 3px rgba(30, 20, 60, 0.3));
  transition: transform 160ms ease;
}
.button-gold:hover::before { transform: scale(1.04) rotate(-0.6deg); }
.button-slip {
  color: #2b2452;
  background: url("../img/book/slip-long.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(1px 3px 3px rgba(30, 20, 60, 0.3));
  padding-left: 1.8rem;
  padding-right: 1.8rem;
}
.button-slip:hover { text-decoration: underline; text-decoration-thickness: 2px; }
@media (prefers-reduced-motion: reduce) {
  .button-gold::before { transition: none; }
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--link);
}
.more::after { content: "\2192"; font-family: var(--font-body); font-size: 1rem; transition: transform 160ms ease; }
.more:hover { text-decoration: underline; }
.more:hover::after { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .more::after { transition: none; }
}

/* ---- The header: one for every page, staying at the top ------------------
   Clear over a picture, a strip of the Book's paper once the page scrolls (site.js sets .is-solid). */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  isolation: isolate;
  color: var(--ink);
  box-shadow: 0 6px 18px -10px var(--shadow);
  transition: box-shadow 200ms ease;
}
/* the Book's paper is a layer of its own, so it fades in under the words in place (over a picture, on scroll,
   or when the phone menu opens) instead of the whole header redrawing */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--paper);
  background-image: var(--paper-image);
  background-size: var(--paper-size);
  transition: opacity 200ms ease;
}
.site-header.is-clear:not(.is-solid):not(.is-open) {
  background: linear-gradient(180deg, rgba(10, 8, 30, 0.7), rgba(10, 8, 30, 0));
  box-shadow: none;
}
.site-header.is-clear:not(.is-solid):not(.is-open)::before { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header::before { transition: none; }
}
.header-bar {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-hand);
  font-size: 1.65rem;
  line-height: 1;
  margin-right: auto;
  white-space: nowrap;
}


.header-menu {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.header-menu ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 0.4rem;
}
.header-menu ul a {
  position: relative;
  display: inline-block;
  padding: 0.2rem 0.65rem 0.25rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  line-height: 1.2;
  isolation: isolate;
}
/* the lilac wash on hover, the gold brush on the page you're on (the Book's contents entries) */
.header-menu ul a::before {
  content: "";
  position: absolute;
  inset: 4px -4px 0;
  z-index: -1;
  background: url("../img/book/row-wash-short.webp") center / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity 140ms ease;
}
.header-menu ul a:hover::before { opacity: 0.85; }
.header-menu ul a[aria-current]::before {
  background-image: url("../img/book/focus-brush.webp");
  opacity: 1;
}
.header-menu ul a[aria-current] { color: #2b2452; }
.header-menu ul a[aria-current]::after {
  content: "";
  position: absolute;
  left: -12px; top: 50%;
  width: 22px; height: 23px;
  margin-top: -11px;
  background: url("../img/book/focus-star.webp") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
.header-tools { display: flex; align-items: center; gap: 0.9rem; }
.header-cta { min-height: 42px; font-size: 1.3rem; padding: 0.2rem 1.7rem 0.25rem 1.5rem; }
.header-list {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.2rem 0.85rem 0.25rem;
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--wash);
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  white-space: nowrap;
}
.header-list:hover { border-color: var(--ink); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.2rem 0.85rem 0.25rem;
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--ink);
  background: var(--wash);
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  cursor: pointer;
}
.theme-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle .on-night { display: none; }
.theme-toggle[aria-pressed="true"] .on-day { display: none; }
.theme-toggle[aria-pressed="true"] .on-night { display: inline; }

.menu-button {
  display: none;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.2rem 0.9rem 0.25rem;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--ink);
  background: var(--wash);
  border: 1.5px solid var(--ink-soft);
  border-radius: 4px;
  cursor: pointer;
}
.menu-button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }

@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js .site-header.is-open .header-menu { animation: none; } }

/* the header's words over a picture */
.site-header.is-clear:not(.is-solid):not(.is-open) .mark,
.site-header.is-clear:not(.is-solid):not(.is-open) .header-menu ul a:not([aria-current]),
.site-header.is-clear:not(.is-solid):not(.is-open) .theme-toggle,
.site-header.is-clear:not(.is-solid):not(.is-open) .header-list,
.site-header.is-clear:not(.is-solid):not(.is-open) .menu-button { color: var(--film-text); }
.site-header.is-clear:not(.is-solid):not(.is-open) .theme-toggle,
.site-header.is-clear:not(.is-solid):not(.is-open) .header-list,
.site-header.is-clear:not(.is-solid):not(.is-open) .menu-button { border-color: rgba(251, 245, 234, 0.7); background: rgba(10, 8, 30, 0.3); }
.site-header.is-clear:not(.is-solid):not(.is-open) .header-menu ul a:hover::before { opacity: 0.6; }

/* a page without a picture at the top starts below the header */
.page-top { padding-top: var(--header-h); }

/* ---- Front page: the cinematic first screen ----------------------------- */
.cine {
  position: relative;
  min-height: min(100vh, 980px);
  display: flex;
  align-items: flex-end;
  color: var(--film-text);
  isolation: isolate;
}
@supports (min-height: 100svh) {
  .cine { min-height: min(100svh, 980px); }
}
/* the still, the silent B-roll over it, and the scrim that keeps the words readable over any frame */
.cine-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #05070c;
  overflow: hidden;
}
.cine-picture,
.cine-picture img,
.cine-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cine-picture img,
.cine-video { object-fit: cover; object-position: 55% 42%; }
.cine-video { opacity: 0; transition: opacity 600ms ease; }
.cine-video.is-playing { opacity: 1; }
/* motion turned off: the still only */
@media (prefers-reduced-motion: reduce) {
  .cine-video { display: none; }
}
.cine-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(10, 8, 30, 0.82) 0, rgba(10, 8, 30, 0.42) 46%, rgba(10, 8, 30, 0.12) 70%, rgba(10, 8, 30, 0.5) 100%),
    linear-gradient(90deg, rgba(10, 8, 30, 0.62) 0, rgba(10, 8, 30, 0.12) 62%, rgba(10, 8, 30, 0) 100%);
}

/* The edge between the first screen and the page: the picture melts into the sky over its last third (his pick). */
.cine-media {
  -webkit-mask: linear-gradient(180deg, #000 0, #000 62%, rgba(0, 0, 0, 0.55) 82%, transparent 100%);
  mask: linear-gradient(180deg, #000 0, #000 62%, rgba(0, 0, 0, 0.55) 82%, transparent 100%);
}
.cine-edge { position: absolute; inset: 0; z-index: -1; }

.cine-text { padding-bottom: clamp(150px, 24vh, 250px); }

.cine-text {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: calc(var(--header-h) + 40px) var(--gutter) clamp(150px, 24vh, 250px);
}
.cine-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.6rem;
}
/* "Alpha" as a stamp */
.status-stage {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.3rem 0.75rem 0.35rem;
  color: #fff4ec;
  background: var(--stamp);
  border: 2px dashed rgba(255, 244, 236, 0.75);
  border-radius: 4px;
  transform: rotate(-4deg);
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.35);
}
.platforms {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 0.8rem;
}
.platforms svg { width: 22px; height: 22px; fill: currentColor; }
.cine h1 {
  font-size: clamp(3rem, 9vw, 6.6rem);
  line-height: 0.92;
  max-width: 12ch;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.55);
}
.cine h1 .title-mark { padding-bottom: 0.18em; }
.cine-line {
  margin-top: 1.1rem;
  max-width: 44ch;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.45;
  color: var(--film-text);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}
.cine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: clamp(24px, 3vw, 34px);
}

/* ---- The film, in a window over the page --------------------------------- */
.film-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--film-text);
}
.film-dialog::backdrop { background: rgba(18, 16, 40, 0.86); }
.film-dialog-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 12px;
}
.film-dialog-bar p { font-family: var(--font-hand); font-size: 1.4rem; color: var(--film-soft); }
.film-close {
  min-height: 40px;
  padding: 0.2rem 1rem 0.25rem;
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--film-text);
  background: transparent;
  border: 1.5px solid rgba(251, 245, 234, 0.7);
  border-radius: 999px;
  cursor: pointer;
}
.film-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 10px solid #fdfaf2;
  border-bottom-width: 14px;
  background: #05070c;
  box-shadow: 4px 10px 26px rgba(0, 0, 0, 0.5);
}

/* ---- Sections ------------------------------------------------------------ */
.section { margin-top: clamp(64px, 9vw, 112px); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: clamp(22px, 3vw, 34px);
}
.section-head h2 {
  font-size: clamp(2.4rem, 4.6vw, 3.4rem);
  color: var(--on-sky);
}
.section-lede { max-width: var(--measure); color: var(--on-sky-soft); margin: -0.6rem 0 1.6rem; }

/* page heads, for pages without a picture */
.page-head { padding-top: clamp(40px, 7vw, 84px); }
.eyebrow {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  color: var(--on-sky-soft);
  margin-bottom: 0.2rem;
}
.page-head h1 {
  font-size: clamp(3rem, 8vw, 5.4rem);
  color: var(--on-sky);
  max-width: 16ch;
}
.page-head .lede {
  margin-top: 1.1rem;
  max-width: 56ch;
  font-size: clamp(1.15rem, 1.8vw, 1.32rem);
  color: var(--on-sky-soft);
}

/* ---- Front page: the game ------------------------------------------------ */
.game {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding: clamp(24px, 4vw, 44px) clamp(20px, 4vw, 48px);
}
.game-sheet { margin-top: clamp(8px, 2vw, 20px); }
.pitch {
  max-width: var(--measure);
  display: grid;
  gap: 0.55rem;
  font-size: clamp(1.15rem, 1.6vw, 1.3rem);
  line-height: 1.5;
}
.pitch p:first-child {
  font-family: var(--font-hand);
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  line-height: 1.15;
  margin-bottom: 0.3rem;
}
.made h2 {
  font-size: 2rem;
  margin-bottom: 0.9rem;
}
.shard-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 46ch;
  font-size: 1.04rem;
}
.shard-list li { padding-left: 1.6rem; position: relative; }
/* the Book's gold star as the bullet */
.shard-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.2em;
  width: 1.05em; height: 1.08em;
  background: url("../img/book/focus-star.webp") 0 0 / 100% 100% no-repeat;
}

/* the party, a roster of stickers */
.party-strip {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2.4vw, 28px);
}
.party-strip a {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 1.3rem 0.75rem 1.1rem;
  text-align: center;
  text-decoration: none;
  border-top: 6px solid var(--hero, var(--focus));
  transition: transform 160ms ease;
}
.party-strip li:nth-child(2n) a { transform: rotate(1deg); }
.party-strip li:nth-child(2n+1) a { transform: rotate(-1deg); }
.party-strip a:hover { transform: translateY(-3px) rotate(0deg); }
@media (prefers-reduced-motion: reduce) {
  .party-strip a, .party-strip a:hover { transition: none; }
}
.party-strip strong.slip {
  position: relative;
  z-index: 2;
  filter: none; /* a filter over its words drops them in Chrome when drawn off-screen */
  font-weight: 400;
  font-size: 1.55rem;
  margin-top: -0.9rem;
  margin-bottom: 0.2rem;
}
.party-strip span { font-size: 0.95rem; color: var(--ink-soft); }
.party-strip .sticker { width: clamp(88px, 11vw, 128px); }

.boss-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.boss-strip a { --hero: var(--cold); }
.boss-strip a.is-coming { --hero: var(--ink-soft); }
.boss-strip .coming-plate { width: clamp(88px, 11vw, 128px); }
.party-strip strong.slip { max-width: 100%; }

/* the small line at the front page's foot */
.foot-line {
  margin-top: clamp(48px, 7vw, 80px);
  font-size: 1.1rem;
  color: var(--on-sky);
  text-align: center;
}
.foot-line a { color: var(--link); font-weight: 600; }

/* the hero's own colour, on their own card */
[data-hero="bastion"] { --hero: var(--bastion); }
[data-hero="oracle"] { --hero: var(--oracle); }
[data-hero="reaver"] { --hero: var(--reaver); }
[data-hero="asha"] { --hero: var(--asha); }

/* ---- Stickers, stamps, photos, tape (the Book's own parts) --------------- */
/* A round die-cut sticker: the white rim and its shadow, the painted face, a ring of the hero's colour */
.sticker {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 6px;
  background: #fffdf8;
  box-shadow: 0 0 0 4px var(--hero, var(--focus)), 3px 6px 10px rgba(30, 20, 60, 0.4);
  transform: rotate(-3deg);
}
.sticker img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sticker .stamp {
  position: absolute;
  right: -10%; bottom: -6%;
  width: 34%;
  height: auto;
  border-radius: 0;
  transform: rotate(6deg);
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.3));
}

/* A photograph taped in */
.photo {
  position: relative;
  display: block;
  padding: 10px 10px 14px;
  background: #fdfaf2;
  transform: rotate(-1.4deg);
  box-shadow: 0 0 0 1px rgba(120, 90, 60, 0.25), 4px 8px 16px rgba(30, 20, 60, 0.32);
}
.photo > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.photo.tilt-right { transform: rotate(1.2deg); }
.photo::before,
.photo::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 92px; height: 34px;
  background: url("../img/book/tape-1.webp") 0 0 / 100% 100% no-repeat;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.2));
  pointer-events: none;
}
.photo::before { left: -30px; top: -8px; transform: rotate(-32deg); }
.photo::after { right: -30px; top: -8px; transform: rotate(30deg); background-image: url("../img/book/tape-3.webp"); }

/* a name slip, the Book's torn paper tag */
.slip {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1.2;
  padding: 0.1rem 1.1rem 0.2rem;
  color: #2b2452;
  background: url("../img/book/slip-mid.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(1px 2px 2px rgba(30, 20, 60, 0.28));
  transform: rotate(-2deg);
  white-space: nowrap;
}

/* two cards side by side: the newest post and the research teaser */
.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3.4vw, 40px);
  align-items: start;
}
.card { display: flex; flex-direction: column; }
.card-body { padding: clamp(18px, 2.4vw, 28px); display: grid; gap: 0.7rem; align-content: start; flex: 1; }
.card .photo { margin: clamp(18px, 2.4vw, 26px) clamp(18px, 2.4vw, 26px) 0; }
.card h2, .card h3 { font-size: clamp(1.8rem, 2.8vw, 2.25rem); line-height: 1.05; }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.card-kicker { font-family: var(--font-hand); color: var(--ink-soft); font-size: 1.3rem; }
.card p { color: var(--ink-soft); }
.card .more { margin-top: auto; padding-top: 0.4rem; }
.card-links { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.card-links a {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.6rem;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 1.45rem;
  text-decoration: none;
  isolation: isolate;
}
.card-links a::before {
  content: "";
  position: absolute;
  inset: 4px 0 2px;
  z-index: -1;
  background: url("../img/book/row-wash-long.webp") left center / 100% 100% no-repeat;
  opacity: 0.75;
}
.card-links li:nth-child(2) a::before { background-image: url("../img/book/row-wash-mid.webp"); right: 12%; }
.card-links a::after { content: "\2192"; font-family: var(--font-body); font-size: 1rem; }
.card-links a:hover,
.card-links a:focus-visible { color: #2b2452; }
.card-links a:hover::after,
.card-links a:focus-visible::after { color: #2b2452; }
.card-links a:hover::before,
.card-links a:focus-visible::before { background-image: url("../img/book/focus-brush.webp"); opacity: 1; right: 0; }
.card-links li { position: relative; }
.card-links li:has(a:hover)::before,
.card-links li:has(a:focus-visible)::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: -14px; top: 50%;
  width: 26px; height: 27px;
  margin-top: -13px;
  background: url("../img/book/focus-star.webp") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

/* ---- The book: request a build and join the list ------------------------ */
.book {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--paper-image);
  background-size: var(--paper-size);
  box-shadow:
    0 0 0 1px rgba(120, 90, 60, 0.25),
    6px 7px 0 -1px var(--paper-deep),   /* the page stack */
    0 22px 50px -18px rgba(18, 16, 40, 0.55);
  border-radius: 6px;
}
.book-single { grid-template-columns: 1fr; max-width: 720px; }
.page {
  position: relative;
  padding: clamp(24px, 4vw, 52px) clamp(20px, 4vw, 52px) clamp(28px, 4vw, 48px);
}
.spine {
  background: linear-gradient(90deg, rgba(30, 20, 60, 0.18), rgba(30, 20, 60, 0.04) 40%, rgba(30, 20, 60, 0.04) 60%, rgba(30, 20, 60, 0.18));
}
.page h2,
.page h3 {
  font-size: clamp(2.3rem, 4vw, 3rem);
  color: var(--ink);
}
.page-lede {
  margin-top: 0.6rem;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.04rem;
}
.page-foot {
  margin-top: 1.6rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.page a { color: var(--link); }

.ledger-form { margin-top: 1.4rem; display: grid; gap: 1.15rem; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label,
.field > legend {
  display: block;
  padding: 0;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.optional { font-family: var(--font-body); font-size: 0.9rem; color: var(--ink-soft); }

/* writing on the ledger's ruled line, over the lilac wash */
.ledger-form input[type="email"],
.ledger-form input[type="text"],
.ledger-form textarea {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--wash);
  border: 0;
  border-bottom: 2px solid var(--ink-soft);
  border-radius: 4px 4px 0 0;
  padding: 0.5rem 0.6rem;
}
.ledger-form textarea { resize: vertical; min-height: 3.2rem; line-height: 1.5; }
.ledger-form input[type="email"]:focus-visible,
.ledger-form input[type="text"]:focus-visible,
.ledger-form textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-bottom-color: var(--ink);
}
.ledger-form [aria-invalid="true"] { border-bottom-color: var(--stamp); background: rgba(200, 50, 60, 0.1); }

.choices { display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; }
.choices label { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; min-height: 32px; }

/* the roster's "fit for duty" boxes */
.ticks { display: grid; gap: 0.35rem; }
.tick { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; min-height: 32px; }
.ledger-form input[type="checkbox"],
.ledger-form input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px; height: 22px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: rgba(var(--paper-rgb), 0.6);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.ledger-form input[type="radio"] { border-radius: 50%; }
.ledger-form input[type="checkbox"]::after {
  content: "";
  width: 7px; height: 12px;
  border: solid var(--stamp);
  border-width: 0 3px 3px 0;
  transform: rotate(42deg) translate(-1px, -1px);
  opacity: 0;
}
.ledger-form input[type="radio"]::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--stamp);
  opacity: 0;
}
.ledger-form input:checked::after { opacity: 1; }
.ledger-form input[type="checkbox"]:focus-visible,
.ledger-form input[type="radio"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ledger-form input[aria-invalid="true"][type="checkbox"],
.ledger-form input[aria-invalid="true"][type="radio"] { border-color: var(--stamp); border-width: 2.5px; }

/* Send: the gold brush */
.seal {
  position: relative;
  justify-self: start;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  line-height: 1.1;
  color: #2b2452;
  background: transparent;
  border: 0;
  padding: 0.4rem 2.1rem 0.45rem 1.9rem;
  min-height: 48px;
  cursor: pointer;
  isolation: isolate;
}
.seal::before {
  content: "";
  position: absolute;
  inset: -2px -10px;
  z-index: -1;
  background: url("../img/book/focus-brush.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(1px 3px 3px rgba(30, 20, 60, 0.3));
  transition: transform 160ms ease;
}
.seal:hover::before { transform: scale(1.04) rotate(-0.6deg); }
.seal:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
/* Send stays off until site.js arms the form (no script, no send), and while a form is sending */
.seal:disabled { opacity: 0.5; cursor: not-allowed; }
.seal:disabled:hover::before { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .seal::before { transition: none; }
}

.form-note { font-size: 0.98rem; color: var(--ink); min-height: 1.5em; }
.form-note.is-error { color: var(--stamp); font-weight: 600; }

/* ---- Shatterbound: the heroes ------------------------------------------- */
.heroes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 34px);
}
.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  align-content: start;
  gap: clamp(14px, 2vw, 22px);
  padding: clamp(18px, 2.4vw, 26px);
  border-top: 7px solid var(--hero, var(--focus));
}
/* The portrait slot is 4:5, ready for Models 101's cut-outs (portrait-<id>-4x5.png).
   Today it holds the game's round sticker in the hero's own colour. */
.portrait {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
}
.portrait .sticker { width: 92%; }
.portrait img.is-cutout { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.hero-card h3 {
  font-size: clamp(2.3rem, 3.6vw, 2.9rem);
  line-height: 1;
}
.role-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin: 0.35rem 0 0.8rem;
}
.role {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.05rem 0.75rem 0.1rem;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  line-height: 1.3;
  color: #fffdf8;
  background: var(--hero, var(--focus));
  border-radius: 999px;
  transform: rotate(-2deg);
}
.role svg { width: 14px; height: 14px; fill: currentColor; }
[data-hero="oracle"] .role { color: #12305a; }
[data-hero="asha"] .role { color: #2b2452; }
.resource { font-size: 0.92rem; color: var(--ink-soft); }
.hero-card .one-line { font-size: 1.05rem; }
.skills {
  grid-column: 2;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  font-size: 0.98rem;
}
.skills b {
  position: relative;
  display: inline-block;
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.15;
  padding: 0 0.6rem 0 0.35rem;
  margin-bottom: 0.1rem;
  isolation: isolate;
}
.skills b::before {
  content: "";
  position: absolute;
  inset: 3px -4px 0 -4px;
  z-index: -1;
  background: url("../img/book/row-wash-mid.webp") center / 100% 100% no-repeat;
  opacity: 0.8;
}
.skills span { display: block; color: var(--ink-soft); }

/* ---- Shatterbound: the bosses -------------------------------------------- */
.bosses { display: grid; gap: clamp(20px, 3vw, 30px); }
.boss-card {
  --hero: var(--cold);
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
  padding: clamp(18px, 2.4vw, 26px);
  border-top: 7px solid var(--cold);
}
.boss-card h3 { font-size: clamp(2.3rem, 3.6vw, 2.9rem); line-height: 1; }
.boss-place { margin: 0.3rem 0 0.7rem; font-family: var(--font-hand); font-size: 1.3rem; color: var(--ink-soft); }
.boss-card .about { max-width: var(--measure); }
.boss-card.is-coming { --hero: var(--ink-soft); border-top-color: var(--ink-soft); }
.coming-plate {
  aspect-ratio: 1;
  width: 92%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px dashed var(--ink-soft);
  opacity: 0.8;
}
.coming-mark { width: 44%; color: var(--ink-soft); }
.tag-coming {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.6rem 0.15rem;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.2;
  vertical-align: middle;
  color: #fff4ec;
  background: var(--stamp);
  border: 1.5px dashed rgba(255, 244, 236, 0.7);
  border-radius: 3px;
  transform: rotate(-4deg);
}

/* the walkthrough, folded behind a click */
.walk { grid-column: 2; border-top: 1.5px dashed var(--rule); }
.walk summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.6rem;
  min-height: 48px;
  padding: 0.6rem 0 0.3rem;
  cursor: pointer;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--link);
  list-style: none;
}
.walk summary::-webkit-details-marker { display: none; }
.walk summary::before {
  content: "";
  width: 10px; height: 10px;
  border: solid currentColor;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
  flex: none;
}
.walk[open] summary::before { transform: rotate(45deg) translate(-2px, -2px); }
@media (prefers-reduced-motion: reduce) {
  .walk summary::before { transition: none; }
}
.walk summary:hover { text-decoration: underline; }
.walk summary .spoiler { font-family: var(--font-body); color: var(--ink-soft); font-size: 0.92rem; }
.walk-body { display: grid; gap: 1.4rem; padding: 0.9rem 0 0.4rem; }
/* The banner slot is 16:9, ready for Models 101's portrait-<id>-16x9.png; today, the game's own fight card, taped in. */
.walk-photo { max-width: 640px; margin: 0.4rem 0 0.2rem 0.6rem; }
.walk h4 { font-size: 1.9rem; margin-bottom: 0.5rem; }
.walk .shard-list { max-width: var(--measure); font-size: 1rem; }
.jobs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.job {
  position: relative;
  padding: 1.1rem 1rem 1rem;
  border-radius: 4px;
  background: var(--wash);
  border-top: 4px solid var(--hero, var(--focus));
  font-size: 0.98rem;
}
.job h5 {
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.55rem;
}
.job h5 img { width: 30px; height: auto; transform: rotate(-6deg); }
.walk .walk-note { font-size: 0.92rem; color: var(--ink-soft); max-width: var(--measure); }

/* ---- Research ------------------------------------------------------------ */
.research-sections { display: grid; gap: clamp(28px, 4vw, 44px); }
.study {
  display: grid;
  grid-template-columns: minmax(0, 230px) minmax(0, 1fr);
  gap: clamp(16px, 4vw, 52px);
  align-items: start;
  padding: clamp(22px, 3.4vw, 40px);
}
.study:nth-child(2n) { transform: rotate(0.25deg); }
.study:nth-child(2n+1) { transform: rotate(-0.25deg); }
.study-num {
  font-family: var(--font-hand);
  font-size: clamp(3rem, 6vw, 4.4rem);
  line-height: 1;
  color: var(--stamp);
}
.study h2 { font-size: clamp(2rem, 3.4vw, 2.6rem); margin-top: 0.4rem; }
.study-text { display: grid; gap: 1rem; max-width: var(--measure); }
.study-text .more { margin-top: 0.3rem; }
.charts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
  margin-top: clamp(12px, 2vw, 20px);
  padding: 0 clamp(8px, 2vw, 24px);
}
.charts figure { margin: 0; }
.charts .photo > img { aspect-ratio: auto; object-fit: contain; background: #0e1230; }
.research-foot { color: var(--on-sky-soft); }
.research-foot a { color: var(--link); }

/* ---- Devlog -------------------------------------------------------------- */
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(24px, 3.4vw, 36px); }
.post-row {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
  padding: clamp(18px, 2.6vw, 30px);
}
.post-date { font-family: var(--font-hand); color: var(--ink-soft); font-size: 1.25rem; }
.post-row h2 { font-size: clamp(2rem, 3.2vw, 2.6rem); margin: 0.2rem 0 0.7rem; }
.post-row h2 a { color: var(--ink); text-decoration: none; }
.post-row h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.post-row p:not(.post-date) { max-width: var(--measure); color: var(--ink-soft); }
.list-foot { margin-top: clamp(48px, 7vw, 88px); }

/* one post: an entry on a page of the Book */
.post { max-width: calc(50rem + 2 * var(--gutter)); }
.post-sheet { padding: clamp(24px, 4.4vw, 56px); margin-top: clamp(32px, 5vw, 64px); }
.post-head h1 { font-size: clamp(2.6rem, 6vw, 4rem); margin-top: 0.2rem; }
.post-head .post-date a { color: var(--link); }
.post-figure { margin: clamp(26px, 4vw, 40px) 0 0; }
/* a photo taped into a post at its own shape (old screenshots come in every size), with a hand-written line under it */
.post-photo { margin: 0.8rem 0; }
.post-photo.post-figure { margin: clamp(26px, 4vw, 40px) 0 0; }
.post-photo .photo { width: fit-content; max-width: 100%; margin-inline: auto; }
.post-photo .photo > img {
  display: block;
  width: auto; height: auto;
  max-width: 100%; max-height: 540px;
  aspect-ratio: auto;
  object-fit: contain;
}
.post-clip .photo { width: 100%; }
.post-clip .photo > video { display: block; width: 100%; height: auto; background: #0e1230; }
.post-clip .photo > .clip-tall { display: none; }
@media (max-width: 600px) {
  .post-clip .photo > .clip-wide { display: none; }
  .post-clip .photo > .clip-tall { display: block; }
}
.post-photo figcaption {
  max-width: 62ch;
  margin: 0.9rem auto 0;
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink-soft);
  text-align: center;
}
.post-body { margin-top: clamp(26px, 4vw, 40px); display: grid; gap: 1.15rem; font-size: 1.15rem; }
.post-body h2 { font-size: clamp(2rem, 3.6vw, 2.5rem); margin-top: 1rem; }
.post-body .shard-list { font-size: 1.1rem; max-width: none; }
.post-sign { color: var(--ink-soft); font-style: italic; }
.post-nav { margin-top: clamp(32px, 5vw, 56px); padding-top: 1rem; border-top: 1.5px dashed var(--rule); }
.post + .list-foot { max-width: calc(50rem + 2 * var(--gutter)); }

/* ---- Contact -------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 19rem);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.contact-aside { display: grid; gap: 1.3rem; padding: 1.6rem 1.5rem; transform: rotate(1deg); }
.contact-aside h2 { font-size: 1.8rem; margin-bottom: 0.1rem; }
.contact-aside p { color: var(--ink-soft); }

/* ---- Footer --------------------------------------------------------------- */
.colophon {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: clamp(72px, 10vw, 130px) auto 0;
  padding: 0 var(--gutter) 40px;
  font-size: 1rem;
  color: var(--on-sky);
}
.colophon-grid {
  padding-top: 28px;
  border-top: 2px dashed rgba(var(--sky-rgb), 0);
  background: url("../img/book/underline-lilac.webp") left top / 100% 10px no-repeat;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: 1.5rem 2.5rem;
}
.colophon h2 {
  font-size: 1.7rem;
  margin-bottom: 0.25rem;
  color: var(--on-sky);
}
.colophon p { color: var(--on-sky-soft); max-width: 52ch; }
.colophon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.colophon a { color: var(--link); }
.colophon-foot { margin-top: 2rem; font-size: 0.92rem; color: var(--on-sky-soft); }
.colophon-foot + .colophon-foot { margin-top: 0.4rem; }
.colophon .colophon-foot { max-width: 90ch; }

/* ---- Wide-to-narrow -------------------------------------------------------- */
@media (max-width: 980px) {
  .heroes { grid-template-columns: 1fr; }
  .colophon-grid { grid-template-columns: 1fr 1fr 1fr; }
  .privacy { grid-column: 1 / -1; }
}

/* the header folds into a menu, wide enough that the bar's links, the two buttons and Day/Night never crowd */
@media (max-width: 1100px) {
  .menu-button { display: none; }
  .js .menu-button { display: inline-flex; }
  /* the first row keeps the closed header's height, so opening the menu moves nothing (Tooling 186) */
  .header-bar { flex-wrap: wrap; align-content: flex-start; }
  .header-bar > .mark { min-height: var(--header-h); }
  .header-menu { width: 100%; flex-wrap: wrap; padding-bottom: 0.6rem; }
  .js .header-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    padding: 0.4rem 0 1.1rem;
  }
  .js .site-header.is-open .header-menu { display: flex; animation: menu-in 160ms ease-out; }
  .js .header-menu ul { flex-direction: column; gap: 0.2rem; }
  .js .header-menu ul a { display: block; padding: 0.45rem 0.6rem; font-size: 1.7rem; }
  .header-tools { justify-content: space-between; flex-wrap: wrap; gap: 0.7rem; }
  .site-header.is-open { box-shadow: 0 18px 40px -20px rgba(18, 16, 40, 0.6); }
}

@media (max-width: 900px) {
  .game { grid-template-columns: 1fr; }
  .made { padding-top: 1.2rem; border-top: 1.5px dashed var(--rule); }
  .study { grid-template-columns: 1fr; gap: 0.6rem; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 1.0625rem; background-image: url("../img/book/sky-day-1920.webp"), linear-gradient(180deg, var(--sky-top) 0, var(--sky-top) 1400px, var(--sky-low) 100%); }
  .duo { grid-template-columns: 1fr; }
  .party-strip, .boss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .book { grid-template-columns: 1fr; }
  .spine { height: 14px; background: linear-gradient(180deg, rgba(30, 20, 60, 0.18), rgba(30, 20, 60, 0.04) 40%, rgba(30, 20, 60, 0.04) 60%, rgba(30, 20, 60, 0.18)); }

  .hero-card, .boss-card { grid-template-columns: minmax(0, 104px) minmax(0, 1fr); }
  .jobs { grid-template-columns: 1fr; }
  .walk, .skills { grid-column: 1 / -1; }
  .cine-picture img, .cine-video { object-position: 66% 42%; }
  .boss-strip li:last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 7px); }
  .post-row { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .colophon-grid { grid-template-columns: 1fr 1fr; }
  .study, .study:nth-child(2n), .study:nth-child(2n+1) { transform: none; }
}

@media (max-width: 420px) {
  .colophon-grid { grid-template-columns: 1fr; }
  .cine-actions .button { flex: 1 1 100%; }
}

@media (forced-colors: active) {
  .ledger-form input[type="checkbox"],
  .ledger-form input[type="radio"] { appearance: auto; -webkit-appearance: auto; }
  .ledger-form input::after { display: none; }
  .button-gold::before, .seal::before { display: none; }
  .button, .seal { border: 2px solid ButtonText; }
}

/* ---- The welcome note after confirming the email list (?subscribed=1) ---- */
.welcome {
  border: 0;
  padding: 0;
  max-width: min(480px, calc(100vw - 32px));
  background: transparent;
  color: var(--ink);
}
.welcome::backdrop { background: rgba(18, 16, 40, 0.6); }
.welcome-page {
  background-color: var(--paper);
  background-image: var(--paper-image);
  background-size: var(--paper-size);
  box-shadow: 0 0 0 1px rgba(120, 90, 60, 0.25), 6px 7px 0 -1px var(--paper-deep), 0 22px 50px -18px rgba(18, 16, 40, 0.55);
  border-radius: 6px;
  padding: clamp(22px, 5vw, 36px);
}
.welcome h2 { color: var(--ink); margin: 0 0 12px; font-size: clamp(2.2rem, 6vw, 2.8rem); }
.welcome p { color: var(--ink-soft); margin: 0 0 22px; }
.welcome form { margin: 0; }

/* ---- Heroes and bosses: big stickers straight on the page, no box behind them (his word) ---- */
.party-strip a,
.hero-card,
.boss-card {
  --ink: var(--on-sky);
  --ink-soft: var(--on-sky-soft);
  color: var(--on-sky);
  background: none;
  box-shadow: none;
  border-top: 0;
  padding: 0;
}
.party-strip li:nth-child(n) a { transform: none; }
.party-strip a { padding: 0.4rem 0 0; gap: 0.25rem; }
.party-strip a:hover .sticker { transform: rotate(0deg) scale(1.04); }
.party-strip .sticker { width: clamp(150px, 19vw, 232px); transition: transform 160ms ease; }
.boss-strip .sticker,
.boss-strip .coming-plate { width: clamp(140px, 15.5vw, 188px); }
.party-strip strong.slip { font-size: 1.9rem; margin-top: -1.3rem; }
.boss-strip strong.slip { font-size: 1.6rem; }
.party-strip a > span:last-child { font-size: 1.05rem; }
@media (prefers-reduced-motion: reduce) {
  .party-strip .sticker { transition: none; }
  .party-strip a:hover .sticker { transform: rotate(-3deg); }
}

.heroes { grid-template-columns: 1fr; gap: clamp(40px, 6vw, 72px); }
.bosses { gap: clamp(40px, 6vw, 72px); }
.hero-card,
.boss-card { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(20px, 3.4vw, 48px); align-items: start; }
.portrait { aspect-ratio: auto; }
.portrait .sticker { width: 100%; padding: 9px; box-shadow: 0 0 0 6px var(--hero, var(--focus)), 4px 8px 14px rgba(30, 20, 60, 0.4); }
.portrait .coming-plate { width: 100%; }
.hero-card h3, .boss-card h3 { font-size: clamp(2.8rem, 4.6vw, 3.6rem); }
.hero-card .one-line { font-size: 1.15rem; max-width: var(--measure); }
.hero-card .portrait { grid-row: span 2; }
.skills { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.6rem; }
.skills span { color: var(--on-sky-soft); }
.boss-card .portrait { grid-row: span 2; }
.walk { border-top: 0; }
@media (max-width: 980px) {
  .skills { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero-card, .boss-card { grid-template-columns: 1fr; justify-items: start; }
  .hero-card .portrait, .boss-card .portrait { grid-row: auto; width: min(72%, 280px); justify-self: center; }
  .party-strip .sticker { width: min(38vw, 170px); }
  .boss-strip .sticker, .boss-strip .coming-plate { width: min(34vw, 150px); }
  .party-strip strong.slip { font-size: 1.5rem; margin-top: -1rem; }
}

/* The words beside a sticker sit on a soft backing of the paper's colour (the sticker itself has none):
   no edge, no shadow. Body text there is never under 16 px, in full ink. */
.hero-card > div,
.boss-card > div:not(.portrait),
.skills,
.walk {
  padding: 1rem 1.3rem 1.15rem;
  border-radius: 14px;
  background: rgba(var(--paper-rgb), 0.86);
}
.hero-card, .boss-card { row-gap: 10px; }
.walk-body { padding: 0.6rem 0 0.2rem; }
.walk summary { padding: 0; min-height: 40px; }
.hero-card .one-line, .boss-card .about { font-size: 1.15rem; color: var(--ink); }
.skills { font-size: 1.06rem; }
.skills span { color: var(--ink); }
.resource { font-size: 1rem; color: var(--ink); }
.walk .shard-list, .job { font-size: 1.06rem; color: var(--ink); }
.walk summary .spoiler { font-size: 1rem; color: var(--ink); }
@media (max-width: 760px) {
  .hero-card > div, .boss-card > div:not(.portrait), .skills, .walk { padding: 0.9rem 1rem 1rem; }
  .hero-card > div, .boss-card > div:not(.portrait), .skills, .walk { width: 100%; }
}

/* =====================================================================================================================
   Tooling 182 and 183: the portraits, the title, the email list up front, the swap note, heroes by role on scrolls,
   and a page per character.
   ===================================================================================================================== */

/* ---- The portrait swap (Tooling 182) ---------------------------------------------------------------------------------
   Every portrait slot holds the painted sticker and the render cut-out; the one setting in js/site.js (PORTRAITS) puts
   data-portraits on the page and only that set is shown (the other, display none and lazy, is never fetched). */
.pt-render,
.pt-render-only { display: none; }
:root[data-portraits="render"] .pt-painted { display: none; }
:root[data-portraits="render"] .pt-render { display: block; }
:root[data-portraits="render"] .pt-render-only { display: block; }

/* the render as a die-cut sticker: the cut-out itself, a white edge cut round it, its shadow; no round backing */
:root[data-portraits="render"] .sticker[data-portrait] {
  aspect-ratio: 4 / 5;
  border-radius: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  transform: rotate(-2deg);
}
:root[data-portraits="render"] .sticker[data-portrait] > .pt-render {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: contain;
  object-position: 50% 100%;
  filter:
    drop-shadow(3px 0 0 #fffdf8) drop-shadow(-3px 0 0 #fffdf8)
    drop-shadow(0 3px 0 #fffdf8) drop-shadow(0 -3px 0 #fffdf8)
    drop-shadow(3px 7px 7px rgba(30, 20, 60, 0.45));
}
:root[data-portraits="render"] .sticker[data-portrait] .stamp { right: -8%; bottom: 2%; }

/* the role tags: the game's own role glyph in ink on its round blank stamp (img/book/role-*.webp), as the HUD shows a role */
.sticker .stamp { width: 34%; right: -6%; bottom: -4%; border-radius: 50%; }
.role-glyph {
  display: inline-block;
  width: 1em; height: 1em;
  background: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}
.role-glyph-tank { --glyph: url("../img/book/glyph-tank.webp"); }
.role-glyph-healer { --glyph: url("../img/book/glyph-healer.webp"); }
.role-glyph-dps { --glyph: url("../img/book/glyph-dps.webp"); }

/* ---- The mark (Tooling 180) -----------------------------------------------------------------------------------------
   D, the formation (the boss with the Tank, Healer and two DPS where the AI stands them): the ink cut on the paper header,
   the chalk cut by Night and over the film. The tab carries A (favicon.ico and favicon.svg at the root; the game's pages
   carry the Shatterbound cut, with the crack through the boss, from img/brand/shatterbound/). */
.mark-glyph { display: inline-flex; align-items: center; flex: none; }
.mark-glyph img { width: 32px; height: 32px; }
.mark-chalk { display: none; }
:root[data-theme="dark"] .mark-ink { display: none; }
:root[data-theme="dark"] .mark-chalk { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark-ink { display: none; }
  :root:not([data-theme="light"]) .mark-chalk { display: block; }
}
.site-header.is-clear:not(.is-solid):not(.is-open) .mark-glyph .mark-ink { display: none; }
.site-header.is-clear:not(.is-solid):not(.is-open) .mark-glyph .mark-chalk { display: block; }
.coming-plate img.coming-mark { width: 50%; height: auto; opacity: 0.8; }

/* ---- The title (front page; his pick A): Project Trinity, with Shatterbound on a name slip beneath ------------------- */
.cine h1.game-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12em;
  max-width: none;
  font-size: clamp(3.1rem, 8.6vw, 6.4rem);
}
.game-title .t-studio { white-space: nowrap; }
.game-title .t-game a { color: inherit; text-decoration: none; }
.game-title .t-game a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.cine .t-game {
  margin-top: 0.12em;
  font-size: 0.42em;
  line-height: 1.15;
  padding: 0.08em 0.9em 0.16em;
  position: relative;
  isolation: isolate;
  color: #2b2452;
  text-shadow: none;
  transform: rotate(-2deg);
}
/* the slip's paper and shadow sit behind the word (a filter over the word itself can drop it in Chrome) */
.cine .t-game::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/book/slip-mid.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(1px 3px 3px rgba(0, 0, 0, 0.35));
}
/* ---- The email list, the first screen's main call; Watch the gameplay beside it --------------------------------------- */
.cine-actions { align-items: flex-start; gap: 1.1rem 1.8rem; }
.join-form { display: grid; gap: 0.5rem; flex: 0 1 28rem; min-width: 0; }
.join-label {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  line-height: 1.15;
  color: var(--film-text);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}
.join-hint { font-size: 1.02rem; line-height: 1.4; color: var(--film-text); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }
.join-row { display: flex; flex-wrap: wrap; gap: 0.8rem 1.4rem; align-items: center; }
.join-row input {
  flex: 1 1 13rem;
  min-width: 0;
  min-height: 48px;
  font: inherit;
  font-size: 1.05rem;
  color: #2b2452;
  background: #fbf5ea;
  border: 0;
  border-bottom: 3px solid var(--focus);
  border-radius: 4px 4px 0 0;
  padding: 0.5rem 0.8rem;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.3);
}
.join-row input::placeholder { color: #6b6390; }
.join-row input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.join-row input[aria-invalid="true"] { border-bottom-color: var(--stamp); background: #fde8e6; }
.join-age {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 32px;
  width: fit-content;
  font-size: 1rem;
  color: var(--film-text);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  cursor: pointer;
}
.join-age input { width: 20px; height: 20px; margin: 0; accent-color: var(--focus); cursor: pointer; }
.join-age input[aria-invalid="true"] { outline: 2px solid #ffb3ae; outline-offset: 2px; }
.join-form .form-note { color: var(--film-text); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); min-height: 0; }
.join-form .form-note:empty { display: none; }
.join-form .form-note.is-error { color: #ffd2cc; }
.join-form .form-note a { color: var(--focus); }
.join-form .turnstile:empty { display: none; }
/* Watch the gameplay lines up with the email box */
.cine-actions > .button-slip { margin-top: calc(1.6rem * 1.15 + 0.5rem); }
@media (forced-colors: active) { .join-row input { border: 2px solid CanvasText; } }

/* ---- Swap heroes mid-fight: under the Shatterbound slip, on the picture with no backing, like the words below it
   (his word, Tooling 202) ----------------------------------------------------------------------------------------------- */
.swap-note { grid-column: 2; grid-row: 1 / span 4; align-self: end; }
.swap-note {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "faces title" "faces line";
  align-items: center;
  column-gap: 1.1rem;
  width: fit-content;
  max-width: min(100%, 36rem);
  margin-top: 1.4rem;
  color: var(--film-text);
}
.swap-note h2 { grid-area: title; font-size: 1.7rem; line-height: 1.05; color: var(--film-text); text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6); }
.swap-row {
  grid-area: faces;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}
.swap-row li { position: relative; flex: none; }
.swap-row img {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid #fffdf8;
  box-shadow: 0 0 0 3px var(--hero), 2px 3px 5px rgba(30, 20, 60, 0.35);
}
/* the swap arrows between them */
.swap-row li + li { margin-left: 26px; }
.swap-row li + li::before {
  content: "";
  position: absolute;
  left: -24px; top: 50%;
  width: 22px; height: 16px;
  margin-top: -8px;
  background: url("../img/book/swap-arrows.svg") center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
}
.swap-note p { grid-area: line; font-size: 1.02rem; line-height: 1.35; color: var(--film-text); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.cine .cine-line { margin-top: 1.2rem; }
.cine .cine-actions { margin-top: clamp(26px, 3.4vw, 40px); }

@media (max-width: 560px) {
  .swap-note { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "faces" "line"; row-gap: 0.5rem; }
}
@media (max-width: 560px) {
  .cine-actions > .button-slip { margin-top: 0; }
  .join-row .button { flex: 1 1 100%; }
}

/* ---- Shatterbound: the heroes by role, each a sticker holding down a scroll ----------------------------------------- */
:root { interpolate-size: allow-keywords; }
.roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 44px);
  align-items: start;
}
.role-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  font-size: clamp(2.3rem, 3.4vw, 2.9rem);
  color: var(--on-sky);
}
.group-stamp { width: 50px; height: auto; transform: rotate(-6deg); filter: drop-shadow(1px 2px 2px rgba(30, 20, 60, 0.3)); }
.hero-slots {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: clamp(30px, 4vw, 48px);
}

.scroll { --roll: 20px; position: relative; color: var(--ink); margin-bottom: 16px; }
.scroll > summary {
  display: grid;
  justify-items: center;
  list-style: none;
  cursor: pointer;
  border-radius: 6px;
}
.scroll > summary::-webkit-details-marker { display: none; }
.scroll > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; }
/* the sticker holds the scroll down: it sits over the top roll */
.scroll .sticker {
  position: relative;
  z-index: 3;
  width: min(72%, 220px);
  margin-bottom: -38px;
  transition: transform 180ms ease;
}
.scroll > summary:hover .sticker { transform: rotate(0deg) translateY(-3px); }
/* the paper strip of a rolled scroll, the hero's name on it */
.scroll-tab {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  width: 100%;
  min-height: 84px;
  padding: calc(var(--roll) + 30px) 1rem 0.9rem;
  text-align: center;
  background-color: var(--paper);
  background-image: var(--paper-image);
  background-size: var(--paper-size);
}
/* the rolls: a paper cylinder at the top of the strip, and one at the foot of the scroll; their ends in the hero's colour */
.scroll-tab::before,
.scroll::after {
  content: "";
  position: absolute;
  left: -10px; right: -10px;
  height: var(--roll);
  border-radius: 10px;
  background:
    linear-gradient(90deg, var(--hero, var(--ink-soft)) 0 9px, transparent 9px calc(100% - 9px), var(--hero, var(--ink-soft)) calc(100% - 9px)),
    linear-gradient(180deg, rgba(30, 20, 60, 0.28), rgba(255, 255, 255, 0.4) 42%, rgba(255, 255, 255, 0.1) 58%, rgba(30, 20, 60, 0.32)),
    var(--paper-deep);
  box-shadow: 0 4px 8px -2px var(--shadow);
}
.scroll-tab::before { top: 0; }
.scroll::after { bottom: -16px; z-index: 2; }
.scroll-name { font-family: var(--font-hand); font-size: 2.3rem; line-height: 1; }
.scroll-sub { font-size: 1rem; color: var(--ink); }
.scroll-pull {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.3rem;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  line-height: 1.1;
  color: var(--link);
}
.scroll-pull::before {
  content: "";
  width: 9px; height: 9px;
  border: solid currentColor;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 180ms ease;
}
.scroll[open] .scroll-pull::before { transform: rotate(-135deg) translate(-2px, -2px); }
.scroll > summary:hover .scroll-pull { text-decoration: underline; }
.scroll .on-open,
.scroll[open] .on-shut { display: none; }
.scroll[open] .on-open { display: inline; }

/* the scroll, pulled open: its paper runs down to the foot roll */
.scroll-body {
  display: grid;
  gap: 1rem;
  padding: 0.4rem clamp(14px, 1.6vw, 22px) 1.6rem;
  background-color: var(--paper);
  background-image: var(--paper-image);
  background-size: var(--paper-size);
}
.scroll-body .one-line { font-size: 1.1rem; color: var(--ink); }
.scroll-body .skills,
.char-sheet .skills {
  grid-column: auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 0;
  background: none;
  border-radius: 0;
  width: auto;
  font-size: 1.04rem;
}
.scroll-body .more { font-size: 1.25rem; }
/* pulling open is a slow unroll where the browser can draw it; otherwise it opens at once */
.scroll::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 650ms ease, content-visibility 650ms allow-discrete;
}
.scroll[open]::details-content { block-size: auto; }
@media (prefers-reduced-motion: reduce) {
  .scroll::details-content, .scroll .sticker, .scroll-pull::before { transition: none; }
}

/* a hero not yet shown: a plain question mark on a sealed scroll */
.sticker-unknown {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: rgba(var(--paper-rgb), 0.55);
  border: 3px dashed var(--ink-soft);
  box-shadow: none;
  font-family: var(--font-hand);
  font-size: clamp(4rem, 7vw, 5.4rem);
  line-height: 1;
  color: var(--ink);
}
.is-sealed .scroll-tab { min-height: 0; padding: calc(var(--roll) + 18px) 0 0; }
.is-sealed { opacity: 0.85; }

.skills .skill-tag,
.skill-tag {
  display: inline-block;
  margin-left: 0.2rem;
  padding: 0 0.5rem 0.05rem;
  font-size: 0.85rem;
  line-height: 1.5;
  vertical-align: 0.25em;
  color: var(--ink);
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
}

/* a skill's clip: a silent loop, cut from existing films, taped in (only where a film already exists) */
.skill-clip { position: relative; margin: 0.65rem 0 0.2rem; }
.skill-clip .photo { padding: 6px 6px 9px; transform: rotate(-0.8deg); }
.skill-clip .photo::before,
.skill-clip .photo::after { width: 58px; height: 22px; }
.skill-clip .photo::before { left: -18px; top: -6px; }
.skill-clip .photo::after { right: -18px; top: -6px; }
.skill-clip video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #0e1230; }
.clip-hold {
  position: absolute;
  right: 12px; bottom: 16px;
  z-index: 3;
  min-height: 32px;
  padding: 0.05rem 0.8rem 0.1rem;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: var(--film-text);
  background: rgba(10, 8, 30, 0.66);
  border: 1.5px solid rgba(251, 245, 234, 0.7);
  border-radius: 999px;
  cursor: pointer;
}

@media (max-width: 980px) {
  .roles { grid-template-columns: minmax(0, 1fr); }
  .hero-slots { grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr)); column-gap: clamp(18px, 4vw, 34px); }
  .hero-slot:has(> details[open]) { grid-column: 1 / -1; }
  .hero-slot:has(> details[open]) .sticker { width: min(52%, 220px); }
}
@media (max-width: 420px) {
  .scroll .sticker { margin-bottom: -28px; }
  .scroll-name { font-size: 2rem; }
  .scroll-tab { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* the bosses' banners swap with the portraits */
.walk .banner { max-width: 640px; margin: 0.4rem 0 0.2rem 0.6rem; }
.boss-card h3 a { color: inherit; text-decoration: none; }
.boss-card h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.job h4 {
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.55rem;
}
.job-stamp { width: 34px; height: auto; transform: rotate(-6deg); }

/* ---- A page per character ------------------------------------------------------------------------------------------- */
.char-head {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding-top: clamp(36px, 6vw, 80px);
}
.char-portrait { margin: 0; }
.char-portrait .sticker { width: 100%; padding: 10px; box-shadow: 0 0 0 7px var(--hero, var(--cold)), 4px 8px 14px rgba(30, 20, 60, 0.4); }
.char-portrait.is-boss { --hero: var(--cold); }
.char-words {
  padding: clamp(18px, 2.4vw, 28px) clamp(18px, 2.6vw, 32px);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(var(--paper-rgb), 0.86);
}
.char-words .eyebrow { color: var(--ink); }
.char-words .eyebrow a { color: var(--link); }
.char-words h1 { font-size: clamp(3.2rem, 8vw, 5.4rem); color: var(--ink); margin-top: 0.1rem; }
.char-words .role-line { margin: 0.7rem 0 0.9rem; }
.char-words .lede { font-size: clamp(1.15rem, 1.8vw, 1.32rem); max-width: 56ch; color: var(--ink); }
.char-note { margin-top: 0.8rem; max-width: 60ch; color: var(--ink); }
.char-swap { margin-top: 0.9rem; font-family: var(--font-hand); font-size: 1.5rem; line-height: 1.2; color: var(--ink); }
.char-banner { margin-top: clamp(28px, 4vw, 52px); }
.char-banner .photo { max-width: 1000px; margin: 0 auto; }
.char-sheet {
  padding: clamp(20px, 3vw, 36px);
  border-radius: 6px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--paper-image);
  background-size: var(--paper-size);
  box-shadow: 0 0 0 1px rgba(120, 90, 60, 0.18), 4px 10px 22px -6px var(--shadow);
}
.char-sheet .skills.kit { display: block; columns: 2; column-gap: 2.4rem; }
.char-sheet .skills.kit > li { break-inside: avoid; margin-bottom: 1.4rem; }
.fight-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: var(--measure); }
.fight-jobs a { font-family: var(--font-hand); font-size: 1.7rem; line-height: 1.1; }
.fight-jobs span { display: block; font-size: 1.06rem; color: var(--ink); }
.walk-open { display: grid; gap: 1.5rem; }
.walk-open .banner { max-width: 760px; margin: 0.3rem 0 0.4rem 0.6rem; }
.walk-open .shard-list { max-width: var(--measure); font-size: 1.06rem; }
.jobs-title { font-size: 1.9rem; margin-bottom: 0.5rem; }
.char-others,
.boss-strip.char-others { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 820px; }
.char-others .sticker { width: clamp(110px, 14vw, 170px); }
@media (max-width: 760px) {
  .char-head { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .char-portrait { width: min(70%, 280px); }
  .char-words { width: 100%; }
  .char-sheet .skills.kit { columns: 1; }
  .char-others .sticker { width: min(26vw, 120px); }
}
.role .role-glyph { width: 15px; height: 15px; }
