/* ============================================================
   VALLUM landing page
   Theme: dark-locked (basalt + bronze). Single accent: --accent.
   Radius system: panels/terminals 10px, buttons/chips/tabs 8px.
   Fonts: Cinzel (display), Geist (body), JetBrains Mono (code).
   ============================================================ */

@font-face {
  font-family: 'Cinzel';
  src: url('fonts/cinzel.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('fonts/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrainsmono.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark; /* UA-drawn scrollbars and controls render their dark variant */
  --bg0: #0c0b09;
  --bg1: #14110c;
  --bg2: #1a160f;
  --line: #262117;
  --line-strong: #383021;
  --text: #ece7dc;
  --text2: #b5aea0;
  --text3: #8b8376; /* ≥4.8:1 on every panel bg — AA for small text */
  --accent: #c9a24d;
  --accent-bright: #ddb968;
  --accent-dim: rgba(201, 162, 77, 0.16);
  --green: #8fb573;
  --red: #c9705f;
  --radius-panel: 10px;
  --radius-ctl: 8px;
  /* one elevation for every raised panel: warm soft drop + hairline top light */
  --shadow-panel: 0 22px 44px -20px rgba(0, 0, 0, 0.55),
                  inset 0 1px 0 rgba(236, 231, 220, 0.04);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Cinzel', 'Times New Roman', serif;
  --wrap: 1320px;
}

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

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar { height: 6px; width: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
*::-webkit-scrollbar-track { background: transparent; }

/* code boxes swipe/wheel-scroll horizontally; their commands are fully
   carried by the Copy buttons, so the bars are pure noise on the dark set */
.term-body, .evidence, .feed-body, .plinth-cmd pre {
  scrollbar-width: none;
}
.term-body::-webkit-scrollbar,
.evidence::-webkit-scrollbar,
.feed-body::-webkit-scrollbar,
.plinth-cmd pre::-webkit-scrollbar { display: none; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle warm light from above, very low key */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(201, 162, 77, 0.09), transparent 65%),
    radial-gradient(700px 700px at 0% 110%, rgba(201, 162, 77, 0.05), transparent 60%);
  pointer-events: none;
}

/* film grain: fixed, non-interactive, above everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

::selection { background: var(--accent-dim); color: var(--text); }

a:focus-visible, button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 30;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: var(--radius-ctl);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- patrol rail ---------- */

.patrol {
  position: fixed; z-index: 20;
  left: 1.6rem; top: 50%; transform: translateY(-50%);
  height: min(60vh, 34rem);
  display: flex; flex-direction: column; justify-content: space-between;
  align-items: center;
}
.patrol-track {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; transform: translateX(-50%);
  background:
    repeating-linear-gradient(180deg, var(--line-strong) 0 10px, transparent 10px 16px);
}
.patrol-fill {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: var(--accent);
  transform-origin: top; transform: scaleY(0);
  box-shadow: 0 0 8px rgba(201, 162, 77, 0.5);
}
html:not(.gsap) .patrol-fill { display: none; }
.waypoint {
  position: relative; z-index: 1;
  font-family: var(--display); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-decoration: none;
  color: var(--text3); background: var(--bg0);
  padding: 0.3rem 0.1rem;
  transition: color 0.3s;
}
.waypoint.active { color: var(--accent-bright); }
.waypoint:hover { color: var(--text); }
@media (max-width: 1099px) { .patrol { display: none; } }

code { font-family: var(--mono); }

h1, h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.18;
  color: var(--text);
}

h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); }

.scene-head { max-width: var(--wrap); margin: 0 auto; padding: 0 2rem; }
.section-sub { color: var(--text2); max-width: 34rem; margin-top: 0.9rem; }

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

section {
  max-width: var(--wrap);
  margin: 0 auto;
  scroll-margin-top: 68px;
}

/* ---------- buttons & chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius-ctl);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-bright); }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  width: 100%;
  background: color-mix(in srgb, var(--bg0) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  height: 68px;
  padding: 0 2rem;
  max-width: var(--wrap);
  margin: 0 auto;
}

/* reading progress along the rampart (scroll-driven, no JS) */
@supports (animation-timeline: scroll()) {
  .nav::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 2px;
    width: 100%;
    background: var(--accent);
    opacity: 0.65;
    transform: scaleX(0);
    transform-origin: left;
    animation: nav-progress linear both;
    animation-timeline: scroll(root);
  }
  @keyframes nav-progress {
    to { transform: scaleX(1); }
  }
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.7rem;
  margin-left: auto;
}
.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 8rem 2rem 6rem;
  overflow: hidden;
}
.hero-copy { position: relative; z-index: 2; max-width: 54rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.12; }
.hero-sub { margin: 1.4rem auto 2.2rem; max-width: 36rem; color: var(--text2); font-size: 1.1rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* the carved inscription behind the hero */
.inscription {
  position: absolute; inset: 0; z-index: 0;
  display: grid; place-content: center;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(6rem, 22vw, 22rem);
  letter-spacing: 0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 162, 77, 0.22);
  user-select: none; pointer-events: none;
}
@supports not (-webkit-text-stroke: 1px black) {
  .inscription { color: rgba(201, 162, 77, 0.09); }
}

/* rising bronze embers over the wall at night */
.embers {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.descend {
  position: absolute; left: 50%; bottom: 2.2rem; transform: translateX(-50%);
  width: 2rem; height: 3.4rem; z-index: 2;
}
.descend-line {
  display: block; width: 1px; height: 100%; margin: 0 auto;
  background: linear-gradient(to bottom, transparent, var(--accent));
}
html.gsap .descend-line { animation: descend-pulse 2.4s ease-in-out infinite; }
@keyframes descend-pulse {
  0%, 100% { transform: scaleY(0.65); transform-origin: top; opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

.install-chip {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line-strong);
  background: var(--bg1);
  border-radius: var(--radius-ctl);
  padding: 0.62rem 0.95rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.install-chip:hover { border-color: var(--accent); }
/* bronze sheen sweep on hover */
.install-chip::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -45%;
  width: 35%;
  background: linear-gradient(100deg, transparent, rgba(221, 185, 104, 0.16), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
  pointer-events: none;
}
.install-chip:hover::before { left: 115%; }
.chip-prompt { color: var(--accent); }
.chip-copy {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--text3);
  border-left: 1px solid var(--line-strong);
  padding-left: 0.65rem;
  transition: color 0.2s ease;
}
.install-chip:hover .chip-copy { color: var(--accent-bright); }

/* ---------- hero terminal demo ---------- */

.term {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.term-bar {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.term-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text3);
}
.term-body {
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
  overflow-y: hidden;
}
/* lines are block-level spans; collapse the literal newlines between them */
.term-body code { display: block; white-space: normal; }

.tl { display: block; white-space: pre-wrap; word-break: break-word; }

.t-prompt { color: var(--accent); }
.t-dim { color: var(--text3); }
.t-err { color: var(--red); }
.t-leak { color: #d8b58a; }
.t-inject { color: var(--red); font-style: italic; }
.t-marker { color: var(--text3); }
.t-redact { color: var(--accent-bright); }
.t-neutral { color: var(--green); }

/* ---------- scene I: the demonstration (pinned sweep) ---------- */

.scene-demo { padding: 9rem 0; }
.demo-stage { max-width: 62rem; margin: 3.5rem auto 0; padding: 0 2rem; }
.term-stage { box-shadow: var(--shadow-panel); }
.term-layers { position: relative; }
.tok-live { margin-left: auto; font-family: var(--mono); font-size: 0.78rem; color: var(--text3); }
.tok-live .tok-n { color: var(--accent-bright); }

/* static: raw block, crenellated divider, clean block — all readable */
.layer-divider {
  display: flex; align-items: center; justify-content: center;
  height: 2.2rem; position: relative;
  background:
    repeating-linear-gradient(90deg, var(--accent-dim) 0 18px, transparent 18px 30px)
    center / 100% 6px no-repeat;
}
.layer-divider span {
  font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.35em;
  color: var(--accent); background: var(--bg2); padding: 0 1rem; text-transform: uppercase;
}

/* gsap mode: clean layer overlays raw, revealed by the sweep */
html.gsap .term-layers { --sweep: 0; }
html.gsap .layer-divider { display: none; }
html.gsap .layer-clean {
  position: absolute; inset: 0;
  background: var(--bg2);
  clip-path: inset(0 calc(100% - var(--sweep) * 1%) 0 0);
}
html.gsap .sweep {
  position: absolute; top: 0; bottom: 0; left: calc(var(--sweep) * 1%);
  width: 14px; margin-left: -7px;
  background:
    repeating-linear-gradient(180deg, var(--accent) 0 14px, transparent 14px 24px)
    center / 4px 100% no-repeat;
  filter: drop-shadow(0 0 12px rgba(201, 162, 77, 0.5));
  opacity: 0;
}
html.gsap .term-layers.sweeping .sweep { opacity: 1; }
.sweep { display: none; }
html.gsap .sweep { display: block; }

@media (max-width: 899px) {
  html.gsap .layer-clean { position: static; clip-path: none; background: none; }
  html.gsap .layer-divider { display: flex; }
  html.gsap .sweep { display: none; }
}

/* ---------- threats: three indictments ---------- */

.threats { max-width: var(--wrap); margin: 0 auto; padding: 9rem 2rem; }
.threats .scene-head { padding: 0; } /* parent already provides the gutter */
.indictment {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 3rem 5rem;
  align-items: center;
  padding: 6rem 0;
  border-top: 1px solid var(--line);
}
.indictment:first-of-type { margin-top: 4rem; }
.ind-2 .ind-text { order: 2; }
.ind-2 .evidence { order: 1; }
.ind-3 { grid-template-columns: 1fr; text-align: center; }
.ind-3 .ind-body { margin: 0 auto; }

.ind-numeral {
  position: absolute; top: 2.4rem; right: 0;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(5rem, 11vw, 10rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(201, 162, 77, 0.18);
  pointer-events: none; user-select: none;
}
.ind-2 .ind-numeral { right: auto; left: 0; }
.ind-3 .ind-numeral { position: static; display: block; margin-bottom: 0.5rem; }

.ind-head {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.1;
  letter-spacing: 0.01em; color: var(--text);
}
.ind-body { max-width: 30rem; margin-top: 1.2rem; color: var(--text2); }

/* evidence: mono lines on bare page, bronze left tick only */
.evidence {
  border-left: 2px solid var(--accent-dim);
  padding: 0.4rem 0 0.4rem 1.4rem;
  font-family: var(--mono); font-size: 0.85rem; line-height: 1.75;
  overflow-x: auto; overflow-y: hidden; white-space: pre;
}
.ind-figure { margin-top: 2rem; }
.big-num {
  display: block; font-family: var(--mono); font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 5rem); color: var(--accent-bright);
}
.fig-arrow { color: var(--text3); }
.figure-note { color: var(--text3); font-size: 0.9rem; }

@media (max-width: 899px) {
  .indictment { grid-template-columns: 1fr; padding: 4rem 0; }
  .ind-2 .ind-text { order: 1; }
  .ind-2 .evidence { order: 2; }
  .ind-numeral { font-size: 4.5rem; top: 1.4rem; }
}

/* ---------- pipeline / wall: Scene II, the six gates ---------- */

.scene-gates { padding: 9rem 0; }
.gates-stage { max-width: var(--wrap); margin: 3.5rem auto 0; padding: 0 2rem; }

.gate-rail {
  list-style: none; counter-reset: gate;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem;
  border-top: 1px solid var(--line-strong); padding-top: 1.2rem;
}
.gate-station { position: relative; }
.gate-station::before {
  counter-increment: gate; content: counter(gate, upper-roman);
  display: block; font-family: var(--display); font-size: 0.8rem;
  letter-spacing: 0.25em; color: var(--text3); margin-bottom: 0.35rem;
}
.station-name {
  display: block; font-family: var(--display); font-size: 0.95rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text2);
}
.station-note { display: block; margin-top: 0.4rem; font-size: 0.8rem; color: var(--text3); }

/* in gsap mode stations show names only; notes are the static fallback detail */
html.gsap .station-note { display: none; }
html.gsap .gate-station { opacity: 0.38; transition: opacity 0.3s; }

.gate-feed { margin: 3rem auto 0; max-width: 56rem; }
.feed-body {
  font-family: var(--mono); font-size: 0.88rem; line-height: 1.9;
  overflow-x: auto;
  overflow-y: hidden;
  border-left: 2px solid var(--accent-dim); padding-left: 1.4rem;
}
/* lines are block-level spans; collapse the literal newlines between them */
.feed-body code { display: block; white-space: normal; }
.fl { display: block; white-space: pre; transition: opacity 0.4s; }
.ansi { color: var(--text3); transition: opacity 0.4s; }
.fl-wrap { color: var(--accent); }

/* one-line mutation states. Default markup ships data-step="6" (end state). */
.gates-stage:not([data-step="0"]) .ansi { opacity: 0; font-size: 0; }
.gates-stage[data-step="2"] .fl-noise,
.gates-stage[data-step="3"] .fl-noise,
.gates-stage[data-step="4"] .fl-noise,
.gates-stage[data-step="5"] .fl-noise,
.gates-stage[data-step="6"] .fl-noise { display: none; }
.gates-stage[data-step="0"] .fl-note-trunc,
.gates-stage[data-step="1"] .fl-note-trunc { display: none; }
.gates-stage[data-step="3"] .fl-warn,
.gates-stage[data-step="4"] .fl-warn,
.gates-stage[data-step="5"] .fl-warn,
.gates-stage[data-step="6"] .fl-warn { display: none; }
.gates-stage[data-step="0"] .fl-note-opt,
.gates-stage[data-step="1"] .fl-note-opt,
.gates-stage[data-step="2"] .fl-note-opt { display: none; }
.fl-note-trunc, .fl-note-opt { color: var(--text3); font-style: italic; }

.sec-raw, .inj-raw { transition: opacity 0.3s; }
.sec-redacted, .inj-neutral { display: none; }
.gates-stage[data-step="4"] .sec-raw,
.gates-stage[data-step="5"] .sec-raw,
.gates-stage[data-step="6"] .sec-raw { display: none; }
.gates-stage[data-step="4"] .sec-redacted,
.gates-stage[data-step="5"] .sec-redacted,
.gates-stage[data-step="6"] .sec-redacted { display: inline; }
.gates-stage[data-step="5"] .inj-raw,
.gates-stage[data-step="6"] .inj-raw { display: none; }
.gates-stage[data-step="5"] .inj-neutral,
.gates-stage[data-step="6"] .inj-neutral { display: inline; }
.gates-stage:not([data-step="6"]) .fl-wrap { opacity: 0; }

/* captions: gsap-only, one visible at a time, pinned-scene widths only */
.gate-captions { display: none; }
@media (min-width: 900px) {
  html.gsap .gate-captions { display: block; margin-top: 2rem; min-height: 1.6em; position: relative; }
}
.gate-caption {
  position: absolute; inset: 0; text-align: center;
  color: var(--text2); opacity: 0; transition: opacity 0.3s;
  font-size: 0.95rem;
}
.gates-stage[data-step="0"] .gate-caption[data-for="0"],
.gates-stage[data-step="1"] .gate-caption[data-for="1"],
.gates-stage[data-step="2"] .gate-caption[data-for="2"],
.gates-stage[data-step="3"] .gate-caption[data-for="3"],
.gates-stage[data-step="4"] .gate-caption[data-for="4"],
.gates-stage[data-step="5"] .gate-caption[data-for="5"],
.gates-stage[data-step="6"] .gate-caption[data-for="6"] { opacity: 1; }

.pipeline-note { max-width: var(--wrap); margin: 3.5rem auto 0; padding: 0 2rem; color: var(--text3); }

@media (max-width: 899px) {
  .gate-rail { grid-template-columns: 1fr; gap: 1.6rem; border-top: 0; }
  .gate-station { border-top: 1px solid var(--line); padding-top: 1rem; }
}

/* ---------- optimizer marquee ---------- */

.optimizer-marquee {
  margin-top: 4.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.05rem 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
}
.mq-set {
  display: flex;
  align-items: center;
  gap: 3.2rem;
  padding-right: 3.2rem;
}
.mq-item {
  display: flex;
  align-items: center;
  gap: 3.2rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--text3);
  white-space: nowrap;
}
/* merlon block as separator */
.mq-item::after {
  content: '';
  width: 12px;
  height: 6px;
  background: var(--accent);
  opacity: 0.3;
}
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marquee 32s linear infinite; }
  @keyframes marquee {
    to { transform: translateX(-50%); }
  }
}
.pipeline-note code {
  font-size: 0.82rem;
  color: var(--text2);
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

/* ---------- guardrail ---------- */

.guardrail {
  max-width: var(--wrap); margin: 0 auto; padding: 9rem 2rem;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 4rem; align-items: center;
}
.guard-copy p { max-width: 30rem; margin-top: 1.2rem; color: var(--text2); }
.ledger-row {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.5rem 0.2rem; border-bottom: 1px solid var(--line);
}
.ledger-row:first-child { border-top: 1px solid var(--line); }
.ledger-cmd { font-family: var(--mono); font-size: 0.95rem; color: var(--text); }
.seal {
  font-family: var(--display); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase;
  border: 1.5px solid currentColor; border-radius: 999px;
  padding: 0.45rem 1.1rem 0.4rem 1.35rem;
  transform: rotate(-4deg);
}
.seal-allow { color: var(--green); }
.seal-ask { color: var(--accent-bright); }
.seal-deny { color: var(--red); }
.ledger-caption { margin-top: 1.4rem; color: var(--text3); font-size: 0.9rem; }
@media (max-width: 899px) { .guardrail { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ---------- motto ---------- */

.motto { text-align: center; padding: 8rem 2rem; }
.motto-latin {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 3rem);
  letter-spacing: 0.12em; color: var(--text);
  text-wrap: balance;
  transition: letter-spacing 1.1s ease, opacity 1.1s ease;
}
.motto-hl { color: var(--accent-bright); }
.motto-en { margin-top: 1rem; color: var(--text3); }
html.gsap .motto-latin:not(.in) { letter-spacing: 0.02em; opacity: 0; }

/* ---------- install ---------- */

.install { max-width: var(--wrap); margin: 0 auto; padding: 9rem 2rem; text-align: center; }
.install .section-sub { margin-left: auto; margin-right: auto; }

.plinth {
  position: relative; max-width: 56rem; margin: 3.5rem auto 0;
  background: var(--bg1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 1.6rem 1.8rem 1.8rem;
}
/* stage light above the plinth */
.plinth::before {
  content: ''; position: absolute; left: 15%; right: 15%; top: -90px; height: 90px;
  background: radial-gradient(60% 100% at 50% 100%, rgba(201, 162, 77, 0.13), transparent 75%);
  pointer-events: none;
}
.method-switch { display: flex; gap: 0.4rem; justify-content: center; margin-bottom: 1.4rem; }
.method {
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 0.85rem; color: var(--text3);
  padding: 0.4rem 0.9rem; border-bottom: 1px solid transparent;
}
.method + .method::before { content: '·' / ''; margin-right: 1.1rem; color: var(--line-strong); }
.method.active { color: var(--accent-bright); border-bottom-color: var(--accent); }
.method:hover { color: var(--text); }

.plinth-cmd { display: none; align-items: center; gap: 1rem; }
.plinth-cmd.active { display: flex; }
.plinth-cmd pre {
  flex: 1; text-align: left; overflow-x: auto; overflow-y: hidden;
  font-family: var(--mono); font-size: 0.85rem; line-height: 1.6;
  white-space: pre; color: var(--text);
}

.copy-btn {
  flex-shrink: 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--text3);
  background: var(--bg2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.copy-btn:hover { color: var(--accent-bright); border-color: var(--accent); }

.verify-passage { max-width: 44rem; margin: 3rem auto 0; text-align: left; color: var(--text2); }
.verify-passage .evidence { margin-top: 1.2rem; }
.hook-passage {
  max-width: 44rem; margin: 4rem auto 0; text-align: left;
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2.5rem; align-items: center;
  border-top: 1px solid var(--line); padding-top: 2.5rem;
}
.hook-text p { color: var(--text2); margin-top: 0.6rem; }
.hook-code { font-family: var(--mono); font-size: 0.95rem; }
.install-note { max-width: 44rem; margin: 3rem auto 0; color: var(--text3); font-size: 0.9rem; }
.install-note code {
  font-size: 0.8rem;
  color: var(--text2);
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}
@media (max-width: 700px) {
  .hook-passage { grid-template-columns: 1fr; }
  .plinth-cmd { flex-direction: column; align-items: stretch; }
  /* the plain-text switch overflows the plinth's own border at narrow
     widths when kept to one line (flex items won't shrink below their
     content); wrap it instead of letting labels spill past the card */
  .method-switch { flex-wrap: wrap; row-gap: 0.5rem; }
}

/* ---------- footer ---------- */

.footer {
  margin-top: 7rem;
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

/* monumental bookend: the inscription sinks below the page edge */
.footer-inscription {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(4.5rem, 15vw, 12.5rem);
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  line-height: 0.78;
  text-align: center;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 162, 77, 0.11);
  transform: translateY(0.16em);
  margin-top: 2.5rem;
  pointer-events: none;
  user-select: none;
}
@supports not (-webkit-text-stroke: 1px black) {
  .footer-inscription { color: rgba(201, 162, 77, 0.05); }
}
/* crenellation over the footer border: closing echo of the wall motif */
.footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 60vw);
  height: 6px;
  background: repeating-linear-gradient(90deg,
    var(--accent) 0 14px,
    transparent 14px 24px);
  opacity: 0.4;
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 3.5rem 2rem 3rem;
}

.etymology {
  color: var(--text2);
  font-size: 0.95rem;
  max-width: 52ch;
}
.etym-word {
  font-family: var(--display);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.footer-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.2rem;
}
.footer-links { display: flex; gap: 1.6rem; }
.footer-links a {
  color: var(--text3);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--accent-bright); }
.footer-license { color: var(--text3); font-size: 0.85rem; }

/* ---------- responsive ---------- */

@media (max-width: 768px) {
  .nav-inner { padding: 0 1.25rem; gap: 1.2rem; }
  /* keep the one anchor that matters in the thumb's reach of a decision:
     Install stays, the wayfinding links collapse */
  .nav-links { gap: 1.1rem; }
  .nav-links a:not(.nav-install) { display: none; }
  .footer-inner { padding: 3rem 1.25rem 2.5rem; }
  .scene-demo, .scene-gates { padding: 5rem 0; }
  .threats, .guardrail, .motto, .install { padding: 5rem 1.25rem; }
  .motto { padding-top: 5.5rem; }
  .optimizer-marquee { margin-top: 3rem; }
}
