/* SeekDeep — shared visual system
   PS2 OSDSYS abyss + deep-ocean cyber
   ------------------------------------------------------------------ */
:root {
  --abyss-0: #02060f;
  --abyss-1: #050b1c;
  --abyss-2: #081434;
  --abyss-3: #0d2152;
  --abyss-4: #14306b;
  --ink:     #000a1f;
  --hull:    #f4f8ff;
  --hull-2:  #c7d6f0;
  --hull-3:  #7d92b8;
  --cyan-0:  #6df0ff;
  --cyan-1:  #2dd4ff;
  --cyan-2:  #00a8e8;
  --cyan-3:  #007ab8;
  --cyan-glow: 0 0 24px rgba(45, 212, 255, 0.45);
  --warn:    #ffb84d;
  --bad:     #ff6b6b;
  --good:    #58e6a1;

  --panel:   color-mix(in oklab, var(--abyss-2) 70%, transparent);
  --panel-hi: color-mix(in oklab, var(--abyss-3) 65%, transparent);
  --stroke:  color-mix(in oklab, var(--cyan-1) 22%, transparent);
  --stroke-hi: color-mix(in oklab, var(--cyan-1) 55%, transparent);

  --font-display: "Space Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 0px;
  --r-md: 2px;
  --r-lg: 2px;
  --r-xl: 3px;

  /* circuit-trace stroke */
  --trace: rgba(45,212,255,0.32);
  --trace-hi: rgba(109,240,255,0.7);
  --substrate: #06121f;
  --substrate-2: #0a1a30;
}

/* SeekDeep mark — animated GIF, render circular wherever it appears */
img[src*="seekdeep-mark"] {
  border-radius: 50%;
  background: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(109, 240, 255, 0.28),
    0 0 24px rgba(45, 212, 255, 0.45),
    0 0 60px rgba(45, 212, 255, 0.2);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-display);
  color: var(--hull);
  /* Backdrop now matches the chat.html .win container's gridded look so
     every page (with or without .win) shows the same subtle grid + dark
     gradient. Previously: pages with .win (chat, Control Center, installer,
     etc.) showed the grid; pages without (About, setup-wizard, boot,
     landing, mobile, tour, pitch) showed only body+abyss+bubbles, which
     read as a totally different design. Now they all share this base. */
  background:
    linear-gradient(rgba(45,212,255,0.03) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(45,212,255,0.03) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, var(--substrate-2) 0%, var(--substrate) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

/* ===== Abyss background — banner-inspired HUD ===== */
.abyss {
  position: fixed; inset: 0; z-index: -3;
  background:
    /* central vortex glow */
    radial-gradient(60% 60% at 50% 50%, rgba(45,212,255,0.18), transparent 60%),
    /* deep edges */
    radial-gradient(120% 80% at 50% 110%, rgba(0,80,160,0.45), transparent 70%),
    radial-gradient(80% 60% at 0% 0%,    rgba(20,48,120,0.65), transparent 60%),
    radial-gradient(70% 60% at 100% 100%, rgba(13,33,82,0.7),  transparent 70%),
    /* base */
    linear-gradient(180deg, #020615 0%, #041025 50%, #02060f 100%);
}

/* Concentric HUD scan rings — like the banner's central vortex */
.abyss::before {
  content: ""; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 140vmin; height: 140vmin;
  background:
    /* outer tick ring */
    radial-gradient(circle, transparent 49%, rgba(45,212,255,0.12) 49.6%, rgba(45,212,255,0.12) 50%, transparent 50.4%, transparent 100%),
    /* mid ring */
    radial-gradient(circle, transparent 39%, rgba(109,240,255,0.10) 39.6%, rgba(109,240,255,0.10) 40%, transparent 40.4%, transparent 100%),
    /* inner ring */
    radial-gradient(circle, transparent 29%, rgba(45,212,255,0.18) 29.6%, rgba(45,212,255,0.18) 30%, transparent 30.4%, transparent 100%),
    /* core glow */
    radial-gradient(circle, rgba(109,240,255,0.06) 0%, transparent 25%);
  animation: hudSweep 28s linear infinite;
  filter: drop-shadow(0 0 30px rgba(45,212,255,0.18));
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.85;
}

/* Tick-mark band — rotates faster, like a scanner */
.abyss::after {
  content: ""; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 95vmin; height: 95vmin;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg,
      transparent 0deg 4deg,
      rgba(109,240,255,0.16) 4deg 4.6deg,
      transparent 4.6deg 8deg);
  -webkit-mask: radial-gradient(circle, transparent 47%, black 47.4%, black 49.6%, transparent 50%);
          mask: radial-gradient(circle, transparent 47%, black 47.4%, black 49.6%, transparent 50%);
  animation: hudSpin 50s linear infinite;
  filter: drop-shadow(0 0 8px rgba(109,240,255,0.5));
  pointer-events: none;
}

@keyframes hudSweep {
  0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0.7; }
  50%      { transform: translate(-50%, -50%) scale(1.04) rotate(180deg); opacity: 1; }
}
@keyframes hudSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* God rays — vertical light shafts from above */
.rays {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  overflow: hidden;
}
.rays::before, .rays::after {
  content: ""; position: absolute;
  top: -10%; bottom: -20%;
  background:
    linear-gradient(180deg,
      transparent 0%,
      rgba(109,240,255,0.10) 12%,
      rgba(45,212,255,0.06) 45%,
      transparent 90%);
  width: 280px;
  filter: blur(36px);
  mix-blend-mode: screen;
  transform-origin: top center;
  animation: rayDrift 18s ease-in-out infinite alternate;
}
.rays::before { left: 14%; transform: rotate(-12deg); animation-delay: 0s; }
.rays::after  { left: 64%; transform: rotate(8deg);   animation-delay: -9s; width: 340px; }
@keyframes rayDrift {
  0%, 100% { transform: rotate(-12deg) translateX(0);  opacity: 0.6; }
  50%      { transform: rotate(-6deg)  translateX(60px); opacity: 1; }
}

/* Diagonal energy streaks · banner-inspired */
.rays::before {
  /* layered with a wider faint streak via box-shadow tricks not possible here.
     We use the existing element only — the streaks come from .bubbles. */
}

/* drifting particles layer — cubes + bubbles.
   Default opacity is intentionally subtle (~0.2) so pages without a
   .win frame don't look "noisy" with old-design particles. Pages that
   want them bolder can override per-page, but the global default is
   tuned to match the look chat.html / index.html (About) ship today. */
.bubbles {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  overflow: hidden;
  perspective: 1200px;
}
.bubbles span {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.85), rgba(109,240,255,0.4) 40%, rgba(45,212,255,0.1) 70%, transparent 100%);
  box-shadow: 0 0 10px rgba(109,240,255,0.6);
  opacity: 0.22;
  animation: drift linear infinite;
}
/* cube variants — declared via a class so we can mix bubbles + cubes */
.bubbles span.cube {
  width: 14px; height: 14px;
  border-radius: 2px;
  background:
    linear-gradient(135deg,
      rgba(255,255,255,0.12) 0%,
      rgba(109,240,255,0.18) 50%,
      rgba(0,120,180,0.08) 100%);
  border: 1px solid rgba(109,240,255,0.5);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    inset -2px -2px 0 rgba(0,0,0,0.3),
    inset 2px 2px 0 rgba(255,255,255,0.12),
    0 0 12px rgba(45,212,255,0.35);
  animation: tumble linear infinite;
  opacity: 0.18;
}
/* no-motion toggle (set by app.html's theme config when ambientMotion=false) */
body.no-motion .bubbles span,
body.no-motion .rays::before,
body.no-motion .rays::after,
body.no-motion .abyss::before,
body.no-motion .abyss::after { animation: none; }
.bubbles span.cube.big { width: 22px; height: 22px; }
.bubbles span.cube.sm  { width: 9px;  height: 9px; }

@keyframes drift {
  0%   { transform: translateY(110vh) scale(0.6); opacity: 0; }
  10%  { opacity: 0.65; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-10vh) scale(1.1); opacity: 0; }
}
@keyframes tumble {
  0%   { transform: translateY(110vh) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(0.7); opacity: 0; }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-10vh) rotateX(540deg) rotateY(360deg) rotateZ(180deg) scale(1.1); opacity: 0; }
}

/* ===== Panel system — circuit board / IC package + smoked glass ===== */
.panel,
.panel-flat,
.card-mini {
  position: relative;
  border-radius: var(--r-md);
  border: 1px solid rgba(45,212,255,0.22);
  background:
    /* faint silkscreen grid */
    linear-gradient(rgba(45,212,255,0.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(45,212,255,0.035) 1px, transparent 1px) 0 0 / 24px 24px,
    /* top sheen (subtle, no horizon line) */
    linear-gradient(180deg,
      rgba(255,255,255,0.05) 0%,
      rgba(255,255,255,0.015) 28%,
      transparent 60%),
    /* bottom cyan caustic */
    linear-gradient(0deg,
      rgba(0,168,232,0.10) 0%,
      transparent 35%),
    /* smoked-glass substrate */
    linear-gradient(180deg, rgba(10,26,48,0.78) 0%, rgba(6,18,31,0.85) 100%);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.45),
    inset 0 0 0 1px rgba(0,0,0,0.35),
    inset 0 0 28px rgba(45,212,255,0.04),
    0 14px 32px rgba(0,0,0,0.55),
    0 0 0 1px rgba(45,212,255,0.08);
  overflow: hidden;
}

/* Corner brackets — top-left + bottom-right L-marks (asymmetric, more distinguished) */
.panel::before,
.panel-flat::before,
.card-mini::before {
  content: ""; position: absolute;
  inset: 6px;
  pointer-events: none;
  background:
    linear-gradient(var(--trace-hi), var(--trace-hi)) top left / 14px 1px no-repeat,
    linear-gradient(var(--trace-hi), var(--trace-hi)) top left / 1px 14px no-repeat,
    linear-gradient(var(--trace-hi), var(--trace-hi)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--trace-hi), var(--trace-hi)) bottom right / 1px 14px no-repeat;
  filter: drop-shadow(0 0 4px rgba(109,240,255,0.7));
  z-index: 1;
}

/* Animated edge trace along top */
.panel::after,
.panel-flat::after,
.card-mini::after {
  content: ""; position: absolute;
  top: -1px; left: 24px; right: 24px;
  height: 1px;
  background:
    linear-gradient(90deg,
      transparent 0,
      var(--trace) 12%,
      var(--trace-hi) 50%,
      var(--trace) 88%,
      transparent 100%);
  filter: drop-shadow(0 0 3px var(--trace-hi));
  pointer-events: none;
  animation: traceFlow 5s ease-in-out infinite;
  z-index: 1;
}
@keyframes traceFlow {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}

.panel > *,
.panel-flat > *,
.card-mini > * { position: relative; z-index: 2; }

/* ===== Glass mixin — circuit + smoked glass for all custom card surfaces ===== */
.launcher-card,
.svc-card,
.chart-wrap,
.bot-card,
.cp-panel,
.cfg-section,
.logs-wrap,
.arch-item,
.persona-card,
.tile,
.lockup-card,
.motion-card,
.value,
.card,
.feature-card,
.step,
.voice-card {
  position: relative !important;
  border-radius: var(--r-md) !important;
  border: 1px solid rgba(45,212,255,0.22) !important;
  background:
    linear-gradient(rgba(45,212,255,0.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(45,212,255,0.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(180deg,
      rgba(255,255,255,0.05) 0%,
      rgba(255,255,255,0.015) 28%,
      transparent 60%),
    linear-gradient(0deg,
      rgba(0,168,232,0.08) 0%,
      transparent 35%),
    linear-gradient(180deg, rgba(10,26,48,0.78) 0%, rgba(6,18,31,0.85) 100%) !important;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.45),
    inset 0 0 0 1px rgba(0,0,0,0.35),
    inset 0 0 28px rgba(45,212,255,0.04),
    0 14px 32px rgba(0,0,0,0.55),
    0 0 0 1px rgba(45,212,255,0.08) !important;
  overflow: hidden;
}

.launcher-card::before,
.svc-card::before,
.chart-wrap::before,
.bot-card::before,
.cp-panel::before,
.cfg-section::before,
.logs-wrap::before,
.arch-item::before,
.persona-card::before,
.tile::before,
.lockup-card::before,
.motion-card::before,
.value::before,
.card::before,
.feature-card::before,
.step::before,
.voice-card::before {
  content: ""; position: absolute;
  inset: 6px;
  pointer-events: none;
  background:
    linear-gradient(var(--trace-hi), var(--trace-hi)) top left / 12px 1px no-repeat,
    linear-gradient(var(--trace-hi), var(--trace-hi)) top left / 1px 12px no-repeat,
    linear-gradient(var(--trace-hi), var(--trace-hi)) bottom right / 12px 1px no-repeat,
    linear-gradient(var(--trace-hi), var(--trace-hi)) bottom right / 1px 12px no-repeat;
  filter: drop-shadow(0 0 4px rgba(109,240,255,0.6));
  z-index: 1;
}

.launcher-card::after,
.svc-card::after,
.chart-wrap::after,
.cp-panel::after,
.cfg-section::after,
.tile::after,
.value::after,
.persona-card::after,
.card::after,
.bot-card::after {
  content: ""; position: absolute;
  top: -1px; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0, var(--trace) 12%,
    var(--trace-hi) 50%, var(--trace) 88%, transparent 100%);
  filter: drop-shadow(0 0 3px var(--trace-hi));
  pointer-events: none;
  animation: traceFlow 5s ease-in-out infinite;
  z-index: 1;
}

.launcher-card > *, .svc-card > *, .chart-wrap > *, .bot-card > *,
.cp-panel > *, .cfg-section > *, .logs-wrap > *, .arch-item > *,
.persona-card > *, .tile > *, .lockup-card > *, .motion-card > *,
.value > *, .card > *, .feature-card > *, .step > *, .voice-card > * {
  position: relative; z-index: 2;
}

/* Chat messages — chip packages */
.cp-msg.b {
  background: linear-gradient(180deg, var(--substrate-2), var(--substrate)) !important;
  border: 1px solid rgba(45,212,255,0.20) !important;
  border-radius: var(--r-md) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    0 6px 16px rgba(0,0,0,0.35),
    0 0 0 1px rgba(45,212,255,0.06) !important;
}
.cp-msg.u {
  background:
    linear-gradient(180deg, var(--cyan-1) 0%, var(--cyan-2) 100%) !important;
  border: 1px solid rgba(109,240,255,0.55) !important;
  border-radius: var(--r-md) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,80,120,0.5),
    0 4px 12px rgba(45,212,255,0.4),
    0 0 16px rgba(45,212,255,0.25) !important;
}

/* ===== Type ramp ===== */
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--cyan-1);
  opacity: 0.9;
}
.h-display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h-display em {
  font-style: normal;
  background: linear-gradient(180deg, var(--cyan-0), var(--cyan-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(45,212,255,0.4);
}
h1, h2, h3 { font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.mono { font-family: var(--font-mono); }

/* ===== Buttons — IC switch / key-cap ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  border: 1px solid rgba(45,212,255,0.30);
  background:
    linear-gradient(rgba(45,212,255,0.04) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(90deg, rgba(45,212,255,0.04) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(180deg, var(--substrate-2) 0%, var(--substrate) 100%);
  color: var(--hull);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    inset 0 0 0 1px rgba(0,0,0,0.3),
    0 2px 6px rgba(0,0,0,0.45);
}
.btn::before {
  content: ""; position: absolute;
  inset: 3px;
  pointer-events: none;
  background:
    linear-gradient(var(--trace-hi), var(--trace-hi)) top left / 8px 1px no-repeat,
    linear-gradient(var(--trace-hi), var(--trace-hi)) top left / 1px 8px no-repeat,
    linear-gradient(var(--trace-hi), var(--trace-hi)) bottom right / 8px 1px no-repeat,
    linear-gradient(var(--trace-hi), var(--trace-hi)) bottom right / 1px 8px no-repeat;
  filter: drop-shadow(0 0 2px rgba(109,240,255,0.6));
  opacity: 0.65;
}
.btn:hover {
  border-color: var(--cyan-1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    inset 0 0 0 1px rgba(45,212,255,0.35),
    inset 0 0 18px rgba(45,212,255,0.18),
    0 2px 8px rgba(45,212,255,0.25),
    0 0 16px rgba(45,212,255,0.18);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--cyan-1) 0%, var(--cyan-2) 100%);
  border-color: rgba(109,240,255,0.65);
  color: #001525;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,80,120,0.45),
    inset 0 0 0 1px rgba(255,255,255,0.20),
    0 2px 8px rgba(45,212,255,0.4),
    0 0 22px rgba(45,212,255,0.4);
}
.btn-primary::before { opacity: 0; }
.btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.65),
    inset 0 -1px 0 rgba(0,80,120,0.55),
    inset 0 0 0 1px rgba(255,255,255,0.30),
    0 4px 14px rgba(45,212,255,0.55),
    0 0 36px rgba(45,212,255,0.5);
}
.btn-ghost {
  background:
    linear-gradient(rgba(45,212,255,0.03) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(90deg, rgba(45,212,255,0.03) 1px, transparent 1px) 0 0 / 14px 14px,
    transparent;
  border-color: rgba(109,240,255,0.22);
}

/* ===== Logo lockup ===== */
.lockup { display: inline-flex; align-items: center; gap: 14px; }
.lockup img { width: 44px; height: 44px; border-radius: 10px; filter: drop-shadow(0 0 16px rgba(45,212,255,0.35)); }
.lockup .wm {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.04em;
}
.lockup .wm em {
  font-style: normal;
  color: var(--cyan-1);
}
/* Topnav variant — heavier lockup so the mark holds its own next to the wordmark */
.topnav .lockup img { width: 52px; height: 52px; border-radius: 12px; }
.topnav .lockup .wm { font-size: 22px; }

/* ===== Window chrome (original — not Windows 11) ===== */
.window {
  border-radius: var(--r-xl);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(13,33,82,0.55), rgba(5,11,28,0.85));
  border: 1px solid var(--stroke);
  box-shadow:
    0 50px 120px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 0 80px rgba(45,212,255,0.06);
}
.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(20,48,107,0.85), rgba(8,20,52,0.85));
  border-bottom: 1px solid var(--stroke);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hull-3);
}
.titlebar .traffic { display: flex; gap: 8px; align-items: center; }
.titlebar .traffic i {
  width: 12px; height: 12px; border-radius: 3px;
  display: inline-block;
  background: var(--abyss-3);
  border: 1px solid var(--stroke);
}
.titlebar .traffic i.min { background: linear-gradient(180deg, #1a4a8a, #0d2152); }
.titlebar .traffic i.max { background: linear-gradient(180deg, #0d2152, #14306b); }
.titlebar .traffic i.close { background: linear-gradient(180deg, var(--cyan-1), var(--cyan-3)); }
.titlebar .title { justify-self: center; }
.titlebar .right { justify-self: end; display: flex; gap: 16px; opacity: 0.7; }

/* ===== Forms — recessed copper trace ===== */
input, textarea, select {
  background: linear-gradient(180deg, #02080f 0%, #04101a 100%);
  border: 1px solid rgba(45,212,255,0.22);
  color: var(--hull);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.18s;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.55),
    inset 0 0 0 1px rgba(0,0,0,0.3);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--cyan-1);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.55),
    inset 0 0 0 1px rgba(45,212,255,0.4),
    inset 0 0 12px rgba(45,212,255,0.15),
    0 0 0 2px rgba(45,212,255,0.18);
}
input.mono, textarea.mono { font-family: var(--font-mono); font-size: 12px; }

/* ===== Status pills — silkscreen tag ===== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-md);
  border: 1px solid rgba(45,212,255,0.30);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  background: linear-gradient(180deg, var(--substrate-2), var(--substrate));
  color: var(--hull-2);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    0 1px 2px rgba(0,0,0,0.45);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hull-3); box-shadow: 0 0 6px currentColor; }
.pill.on .dot { background: var(--good); box-shadow: 0 0 8px var(--good); }
.pill.warn .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.pill.bad .dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.pill.cyan .dot { background: var(--cyan-1); box-shadow: 0 0 8px var(--cyan-0); }

/* ===== Scanline cyan rule ===== */
.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-1), transparent);
  opacity: 0.4;
  margin: 24px 0;
}

/* ===== Top nav (shared across pages) ===== */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(2, 6, 15, 0.96);
  border-bottom: 1px solid color-mix(in oklab, var(--cyan-1) 14%, transparent);
}
.topnav .links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  min-width: 0;
}
.topnav .links a {
  color: var(--hull-2);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s;
}
.topnav .links a:hover { color: var(--cyan-1); }
.topnav .links a.active { color: var(--cyan-1); }
.topnav .links a.active::after {
  content: ""; display: block; height: 1px;
  background: var(--cyan-1); margin-top: 4px;
  box-shadow: 0 0 6px var(--cyan-0);
}

/* Hamburger button — only shown at narrow widths */
.topnav .menu-toggle {
  display: none;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--cyan-1) 30%, transparent);
  border-radius: 6px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
}
.topnav .menu-toggle span {
  display: block; height: 1.5px; width: 16px;
  background: var(--cyan-1);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.topnav.is-open .menu-toggle span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.topnav.is-open .menu-toggle span:nth-child(2) { opacity: 0; }
.topnav.is-open .menu-toggle span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Tablet — tighter spacing, smaller lockup */
@media (max-width: 1100px) {
  .topnav { gap: 16px; padding: 12px 18px; }
  .topnav .links { gap: 14px; }
  .topnav .links a { font-size: 11px; letter-spacing: 0.08em; }
  .topnav .lockup img { width: 40px; height: 40px; }
  .topnav .lockup .wm { font-size: 18px; }
}

/* Mobile — hamburger drawer */
@media (max-width: 760px) {
  .topnav {
    grid-template-columns: auto 1fr auto;
    gap: 10px; padding: 10px 14px;
    position: sticky;
  }
  .topnav .lockup img { width: 36px; height: 36px; border-radius: 9px; }
  .topnav .lockup .wm { font-size: 16px; }
  .topnav .menu-toggle { display: inline-flex; }
  .topnav .links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(2, 6, 15, 0.98);
    padding: 14px 18px 18px;
    gap: 4px;
    border-bottom: 1px solid var(--stroke);
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    text-align: left;
    z-index: 60;
  }
  .topnav.is-open .links { display: flex; }
  .topnav .links a {
    padding: 10px 6px;
    font-size: 13px;
    letter-spacing: 0.12em;
    border-bottom: 1px solid color-mix(in oklab, var(--cyan-1) 8%, transparent);
  }
  .topnav .links a:last-child { border-bottom: none; }
  .topnav .links a.active::after { display: none; }
  .topnav .row .pill { font-size: 9px; padding: 4px 8px; }
}

/* Subpage shell — pages with a topnav above a fit-to-viewport .win.
   The .win-titlebar that pages used to have is gone; the topnav replaces it.
   --topnav-h is set dynamically by nav.js trackTopnavHeight(); the
   fallback values here are correct for typical desktop widths. */
:root { --topnav-h: 80px; }
body.has-topnav { overflow: hidden; }
body.has-topnav .app-wrap {
  height: calc(100dvh - var(--topnav-h));
  min-height: 360px;
}
body.has-topnav .win {
  height: calc(100dvh - var(--topnav-h) - 48px);
  grid-template-rows: 1fr !important;
}
/* Soften the heavy cyan border on the .win when paired with topnav — it's
   visual double-chrome otherwise. */
body.has-topnav .win {
  border-color: color-mix(in oklab, var(--cyan-1) 14%, transparent) !important;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.04) !important;
}
body.has-topnav .win::before { display: none !important; }

/* On narrow / mobile viewports, let pages scroll. The fixed-viewport .win
   pattern doesn't survive small screens — content gets clipped. */
@media (max-width: 760px) {
  body.has-topnav { overflow: auto; }
  body.has-topnav .app-wrap {
    height: auto;
    min-height: calc(100dvh - var(--topnav-h));
    padding: 14px;
    place-items: stretch;
  }
  body.has-topnav .win {
    height: auto;
    min-height: calc(100dvh - var(--topnav-h) - 28px);
    max-width: none;
  }
}

/* ===== Utility ===== */
.glow-text { text-shadow: 0 0 18px rgba(45,212,255,0.45); }
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--hull-3); }
.tiny { font-size: 11px; }
.center { text-align: center; }

/* ===== Image placeholder ===== */
.ph {
  background:
    repeating-linear-gradient(45deg,
      rgba(45,212,255,0.04) 0 10px,
      transparent 10px 20px),
    rgba(2,6,15,0.55);
  border: 1px dashed var(--stroke);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--hull-3);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 16px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(2,6,15,0.6); }
::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--cyan-1) 25%, transparent); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-2); }

/* Selection */
::selection { background: var(--cyan-1); color: var(--ink); }

/* ===== Blinking caret · terminal cursor (thin) ===== */
.caret::after,
.eyebrow::after,
h1.live::after,
h2.live::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--cyan-1);
  margin-left: 5px;
  box-shadow: 0 0 6px var(--cyan-0);
  animation: blink 1s steps(2, end) infinite;
  vertical-align: -0.08em;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* Standalone caret span */
.cur {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  background: var(--cyan-1);
  box-shadow: 0 0 6px var(--cyan-0);
  margin-left: 4px;
  vertical-align: -0.08em;
  animation: blink 1s steps(2, end) infinite;
}

/* Live status dot — slow pulse */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 10px var(--good);
  margin-right: 6px;
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}

/* Pin contact dots — small circuit endpoints on corners */
.pin-dot {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cyan-1);
  box-shadow: 0 0 6px var(--cyan-0);
}

/* ===== Design-time MOCK markers ===== */
/* Inline banner — matches tts.html's existing pattern. Use on pages
   with a standard topnav (inject right after </nav>). */
.mock-banner {
  margin: 14px 22px;
  padding: 10px 14px;
  background: rgba(255,184,77,0.07);
  border: 1px dashed rgba(255,184,77,0.40);
  border-radius: var(--r-md);
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}
.mock-banner strong { color: var(--warn); font-weight: 700; }
.mock-banner code {
  background: rgba(255,184,77,0.12); color: var(--warn);
  padding: 1px 5px; border-radius: 3px;
  font-family: var(--font-mono);
}

/* Small fixed-corner tag — use on full-bleed pages (decks,
   boot animation, tour overlay) where an inline banner would
   disrupt the composition. */
.mock-tag {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 100;
  padding: 5px 10px;
  background: rgba(2,6,15,0.85);
  border: 1px dashed rgba(255,184,77,0.50);
  border-radius: var(--r-md);
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.mock-tag strong { font-weight: 700; }
