/* ── HyperGrowth Ops Console ── Monochrome + signal blue ── */
@import url('./glass-tokens.css');

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Room for fixed venue trace terminal (ops console) */
body.hg-ops-layout {
  padding-bottom: min(44vh, 380px);
}

/* ═══ Global particle field (halftone / ordered screen — reproducible roughness) ═══ */

.hg-particle-stack {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.hg-particle-layer {
  position: absolute;
  inset: 0;
}

/* Fine AM screen */
.hg-particle-fine {
  mix-blend-mode: overlay;
  opacity: 0.048;
  background-image: radial-gradient(circle, var(--hg-particle-dot) 0.45px, transparent 0.45px);
  background-size: var(--hg-dot-fine) var(--hg-dot-fine);
}

/* Coarse second pass (offset moiré control) */
.hg-particle-coarse {
  mix-blend-mode: soft-light;
  opacity: 0.038;
  background-image: radial-gradient(circle, var(--hg-particle-faint) 0.85px, transparent 0.85px);
  background-size: var(--hg-dot-coarse) var(--hg-dot-coarse);
  background-position: calc(var(--hg-dot-coarse) * 0.47) calc(var(--hg-dot-coarse) * 0.31);
}

/* Ordered dither grid (Bayer-like cross frequencies) */
.hg-particle-bayer {
  mix-blend-mode: overlay;
  opacity: 0.036;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 1px, var(--hg-screen-line) 1px, var(--hg-screen-line) 2px),
    repeating-linear-gradient(90deg, transparent 0, transparent 2px, var(--hg-screen-line) 2px, var(--hg-screen-line) 3px);
  background-size: 4px 4px, 4px 4px;
}

/* Edge ink density: particles only (masks smooth falloff of “continuous” vignette) */
.hg-particle-vignette {
  mix-blend-mode: multiply;
  opacity: 0.38;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0.5px, transparent 0.5px);
  background-size: var(--hg-dot-mid) var(--hg-dot-mid);
  mask-image: radial-gradient(ellipse 92% 88% at 50% 42%, transparent 28%, black 100%);
  -webkit-mask-image: radial-gradient(ellipse 92% 88% at 50% 42%, transparent 28%, black 100%);
}

.hg-scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.012;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.035) 2px,
    rgba(255, 255, 255, 0.035) 4px
  );
}

/* ═══ Interactive halftone registration (pointer → particle phase shift) ═══ */

.hg-particle-stack[data-hg-interactive="true"] .hg-particle-fine {
  background-position:
    calc((var(--hg-pointer-x) - 0.5) * 56px)
    calc((var(--hg-pointer-y) - 0.5) * 56px);
}

.hg-particle-stack[data-hg-interactive="true"] .hg-particle-coarse {
  background-position:
    calc(var(--hg-dot-coarse) * 0.47 + (0.5 - var(--hg-pointer-x)) * 40px)
    calc(var(--hg-dot-coarse) * 0.31 + (0.5 - var(--hg-pointer-y)) * 40px);
}

.hg-particle-stack[data-hg-interactive="true"] .hg-particle-bayer {
  background-position:
    calc((var(--hg-pointer-x) - 0.5) * 12px)
    calc((var(--hg-pointer-y) - 0.5) * 12px),
    calc(2px + (var(--hg-pointer-y) - 0.5) * 8px)
    calc(1px + (var(--hg-pointer-x) - 0.5) * 8px);
}

html[data-hg-bayer-step="1"] .hg-particle-stack[data-hg-interactive="true"] .hg-particle-bayer {
  opacity: 0.042;
  background-size: 5px 5px, 5px 5px;
}

html[data-hg-bayer-step="2"] .hg-particle-stack[data-hg-interactive="true"] .hg-particle-bayer {
  opacity: 0.032;
  background-size: 3px 3px, 3px 3px;
}

html[data-hg-bayer-step="3"] .hg-particle-stack[data-hg-interactive="true"] .hg-particle-bayer {
  opacity: 0.038;
  background-size: 6px 6px, 6px 6px;
}

/* ═══ Topbar ═══ */

.hg-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  height: 48px;
  background-color: rgba(5, 6, 10, 0.94);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0.42px, transparent 0.42px);
  background-size: 4px 4px;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(92, 159, 216, 0.1);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hg-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hg-topbar-mark {
  color: var(--ink);
  font-weight: 600;
}

.hg-topbar-sep {
  color: var(--muted);
}

.hg-topbar-sub {
  color: var(--muted);
}

.hg-topbar-nav {
  display: flex;
  gap: 6px;
}

.hg-topbar-nav a {
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  transition: var(--transition-fast);
}

.hg-topbar-nav a:hover {
  border-color: var(--line);
  color: var(--ink);
}

.hg-topbar-nav a.is-active {
  border-color: var(--accent-dim);
  background: var(--surface-1);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(92, 159, 216, 0.06);
}

.hg-topbar-right {
  color: var(--muted);
}

.hg-topbar-meta {
  font-size: 0.66rem;
}

/*
 * Ops console surface (index.html)
 * — One column shell, dot/halftone fills, ASCII framing (no marketing hero)
 * — Signal deck = HTTP/idem strip + lane KPI as a single panel
 * — Lanes = buyer | seller | admin grid on wide viewports
 */
.hg-ops-shell {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px 40px;
}

.hg-ops-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px 28px;
  align-items: start;
  padding: 20px 0 18px;
  border-bottom: 1px solid rgba(92, 159, 216, 0.08);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.045) 0.4px, transparent 0.4px);
  background-size: 6px 6px;
}

.hg-ops-intro-visual {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hg-ops-ascii {
  margin: 0;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 1.1vw, 0.68rem);
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--accent-soft);
  background: var(--surface-0);
  border: 1px solid rgba(92, 159, 216, 0.14);
  border-radius: var(--radius-sm);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0.35px, transparent 0.35px);
  background-size: 4px 4px;
  white-space: pre;
  overflow-x: auto;
}

.hg-ops-dotline {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.hg-ops-dotline span {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0.35;
  box-shadow: 0 0 0 1px rgba(92, 159, 216, 0.2);
}

.hg-ops-dotline span:nth-child(3n) { opacity: 0.55; }
.hg-ops-dotline span:nth-child(3n+1) { opacity: 0.28; }

.hg-ops-intro-copy {
  min-width: 0;
}

.hg-ops-intro-world {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.hg-ops-intro-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hg-ops-intro-lead {
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-secondary);
  max-width: 52ch;
}

.hg-ops-intro-lead a {
  color: var(--accent-soft);
  text-decoration: none;
  border-bottom: 1px dotted rgba(92, 159, 216, 0.45);
}

.hg-ops-intro-lead a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hg-ops-intro-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.hg-ops-signal-deck {
  max-width: 1200px;
  margin: 16px auto 0;
  border: 1px solid rgba(92, 159, 216, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-0);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0.38px, transparent 0.38px);
  background-size: 5px 5px;
}

.hg-ops-signal-deck .hg-status-bar {
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--line-faint);
}

.hg-ops-signal-deck .hg-kpi-ribbon {
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
}

.hg-ops-shell .hg-terrain-strip.ot-cli {
  max-width: none;
  min-height: 48px;
  margin: 12px 0 0;
  border: 1px solid var(--ot-cli-border);
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--ot-cli-border);
}

.hg-ops-shell .hg-terrain-strip.ot-cli .ot-canvas-host {
  min-height: 18px;
  max-height: 26px;
}

.hg-ops-shell > .hg-section {
  padding-left: 4px;
  padding-right: 4px;
}

.hg-ops-shell .hg-layer-grid {
  gap: 8px;
}

.hg-ops-shell .hg-layer-card {
  padding: 10px 12px;
}

.hg-ops-shell .hg-layer-card p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .hg-ops-shell .hg-layer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hg-ops-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-top: 8px;
}

.hg-ops-lanes .hg-section--lane {
  margin: 0;
  padding: 22px 16px 28px;
  border: 1px solid rgba(92, 159, 216, 0.1);
  border-radius: var(--radius-md);
  border-bottom: 1px solid rgba(92, 159, 216, 0.1);
  background-color: var(--surface-0);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.042) 0.4px, transparent 0.4px);
  background-size: 6px 6px;
  animation: none;
}

.hg-ops-lanes .hg-section--lane .hg-section-head {
  margin-bottom: 16px;
}

.hg-ops-lanes .hg-section--lane .hg-section-head h2 {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
}

.hg-ops-lanes .hg-form-grid.cols-3,
.hg-ops-lanes .hg-form-grid.cols-4 {
  grid-template-columns: 1fr;
}

@media (max-width: 1100px) {
  .hg-ops-lanes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hg-ops-intro {
    grid-template-columns: 1fr;
  }

  .hg-ops-ascii {
    font-size: 0.58rem;
  }
}

.hg-terminal-title-ascii {
  letter-spacing: 0.28em;
  text-transform: lowercase;
  color: var(--hg-term-accent);
}

/* ═══ Screen-reader only ═══ */

.hg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ═══ Hero manifest: world + human + agent + proof + brand ═══ */

.hg-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: min(92vh, 1200px);
  padding: 48px 24px 40px;
  overflow: hidden;
  /* Flat base — all tone from particles, not radial gradient fills */
  background-color: var(--bg-0);
}

/* Mid-frequency screen across hero plane */
.hg-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
  opacity: 0.055;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0.48px, transparent 0.48px);
  background-size: var(--hg-dot-mid) var(--hg-dot-mid);
}

/* Signal-blue particle halo at core (screened accent, not smooth glow) */
.hg-hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
  opacity: 0.2;
  background-image: radial-gradient(circle, var(--accent-particle) 0.42px, transparent 0.42px);
  background-size: 5px 5px;
  mask-image: radial-gradient(circle at 50% 50%, black 0%, black 35%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 0%, black 35%, transparent 72%);
}

/* Ordered dither + diagonal weave (local hero field) */
.hg-hero-dither {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.07) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(255, 255, 255, 0.025) 3px,
      rgba(255, 255, 255, 0.025) 4px
    );
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-position: 0 0, 2.5px 2.5px, 0 0;
}

/* LAYER 1 — Worldview */
.hg-hero-world {
  position: relative;
  z-index: 2;
  max-width: 22ch;
  margin: 0 auto 8px;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.1vw, 1.65rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(232, 236, 244, 0.94);
}

/* LAYER 5 — Brand vision (sparse corner) */
.hg-hero-brand-vision {
  position: absolute;
  z-index: 4;
  top: 52px;
  right: clamp(16px, 4vw, 36px);
  max-width: 26ch;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.45;
  letter-spacing: 0.06em;
  color: rgba(154, 168, 188, 0.68);
  text-align: right;
}

/* Stage: proof scaffold | rings */
.hg-hero-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 17ch) minmax(260px, 1fr);
  gap: clamp(12px, 3vw, 28px);
  align-items: center;
  justify-content: center;
  max-width: 1180px;
  margin: 12px auto 0;
  width: 100%;
}

.hg-hero-proof {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-right: 1px solid rgba(92, 159, 216, 0.08);
  padding-right: clamp(8px, 2vw, 16px);
  align-self: stretch;
  justify-content: center;
}

.hg-hero-proof-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.hg-hero-proof-lines {
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: rgba(168, 182, 198, 0.44);
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  border: none;
}

.hg-hero-proof-lines code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  color: inherit;
}

.hg-hero-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.hg-hero-ring-container {
  position: relative;
  width: min(560px, 78vw);
  height: min(560px, 78vw);
}

.hg-rings-svg {
  width: 100%;
  height: 100%;
}

/* Ring text styling */
.hg-ring-text-group {
  animation: ringRotate 180s linear infinite;
}

.hg-ring-text-group text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  fill: rgba(255,255,255,0.14);
}

.ring-outer text { font-size: 13px; fill: rgba(255,255,255,0.10); }
.ring-mid-outer text { font-size: 12.5px; fill: rgba(230,236,248,0.11); }
.ring-mid text { font-size: 12px; fill: rgba(220,230,245,0.13); }
.ring-mid-inner text { font-size: 11px; fill: rgba(210,224,245,0.15); }
.ring-inner text { font-size: 10.5px; fill: rgba(200,218,242,0.19); }

/* Screened signal core */
.hg-core-halftone {
  animation: corePulse 5s ease-in-out infinite;
}

.hg-core-pulse {
  animation: corePulse 4s ease-in-out infinite;
  animation-delay: 1s;
}

/* Title overlay (centered on rings) */
.hg-hero-title-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.hg-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  /* Accent from screened particles (hero ::after + SVG halftone), not text glow */
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.88);
}

.hg-hero-stratum {
  margin-top: 10px;
  max-width: 28ch;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: rgba(154, 170, 190, 0.78);
  text-transform: uppercase;
}

/* LAYER 2 — Human */
.hg-hero-human {
  position: relative;
  z-index: 2;
  max-width: 62ch;
  margin: clamp(28px, 5vw, 48px) auto 0;
  padding-top: clamp(20px, 3vw, 32px);
  border-top: 1px solid rgba(92, 159, 216, 0.08);
}

.hg-hero-human-lead,
.hg-hero-human-note {
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 1.35vw, 1.05rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink-secondary);
  margin: 0 0 1em;
}

.hg-hero-human-lead strong,
.hg-hero-human-note strong {
  font-weight: 600;
  color: var(--ink);
}

/* LAYER 3 — Agent */
.hg-hero-agent {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: clamp(20px, 3vw, 32px) auto 0;
}

.hg-hero-agent-block {
  margin: 0;
  padding: 16px 18px 18px 20px;
  border-left: 3px solid var(--accent-border);
  background-color: rgba(8, 8, 8, 0.72);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.055) 0.38px, transparent 0.38px);
  background-size: 4px 4px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: inset 0 0 0 1px var(--line-faint);
  overflow-x: auto;
}

.hg-hero-agent-block code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: rgba(210, 206, 196, 0.88);
  white-space: pre;
  display: block;
}

/* Footer row: manifest link + corner meta */
.hg-hero-footer-row {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 24px auto 0;
  padding-top: 16px;
  width: 100%;
}

.hg-hero-manifest-href {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line-faint);
  padding-bottom: 2px;
}

.hg-hero-manifest-href:hover {
  color: var(--accent-soft);
  border-bottom-color: var(--accent-border);
}

.hg-hero-corner-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .hg-hero-brand-vision {
    position: static;
    max-width: none;
    text-align: center;
    margin: 12px auto 0;
    padding: 0 12px;
  }

  .hg-hero-stage {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hg-hero-proof {
    border-right: none;
    border-bottom: 1px solid var(--line-faint);
    padding-right: 0;
    padding-bottom: 16px;
  }

  .hg-hero-proof-lines {
    font-size: 0.62rem;
    color: rgba(200, 196, 186, 0.5);
  }
}

/* ═══ Status Bar ═══ */

.hg-status-bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--line-faint);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0.4px, transparent 0.4px);
  background-size: 5px 5px;
}

.hg-status-item {
  flex: 1 1 0;
  min-width: 100px;
  padding: 10px 14px;
  background-color: var(--surface-0);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.045) 0.4px, transparent 0.4px);
  background-size: 5px 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hg-status-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.hg-status-value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.hg-status-value[data-state="ok"] { color: var(--ok); }
.hg-status-value[data-state="fail"] { color: var(--danger); }
.hg-status-value[data-state="warn"] { color: var(--warn); }

/* ═══ Sections (editorial flow) ═══ */

.hg-section {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 28px;
  border-bottom: 1px solid rgba(92, 159, 216, 0.06);
  animation: fadeInUp 0.6s var(--ease-out) both;
  background-color: transparent;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0.42px, transparent 0.42px);
  background-size: 7px 7px;
}

.hg-section-head {
  margin-bottom: 24px;
}

.hg-kicker {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent-soft);
  text-transform: uppercase;
  opacity: 0.92;
}

.hg-section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ═══ Form elements ═══ */

.hg-connect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.hg-connect-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.hg-connect-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted-strong);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.hg-connect-links a:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-1);
}

.hg-field,
.hg-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hg-field span,
.hg-field-block span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--muted-strong);
  text-transform: uppercase;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background-color: var(--surface-1);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.055) 0.38px, transparent 0.38px);
  background-size: 4px 4px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  transition: var(--transition-fast);
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

button {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--accent-deep);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0.35px, transparent 0.35px);
  background-size: 3px 3px;
  color: #f0f6fc;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 0 0 1px rgba(92, 159, 216, 0.15);
}

button:hover {
  background-color: var(--accent);
  color: #fff;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
}

button.ghost:hover {
  border-color: var(--accent-dim);
  color: var(--accent-soft);
  background: var(--surface-1);
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent-dim);
}

button.ghost:focus-visible {
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent-soft);
}

button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.hg-form-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.hg-form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.hg-form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ═══ Inline stats ═══ */

.hg-inline-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-sm);
  background-color: var(--surface-0);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0.4px, transparent 0.4px);
  background-size: 5px 5px;
}

.hg-inline-stat span {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.hg-inline-stat strong {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.hg-inline-stat.wide {
  flex: 1;
}

/* ═══ Layer cards ═══ */

.hg-layer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.hg-layer-card {
  padding: 14px;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-sm);
  background-color: var(--surface-0);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.045) 0.4px, transparent 0.4px);
  background-size: 5px 5px;
  transition: var(--transition-fast);
}

.hg-layer-card.is-active {
  border-color: var(--accent-dim);
  box-shadow: 0 0 20px var(--accent-dim);
}

.hg-layer-card h3 {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.hg-layer-card p {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ═══ KPI Ribbon ═══ */

.hg-kpi-ribbon {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  max-width: 1200px;
  margin: 0 auto;
  background-color: var(--line-faint);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0.4px, transparent 0.4px);
  background-size: 5px 5px;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.hg-kpi {
  padding: 14px;
  background-color: var(--surface-0);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.045) 0.4px, transparent 0.4px);
  background-size: 5px 5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hg-kpi-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.hg-kpi-value {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

/* ═══ Output (terminal) ═══ */

.hg-output-head {
  margin: 20px 0 8px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--muted-strong);
  text-transform: uppercase;
}

.hg-output {
  margin: 0;
  min-height: 120px;
  max-height: 340px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-sm);
  background-color: var(--bg-0);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0.4px, transparent 0.4px);
  background-size: 4px 4px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.7;
}

.hg-output-sm { min-height: 80px; max-height: 200px; }
.hg-output-tall { min-height: 240px; max-height: 500px; }

/* ═══ Fixed venue trace terminal (SSE) ═══ */

.hg-terminal-dock {
  --hg-term-bg0: #04070f;
  --hg-term-bg1: #0a101c;
  --hg-term-fg: #c8d2dc;
  --hg-term-dim: #6d7a8c;
  --hg-term-accent: #5c9fd8;
  --hg-term-ok: #7fd99a;
  --hg-term-warn: #e6c07b;
  --hg-term-err: #f07178;
  --hg-term-meta: #6a9e7c;
  --hg-term-border: rgba(92, 159, 216, 0.28);
  --hg-term-grid: 12ch minmax(9ch, 11ch) 9ch minmax(6.5ch, 8.5ch) 6.5ch minmax(10rem, 1fr) minmax(11rem, 1.35fr);

  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8000;
  padding: 0 16px;
  max-height: min(42vh, 360px);
  box-sizing: border-box;
  pointer-events: auto;
}

.hg-terminal-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: inherit;
  border: 1px solid var(--hg-term-border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: rgba(3, 6, 12, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.hg-terminal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 10px 14px 10px 16px;
  border-bottom: 1px solid var(--line-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted-strong);
  background: linear-gradient(180deg, rgba(12, 18, 30, 0.95) 0%, rgba(8, 12, 22, 0.88) 100%);
}

.hg-terminal-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hg-terminal-title {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--hg-term-accent);
  text-transform: lowercase;
}

.hg-terminal-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hg-terminal-status {
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  color: var(--hg-term-dim);
}

.hg-terminal-status[data-state="live"] {
  color: var(--hg-term-ok);
}

.hg-terminal-status[data-state="connecting"] {
  color: var(--hg-term-warn);
}

.hg-terminal-status[data-state="error"],
.hg-terminal-status[data-state="paused"] {
  color: var(--hg-term-err);
}

.hg-terminal-status[data-state="idle"] {
  color: var(--hg-term-dim);
}

.hg-terminal-bar-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.hg-terminal-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hg-terminal-filter-label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hg-terminal-filter select {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-faint);
  background: var(--hg-term-bg0);
  color: var(--hg-term-fg);
}

.hg-terminal-btn {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(92, 159, 216, 0.4);
  background: rgba(92, 159, 216, 0.1);
  color: var(--hg-term-fg);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.hg-terminal-btn.ghost {
  border-color: var(--line-faint);
  background: transparent;
  color: var(--muted-strong);
}

.hg-terminal-btn:hover {
  border-color: rgba(92, 159, 216, 0.75);
  background: rgba(92, 159, 216, 0.16);
}

.hg-terminal-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  font-family: var(--font-mono);
  color: var(--hg-term-fg);
  background: linear-gradient(180deg, var(--hg-term-bg0) 0%, var(--hg-term-bg1) 100%);
  outline: none;
}

.hg-terminal-view:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(92, 159, 216, 0.35);
}

.hg-terminal-banner {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 16px 8px;
  font-size: 0.64rem;
  line-height: 1.5;
  color: rgba(106, 158, 124, 0.92);
  border-bottom: 1px solid rgba(90, 143, 111, 0.2);
}

.hg-terminal-banner p {
  margin: 0 0 4px;
}

.hg-terminal-banner p:last-child {
  margin-bottom: 0;
}

.hg-terminal-code {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: #9ec5e8;
  font-weight: 500;
}

.hg-terminal-stream {
  flex: 1;
  min-height: 0;
  overflow: auto;
  font-size: 0.68rem;
  line-height: 1.4;
  font-feature-settings: "tnum" 1;
  scroll-behavior: smooth;
}

.hg-terminal-cols-head {
  display: grid;
  grid-template-columns: var(--hg-term-grid);
  gap: 0 10px;
  align-items: end;
  padding: 8px 14px 6px;
  margin: 0 2px;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hg-term-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--hg-term-bg0);
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: min(100%, 52rem);
}

.hg-terminal-rows {
  padding: 4px 0 12px;
  min-width: min(100%, 52rem);
}

.hg-terminal-row {
  display: grid;
  grid-template-columns: var(--hg-term-grid);
  gap: 0 10px;
  align-items: baseline;
  padding: 4px 14px;
  margin: 0 2px;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
}

.hg-term-cell.hg-term-time {
  color: var(--hg-term-dim);
}

.hg-term-cell.hg-term-channel {
  color: #9eb8d4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hg-term-cell.hg-term-verb {
  color: #b0c4d9;
  font-weight: 600;
}

.hg-term-cell.hg-term-level {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--hg-term-dim);
}

.hg-term-cell.hg-term-lat {
  color: var(--hg-term-dim);
  text-align: right;
}

.hg-term-cell.hg-term-fact {
  color: #8a9aad;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hg-term-cell.hg-term-summary {
  color: var(--hg-term-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hg-terminal-row--venue {
  border-left-color: rgba(127, 217, 154, 0.5);
}

.hg-terminal-row--pass {
  border-left-color: var(--hg-term-ok);
}

.hg-terminal-row--fail {
  border-left-color: var(--hg-term-err);
}

.hg-terminal-row--warn {
  border-left-color: var(--hg-term-warn);
}

.hg-terminal-row--meta {
  display: block;
  grid-template-columns: unset;
  padding: 5px 16px;
  margin-top: 2px;
  font-size: 0.63rem;
  line-height: 1.45;
  color: rgba(130, 170, 200, 0.95);
  border-left: none;
  background: transparent;
}

.hg-terminal-row--console {
  display: block;
  grid-template-columns: unset;
  padding: 6px 16px 8px;
  margin-top: 2px;
  border-left: 3px solid rgba(150, 160, 180, 0.45);
  border-radius: 0 5px 5px 0;
  background: rgba(255, 255, 255, 0.02);
}

.hg-console-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;
  color: #aab6c5;
}

.hg-term-prompt {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--hg-term-accent);
}

.hg-console-msg {
  flex: 1 1 12rem;
  min-width: 0;
  word-break: break-word;
}

.hg-console-meta {
  margin-top: 4px;
  padding-left: calc(12ch + 12px);
  font-size: 0.6rem;
  line-height: 1.4;
  color: var(--hg-term-dim);
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .hg-terminal-dock {
    padding: 0 8px;
  }

  .hg-console-meta {
    padding-left: 0;
  }
}

/* ═══ Footer ═══ */

.hg-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ═══ Responsive ═══ */

@media (max-width: 1000px) {
  .hg-connect-grid { grid-template-columns: 1fr; }
  .hg-form-grid.cols-3,
  .hg-form-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .hg-layer-grid { grid-template-columns: repeat(2, 1fr); }
  .hg-kpi-ribbon { grid-template-columns: repeat(2, 1fr); }
  .hg-status-bar { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .hg-topbar {
    padding: 0 14px;
    font-size: 0.62rem;
  }
  .hg-topbar-nav { display: none; }
  .hg-section { padding: 32px 16px; }
  .hg-form-grid.cols-3,
  .hg-form-grid.cols-4 { grid-template-columns: 1fr; }
  .hg-layer-grid { grid-template-columns: 1fr; }
  .hg-kpi-ribbon { grid-template-columns: 1fr; }
  .hg-hero { min-height: unset; padding: 32px 14px 28px; }
  .hg-footer { flex-direction: column; gap: 8px; }
}

/* ═══ Policy list (for closed-beta-policies etc.) ═══ */

.hg-policy-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hg-policy-list li {
  position: relative;
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--line-faint);
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.65;
}

.hg-policy-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.hg-policy-list code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--ink-soft);
}

/* ═══ Observation Terrain — Console (CLI strip) ═══ */

.hg-terrain-strip.ot-cli {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  min-height: 62px;
  height: auto;
  margin: 0 auto;
  border-bottom: 1px solid var(--ot-cli-border);
  background-color: var(--ot-cli-bg);
  background-image:
    radial-gradient(circle at 50% 120%, rgba(92, 159, 216, 0.06) 0%, transparent 55%),
    radial-gradient(circle, rgba(255, 255, 255, 0.028) 0.35px, transparent 0.35px);
  background-size: 100% 100%, 5px 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hg-terrain-strip.ot-cli .ot-canvas-host {
  min-height: 24px;
  max-height: 32px;
}

.hg-terrain-strip.ot-cli .ot-cli-ascii {
  font-size: clamp(0.5rem, 0.9vw, 0.64rem);
  line-height: 1.07;
}

.hg-terrain-strip.ot-cli .ot-cli-ruler {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══ Reduced Motion ═══ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hg-hero::after {
    opacity: 0.09;
  }

  .hg-particle-vignette {
    opacity: 0.22;
  }
}
