/* SafeGrid: site design system.
   Colour carries meaning: scan = scanning / normal, flag = flagged,
   risk = high-risk or confirmed. The hero scanner lives in scan-banner.css. */

@font-face {
  font-family: "Archivo SG";
  src: url("fonts/archivo-wdth-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans SG";
  src: url("fonts/source-sans-3-wght.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono SG";
  src: url("fonts/jetbrains-mono-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Tokens */
  --ink: #07090c;
  --slate: #3b4a5c;
  --bone: #ece7dc;
  --scan: #78aaff;
  --flag: #ffb23e;
  --risk: #ff3b3b;

  /* Derived */
  --bone-2: rgba(236, 231, 220, 0.76);
  --bone-3: rgba(236, 231, 220, 0.6);
  --line: rgba(59, 74, 92, 0.7);
  --line-soft: rgba(59, 74, 92, 0.4);
  --panel: rgba(7, 9, 12, 0.84);
  --scan-wash: rgba(120, 170, 255, 0.1);
  --flag-wash: rgba(255, 178, 62, 0.16);
  --risk-wash: rgba(255, 59, 59, 0.16);
  --risk-text: #ff6b6b; /* risk, lifted for small text */

  --display: "Archivo SG", "Archivo", ui-sans-serif, system-ui, sans-serif;
  --body: "Source Sans SG", "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono SG", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--bone-2);
  background: var(--ink);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--scan);
}

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--bone);
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.025em;
}

p {
  margin: 0;
}

.signal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 14px 18px;
  background: var(--scan);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 9, 12, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: var(--nav-h);
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  line-height: 0;
}

.brand-logo {
  width: auto;
  height: 38px;
}

.site-nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.site-nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--bone-2);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"] {
  color: var(--bone);
}

.nav-ind {
  position: absolute;
  left: 0;
  bottom: 2px;
  height: 2px;
  width: 0;
  background: var(--scan);
  box-shadow: 0 0 10px rgba(120, 170, 255, 0.8);
  transition:
    transform 0.45s var(--ease),
    width 0.45s var(--ease),
    opacity 0.2s ease;
  pointer-events: none;
}

.site-nav .btn {
  margin-left: 10px;
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  overflow: hidden;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid;
  border-radius: 0;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.btn-primary {
  background: var(--scan);
  border-color: var(--scan);
  color: var(--ink);
}

.btn-primary:hover {
  background: #9cc0ff;
  border-color: #9cc0ff;
}

/* Scan effect: a beam passes across on hover */
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.55) 70%,
    rgba(255, 255, 255, 0.9) 72%,
    transparent 74%
  );
  transform: translateX(-120%);
  pointer-events: none;
}

.btn:hover::after,
.btn:focus-visible::after {
  animation: btn-scan 0.75s var(--ease);
}

.btn-ghost::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(120, 170, 255, 0.22) 70%,
    rgba(120, 170, 255, 0.9) 72%,
    transparent 74%
  );
}

@keyframes btn-scan {
  to {
    transform: translateX(260%);
  }
}

.btn-ghost {
  background: rgba(7, 9, 12, 0.6);
  border-color: var(--slate);
  color: var(--bone);
}

.btn-ghost:hover {
  border-color: var(--scan);
}

.btn-sm {
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
}

/* ---------- Type helpers ---------- */

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-2);
}

.kicker::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--scan);
}

.lead {
  max-width: 60ch;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.6;
  color: var(--bone-2);
}

.h2 {
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.02;
  max-width: 18ch;
}

.body-copy {
  max-width: 56ch;
  margin-top: 22px;
  font-size: 19px;
  line-height: 1.65;
}

.sample-tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--bone-3);
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---------- Sections and gutter labels ---------- */

.section {
  position: relative;
  padding-block: clamp(72px, 8.5vw, 124px);
}

.sec-grid {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0 clamp(16px, 3vw, 40px);
}

.sec-label {
  align-self: start;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin: 0;
  padding-bottom: 4px;
  border-right: 1px solid var(--scan);
  font-family: var(--body);
  font-size: 14px;
  font-stretch: 100%;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bone);
  line-height: 1;
  padding-right: 10px;
}

.sec-head {
  margin-bottom: clamp(36px, 5vw, 64px);
}

/* ---------- Hero ---------- */

.hero {
  padding-top: clamp(16px, 2.4vw, 32px);
}

.hero-scene .sg-scan-banner,
.page-scene .sg-scan-banner {
  margin: 0;
  border-radius: 0;
  border-color: var(--line);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.7),
    inset 0 0 60px rgba(120, 170, 255, 0.06);
}

.sg-scan-banner__title {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
}

.sg-scan-banner__sub {
  font-family: var(--body);
}

/* Home: the scanner grows into the scene, a transcript runs beside it */
.hero-scene .sg-scan-banner {
  height: clamp(340px, 33vw, 470px);
  justify-content: flex-start;
}

.hero-scene .sg-scan-banner__radar {
  left: 4%;
  width: min(380px, 27vw);
  height: min(380px, 27vw);
}

.hero-scene .sg-scan-banner__center {
  margin-left: calc(4% + min(380px, 27vw));
  width: calc(100% - 4% - min(380px, 27vw) - 40%);
  padding: 0 16px;
}

.page-scene .sg-scan-banner {
  height: clamp(260px, 28vw, 400px);
}

.page-scene .sg-scan-banner__radar {
  width: min(300px, 30vw);
  height: min(300px, 30vw);
}

.tx-panel {
  position: absolute;
  top: 7%;
  bottom: 7%;
  right: 3%;
  width: 36%;
  z-index: 2;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(5, 8, 13, 0.92), rgba(5, 8, 13, 0.72));
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}

.tx-track {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: 0;
  will-change: transform;
}

.tx-line {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 18px;
  opacity: 0.32;
  filter: blur(1.4px);
  transition:
    opacity 0.5s ease,
    filter 0.5s ease;
}

.tx-line.is-b {
  padding-left: 54px;
}

.tx-line.is-read {
  opacity: 1;
  filter: none;
}

.tx-dot {
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--slate);
}

.tx-line.is-b .tx-dot {
  background: transparent;
  border: 1px solid var(--slate);
}

.tx-bar {
  height: 7px;
  flex: none;
  background: rgba(236, 231, 220, 0.24);
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

.tx-line.is-read.is-flag .tx-bar.k {
  background: var(--flag);
  box-shadow: 0 0 12px rgba(255, 178, 62, 0.5);
}

.tx-line.is-read.is-risk .tx-bar.k {
  background: var(--risk);
  box-shadow: 0 0 14px rgba(255, 59, 59, 0.6);
}

.tx-tag {
  position: relative;
  z-index: 1;
  background: var(--ink);
  margin-left: auto;
  padding: 3px 7px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--bone-2);
  border: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.tx-line.is-read .tx-tag {
  opacity: 1;
}

.tx-line.is-read.is-flag .tx-tag {
  color: var(--flag);
  border-color: rgba(255, 178, 62, 0.6);
}

.tx-line.is-read.is-risk .tx-tag {
  color: var(--risk-text);
  border-color: rgba(255, 59, 59, 0.7);
}

.tx-scan {
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--scan) 30%, var(--scan) 70%, transparent);
  box-shadow: 0 0 16px rgba(120, 170, 255, 0.9);
  will-change: transform;
}

.tx-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 60px;
  background: linear-gradient(transparent, rgba(120, 170, 255, 0.1));
}

.hero-copy {
  padding: clamp(36px, 4vw, 56px) 0 clamp(64px, 8vw, 104px);
}

.hero-title {
  margin-top: 20px;
  font-size: clamp(38px, 5.25vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

/* Hidden until the scramble starts; revealed anyway if the script never runs */
.js .hero-title[data-scramble] {
  visibility: hidden;
  animation: scramble-failsafe 0s linear 1.6s forwards;
}

.js .hero-title.is-scrambling,
.js .hero-title.is-marked {
  visibility: visible;
  animation: none;
}

@keyframes scramble-failsafe {
  to {
    visibility: visible;
  }
}

.hero-title .ln {
  display: block;
}

.hero-title .w {
  display: inline-block;
  white-space: nowrap;
}

.hero-title .c {
  display: inline-block;
  text-align: center;
}

.hero-title .c.is-noise {
  color: var(--scan);
  opacity: 0.75;
}

.hl {
  background-image: linear-gradient(
    transparent 56%,
    rgba(255, 178, 62, 0.36) 56%,
    rgba(255, 178, 62, 0.36) 90%,
    transparent 90%
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transition: background-size 0.7s var(--ease);
}

.js .hero-title .hl {
  background-size: 0% 100%;
}

.js .hero-title.is-marked .hl {
  background-size: 100% 100%;
}

.hero-sub {
  display: grid;
  grid-template-columns: minmax(0, 60ch) auto;
  justify-content: space-between;
  align-items: end;
  gap: 32px 48px;
  margin-top: 40px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- What Zero hunts: expanding panels ---------- */

.hunts {
  display: flex;
  gap: 12px;
  height: 480px;
}

.hunt {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    flex-grow 0.7s var(--ease),
    border-color 0.4s ease;
}

.hunt.is-active {
  flex-grow: 3.2;
  border-color: rgba(120, 170, 255, 0.5);
}

.hunt h3 {
  font-size: inherit;
}

.hunt-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 28px 28px 20px;
  background: none;
  border: 0;
  color: var(--bone);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.hunt-name {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--bone);
}

.tag-main {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-2);
  border: 1px solid var(--slate);
}

.hunt-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 22px;
  min-width: 440px;
  padding: 0 28px 28px;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.hunt.is-active .hunt-body {
  opacity: 1;
  transition-delay: 0.2s;
}

.hunt-body p {
  max-width: 44ch;
  font-size: 19px;
  color: var(--bone-2);
}

.hunt-art {
  width: 100%;
  max-width: 460px;
  max-height: 230px;
  overflow: visible;
}

.hunt::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 30px;
  height: 96px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(236, 231, 220, 0.14) 0 6px,
    transparent 6px 18px
  );
  -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent 85%);
  mask-image: linear-gradient(90deg, #000 30%, transparent 85%);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.hunt.is-active::after {
  opacity: 0;
}

.hunt:not(.is-active):hover {
  border-color: rgba(120, 170, 255, 0.4);
}

.art-line {
  fill: none;
  stroke: var(--scan);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.art-dim {
  fill: none;
  stroke: rgba(236, 231, 220, 0.3);
  stroke-width: 1;
}

.art-flag {
  fill: var(--flag-wash);
  stroke: var(--flag);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.art-risk {
  fill: var(--risk-wash);
  stroke: var(--risk);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.art-beam {
  fill: rgba(120, 170, 255, 0.08);
}

.art-trace {
  fill: none;
  stroke: var(--flag);
  stroke-width: 1.2;
}

.art-sector {
  fill: rgba(120, 170, 255, 0.14);
  stroke: var(--scan);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.art-tagbg {
  fill: var(--ink);
}

.art-text--risk {
  fill: var(--risk-text);
}

.art-sweepx {
  animation: art-sweepx 3.6s linear infinite;
}

@keyframes art-sweepx {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(296px);
  }
}

.flag-note {
  margin-top: 18px;
  font-size: 16px;
  color: var(--bone-3);
}

.art-text {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--bone-3);
  paint-order: stroke;
  stroke: var(--ink);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.art-text--flag {
  fill: var(--flag);
}

.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1s var(--ease) var(--d, 0s);
}

.is-active .draw,
.in-view .draw {
  stroke-dashoffset: 0;
}

.pop {
  opacity: 0;
  transition: opacity 0.45s ease var(--d, 0s);
}

.is-active .pop,
.in-view .pop {
  opacity: 1;
}

.loop {
  animation-play-state: paused;
}

.is-active .loop,
.in-view .loop {
  animation-play-state: running;
}

.art-sweep {
  animation: art-sweep 3.2s linear infinite;
}

@keyframes art-sweep {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(170px);
  }
}

.art-spin {
  transform-box: view-box;
  transform-origin: 160px 100px;
  animation: art-spin 5s linear infinite;
}

.art-spin-slow {
  transform-box: view-box;
  transform-origin: 160px 100px;
  animation: art-spin 11s linear infinite reverse;
}

@keyframes art-spin {
  to {
    transform: rotate(360deg);
  }
}

.art-blink {
  animation: art-blink 1.6s ease-in-out infinite;
}

@keyframes art-blink {
  50% {
    opacity: 0.25;
  }
}

/* ---------- Harm builds: pinned timeline ---------- */

.harm {
  height: 280vh;
  padding: 0;
}

.harm-sticky {
  position: sticky;
  top: var(--nav-h);
  display: flex;
  align-items: center;
  height: calc(100vh - var(--nav-h));
  min-height: 560px;
}

.harm-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  width: 100%;
}

.harm-scene {
  padding: clamp(18px, 2.4vw, 30px);
}

.harm-scene svg {
  display: block;
  width: 100%;
}

.harm-cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.hm-msg {
  fill: rgba(236, 231, 220, 0.08);
  stroke: rgba(236, 231, 220, 0.24);
  stroke-width: 1;
  opacity: 0;
  transform: translateX(var(--from, -14px));
  transform-box: fill-box;
  transition:
    opacity 0.4s ease,
    transform 0.5s var(--ease),
    fill 0.5s ease,
    stroke 0.5s ease;
}

.hm-msg.on {
  opacity: 1;
  transform: none;
}

.hm-msg.on.lvl-scan {
  fill: rgba(120, 170, 255, 0.14);
  stroke: var(--scan);
}

.hm-msg.on.lvl-flag {
  fill: var(--flag-wash);
  stroke: var(--flag);
}

.hm-msg.on.lvl-risk {
  fill: var(--risk-wash);
  stroke: var(--risk);
}

.hm-tag {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hm-tag.on {
  opacity: 1;
}

.hm-tag rect {
  fill: var(--ink);
  stroke-width: 1;
}

.hm-tag text {
  font-family: var(--mono);
  font-size: 11px;
}

.hm-tag.t-scan rect {
  stroke: var(--scan);
}
.hm-tag.t-scan text {
  fill: var(--scan);
}
.hm-tag.t-flag rect {
  stroke: var(--flag);
}
.hm-tag.t-flag text {
  fill: var(--flag);
}
.hm-tag.t-risk rect {
  stroke: var(--risk);
}
.hm-tag.t-risk text {
  fill: var(--risk);
}

.hm-curve {
  fill: none;
  stroke: url(#risk-gradient);
  stroke-width: 2.5;
  stroke-dasharray: 1;
  stroke-dashoffset: var(--p, 0);
}

.hm-area {
  fill: url(#risk-area);
  opacity: var(--a, 0.9);
}

.hm-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.hm-axis-label {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--bone-3);
}

/* ---------- Principles: the evidence card ---------- */

.evidence {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
}

.evidence-top {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.ev-finding {
  padding: clamp(22px, 3vw, 36px);
}

.ev-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.ev-head .mono {
  font-size: 13px;
  color: var(--bone-2);
}

.ev-status {
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--flag);
  border: 1px solid rgba(255, 178, 62, 0.6);
  transition:
    color 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease;
}

.ev-status[data-state="confirmed"] {
  color: var(--risk);
  border-color: rgba(255, 59, 59, 0.7);
  background: var(--risk-wash);
}

.ev-status[data-state="rejected"] {
  color: var(--scan);
  border-color: rgba(120, 170, 255, 0.6);
  background: var(--scan-wash);
}

.ev-quote {
  display: grid;
  gap: 12px;
  margin: 26px 0 22px;
}

.ev-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rx {
  display: inline-block;
  height: 14px;
  background: rgba(236, 231, 220, 0.2);
}

.rx.hit {
  position: relative;
  background: rgba(236, 231, 220, 0.2);
  box-shadow:
    0 0 0 3px var(--ink),
    0 0 0 4px var(--flag);
}

.rx.hit::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: rgba(255, 178, 62, 0.55);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.6s var(--ease) var(--d, 0s);
}

.in-view .rx.hit::before {
  transform: scaleX(1);
}

.evidence[data-decision="confirmed"] .rx.hit {
  box-shadow:
    0 0 0 3px var(--ink),
    0 0 0 4px var(--risk);
}

.evidence[data-decision="confirmed"] .rx.hit::before {
  background: rgba(255, 59, 59, 0.6);
}

.evidence[data-decision="rejected"] .rx.hit {
  box-shadow:
    0 0 0 3px var(--ink),
    0 0 0 4px var(--slate);
}

.evidence[data-decision="rejected"] .rx.hit::before {
  background: rgba(120, 170, 255, 0.25);
}

.ev-tagrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.stage-tag {
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--flag);
  border: 1px solid rgba(255, 178, 62, 0.55);
}

.callout {
  padding: 18px 0 0 18px;
  border-left: 2px solid var(--flag);
}

.callout h3,
.ev-audit h3 {
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.1;
}

.callout p,
.ev-audit > p {
  max-width: 52ch;
  margin-top: 8px;
  font-size: 18px;
}

.callout--human {
  border-left-color: var(--bone-3);
}

.ev-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.ev-buttons {
  display: flex;
  gap: 10px;
}

.btn-decide {
  min-height: 48px;
  padding: 0 22px;
  font-size: 15px;
}

.btn-confirm {
  background: rgba(7, 9, 12, 0.6);
  color: var(--risk);
  border-color: var(--risk);
}

.btn-confirm:hover,
.btn-confirm[aria-pressed="true"] {
  background: var(--risk);
  color: var(--ink);
}

.btn-reject {
  background: rgba(7, 9, 12, 0.6);
  color: var(--bone);
  border-color: var(--slate);
}

.btn-reject:hover,
.btn-reject[aria-pressed="true"] {
  border-color: var(--scan);
  color: var(--scan);
}

.ev-audit {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 32px);
}

.audit-log {
  flex: 1;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  border-top: 1px solid var(--line-soft);
}

.audit-log li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--bone-2);
}

.audit-log time {
  color: var(--scan);
}

.ev-audit .audit-hint {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bone-3);
}

.audit-log li.is-new {
  animation: audit-in 0.9s ease;
}

.audit-log li[data-kind="confirmed"] span {
  color: var(--risk);
}

@keyframes audit-in {
  from {
    background: rgba(120, 170, 255, 0.18);
  }
  to {
    background: transparent;
  }
}

.callout--env {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px 32px;
  padding: 26px clamp(22px, 3vw, 36px);
  border: 1px solid var(--line);
  border-left: 2px solid var(--scan);
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.callout--env p {
  margin: 0;
}

/* ---------- Built for: typographic rows ---------- */

.aud-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.aud-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(18px, 2.2vw, 28px) 4px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-stretch: 116%;
  font-weight: 800;
  font-size: clamp(24px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--bone);
  background: linear-gradient(90deg, rgba(7, 9, 12, 0.86), rgba(7, 9, 12, 0.6));
  outline-offset: -2px;
}

.aud-row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 220px;
  background: linear-gradient(90deg, transparent, rgba(120, 170, 255, 0.14));
  border-right: 1px solid var(--scan);
  transform: translateX(-240px);
  opacity: 0;
  pointer-events: none;
}

.aud-row:hover::after,
.aud-row:focus-visible::after {
  animation: row-scan 0.9s var(--ease) forwards;
}

@keyframes row-scan {
  0% {
    opacity: 1;
    transform: translateX(-240px);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(calc(100vw));
  }
}

.aud-icon {
  flex: none;
  width: clamp(30px, 3vw, 44px);
  height: clamp(30px, 3vw, 44px);
}

.aud-icon path,
.aud-icon rect,
.aud-icon circle {
  fill: none;
  stroke: var(--scan);
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.7s var(--ease) 0.1s;
}

.aud-row:hover .aud-icon *,
.aud-row:focus-visible .aud-icon * {
  stroke-dashoffset: 0;
}

/* ---------- Terminal briefing panel ---------- */

@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.terminal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px 48px;
  padding: clamp(28px, 5vw, 64px);
  background: rgba(5, 7, 10, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  background:
    conic-gradient(from var(--ang), transparent 0deg, transparent 250deg, var(--scan) 320deg, transparent 360deg),
    linear-gradient(var(--line), var(--line));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: border-spin 7s linear infinite;
  pointer-events: none;
}

@keyframes border-spin {
  to {
    --ang: 360deg;
  }
}

.term-path {
  margin-bottom: 22px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--bone-3);
}

.term-path b {
  font-weight: 500;
  color: var(--scan);
}

.terminal .h2 {
  max-width: 20ch;
}

.term-line {
  max-width: 60ch;
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  color: var(--bone-2);
}

.term-line .pr {
  color: var(--scan);
  margin-right: 8px;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--scan);
  animation: cursor 1.05s steps(1) infinite;
}

@keyframes cursor {
  50% {
    opacity: 0;
  }
}

/* ---------- Zero page ---------- */

.zero-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px clamp(20px, 3vw, 40px);
  align-items: center;
  margin-top: 22px;
}

.zero-mark {
  width: clamp(72px, 9vw, 120px);
  height: auto;
  filter: drop-shadow(0 0 22px rgba(120, 170, 255, 0.35));
}

.zero-title {
  font-size: clamp(64px, 12vw, 168px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.pipeline {
  position: relative;
}

.stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipe-track {
  position: absolute;
  top: 27px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: var(--line);
  overflow: hidden;
}

.pipe-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--scan), var(--flag) 66%, var(--bone));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.6s var(--ease);
}

.pipeline.in-view .pipe-fill {
  transform: scaleX(1);
}

.pipe-packet {
  position: absolute;
  top: -2px;
  left: 0;
  width: 26px;
  height: 6px;
  background: radial-gradient(closest-side, #fff, rgba(120, 170, 255, 0.9), transparent);
  animation: packet 3.4s linear infinite;
  animation-delay: var(--d, 0s);
  opacity: 0;
}

.pipeline.in-view .pipe-packet {
  opacity: 1;
}

@keyframes packet {
  from {
    left: -30px;
  }
  to {
    left: 100%;
  }
}

.stage {
  position: relative;
  text-align: center;
}

.stage-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 26px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--bone-3);
  background: var(--ink);
  border: 1px solid var(--slate);
  transition:
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.stage h3 {
  font-size: clamp(24px, 2.2vw, 32px);
  color: var(--bone-3);
  transition: color 0.4s ease;
}

.stage p {
  max-width: 30ch;
  margin: 12px auto 0;
  font-size: 17px;
}

.stage.lit .stage-node {
  color: var(--scan);
  border-color: var(--scan);
  box-shadow:
    0 0 0 5px rgba(120, 170, 255, 0.12),
    0 0 24px rgba(120, 170, 255, 0.4);
}

.stage.lit h3 {
  color: var(--bone);
}

.stage.lit.is-evidence .stage-node {
  color: var(--flag);
  border-color: var(--flag);
  box-shadow:
    0 0 0 5px rgba(255, 178, 62, 0.12),
    0 0 24px rgba(255, 178, 62, 0.4);
}

.stage.lit.is-review .stage-node {
  color: var(--bone);
  border-color: var(--bone);
  box-shadow: 0 0 0 5px rgba(236, 231, 220, 0.1);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.annot {
  padding: clamp(20px, 3vw, 32px);
}

.annot-rows {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.annot-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--flag);
}

.annot-note::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--flag);
}

.deploy-figure {
  padding: clamp(18px, 3vw, 30px);
}

.dp-boundary {
  fill: rgba(120, 170, 255, 0.03);
  stroke: var(--slate);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
}

.dp-node {
  fill: var(--ink);
  stroke: var(--scan);
  stroke-width: 1.5;
}

.dp-node--ext {
  stroke: var(--bone-3);
}

.dp-link {
  stroke: var(--bone-3);
  stroke-width: 1.5;
}

.dp-label {
  font-family: var(--mono);
  font-size: 13px;
  fill: var(--bone-2);
}

.dp-title {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 26px;
  fill: var(--bone);
}

.dp-ext {
  font-family: var(--body);
  font-weight: 600;
  font-size: 16px;
  fill: var(--bone);
}

.dp-packet {
  fill: var(--scan);
  animation: dp-move 2.6s linear infinite;
}

.dp-packet--back {
  animation-direction: reverse;
  animation-delay: -1.3s;
}

@keyframes dp-move {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(146px);
  }
}

.dp-key {
  fill: none;
  stroke: var(--flag);
  stroke-width: 1.5;
}

.spec-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.spec-list li {
  padding: 16px 0 16px 26px;
  position: relative;
  font-size: 19px;
  color: var(--bone);
  border-bottom: 1px solid var(--line);
}

.spec-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 27px;
  width: 10px;
  height: 1px;
  background: var(--scan);
}

/* ---------- Contact ---------- */

.contact-copy {
  padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 8vw, 104px);
}

.contact-title {
  font-size: clamp(40px, 7vw, 104px);
  line-height: 0.95;
  max-width: 12ch;
}

.term-email {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(26px, 4.6vw, 60px);
  letter-spacing: -0.02em;
  color: var(--bone);
  text-decoration: none;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--scan), var(--scan));
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 100%;
}

.term-email:hover {
  color: var(--scan);
}

.contact-notes {
  display: grid;
  gap: 10px;
  max-width: 62ch;
  margin-top: 36px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(7, 9, 12, 0.9);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 28px 48px;
  align-items: center;
  padding-block: 44px;
}

.footer-brand {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.footer-brand p,
.footer-base p {
  font-size: 15px;
  color: var(--bone-3);
}

.footer-motto {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--bone);
}

.footer-motto::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--risk);
  box-shadow: 0 0 12px var(--risk);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 16px;
  color: var(--bone-2);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--scan);
}

.footer-base {
  padding-block: 18px 30px;
  border-top: 1px solid var(--line-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .hero-scene .sg-scan-banner__center {
    width: calc(100% - 4% - min(380px, 27vw) - 42%);
  }
  .tx-panel {
    width: 40%;
  }
}

@media (max-width: 900px) {
  .sec-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sec-label {
    writing-mode: horizontal-tb;
    transform: none;
    justify-self: start;
    margin-bottom: 22px;
    padding: 0 0 8px;
    border-right: 0;
    border-bottom: 1px solid var(--scan);
  }

  .hero-sub,
  .harm-grid,
  .evidence,
  .split,
  .terminal,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hunts {
    flex-direction: column;
    height: auto;
  }

  .hunt,
  .hunt.is-active {
    flex: none;
  }

  .hunt-body {
    display: none;
    min-width: 0;
  }

  .hunt.is-active .hunt-body {
    display: flex;
    opacity: 1;
  }

  .hunt-head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .harm {
    height: 240vh;
  }

  .harm-sticky {
    align-items: flex-start;
    padding-top: 20px;
    min-height: 0;
  }

  .harm-grid {
    gap: 20px;
  }

  .harm .body-copy {
    margin-top: 12px;
    font-size: 17px;
  }

  .harm-scene svg {
    max-height: 48vh;
  }

  .callout--env {
    grid-template-columns: minmax(0, 1fr);
  }

  .stages {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .pipe-track {
    top: 0;
    bottom: 0;
    left: 27px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .pipe-fill {
    transform-origin: top;
    transform: scaleY(0);
    background: linear-gradient(180deg, var(--scan), var(--flag) 66%, var(--bone));
  }

  .pipeline.in-view .pipe-fill {
    transform: scaleY(1);
  }

  .pipe-packet {
    display: none;
  }

  .stage {
    padding-left: 84px;
    text-align: left;
  }

  .stage-node {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
  }

  .stage p {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --nav-h: 64px;
  }

  body {
    font-size: 17px;
  }

  .header-bar {
    justify-content: center;
  }

  .site-nav {
    justify-content: center;
  }

  .brand-logo {
    height: 30px;
  }
}

@media (max-width: 560px) {
  .header-bar {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 8px;
  }

  .brand-logo {
    height: 24px;
  }

  .site-nav .btn {
    display: none;
  }

  .site-nav a:not(.btn) {
    padding: 0 9px;
    font-size: 15px;
  }

  .hero-scene .sg-scan-banner {
    flex-direction: column;
    height: auto;
    padding: 40px 0 18px;
  }

  .hero-scene .sg-scan-banner__center {
    margin-left: 0;
    width: auto;
  }

  .tx-panel {
    position: relative;
    top: auto;
    bottom: auto;
    right: auto;
    width: calc(100% - 28px);
    height: 168px;
    margin-top: 22px;
    border: 1px solid var(--line);
  }

  .tx-line {
    padding: 0 12px;
  }

  .tx-line.is-b {
    padding-left: 34px;
  }

  .ev-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ev-buttons .btn {
    flex: 1;
  }

  .aud-row {
    padding-inline: 2px;
  }
}

@media (max-width: 600px) {
  /* Diagram labels scale with the SVG; keep them readable on phones */
  .dp-label {
    font-size: 21px;
  }

  .dp-title {
    font-size: 38px;
  }

  .dp-ext {
    font-size: 22px;
  }
}

@media (max-width: 400px) {
  .site-nav a:not(.btn) {
    padding: 0 11px;
  }

  .site-nav .btn {
    margin-left: 0;
  }

  .actions .btn {
    width: 100%;
  }

  .hunt-head,
  .hunt-body {
    padding-inline: 20px;
  }

  .stage {
    padding-left: 72px;
  }
}

/* ---------- Reduced motion: one still frame, no movement ---------- */

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

  .btn::after,
  .aud-row::after,
  .terminal::before,
  .cursor,
  .art-sweep,
  .art-sweepx,
  .art-spin,
  .art-spin-slow,
  .art-blink,
  .pipe-packet,
  .dp-packet,
  .audit-log li.is-new {
    animation: none !important;
  }

  .harm {
    height: auto;
    padding-block: clamp(88px, 11vw, 160px);
  }

  .harm-sticky {
    position: static;
    height: auto;
    min-height: 0;
  }

  .hunt,
  .hunt-body,
  .nav-ind,
  .draw,
  .pop,
  .hm-msg,
  .hm-tag,
  .pipe-fill,
  .stage-node,
  .rx.hit::before,
  .hl,
  .tx-line {
    transition: none !important;
  }
}
