/* ============================================================
   THE AGENCY // LUX LETIFERA
   Tactical dossier · mobile-first · refined cyberpunk
   ============================================================ */

:root {
  --ink: #ff4b0a;
  --ink-soft: rgba(255, 75, 10, 0.55);
  --ink-glow: rgba(255, 75, 10, 0.35);

  --bone: #f3ecd8;
  --bone-dim: rgba(243, 236, 216, 0.82);

  --ash: #8a8577;
  --ash-dim: rgba(138, 133, 119, 0.28);

  --void: #07050a;
  --void-2: #0d0907;
  --surface: rgba(18, 12, 8, 0.72);
  --surface-line: rgba(255, 75, 10, 0.22);

  --go: #7bdc8e;
  --stop: #ff3a4a;

  --font-display: 'Chakra Petch', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --max: 1180px;

  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--void);
  color: var(--bone);
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at 70% -10%, rgba(255, 75, 10, 0.12), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(255, 75, 10, 0.08), transparent 60%),
    linear-gradient(180deg, #07050a 0%, #0a0705 50%, #050305 100%);
  background-attachment: fixed;
  /* Phosphor persistence — amber bleed on every glyph */
  text-shadow: 0 0 1px rgba(255, 110, 30, 0.38);
}

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

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection { background: var(--ink); color: var(--void); }

/* --- Accessibility helpers ----------------------------------- */

.skip-link {
  position: absolute;
  top: -100px; left: 1rem;
  background: var(--ink); color: var(--void);
  padding: 0.6rem 1rem;
  font-family: var(--font-mono); font-weight: 700;
  z-index: 100;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

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

/* --- Global atmosphere --------------------------------------- */

.grid-overlay {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><path d='M80 0H0V80' fill='none' stroke='%23ff5f14' stroke-opacity='0.22' stroke-width='1' shape-rendering='crispEdges'/></svg>");
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9), rgba(0,0,0,0) 78%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9), rgba(0,0,0,0) 78%);
  opacity: 0.75;
}

.vignette {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.78) 100%);
}

/* Phosphor sweep — slow amber refresh band, no harsh scanlines */
.scanline-overlay {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 4;
  background:
    linear-gradient(
      180deg,
      rgba(255, 120, 40, 0) 0%,
      rgba(255, 120, 40, 0) 38%,
      rgba(255, 150, 60, 0.032) 50%,
      rgba(255, 120, 40, 0) 62%,
      rgba(255, 120, 40, 0) 100%
    );
  background-size: 100% 320%;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  animation: phosphorSweep 27s ease-in-out infinite;
}

@keyframes phosphorSweep {
  0%   { background-position: 0 -90%; }
  45%  { background-position: 0 190%; }
  100% { background-position: 0 190%; }
}

/* Animated phosphor grain — SVG noise tile shifted in discrete steps
   so the whole viewport shimmers like live phosphor hiss. */
body::before {
  content: '';
  position: fixed;
  top: -50px; left: -50px; right: -50px; bottom: -50px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.78  0 0 0 0 0.4  0 0 0 1.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  animation: phosphorHiss 1.1s steps(5) infinite;
}

@keyframes phosphorHiss {
  0%   { background-position: 0 0; }
  20%  { background-position: -44px 36px; }
  40%  { background-position: 72px -28px; }
  60%  { background-position: -32px -58px; }
  80%  { background-position: 58px 64px; }
  100% { background-position: 0 0; }
}

/* Slow ambient phosphor breathing — a barely perceptible warm bloom */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 140, 55, 0.05) 12%, rgba(255, 140, 55, 0) 65%);
  animation: phosphorBreathe 7.5s ease-in-out infinite;
}

@keyframes phosphorBreathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* --- Shared section chrome ----------------------------------- */

main, .hero, .site-footer { position: relative; z-index: 3; }
.modal { z-index: 1000; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem var(--gutter);
}

.section__head {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    'num'
    'title'
    'kicker';
  gap: 0.5rem 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--surface-line);
}

.section__num {
  grid-area: num;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--ink);
}

.section__title {
  grid-area: title;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 7vw, 3.75rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--bone);
}

.section__kicker {
  grid-area: kicker;
  align-self: end;
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ash);
  letter-spacing: 0.15em;
  margin: 0.4rem 0 0;
}

@media (min-width: 720px) {
  .section { padding: 6rem var(--gutter); }
  .section__head {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'num    kicker'
      'title  kicker';
  }
  .section__kicker {
    justify-self: end;
    align-self: end;
    font-size: 0.7rem;
    margin: 0;
  }
}

.accent { color: var(--ink); font-weight: 600; }
.text-link {
  color: var(--ink);
  border-bottom: 1px dashed var(--ink-soft);
  transition: border-color 0.2s var(--ease), text-shadow 0.2s var(--ease);
}
.text-link:hover { border-bottom-color: var(--ink); text-shadow: 0 0 12px var(--ink-glow); }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem var(--gutter) 6rem;
  position: relative;
}

.hero__frame {
  width: 100%;
  max-width: var(--max);
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
  position: relative;
}

.hero__meta {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--ash);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  width: 100%;
  max-width: 640px;
}
@media (min-width: 560px) {
  .hero__meta {
    font-size: 0.7rem;
    gap: 0.75rem;
    letter-spacing: 0.2em;
  }
  .hero__meta::before,
  .hero__meta::after {
    content: '';
    flex: 1;
    min-width: 24px;
    max-width: 100px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--ink-soft));
  }
  .hero__meta::after {
    background: linear-gradient(to left, transparent, var(--ink-soft));
  }
}
.hero__meta-dot {
  width: 4px; height: 4px;
  background: var(--ink); display: inline-block;
}

.hero__logo {
  width: min(78vw, 420px);
  margin: 0.5rem 0;
  position: relative;
  animation: logoFloat 1.2s var(--ease) both;
}
.hero__logo img {
  width: 100%;
  filter: drop-shadow(0 0 30px rgba(255, 75, 10, 0.35));
}
.hero__wordmark {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 2rem 1rem;
  border: 1px solid var(--ink-soft);
  border-left-width: 2px;
  border-right-width: 2px;
  background: linear-gradient(180deg, rgba(255,75,10,0.05), transparent);
  text-shadow: 0 0 24px var(--ink-glow);
}
.hero__wordmark-the {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  color: var(--ink);
}
.hero__wordmark-agency {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 5.5rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--bone);
  text-transform: uppercase;
}
.hero__wordmark-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  color: var(--ash);
  margin-top: 0.4rem;
}
.hero__logo.is-fallback img { display: none; }
.hero__logo.is-fallback .hero__wordmark { display: flex; }

@media (min-width: 720px) {
  .hero__logo { width: min(55vw, 480px); }
}

.hero__tagline {
  max-width: 48ch;
  font-size: clamp(1.05rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: var(--bone-dim);
  letter-spacing: 0.005em;
  animation: fadeUp 1s 0.2s var(--ease) both;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  width: min(100%, 420px);
  margin-top: 0.5rem;
  animation: fadeUp 1s 0.4s var(--ease) both;
}

@media (min-width: 560px) {
  .hero__actions { flex-direction: row; width: auto; }
}

.hero__footnote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  animation: fadeUp 1s 0.55s var(--ease) both;
}
.hero__status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ash);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.btn--compact { padding: 0.7rem 1.2rem; font-size: 0.72rem; }

.hero__scroll {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  color: var(--ash);
}
.hero__scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--ink), transparent);
  animation: scrollPulse 2.4s var(--ease) infinite;
}
@media (min-width: 640px) {
  .hero__scroll { display: flex; }
}

@keyframes logoFloat {
  from { opacity: 0; transform: translateY(-20px) scale(0.96); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scrollPulse {
  0%,100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50%     { opacity: 1;   transform: scaleY(1); }
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-border: var(--ink);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.2s var(--ease), box-shadow 0.3s var(--ease);
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--ink);
  transform: translateX(-101%);
  transition: transform 0.35s var(--ease);
  z-index: -1;
}
.btn:hover::before,
.btn:focus-visible::before { transform: translateX(0); }
.btn:hover,
.btn:focus-visible {
  color: var(--void);
  box-shadow: 0 8px 30px var(--ink-glow);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  --btn-bg: rgba(255, 75, 10, 0.08);
}
.btn--ghost {
  --btn-fg: var(--bone);
  --btn-border: var(--ash-dim);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--void);
  border-color: var(--ink);
}
.btn--large { padding: 1.15rem 2.2rem; font-size: 0.9rem; }

.btn__icon { width: 18px; height: 14px; }
.btn__bracket { color: var(--ink); transition: color 0.25s var(--ease); }
.btn:hover .btn__bracket,
.btn:focus-visible .btn__bracket { color: var(--void); }

/* --- Glitch layer -------------------------------------------
   Chromatic split on the label — one warm ghost (ink), one cool
   ghost (bone). Quiet by default; shears briefly on hover/focus
   and once on press. A slower ambient flicker is reserved for
   the ghost "Access Archives" button to signal a live signal
   without the constant-motion noise of the original slicer.
   ------------------------------------------------------------ */

.btn__label {
  position: relative;
  display: inline-block;
  line-height: 1;
}
.btn__label::before,
.btn__label::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: inherit;
  opacity: 0;
  transition: opacity 0.2s var(--ease), color 0.25s var(--ease);
}
.btn__label::before {
  color: var(--ink);
  text-shadow: 0 0 2px var(--ink), 0 0 8px var(--ink-glow);
  clip-path: polygon(0 0, 100% 0, 100% 48%, 0 48%);
  transform: translate3d(-2px, 0, 0);
  mix-blend-mode: screen;
}
.btn__label::after {
  color: var(--bone);
  text-shadow: 0 0 2px rgba(123, 220, 142, 0.75), 0 0 6px rgba(123, 220, 142, 0.35);
  clip-path: polygon(0 52%, 100% 52%, 100% 100%, 0 100%);
  transform: translate3d(2px, 0, 0);
  mix-blend-mode: screen;
}

.btn:hover .btn__label::before,
.btn:focus-visible .btn__label::before {
  animation: btn-shear-top 0.6s steps(9, end) 1;
}
.btn:hover .btn__label::after,
.btn:focus-visible .btn__label::after {
  animation: btn-shear-bot 0.6s steps(9, end) 1;
}
.btn:active .btn__label::before { animation: btn-shear-top 0.2s steps(4, end) 1; }
.btn:active .btn__label::after  { animation: btn-shear-bot 0.2s steps(4, end) 1; }

@keyframes btn-shear-top {
  0%   { opacity: 0;    transform: translate3d(-2px, 0, 0);   clip-path: polygon(0 0, 100% 0, 100% 48%, 0 48%); }
  10%  { opacity: 1;    transform: translate3d(-9px, -1px, 0); clip-path: polygon(0 0, 100% 0, 100% 20%, 0 20%); }
  22%  { opacity: 1;    transform: translate3d(7px, 1px, 0);   clip-path: polygon(0 14%, 100% 14%, 100% 54%, 0 54%); }
  34%  { opacity: 0.95; transform: translate3d(-6px, 0, 0);    clip-path: polygon(0 0, 100% 0, 100% 38%, 0 38%); }
  46%  { opacity: 0.9;  transform: translate3d(4px, -1px, 0);  clip-path: polygon(0 6%, 100% 6%, 100% 46%, 0 46%); }
  60%  { opacity: 0.8;  transform: translate3d(-3px, 0, 0);    clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%); }
  78%  { opacity: 0.5;  transform: translate3d(1px, 0, 0); }
  100% { opacity: 0;    transform: translate3d(0, 0, 0);       clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
}
@keyframes btn-shear-bot {
  0%   { opacity: 0;    transform: translate3d(2px, 0, 0);     clip-path: polygon(0 52%, 100% 52%, 100% 100%, 0 100%); }
  10%  { opacity: 0.95; transform: translate3d(9px, 1px, 0);   clip-path: polygon(0 80%, 100% 80%, 100% 100%, 0 100%); }
  22%  { opacity: 1;    transform: translate3d(-7px, -1px, 0); clip-path: polygon(0 46%, 100% 46%, 100% 86%, 0 86%); }
  34%  { opacity: 0.9;  transform: translate3d(6px, 0, 0);     clip-path: polygon(0 62%, 100% 62%, 100% 100%, 0 100%); }
  46%  { opacity: 0.85; transform: translate3d(-4px, 1px, 0);  clip-path: polygon(0 54%, 100% 54%, 100% 94%, 0 94%); }
  60%  { opacity: 0.75; transform: translate3d(3px, 0, 0);     clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%); }
  78%  { opacity: 0.45; transform: translate3d(-1px, 0, 0); }
  100% { opacity: 0;    transform: translate3d(0, 0, 0);       clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); }
}

/* Ambient flicker — reserved for the ghost "signal" button.
   Runs a long, mostly-idle loop with a short shear window so
   the effect reads as a dropped frame, not a constant tremor. */
.btn--flicker .btn__label::before {
  animation: btn-ambient-top 6s steps(10, end) infinite;
}
.btn--flicker .btn__label::after {
  animation: btn-ambient-bot 6s steps(10, end) infinite;
}
.btn--flicker:hover .btn__label::before,
.btn--flicker:focus-visible .btn__label::before {
  animation: btn-shear-top 0.6s steps(9, end) 1;
}
.btn--flicker:hover .btn__label::after,
.btn--flicker:focus-visible .btn__label::after {
  animation: btn-shear-bot 0.6s steps(9, end) 1;
}

@keyframes btn-ambient-top {
  0%, 84%, 100%  { opacity: 0;    transform: translate3d(-2px, 0, 0); }
  85%            { opacity: 1;    transform: translate3d(-7px, -1px, 0); clip-path: polygon(0 0, 100% 0, 100% 22%, 0 22%); }
  87%            { opacity: 0.85; transform: translate3d(5px, 0, 0);     clip-path: polygon(0 10%, 100% 10%, 100% 50%, 0 50%); }
  89%            { opacity: 0.9;  transform: translate3d(-4px, 1px, 0);  clip-path: polygon(0 0, 100% 0, 100% 34%, 0 34%); }
  91%            { opacity: 0.6;  transform: translate3d(2px, 0, 0); }
  93%            { opacity: 0;    transform: translate3d(-2px, 0, 0); }
}
@keyframes btn-ambient-bot {
  0%, 84%, 100%  { opacity: 0;    transform: translate3d(2px, 0, 0); }
  85%            { opacity: 0.95; transform: translate3d(7px, 1px, 0);    clip-path: polygon(0 78%, 100% 78%, 100% 100%, 0 100%); }
  87%            { opacity: 0.8;  transform: translate3d(-5px, 0, 0);     clip-path: polygon(0 50%, 100% 50%, 100% 90%, 0 90%); }
  89%            { opacity: 0.85; transform: translate3d(4px, -1px, 0);   clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%); }
  91%            { opacity: 0.55; transform: translate3d(-2px, 0, 0); }
  93%            { opacity: 0;    transform: translate3d(2px, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .btn__label::before,
  .btn__label::after { display: none; }
}

/* ============================================================
   DOCTRINE LEDGER
   A numbered manifest of articles — not blocks. Hairline rules
   replace card frames; a left-edge tick animates on hover.
   ============================================================ */

.doctrine-ledger {
  list-style: none;
  position: relative;
  border-top: 1px solid var(--surface-line);
}

.doctrine-row {
  position: relative;
  padding: 1.75rem 0 1.75rem 1.25rem;
  border-bottom: 1px solid var(--surface-line);
  transition: padding-left 0.4s var(--ease), background 0.4s var(--ease);
}
.doctrine-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2.1rem;
  width: 10px;
  height: 1px;
  background: var(--ink);
  opacity: 0.55;
  transition: width 0.4s var(--ease), opacity 0.4s var(--ease);
}
.doctrine-row::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ink);
  opacity: 0;
  transform: scaleY(0.2);
  transform-origin: top;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
@media (hover: hover) {
  .doctrine-row:hover {
    padding-left: 1.75rem;
    background: linear-gradient(90deg, rgba(255, 75, 10, 0.045), transparent 45%);
  }
  .doctrine-row:hover::before {
    width: 22px;
    opacity: 1;
  }
  .doctrine-row:hover::after {
    opacity: 0.5;
    transform: scaleY(1);
  }
  .doctrine-row:hover .doctrine-row__title { color: var(--ink); }
}

.doctrine-row__meta {
  margin-bottom: 0.9rem;
}

.doctrine-row__idx {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink);
  letter-spacing: 0.25em;
  margin-bottom: 0.55rem;
}

.doctrine-row__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bone);
  line-height: 1.15;
  transition: color 0.35s var(--ease);
}

.doctrine-row__body p {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--bone-dim);
  margin-bottom: 0.8rem;
  max-width: 62ch;
}
.doctrine-row__body p:last-child { margin-bottom: 0; }

.doctrine-row__stinger {
  color: var(--ink) !important;
  font-weight: 500;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--surface-line);
  margin-top: 0.55rem !important;
}

@media (min-width: 820px) {
  .doctrine-row {
    display: grid;
    grid-template-columns: minmax(200px, 24%) 1fr;
    column-gap: 3rem;
    align-items: start;
    padding: 2.5rem 0 2.5rem 1.5rem;
  }
  .doctrine-row::before { top: 2.85rem; }
  .doctrine-row__meta { margin-bottom: 0; }
  .doctrine-row__idx { margin-bottom: 0.7rem; }
  .doctrine-row__title { font-size: 1.5rem; }
}

/* ============================================================
   CLEARANCE
   ============================================================ */

.clearance-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .clearance-grid { grid-template-columns: 1fr 1fr; }
}

.clearance-block {
  position: relative;
  padding: 1.75rem;
  border: 1px dashed;
  background: rgba(0,0,0,0.3);
}
.clearance-block__readout {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--ash);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  opacity: 0.7;
}
.clearance-block__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
}
.clearance-block__status {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.clearance-block__blink {
  width: 8px; height: 8px;
  border-radius: 50%;
  animation: blink 1.4s var(--ease) infinite;
}
.clearance-block p {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--bone-dim);
  margin-bottom: 0.75rem;
}
.clearance-block p:last-child { margin-bottom: 0; }

.clearance-block--authorized {
  border-color: rgba(123, 220, 142, 0.45);
  background: linear-gradient(180deg, rgba(123, 220, 142, 0.06), transparent 70%), rgba(0,0,0,0.3);
}
.clearance-block--authorized .clearance-block__status { color: var(--go); text-shadow: 0 0 12px rgba(123, 220, 142, 0.35); }
.clearance-block--authorized .clearance-block__blink { background: var(--go); box-shadow: 0 0 12px var(--go); }

.clearance-block--denied {
  border-color: rgba(255, 58, 74, 0.45);
  background: linear-gradient(180deg, rgba(255, 58, 74, 0.06), transparent 70%), rgba(0,0,0,0.3);
}
.clearance-block--denied .clearance-block__status { color: var(--stop); text-shadow: 0 0 12px rgba(255, 58, 74, 0.35); }
.clearance-block--denied .clearance-block__blink { background: var(--stop); box-shadow: 0 0 12px var(--stop); }

@keyframes blink {
  0%, 60%, 100% { opacity: 1; }
  70%, 90%      { opacity: 0.2; }
}

/* ============================================================
   CONTACT
   ============================================================ */

.contact-card {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-top: 2px solid var(--ink);
  position: relative;
}
.contact-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 40px; height: 40px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

@media (min-width: 760px) {
  .contact-card {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    padding: 3rem;
    align-items: center;
  }
}

.contact-card__lead {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--bone-dim);
  margin-bottom: 1.75rem;
  max-width: 42ch;
}

.contact-card__fine {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--ash);
  text-transform: uppercase;
}

.contact-card__figure {
  position: relative;
  border: 1px solid var(--surface-line);
  overflow: hidden;
}
.contact-card__figure img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: contrast(1.05) saturate(0.9);
}
.contact-card__figure figcaption {
  position: absolute;
  left: 0; bottom: 0; right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--ink);
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem var(--gutter) 4rem;
  border-top: 1px solid var(--surface-line);
  text-align: center;
}
.site-footer__line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--ash);
  text-transform: uppercase;
}
.site-footer__sep { color: var(--ink); }
.site-footer__fine {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(138, 133, 119, 0.6);
  letter-spacing: 0.1em;
}

/* ============================================================
   MODAL — ARCHIVES
   ============================================================ */

.modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeBackdrop 0.3s var(--ease);
}

.modal__panel {
  position: relative;
  width: min(100%, 780px);
  max-height: min(85vh, 720px);
  background: var(--void-2);
  border: 1px solid var(--ink);
  box-shadow: 0 0 60px var(--ink-glow), inset 0 0 30px rgba(255, 75, 10, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.4s var(--ease);
  clip-path: polygon(
    0 12px, 12px 0,
    calc(100% - 12px) 0, 100% 12px,
    100% calc(100% - 12px), calc(100% - 12px) 100%,
    12px 100%, 0 calc(100% - 12px)
  );
}

.modal__scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom, transparent 0 2px, rgba(255, 75, 10, 0.04) 2px 3px
  );
  pointer-events: none;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  color: var(--ink);
  text-transform: uppercase;
  background: rgba(255, 75, 10, 0.05);
}

.modal__close {
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.modal__close:hover,
.modal__close:focus-visible {
  border-color: var(--ink);
  background: rgba(255, 75, 10, 0.1);
}

.modal__body {
  padding: 1.5rem 1.25rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  color: var(--bone);
  font-size: 0.9rem;
  line-height: 1.75;
  text-shadow: 0 0 8px rgba(255, 75, 10, 0.2);
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}
.modal__body::-webkit-scrollbar { width: 6px; }
.modal__body::-webkit-scrollbar-thumb { background: var(--ink); }

.log-menu__prompt {
  color: var(--ink);
  margin-bottom: 1rem;
}
.log-menu ul { list-style: none; display: grid; gap: 0.5rem; }
.log-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--bone);
  border: 1px solid transparent;
  border-left: 2px solid var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.log-link:hover,
.log-link:focus-visible {
  background: rgba(255, 75, 10, 0.08);
  color: var(--ink);
  padding-left: 1.4rem;
}

.term-text__back {
  display: inline-block;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink);
  letter-spacing: 0.15em;
  border-bottom: 1px dashed var(--ink-soft);
  padding-bottom: 2px;
}
.term-text__content {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--bone);
}
.term-text__content::after {
  content: '▊';
  display: inline;
  color: var(--ink);
  animation: caret 1s steps(1) infinite;
}

@keyframes fadeBackdrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes caret {
  50% { opacity: 0; }
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger doctrine cards */
.doctrine-ledger .reveal:nth-child(1) { transition-delay: 0s; }
.doctrine-ledger .reveal:nth-child(2) { transition-delay: 0.08s; }
.doctrine-ledger .reveal:nth-child(3) { transition-delay: 0.16s; }
.doctrine-ledger .reveal:nth-child(4) { transition-delay: 0.24s; }
.doctrine-ledger .reveal:nth-child(5) { transition-delay: 0.32s; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */

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