/* Chainsaw Industries / Prophet Archive System
   Static-first. Display font is locally hosted Droid Sans (Apache 2.0). */

@font-face {
  font-family: "Droid Sans";
  src: url("/assets/fonts/DroidSans.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Droid Sans";
  src: url("/assets/fonts/DroidSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --iron-0: #070706;
  --iron-1: #0d0d0b;
  --iron-2: #151410;
  --iron-3: #24221d;
  --bone: #e1d8c4;
  --bone-dim: #a79f8e;
  --paper: #cfc5ae;
  --amber: #d58a42;
  --amber-hot: #ffb45b;
  --rust: #8f4229;
  --red: #bd4638;
  --copper: #67a18f;
  --rule: rgba(225, 216, 196, .2);
  --rule-strong: rgba(225, 216, 196, .48);
  --font-display: "Droid Sans", "Noto Sans", Verdana, sans-serif;
  --font-sans: "Droid Sans", "Bahnschrift", "Aptos", "Segoe UI", sans-serif;
  --ext: var(--copper);
  --ext-hot: #8cc7b2;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --container: min(1240px, calc(100vw - 48px));
  --reader-scale: 1;
  color-scheme: dark;
}

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

html {
  background: var(--iron-0);
  scroll-behavior: smooth;
  scrollbar-color: var(--amber) var(--iron-1);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--bone);
  background:
    linear-gradient(90deg, transparent 0 49.9%, rgba(225,216,196,.025) 50%, transparent 50.1%),
    radial-gradient(circle at 82% 8%, rgba(143,66,41,.12), transparent 34rem),
    var(--iron-0);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 15px;
  width: 1px;
  content: "";
  pointer-events: none;
  background: linear-gradient(transparent, var(--amber) 18%, var(--rule) 55%, transparent);
  opacity: .5;
}

::selection { color: var(--iron-0); background: var(--amber-hot); }

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

a { color: inherit; cursor: pointer; text-underline-offset: .22em; }
a:hover { color: var(--amber-hot); }

button, input, textarea, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--amber-hot);
  outline-offset: 4px;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 3.6vw, 3.6rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 1.5vw, 1.4rem); }

.container { width: var(--container); margin-inline: auto; }
.container--narrow { max-width: 880px; }
.container--reader { width: min(760px, calc(100vw - 40px)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.eyebrow, .record-label {
  margin-bottom: 1rem;
  color: var(--amber);
  font: 700 .72rem/1.2 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  border: 1px solid currentColor;
  border-radius: 0;
  font: 700 .75rem/1 var(--font-mono);
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.button--primary { color: var(--iron-0); border-color: var(--bone); background: var(--bone); }
.button--primary:hover { color: var(--iron-0); border-color: var(--amber-hot); background: var(--amber-hot); }
.button--secondary { color: var(--bone); background: transparent; }
.button--secondary:hover { color: var(--iron-0); border-color: var(--bone); background: var(--bone); }
.button--light { color: var(--iron-0); border-color: var(--iron-0); }
.text-link, .record-link { font: 700 .76rem/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

/* Header */
.site-header {
  position: relative;
  z-index: 15;
  border-bottom: 1px solid var(--rule-strong);
  background: rgba(7,7,6,.94);
}

.site-header__inner {
  display: flex;
  min-height: 86px;
  align-items: stretch;
  justify-content: space-between;
}

.brand {
  display: flex;
  min-width: 260px;
  align-items: center;
  gap: .85rem;
  padding-right: 1.4rem;
  border-right: 1px solid var(--rule);
  text-decoration: none;
}

.brand__logo { width: 46px; height: 46px; object-fit: contain; }
.brand__name { font: 700 1rem/1.1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
.brand__tagline { max-width: 150px; color: var(--bone-dim); font: 500 .6rem/1.35 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

.site-nav { display: flex; align-items: stretch; }
.site-nav__list {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: stretch;
  list-style: none;
}
.site-nav__list > li { display: flex; align-items: stretch; }
.site-nav a:not(.button) {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 .72rem;
  color: var(--bone-dim);
  font: 650 .65rem/1 var(--font-mono);
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a.is-current, .site-nav a:hover { color: var(--bone); }
.site-nav a.is-current::after {
  position: absolute;
  right: .72rem;
  bottom: 0;
  left: .72rem;
  height: 3px;
  content: "";
  background: var(--amber);
}

.nav-toggle {
  display: none;
  width: 54px;
  padding: 0;
  border: 0;
  color: var(--bone);
  background: transparent;
}
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
  display: block;
  width: 24px;
  height: 1px;
  margin: auto;
  content: "";
  background: currentColor;
}
.nav-toggle__bar::before { transform: translateY(-7px); }
.nav-toggle__bar::after { transform: translateY(6px); }

/* Terminal hero */
.terminal-hero { position: relative; border-bottom: 1px solid var(--rule-strong); }
.terminal-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.48), transparent 75%);
  opacity: .22;
}
.terminal-hero__topline {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid var(--rule);
  color: var(--bone-dim);
  font: 600 .63rem/1 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.terminal-hero__topline span { padding: .8rem max(20px, calc((100vw - min(1240px, calc(100vw - 48px))) / 2)); }
.terminal-hero__topline span:nth-child(2) { text-align: center; border-inline: 1px solid var(--rule); }
.terminal-hero__system { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; }
.terminal-hero__uid { color: var(--bone-dim); font: 500 .56rem/1 var(--font-mono); letter-spacing: .18em; opacity: .8; }
.terminal-hero__system img { width: 74px; height: 18px; object-fit: contain; }
.terminal-hero__system b { font: inherit; }
.terminal-hero__topline span:last-child { text-align: right; }
.terminal-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: min(608px, calc(100vh - 120px));
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
}
/* Front page hero sits ~150px shorter than the rest: trim the copy column's
   vertical padding (~75px per side) and lower the min-height floor so it can't
   push the hero back up. */
body[data-page="index"] .terminal-hero__grid { min-height: min(458px, calc(100vh - 120px)); }
body[data-page="index"] .terminal-hero__copy { padding-block: clamp(1rem, 2vw, 1.6rem); }
.terminal-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3.5rem, 7vw, 7rem) clamp(28px, 4vw, 58px) clamp(3.5rem, 7vw, 7rem) max(24px, calc((100vw - min(1240px, calc(100vw - 48px))) / 2));
  border-right: 1px solid var(--rule-strong);
}
.terminal-hero__session {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.6rem;
  margin-bottom: clamp(2.5rem, 5vw, 5.5rem);
  color: var(--bone-dim);
  font: 600 .65rem/1.3 var(--font-mono);
  letter-spacing: .05em;
}
.terminal-hero__session strong { color: var(--bone); }
.terminal-hero__status { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: 1.4rem; color: var(--bone-dim); font: 650 .64rem/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.terminal-hero__status strong { color: var(--amber-hot); }
.terminal-hero h1 { width: min(100%, 980px); max-width: 30ch; margin-bottom: 1.7rem; font-size: clamp(1.85rem, 2.9vw, 3.1rem); text-wrap: balance; }
.terminal-hero__lead { max-width: 640px; color: var(--paper); font-size: clamp(1.05rem, 1.6vw, 1.35rem); }
.terminal-hero__lead p:last-child { margin-bottom: 0; }
.terminal-hero__actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 2.2rem; }

.sensor-frame {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: #000;
  isolation: isolate;
  transform: perspective(1200px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transform-style: preserve-3d;
  transition: transform .24s ease-out;
}
/* Hero frames never dictate layout height: the figure stretches to exactly the
   row height the copy defines, and the image cover-fills it. No caps, no gaps. */
.terminal-hero .sensor-frame { min-height: 416px; }
.terminal-hero .sensor-frame img { position: absolute; inset: 0; }
.sensor-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: saturate(.9) contrast(1.03) sepia(.05); transform: scale(1.025) translate3d(var(--shift-x, 0), var(--shift-y, 0), 0); transition: transform .24s ease-out; }
/* Pale-Iron's full-length portrait: anchor the hero crop to the top so the face stays in frame. */
body[data-page="characters/pale-iron"] .terminal-hero .sensor-frame img { object-position: 50% 0; }
.sensor-frame::before, .sensor-frame::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  pointer-events: none;
}
.sensor-frame::before {
  background:
    linear-gradient(90deg, rgba(0,0,0,.72), transparent 12%, transparent 88%, rgba(0,0,0,.65)),
    repeating-linear-gradient(0deg, rgba(225,216,196,.035) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 48%, transparent 20%, rgba(0,0,0,.4) 100%);
  mix-blend-mode: screen;
  opacity: .48;
}
.sensor-frame::after {
  inset: 18px;
  border: 1px solid rgba(225,216,196,.38);
  background:
    linear-gradient(var(--amber),var(--amber)) 0 0/38px 1px no-repeat,
    linear-gradient(var(--amber),var(--amber)) 0 0/1px 38px no-repeat,
    linear-gradient(var(--amber),var(--amber)) 100% 100%/38px 1px no-repeat,
    linear-gradient(var(--amber),var(--amber)) 100% 100%/1px 38px no-repeat;
}
.sensor-frame figcaption {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .75rem;
  color: var(--bone);
  background: rgba(7,7,6,.82);
  font: 600 .62rem/1.2 var(--font-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* Diode wake: a dormant chassis whose sensor diodes snap on after a while. The
   "live" image is stacked over the dark one (absolute, in any frame type) and
   revealed by JS toggling .is-awake on the [data-diode-wake] container. */
.wake-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}
/* No flicker: the lit image simply flips on once the delay elapses. */
[data-diode-wake].is-awake .wake-layer { opacity: 1; }
/* Sensor-frame alarm cue: brackets and caption flush hot when it wakes. */
.sensor-frame[data-diode-wake].is-awake::after { border-color: rgba(214,74,58,.9); }
.sensor-frame[data-diode-wake].is-awake figcaption { color: var(--amber-hot); }
.sensor-frame--compact { aspect-ratio: 1.34; margin-bottom: 1.1rem; border-bottom: 1px solid var(--rule); }
/* Cinematic chapter hero: full-bleed concept frame with the title overlaid. */
.fragment-hero {
  position: relative;
  display: flex;
  max-width: 65vw;
  min-height: min(67vh, 656px);
  margin-inline: auto;
  overflow: hidden;
  background: #000;
  isolation: isolate;
}
.fragment-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; }
.fragment-hero--top img { object-position: 50% 0; }
.fragment-hero--bottom img { object-position: 50% 100%; }
.fragment-hero::after { display: none; }
.fragment-hero__scrim {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(7,7,6,.97) 4%, rgba(7,7,6,.55) 30%, rgba(7,7,6,.05) 60%, transparent 78%),
    linear-gradient(to bottom, rgba(7,7,6,.72), transparent 26%);
}
.fragment-hero__codes {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 1.5rem;
  padding: 1rem clamp(20px, 3vw, 42px);
  border-bottom: 1px solid var(--rule);
  color: var(--bone-dim);
  font: 600 .62rem/1.3 var(--font-mono);
  letter-spacing: .06em;
}
.fragment-hero__title {
  position: relative;
  z-index: 4;
  align-self: flex-end;
  width: 100%;
  padding-block: clamp(2rem, 5vw, 4.5rem);
}
.fragment-hero__title .eyebrow { margin-bottom: 1.1rem; }
.fragment-hero__title h1 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: 1.02;
  text-shadow: 0 2px 40px rgba(7,7,6,.85);
  text-wrap: balance;
}
.fragment-reader > .fragment-reader__header--cinematic { padding: 0; background: none; }
.fragment-reader__header--cinematic > .container { padding-top: clamp(2.5rem, 6vw, 5rem); }
.sensor-frame--compact::after { inset: 10px; }
.sensor-frame--compact figcaption { right: 10px; bottom: 10px; left: 10px; }

.telemetry {
  position: relative;
  z-index: 3;
  display: grid;
  margin: 0;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule-strong);
}
.telemetry__item { min-width: 0; padding: 1rem clamp(1rem, 2vw, 2rem); border-right: 1px solid var(--rule); }
.telemetry__item:last-child { border-right: 0; }
.telemetry dt { display: flex; align-items: center; gap: .45em; color: var(--bone-dim); font: 600 .6rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.telemetry dd { margin: .35rem 0 0; overflow-wrap: anywhere; font: 650 clamp(.8rem, 1.15vw, 1rem)/1.25 var(--font-mono); }
.telemetry__item[data-state="warning"] dd, .telemetry__item[data-state="anomaly"] dd { color: var(--amber-hot); }
/* State glyphs: hollow square (stable), solid triangle (warning), cut diamond (anomaly). */
.telemetry dt::before {
  flex: none;
  width: .85em;
  height: .85em;
  content: "";
  background: currentColor;
  -webkit-mask: var(--state-glyph) center / contain no-repeat;
  mask: var(--state-glyph) center / contain no-repeat;
}
.telemetry__item[data-state="stable"] dt::before { --state-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M2 2h20v20H2V2Zm3.5 3.5v13h13v-13h-13Z'/%3E%3C/svg%3E"); }
.telemetry__item[data-state="warning"] dt::before { --state-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 23 22H1L12 2Z'/%3E%3C/svg%3E"); color: var(--amber-hot); }
.telemetry__item[data-state="anomaly"] dt::before { --state-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 0 24 12 12 24 0 12 12 0Zm-1.1 6.8h2.2v6.4h-2.2V6.8Zm0 8h2.2v2.4h-2.2v-2.4Z'/%3E%3C/svg%3E"); color: var(--amber-hot); }
.telemetry__item[data-state="anomaly"] dt { color: var(--amber-hot); }

.archive-context-note {
  position: relative;
  z-index: 4;
  display: grid;
  padding: clamp(1.5rem, 3.8vw, 3.5rem) max(24px, calc((100vw - min(1240px, calc(100vw - 48px))) / 2));
  grid-template-columns: minmax(160px, .42fr) 1fr;
  gap: 2rem;
  border-top: 1px solid var(--amber);
  color: var(--bone);
  background:
    linear-gradient(92deg, rgba(213,138,66,.14), transparent 56%),
    repeating-linear-gradient(-4deg, transparent 0 11px, rgba(194,118,56,.035) 11px 12px),
    var(--iron-1);
}
.archive-context-note__label { color: var(--amber); font: 700 .7rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
/* Brutalist warning glyph above the flag label: solid chamfered triangle, punched bar. */
.archive-context-note__label::before {
  display: block;
  width: 46px;
  height: 46px;
  margin-bottom: .9rem;
  content: "";
  background: var(--amber);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 1.5 23.5 22H.5L12 1.5ZM10.9 9.2h2.2v6h-2.2v-6Zm0 7.6h2.2v2.4h-2.2v-2.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 1.5 23.5 22H.5L12 1.5ZM10.9 9.2h2.2v6h-2.2v-6Zm0 7.6h2.2v2.4h-2.2v-2.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.archive-context-note div { max-width: 900px; color: var(--amber); font: 400 clamp(1.05rem, 1.5vw, 1.45rem)/1.5 var(--font-display); }
.archive-context-note p:last-child { margin-bottom: 0; }

/* Shared static sections */
.section-heading { max-width: 1080px; margin-bottom: clamp(2.6rem, 6vw, 5.4rem); }
.section-heading h2 { margin-bottom: 1.4rem; }
.section-heading--split { display: grid; max-width: none; grid-template-columns: 1.05fr .75fr; gap: clamp(2rem, 6vw, 7rem); align-items: end; }
.section-heading--split > div:last-child { color: var(--paper); }

.richtext, .cards, .contact, .tier-stack-section, .archive-section, .signal-feed, .glossary-section, .field-atlas {
  padding-block: clamp(5rem, 10vw, 9rem);
  border-bottom: 1px solid var(--rule-strong);
}
.richtext__body { color: var(--paper); font-size: 1.1rem; }
.richtext__body h3 { margin-top: 3rem; }
.richtext__body blockquote { margin: 2rem 0; padding-left: 1.4rem; border-left: 3px solid var(--amber); color: var(--bone); }

/* Orientation glossary */
.glossary-section { background: linear-gradient(180deg, rgba(213,138,66,.035), transparent 30rem); }
.glossary-grid { display: grid; margin: 0; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong); }
.glossary-term { position: relative; min-width: 0; padding: clamp(1.4rem, 3vw, 2.6rem); border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); background: rgba(7,7,6,.46); }
.glossary-term::before { position: absolute; top: 0; left: 0; width: 26px; height: 2px; content: ""; background: var(--amber); }
.glossary-term__category { display: block; margin-bottom: 1.6rem; color: var(--bone-dim); font: 650 .58rem/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.glossary-term dt { margin-bottom: .8rem; color: var(--bone); font: 700 clamp(1.05rem, 1.4vw, 1.35rem)/1.2 var(--font-display); text-transform: uppercase; }
.glossary-term dd { margin: 0; color: var(--paper); }
.glossary-term dd > strong { display: block; margin-bottom: .7rem; color: var(--amber-hot); font: 600 .73rem/1.45 var(--font-mono); text-transform: uppercase; }
.glossary-term dd > div p:last-child { margin-bottom: 0; }
.glossary-term .text-link { display: inline-block; margin-top: 1.2rem; }

/* ARES visual index */
.field-atlas { background: #080806; }
.field-atlas__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong); }
.field-atlas__record { position: relative; min-width: 0; padding: clamp(1rem, 2.2vw, 1.8rem); border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); background: linear-gradient(150deg, rgba(225,216,196,.025), transparent 48%); transition: border-color .18s ease, background-color .18s ease; }
.field-atlas__frame { aspect-ratio: 3 / 2; margin-bottom: 1.4rem; }
/* Bias crops toward the upper third so faces survive the landscape frame. */
.field-atlas__frame img { object-position: 50% 22%; }
/* Subject registry shows people: portrait frames, face-height crop. */
body[data-page="characters"] .field-atlas__grid .field-atlas__frame { aspect-ratio: 3 / 4; }
body[data-page="characters"] .field-atlas__grid .field-atlas__frame img { object-position: 50% 15%; }
.field-atlas__meta { display: flex; min-height: 2.2em; justify-content: space-between; gap: 1rem; color: var(--bone-dim); font: 600 .58rem/1.3 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; }
.field-atlas__record h3 { margin: .65rem 0 1rem; font-size: clamp(1.1rem, 1.5vw, 1.45rem); }
.field-atlas__description { color: var(--paper); }
.field-atlas__description p:last-child { margin-bottom: 0; }
.field-atlas__note { margin: 1.1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--rule); color: var(--bone-dim); font: 550 .67rem/1.5 var(--font-mono); text-transform: uppercase; }
.field-atlas__record .text-link { display: inline-block; margin-top: 1.2rem; }
.field-atlas__record .text-link::after, .glossary-term .text-link::after, .card__link::after, .archive-record .record-link::after { position: absolute; z-index: 6; inset: 0; content: ""; }
.field-atlas__record:has(.text-link):hover, .glossary-term:has(.text-link):hover, .card:has(.card__link):hover, .archive-record:has(.record-link):hover { border-color: var(--amber); background-color: rgba(213,138,66,.075); }
.field-atlas__record:has(.text-link), .glossary-term:has(.text-link), .card:has(.card__link), .archive-record:has(.record-link) { cursor: pointer; }
.field-atlas__cta { margin: 2.4rem 0 0; }

.cards__intro { max-width: 900px; color: var(--paper); }
.cards__grid { display: grid; margin: 3rem 0 0; padding: 0; grid-template-columns: repeat(3, 1fr); list-style: none; border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong); }
.card { position: relative; min-width: 0; padding: clamp(1.5rem, 3vw, 2.8rem); border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); background: rgba(21,20,16,.5); }
.card::before { position: absolute; top: 0; left: 0; width: 32px; height: 3px; content: ""; background: var(--amber); }
.card__badge { display: inline-block; margin-bottom: 2rem; color: var(--amber); font: 650 .62rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.card__icon { width: 100%; max-height: 240px; margin-bottom: 1.5rem; object-fit: cover; filter: sepia(.06) saturate(.92); }
.card__title { margin-bottom: 1.1rem; }
.card__link { text-decoration: none; }
.card__text { color: var(--paper); }
.cards__cta { margin-top: 2rem; }

.cta-band { border-bottom: 1px solid var(--iron-0); color: var(--iron-0); background: var(--amber); }
.cta-band__inner { display: flex; min-height: 260px; align-items: center; justify-content: space-between; gap: 3rem; padding-block: 3rem; }
.cta-band h2 { max-width: 30ch; margin-bottom: 1rem; font-size: clamp(1.6rem, 2.7vw, 2.6rem); text-wrap: balance; }
.cta-band__text { max-width: 650px; }

/* Tier directory */
.tier-stack { border-top: 1px solid var(--rule-strong); }
.tier { position: relative; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule-strong); border-left: 1px solid var(--rule); background: var(--iron-1); }
.tier::before { position: absolute; inset: 0 auto 0 0; width: calc(var(--weight, 1) * 3px); content: ""; background: var(--bone-dim); }
.tier[data-weight="2"] { --weight: 2; }
.tier[data-weight="3"] { --weight: 3; }
.tier[data-weight="4"] { --weight: 4; }
.tier--restricted::before, .tier--redacted::before { background: var(--red); }
.tier--decommissioned::before { background: var(--rust); }
.tier--operational::before { background: var(--copper); }
.tier__trigger {
  display: grid;
  width: 100%;
  min-height: 92px;
  padding: 0;
  grid-template-columns: 90px 1fr auto;
  align-items: stretch;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.tier__trigger > span { display: flex; align-items: center; padding: 1rem 1.35rem; border-right: 1px solid var(--rule); }
.tier__number { justify-content: center; color: var(--amber); font: 650 2rem/1 var(--font-display); }
.tier__identity { min-width: 0; flex-direction: column; align-items: flex-start !important; justify-content: center; }
.tier__identity strong { font: 650 clamp(1.15rem, 2vw, 1.65rem)/1.05 var(--font-display); text-transform: uppercase; }
.tier__identity span { margin-top: .35rem; color: var(--bone-dim); font: 500 .72rem/1.2 var(--font-mono); letter-spacing: .05em; }
.tier__state { min-width: 150px; justify-content: flex-end; border-right: 0 !important; color: var(--bone-dim); font: 650 .65rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.tier.is-selected { background: var(--iron-2); }
.tier.is-selected .tier__trigger { border-bottom: 1px solid var(--rule); }
.js [data-tier]:not(.is-selected) [data-tier-detail] { display: none; }
.tier__detail { display: grid; padding: 2rem clamp(1.4rem, 4vw, 5rem) 2.4rem 112px; grid-template-columns: 1fr .75fr; gap: 1rem 3rem; color: var(--paper); }
.tier__detail blockquote { grid-column: 1 / -1; margin: 1rem 0 0; padding: 1.2rem 1.4rem; border-left: 3px solid var(--rust); color: #f1d1b8; background: rgba(143,66,41,.12); font: 650 1.05rem/1.45 var(--font-mono); text-transform: uppercase; }
.tier__technology span { display: block; margin-bottom: .35rem; color: var(--bone-dim); font: 650 .6rem/1 var(--font-mono); letter-spacing: .08em; }
.tier__extended { grid-column: 1 / -1; max-width: 74ch; color: var(--paper); }
.tier__extended p { margin-bottom: .9rem; }
.tier__extended p:last-child { margin-bottom: 0; }

/* Registry */
.archive-controls { display: flex; margin-bottom: 2rem; justify-content: space-between; gap: 1rem; }
.archive-filters, .archive-views { display: flex; flex-wrap: wrap; gap: .4rem; }
.archive-controls button, .reader-tools button {
  min-height: 38px;
  padding: .55rem .72rem;
  border: 1px solid var(--rule-strong);
  color: var(--bone-dim);
  background: var(--iron-1);
  font: 650 .62rem/1 var(--font-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
}
.archive-controls button.is-active, .archive-controls button:hover, .reader-tools button:hover { color: var(--iron-0); border-color: var(--amber); background: var(--amber); }
.archive-records { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong); }
.archive-record { position: relative; min-width: 0; padding: clamp(1.25rem, 2.8vw, 2.4rem); border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); background: linear-gradient(145deg, rgba(225,216,196,.025), transparent 46%); }
.archive-record__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-bottom: 2.2rem; color: var(--bone-dim); font: 600 .58rem/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.archive-record h3 { margin-bottom: 1rem; }
.archive-record__approved, .archive-record__recovered { transition: opacity .2s ease; }
.archive-record__recovered { margin-top: 2rem; padding: 1.3rem; border: 1px solid rgba(194,118,56,.28); color: #f0d2b9; background: rgba(143,66,41,.09); }
.archive-record__recovered .record-label { color: var(--amber-hot); }
.archive-record__approved > div, .archive-record__recovered > div { color: var(--paper); }
.archive-record .record-link { display: inline-block; margin-top: 1.5rem; }
.archive-section[data-view="approved"] .archive-record__recovered { opacity: .42; }
.archive-section[data-view="recovered"] .archive-record__approved { opacity: .42; }
.featured-incident { display: grid; margin-top: 2rem; padding: 1.5rem; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem; border: 1px solid var(--amber); background: rgba(213,138,66,.08); }
.featured-incident > span { color: var(--amber); font: 650 .7rem/1 var(--font-mono); }
.featured-incident h3 { margin-bottom: .35rem; }
.featured-incident p { margin: 0; color: var(--paper); }

/* Reader */
.fragment-reader { position: relative; background: #0a0908; }
.reading-progress { position: fixed; z-index: 30; top: 0; left: 0; width: 100%; height: 3px; border: 0; appearance: none; }
.reading-progress::-webkit-progress-bar { background: transparent; }
.reading-progress::-webkit-progress-value { background: var(--amber-hot); }
.reading-progress::-moz-progress-bar { background: var(--amber-hot); }
.fragment-reader__header { padding-block: clamp(5rem, 11vw, 9rem) clamp(3.5rem, 7vw, 6rem); border-bottom: 1px solid var(--rule-strong); background: radial-gradient(circle at 50% 0, rgba(143,66,41,.14), transparent 38rem); }
.fragment-reader__codes { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; margin-bottom: clamp(4rem, 9vw, 8rem); padding-block: .7rem; border-block: 1px solid var(--rule); color: var(--bone-dim); font: 600 .62rem/1.2 var(--font-mono); letter-spacing: .06em; }
.fragment-reader h1 { max-width: 26ch; margin-bottom: 2rem; font-size: clamp(2rem, 3.4vw, 3.2rem); text-wrap: balance; }
.fragment-reader__note { max-width: 650px; color: var(--paper); font-size: 1.1rem; }
.reader-tools { display: flex; margin-top: 3rem; align-items: center; gap: .4rem; }
.reader-tools > span { margin-right: auto; color: var(--bone-dim); font: 600 .65rem/1 var(--font-mono); text-transform: uppercase; }
.audio-sample { padding-block: 2.4rem; border-bottom: 1px solid var(--rule); background: var(--iron-1); }
.audio-sample h2 { margin-bottom: 1.25rem; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.audio-sample audio { width: 100%; height: 48px; accent-color: var(--amber); }
.audio-sample p:last-child { margin: .8rem 0 0; color: var(--bone-dim); font-size: .88rem; }
.fragment-reader__body { padding-block: clamp(4rem, 9vw, 8rem); color: #dfd6c5; font-family: Georgia, "Times New Roman", serif; font-size: calc(clamp(1.08rem, 1.7vw, 1.28rem) * var(--reader-scale)); line-height: 1.9; }
.fragment-reader__body p { margin-bottom: 1.55em; }
.fragment-reader__body em { color: #f0dfc4; }
.fragment-reader__body hr { width: 80px; margin: 4rem auto; border: 0; border-top: 1px solid var(--amber); }
.fragment-reader__body blockquote { margin: 2.5rem 0; padding: .2rem 0 .2rem 1.5rem; border-left: 2px solid var(--amber); color: var(--bone); }
.fragment-reader__end { padding-block: 4rem 7rem; border-top: 1px solid var(--rule-strong); text-align: center; }
.fragment-reader__end > p { color: var(--amber); font: 700 .72rem/1.2 var(--font-mono); letter-spacing: .12em; }

/* One-click chapter reaction (out-of-world, copper) */
.chapter-react { margin: 2.2rem auto 2.6rem; padding: 1.4rem 1.2rem; max-width: 560px; border: 1px solid rgba(103,161,143,.4); background: rgba(103,161,143,.05); }
.chapter-react__prompt { margin: 0 0 .9rem; color: var(--ext); font: 700 .68rem/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.chapter-react__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.chapter-react__buttons button {
  min-height: 48px;
  padding: .8rem 1.4rem;
  border: 1px solid var(--ext);
  color: var(--iron-0);
  background: var(--ext);
  font: 700 .8rem/1 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s ease;
}
.chapter-react__buttons button:hover:not(:disabled) { background: var(--ext-hot); border-color: var(--ext-hot); transform: translateY(-1px); }
.chapter-react__buttons button:disabled { opacity: .45; cursor: default; }
.chapter-react__buttons button.is-chosen { color: var(--iron-0); background: var(--ext); opacity: 1; }
.chapter-react__status { min-height: 1.2em; margin: .8rem 0 0; color: var(--bone-dim); font: 600 .7rem/1.4 var(--font-mono); letter-spacing: .04em; }
.chapter-react__more { margin: .5rem 0 0; font-size: .76rem; }
.chapter-react__more a { color: var(--ext); }

.chapter-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem; margin: 0 auto 2.4rem; }
.chapter-share__label { color: var(--bone-dim); font: 600 .68rem/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.chapter-share__button {
  min-height: 44px;
  padding: .7rem 1.2rem;
  border: 1px solid var(--bone);
  color: var(--iron-0);
  background: var(--bone);
  font: 700 .76rem/1 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s ease;
}
.chapter-share__button:hover { border-color: var(--amber-hot); background: var(--amber-hot); transform: translateY(-1px); }
.chapter-share__status { min-width: 7em; color: var(--bone-dim); font: 600 .68rem/1.3 var(--font-mono); text-align: left; }

/* Signals + contact */
.signal-feed__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule-strong); }
.signal-item { display: grid; padding: 1.8rem 0; grid-template-columns: .72fr 1.25fr 1fr; gap: 2rem; border-bottom: 1px solid var(--rule); }
.signal-item__meta { display: flex; flex-direction: column; gap: .4rem; color: var(--bone-dim); font: 600 .62rem/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.signal-item h3 { margin: 0; font-size: clamp(1.35rem, 2.2vw, 2.1rem); }
.signal-item h3 a { text-decoration: none; }
.signal-item > p { margin: 0; color: var(--paper); }
.signal-feed__status { margin: 1rem 0 0; color: var(--bone-dim); font: 600 .62rem/1.4 var(--font-mono); text-transform: uppercase; }

.contact__intro { max-width: 650px; color: var(--paper); }
.contact__form { display: grid; max-width: 800px; margin-top: 2.5rem; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact__form label { display: flex; flex-direction: column; gap: .45rem; color: var(--bone-dim); font: 650 .64rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.contact__form label:has(textarea), .contact__privacy, .contact__status { grid-column: 1 / -1; }
.contact__form input, .contact__form textarea {
  width: 100%;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: .85rem;
  color: var(--bone);
  background: var(--iron-1);
}
.contact__form textarea { resize: vertical; }
.contact__privacy { color: var(--bone-dim); font-size: .8rem; }
.contact__status { min-height: 1.5rem; margin: 0; }
.contact__fallback { color: var(--bone-dim); }

/* Footer */
.site-footer { position: relative; overflow: hidden; padding-block: 5rem 2rem; border-top: 1px solid var(--rule-strong); background: #050504; }
.site-footer::after { position: absolute; top: 2.2rem; right: 3vw; width: 170px; height: 52px; content: ""; opacity: .12; background: url('/assets/images/decalon-submark.svg') center / contain no-repeat; pointer-events: none; }
.site-footer__inner { display: grid; grid-template-columns: 1.45fr repeat(3, minmax(120px, .55fr)); gap: 3rem; }
.site-footer__about { max-width: 420px; }
.site-footer__logo { width: min(280px, 100%); height: auto; max-height: 70px; margin-bottom: 1.5rem; object-fit: contain; object-position: left center; }
.site-footer__text { color: var(--bone-dim); }
.site-footer__text p { margin-bottom: .7rem; }
.site-footer__heading { color: var(--bone); font: 650 .65rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li + li { margin-top: .55rem; }
.site-footer nav a { color: var(--bone-dim); font-size: .82rem; text-decoration: none; }
.site-footer__legal { min-width: 140px; }
.site-footer__copyright { grid-column: 1 / -1; margin: 2rem 0 0; padding-top: 1.3rem; border-top: 1px solid var(--rule); color: var(--bone-dim); font: 500 .62rem/1.4 var(--font-mono); }

/* ============================================================
   Out-of-world boundary: routes under /read, /origin, /signals
   leave the archive fiction. Marked with the copper accent. */
.site-nav a:not(.button)[href^="/read"],
.site-nav a:not(.button)[href="/origin"],
.site-nav a:not(.button)[href="/signals"] { color: var(--ext); }
.site-nav a:not(.button)[href^="/read"]:hover,
.site-nav a:not(.button)[href="/origin"]:hover,
.site-nav a:not(.button)[href="/signals"]:hover,
.site-nav a:not(.button)[href^="/read"].is-current,
.site-nav a:not(.button)[href="/origin"].is-current { color: var(--ext-hot); }
.site-nav a[href^="/read"].is-current::after,
.site-nav a[href="/origin"].is-current::after { background: var(--ext); }
.site-nav a:not(.button)[href^="/read"]::before,
.site-nav a:not(.button)[href="/origin"]::before,
.site-nav a:not(.button)[href="/signals"]::before { margin-right: .45em; content: "\2197"; opacity: .7; }

a.button[href^="/read"], a.button[href="/origin"], a.button[href="/signals"] {
  color: var(--ext);
  border-color: var(--ext);
  background: transparent;
}
a.button[href^="/read"]:hover, a.button[href="/origin"]:hover, a.button[href="/signals"]:hover {
  color: var(--iron-0);
  border-color: var(--ext-hot);
  background: var(--ext-hot);
}
a.button[href^="/read"]::before, a.button[href="/origin"]::before, a.button[href="/signals"]::before { margin-right: .5em; content: "\2197"; }

.text-link[href^="/read"], .record-link[href^="/read"],
.text-link[href="/origin"], .record-link[href="/origin"],
.text-link[href="/signals"], .record-link[href="/signals"] { color: var(--ext); }
.text-link[href^="/read"]:hover, .record-link[href^="/read"]:hover,
.text-link[href="/origin"]:hover, .record-link[href="/origin"]:hover { color: var(--ext-hot); }

/* ============================================================
   Live-feed treatment: compressed-transmission texture over all
   sensor frames, plus JS-driven glitch ticks and tear line. */
.sensor-frame::before {
  background:
    linear-gradient(90deg, rgba(0,0,0,.72), transparent 12%, transparent 88%, rgba(0,0,0,.65)),
    repeating-linear-gradient(0deg, rgba(225,216,196,.045) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.04) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 50% 48%, transparent 20%, rgba(0,0,0,.4) 100%);
  animation: feed-scan 9s steps(24) infinite;
}
@keyframes feed-scan {
  0% { background-position: 0 0, 0 0, 0 0, 0 0; opacity: .48; }
  46% { opacity: .48; }
  48% { opacity: .6; }
  50% { background-position: 0 0, 0 2px, 1px 0, 0 0; opacity: .44; }
  100% { background-position: 0 0, 0 3px, 0 0, 0 0; opacity: .48; }
}
.sensor-frame .feed-tear {
  position: absolute;
  z-index: 3;
  right: 0;
  left: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(225,216,196,.16) 18%, rgba(213,138,66,.2) 52%, transparent);
  opacity: 0;
}
.sensor-frame.is-glitch .feed-tear { opacity: 1; }
.sensor-frame.is-glitch img {
  transform: translateX(var(--glitch-x, 2px)) scaleY(1.004);
  filter: saturate(.35) contrast(1.3) sepia(.2);
}
.sensor-frame.is-glitch::before { opacity: .7; }

/* Signal-loss loader: canvas veil, macroblocks resolve then repair */
.pixelate-veil {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}

/* Feed personalities: how a frame corrupts is part of its record. */
.sensor-frame.feed-pristine::before { animation: none; opacity: .3; }
.sensor-frame.feed-pristine img { filter: saturate(.96) contrast(1.02) sepia(.02); }
.sensor-frame.feed-breathing::before { animation: none; }
.sensor-frame.feed-breathing img { animation: feed-breathe 8s ease-in-out infinite; }
@keyframes feed-breathe {
  0%, 100% { filter: saturate(.9) contrast(1.03) sepia(.05) brightness(1); }
  50% { filter: saturate(.95) contrast(1.01) sepia(.08) brightness(1.06); }
}
.sensor-frame .feed-static {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(0deg, rgba(225,216,196,.14) 0 1px, rgba(7,7,6,.9) 1px 3px),
    repeating-linear-gradient(90deg, rgba(225,216,196,.06) 0 2px, transparent 2px 5px),
    #0a0908;
}
.sensor-frame.is-dropout .feed-static { opacity: 1; }
.sensor-frame.is-dropout img { filter: brightness(.15) contrast(1.6); }
@media (prefers-reduced-motion: reduce) {
  .sensor-frame.feed-breathing img { animation: none; }
}

/* Typewriter reveal on primary headlines */
.js [data-typewriter].tw-armed { visibility: hidden; }
[data-typewriter].tw-typing { visibility: visible; }
[data-typewriter].tw-typing::after {
  display: inline-block;
  width: .55em;
  margin-left: .08em;
  content: "";
  border-bottom: .14em solid var(--amber-hot);
  animation: tw-blink .5s steps(1) infinite;
}
@keyframes tw-blink { 50% { opacity: 0; } }

/* Ambient triangle field behind in-world pages */
.ambient-field {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ============================================================
   PAS sidechannel terminal */
.terminal-toggle {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 .72rem;
  border: 0;
  color: var(--amber);
  background: transparent;
  font: 700 .65rem/1 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.terminal-toggle::before { margin-right: .45em; content: ">_"; opacity: .8; }
.terminal-toggle:hover { color: var(--amber-hot); }

.pas-terminal[hidden] { display: none; }
.pas-terminal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(120% 80% at 50% -10%, rgba(213,138,66,.07), transparent 55%), rgba(4, 4, 3, .82);
  backdrop-filter: blur(3px);
}
.pas-terminal__frame {
  position: relative;
  display: flex;
  width: min(880px, 100%);
  height: min(72vh, 640px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(213,138,66,.5);
  background:
    linear-gradient(180deg, rgba(213,138,66,.05), transparent 16%),
    repeating-linear-gradient(0deg, rgba(225,216,196,.028) 0 1px, transparent 1px 3px),
    #080706;
  box-shadow:
    0 0 0 1px rgba(7,7,6,.9),
    0 30px 90px rgba(0,0,0,.6),
    0 0 64px rgba(213,138,66,.10),
    inset 0 0 70px rgba(0,0,0,.55);
  isolation: isolate;
}
/* Acquisition corner brackets, echoing the ARES sensor frames. */
.pas-terminal__frame::before {
  position: absolute;
  z-index: 4;
  inset: 6px;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(var(--amber), var(--amber)) 0 0/14px 1px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 0 0/1px 14px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 100% 0/14px 1px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 100% 0/1px 14px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 0 100%/14px 1px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 0 100%/1px 14px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 100% 100%/14px 1px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 100% 100%/1px 14px no-repeat;
  opacity: .5;
}
/* Slow scan sweep drifting behind the console text. */
.pas-terminal__frame::after {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 46%;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(213,138,66,.08) 66%, rgba(213,138,66,.16));
  mix-blend-mode: screen;
  animation: pas-sweep 7.5s linear infinite;
}
@keyframes pas-sweep {
  0% { transform: translateY(-108%); }
  100% { transform: translateY(340%); }
}
.pas-terminal__top {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .58rem .62rem .58rem .78rem;
  border-bottom: 1px solid rgba(213,138,66,.32);
  background: linear-gradient(180deg, rgba(213,138,66,.06), transparent);
}
.pas-terminal__brand { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.pas-terminal__logo { flex-shrink: 0; width: 22px; height: 22px; object-fit: contain; opacity: .92; }
.pas-terminal__id { display: flex; min-width: 0; flex-direction: column; gap: .16rem; }
.pas-terminal__id b { color: var(--amber); font: 700 .66rem/1 var(--font-mono); letter-spacing: .16em; }
.pas-terminal__id span { overflow: hidden; color: var(--bone-dim); font: 600 .55rem/1 var(--font-mono); letter-spacing: .08em; white-space: nowrap; text-overflow: ellipsis; }
.pas-terminal__status {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-left: auto;
  color: var(--bone-dim);
  font: 700 .55rem/1 var(--font-mono);
  letter-spacing: .12em;
  white-space: nowrap;
}
.pas-terminal__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 8px 1px var(--copper);
  animation: pas-pulse 2.4s ease-in-out infinite;
}
@keyframes pas-pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.pas-terminal__close {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--rule);
  color: var(--bone-dim);
  background: transparent;
  font: 700 .7rem/1 var(--font-mono);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.pas-terminal__close:hover { color: var(--iron-0); border-color: var(--amber); background: var(--amber); }
.pas-terminal__output {
  position: relative;
  z-index: 5;
  flex: 1;
  min-height: 0;
  min-width: 0;
  padding: 1rem 1.05rem;
  overflow-x: hidden;
  overflow-y: auto;
  font: 500 .78rem/1.6 var(--font-mono);
  scrollbar-width: thin;
  scrollbar-color: rgba(213,138,66,.45) transparent;
}
.t-line { margin: 0 0 .15rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.t-sys { color: var(--bone-dim); }
.t-warn { color: var(--amber-hot); }
.t-code { color: var(--amber); }
.t-user { color: var(--bone); opacity: .85; }
.t-aera { color: var(--paper); }
.t-aera:first-line { letter-spacing: .01em; }
.t-prom { color: #e8b98a; }
.pas-terminal__inputline {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .72rem 1.05rem;
  border-top: 1px solid rgba(213,138,66,.28);
  background: linear-gradient(0deg, rgba(213,138,66,.05), transparent);
}
.pas-terminal__prompt { color: var(--amber); font: 700 .72rem/1 var(--font-mono); white-space: nowrap; }
.pas-terminal__inputline input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  color: var(--bone);
  background: transparent;
  font: 500 .82rem/1.4 var(--font-mono);
  caret-color: var(--amber-hot);
}
body.terminal-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .pas-terminal__frame::after { animation: none; opacity: .25; }
  .pas-terminal__dot { animation: none; opacity: .9; }
}

/* ============================================================
   Reader feedback panel (out-of-world, copper accent) */
.eyebrow--ext { color: var(--ext); }
.feedback-panel { padding-block: clamp(5rem, 10vw, 9rem); border-bottom: 1px solid var(--rule-strong); background: linear-gradient(180deg, rgba(103,161,143,.05), transparent 26rem); }
.feedback-panel__intro { max-width: 640px; color: var(--paper); }
.feedback-panel__group { margin: 0 0 1.6rem; padding: 0; border: 0; }
.feedback-panel__group legend { margin-bottom: .9rem; color: var(--bone); font: 650 .68rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.feedback-panel__options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.feedback-option { position: relative; display: flex; cursor: pointer; }
.feedback-option input { position: absolute; opacity: 0; }
.feedback-option__body { display: block; width: 100%; padding: .9rem 1rem; border: 1px solid var(--rule-strong); background: rgba(21,20,16,.55); transition: border-color .15s ease, background-color .15s ease; }
.feedback-option__body strong { display: block; margin-bottom: .3rem; font: 700 .8rem/1.2 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.feedback-option__body span { color: var(--bone-dim); font-size: .82rem; line-height: 1.45; }
.feedback-option input:checked + .feedback-option__body { border-color: var(--ext); background: rgba(103,161,143,.1); }
.feedback-option input:focus-visible + .feedback-option__body { outline: 2px solid var(--ext-hot); outline-offset: 2px; }
.feedback-panel__chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.feedback-chip { position: relative; cursor: pointer; }
.feedback-chip input { position: absolute; opacity: 0; }
.feedback-chip span { display: inline-block; padding: .5rem .85rem; border: 1px solid var(--rule-strong); color: var(--bone-dim); font: 650 .68rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; transition: all .15s ease; }
.feedback-chip input:checked + span { color: var(--iron-0); border-color: var(--ext); background: var(--ext); }
.feedback-chip input:focus-visible + span { outline: 2px solid var(--ext-hot); outline-offset: 2px; }
.feedback-panel__field { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1.1rem; color: var(--bone-dim); font: 650 .64rem/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.feedback-panel__field textarea, .feedback-panel__field input { width: 100%; padding: .85rem; border: 1px solid var(--rule-strong); border-radius: 0; color: var(--bone); background: var(--iron-1); }
.feedback-panel__field textarea { resize: vertical; }
.feedback-panel__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.feedback-panel__row .feedback-panel__field { margin-bottom: 1.1rem; }
@media (max-width: 560px) { .feedback-panel__row { grid-template-columns: 1fr; } }
.feedback-panel__actions { display: flex; align-items: center; gap: 1.2rem; }
.feedback-panel__actions .button { min-height: 48px; padding: .8rem 1.6rem; color: var(--iron-0); border-color: var(--ext); background: var(--ext); font-size: .8rem; }
.feedback-panel__actions .button:hover { color: var(--iron-0); border-color: var(--ext-hot); background: var(--ext-hot); transform: translateY(-1px); }
.feedback-panel__status { margin: 0; color: var(--bone-dim); font: 600 .72rem/1.4 var(--font-mono); }
.feedback-panel__privacy { margin-top: 1.4rem; color: var(--bone-dim); font-size: .78rem; }
.feedback-panel__privacy a { color: var(--ext); }
@media (max-width: 700px) { .feedback-panel__options { grid-template-columns: 1fr; } }

@media (max-width: 560px) {
  /* The terminal becomes a full-screen sheet on phones. The overlay drops flex
     centering and the frame is pinned edge-to-edge, so its width is the viewport
     exactly (no flex min-content growth pushing content off the right). */
  .pas-terminal { display: block; padding: 0; }
  .pas-terminal__frame {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    box-shadow: none;
  }
  .pas-terminal__frame::before { inset: 4px; }
  .pas-terminal__top { gap: .5rem; padding: .7rem .55rem .7rem .8rem; }
  .pas-terminal__logo { width: 20px; height: 20px; }
  .pas-terminal__id b { font-size: .6rem; letter-spacing: .12em; }
  .pas-terminal__id span { font-size: .5rem; }
  .pas-terminal__status { display: none; }                  /* free up width; the live state is implicit */
  /* On a full-screen sheet the ✕ is the only exit, so make it obvious + tappable. */
  .pas-terminal__close { flex-shrink: 0; width: 42px; height: 42px; margin-left: auto; border-color: rgba(213,138,66,.6); color: var(--amber); font-size: .85rem; }
  .pas-terminal__output { padding: .9rem; font: 500 .84rem/1.6 var(--font-mono); overscroll-behavior: contain; }
  .pas-terminal__inputline { padding: .8rem .9rem calc(.85rem + env(safe-area-inset-bottom, 0px)); }
  .pas-terminal__prompt { font-size: .64rem; }
  .pas-terminal__inputline input { font-size: 16px; }        /* >=16px stops iOS auto-zoom on focus */
}

@media (prefers-reduced-motion: reduce) {
  .sensor-frame::before { animation: none; }
  .js [data-typewriter].tw-armed { visibility: visible; }
  .ambient-field { display: none; }
}

@media (max-width: 1360px) {
  .site-header__inner { flex-wrap: wrap; }
  .brand { min-height: 76px; border-right: 0; }
  .js .nav-toggle { display: block; }
  .js .site-nav { display: none; width: 100%; border-top: 1px solid var(--rule); }
  .js .site-nav.is-open { display: block; }
  .site-nav__list { flex-wrap: wrap; }
  .site-nav__list > li { min-height: 48px; }
  .site-nav a:not(.button) { padding: .9rem; }
  .site-nav a.is-current::after { right: .9rem; left: .9rem; }
  .terminal-toggle { padding: .9rem; height: auto; }
}

@media (max-width: 1120px) {
  .archive-records { grid-template-columns: repeat(2, 1fr); }
  .cards__grid { grid-template-columns: repeat(2, 1fr); }
  .glossary-grid, .field-atlas__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  :root { --container: min(100% - 32px, 720px); }
  body::before { left: 7px; }
  .fragment-hero { max-width: none; }
  .terminal-hero__topline { display: flex; flex-wrap: wrap; }
  .terminal-hero__topline span { flex: 1 1 auto; min-width: 0; padding: .75rem 16px; overflow-wrap: anywhere; }
  .terminal-hero__topline span:nth-child(2) { border-right: 0; }
  .terminal-hero__topline span:last-child { flex-basis: 100%; text-align: left; border-top: 1px solid var(--rule); }
  .terminal-hero__grid { display: flex; min-height: 0; flex-direction: column; }
  .terminal-hero__copy { min-height: 610px; padding: 4.5rem 20px; border-right: 0; }
  .terminal-hero h1 { max-width: 100%; }
  .terminal-hero .sensor-frame { min-height: 344px; border-top: 1px solid var(--rule-strong); }
  .telemetry { grid-template-columns: 1fr 1fr; }
  .telemetry__item:nth-child(2) { border-right: 0; }
  .telemetry__item:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .archive-context-note { grid-template-columns: 1fr; gap: .4rem; }
  .section-heading--split { grid-template-columns: 1fr; gap: 1rem; }
  .archive-controls { flex-direction: column; }
  .tier__trigger { grid-template-columns: 64px 1fr; }
  .tier__state { grid-column: 2; justify-content: flex-start; min-width: 0; padding-top: 0 !important; padding-bottom: 1rem !important; border-right: 0 !important; }
  .tier__detail { padding: 1.5rem; grid-template-columns: 1fr; }
  .featured-incident { grid-template-columns: 1fr; }
  .signal-item { grid-template-columns: .55fr 1.2fr; }
  .signal-item > p { grid-column: 2; }
  .site-footer__inner { grid-template-columns: 1.2fr 1fr 1fr; }
  .site-footer__about { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  h2 { font-size: clamp(1.35rem, 6vw, 1.9rem); }
  .brand { min-width: 0; flex: 1; }
  .brand__tagline { display: none; }
  .site-nav__list { display: block; }
  .site-nav__list > li { display: block; min-height: 0; }
  .site-nav a:not(.button) { min-height: 46px; }
  .terminal-hero__copy { min-height: 560px; }
  .terminal-hero h1 { max-width: 100%; font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .terminal-hero__session { flex-direction: column; }
  .terminal-hero .sensor-frame { min-height: 272px; }
  .sensor-frame figcaption { flex-direction: column; gap: .3rem; }
  .telemetry { grid-template-columns: 1fr; }
  .telemetry__item { border-right: 0; border-bottom: 1px solid var(--rule); }
  .telemetry__item:last-child { border-bottom: 0; }
  .archive-records, .cards__grid, .glossary-grid, .field-atlas__grid { grid-template-columns: 1fr; }
  .archive-controls button { flex: 1 1 auto; }
  .tier__identity strong { font-size: 1rem; }
  .tier__trigger > span { padding-inline: .85rem; }
  .tier__detail blockquote { font-size: .88rem; }
  .cta-band__inner { align-items: flex-start; flex-direction: column; }
  .reader-tools { flex-wrap: wrap; }
  .fragment-reader h1 { max-width: 100%; font-size: clamp(1.7rem, 7.5vw, 2.3rem); }
  .fragment-hero { min-height: min(58vh, 448px); }
  .fragment-hero__title h1 { max-width: 100%; font-size: clamp(2rem, 9vw, 2.8rem); }
  .fragment-hero__codes span:nth-child(2) { display: none; }
  .reader-tools > span { width: 100%; margin-bottom: .7rem; }
  .signal-item { display: block; }
  .signal-item__meta { margin-bottom: 1rem; flex-direction: row; flex-wrap: wrap; }
  .signal-item h3 { margin-bottom: .8rem; }
  .contact__form { grid-template-columns: 1fr; }
  .contact__form label:has(textarea), .contact__privacy, .contact__status { grid-column: auto; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: 2.2rem 1rem; }
  .site-footer__about { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .sensor-frame, .sensor-frame img { transform: none !important; }
}

@media print {
  .site-header, .site-footer, .reader-tools, .reading-progress, .fragment-reader__end .button { display: none !important; }
  body, .fragment-reader { color: #111; background: #fff; }
  .fragment-reader__body { color: #111; font-size: 11pt; }
}
