/* avasiris.com · Direction A "Archive Hall" */

:root {
  --bg: #05090B;
  --bg-2: #070C0F;
  --line: #142027;
  --text: #E6EEF0;
  --text-2: #C5D1D5;
  --text-3: #B3C1C6;
  --muted: #9AABB1;
  --dim: #8A9BA1;
  --fine: #7E9097;
  --accent: #8FD6D8;         /* per-book light: cyan 727 · #A99BF0 737 · #F08A5D 747 */
  --sealed: #F08A7E;
  --paper: #EEF1F1;
  --ink: #13191C;
  --ink-2: #4C585E;
  --red: #B8322A;
  --seal: #DA291C;           /* the Imagami grand seal (hanko kit) */
  --font: Archivo, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(20px, 4vw, 48px);
  --section: clamp(72px, 9vw, 128px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p, h1, h2, h3, figure { margin: 0; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 14px; background: var(--text); color: var(--bg);
  font-family: var(--mono); font-size: 13px; text-decoration: none;
}
.skip:focus { top: 12px; }

[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* type helpers */
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em;
  color: var(--accent); margin-bottom: 18px;
}
.label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; color: var(--muted);
}
.display {
  font-weight: 800; font-stretch: 112%; line-height: 1.02; text-transform: uppercase;
}
.wordmark { font-weight: 600; font-stretch: 125%; font-size: 13px; letter-spacing: 0.3em; }

/* layout */
.wrap { max-width: 1200px; margin: 0 auto; }
.section { padding: var(--section) var(--gutter); }

/* eye mark */
.eye { display: block; flex: none; overflow: visible; }
.eye g { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.eye .pupil { fill: currentColor; stroke: none; }

/* glitch divider (echoes the avatar's glitch line) */
.glitch { position: relative; height: 1px; background: rgba(143, 214, 216, 0.14); overflow-x: clip; }
.glitch::before, .glitch::after { content: ""; position: absolute; height: 1px; }
.glitch::before { left: min(var(--x, 61%), calc(100% - 226px)); top: -3px; width: 140px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.glitch::after { left: calc(min(var(--x, 61%), calc(100% - 226px)) + 146px); top: 0; width: 64px; background: rgba(143, 214, 216, 0.5); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: max(760px, 100svh); overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 9, 11, 0.92) 0%, rgba(5, 9, 11, 0) 22%),
    linear-gradient(0deg, var(--bg) 0%, rgba(5, 9, 11, 0.9) 30%, rgba(5, 9, 11, 0) 64%);
}
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  padding: 24px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); text-decoration: none; }
.btn-ghost {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(230, 238, 240, 0.5); background: rgba(5, 9, 11, 0.35);
  color: var(--text); text-decoration: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
/* The language switch (EN · 日本語 · 한국어) sits before the access button. The current page's name is lit.
   On phones the access button gives way to it (the sign-up form is just below, in the hero). */
.topbar-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 14px; }
.lang { display: flex; align-items: center; gap: 0 9px; font: 500 11px/1 var(--mono); letter-spacing: 0.14em; }
.lang a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
  color: var(--muted); text-decoration: none; text-underline-offset: 7px; transition: color 0.2s;
}
.lang a + a::before { content: "·"; content: "·" / ""; position: absolute; left: -7px; color: var(--fine); pointer-events: none; }
.lang a:hover { color: var(--text); }
.lang a[aria-current] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; }
@media (max-width: 560px) { .topbar-end .btn-ghost { display: none; } }
@media (max-width: 380px) { .topbar .wordmark { letter-spacing: 0.2em; } .lang { gap: 0 7px; } .lang a { padding: 0 4px; } .lang a + a::before { left: -6px; } }
.lang a:lang(ja), .lang a:lang(ko) { font-size: 12px; letter-spacing: 0.04em; }

.hero-body {
  position: relative; z-index: 2; width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 120px var(--gutter) clamp(48px, 6vw, 84px);
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px 64px;
}
.hero-copy { flex: 1 1 520px; min-width: 0; max-width: 720px; }
.hero h1 {
  font-weight: 760; font-stretch: 104%; font-size: clamp(40px, 4.6vw, 68px);
  line-height: 1.02; letter-spacing: -0.005em; text-wrap: balance;
}
.hero h1 .h1-line { display: block; }
.hero h1 .h1-b { color: #8FA3AA; }
.hero-side { flex: 0 1 420px; min-width: 0; }
.hero-pitch { margin-bottom: 24px; color: var(--text-2); }

/* ---------- signup ---------- */
.signup label { display: block; margin-bottom: 10px; }
.signup-row { display: flex; flex-wrap: wrap; gap: 8px; }
.signup input[type="email"] {
  flex: 1 1 200px; min-width: 0; height: 52px; padding: 0 16px;
  background: rgba(5, 9, 11, 0.6); border: 1px solid rgba(230, 238, 240, 0.38); border-radius: 0;
  color: var(--text); font: 16px var(--font);
}
.signup input[type="email"]::placeholder { color: #7D8E94; }
.signup input[type="email"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
.signup button {
  flex: 1 0 auto; height: 52px; padding: 0 22px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--text); color: var(--bg);
  font: 650 15px var(--font); letter-spacing: 0.02em;
  transition: background 0.2s;
}
.signup button:hover { background: var(--accent); }
.signup button[disabled] { opacity: 0.6; cursor: progress; }
.signup-note { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin-top: 10px; font: 500 12px/1.5 var(--mono); letter-spacing: 0.06em; color: var(--sealed); }
.signup-done { padding: 18px 20px; border: 1px solid var(--accent); background: rgba(5, 9, 11, 0.7); }
.signup-done .eyebrow { margin-bottom: 8px; letter-spacing: 0.18em; }
.signup-done p:last-child { font-size: 16px; line-height: 1.5; }

/* ---------- record 727 ---------- */
.record { display: flex; flex-wrap: wrap; gap: clamp(32px, 5vw, 64px); align-items: flex-start; }
.record-cover { flex: 1 1 300px; max-width: 400px; }
.record-cover .frame { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(143, 214, 216, 0.14); }
.record-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.record-cover figcaption { margin-top: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; color: var(--dim); }

.card {
  /* Record 727 is typed on aged archive stock: yellowed, folded in thirds, foxed, stamped and annotated. */
  --paper-ink: #2A241E;
  --paper-faded: #675C4F;
  --stamp-red: #A8352A;
  --stamp-violet: #4F4479;
  --pencil: #6E6A62;
  --typed: "Special Elite", "Courier Prime", "Courier New", Courier, monospace;
  --hand: "Reenie Beanie", "Bradley Hand", "Segoe Print", cursive;
  --deckle: polygon(0% 0.2px, 3.6% 0.4px, 7.1% 1px, 10.7% 1.6px, 14.3% 1.8px, 17.9% 1.5px, 21.4% 1.6px, 22.3% 0.6px, 23% 5.5px, 23.4% 3px, 24% 0.8px, 28.6% 1.6px, 32.1% 1.1px, 35.7% 1.2px, 39.3% 1.2px, 42.9% 1.6px, 46.4% 1.4px, 50% 1.2px, 53.6% 1.4px, 57.1% 1.1px, 60.7% 1.1px, 64.3% 0.8px, 67.9% 1px, 71.4% 1px, 75% 1px, 78.6% 0.7px, 82.1% 0.9px, 85.7% 1px, 89.3% 1.7px, 92.9% 1.3px, 96.4% 1.3px, 100% 0.7px, calc(100% - 0.7px) 3.6%, calc(100% - 0.7px) 7.1%, calc(100% - 1.2px) 10.7%, calc(100% - 1.6px) 14.3%, calc(100% - 1.5px) 17.9%, calc(100% - 1.5px) 21.4%, calc(100% - 1.3px) 25%, calc(100% - 1.4px) 28.6%, calc(100% - 1.6px) 32.1%, calc(100% - 1.3px) 35.7%, calc(100% - 1.3px) 39.3%, calc(100% - 1.4px) 42.9%, calc(100% - 1.5px) 46.4%, calc(100% - 1.5px) 50%, calc(100% - 1px) 53.6%, calc(100% - 1.4px) 57.1%, calc(100% - 1px) 60.7%, calc(100% - 0.8px) 64.3%, calc(100% - 0.2px) 67.9%, calc(100% - 0.2px) 71.4%, calc(100% - 1px) 75%, calc(100% - 0.9px) 78.6%, calc(100% - 1.7px) 82.1%, calc(100% - 1.1px) 85.7%, calc(100% - 1.4px) 89.3%, calc(100% - 1px) 92.9%, calc(100% - 1.5px) 96.4%, 100% calc(100% - 30px), calc(100% - 6px) calc(100% - 19px), calc(100% - 14px) calc(100% - 9px), calc(100% - 21px) calc(100% - 6px), calc(100% - 33px) 100%, 92.9% calc(100% - 1.3px), 89.3% calc(100% - 1.6px), 85.7% calc(100% - 2.1px), 82.1% calc(100% - 1.6px), 78.6% calc(100% - 1.1px), 75% calc(100% - 1.1px), 71.4% calc(100% - 1.5px), 67.9% calc(100% - 1.8px), 64.3% calc(100% - 1.3px), 60.7% calc(100% - 1.1px), 57.1% calc(100% - 1.1px), 53.6% calc(100% - 1.1px), 50% calc(100% - 1.5px), 46.4% calc(100% - 1.3px), 42.9% calc(100% - 1.4px), 39.3% calc(100% - 1px), 35.7% calc(100% - 0.9px), 32.1% calc(100% - 1.2px), 28.6% calc(100% - 1.5px), 25% calc(100% - 1.5px), 21.4% calc(100% - 1.8px), 17.9% calc(100% - 1.7px), 14.3% calc(100% - 2.1px), 10.7% calc(100% - 1.7px), 7.1% calc(100% - 1.3px), 3.6% calc(100% - 0.8px), 0% calc(100% - 0.5px), 0.3px 96.4%, 0.6px 92.9%, 1.2px 89.3%, 1.4px 85.7%, 1.7px 82.1%, 1.4px 78.6%, 1.6px 75%, 1.6px 71.4%, 1.8px 67.9%, 1.7px 64.3%, 1.3px 60.7%, 0.7px 57.1%, 1px 53.6%, 1.1px 50%, 0.9px 46.4%, 0.5px 42.9%, 0.9px 39.3%, 1.6px 35.7%, 2px 32.1%, 1.9px 28.6%, 1.3px 25%, 1.3px 21.4%, 1.1px 17.9%, 1.3px 14.3%, 0.7px 10.7%, 0.9px 7.1%, 1.2px 3.6%);
  --rd-a: polygon(2% 0.5px, 14% 0.9px, 26% 1.1px, 38% 1.3px, 50% 1.2px, 62% 1.3px, 74% 1.4px, 86% 1.3px, 98% 1.2px, calc(100% - 0.5px) 12%, calc(100% - 3px) 30%, calc(100% - 1.5px) 52%, calc(100% - 0px) 71%, calc(100% - 5.5px) 90%, 98% calc(100% - 0.4px), 86% calc(100% - 1px), 74% calc(100% - 1.3px), 62% calc(100% - 1.8px), 50% calc(100% - 1.3px), 38% calc(100% - 1.2px), 26% calc(100% - 1.1px), 14% calc(100% - 1.2px), 2% calc(100% - 1.1px), 6px 88%, 2.5px 66%, 4px 45%, 4px 24%, 2.5px 8%);
  --rd-b: polygon(2% 0.8px, 14% 0.7px, 26% 1.1px, 38% 1.2px, 50% 1.3px, 62% 1.4px, 74% 1.2px, 86% 0.8px, 98% 0.9px, calc(100% - 3px) 12%, calc(100% - 1.5px) 30%, calc(100% - 5.5px) 52%, calc(100% - 3px) 71%, calc(100% - 0px) 90%, 98% calc(100% - 1.1px), 86% calc(100% - 1px), 74% calc(100% - 1.2px), 62% calc(100% - 1px), 50% calc(100% - 0.7px), 38% calc(100% - 0.3px), 26% calc(100% - 0.6px), 14% calc(100% - 0.9px), 2% calc(100% - 1.3px), 1px 88%, 4px 66%, 6px 45%, 4px 24%, 4px 8%);
  --rd-c: polygon(2% 1.6px, 14% 2px, 26% 1.7px, 38% 1.3px, 50% 0.8px, 62% 0.7px, 74% 0.8px, 86% 1px, 98% 1.3px, calc(100% - 5.5px) 12%, calc(100% - 5.5px) 30%, calc(100% - 0.5px) 52%, calc(100% - 0px) 71%, calc(100% - 0.5px) 90%, 98% calc(100% - 1.6px), 86% calc(100% - 1.7px), 74% calc(100% - 1.7px), 62% calc(100% - 1.4px), 50% calc(100% - 1.2px), 38% calc(100% - 1px), 26% calc(100% - 1.3px), 14% calc(100% - 1.6px), 2% calc(100% - 1.6px), 4px 88%, 2.5px 66%, 0px 45%, 0px 24%, 0px 8%);
  position: relative; isolation: isolate;
  flex: 1 1 520px; min-width: 0; padding: clamp(34px, 4.4vw, 56px) clamp(24px, 4vw, 52px) clamp(26px, 3.4vw, 40px);
  color: var(--paper-ink); font-family: var(--typed); font-size: 16.5px;
}
.card::before, .card::after { content: ""; position: absolute; inset: 0; clip-path: var(--deckle); pointer-events: none; }
.card::before {
  z-index: -1;
  background:
    radial-gradient(circle at calc(50% - 134px) 19px, #05090B 0 6.4px, rgba(64, 46, 26, 0.5) 7.3px, rgba(150, 98, 48, 0.2) 9.6px, transparent 12.5px),
    radial-gradient(circle at calc(50% + 134px) 19px, #05090B 0 6.4px, rgba(64, 46, 26, 0.5) 7.3px, rgba(150, 98, 48, 0.2) 9.6px, transparent 12.5px),
    url(img/paper-fibers.jpg) 0 0 / 512px 512px repeat,
    url(img/paper-age.jpg) 0 0 / 100% 100% no-repeat,
    #E6DBC1;
  background-blend-mode: normal, normal, multiply, normal;
}
.card::after {
  z-index: 2;
  background:
    url(img/stain.png) right -64px top 23% / 200px 200px no-repeat,
    url(img/paper-wear.png) 0 0 / 100% 100% no-repeat;
}
.card-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px;
  padding-bottom: 12px; border-bottom: 3px double rgba(42, 36, 30, 0.72);
  font-size: 13px; letter-spacing: 0.12em; color: var(--paper-faded);
}
.card-head .status {
  display: inline-block; margin: -4px 0 -6px; padding: 5px 10px 3px;
  border: 3px double currentColor; border-radius: 3px;
  color: var(--stamp-red); font-size: 14px; letter-spacing: 0.16em;
  rotate: -5deg; mix-blend-mode: multiply; opacity: 0.88; filter: url(#stampink);
}
.card h2 { margin-top: 30px; font-size: clamp(34px, 4vw, 48px); line-height: 1; color: var(--paper-ink); filter: url(#worn); }
.card-label { margin: 28px 0 12px; font-size: 13px; letter-spacing: 0.2em; color: var(--paper-faded); }
.card-text { display: grid; gap: 16px; font-size: 17px; line-height: 1.72; }
.card-text p, .card .note p { text-shadow: 0 0 0.6px rgba(42, 36, 30, 0.45); }
.margin-note { position: relative; height: 0; }
.margin-note span {
  position: absolute; right: -8px; top: -44px; rotate: -6deg; white-space: nowrap;
  font: 400 25px/1 var(--hand); color: var(--pencil); opacity: 0.9;
}
.pencil-u {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5.3C30 4.2 62 5.7 94 4.7S160 3.9 199 5' fill='none' stroke='%23716C63' stroke-width='1.4' stroke-linecap='round' opacity='.85' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M7 6.6C52 5.8 112 6.9 194 5.8' fill='none' stroke='%23716C63' stroke-width='.9' stroke-linecap='round' opacity='.55' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") left 100% / 100% 0.42em no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding-bottom: 0.1em;
}
.xo { position: relative; color: rgba(42, 36, 30, 0.5); }
.xo::after {
  content: attr(data-x); position: absolute; left: 0; right: 0; top: 0; overflow: hidden; white-space: nowrap;
  line-height: normal; letter-spacing: -0.085em; color: var(--paper-ink);
}
.redact {
  position: relative; display: inline-block; width: var(--w, 6em); height: 0.92em;
  background: var(--ink); vertical-align: -0.1em;
}
.card .redact { height: 1.06em; vertical-align: -0.17em; background: none; rotate: var(--rr, -0.6deg); }
.card .redact::before {
  content: ""; position: absolute; inset: -0.04em -0.1em;
  background:
    repeating-linear-gradient(180deg, rgba(255, 246, 230, 0) 0 2px, rgba(255, 246, 230, 0.05) 2px 3px),
    linear-gradient(90deg, #221C17, #16120F 38%, #1F1A15 66%, #14100D);
  clip-path: var(--rd, var(--rd-a));
}
.note {
  margin-top: 28px; padding-top: 20px; border-top: 1px dashed #98A4A9;
  display: flex; gap: 20px; align-items: flex-start; justify-content: space-between;
}
.card .note { margin-top: 30px; padding-top: 22px; border-top: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 6' preserveAspectRatio='none'%3E%3Cpath d='M2 3.4C70 2.6 130 3.9 205 3.1S330 2.4 398 3.3' fill='none' stroke='%236E6A62' stroke-width='1.1' stroke-linecap='round' opacity='.75' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M60 4.2C150 3.6 260 4.5 360 3.9' fill='none' stroke='%236E6A62' stroke-width='.7' stroke-linecap='round' opacity='.4' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") left top / 100% 6px no-repeat; }
.note p { font-size: 16px; line-height: 1.6; font-style: italic; }
.card .note p { line-height: 1.68; font-style: normal; }
.note .sig { margin-top: 10px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.2em; font-style: normal; }
.card .note .sig { margin-top: 12px; font-family: var(--typed); font-size: 14px; }
.seal { display: block; flex: none; color: var(--seal); }
.card .seal { rotate: -7deg; mix-blend-mode: multiply; opacity: 0.9; }
.meter { margin-top: 28px; padding: 18px 20px; background: var(--ink); color: var(--text); }
.card .meter {
  position: relative; margin-top: 32px; padding: 16px 18px 14px; rotate: -0.5deg;
  background: rgba(252, 248, 236, 0.6); color: var(--paper-ink);
  border: 1px solid rgba(42, 36, 30, 0.55); box-shadow: 0 2px 6px rgba(60, 44, 24, 0.14);
}
.card .meter::before, .card .meter::after {
  content: ""; position: absolute; top: -11px; width: 76px; height: 22px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.22) 0 28%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(244, 235, 198, 0.82), rgba(226, 211, 166, 0.76));
  clip-path: polygon(0 12%, 5% 0, 9% 9%, 14% 1%, 20% 8%, 100% 0, 96% 14%, 100% 30%, 95% 47%, 100% 63%, 96% 80%, 100% 100%, 0 100%, 4% 86%, 0 71%, 5% 55%, 0 38%, 4% 24%);
}
.card .meter::before { left: -18px; rotate: -31deg; }
.card .meter::after { right: -18px; rotate: 29deg; }
.meter-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; }
.card .meter-head { font-family: var(--typed); font-size: 13px; }
.meter-head span:last-child { color: var(--accent); }
.card .meter-head span:last-child { color: var(--stamp-violet); }
.meter-bar { margin-top: 12px; display: flex; gap: 3px; }
.meter-bar i { flex: 1 1 0; height: 10px; background: rgba(230, 238, 240, 0.16); }
.card .meter-bar i { height: 11px; background: transparent; box-shadow: inset 0 0 0 1px rgba(42, 36, 30, 0.45); }
.meter-bar i.on { background: var(--accent); }
.card .meter-bar i.on { background: var(--stamp-violet); }
.meter-foot { margin-top: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--muted); }
.card .meter-foot { font-family: var(--typed); font-size: 13px; color: var(--paper-faded); }
@media (max-width: 520px) { .card .meter-bar { gap: 2px; } }
.card-cta { margin-top: 28px; font-size: 15px; line-height: 1.6; color: var(--paper-faded); }
.card-cta a { color: var(--paper-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; white-space: nowrap; }
.card-cta a:hover { color: var(--stamp-red); }
.card :focus-visible { outline-color: var(--paper-ink); }
.page-no { margin-top: 26px; text-align: center; font-size: 13px; letter-spacing: 0.3em; color: var(--paper-faded); }

/* ---------- records shelf ---------- */
.records { background: var(--bg-2); }
.records-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 48px; }
.records-head h2 { font-size: clamp(32px, 4.2vw, 56px); }
.records-head p { flex: 0 1 380px; color: var(--text-3); }
.shelf { margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.book { min-width: 0; }
.book-art { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: #0B1216; }
.book-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.book:hover .book-art img { transform: scale(1.03); }
.book-meta { margin-top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--dim); }
.book h3 { margin-top: 8px; font-weight: 750; font-stretch: 110%; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.2; text-transform: uppercase; }
.book-kind { margin-top: 4px; font-size: 15px; color: var(--text-3); }
.chip {
  display: inline-block; margin-top: 14px; padding: 6px 9px;
  border: 1px solid rgba(230, 238, 240, 0.4);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; line-height: 1.4;
}
.chip.live { border-color: var(--accent); color: var(--accent); }
.chip.sealed { border-color: rgba(240, 138, 126, 0.6); color: var(--sealed); }
.book.is-sealed .book-art img { transform: scale(1.15); } /* sealed files ship pre-blurred: no title in the image */
.book.is-sealed:hover .book-art img { transform: scale(1.15); }
.stamp {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.stamp span {
  padding: 8px 14px; border: 2px solid #E2584A; color: var(--sealed); background: rgba(5, 9, 11, 0.45);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.3em; transform: rotate(-8deg);
}
.book .redact { background: #33424A; height: 0.85em; vertical-align: -0.05em; }

/* Covers turn over (click, tap, or Enter/Space on the button laid over each one) to show the back: the
   archive's record card from the print back cover. Sealed records stay sealed on the back too. */
.book-cover { position: relative; aspect-ratio: 2 / 3; perspective: 1600px; container-type: inline-size; }
.book-card { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(0.3, 0.65, 0.18, 1); }
.book-cover.is-turned .book-card { transform: rotateY(-180deg); }
.book-cover .book-art, .book-back { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.book-cover .book-art { aspect-ratio: auto; }
.book-flip {
  position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; padding: 0;
  display: flex; align-items: flex-start; justify-content: flex-end;
  border: 0; background: none; color: var(--text); font: inherit; cursor: pointer;
}
html:not(.js) .book-flip { display: none; } /* without the script the covers stay as they are */
.book-flip:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.book-flip span {
  display: inline-flex; align-items: center; gap: 7px; margin: 8px 8px 0 0; padding: 7px 9px 7px 8px;
  background: rgba(5, 9, 11, 0.82); border: 1px solid rgba(143, 214, 216, 0.45);
  font: 500 10px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transform: translateY(-4px); transition: opacity 0.2s, transform 0.2s;
}
.book-cover.is-turned .book-flip { align-items: flex-end; }
.book-cover.is-turned .book-flip span { margin: 0 8px 8px 0; transform: translateY(4px); }
.book-flip span::before { content: "↻"; content: "↻" / ""; font-size: 13px; letter-spacing: 0; color: var(--accent); }
.book-flip:hover span, .book-flip:focus-visible span, .book-cover.is-turned .book-flip:hover span, .book-cover.is-turned .book-flip:focus-visible span { opacity: 1; transform: none; }
@media (hover: none) {
  /* Touch screens: a small turn mark always shows, so readers know a cover can be tapped. */
  .book-flip span, .book-cover.is-turned .book-flip span { opacity: 0.92; transform: none; padding: 6px 7px; font-size: 0; letter-spacing: 0; gap: 0; }
}

.book-back {
  transform: rotateY(180deg); overflow: hidden;
  display: flex; flex-direction: column; padding: 6.6cqi 7cqi 5.6cqi;
  background: url(img/paper-fibers.jpg) 0 0 / 300px 300px repeat, #D8DCD7; background-blend-mode: multiply, normal;
  color: #15191B; box-shadow: inset 0 0 0 1px rgba(21, 25, 27, 0.1), inset 0 0 28cqi rgba(80, 70, 50, 0.12);
}
.bb-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1cqi 3cqi;
  padding-bottom: 3cqi; border-bottom: 1.5px solid currentColor;
  font: 500 max(7px, 3.1cqi)/1.35 var(--mono); letter-spacing: 0.05em;
}
.bb-head b { font-weight: 500; color: #B8322A; white-space: nowrap; }
.bb-rec { white-space: nowrap; }
.bb-hook {
  margin-top: 4.6cqi; padding-bottom: 4.6cqi; border-bottom: 1px solid rgba(21, 25, 27, 0.75);
  font: 750 7cqi/1.12 var(--font); font-stretch: 100%; letter-spacing: -0.005em; text-wrap: balance;
}
.bb-label { margin-top: 4cqi; font: 500 max(6.5px, 2.9cqi)/1 var(--mono); letter-spacing: 0.24em; opacity: 0.6; }
.bb-text { margin-top: 2.6cqi; font: 3.8cqi/1.42 var(--mono); }
.bb-bar { display: inline-block; width: var(--w); height: 0.95em; vertical-align: -0.14em; background: #15191B; }
.bb-sign { margin-top: auto; padding-top: 2.4cqi; display: flex; align-items: center; gap: 2.4cqi; font: 700 5cqi/1 var(--font); font-stretch: 115%; letter-spacing: 0.12em; }
.bb-seal { width: 12cqi; height: 12cqi; rotate: -7deg; opacity: 0.92; color: var(--seal); }
.bb-foot {
  display: flex; align-items: center; gap: 2.6cqi; margin-top: 3.4cqi; padding-top: 3cqi;
  border-top: 1px solid rgba(21, 25, 27, 0.75); font: 500 max(6.5px, 2.9cqi)/1 var(--mono); letter-spacing: 0.12em;
}
.bb-eye { flex: none; width: 11cqi; height: auto; overflow: visible; }
.bb-code {
  position: relative; flex: none; width: 23cqi; height: 9.4cqi; margin-left: auto; background: #F4F5F2;
  background-image: repeating-linear-gradient(90deg, #15191B 0 1.4px, transparent 1.4px 2.6px, #15191B 2.6px 3.2px, transparent 3.2px 4.9px, #15191B 4.9px 6.9px, transparent 6.9px 7.8px, #15191B 7.8px 8.4px, transparent 8.4px 10.6px);
  background-size: auto 56%; background-repeat: repeat-x; background-position: 0 10%;
  box-shadow: 0 0 0 1.4cqi #F4F5F2;
}
/* The record number under the bars, where the print back cover has its ISBN line. */
.bb-no {
  position: absolute; left: 0; right: 0; bottom: 0.5cqi; padding-left: 0.5em; text-align: center;
  font: 500 max(5px, 2.3cqi)/1 var(--mono); font-style: normal; letter-spacing: 0.5em; color: #15191B;
}
/* Sealed records: the back is blacked out under a stamp. */
.book-back.is-sealed .bb-hook { display: grid; gap: 2.6cqi; }
.book-back.is-sealed .bb-hook .bb-bar { display: block; height: 5.6cqi; }
.book-back.is-sealed .bb-text { display: grid; gap: 2.6cqi; }
.book-back.is-sealed .bb-text .bb-bar { display: block; height: 3.5cqi; }
.bb-stamp {
  position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%; rotate: -11deg;
  padding: 1.4cqi; white-space: nowrap;
  background: url(img/paper-fibers.jpg) 40px 70px / 300px 300px repeat, #D8DCD7; background-blend-mode: multiply, normal;
  box-shadow: 0 0.5cqi 2.2cqi rgba(21, 25, 27, 0.22);
}
.bb-stamp span {
  display: block; padding: 2.6cqi calc(3.8cqi - 0.22em) 2.6cqi 3.8cqi; border: 3px double #B8322A; color: #B8322A;
  font: 600 max(7px, 4.4cqi)/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase;
  filter: url(#stampink);
}
/* Small covers (phones show the shelf two across): the hook stays readable; the summary waits for a wider screen. */
@container (max-width: 230px) {
  .book-back:not(.is-sealed) .bb-label, .book-back:not(.is-sealed) .bb-text { display: none; }
  .bb-hook { font-size: 8.6cqi; margin-top: 7cqi; }
  .bb-head { letter-spacing: 0; }
  .bb-head > span { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .book-card { transition: none; } }

/* ---------- about ---------- */
.about { display: flex; flex-wrap: wrap; gap: clamp(32px, 6vw, 80px); align-items: center; max-width: 1100px; }
.about figure { flex: 1 1 280px; max-width: 420px; }
.about img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.about figcaption { margin-top: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--dim); }
.about-copy { flex: 1 1 420px; min-width: 0; }
.about-name { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.about-name h2 { font-stretch: 118%; font-size: clamp(36px, 4.4vw, 60px); line-height: 1; letter-spacing: 0.04em; }
.about-lede { margin-top: 28px; font-size: clamp(18px, 1.6vw, 21px); color: #D3DDE0; }
.about-more { margin-top: 16px; color: #A9B8BD; }

/* ---------- final call ---------- */
.join {
  text-align: center; border-top: 1px solid var(--line);
  background: radial-gradient(ellipse 60% 80% at 50% 100%, rgba(143, 214, 216, 0.16), rgba(5, 9, 11, 0) 70%), var(--bg);
  padding: clamp(80px, 10vw, 140px) var(--gutter);
}
.join-inner { max-width: 640px; margin: 0 auto; }
.join h2 { font-size: clamp(36px, 5vw, 64px); line-height: 1; text-wrap: balance; }
.join-lede { margin: 22px auto 0; max-width: 520px; color: var(--text-3); }
.join .signup, .join .signup-done { margin: 32px auto 0; max-width: 520px; text-align: left; }

/* ---------- footer ---------- */
.footer { padding: 40px var(--gutter) 48px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.footer-brand .wordmark { font-size: 12px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 0 28px; }
.footer nav a {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); text-decoration: none;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
}
.footer nav a:hover { color: var(--accent); }
.footer-fine {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  font-size: 13px; color: var(--fine);
}
.footer-fine p:first-child { max-width: 720px; }
.footer-fine .mono { font-size: 12px; letter-spacing: 0.08em; }
.footer-fine a { color: inherit; text-underline-offset: 2px; }
.footer-fine a:hover { color: var(--accent); }

/* ---------- small pages (404, thanks) ---------- */
.solo {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: 96px var(--gutter); max-width: 760px; margin: 0 auto;
}
.solo h1 { font-size: clamp(40px, 7vw, 80px); line-height: 0.98; }
.solo p { margin-top: 22px; font-size: clamp(18px, 1.8vw, 21px); color: var(--text-2); }
.solo .btn-ghost { margin-top: 36px; align-self: flex-start; }
.solo .brand { position: absolute; top: 24px; left: var(--gutter); }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero { min-height: 860px; }
  .note { flex-direction: column-reverse; }
}
@media (max-aspect-ratio: 3/4) {
  .hero-img { object-position: 20% 50%; }
}

/* =====================================================================
   Motion layer
   Starting states that hide anything only apply when the script runs
   (.js) and the visitor hasn't asked for reduced motion. Without either,
   everything above is complete and still.
   ===================================================================== */

/* ---------- hero layers ---------- */
.hero-feed, .hero-dust { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.hero-feed { opacity: 0; }
.hero-feed.is-live { opacity: 1; }
.hero-dust {
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 45%, transparent 90%);
}

/* ---------- HUD: the camera's own overlay ---------- */
.hud, .hud-track { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hud { font: 500 11px/1.5 var(--mono); letter-spacing: 0.16em; color: rgba(230, 238, 240, 0.74); text-transform: uppercase; }
.hud-c { position: absolute; width: 26px; height: 26px; border: 0 solid rgba(230, 238, 240, 0.5); }
.hud-c.tl { top: 14px; left: 14px; border-width: 1px 0 0 1px; }
.hud-c.tr { top: 14px; right: 14px; border-width: 1px 1px 0 0; }
.hud-c.bl { bottom: 14px; left: 14px; border-width: 0 0 1px 1px; }
.hud-c.br { bottom: 14px; right: 14px; border-width: 0 1px 1px 0; }
.hud-rec { position: absolute; top: 92px; left: var(--gutter); display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.hud-rec i { width: 8px; height: 8px; border-radius: 50%; background: #E5483A; box-shadow: 0 0 10px rgba(229, 72, 58, 0.8); animation: blink-step 1.2s steps(1) infinite; }
.hud-rec b { font-weight: 500; color: var(--text); }
.hud-cam { position: absolute; top: 92px; right: var(--gutter); text-align: right; }
.hud-cam > span { display: block; }
.hud-cam .sig { color: var(--accent); }
.hud-side {
  position: absolute; top: 50%; right: 18px; writing-mode: vertical-rl; transform: translateY(-50%);
  font-size: 10px; letter-spacing: 0.32em; color: rgba(230, 238, 240, 0.45); white-space: nowrap;
}
.hud-boot {
  display: none; position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  color: var(--accent); font-size: 12px; letter-spacing: 0.3em; white-space: nowrap;
}
.hud-boot::after { content: "_"; animation: blink-step 0.8s steps(1) infinite; }
.hud-target {
  display: none; position: absolute; left: 0; top: 0; width: 60px; height: 60px;
  opacity: 0; transition: opacity 0.3s; will-change: transform; --hc: #F4F7F8;
}
.motion .hud-target { display: block; }
.hud-target.is-in { opacity: 1; }
.hud-target.off { opacity: 0; }
.hud-target b {
  position: absolute; inset: 0; filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 6px rgba(0, 0, 0, 0.5));
  background:
    linear-gradient(var(--hc), var(--hc)) left top / 12px 2px no-repeat,
    linear-gradient(var(--hc), var(--hc)) left top / 2px 12px no-repeat,
    linear-gradient(var(--hc), var(--hc)) right top / 12px 2px no-repeat,
    linear-gradient(var(--hc), var(--hc)) right top / 2px 12px no-repeat,
    linear-gradient(var(--hc), var(--hc)) left bottom / 12px 2px no-repeat,
    linear-gradient(var(--hc), var(--hc)) left bottom / 2px 12px no-repeat,
    linear-gradient(var(--hc), var(--hc)) right bottom / 12px 2px no-repeat,
    linear-gradient(var(--hc), var(--hc)) right bottom / 2px 12px no-repeat;
}
.hud-target.locking { --hc: var(--sealed); }
.hud-target.locking b { animation: blink-step 0.16s steps(1) infinite; }
.hud-target span {
  position: absolute; left: calc(100% + 10px); top: -4px; padding: 4px 8px 4px 9px;
  background: rgba(5, 9, 11, 0.66); border-left: 2px solid var(--hc);
  font: 500 10px/1.5 var(--mono); letter-spacing: 0.18em; color: rgba(236, 242, 244, 0.92); white-space: nowrap;
}
.hud-target em { display: block; font-style: normal; color: var(--sealed); }
.no-gl .hud-track { display: none; }
@keyframes blink-step { 50% { opacity: 0; } }

/* ---------- hero power-on ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-img { opacity: 0; }
  .js.no-gl .hero-img { opacity: 1; animation: img-on 1.6s steps(1, end) both, drift 30s ease-in-out 1.6s infinite alternate; }
  .js .hud-boot { display: block; transition: opacity 0.3s; }
  .js .hud-boot.gone { opacity: 0; }
  .js .hero [data-intro] { transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .js .hero [data-intro]:not(.is-in) { opacity: 0; }
  .js .hero .hero-pitch:not(.is-in), .js .hero .signup:not(.is-in) { transform: translateY(18px); }
  .js .hero .h1-line.is-in:not(.done) { animation: glitch-in 0.85s steps(1, end) both; }
}
@keyframes img-on { 0% { opacity: 0; } 8% { opacity: 0.6; } 12% { opacity: 0; } 20% { opacity: 0.9; } 24% { opacity: 0.25; } 36%, 100% { opacity: 1; } }
@keyframes drift { to { transform: scale(1.07) translate(-1%, -1.2%); } }

/* ---------- scroll reveals ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal="up"] {
    opacity: 0; transform: translateY(26px);
    transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rd, 0ms), transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rd, 0ms);
  }
  .js [data-reveal="up"].is-in { opacity: 1; transform: none; }
  .js [data-reveal="fade"] { opacity: 0; transition: opacity 1.2s ease var(--rd, 0ms); }
  .js [data-reveal="fade"].is-in { opacity: 1; }
  .js [data-reveal="glitch"]:not(.is-in), .js [data-reveal="stamp"]:not(.is-in) { opacity: 0; }
  .js [data-reveal="glitch"].is-in:not(.done) { animation: glitch-in 0.85s steps(1, end) var(--rd, 0ms) both; }
  .js [data-reveal="stamp"].is-in:not(.done) { animation: stamp 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) var(--rd, 0ms) both; }
  .js [data-reveal="print"] { clip-path: inset(0 0 100% 0); }
  .js [data-reveal="print"].is-in { clip-path: inset(0 0 0 0); transition: clip-path 1.3s steps(24, end); }
  .js [data-reveal="restore"] { clip-path: inset(0 0 100% 0); filter: brightness(1.9) contrast(0.6) saturate(0); }
  .js [data-reveal="restore"].is-in {
    clip-path: inset(0 0 0 0); filter: none;
    transition: clip-path 1.1s cubic-bezier(0.7, 0, 0.2, 1) var(--rd, 0ms), filter 1.4s ease calc(var(--rd, 0ms) + 0.45s);
  }
  .js [data-reveal].done { clip-path: none; }
  .js [data-decode]:not(.is-in):not([data-intro]) { opacity: 0; }
}

@keyframes glitch-in {
  0% { opacity: 0; }
  8% { opacity: 1; transform: translateX(-14px) skewX(-10deg); clip-path: inset(0 0 72% 0); text-shadow: 6px 0 rgba(255, 70, 70, 0.8), -6px 0 rgba(80, 230, 255, 0.8); }
  16% { transform: translateX(10px); clip-path: inset(38% 0 30% 0); }
  24% { opacity: 0.35; transform: translateX(-4px) skewX(6deg); clip-path: inset(66% 0 0 0); }
  32% { opacity: 1; transform: translateX(5px); clip-path: inset(0 0 44% 0); text-shadow: -4px 0 rgba(255, 70, 70, 0.7), 4px 0 rgba(80, 230, 255, 0.7); }
  44% { transform: translateX(-2px); clip-path: inset(0); text-shadow: 2px 0 rgba(255, 70, 70, 0.55), -2px 0 rgba(80, 230, 255, 0.55); }
  60% { transform: none; text-shadow: -1px 0 rgba(255, 70, 70, 0.35), 1px 0 rgba(80, 230, 255, 0.35); }
  100% { opacity: 1; transform: none; clip-path: inset(0); text-shadow: none; }
}
.flash { animation: flash 0.36s steps(1, end) !important; }
@keyframes flash {
  0% { transform: translateX(-3px); clip-path: inset(8% 0 40% 0); text-shadow: 4px 0 rgba(255, 70, 70, 0.75), -4px 0 rgba(80, 230, 255, 0.75); }
  25% { transform: translateX(3px); clip-path: inset(52% 0 6% 0); }
  50% { transform: translateX(-1px); clip-path: inset(0); text-shadow: -2px 0 rgba(255, 70, 70, 0.6), 2px 0 rgba(80, 230, 255, 0.6); }
  75% { transform: none; text-shadow: 1px 0 rgba(255, 70, 70, 0.4), -1px 0 rgba(80, 230, 255, 0.4); }
  100% { transform: none; clip-path: none; text-shadow: none; }
}
@keyframes stamp {
  0% { opacity: 0; transform: scale(1.9) rotate(-16deg); }
  55% { opacity: 1; transform: scale(0.9) rotate(3deg); }
  78% { transform: scale(1.05) rotate(-1deg); }
  100% { opacity: 1; transform: none; }
}

/* ---------- film grain and signal tears ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 60; pointer-events: none;
  background: url(img/grain.png); opacity: 0.55; animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 17% { transform: translate(-5%, 4%); } 33% { transform: translate(4%, -6%); }
  50% { transform: translate(-3%, 7%); } 67% { transform: translate(6%, 2%); } 83% { transform: translate(-6%, -3%); }
  100% { transform: translate(2%, 5%); }
}
.tears { position: fixed; inset: 0; z-index: 59; pointer-events: none; overflow: hidden; }
.tears i {
  position: absolute; left: -10%; right: -10%; opacity: 0; mix-blend-mode: difference;
  background: url(img/grain.png), linear-gradient(90deg, rgba(143, 214, 216, 0), rgba(143, 214, 216, 0.55) 25%, rgba(230, 238, 240, 0.75) 50%, rgba(240, 138, 126, 0.45) 75%, rgba(143, 214, 216, 0));
}
.tears.on i { animation: tear 0.26s steps(2, end) both; }
@keyframes tear {
  0% { opacity: 1; transform: translateX(var(--dx)); }
  50% { opacity: 0.85; transform: translateX(calc(var(--dx) * -0.6)); }
  100% { opacity: 0; transform: none; }
}

/* ---------- covers: scanlines, slice glitches, tilt glare ---------- */
.gl { position: relative; overflow: hidden; isolation: isolate; }
.gl::before, .gl::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background-image: var(--src); background-size: cover; background-position: center;
  background-color: #FF3B3B; background-blend-mode: multiply; mix-blend-mode: screen;
}
.gl::after { background-color: #2EE6FF; }
.gl.gl-on::before { animation: gl-a 0.45s steps(1, end); }
.gl.gl-on::after { animation: gl-b 0.45s steps(1, end); }
.gl.gl-on img { animation: gl-img 0.45s steps(1, end); }
@keyframes gl-a {
  0% { opacity: 0.9; transform: translateX(-12px); clip-path: inset(14% 0 66% 0); }
  18% { transform: translateX(9px); clip-path: inset(48% 0 34% 0); }
  36% { transform: translateX(-5px); clip-path: inset(78% 0 8% 0); }
  54% { transform: translateX(14px); clip-path: inset(30% 0 58% 0); }
  72% { transform: translateX(-7px); clip-path: inset(60% 0 22% 0); }
  90%, 100% { opacity: 0; }
}
@keyframes gl-b {
  0% { opacity: 0.9; transform: translateX(10px); clip-path: inset(56% 0 28% 0); }
  18% { transform: translateX(-8px); clip-path: inset(8% 0 80% 0); }
  36% { transform: translateX(12px); clip-path: inset(40% 0 44% 0); }
  54% { transform: translateX(-10px); clip-path: inset(70% 0 12% 0); }
  72% { transform: translateX(6px); clip-path: inset(22% 0 64% 0); }
  90%, 100% { opacity: 0; }
}
@keyframes gl-img {
  0% { transform: translateX(3px); }
  20% { transform: translateX(-4px); filter: contrast(1.35) brightness(1.15); }
  40% { transform: none; filter: none; }
  60% { transform: translateX(2px) skewX(-2deg); }
  80%, 100% { transform: none; }
}
.scan {
  position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
}
.scan::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22%;
  background: linear-gradient(180deg, transparent, rgba(143, 214, 216, 0.1) 50%, transparent);
  animation: roll 6s linear infinite;
}
@keyframes roll { from { transform: translateY(-100%); } to { transform: translateY(460%); } }
.tilt { will-change: transform; }
.glare {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.16), transparent 55%);
}
.tilt.is-tilting .glare { opacity: 1; }

/* ---------- sealed records: live static ---------- */
.book.is-sealed .book-art::after {
  content: ""; position: absolute; inset: -50%; z-index: 1; pointer-events: none;
  background: url(img/grain.png); opacity: 0.5; animation: static 0.5s steps(4) infinite;
}
.book.is-sealed .book-art::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 24%; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(240, 138, 126, 0.14), transparent);
  animation: roll 4.5s linear infinite;
}
.book.is-sealed.denied .book-art::after { opacity: 0.95; animation-duration: 0.22s; }
.stamp { z-index: 2; }
.book.is-sealed.denied .stamp span { border-color: var(--sealed); box-shadow: 0 0 18px rgba(240, 138, 126, 0.35); }
@keyframes static {
  0% { transform: translate(0, 0); } 25% { transform: translate(-12%, 8%); } 50% { transform: translate(9%, -11%); }
  75% { transform: translate(-6%, -4%); } 100% { transform: translate(4%, 10%); }
}

/* ---------- redactions: look closer, get refused ---------- */
.redact { cursor: help; }
.redact .rn {
  position: absolute; inset: 0; overflow: hidden; display: flex; align-items: center;
  font: 500 0.78em/1 var(--mono); letter-spacing: 0; color: #56646B; white-space: nowrap;
}
.redact[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 3;
  transform: translateX(-50%); padding: 5px 7px; background: var(--ink); color: var(--paper);
  font: 500 10px/1 var(--mono); letter-spacing: 0.2em; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.book .redact[data-tip]::after { background: var(--text); color: var(--bg); }
.redact:hover::after, .redact.probe::after { opacity: 1; }
.redact.probe { animation: probe 0.5s steps(1, end); }
@keyframes probe {
  0% { transform: translateX(2px); box-shadow: 3px 0 rgba(255, 70, 70, 0.55), -3px 0 rgba(80, 230, 255, 0.55); }
  30% { transform: translateX(-2px); }
  60% { transform: none; box-shadow: -1px 0 rgba(255, 70, 70, 0.5), 1px 0 rgba(80, 230, 255, 0.5); }
  100% { transform: none; box-shadow: none; }
}

/* ---------- files-released meter ---------- */
.meter-bar i:first-child { animation: pending 1.6s steps(1) infinite; }
@keyframes pending { 50% { background: rgba(143, 214, 216, 0.6); } }
.meter.sweep .meter-bar i { animation: sweep 0.9s ease-out both; animation-delay: calc(var(--n, 0) * 22ms); }
@keyframes sweep {
  0% { background: rgba(230, 238, 240, 0.16); }
  14% { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
  100% { background: rgba(230, 238, 240, 0.16); box-shadow: none; }
}

/* ---------- the archivist's portrait ---------- */
.portrait { position: relative; }
.portrait canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; pointer-events: none; }
.portrait canvas.is-live { opacity: 1; }

/* ---------- depth: ghost type, edge labels, record ticker ---------- */
.has-ghost { position: relative; overflow: hidden; }
@supports (overflow: clip) { .has-ghost { overflow: clip; } }
.has-ghost > .wrap { position: relative; z-index: 1; }
.ghost {
  position: absolute; z-index: 0; pointer-events: none; user-select: none; white-space: nowrap;
  font-weight: 800; font-stretch: 125%; line-height: 0.78; letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 1px rgba(143, 214, 216, 0.16);
}
.ghost-727 { left: -3vw; bottom: 2%; font-size: clamp(160px, 24vw, 400px); }
.edge {
  position: absolute; top: 50%; z-index: 1; writing-mode: vertical-rl; pointer-events: none;
  font: 500 10px/1 var(--mono); letter-spacing: 0.34em; color: rgba(154, 171, 177, 0.5); white-space: nowrap;
}
.edge-l { left: 18px; transform: translateY(-50%) rotate(180deg); }
.edge-r { right: 18px; transform: translateY(-50%); }
@media (max-width: 1100px) { .edge { display: none; } }
.ticker { overflow: hidden; margin: calc(var(--section) * -0.35) calc(var(--gutter) * -1) clamp(36px, 5vw, 64px); pointer-events: none; }
.ticker-track {
  display: flex; width: max-content; margin-left: -600px; white-space: nowrap;
  font-weight: 800; font-stretch: 125%; font-size: clamp(56px, 9vw, 150px); line-height: 1.05; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1px rgba(230, 238, 240, 0.12);
}
.ticker-track span { padding-right: 0.35em; }
.ticker-track .cur { -webkit-text-stroke-color: rgba(143, 214, 216, 0.55); }
.ticker-track .sealed-t { -webkit-text-stroke-color: rgba(240, 138, 126, 0.3); }

/* glitch dividers: the bright segment slips now and then */
.glitch::before { animation: seg 9s steps(1, end) infinite; }
@keyframes seg {
  0%, 61%, 64%, 88%, 91%, 100% { transform: none; opacity: 1; }
  62% { transform: translateX(46px); opacity: 0.4; }
  63% { transform: translateX(-180px) scaleX(0.4); }
  89% { transform: translateX(120px) scaleX(1.6); opacity: 0.7; }
  90% { transform: translateX(10px); opacity: 0.2; }
}

/* ---------- final call: a heartbeat and an eye ---------- */
.join { position: relative; overflow: hidden; }
@supports (overflow: clip) { .join { overflow: clip; } }
.join-inner { position: relative; z-index: 1; }
.join::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 70% at 50% 100%, rgba(143, 214, 216, 0.22), transparent 70%);
  opacity: 0.35; animation: beat 1.7s ease-out infinite;
}
@keyframes beat { 0%, 100% { opacity: 0.35; } 6% { opacity: 1; } 14% { opacity: 0.55; } 24% { opacity: 0.85; } 42% { opacity: 0.35; } }
.join-eye {
  position: absolute; left: 50%; top: 50%; pointer-events: none;
  width: min(80vw, 760px); margin-left: calc(min(80vw, 760px) / -2); margin-top: calc(min(80vw, 760px) * -0.347);
  color: var(--accent); opacity: 0.07;
}
.join-eye svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------- the eye mark ---------- */
.eye-live { transform-origin: 50% 45%; }
.eye-live.blink { animation: blink 0.64s cubic-bezier(0.45, 0, 0.3, 1); }
.eye-live.eye-glitch { animation: eye-glitch 0.3s steps(1, end); }
@keyframes blink { 0%, 100% { transform: none; } 38%, 50% { transform: scaleY(0.6); } }
@keyframes eye-glitch {
  0% { transform: translateX(2px); filter: drop-shadow(2px 0 rgba(255, 70, 70, 0.9)) drop-shadow(-2px 0 rgba(80, 230, 255, 0.9)); }
  33% { transform: translateX(-2px) skewX(8deg); }
  66% { transform: translateX(1px); filter: none; }
  100% { transform: none; }
}

/* ---------- archive terminal ---------- */
.term {
  width: min(680px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 48px)); padding: 0;
  border: 1px solid rgba(143, 214, 216, 0.5); background: rgba(5, 9, 11, 0.97); color: var(--accent);
  font: 13px/1.6 var(--mono);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.7), 0 0 60px rgba(143, 214, 216, 0.15);
}
.term::backdrop { background: rgba(5, 9, 11, 0.72); }
.term[open] { display: flex; flex-direction: column; animation: term-in 0.4s steps(1, end); }
@keyframes term-in {
  0% { opacity: 0; transform: scaleY(0.02); }
  20% { opacity: 1; transform: scaleY(0.02) scaleX(1.02); }
  40% { transform: scaleY(1.04); clip-path: inset(0 0 40% 0); }
  60% { transform: none; clip-path: inset(20% 0 0 0); }
  80%, 100% { transform: none; clip-path: none; }
}
.term-head, .reel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  border-bottom: 1px solid rgba(143, 214, 216, 0.25); font-size: 11px; letter-spacing: 0.2em; color: var(--muted);
}
.term-x {
  min-height: 36px; padding: 0 12px; background: none; border: 1px solid rgba(230, 238, 240, 0.3); color: var(--text-2);
  font: 500 11px var(--mono); letter-spacing: 0.14em; cursor: pointer;
}
.term-x:hover { border-color: var(--accent); color: var(--accent); }
.term-log { flex: 1 1 auto; min-height: 180px; overflow-y: auto; padding: 16px; white-space: pre-wrap; }
.term-log p { margin: 0; }
.term-log .in { margin-top: 10px; color: var(--text); }
.term-log .dim { color: var(--muted); }
.term-form { display: flex; align-items: center; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid rgba(143, 214, 216, 0.18); }
.term-form:focus-within { border-top-color: var(--accent); }
.term-form label { color: var(--accent); }
.term-form input {
  flex: 1 1 auto; min-width: 0; height: 36px; padding: 0; border: 0; background: transparent;
  color: var(--text); font: 16px var(--mono); caret-color: var(--accent);
}
.term-form input:focus { outline: none; }

/* ---------- phones ---------- */
@media (max-width: 700px) {
  .hud-cam, .hud-side, .hud-track { display: none; }
  .hud-rec { top: 82px; font-size: 10px; letter-spacing: 0.12em; }
  .hud-c { width: 16px; height: 16px; }
  .hud-c.tl, .hud-c.tr { top: 10px; }
  .hud-c.bl, .hud-c.br { bottom: 10px; }
  .hud-c.tl, .hud-c.bl { left: 10px; }
  .hud-c.tr, .hud-c.br { right: 10px; }
  /* the headline sits over the bright end of the hall on phones: deepen the shade and lift the grey line */
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(5, 9, 11, 0.92) 0%, rgba(5, 9, 11, 0) 20%),
      linear-gradient(0deg, var(--bg) 0%, rgba(5, 9, 11, 0.88) 32%, rgba(5, 9, 11, 0.42) 58%, rgba(5, 9, 11, 0.1) 80%, rgba(5, 9, 11, 0) 100%);
  }
  .hero h1 { text-shadow: 0 0 24px rgba(5, 9, 11, 0.75), 0 2px 4px rgba(5, 9, 11, 0.45); }
  .hero h1 .h1-b { color: #B4C4CA; }
}

/* ---------- safety nets ---------- */
.static [data-intro], .static [data-reveal], .static [data-decode], .static .hero-img {
  opacity: 1 !important; transform: none !important; clip-path: none !important; filter: none !important; animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important; animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important; animation-delay: 0ms !important;
  }
}

/* ---------- record 727 document: ink versions of the meter and probe ---------- */
.card .redact .rn { color: #8E8273; font-family: var(--typed); }
.card .redact[data-tip]::after { background: #1C1713; color: #E8DFC8; font-family: var(--typed); }
.card .redact.probe { animation: probe-ink 0.5s steps(1, end); }
@keyframes probe-ink { 0% { translate: 2px 0; } 30% { translate: -2px 0; } 60%, 100% { translate: none; } }
.card .meter-bar i:first-child { animation-name: pending-ink; }
@keyframes pending-ink { 50% { background: rgba(79, 68, 121, 0.45); } }
.card .meter.sweep .meter-bar i { animation-name: sweep-ink; }
@keyframes sweep-ink { 0% { background: transparent; } 14% { background: var(--stamp-violet); } 100% { background: transparent; } }

/* ---------- Record 727: the recovered audio card (opens #recording) ---------- */
.record-side { flex: 1 1 300px; max-width: 400px; display: flex; flex-direction: column; gap: 30px; }
.record-side .record-cover { flex: none; max-width: none; }
.signal-card {
  position: relative; display: block; width: 100%; margin: 0; padding: 18px 20px 20px; text-align: left; cursor: pointer;
  color: var(--text); background: linear-gradient(180deg, rgba(10, 24, 28, 0.88), rgba(4, 9, 11, 0.88));
  border: 1px solid rgba(143, 214, 216, 0.55); border-radius: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 44px rgba(143, 214, 216, 0.1);
  font: 500 11px/1.3 var(--mono); letter-spacing: 0.2em; text-transform: uppercase;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.signal-head { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.signal-head i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #E5483A; box-shadow: 0 0 8px rgba(229, 72, 58, 0.8); animation: blink-step 1.2s steps(1) infinite; }
.signal-main { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.signal-play {
  position: relative; flex: none; width: 60px; height: 60px; color: var(--bg); background: var(--accent);
  box-shadow: 0 0 0 4px rgba(143, 214, 216, 0.12), 0 0 26px rgba(143, 214, 216, 0.4); transition: background 0.2s, box-shadow 0.2s;
}
.signal-play::before {
  content: ""; position: absolute; left: 50%; top: 50%; margin: -10px 0 0 -6px;
  border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent currentColor;
}
.signal-text { min-width: 0; }
.signal-title { display: block; font: 700 19px/1.1 var(--font); font-stretch: 112%; letter-spacing: 0.04em; color: var(--text); }
.signal-meta { display: block; margin-top: 8px; color: var(--accent); }
.signal-wave {
  display: block; width: 100%; height: 46px; margin-top: 18px;
  background: linear-gradient(rgba(143, 214, 216, 0.3), rgba(143, 214, 216, 0.3)) center / 100% 1px no-repeat;
}
.signal-card:hover, .signal-card:focus-visible { border-color: var(--accent); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 60px rgba(143, 214, 216, 0.22); }
.signal-card:hover .signal-play, .signal-card:focus-visible .signal-play { background: #E6F7F7; box-shadow: 0 0 0 6px rgba(143, 214, 216, 0.16), 0 0 34px rgba(143, 214, 216, 0.6); }
.signal-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
html:not(.js) .signal-card { display: none; }
@media (max-width: 380px) {
  .signal-card { padding: 16px 16px 18px; letter-spacing: 0.14em; }
  .signal-title { font-size: 17px; }
}

/* ---------- the recovered recording window (audio, or footage if a <video> is set) ---------- */
.reel {
  width: min(1120px, calc(100vw - 20px)); max-width: none; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px);
  margin: auto; padding: 0; overflow: hidden; border: 1px solid rgba(143, 214, 216, 0.45); background: #020406; color: var(--text);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.75), 0 0 60px rgba(143, 214, 216, 0.12);
}
.reel::backdrop { background: rgba(2, 4, 6, 0.9); }
.reel[open] { display: flex; flex-direction: column; animation: term-in 0.4s steps(1, end); }
.reel-screen { position: relative; flex: none; aspect-ratio: 16 / 9; max-height: calc(100dvh - 116px); background: #000; }
.reel-screen video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
/* Captions in the archive's typewriter-terminal voice (::cue takes only font, color and background). */
.reel-screen video::cue { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; color: #E6EEF0; background: rgba(3, 6, 8, 0.8); }
@media (max-width: 560px) { .reel-screen video::cue { font-size: 12.5px; } } /* the default scales with the frame and gets tiny on phones */
.reel.is-waiting video, .reel.is-waiting .tape, .reel.is-waiting .tape-bar, .reel-wait { display: none; }
.reel.is-waiting .reel-wait {
  position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; text-align: center; font: 500 12px/1.6 var(--mono); letter-spacing: 0.3em; color: var(--text-2);
}
.reel-wait::before {
  content: ""; position: absolute; inset: -50%; pointer-events: none;
  background: url(img/grain.png); opacity: 0.55; animation: static 0.5s steps(4) infinite;
}
.reel-wait::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(143, 214, 216, 0.12), transparent); animation: roll 4.5s linear infinite;
}
.reel-wait p { position: relative; z-index: 1; }
.reel-wait .reel-wait-k { font-size: clamp(18px, 3vw, 30px); letter-spacing: 0.32em; color: var(--sealed); }
.reel-wait .reel-wait-d { color: var(--accent); }
.reel-wait .hud-c { z-index: 1; pointer-events: none; }
.reel-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 16px;
  border-top: 1px solid rgba(143, 214, 216, 0.18); font: 500 11px/1.4 var(--mono); letter-spacing: 0.2em; color: var(--muted);
}

/* Audio: a signal display. A trace sweeps across writing the recording's voiceprint (from its signal map),
   a signal meter sits top right, the spoken line types out below, and the seek bar shows the levels. */
.reel.is-audio .reel-screen { max-height: calc(100dvh - 180px); }
.tape { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse 75% 55% at 50% 41%, #071419 0%, #030709 62%, #020406 100%); }
.tape-scope { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; pointer-events: none; }
.tape::before {
  content: ""; position: absolute; inset: -50%; z-index: 2; pointer-events: none;
  background: url(img/grain.png); opacity: 0.2; animation: static 0.5s steps(4) infinite;
}
.tape::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(2, 4, 6, 0.24) 0 1px, transparent 1px 3px),
    linear-gradient(0deg, rgba(2, 4, 6, 0.92) 0%, rgba(2, 4, 6, 0.55) 17%, rgba(2, 4, 6, 0) 32%);
}
.tape .hud-c { z-index: 3; pointer-events: none; }
.tape-src, .tape-sig {
  position: absolute; top: 16px; z-index: 3; display: flex; align-items: center; gap: 8px; margin: 0;
  font: 500 10px/1 var(--mono); letter-spacing: 0.2em; color: var(--text-2);
}
.tape-src { left: 18px; }
.tape-sig { right: 18px; }
.tape-dot { width: 6px; height: 6px; border-radius: 50%; background: #E5483A; box-shadow: 0 0 8px rgba(229, 72, 58, 0.8); }
.reel.is-playing .tape-dot { animation: blink-step 1.2s steps(1) infinite; }
.tape-sig span { display: flex; align-items: flex-end; gap: 2px; height: 10px; }
.tape-sig i { width: 3px; height: 100%; background: rgba(143, 214, 216, 0.2); transition: background 0.12s; }
.tape-sig i:nth-child(1) { height: 30%; }
.tape-sig i:nth-child(2) { height: 47%; }
.tape-sig i:nth-child(3) { height: 64%; }
.tape-sig i:nth-child(4) { height: 82%; }
.tape-sig i.on { background: var(--accent); box-shadow: 0 0 6px rgba(143, 214, 216, 0.6); }
.reel:not(.has-signal) .tape-sig { visibility: hidden; }
.tape-line {
  position: absolute; left: 7%; right: 7%; bottom: 7%; z-index: 3; min-height: 2.9em; margin: 0;
  display: flex; align-items: flex-end; justify-content: center; text-align: center;
  font: 500 clamp(13px, 1.75vw, 20px)/1.45 var(--mono); color: var(--text);
  text-shadow: 0 0 14px rgba(2, 4, 6, 0.95), 0 1px 2px rgba(2, 4, 6, 0.9); transition: opacity 0.8s;
}
.tape-line.is-past { opacity: 0.38; }
.tape-line.is-typing::after { content: "\258C"; margin-left: 1px; color: var(--accent); animation: blink-step 0.8s steps(1) infinite; }
.tape-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid rgba(143, 214, 216, 0.18); }
.tape-play {
  position: relative; flex: none; width: 40px; height: 40px; padding: 0; cursor: pointer; color: var(--text);
  border: 1px solid rgba(230, 238, 240, 0.55); background: rgba(5, 9, 11, 0.45); transition: border-color 0.2s, color 0.2s;
}
.tape-play::before {
  content: ""; position: absolute; left: 50%; top: 50%; margin: -6px 0 0 -4px;
  border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor;
}
.reel.is-playing .tape-play::before {
  box-sizing: border-box; width: 10px; height: 12px; margin: -6px 0 0 -5px;
  border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor;
}
.tape-play:hover, .tape-play:focus-visible { border-color: var(--accent); color: var(--accent); }
.tape-track { position: relative; flex: 1 1 auto; min-width: 0; height: 34px; }
.tape-wave { position: absolute; left: 0; top: 4px; display: block; width: 100%; height: calc(100% - 8px); pointer-events: none; opacity: 0; transition: opacity 0.4s; }
.reel.has-signal .tape-wave { opacity: 1; }
.tape-seek {
  position: relative; display: block; width: 100%; height: 34px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.tape-seek::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), rgba(230, 238, 240, 0.2) var(--p, 0%)); }
.tape-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 16px; margin-top: -7px; border: 0; border-radius: 0; background: var(--accent); }
.tape-seek::-moz-range-track { height: 2px; background: rgba(230, 238, 240, 0.2); }
.tape-seek::-moz-range-progress { height: 2px; background: var(--accent); }
.tape-seek::-moz-range-thumb { width: 8px; height: 16px; border: 0; border-radius: 0; background: var(--accent); }
/* with the level bars drawn under it, the seek bar keeps only a thin playhead */
.reel.has-signal .tape-seek::-webkit-slider-runnable-track { background: transparent; }
.reel.has-signal .tape-seek::-webkit-slider-thumb { width: 2px; height: 30px; margin-top: -14px; background: #E6F7F7; box-shadow: 0 0 8px rgba(143, 214, 216, 0.9); }
.reel.has-signal .tape-seek::-moz-range-track, .reel.has-signal .tape-seek::-moz-range-progress { background: transparent; }
.reel.has-signal .tape-seek::-moz-range-thumb { width: 2px; height: 30px; background: #E6F7F7; box-shadow: 0 0 8px rgba(143, 214, 216, 0.9); }
.tape-seek:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.tape-time { flex: none; font: 500 11px/1 var(--mono); letter-spacing: 0.14em; color: var(--muted); }
@media (max-width: 560px) {
  .reel.is-audio .reel-screen { aspect-ratio: 1 / 1; }
  .tape-src, .tape-sig { top: 12px; font-size: 9px; letter-spacing: 0.14em; }
  .tape-src { left: 12px; }
  .tape-sig { right: 12px; }
  .tape-bar { gap: 10px; padding: 8px 12px; }
  .tape-time { letter-spacing: 0.06em; }
}

/* ---------- testimony slip: Form T-7 on the same archive stock as Record 727 ---------- */
.slip {
  width: min(660px, calc(100vw - 20px)); max-width: none; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px);
  margin: auto; padding: 14px 10px; border: 0; background: transparent; color: var(--paper-ink);
  overflow-y: auto; overscroll-behavior: contain;
}
.slip::backdrop { background: rgba(3, 6, 8, 0.84); }
.slip[open] { animation: slip-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes slip-in { from { opacity: 0; transform: translateY(40px) rotate(-1.2deg); } to { opacity: 1; transform: none; } }
.slip :focus-visible { outline-color: var(--paper-ink); }
.slip-paper { padding: clamp(32px, 6vw, 48px) clamp(20px, 5.5vw, 46px) clamp(22px, 4vw, 30px); outline: none; }
.slip .card-head { font-size: 12.5px; }
.slip-x {
  min-height: 40px; margin: -10px -8px -10px 0; padding: 0 8px; border: 0; background: none; cursor: pointer;
  font: 13px/1 var(--typed); letter-spacing: 0.16em; color: var(--paper-faded); text-decoration: underline; text-underline-offset: 3px;
}
.slip-x:hover { color: var(--stamp-red); }
.slip h2 { margin-top: 26px; font-size: clamp(30px, 6vw, 42px); }
.slip-lede { margin-top: 14px; font-size: 16px; line-height: 1.65; text-shadow: 0 0 0.6px rgba(42, 36, 30, 0.45); }
.slip-form { position: relative; }
.slip-fields { min-width: 0; margin: 24px 0 0; padding: 0; border: 0; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; letter-spacing: 0.2em; color: var(--paper-faded); }
.field label small { margin-left: 6px; font-size: 11px; letter-spacing: 0.14em; opacity: 0.85; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.slip input:not([type="checkbox"]), .slip select, .slip textarea {
  width: 100%; min-width: 0; margin: 0; padding: 6px 2px; border: 0; border-bottom: 1px solid rgba(42, 36, 30, 0.6); border-radius: 0;
  background-color: transparent; color: var(--paper-ink); font: 17px/1.5 var(--typed);
  -webkit-appearance: none; appearance: none; transition: background-color 0.2s, border-color 0.2s;
}
.slip ::placeholder { color: rgba(103, 92, 79, 0.75); opacity: 1; }
.slip select {
  padding-right: 28px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232A241E' stroke-width='1.6'/%3E%3C/svg%3E") right 6px center / 12px 8px no-repeat;
}
.slip select option { background: #F1E9D6; color: #2A241E; }
.slip textarea {
  min-height: 146px; padding: 1px 2px 0; resize: vertical; border-bottom: 0; line-height: 28px;
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(42, 36, 30, 0.32) 27px 28px);
  background-attachment: local;
}
.slip input:not([type="checkbox"]):focus, .slip select:focus, .slip textarea:focus {
  outline: none; border-bottom-color: var(--stamp-violet); box-shadow: 0 1px 0 var(--stamp-violet); background-color: rgba(79, 68, 121, 0.07);
}
.slip textarea:focus { box-shadow: inset 0 -2px 0 var(--stamp-violet); }
.slip-fields:disabled input, .slip-fields:disabled select, .slip-fields:disabled textarea {
  color: var(--paper-ink); -webkit-text-fill-color: var(--paper-ink); opacity: 1; cursor: default;
}
.slip-fields:disabled ::placeholder { color: transparent; -webkit-text-fill-color: transparent; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 15px; line-height: 1.45; cursor: pointer; }
.check input {
  flex: none; width: 18px; height: 18px; margin: 1px 0 0; border: 1.5px solid var(--paper-ink); border-radius: 0;
  background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.check input:checked {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 2.8L11.6 11.4M11.3 2.4L2.6 11.7' fill='none' stroke='%232A241E' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}
.check input:focus-visible { outline: 2px solid var(--stamp-violet); outline-offset: 2px; }
.slip-foot { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.slip-file {
  min-height: 50px; padding: 0 24px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--paper-ink); color: #F3EBD8; font: 15px/1 var(--typed); letter-spacing: 0.14em; text-transform: uppercase;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 6px 14px rgba(60, 44, 24, 0.18); transition: background 0.2s;
}
.slip-file:hover { background: var(--stamp-red); }
.slip-file[disabled] { opacity: 0.65; cursor: progress; }
.slip-fine { flex: 1 1 200px; font-size: 13px; line-height: 1.5; color: var(--paper-faded); }
.slip .form-error { font: 14px/1.5 var(--typed); letter-spacing: 0.02em; color: var(--stamp-red); }
.filed-stamp {
  position: absolute; left: 50%; top: 44%; z-index: 3; display: none; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 24px 9px; border: 4px double var(--stamp-red); border-radius: 4px; color: var(--stamp-red);
  font: clamp(30px, 8vw, 44px)/1 var(--typed); letter-spacing: 0.2em; text-align: center; white-space: nowrap;
  translate: -50% -50%; rotate: -9deg; mix-blend-mode: multiply; opacity: 0.9; filter: url(#stampink); pointer-events: none;
}
.filed-stamp small { font-size: 13px; letter-spacing: 0.26em; }
.slip.is-filed .filed-stamp { display: flex; }
.slip.is-filed .slip-foot, .slip.is-filed .form-error { display: none; }
.slip-filed {
  margin-top: 22px; padding: 16px 18px 14px; outline: none; rotate: -0.4deg;
  border: 1px solid rgba(42, 36, 30, 0.55); background: rgba(252, 248, 236, 0.6); box-shadow: 0 2px 6px rgba(60, 44, 24, 0.14);
}
.filed-id { font-size: 14px; letter-spacing: 0.16em; color: var(--paper-faded); }
.filed-id b { font-weight: 400; letter-spacing: 0.12em; color: var(--paper-ink); }
.slip-filed > p + p { margin-top: 6px; font-size: 17px; }
.slip-actions { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.slip-again {
  min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: 15px/1 var(--typed); letter-spacing: 0.08em; color: var(--paper-ink); text-decoration: underline; text-underline-offset: 3px;
}
.slip-again:hover { color: var(--stamp-red); }
.slip-alt { margin-top: 22px; font-size: 13px; color: var(--paper-faded); }
.slip-alt a { color: var(--paper-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .slip.is-filed .filed-stamp { animation: stamp 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
  .slip.is-filed .slip-paper { animation: thump 0.34s ease-out 0.12s; }
}
@keyframes thump { 0%, 100% { translate: none; } 35% { translate: 0 4px; } 65% { translate: 0 -1px; } }
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .slip-foot .slip-file { flex: 1 1 100%; }
  .slip .card-head { flex-wrap: nowrap; font-size: 11.5px; letter-spacing: 0.06em; }
  .slip .card-head > span { min-width: 0; }
}
/* Without JavaScript, #testimony links show the slip in place at the end of the page. */
html:not(.js) .slip:target {
  display: block; position: relative; inset: auto; max-height: none; margin: 0 auto; padding: 48px 10px; overflow: visible; outline: none;
}
html:not(.js) .slip-x { display: none; }

/* ---------- the power-on screen (only with <html data-gate>) ---------- */
.gate { display: none; }
html.js[data-gate]:not(.gate-done) { overflow: hidden; }
html.js[data-gate]:not(.gate-done) .gate {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(ellipse 60% 52% at 50% 44%, #0B1C21 0%, #04090B 56%, #010203 100%);
}
.gate::before {
  content: ""; position: absolute; inset: -50%; pointer-events: none;
  background: url(img/grain.png); opacity: 0.34; animation: static 0.5s steps(4) infinite;
}
.gate::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(1, 2, 3, 0.34) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.7) 100%);
}
.gate .hud-c { z-index: 2; }
.gate-corner { position: absolute; z-index: 2; margin: 0; font: 500 10.5px/1 var(--mono); letter-spacing: 0.22em; color: var(--muted); }
.gate-corner span { color: var(--text-2); }
.gate-tl { top: 24px; left: 48px; display: flex; align-items: center; gap: 9px; }
.gate-tl i { width: 7px; height: 7px; border-radius: 50%; background: #E5483A; box-shadow: 0 0 8px rgba(229, 72, 58, 0.85); animation: blink-step 1.2s steps(1) infinite; }
.gate-tr { top: 24px; right: 48px; color: var(--accent); }
.gate-bl { bottom: 24px; left: 48px; }
.gate-br { bottom: 24px; right: 48px; }
.gate-panel { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; padding: 24px; text-align: center; }
/* The eye is drawn as light on the screen: white-hot lines with a glow (the #phosphor filter), scanlines,
   a slow refresh band, flicker, and an afterimage when the iris moves (site.js). */
.gate-eye { position: relative; width: min(300px, 58vw); color: #86D4D9; animation: gate-breathe 5s ease-in-out infinite, gate-flicker 4.7s steps(1, end) infinite; }
.gate-eye svg { display: block; width: 100%; height: auto; }
.gate-eye .iris, .gate-eye .iris-ghost { color: #CFEFFB; --eye-pupil: #74BFDC; --eye-pupil-a: 0.7; }
.gate-eye::before, .gate-eye::after {
  content: ""; position: absolute; inset: -18% -12%; z-index: 1; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent); mask-image: radial-gradient(closest-side, #000 55%, transparent);
}
.gate-eye::after { background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(2, 6, 8, 0.28) 2px 3px); mix-blend-mode: multiply; }
.gate-eye::before {
  background: linear-gradient(180deg, transparent 40%, rgba(170, 238, 242, 0.08) 47%, rgba(200, 246, 250, 0.14) 50%, rgba(170, 238, 242, 0.08) 53%, transparent 60%) 0 0 / 100% 300% no-repeat;
  mix-blend-mode: screen; animation: gate-roll 6.5s linear infinite;
}
@keyframes gate-breathe { 50% { filter: brightness(1.14); } }
@keyframes gate-flicker { 0%, 100% { opacity: 1; } 11% { opacity: 0.86; } 12% { opacity: 1; } 47% { opacity: 0.94; } 48% { opacity: 1; } 49% { opacity: 0.88; } 50% { opacity: 1; } 83% { opacity: 0.95; } 84% { opacity: 1; } }
@keyframes gate-roll { from { background-position: 0 100%; } to { background-position: 0 0; } }
.gate-title { margin: 36px 0 0; font: 800 clamp(30px, 4.4vw, 54px)/1.04 var(--font); font-stretch: 112%; text-transform: uppercase; color: var(--text); }
.gate-title span { display: block; }
.gate-title span + span { color: #8C9EA4; }
.gate-on {
  display: inline-flex; align-items: center; gap: 14px; min-height: 54px; margin-top: 36px; padding: 0 30px 0 24px; cursor: pointer;
  color: var(--bg); background: var(--accent); border: 0; border-radius: 0;
  font: 600 13px/1 var(--mono); letter-spacing: 0.32em; text-transform: uppercase;
  box-shadow: 0 0 0 5px rgba(143, 214, 216, 0.12), 0 0 40px rgba(143, 214, 216, 0.35); transition: background 0.2s, box-shadow 0.2s;
}
.gate-on:hover, .gate-on:focus-visible { background: #E6F7F7; box-shadow: 0 0 0 7px rgba(143, 214, 216, 0.16), 0 0 56px rgba(143, 214, 216, 0.55); }
.gate-on:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.gate-power { position: relative; flex: none; width: 15px; height: 15px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; }
.gate-power::before { content: ""; position: absolute; left: 50%; top: -6px; width: 2px; height: 9px; margin-left: -1px; background: currentColor; }
.gate-note { margin: 16px 0 0; font: 500 10.5px/1.4 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.gate-quiet {
  margin-top: 6px; padding: 8px; background: none; border: 0; cursor: pointer; color: var(--dim);
  font: 500 10.5px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px;
}
.gate-quiet:hover, .gate-quiet:focus-visible { color: var(--text-2); }
/* Switching on: the picture draws in to a bright line, flashes open, and the archive takes over. */
.gate-flash { position: absolute; left: 0; right: 0; top: 50%; z-index: 3; height: 2px; margin-top: -1px; background: #EAF8F8; box-shadow: 0 0 34px 6px rgba(143, 214, 216, 0.9); opacity: 0; pointer-events: none; }
.gate.is-on .gate-panel, .gate.is-on .gate-corner, .gate.is-on .hud-c { opacity: 0; transition: opacity 0.12s; }
.gate.is-on .gate-flash { animation: gate-line 0.75s cubic-bezier(0.2, 0.75, 0.25, 1) forwards; }
.gate.is-on { animation: gate-out 0.5s ease-in 0.36s forwards; }
@keyframes gate-line {
  0% { opacity: 1; transform: scaleX(0.002); }
  32% { opacity: 1; transform: scaleX(1); }
  56% { opacity: 1; transform: scaleX(1) scaleY(150); }
  100% { opacity: 0; transform: scaleX(1) scaleY(440); }
}
@keyframes gate-out { to { opacity: 0; } }
@media (max-width: 700px) {
  .gate-corner { font-size: 9px; letter-spacing: 0.14em; }
  .gate-tl, .gate-bl { left: 22px; }
  .gate-tr, .gate-br { right: 22px; }
  .gate-tl, .gate-tr { top: 18px; }
  .gate-bl, .gate-br { bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .gate::before, .gate-eye, .gate-eye::before, .gate-tl i { animation: none; }
  .gate-eye::before { display: none; }
}

/* =====================================================================
   Japanese and Korean pages (avasiris.com/ja/ and /ko/, built by tools/build-langs.mjs)
   Archivo and IBM Plex Mono still set the Latin letters and digits; each page loads its own
   Japanese or Korean faces: a sans for text, a mincho/myeongjo for the typed case file and the
   form, and a handwriting face for the pencil notes.
   ===================================================================== */
:root:lang(ja) {
  --font: Archivo, "IBM Plex Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", ui-monospace, monospace;
}
:root:lang(ko) {
  --font: Archivo, "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", ui-monospace, monospace;
}
.card:lang(ja) {
  --typed: "Special Elite", "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --hand: "Reenie Beanie", Yomogi, cursive;
}
.card:lang(ko) {
  --typed: "Special Elite", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  --hand: "Reenie Beanie", "Nanum Pen Script", cursive;
}
/* Line breaks: Japanese wraps between phrases where the browser can (Chrome, Edge), Korean between words. */
:root:lang(ja) body { word-break: auto-phrase; line-break: strict; }
:root:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
/* Japanese and Korean glyphs fill the whole square, so stacked lines need more air than Latin capitals. */
:lang(ja) .display, :lang(ko) .display { line-height: 1.24; letter-spacing: 0.02em; }
:lang(ja) .hero h1, :lang(ko) .hero h1 { font-size: clamp(34px, 3.9vw, 58px); line-height: 1.3; letter-spacing: 0.01em; }
:lang(ja) body, :lang(ko) body { line-height: 1.8; }
:lang(ja) .card-text, :lang(ko) .card-text { line-height: 1.95; }
:lang(ja) .bb-hook, :lang(ko) .bb-hook { line-height: 1.4; letter-spacing: 0.01em; }
:lang(ja) .bb-text, :lang(ko) .bb-text { line-height: 1.75; }
:lang(ja) .bb-label, :lang(ko) .bb-label { letter-spacing: 0.12em; }
:lang(ja) .bb-stamp span, :lang(ko) .bb-stamp span { padding-right: calc(3.8cqi - 0.12em); letter-spacing: 0.12em; }
:lang(ko) .bb-stamp span { word-spacing: -0.2em; }
/* Korean words are set apart by spaces, and the typewriter face's space is half as wide again as Korean needs. */
:lang(ko) .bb-text { word-spacing: -0.28em; }
@media (hover: hover) { :lang(ja) .book-flip span, :lang(ko) .book-flip span { letter-spacing: 0.08em; font-size: 11px; } }
