/* ============================================================
   AIHarness — premium enterprise-security showcase (LIGHT)
   Design system: light, refined; ONE restrained technical
   teal/green accent that bridges into the Matrix demo;
   amber/red reserved for finding severities.
   The live-demo section is a dark Matrix terminal embedded
   in the light page.
   ============================================================ */

:root {
  /* surfaces (light) */
  --bg:        #f6f8f9;
  --bg-2:      #eef2f4;
  --panel:     #ffffff;
  --panel-2:   #fbfcfd;
  --tint:      #f0f7f5;     /* faint teal-tinted surface */
  --line:      #e2e7ec;
  --line-2:    #cfd7df;

  /* text */
  --ink:       #0e1726;
  --ink-soft:  #475467;
  --ink-dim:   #7b8794;

  /* signal accent = "secure" (technical teal/green, bridges to Matrix) */
  --signal:      #07a883;
  --signal-2:    #0c8f72;
  --signal-deep: #06614e;
  --signal-soft: #d6f0e9;
  --signal-glow: rgba(7, 168, 131, 0.20);

  /* matrix phosphor (terminal only) */
  --phos:      #39ff14;
  --phos-2:    #00ff9c;
  --phos-dim:  #1f7a3c;

  /* severity (findings only) */
  --sev-critical: #d6204a;
  --sev-high:     #e0560f;
  --sev-medium:   #b8860b;
  --sev-low:      #0f9d6e;
  --sev-info:     #2563c9;

  /* type */
  --display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --sans:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* space */
  --wrap: 1120px;
  --r:    16px;
  --r-sm: 10px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --shadow-sm: 0 1px 2px rgba(14,23,38,.05), 0 1px 1px rgba(14,23,38,.04);
  --shadow:    0 6px 22px -10px rgba(14,23,38,.18), 0 2px 6px -3px rgba(14,23,38,.08);
  --shadow-lg: 0 22px 50px -22px rgba(14,23,38,.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle ambient backdrop — soft teal wash, light */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 600px at 82% -10%, rgba(7,168,131,.08), transparent 60%),
    radial-gradient(820px 520px at -8% 12%, rgba(37,99,201,.05), transparent 55%);
  pointer-events: none;
}

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.08; margin: 0; color: var(--ink); }
a { color: var(--signal-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--signal); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===================== HEADER / NAV ===================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(246, 248, 249, 0.82);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto;
  height: 66px;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--signal); display: inline-flex; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-soft); font-size: .92rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-cta {
  color: #fff !important; background: var(--signal); padding: .5rem .95rem; border-radius: 999px; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-cta:hover { background: var(--signal-2); text-decoration: none; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s var(--ease); }

/* ===== architecture responsive: stack gracefully below desktop ===== */
@media (max-width: 1100px) {
  .firstscreen { height: auto; min-height: 0; max-height: none; }
  .arch-scene { perspective: 1700px; perspective-origin: 50% 50%; padding: 2rem .5rem 2.4rem; }
  .arch-floor { display: none; }
  .arch-stage-track {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 2.4rem 1.6rem;
    transform: rotateX(14deg);
  }
  .arch-node { margin: 0 12px; min-height: 130px; }
  .arch-stage:first-child .arch-node, .arch-stage:last-child .arch-node { margin: 0 12px; }
  .arch-link { display: none; }
  .node-tip, .arch-stage:first-child .node-tip, .arch-stage:last-child .node-tip {
    left: 50%; right: auto; transform: translateX(-50%) translateZ(80px) rotateX(-14deg) scale(.96);
  }
}
@media (max-width: 640px) {
  .arch-scene { perspective: none; transform-style: flat; padding: 1rem 0; }
  .arch-floor { display: none; }
  .arch-stage-track { grid-template-columns: 1fr; gap: 1rem; transform: none; }
  .arch-node { margin: 0; min-height: 0; transform: none; }
  .arch-stage:first-child .arch-node, .arch-stage:last-child .arch-node { margin: 0; }
  .node-face-side, .node-face-bottom { display: none; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: .25rem;
    background: var(--panel); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem; max-height: 0; overflow: hidden; transition: max-height .3s var(--ease), padding .3s var(--ease);
    padding-block: 0;
  }
  .nav-links.open { max-height: 460px; padding-block: 1rem; }
  .nav-links a { padding: .5rem 0; font-size: 1rem; }
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: .95rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, var(--signal), var(--signal-2));
  color: #fff;
  box-shadow: 0 8px 22px -10px var(--signal-glow), var(--shadow-sm);
}
.btn-primary:hover { box-shadow: 0 12px 28px -10px var(--signal-glow); }
.btn-primary:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-ghost { background: var(--panel); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--signal); color: var(--signal-2); background: var(--tint); }
.btn-small { padding: .5rem 1rem; font-size: .85rem; }

/* ===================== FIRST SCREEN (HERO + ARCHITECTURE) ===================== */
/* Single no-scroll viewport: condensed hero on top, dramatic 3D pipeline below. */
.firstscreen {
  position: relative; overflow: hidden;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  display: flex; flex-direction: column;
  padding: 0;
}
.firstscreen-inner {
  position: relative; z-index: 1;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding-top: .8rem;
  padding-bottom: 1rem;
}
.hero-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(900px 600px at 60% 0%, #000 6%, transparent 72%);
  opacity: .6;
}

/* --- condensed hero --- */
.hero-top { flex: 0 0 auto; max-width: 900px; }
.eyebrow {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--signal-2); margin: 0 0 .5rem;
}
.firstscreen h1 {
  font-size: clamp(1.7rem, 3.3vw, 2.55rem); font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em; line-height: 1.05;
  max-width: 20ch; margin: 0;
}
.lede { font-size: clamp(.95rem, 1.25vw, 1.06rem); color: var(--ink-soft); max-width: 680px; margin: .55rem 0 0; line-height: 1.5; }
.lede strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .85rem; }
.hero-cta .btn { padding: .62rem 1.2rem; font-size: .92rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: .8rem 0 0; }
.hero-badges li {
  font-family: var(--mono); font-size: .74rem; color: var(--ink-soft);
  border: 1px solid var(--line-2); border-radius: 999px; padding: .32rem .75rem;
  background: var(--panel); box-shadow: var(--shadow-sm);
}

/* ===================== SECTIONS ===================== */
.section { padding: 6rem 0; border-top: 1px solid var(--line); }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.section-head { max-width: 740px; margin-bottom: 3rem; }
.kicker {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--signal-2); margin: 0 0 .8rem;
}
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 700; }
.section-sub { color: var(--ink-soft); font-size: 1.08rem; margin: 1rem 0 0; }

/* ===================== ARCHITECTURE (DRAMATIC 3D) ===================== */
.arch {
  --flow: 0;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
  margin-top: .4rem;
}
.arch-caption {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em;
  color: var(--ink-soft); margin: 0 0 .2rem; text-align: center;
}
.arch-caption span { color: var(--ink-dim); }

/* The 3D stage: deep perspective + strong iso tilt so the row of solid blocks
   recedes into space and reads unmistakably as a 3D pipeline. */
.arch-scene {
  position: relative;
  perspective: 950px;
  perspective-origin: 50% 32%;
  padding: 3rem 2.4rem 4rem;
  flex: 1; min-height: 0;
  display: flex; align-items: center;
}

/* a soft lit ground plane behind the blocks to catch their cast shadows */
.arch-floor {
  position: absolute; left: 2%; right: 2%; top: 30%; bottom: 0%;
  transform-style: preserve-3d;
  transform: rotateX(62deg) translateZ(-90px);
  background:
    radial-gradient(120% 100% at 50% 18%, rgba(7,168,131,.16), transparent 60%),
    linear-gradient(180deg, #ecf2f3, #dde6e8);
  border-radius: 50%;
  filter: blur(12px);
  opacity: .95;
  pointer-events: none;
}

.arch-stage-track {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  gap: 0;
  transform-style: preserve-3d;
  /* dramatic recede + iso tilt */
  transform: rotateX(32deg) rotateY(-2deg) rotateZ(-1.5deg) translateZ(-20px);
}

.arch-stage {
  position: relative;
  transform-style: preserve-3d;
  display: flex;
  min-width: 0;            /* allow grid cells to shrink, never overflow */
}

/* dimensional 3D connector between adjacent nodes — a raised beam in depth */
.arch-link {
  position: absolute;
  top: 50%;
  left: calc(100% - 18px);
  width: 36px;
  height: 6px;
  margin-top: -3px;
  z-index: 0;
  transform-style: preserve-3d;
  transform: translateZ(22px);
  background: linear-gradient(90deg, var(--line-2), #d8dee4);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(14,23,38,.18), 0 1px 0 rgba(255,255,255,.7) inset;
}
.arch-link::before {       /* base rail glow when the flow passes */
  content: ""; position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--signal-2), var(--signal));
  box-shadow: 0 0 12px 2px var(--signal-glow);
  opacity: 0; transition: opacity .4s var(--ease);
}
.arch-link.flowing::before { opacity: .95; }
/* energy packet riding the connector, position driven by --flow (0..1) */
.arch-link-packet {
  position: absolute; top: 50%; left: 0;
  width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--signal) 52%, var(--signal-deep));
  box-shadow: 0 0 16px 5px var(--signal-glow), 0 0 7px 2px var(--signal);
  opacity: 0;
  transform: translateX(0) translateZ(8px);
}
.arch-link.flowing .arch-link-packet {
  opacity: 1;
  transform: translateX(calc(var(--flow) * 36px)) translateZ(8px);
}

/* ---- The node: a genuinely EXTRUDED 3D block ----
   .arch-node = the top (front) face. Two pseudo-elements build the side
   walls; layered box-shadows fake the extruded thickness + cast shadow. */
.arch-node {
  position: relative;
  z-index: 1;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: translateZ(18px);
  background: linear-gradient(158deg, #ffffff 0%, var(--panel-2) 55%, var(--tint) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  margin: 0 13px;
  min-height: 158px;
  display: flex;
  /* the long lower shadow = the extruded thickness; the wide soft shadow = cast on ground */
  box-shadow:
    0 1px 0 rgba(255,255,255,.95) inset,
    2px 6px 0 -1px #cdd6dd,
    4px 12px 0 -2px #c2ccd4,
    6px 18px 0 -3px #b9c4cd,
    0 30px 40px -16px rgba(14,23,38,.42),
    0 14px 22px -12px rgba(14,23,38,.28);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease),
              border-color .3s var(--ease), background .3s var(--ease);
  color: var(--ink); font-family: var(--sans);
}
.arch-stage:first-child .arch-node { margin-left: 0; }
.arch-stage:last-child .arch-node { margin-right: 8px; }

/* extruded faces give real depth (top edge-light glow + lit side walls) */
.node-face { position: absolute; pointer-events: none; }
.node-face-top {
  inset: 0; border-radius: 14px;
  transform: translateZ(.5px);
  background: linear-gradient(180deg, rgba(7,168,131,.10), transparent 52%);
  filter: blur(.5px);
}
/* right + bottom side walls built as 3D-rotated faces = solid block look */
.node-face-side {
  top: 8px; bottom: 10px; right: -13px; width: 14px;
  border-radius: 0 11px 11px 0;
  transform: rotateY(52deg);
  transform-origin: left center;
  background: linear-gradient(180deg, #d3dbe2 0%, #bcc6cf 60%, #a9b5bf 100%);
  box-shadow: -1px 0 5px rgba(14,23,38,.16);
}
.node-face-bottom {
  left: 9px; right: 5px; bottom: -13px; height: 14px;
  border-radius: 0 0 11px 11px;
  transform: rotateX(-58deg);
  transform-origin: center top;
  background: linear-gradient(90deg, #c9d2da 0%, #b8c2cb 100%);
}
.arch-node.lit .node-face-side, .arch-node.active .node-face-side {
  background: linear-gradient(180deg, #a7e2d1 0%, #6ec7ad 60%, #4cb999 100%);
}
.arch-node.lit .node-face-bottom, .arch-node.active .node-face-bottom {
  background: linear-gradient(90deg, #8fd6c1 0%, #66c2a7 100%);
}

.node-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  padding: 1rem 1rem 1.05rem;
  width: 100%;
}

/* hover / focus — block pops dramatically forward in Z */
.arch-node:hover, .arch-node:focus-visible {
  outline: none;
  transform: translateZ(70px) translateY(-4px);
  border-color: var(--signal);
  box-shadow:
    0 1px 0 rgba(255,255,255,.95) inset,
    2px 6px 0 -1px #b8e3d6,
    4px 12px 0 -2px #a3dbc9,
    6px 18px 0 -3px #8fd2bd,
    0 0 0 1px var(--signal),
    0 40px 60px -22px rgba(7,168,131,.55),
    0 16px 28px -12px rgba(14,23,38,.3);
}
.arch-node.active {
  border-color: var(--signal);
  background: linear-gradient(158deg, #ffffff, var(--signal-soft));
}
/* live "lit" state driven by JS during the loop — node pops + glows */
.arch-node.lit {
  transform: translateZ(56px) translateY(-3px);
  border-color: var(--signal);
  background: linear-gradient(158deg, #ffffff, var(--signal-soft));
  box-shadow:
    0 1px 0 rgba(255,255,255,.95) inset,
    2px 6px 0 -1px #b8e3d6,
    4px 12px 0 -2px #a3dbc9,
    6px 18px 0 -3px #8fd2bd,
    0 0 0 1px var(--signal),
    0 38px 56px -20px rgba(7,168,131,.6),
    0 0 34px 3px var(--signal-glow);
}
.arch-node.lit .node-face-top { background: linear-gradient(180deg, rgba(7,168,131,.30), transparent 60%); }

.node-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--line-2);
  margin-bottom: .5rem; flex: 0 0 auto;
  box-shadow: 0 0 0 0 var(--signal-soft);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.arch-node.lit .node-dot, .arch-node.active .node-dot {
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-soft), 0 0 10px 1px var(--signal-glow);
}
.node-stage {
  display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--signal-2); font-weight: 600;
  margin-bottom: .42rem;
}
.node-sub {
  display: block; font-size: .76rem; line-height: 1.4; color: var(--ink-soft);
  font-weight: 500;
  /* always wrap inside the node, never truncate */
  overflow-wrap: anywhere; word-break: normal; hyphens: auto;
}

/* ---- per-node hover/focus OVERLAY tooltip (detail + standards) ----
   absolutely positioned, counter-rotated flat to face the viewer, and only
   shown on hover/focus — so it never consumes layout in the default state. */
.node-tip {
  position: absolute;
  left: 50%; bottom: calc(100% + 16px);
  width: 250px; max-width: 78vw;
  transform: translateX(-50%) translateZ(80px) rotateX(-26deg) scale(.96);
  transform-origin: bottom center;
  background: var(--panel);
  border: 1px solid var(--signal);
  border-radius: var(--r-sm);
  padding: .8rem .9rem;
  box-shadow: 0 22px 48px -18px rgba(14,23,38,.4), 0 0 0 1px rgba(7,168,131,.15);
  opacity: 0; visibility: hidden;
  pointer-events: none;
  z-index: 40;
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
}
.node-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px;
  width: 14px; height: 14px; background: var(--panel);
  border-right: 1px solid var(--signal); border-bottom: 1px solid var(--signal);
  transform: rotate(45deg);
}
.arch-node:hover .node-tip,
.arch-node:focus-visible .node-tip {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateZ(80px) rotateX(-26deg) scale(1);
}
.node-tip-detail {
  display: block; font-size: .8rem; line-height: 1.45; color: var(--ink-soft);
  margin-bottom: .6rem;
}
.node-tip-standards { display: flex; flex-wrap: wrap; gap: .35rem; }
.node-tip-chip {
  font-family: var(--mono); font-size: .68rem; color: var(--signal-2);
  border: 1px solid var(--signal-soft); background: var(--tint);
  border-radius: 999px; padding: .22rem .55rem; line-height: 1.2;
}
/* nudge first/last tooltips inward so they don't clip the viewport edge */
.arch-stage:first-child .node-tip { left: 0; transform: translateX(0) translateZ(80px) rotateX(-26deg) scale(.96); }
.arch-stage:first-child .arch-node:hover .node-tip,
.arch-stage:first-child .arch-node:focus-visible .node-tip { transform: translateX(0) translateZ(80px) rotateX(-26deg) scale(1); }
.arch-stage:first-child .node-tip::after { left: 60px; }
.arch-stage:last-child .node-tip { left: auto; right: 0; transform: translateX(0) translateZ(80px) rotateX(-26deg) scale(.96); }
.arch-stage:last-child .arch-node:hover .node-tip,
.arch-stage:last-child .arch-node:focus-visible .node-tip { transform: translateX(0) translateZ(80px) rotateX(-26deg) scale(1); }
.arch-stage:last-child .node-tip::after { left: auto; right: 60px; }

/* ===================== HOW IT WORKS ===================== */
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.how-card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.6rem 1.4rem; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: border-color .25s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
}
.how-card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.how-num {
  font-family: var(--mono); font-size: .85rem; font-weight: 600; color: var(--signal-2);
  display: inline-block; margin-bottom: .9rem;
}
.how-card h3 { font-size: 1.12rem; margin-bottom: .6rem; }
.how-card p { color: var(--ink-soft); margin: 0; font-size: .95rem; }
.how-card strong { color: var(--ink); }
.how-card em { color: var(--signal-2); font-style: normal; font-weight: 600; }
.how-note {
  margin-top: 1.6rem; padding: 1rem 1.25rem; border-left: 3px solid var(--signal);
  background: var(--tint); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-soft); font-size: .95rem;
}

/* ===================== DEMO ===================== */
.demo {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.75rem; display: grid; gap: 1.4rem; box-shadow: var(--shadow);
}
/* Input-mode segmented control */
.input-mode {
  display: inline-flex; border: 1px solid var(--line-2); border-radius: calc(var(--r) - 2px);
  overflow: hidden; background: var(--bg);
}
.mode-btn {
  font-family: var(--mono); font-size: .8rem; font-weight: 500; letter-spacing: .03em;
  padding: .38rem 1rem; background: transparent; border: none; color: var(--ink-dim);
  cursor: pointer; transition: background .15s, color .15s;
}
.mode-btn + .mode-btn { border-left: 1px solid var(--line-2); }
.mode-btn:hover { background: var(--tint); color: var(--ink); }
.mode-btn-active { background: var(--signal) !important; color: #fff !important; }
.mode-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }

.demo-controls { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: flex-end; justify-content: space-between; }
.field { display: flex; flex-direction: column; gap: .45rem; }
.demo-controls .field { min-width: 180px; }
.field-grow { flex: 1; }
.field label, .code-field label {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-dim);
}
select, input, textarea {
  width: 100%; padding: .7rem .85rem; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); font-family: var(--sans); font-size: .95rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
textarea { font-family: var(--mono); font-size: .86rem; line-height: 1.55; resize: vertical; min-height: 220px; background: var(--panel-2); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-glow); }
.field-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.privacy-note {
  display: flex; align-items: flex-start; gap: .45rem; margin: .2rem 0 0;
  font-size: .8rem; color: var(--ink-dim); line-height: 1.45;
}
.privacy-note svg { color: var(--signal); flex: 0 0 auto; margin-top: 2px; }

/* advanced (optional key) disclosure */
.advanced {
  border: 1px dashed var(--line-2); border-radius: var(--r-sm);
  background: var(--panel-2);
}
.advanced > summary {
  cursor: pointer; list-style: none; padding: .85rem 1.1rem;
  font-family: var(--mono); font-size: .82rem; color: var(--ink-soft); font-weight: 500;
  display: flex; align-items: center; gap: .5rem;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before { content: "▸"; color: var(--signal-2); font-size: .8rem; transition: transform .2s var(--ease); }
.advanced[open] > summary::before { transform: rotate(90deg); }
.advanced .advanced-hint { color: var(--ink-dim); }
.advanced-body { padding: 0 1.1rem 1.1rem; }

@media (max-width: 680px) {
  .demo-controls { flex-direction: column; align-items: stretch; }
  .field-actions { justify-content: stretch; }
  .field-actions .btn { flex: 1; }
}

/* ===================== MATRIX TERMINAL ===================== */
.terminal {
  position: relative; overflow: hidden;
  background: #0a0f0a;
  border: 1px solid #11331f;
  border-radius: var(--r);
  box-shadow: 0 22px 50px -22px rgba(7,40,20,.7), inset 0 0 60px rgba(0,255,156,.04);
}
.rain {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
  opacity: .22; pointer-events: none;
}
.terminal-chrome {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1rem; border-bottom: 1px solid #11331f;
  background: rgba(6, 18, 11, .85);
}
.tl-dots { display: inline-flex; gap: .45rem; }
.tl-dots .dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-r { background: #ff5f56; } .dot-y { background: #ffbd2e; } .dot-g { background: #27c93f; }
.terminal-title {
  font-family: var(--mono); font-size: .82rem; color: var(--phos-2);
  text-shadow: 0 0 8px rgba(0,255,156,.55); letter-spacing: .02em;
}
.terminal-body {
  position: relative; z-index: 1;
  padding: 1.1rem 1.2rem 1.3rem;
  min-height: 240px; max-height: 460px; overflow-y: auto;
  font-family: var(--mono); font-size: .85rem; line-height: 1.7;
  color: var(--phos); text-shadow: 0 0 6px rgba(57,255,20,.35);
  scrollbar-width: thin; scrollbar-color: #1f7a3c #0a0f0a;
}
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-thumb { background: #1f7a3c; border-radius: 8px; }
.term-lines { white-space: pre-wrap; word-break: break-word; }
.term-line { display: block; }
.term-line.t-cmd   { color: #eafff0; text-shadow: 0 0 6px rgba(0,255,156,.45); }
.term-line.t-cmd .prompt { color: var(--phos-2); }
.term-line.t-info  { color: #7fffa8; }
.term-line.t-dim   { color: #5fae7a; opacity: .9; }
.term-line.t-rule  { color: #1f7a3c; }
.term-line.t-ok    { color: var(--phos); }
.term-line.t-warn  { color: #ffd24a; text-shadow: 0 0 6px rgba(255,189,46,.4); }
.term-line.t-err   { color: #ff6a5a; text-shadow: 0 0 6px rgba(255,90,80,.4); }
.term-line.t-fix   { color: #9be8c0; padding-left: 4px; }
.term-line.t-link  { color: var(--phos-2); }
/* verdict / severity tokens inside a finding line */
.tok { font-weight: 600; }
.tok-confirmed, .tok-secure, .tok-low, .tok-info { color: var(--phos); }
.tok-uncertain, .tok-medium, .tok-needsreview { color: #ffd24a; }
.tok-high, .tok-critical, .tok-refuted, .tok-failed { color: #ff6a5a; }

.term-cursor {
  display: inline-block; width: 9px; height: 1.05em; margin-left: 1px;
  background: var(--phos); vertical-align: text-bottom;
  box-shadow: 0 0 8px rgba(57,255,20,.7);
  animation: blink 1s steps(1) infinite;
  position: relative; z-index: 1;
}
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

.demo .findings-head { display: none; align-items: center; justify-content: space-between; gap: 1rem; }
.demo .findings-head:not([hidden]) { display: flex; }
.findings-head h3 { font-size: 1.05rem; }

/* ===================== STANDARDS ===================== */
.std-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.std-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.4rem; box-shadow: var(--shadow-sm); transition: border-color .25s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
}
.std-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.std-card h3 { font-size: .82rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--signal-2); margin-bottom: .85rem; font-weight: 600; }
.std-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.std-card a { color: var(--ink); font-size: .94rem; display: inline-flex; align-items: center; gap: .4rem; }
.std-card a::after { content: "↗"; color: var(--ink-dim); font-size: .8rem; }
.std-card a:hover { color: var(--signal-2); text-decoration: none; }
.std-footnote { margin-top: 1.8rem; font-size: .86rem; color: var(--ink-dim); font-style: italic; max-width: 760px; }

/* ===================== USE CASES / TRUST ===================== */
.uc-grid, .trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.uc-card, .trust-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.5rem 1.4rem; box-shadow: var(--shadow-sm); transition: border-color .25s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
}
.uc-card:hover, .trust-card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.uc-card h3, .trust-card h3 { font-size: 1.08rem; margin-bottom: .55rem; }
.uc-card p, .trust-card p { color: var(--ink-soft); margin: 0; font-size: .94rem; }
.uc-card strong, .trust-card strong { color: var(--signal-2); }

/* ===================== SELF SCAN ===================== */
.self-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; margin-bottom: 2rem; }
.self-stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.8rem 1.5rem; text-align: center; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.self-stat::before {
  content: ""; position: absolute; inset: 0; background: radial-gradient(140px 90px at 50% 0%, var(--signal-glow), transparent 70%); opacity: .6;
}
.self-num { position: relative; font-family: var(--display); font-weight: 800; font-size: 2.8rem; color: var(--signal-2); display: block; line-height: 1; }
.self-label { position: relative; color: var(--ink-soft); font-size: .9rem; margin-top: .6rem; display: block; }
.self-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; max-width: 820px; }
.self-list li { position: relative; padding-left: 1.6rem; color: var(--ink-soft); font-size: .95rem; }
.self-list li::before { content: "✓"; position: absolute; left: 0; color: var(--signal); font-weight: 700; }

/* ===================== FOOTER ===================== */
.site-footer { border-top: 1px solid var(--line); padding: 3.5rem 0; background: var(--bg-2); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.footer-answer { font-family: var(--display); font-weight: 600; font-size: 1.15rem; margin: 0 0 1rem; max-width: 560px; color: var(--ink); }
.footer-lead { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.footer-meta { font-family: var(--mono); font-size: .82rem; color: var(--ink-dim); margin: 0; }

/* ===================== SCROLL REVEAL ===================== */
/* Progressive enhancement ONLY: start-state is scoped to html.js .reveal:not(.in).
   With JS off (no .js class) or once .in is added, content is fully visible.
   A load/timeout fallback in JS also force-adds .in so nothing can stay hidden. */
html.js .reveal:not(.in) { opacity: 0; transform: translateY(18px); }
html.js .reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  /* content simply shows; no transform/opacity animation */
  html.js .reveal:not(.in), .reveal { opacity: 1 !important; transform: none !important; }
  .arch-link-packet { transition: none !important; }
  .term-cursor { animation: none; opacity: 1; }
  .gh-blink { animation: none !important; }
}

/* ---- Top credit bar + blinking GitHub button ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 24px; font-size: 13px; line-height: 1.4;
  background: #0b1220; color: #cbd5e1;
}
.topbar-credit strong { color: #fff; font-weight: 700; }
.topbar-phone { color: #34d399; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.topbar-phone:hover { text-decoration: underline; }
.gh-blink {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 6px 14px; border-radius: 999px;
  font-weight: 700; font-size: 13px; text-decoration: none;
  color: #0b1220; background: #fff; border: 1px solid rgba(255,255,255,.25);
  animation: gh-blink 0.85s steps(1, end) 5; /* blink 5 times, then settle to solid */
}
.gh-blink svg { flex: 0 0 auto; }
.gh-blink:hover { background: #22c55e; color: #04130a; }
.gh-blink:focus-visible { outline: 2px solid #34d399; outline-offset: 2px; }
@keyframes gh-blink {
  0%, 49%   { background: #22c55e; color: #04130a;
              box-shadow: 0 0 0 4px rgba(34,197,94,.35), 0 0 20px rgba(34,197,94,.75); transform: scale(1.05); }
  50%, 100% { background: #fff; color: #0b1220; box-shadow: 0 0 0 0 rgba(34,197,94,0); transform: scale(1); }
}
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 8px 16px; }
}

/* keep architecture node labels whole — no mid-word hyphenation */
.arch-node, .arch-node * { -webkit-hyphens: none; hyphens: none; overflow-wrap: break-word; word-break: normal; }
