/* ==========================================================================
   Report Missing Time — site.css
   A small, responsive section framework + the two signature animations.

   1. Tokens            5. Form
   2. Base              6. Paper / dossier section
   3. Layout framework  7. Buttons, video, books, quotes, FAQ
   4. Intake + typing   8. Footer, dock, motion
   ========================================================================== */

/* 1. TOKENS --------------------------------------------------------------- */
:root {
  /* terminal (dark) */
  --term-bg: #0a0c0b;
  --term-bg-2: #111513;
  --term-line: #24302a;
  --phosphor: #8dffc4;
  --phosphor-dim: #5fae86;
  --term-text: #c9d6cf;

  /* dossier (paper) */
  --paper: #eee7d8;
  --paper-2: #e4dbc8;
  --paper-ink: #1c1a16;
  --paper-mute: #5c574c;
  --paper-line: #c9bfa9;
  --redact: #121110;
  --stamp: #b3261e;
  --signal: #e8531a;
  --signal-ink: #fff6ef;

  /* type */
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  /* fluid scale */
  --step--1: clamp(.82rem, .79rem + .15vw, .9rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + .5vw, 1.45rem);
  --step-2: clamp(1.45rem, 1.25rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.5rem + 2.4vw, 3.4rem);
  --step-4: clamp(2.8rem, 1.8rem + 5vw, 6rem);

  /* spacing */
  --gutter: clamp(16px, 4vw, 40px);
  --space-section: clamp(56px, 9vw, 120px);
  --radius: 4px;
}

/* 2. BASE ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--term-bg);
  color: var(--term-text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.1; margin: 0; }
p { margin: 0; }
small { font-size: .82em; opacity: .75; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; white-space: nowrap !important; padding: 0 !important; margin: 0 !important; border: 0 !important;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--phosphor); color: #000; padding: 8px 12px; }
.skip-link:focus { left: 8px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* 3. LAYOUT FRAMEWORK ----------------------------------------------------- */
.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 760px; }
.container--wide { max-width: 1360px; }

.section { position: relative; padding-block: var(--space-section); }
.section--dark  { background: var(--term-bg); color: var(--term-text); }
.section--paper { background: var(--paper); color: var(--paper-ink); }
.section--ink   { background: var(--redact); color: #e9e3d6; }

.stack > * + * { margin-top: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cluster--tight { gap: 8px; }
.cluster--center { justify-content: center; }

/* .grid auto-fits; modifiers cap the column count. Everything stacks on phones. */
.grid { display: grid; gap: clamp(16px, 3vw, 32px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.grid--3 { grid-template-columns: 1fr; }
.grid--split { grid-template-columns: 1fr; align-items: center; }
.grid--books { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--books { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid--split { grid-template-columns: 1.05fr 1fr; }
}
@media (min-width: 1080px) {
  .grid--books { grid-template-columns: repeat(4, 1fr); }
}

/* 4. TOPBAR + INTAKE + TYPING -------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 12, 11, .86);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--term-line);
  font-family: var(--font-mono); font-size: var(--step--1);
}
.topbar__inner { display: flex; justify-content: space-between; align-items: center; min-height: 48px; gap: 12px; }
.topbar__id { color: var(--phosphor-dim); letter-spacing: .08em; text-transform: uppercase; }
.topbar__link { color: var(--phosphor); text-decoration: none; white-space: nowrap; }
.topbar__link:hover { text-decoration: underline; }

.section--intake {
  min-height: min(78svh, 720px);
  display: flex; align-items: center;
  padding-block: clamp(48px, 10vw, 120px) clamp(24px, 4vw, 48px);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(141, 255, 196, .07), transparent 60%),
    var(--term-bg);
  overflow: hidden;
}
.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
.terminal-meta {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  font-family: var(--font-mono); font-size: var(--step--1);
  color: var(--phosphor-dim); letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: clamp(20px, 4vw, 36px);
}
.terminal-meta__live { display: inline-flex; align-items: center; gap: 6px; color: var(--phosphor); }
.terminal-meta__live i { width: 8px; height: 8px; border-radius: 50%; background: var(--phosphor); animation: pulse 1.6s ease-in-out infinite; }

.typer {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, .9rem + 1.9vw, 2.15rem);
  line-height: 1.35;
  color: var(--phosphor);
  text-shadow: 0 0 12px rgba(141, 255, 196, .35);
  min-height: 5.6em;            /* reserve space so the page doesn't jump */
}
.typer__line { margin: 0 0 .35em; white-space: pre-wrap; word-break: break-word; }
.typer__line--done { color: var(--phosphor-dim); text-shadow: none; }
.typer__line--final { color: var(--phosphor); font-weight: 600; }
.typer__cursor {
  display: inline-block; width: .6em; height: 1.05em; margin-left: 2px;
  background: var(--phosphor); vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}
.intake-lede { margin-top: 20px; color: var(--term-text); font-size: var(--step-1); max-width: 34ch; }

/* 5. FORM ----------------------------------------------------------------- */
.section--form { padding-top: 0; }
.disclosure {
  border: 1px dashed var(--term-line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 28px;
  font-size: var(--step--1); color: #a9b8b0; background: var(--term-bg-2);
}
.disclosure a { color: var(--phosphor); }

.form { display: grid; gap: 28px; }
.form__group { border: 0; margin: 0; padding: 0; display: grid; gap: 16px; min-width: 0; }
.form__group legend {
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: .14em; text-transform: uppercase;
  color: var(--phosphor); padding: 0 0 10px; margin-bottom: 4px; width: 100%;
  border-bottom: 1px solid var(--term-line);
}
.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: var(--step--1); color: #a9b8b0; }
.field__count { justify-self: end; font-family: var(--font-mono); font-size: .75rem; color: var(--phosphor-dim); }

.form input[type="text"], .form input[type="email"], .form input[type="date"], .form select, .form textarea {
  width: 100%; font: inherit; font-family: var(--font-mono); font-size: 16px; /* 16px stops iOS zoom */
  color: var(--phosphor); background: var(--term-bg-2);
  border: 1px solid var(--term-line); border-radius: var(--radius);
  padding: 12px 14px; min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
  color-scheme: dark;
}
.form textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
.form input::placeholder, .form textarea::placeholder { color: #4d5d55; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--phosphor); box-shadow: 0 0 0 3px rgba(141, 255, 196, .15);
}
.form [aria-invalid="true"] { border-color: #ff7a6b !important; }

.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px; }
.check, .pill { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input, .pill input { accent-color: var(--phosphor); width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.check:not(.check--block) {
  padding: 10px 12px; border: 1px solid var(--term-line); border-radius: var(--radius);
  background: var(--term-bg-2); align-items: center;
}
.check:not(.check--block):has(input:checked) { border-color: var(--phosphor); }
.check--block { font-size: var(--step--1); color: #b8c6be; }
.pill { padding: 8px 14px; border: 1px solid var(--term-line); border-radius: 999px; align-items: center; }
.pill:has(input:checked) { border-color: var(--phosphor); color: var(--phosphor); }
.pill input { margin: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__error { color: #ff9b8f; font-family: var(--font-mono); font-size: var(--step--1); }

.filed { text-align: left; border: 1px solid var(--phosphor); border-radius: var(--radius); padding: clamp(20px, 5vw, 40px); display: grid; gap: 14px; background: var(--term-bg-2); }
.filed__stamp { font-family: var(--font-mono); color: var(--phosphor); letter-spacing: .2em; font-weight: 600; }
.filed__case { font-family: var(--font-mono); font-size: var(--step-2); color: #fff; }

/* 6. TRANSITION + DOSSIER -------------------------------------------------- */
/* The signal: a beam sweeps across while the terminal fades into paper. */
.signal {
  position: relative; height: clamp(90px, 14vw, 160px); overflow: hidden;
  background: linear-gradient(to bottom, var(--term-bg) 0%, #2a2a25 45%, var(--paper) 100%);
}
.signal__beam {
  position: absolute; top: 0; bottom: 0; width: 40%; left: -40%;
  background: linear-gradient(90deg, transparent, rgba(232, 83, 26, .0) 10%, rgba(232, 83, 26, .55) 50%, rgba(255, 220, 190, .9) 52%, rgba(232, 83, 26, .0) 90%, transparent);
  filter: blur(6px);
  animation: sweep 5.5s cubic-bezier(.6, 0, .4, 1) infinite;
}

.section--paper {
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.35), transparent 40%),
    var(--paper);
}
.section--paper .container { position: relative; }

.dossier-head { position: relative; text-align: center; margin-bottom: clamp(32px, 6vw, 64px); }
.kicker { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: .25em; text-transform: uppercase; color: var(--paper-mute); }
.kicker--light { color: #a59f92; }
.dossier-title {
  font-family: var(--font-sans); font-weight: 700; text-transform: uppercase;
  font-size: var(--step-4); letter-spacing: -.01em; line-height: .95;
  margin: 10px 0 12px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .25em;
}
.dossier-sub { font-family: var(--font-serif); font-style: italic; font-size: var(--step-2); color: var(--paper-mute); }

/* Redaction reveal: black bars slide off each word, one after another */
.redact { position: relative; display: inline-block; }
.redact::after {
  content: ""; position: absolute; inset: .08em -.06em; background: var(--redact);
  transform-origin: right center; transform: scaleX(1);
  transition: transform .7s cubic-bezier(.7, 0, .2, 1);
}
.redact:nth-child(2)::after { transition-delay: .35s; }
.redact:nth-child(3)::after { transition-delay: .7s; }
.is-in .redact::after { transform: scaleX(0); }

.stamp {
  position: absolute; top: -8px; right: clamp(0px, 4vw, 40px);
  font-family: var(--font-mono); font-weight: 600; text-transform: uppercase; letter-spacing: .18em;
  font-size: clamp(.7rem, .6rem + .4vw, .95rem);
  color: var(--stamp); border: 2px solid var(--stamp); padding: 4px 10px; border-radius: 3px;
  transform: rotate(8deg) scale(2.2); opacity: 0;
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1) 1.3s, opacity .2s 1.3s;
}
.is-in .stamp { transform: rotate(8deg) scale(1); opacity: .9; }
@media (max-width: 520px) { .stamp { position: static; display: inline-block; margin-bottom: 12px; } }

.lead { font-family: var(--font-serif); font-size: var(--step-2); line-height: 1.25; }
.lead strong { font-weight: 400; font-style: italic; color: var(--stamp); }
.section-label {
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: .22em; text-transform: uppercase;
  color: var(--paper-mute); border-top: 1px solid var(--paper-line); padding-top: 14px;
  margin: clamp(48px, 7vw, 80px) 0 24px;
}
.grid--split .section-label { margin-top: 0; }
.grid--top { align-items: start; }
.text-link { color: var(--paper-ink); font-weight: 600; text-underline-offset: 4px; }

/* 7. BUTTONS -------------------------------------------------------------- */
.btn {
  --h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 22px; border-radius: var(--radius);
  font-family: var(--font-sans); font-weight: 700; font-size: var(--step-0); letter-spacing: .02em;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform .15s, background .2s, color .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn--sm { --h: 42px; padding: 0 14px; font-size: var(--step--1); }
.btn--primary { background: var(--paper-ink); color: var(--paper); }
.btn--primary:hover { background: var(--stamp); }
.btn--ghost, .btn--line { border-color: var(--paper-ink); color: var(--paper-ink); background: transparent; }
.btn--ghost:hover, .btn--line:hover { background: var(--paper-ink); color: var(--paper); }
.btn--signal { background: var(--signal); color: var(--signal-ink); }
.btn--signal:hover { background: #ff6a2e; box-shadow: 0 0 0 4px rgba(232, 83, 26, .25); }
.btn--terminal {
  width: 100%; background: transparent; color: var(--phosphor); border-color: var(--phosphor);
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .18em; min-height: 56px;
}
.btn--terminal:hover { background: var(--phosphor); color: var(--term-bg); box-shadow: 0 0 24px rgba(141, 255, 196, .35); }
.btn--terminal[disabled] { opacity: .6; cursor: progress; }
.filed .btn--terminal { width: auto; letter-spacing: .08em; padding: 0 18px; }

/* VIDEO */
.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.video iframe, .video__facade { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__facade { padding: 0; cursor: pointer; background: #000; }
.video__facade img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .3s, transform .6s; }
.video__facade:hover img { opacity: 1; transform: scale(1.02); }
.video__play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 rgba(232, 83, 26, .6);
  animation: ring 2.2s ease-out infinite;
}
.video__play::after { content: ""; position: absolute; left: 31px; top: 24px; border-left: 22px solid #fff; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.video__label { position: absolute; left: 14px; bottom: 12px; color: #fff; font-family: var(--font-mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }

/* BOOKS */
.book { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: start; }
@media (min-width: 640px) { .book { grid-template-columns: 1fr; } }
.book__cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; box-shadow: 0 18px 30px -16px rgba(0,0,0,.55); background: var(--paper-2); }
.book__cover--sealed { display: grid; place-items: center; background: repeating-linear-gradient(135deg, #1a1916 0 10px, #23211d 10px 20px); color: var(--stamp); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .15em; font-size: .75rem; }
.book__cover--sealed span { border: 2px solid var(--stamp); padding: 4px 8px; transform: rotate(-8deg); }
.book__body { display: grid; gap: 8px; }
.book__num { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--paper-mute); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { background: var(--stamp); color: #fff; padding: 1px 7px; border-radius: 2px; letter-spacing: .08em; }
.book__title { font-family: var(--font-serif); font-weight: 400; font-size: var(--step-2); }
.book__blurb { font-size: var(--step--1); color: var(--paper-mute); }
.book__buy { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.bar { color: var(--redact); letter-spacing: -.1em; }

/* QUOTES */
.quote { margin: 0; padding: 22px; background: var(--paper-2); border-left: 3px solid var(--paper-ink); }
.quote blockquote { margin: 0 0 12px; font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.3; }
.quote figcaption { font-family: var(--font-mono); font-size: .78rem; color: var(--paper-mute); }
.quotes + .center { margin-top: 24px; }

/* INK BAND */
.band-title { font-family: var(--font-serif); font-weight: 400; font-size: var(--step-3); line-height: 1.05; }
.section--ink p { color: #b9b2a3; }

/* FAQ */
.faq { border-bottom: 1px solid var(--paper-line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-family: var(--font-mono); }
.faq[open] summary::after { content: "\2013"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin-top: 10px; color: var(--paper-mute); font-size: var(--step--1); }

/* 8. FOOTER + DOCK + MOTION ---------------------------------------------- */
.footer { background: var(--redact); color: #a59f92; padding-block: 48px calc(48px + env(safe-area-inset-bottom)); font-size: var(--step--1); }
.footer strong { color: #e9e3d6; }
.footer a { color: #e9e3d6; }
.footer__fine { opacity: .6; }

.dock {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 8px;
  background: rgba(18, 17, 16, .94); color: #f1ebdf;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  transform: translateY(150%); transition: transform .35s cubic-bezier(.2, .9, .3, 1);
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
}
.dock.is-shown { transform: translateY(0); }
@media (min-width: 900px) { .dock { left: auto; right: 24px; bottom: 24px; width: auto; } }

/* Scroll reveals */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
[data-reveal].is-in { opacity: 1; transform: none; }
/* "develop": like a photo coming up in the tray */
[data-reveal="develop"] { transform: none; filter: blur(8px) sepia(1) contrast(.6) brightness(1.3); transition: opacity 1.1s ease, filter 1.6s ease; }
[data-reveal="develop"].is-in { filter: none; }
.grid--books > :nth-child(2) { transition-delay: .15s; }
.grid--books > :nth-child(3) { transition-delay: .3s; }
.grid--books > :nth-child(4) { transition-delay: .45s; }
[data-reveal="declassify"] { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; filter: none; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes sweep { 0% { left: -40%; } 60%, 100% { left: 110%; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(232, 83, 26, .6); } 100% { box-shadow: 0 0 0 26px rgba(232, 83, 26, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .redact::after { transform: scaleX(0); }
  .stamp { opacity: .9; transform: rotate(8deg); }
  .signal__beam { display: none; }
}
