/* ════════════════════════════════════════════════════════════════
   THE BUILDER — main stylesheet (v2: more ink, more voice)
   Palette: ink / paper / spider red / arc blue / copper
   ════════════════════════════════════════════════════════════════ */

:root {
  --ink: #0b0c10;
  --ink-2: #14161d;
  --ink-3: #1d2029;
  --paper: #f2ede3;
  --paper-dim: #d8d2c4;
  --graphite: #8a8d96;
  --red: #e62429;
  --red-soft: #ff5a5f;
  --blue: #4cc3ff;
  --blue-deep: #1f6feb;
  --copper: #c97b3d;
  --caption: #ecd27d;
  --line: rgba(242, 237, 227, 0.14);
  --line-strong: rgba(242, 237, 227, 0.3);

  --font-display: "Archivo Black", "Arial Black", sans-serif;
  --font-body: "Space Grotesk", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --pad: clamp(1.25rem, 5vw, 5rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  overflow-x: hidden;
}

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--red); color: var(--paper); padding: 0.6rem 1rem;
  font-family: var(--font-mono); text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── shared atoms ───────────────────────────────────────────── */

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
}

/* issue tag = rubber stamp. Stamps slam in when the panel enters. */
.issue-tag {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 1.5rem;
  transform: rotate(-2deg);
  position: relative; z-index: 1;
}
.issue-tag__no {
  border: 1.5px solid currentColor; padding: 0.25rem 0.6rem;
  color: var(--red); font-weight: 700;
}
.issue-tag--light { color: #6b6356; }
.issue-tag--light .issue-tag__no { color: #b3372f; }
.js .panel .issue-tag { opacity: 0; }
.panel.is-in .issue-tag { animation: stamp 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) forwards 0.15s; }
@keyframes stamp {
  0%   { opacity: 0; transform: scale(2.2) rotate(-9deg); }
  70%  { opacity: 1; transform: scale(0.96) rotate(-1deg); }
  100% { opacity: 1; transform: scale(1) rotate(-2deg); }
}

.panel {
  position: relative;
  padding: clamp(5rem, 12vh, 9rem) var(--pad);
  border-bottom: 1px solid var(--line);
}

/* "NEXT:" teaser at the foot of each chapter, like a comic page turn */
.panel[data-next]::after {
  content: "next: " attr(data-next);
  position: absolute; right: var(--pad); bottom: 1.1rem;
  font-family: var(--font-mono); font-size: 0.64rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--graphite);
}
.panel--origin[data-next]::after { color: #8a8475; }

.panel__head { max-width: 70rem; margin: 0 auto 3.5rem; position: relative; }

/* ghost chapter numerals — huge, outlined, behind the headline */
.panel__head[data-ch]::before {
  content: attr(data-ch);
  position: absolute; top: -0.18em; right: -0.04em;
  font-family: var(--font-display);
  font-size: clamp(7rem, 20vw, 15rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(242, 237, 227, 0.1);
  pointer-events: none; z-index: 0;
  transform: translateX(30px);
  opacity: 0;
  transition: opacity 1.1s ease 0.2s, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s;
}
.panel.is-in .panel__head[data-ch]::before { opacity: 1; transform: none; }
.panel--origin .panel__head[data-ch]::before { -webkit-text-stroke-color: rgba(11, 12, 16, 0.12); }

.panel__title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.1rem + 3.2vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  position: relative; z-index: 1;
}
.panel__title--ink { color: var(--ink); }
.title-accent { color: var(--red); }

/* cinematic wipe: headlines reveal left→right as the chapter opens */
.js .panel__title {
  clip-path: inset(-4% 102% -4% -2%);
  transition: clip-path 1s cubic-bezier(0.6, 0.05, 0.2, 1) 0.25s;
}
.panel.is-in .panel__title { clip-path: inset(-4% -2% -4% -2%); }

.panel__lede {
  margin-top: 1.5rem; max-width: 44rem; color: var(--paper-dim);
  position: relative; z-index: 1;
}

/* comic narration caption box */
.caption-box {
  display: inline-block;
  background: var(--caption); color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(11, 12, 16, 0.55);
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; line-height: 1.55;
  padding: 0.7rem 1rem;
  transform: rotate(-0.6deg);
}
.caption-box--lesson { transform: rotate(0.4deg); margin-top: 1.6rem; }
.caption-box--field { margin-top: 1.4rem; max-width: 22rem; }

/* reveal-on-scroll primitive */
.js .rv { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.rv.is-in { opacity: 1; transform: none; }

/* ── canvas ─────────────────────────────────────────────────── */

#web-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}

/* ── route map ──────────────────────────────────────────────── */

.route {
  position: fixed; left: 1.4rem; top: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; flex-direction: column; gap: 1.05rem;
}
.route__line {
  position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px;
  background: var(--line-strong);
}
.route__stop {
  position: relative; width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid var(--graphite); background: var(--ink);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.route__stop:hover, .route__stop:focus-visible { border-color: var(--paper); transform: scale(1.25); }
.route__stop.is-active { border-color: var(--red); background: var(--red); box-shadow: 0 0 12px rgba(230, 36, 41, 0.6); }
.route__label {
  position: absolute; left: 1.6rem; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--paper); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
  background: var(--ink-2); padding: 0.25rem 0.55rem; border: 1px solid var(--line);
}
.route__stop:hover .route__label, .route__stop:focus-visible .route__label { opacity: 1; }
@media (max-width: 860px) { .route { display: none; } }

/* ── topbar ─────────────────────────────────────────────────── */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.8rem var(--pad);
  background: linear-gradient(rgba(11, 12, 16, 0.92), rgba(11, 12, 16, 0));
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
/* no website chrome on the cover: the header only exists once
   the reader is inside the issue (js removes the class on scroll) */
.js .topbar.topbar--cover { opacity: 0; transform: translateY(-14px); }
.js .topbar.topbar--cover > * { pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar__mark {
  display: inline-grid; place-items: center;
  width: 1.6rem; height: 1.6rem;
  font-size: 1rem; line-height: 1; color: var(--ink);
  background: var(--red);
}
.topbar__title { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.2em; }
.topbar__sub { color: var(--graphite); }
.blueprint-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em;
  color: var(--blue); background: transparent;
  border: 1px solid rgba(76, 195, 255, 0.45); padding: 0.45rem 0.85rem;
  cursor: pointer; transition: background 0.25s, color 0.25s;
}
.blueprint-toggle:hover { background: rgba(76, 195, 255, 0.12); }
.blueprint-toggle[aria-pressed="true"] { background: var(--blue); color: var(--ink); }
.blueprint-toggle__icon {
  width: 10px; height: 10px; border: 1.5px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat;
}

/* ── PANEL 01 · CHAOS ───────────────────────────────────────── */

.panel--chaos {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  border-bottom: none; z-index: 1;
  padding-top: clamp(11rem, 24vh, 15rem);
}
.chaos__inner { position: relative; z-index: 2; max-width: 46rem; }
.issue-tag--prologue { margin-bottom: 2.4rem; }

/* ── cover furniture: screen one is the cover of №1 ─────────── */

.cover-top {
  position: absolute; top: 1.4rem; left: var(--pad); right: var(--pad);
  display: flex; align-items: flex-start; gap: 1.2rem;
  z-index: 2;
}
.corner-box {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  border: 2px solid var(--paper); background: rgba(11, 12, 16, 0.72);
  padding: 0.55rem 0.5rem; min-width: 4rem;
  font-family: var(--font-mono); text-align: center;
}
.corner-box__brand { font-size: 0.52rem; font-weight: 700; letter-spacing: 0.18em; line-height: 1.5; }
.corner-box__anchor { font-size: 1.05rem; line-height: 1; color: var(--red-soft); }
.corner-box__meta { font-size: 0.58rem; color: var(--paper-dim); letter-spacing: 0.12em; }
.cover-masthead { flex: 1 1 auto; text-align: center; }
.cover-masthead__kicker { display: block; margin-bottom: 0.5rem; letter-spacing: 0.3em; }
.cover-masthead__title {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 1rem + 7vw, 5.2rem);
  line-height: 0.95; letter-spacing: 0.015em; text-transform: uppercase;
  /* printed cover: a whisper of plate offset, permanently */
  text-shadow:
    2px 1.5px 0 rgba(230, 36, 41, 0.5),
    -2px -1.5px 0 rgba(76, 195, 255, 0.45);
}
.cover-masthead__sub { display: block; margin-top: 0.55rem; letter-spacing: 0.26em; }
.code-seal {
  flex: 0 0 auto;
  width: 4.3rem; height: 4.3rem;
  display: grid; place-items: center;
  border: 2px solid var(--paper); background: rgba(11, 12, 16, 0.72);
  transform: rotate(2.5deg);
  font-family: var(--font-mono); font-size: 0.46rem; font-weight: 700;
  letter-spacing: 0.14em; text-align: center; line-height: 1.6;
  color: var(--paper-dim);
}
.cover-bottom {
  position: absolute; left: var(--pad); bottom: 2rem;
  display: flex; flex-direction: column; gap: 0.45rem;
  z-index: 2;
}
.cover-bottom__barcode {
  width: 58px; height: 16px;
  background: repeating-linear-gradient(90deg, var(--paper) 0 2px, transparent 2px 4px);
  opacity: 0.7;
}
@media (max-width: 640px) {
  .code-seal { display: none; }
  .corner-box { min-width: 3.3rem; padding: 0.45rem 0.4rem; }
  .cover-bottom { display: none; }
}
.chaos-line {
  font-family: var(--font-body); font-weight: 500;
  font-size: clamp(1.3rem, 1rem + 1.8vw, 2.2rem);
  line-height: 1.4; margin: 1.1rem 0;
  transition: opacity 1.1s ease, transform 1.1s ease, filter 1.1s ease;
}
.js .chaos-line { opacity: 0; transform: translateY(18px); filter: blur(6px); }
.chaos-line.is-in { opacity: 1; transform: none; filter: none; }
.chaos-line--accent { color: var(--red-soft); font-weight: 700; }
.scroll-cue {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  z-index: 2;
}
.scroll-cue__text { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--graphite); }
.scroll-cue__line {
  width: 1px; height: 52px; background: var(--graphite); position: relative; overflow: hidden;
}
.scroll-cue__line::after {
  content: ""; position: absolute; left: 0; top: -50%; width: 100%; height: 50%;
  background: var(--red); animation: cue-drop 1.8s ease-in-out infinite;
}
@keyframes cue-drop { to { top: 110%; } }

/* ── PANEL 02 · REVEAL ──────────────────────────────────────── */

.panel--reveal {
  min-height: 100vh; display: flex; align-items: center;
  z-index: 1; border-bottom: 1px solid var(--line);
}
.reveal__inner { position: relative; z-index: 2; max-width: 70rem; margin: 0 auto; width: 100%; }
/* CMYK misregistration: the name prints off-register in chaos and the
   plates slide into alignment as the web assembles (js drives --misx/y) */
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 1.5rem + 9.5vw, 9rem);
  line-height: 0.92; letter-spacing: 0.01em; text-transform: uppercase;
  --misx: 2.5px; --misy: 1.8px;
  text-shadow:
    var(--misx) var(--misy) 0 rgba(230, 36, 41, 0.55),
    calc(var(--misx) * -1) calc(var(--misy) * -1) 0 rgba(76, 195, 255, 0.5),
    0 0 60px rgba(11, 12, 16, 0.9);
}

/* the first panel frame: chaos has no borders — the story does */
.panel-frame {
  position: absolute; inset: 1.1rem;
  border: 1px solid var(--line);
  pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity 1.4s ease 0.3s;
}
.panel.is-in .panel-frame { opacity: 1; }
.panel-frame::before, .panel-frame::after {
  content: ""; position: absolute; width: 22px; height: 22px;
  border: 2.5px solid var(--red);
}
.panel-frame::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.panel-frame::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.hero-thesis {
  margin-top: 1.6rem;
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(0.95rem, 0.8rem + 1vw, 1.45rem);
  letter-spacing: 0.06em; line-height: 1.5;
}
.hero-thesis em { font-style: normal; color: var(--red); }
.triptych {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  margin-top: 4rem; border-top: 1px solid var(--line); padding-top: 2rem;
}
.triptych__most { color: var(--graphite); font-size: 0.95rem; }
.triptych__i { font-weight: 700; margin-top: 0.35rem; }
.triptych__i::before { content: "→ "; color: var(--blue); }
@media (max-width: 760px) { .triptych { grid-template-columns: 1fr; gap: 1.2rem; } }

/* ── PANEL 03 · ORIGIN (paper / blueprint) ──────────────────── */

.panel--origin {
  background:
    linear-gradient(rgba(242, 237, 227, 0.97), rgba(242, 237, 227, 0.97)),
    radial-gradient(circle at 1px 1px, #b9b2a2 1px, transparent 0) 0 0 / 22px 22px;
  background-color: var(--paper);
  color: var(--ink);
  z-index: 1;
}
.origin__grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 5rem);
  max-width: 70rem; margin: 0 auto; align-items: start;
}
.origin__story p { margin-bottom: 1.1rem; max-width: 36rem; }
.origin__story strong { color: #b3372f; }
.origin__questions { list-style: none; margin: 1.4rem 0 1.6rem; }
.origin__questions li {
  font-family: var(--font-mono); font-size: 0.92rem; padding: 0.55rem 0 0.55rem 1.4rem;
  border-left: 2px solid #b3372f; margin-bottom: 0.5rem; color: #3c3a33;
}
.origin__toolkit { margin-top: 2.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.origin__toolkit .mono-label { color: #8a8475; }
.toolkit-tags { font-family: var(--font-mono); font-size: 0.85rem; color: #3c3a33; }

.origin__blueprint {
  background: #173a63;
  border: 1px solid #2c5a8f;
  padding: 1.4rem;
  box-shadow: 10px 10px 0 rgba(11, 12, 16, 0.12);
}
.origin__blueprint figcaption { color: #9fc3e8; margin-top: 0.9rem; }
#blueprint-svg { width: 100%; height: auto; color: #cfe5fa; }
#blueprint-svg .bp { stroke: #cfe5fa; stroke-width: 1.8; }
#blueprint-svg .bp-frame { stroke: #5e8cc0; stroke-width: 1; }
#blueprint-svg .bp-grid path { stroke: #2c5a8f; stroke-width: 0.7; }
#blueprint-svg .bp-dim { stroke: #7fa9d6; stroke-width: 1; }
#blueprint-svg .bp-note { fill: #9fc3e8; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; }
/* stroke-draw choreography */
.js #blueprint-svg .bp { stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.panel--origin.is-in #blueprint-svg .bp-d1 { animation: bp-draw 1.4s ease forwards 0.1s; }
.panel--origin.is-in #blueprint-svg .bp-d2 { animation: bp-draw 1.4s ease forwards 0.9s; }
.panel--origin.is-in #blueprint-svg .bp-d3 { animation: bp-draw 1.6s ease forwards 1.7s; }
@keyframes bp-draw { to { stroke-dashoffset: 0; } }

.dossier {
  max-width: 70rem; margin: 4rem auto 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border: 1.5px solid var(--ink); background: var(--paper);
}
.dossier__item { padding: 1.1rem 1.2rem; border-right: 1px solid rgba(11, 12, 16, 0.2); }
.dossier__item:last-child { border-right: none; }
.dossier dt { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; color: #8a8475; margin-bottom: 0.4rem; }
.dossier dd { font-size: 0.9rem; font-weight: 500; line-height: 1.45; }
@media (max-width: 900px) {
  .origin__grid { grid-template-columns: 1fr; }
  .dossier__item { border-right: none; border-bottom: 1px solid rgba(11,12,16,0.15); }
}

/* ── PANEL 04 · ENEMIES ─────────────────────────────────────── */

.panel--enemies { background: var(--ink); z-index: 1; }
.enemies__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem; max-width: 70rem; margin: 0 auto;
}
.villain {
  position: relative; min-height: 340px; perspective: 1200px;
  background: none; border: none; cursor: pointer; color: var(--paper);
  font-family: inherit; text-align: left; padding: 0;
}
.villain__face, .villain__back {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: 1.6rem; backface-visibility: hidden;
  border: 1px solid var(--line-strong);
  transition: transform 0.7s cubic-bezier(0.3, 0.8, 0.3, 1);
  background:
    linear-gradient(rgba(20, 22, 29, 0.96), rgba(20, 22, 29, 0.96)),
    radial-gradient(circle at 1px 1px, var(--graphite) 1px, transparent 0) 0 0 / 16px 16px;
}
.villain__face { transform: rotateY(0deg); }
.villain__back {
  transform: rotateY(180deg);
  border-color: var(--red);
  justify-content: center; gap: 1rem;
}
.villain:hover .villain__face, .villain:focus-visible .villain__face, .villain.is-flipped .villain__face { transform: rotateY(-180deg); }
.villain:hover .villain__back, .villain:focus-visible .villain__back, .villain.is-flipped .villain__back { transform: rotateY(0deg); }
.villain__glyph { width: 76px; height: 76px; color: var(--red); margin-bottom: 1.1rem; }
.villain__name { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.02em; margin-bottom: 0.6rem; }
.villain__desc { color: var(--paper-dim); font-size: 0.95rem; line-height: 1.5; }
.villain__threat { display: flex; gap: 5px; margin-top: auto; padding-top: 1.2rem; }
.villain__threat i { width: 22px; height: 6px; background: var(--red); }
.villain__threat i.dim { background: var(--ink-3); }
.villain__counter { font-size: 0.98rem; line-height: 1.55; }
.villain__counter em { font-style: normal; color: var(--red-soft); font-weight: 700; }
.villain__status { font-family: var(--font-mono); font-size: 0.63rem; letter-spacing: 0.14em; color: var(--blue); }
.enemies__hint { text-align: center; margin-top: 2.2rem; }

/* ── PANEL 05 · MISSIONS — issue covers ─────────────────────── */

.panel--missions { background: var(--ink-2); z-index: 1; }
.covers__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.6rem; max-width: 70rem; margin: 0 auto;
}
.cover {
  aspect-ratio: 2 / 3;
  position: relative; display: flex; flex-direction: column;
  background:
    linear-gradient(rgba(11, 12, 16, 0.92), rgba(11, 12, 16, 0.92)),
    radial-gradient(circle at 2px 2px, var(--graphite) 1.2px, transparent 0) 0 0 / 12px 12px;
  border: 3px solid var(--paper);
  color: var(--paper); font-family: inherit; text-align: left;
  padding: 0; cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.35s ease;
}
.cover:hover, .cover:focus-visible {
  transform: translateY(-10px) rotate(-1.2deg);
  box-shadow: 12px 14px 0 rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.cover:nth-child(even):hover { transform: translateY(-10px) rotate(1.2deg); }
.cover__masthead {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.45rem 0.7rem; border-bottom: 2px solid var(--paper);
  font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.16em;
  text-transform: uppercase;
}
.cover__masthead b { color: var(--red-soft); }
.cover__masthead i { font-style: normal; color: var(--graphite); }
.cover__box {
  position: absolute; top: 2.5rem; left: 0.7rem;
  display: flex; flex-direction: column; align-items: center;
  border: 2px solid var(--paper); background: var(--ink);
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  padding: 0.25rem 0.4rem; line-height: 1.5; z-index: 1;
}
.cover__box i { font-style: normal; color: var(--graphite); }
.cover__art {
  flex: 1 1 auto; min-height: 0;
  display: grid; place-items: center;
}
.cover__art svg { width: 72%; height: 88%; }
.cover__art--red { color: var(--red); }
.cover__art--blue { color: var(--blue); }
.cover__art--copper { color: var(--copper); }
.cover__title {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.2rem); line-height: 1.08;
  padding: 0 0.8rem 0.45rem;
}
.cover__line {
  font-size: 0.78rem; color: var(--paper-dim); line-height: 1.45;
  padding: 0 0.8rem 0.9rem;
}
.cover__barcode {
  flex: 0 0 auto; align-self: flex-end;
  width: 52px; height: 15px;
  margin: 0 0.7rem 0.7rem auto;
  background: repeating-linear-gradient(90deg, var(--paper) 0 2px, transparent 2px 4px);
  opacity: 0.65;
}
.missions__hint { text-align: center; margin-top: 2.2rem; }
@media (max-width: 700px) {
  .covers__grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
}

/* ── ISSUE READER — comic interior in a <dialog> ────────────── */

dialog.issue {
  border: none; padding: 0; background: transparent;
  width: min(62rem, 94vw); max-width: none;
  margin: auto;
}
dialog.issue::backdrop {
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(3px);
}
dialog.issue[open] .issue__inner { animation: issue-open 0.4s cubic-bezier(0.2, 1.1, 0.3, 1); }
@keyframes issue-open {
  from { opacity: 0; transform: translateY(26px) scale(0.97) rotate(-0.4deg); }
  to   { opacity: 1; transform: none; }
}
body:has(dialog[open]) { overflow: hidden; }
.issue__inner {
  background:
    linear-gradient(rgba(242, 237, 227, 0.97), rgba(242, 237, 227, 0.97)),
    radial-gradient(circle at 1px 1px, #b9b2a2 1px, transparent 0) 0 0 / 18px 18px;
  background-color: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 16px 16px 0 rgba(0, 0, 0, 0.55);
  padding: clamp(1.2rem, 3.5vw, 2.6rem);
  max-height: 86vh; overflow: auto;
}
.issue__head {
  display: flex; align-items: flex-start; gap: 1rem;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 1.1rem; margin-bottom: 1.5rem;
}
.issue__kicker { color: #8a8475; margin-bottom: 0.4rem; }
.issue__title {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(1.5rem, 1.1rem + 2.4vw, 2.6rem); line-height: 1.05;
}
.issue__close {
  margin-left: auto; flex: 0 0 auto;
  width: 2.7rem; height: 2.7rem;
  font-family: var(--font-display); font-size: 1.4rem; line-height: 1;
  color: var(--ink); background: transparent;
  border: 2.5px solid var(--ink); cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.issue__close:hover, .issue__close:focus-visible { background: var(--red); color: var(--paper); border-color: var(--ink); }
.issue__panels {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem;
  margin: 1.7rem 0 0.4rem;
}
.issue__panel {
  border: 2.5px solid var(--ink); background: #faf6ec;
  padding: 1.15rem 1.2rem;
  box-shadow: 4px 4px 0 rgba(11, 12, 16, 0.25);
}
.issue__panel:nth-child(1) { transform: rotate(-0.35deg); }
.issue__panel:nth-child(2) { transform: rotate(0.4deg); }
.issue__panel:nth-child(3) { transform: rotate(-0.25deg); }
.issue__panel h4 { color: #b3372f; margin-bottom: 0.55rem; }
.issue__panel p { font-size: 0.93rem; line-height: 1.6; }
.issue__next { text-align: center; margin-top: 1.8rem; color: #8a8475; }
@media (max-width: 760px) {
  .issue__panels { grid-template-columns: 1fr; }
}

/* ── PANEL 06 · DOCTRINE ────────────────────────────────────── */

.panel--systems { background: var(--ink); z-index: 1; }
.systems__diagram { max-width: 70rem; margin: 0 auto; }
.systems__diagram figcaption { margin-top: 1rem; text-align: center; }
#systems-svg { width: 100%; height: auto; }
#systems-svg .sys-edge {
  stroke: var(--line-strong); stroke-width: 1.5; fill: none;
  stroke-dasharray: 6 10;
  transition: opacity 0.8s ease;
}
.js #systems-svg .sys-edge { opacity: 0; }
.panel--systems.is-in #systems-svg .sys-edge { opacity: 1; animation: flow 1.2s linear infinite; }
.panel--systems.is-in #systems-svg .sys-edge--out { stroke: var(--blue); }
@keyframes flow { to { stroke-dashoffset: -16; } }
#systems-svg .sys-node rect { stroke: var(--graphite); fill: var(--ink-2); }
#systems-svg .sys-node text {
  fill: var(--paper); font-family: var(--font-mono); font-size: 13px;
  letter-spacing: 0.12em; text-anchor: middle; font-weight: 700;
}
#systems-svg .sys-node .sys-sub { fill: var(--graphite); font-size: 9.5px; font-weight: 400; letter-spacing: 0.06em; }
#systems-svg .sys-node--src rect { stroke: var(--line-strong); }
#systems-svg .sys-node--core rect { stroke: var(--red); stroke-width: 2; fill: rgba(230, 36, 41, 0.08); }
#systems-svg .sys-node--people .sys-people-ring { stroke: var(--blue); stroke-width: 2; fill: rgba(76, 195, 255, 0.08); r: 44px; }
#systems-svg .sys-people-txt { fill: var(--blue) !important; }
.js #systems-svg .sys-node { opacity: 0; transform: translateY(14px); }
#systems-svg .sys-node { transition: opacity 0.7s ease, transform 0.7s ease; }
.panel--systems.is-in #systems-svg .sys-node { opacity: 1; transform: none; }
.panel--systems.is-in #systems-svg .sys-node[data-d="0"] { transition-delay: 0.05s; }
.panel--systems.is-in #systems-svg .sys-node[data-d="1"] { transition-delay: 0.15s; }
.panel--systems.is-in #systems-svg .sys-node[data-d="2"] { transition-delay: 0.25s; }
.panel--systems.is-in #systems-svg .sys-node[data-d="3"] { transition-delay: 0.35s; }
.panel--systems.is-in #systems-svg .sys-node[data-d="4"] { transition-delay: 0.6s; }
.panel--systems.is-in #systems-svg .sys-node[data-d="5"] { transition-delay: 0.9s; }
.panel--systems.is-in #systems-svg .sys-node[data-d="6"] { transition-delay: 1.0s; }
.panel--systems.is-in #systems-svg .sys-node[data-d="7"] { transition-delay: 1.1s; }
.panel--systems.is-in #systems-svg .sys-node[data-d="8"] { transition-delay: 1.4s; }

/* ── PANEL 07 · THE ROAD ────────────────────────────────────── */

.panel--explorer {
  background: linear-gradient(180deg, var(--ink) 0%, #10131c 60%, #131720 100%);
  z-index: 1;
}
.explorer__stage { position: relative; max-width: 70rem; margin: 0 auto; }
#explorer-svg { width: 100%; height: auto; display: block; }
.contour {
  stroke: rgba(201, 123, 61, 0.5); stroke-width: 1.2; fill: none;
}
.js .contour { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.contour--peak { stroke: var(--copper); stroke-width: 1.6; }
.panel--explorer.is-in .contour { animation: contour-draw 2.6s ease forwards; }
.panel--explorer.is-in .contour:nth-child(2) { animation-delay: 0.15s; }
.panel--explorer.is-in .contour:nth-child(3) { animation-delay: 0.3s; }
.panel--explorer.is-in .contour:nth-child(4) { animation-delay: 0.45s; }
.panel--explorer.is-in .contour:nth-child(5) { animation-delay: 0.6s; }
.panel--explorer.is-in .contour:nth-child(6) { animation-delay: 0.75s; }
.panel--explorer.is-in .contour:nth-child(7) { animation-delay: 0.9s; }
.panel--explorer.is-in .contour:nth-child(8) { animation-delay: 1.05s; }
@keyframes contour-draw { to { stroke-dashoffset: 0; } }
.road {
  stroke: var(--paper-dim); stroke-width: 2; fill: none;
  stroke-dasharray: 10 8; opacity: 0.5;
}
/* the climb made visible: js paints the covered road copper */
.road-trail {
  stroke: var(--copper); stroke-width: 2.6; fill: none;
  stroke-linecap: round; opacity: 0.9;
}
.headlight { fill: #ffd9a0; }
.headlight-glow { fill: rgba(255, 217, 160, 0.18); }
.summit { opacity: 0; transform: translateY(8px); transition: opacity 0.9s ease, transform 0.9s ease; }
.is-summit .summit { opacity: 1; transform: none; }
.summit__flag { stroke: var(--copper); stroke-width: 2; fill: none; }
.summit__label {
  fill: var(--copper); font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.08em; text-anchor: end;
}
.explorer__copy {
  position: absolute; left: clamp(1rem, 4vw, 3.5rem); top: clamp(1rem, 4vw, 3rem);
  max-width: 24rem;
}
/* reflections light up as the rider passes each switchback */
.explorer__line {
  font-weight: 500; font-size: clamp(1rem, 0.9rem + 0.8vw, 1.35rem);
  margin-bottom: 0.7rem; text-shadow: 0 2px 18px rgba(11, 12, 16, 0.95);
  transition: opacity 0.9s ease;
}
.js .explorer__line { opacity: 0.22; }
.js .explorer__line.lit { opacity: 1; }
.explorer__line--accent { color: var(--copper); font-weight: 700; }
@media (max-width: 700px) {
  .explorer__copy { position: static; max-width: none; margin-top: 1.4rem; }
}

/* ── PANEL 08 · STILL BUILDING ──────────────────────────────── */

.panel--future {
  min-height: 80vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  overflow: hidden; z-index: 1;
}
.future__scaffold { position: absolute; inset: auto 0 0 0; opacity: 0.65; pointer-events: none; }
.future__scaffold svg { width: 100%; height: auto; display: block; }
.scaffold path { stroke: var(--graphite); stroke-width: 1.4; }
.float-node { fill: var(--blue); }
.fn1 { animation: bob 5s ease-in-out infinite; }
.fn2 { animation: bob 6.5s ease-in-out infinite 0.8s; }
.fn3 { animation: bob 7.5s ease-in-out infinite 1.6s; }
@keyframes bob { 50% { transform: translateY(-14px); } }
.future__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.2rem + 4.5vw, 4.6rem);
  line-height: 1.1; text-transform: uppercase; position: relative; z-index: 2;
}
.caret {
  display: inline-block; width: 0.55em; height: 0.08em;
  background: var(--red); margin-left: 0.12em; vertical-align: baseline;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.future__sub { margin-top: 1.6rem; color: var(--paper-dim); position: relative; z-index: 2; }

/* ── PANEL 09 · CONTACT ─────────────────────────────────────── */

.panel--contact {
  min-height: 90vh; display: flex; align-items: center; justify-content: center;
  text-align: center; border-bottom: none; z-index: 1;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(230, 36, 41, 0.12), transparent 55%),
    radial-gradient(ellipse at 85% 10%, rgba(76, 195, 255, 0.07), transparent 50%),
    var(--ink);
}
.contact__inner { max-width: 54rem; }
.contact__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 1.4rem + 5.5vw, 5.6rem);
  line-height: 1.02; text-transform: uppercase;
}
.contact__sub { margin-top: 1.8rem; color: var(--paper-dim); font-size: 1.05rem; }
.contact__actions { margin-top: 2.8rem; display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem;
  letter-spacing: 0.18em; text-decoration: none; padding: 1.05rem 2.4rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s;
}
.btn--primary {
  background: var(--red); color: var(--paper);
  box-shadow: 6px 6px 0 rgba(230, 36, 41, 0.25);
}
.btn--primary:hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 rgba(230, 36, 41, 0.3); }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--paper); }
.btn--ghost:hover { background: rgba(242, 237, 227, 0.08); }
.contact__mail { margin-top: 2rem; }

/* ── footer ─────────────────────────────────────────────────── */

.footer {
  padding: 2.4rem var(--pad); text-align: center;
  border-top: 1px solid var(--line); color: var(--paper-dim);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.footer strong { color: var(--red-soft); }
.footer__sailor { cursor: help; }

/* ── BLUEPRINT MODE ─────────────────────────────────────────── */

body.blueprint-mode { background: #0e2a4a; }
body.blueprint-mode .panel,
body.blueprint-mode .footer {
  background: #0e2a4a !important; color: #cfe5fa;
  border-color: rgba(159, 195, 232, 0.35);
  background-image:
    linear-gradient(rgba(159, 195, 232, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(159, 195, 232, 0.07) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
}
body.blueprint-mode .panel * { color: #cfe5fa !important; }
body.blueprint-mode .panel--origin,
body.blueprint-mode .panel--origin * { color: #cfe5fa !important; }
body.blueprint-mode img, body.blueprint-mode svg { filter: saturate(0) brightness(1.4); }
body.blueprint-mode #web-canvas { opacity: 0.25; }
body.blueprint-mode .panel::before {
  content: attr(data-annotation);
  position: absolute; top: 0.8rem; right: 1rem; z-index: 5;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em;
  color: #9fc3e8 !important; border: 1px dashed rgba(159, 195, 232, 0.6);
  padding: 0.3rem 0.6rem; text-transform: uppercase;
  background: rgba(14, 42, 74, 0.85);
}
body.blueprint-mode .villain__face, body.blueprint-mode .villain__back,
body.blueprint-mode .cover, body.blueprint-mode .dossier,
body.blueprint-mode .caption-box,
body.blueprint-mode .corner-box, body.blueprint-mode .code-seal,
body.blueprint-mode .origin__blueprint {
  background: transparent !important; border-style: dashed !important;
  box-shadow: none;
}
body.blueprint-mode .btn--primary { background: transparent; border: 1px dashed #cfe5fa; box-shadow: none; }

/* ── reduced motion ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chaos-line, .rv, .sys-node, .sys-edge { opacity: 1 !important; transform: none !important; filter: none !important; }
  .issue-tag { opacity: 1 !important; }
  .panel__title { clip-path: none !important; }
  .panel-frame { opacity: 1 !important; }
  .explorer__line { opacity: 1 !important; }
  .panel__head[data-ch]::before { opacity: 1 !important; transform: none !important; }
  .contour, #blueprint-svg .bp { stroke-dashoffset: 0 !important; }
  .cover:hover, .cover:focus-visible { transform: none; }
}
