/* ==========================================================================
   Swapnil Diwakar — Industrial Automation & Machine Vision Portfolio
   Precision Instrumentation / HMI Editorial Design System
   ========================================================================== */

:root {
  /* Dark Theme (Default) */
  --bg: #0a0d13;
  --bg-alt: #0f141e;
  --surface: #131926;
  --surface-elevated: #192233;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);

  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --accent-border: rgba(245, 158, 11, 0.38);

  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.14);

  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);

  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.16);

  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);

  --grid-color: rgba(148, 163, 184, 0.055);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.3);

  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --nav-height: 70px;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: #f8fafc;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.2);

  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.1);
  --accent-border: rgba(217, 119, 6, 0.35);

  --cyan: #0284c7;
  --cyan-soft: rgba(2, 132, 199, 0.1);

  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.12);

  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.12);

  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, 0.1);

  --grid-color: rgba(15, 23, 42, 0.045);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.1);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.07);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

p {
  margin: 0;
}

/* Ambient Technical Grid */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: -2;
}

.bg-glow {
  position: fixed;
  top: -180px;
  right: -120px;
  width: 680px;
  height: 680px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.11) 0%, rgba(56, 189, 248, 0.06) 42%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.container {
  width: min(1160px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #ea580c);
  color: #0a0d13;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  letter-spacing: -0.03em;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.nav-flagship {
  color: var(--accent);
  font-weight: 600;
}

.nav-links a.nav-flagship:hover {
  color: #fbbf24;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.28);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--emerald);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.74rem 1.25rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #0a0d13;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.24);
}

.btn-primary:hover {
  background: #fbbf24;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.34);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-elevated);
  border-color: var(--accent-border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

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

.btn-full {
  width: 100%;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 4.5rem 0 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 2.5rem;
  align-items: center;
}

.mono-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
}

.hero-eyebrow {
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.25rem, 4.3vw, 3.45rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 1.25rem;
}

.text-accent {
  color: var(--accent);
}

.text-cyan {
  color: var(--cyan);
}

.hero-lead {
  font-size: 1.06rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 2rem;
}

.hero-lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.hero-metrics {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.metric-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ==========================================================================
   Interactive Machine Vision & PLC Telemetry HUD
   ========================================================================== */
.hud-panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.73rem;
}

.hud-title-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 600;
}

.hud-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.hud-badge {
  color: var(--cyan);
  background: var(--cyan-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  font-weight: 500;
}

/* Compact Hero Live OpenCV + YOLOX-Nano HUD */
.hud-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-mode-pills {
  display: inline-flex;
  padding: 2px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.hud-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 600;
  padding: 0.22rem 0.52rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.hud-mode-btn.active {
  background: var(--accent);
  color: #0a0d13;
}

.hud-dual-viewports {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
}

.hud-pane {
  display: flex;
  flex-direction: column;
  background: #06090f;
}

.hud-pane-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.36rem 0.65rem;
  background: rgba(18, 25, 38, 0.92);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.hud-pane-out .hud-pane-tag span:last-child {
  color: var(--cyan);
}

.hud-viewport-single {
  height: 295px;
}

.hud-viewport-single video,
.hud-viewport-single canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  z-index: 2;
}

.hud-viewport-single video.visible,
.hud-viewport-single canvas.visible {
  display: block;
}

.hud-viewport-single canvas.visible {
  z-index: 3;
}

.hud-viewport-single .viewport-meta {
  z-index: 4;
  background: rgba(6, 9, 15, 0.72);
  padding: 0.16rem 0.45rem;
  border-radius: 4px;
}

.hud-empty-title {
  color: #e2e8f0;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
}

.hud-empty-sub {
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.hud-empty {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.hud-empty.hidden {
  display: none;
}

.hud-empty svg {
  color: var(--cyan);
  opacity: 0.75;
}

.hud-pane-out .hud-empty svg {
  color: var(--accent);
}

.hud-telemetry-strip {
  padding: 0.7rem 0.95rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: 0.45rem;
}

.hud-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.hud-engine-text {
  color: var(--text-muted);
}

.hud-meta-inline {
  color: var(--text-subtle);
}

.hud-meta-inline strong {
  color: var(--text);
}

.hud-footer-live {
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.75rem 0.95rem;
}

.hud-source-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.hud-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.hud-mini-btn:hover {
  border-color: var(--accent-border);
  background: var(--surface-elevated);
}

.hud-mini-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  cursor: pointer;
}

.hud-mini-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hud-mini-switch .switch-track {
  width: 28px;
  height: 16px;
}

.hud-mini-switch .switch-track::after {
  width: 10px;
  height: 10px;
}

.hud-mini-switch input:checked + .switch-track::after {
  transform: translateX(12px);
}

.hud-mini-conf {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.hud-mini-conf input[type="range"] {
  width: 58px;
  accent-color: var(--accent);
  cursor: pointer;
}

.hud-trigger-main.is-running {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.hud-viewport {
  position: relative;
  height: 235px;
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.07), transparent 70%),
    linear-gradient(180deg, #070a10 0%, #0d131f 100%);
  color: #cbd5e1;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.part-svg {
  width: 90%;
  max-width: 360px;
  height: auto;
}

/* Corner Reticles */
.hud-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(56, 189, 248, 0.55);
  border-style: solid;
}
.hud-corner.tl { top: 12px; left: 12px; border-width: 2px 0 0 2px; }
.hud-corner.tr { top: 12px; right: 12px; border-width: 2px 2px 0 0; }
.hud-corner.bl { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; }
.hud-corner.br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; }

/* Scanning Laser Bar */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 14px var(--cyan);
  top: 0;
  opacity: 0;
  pointer-events: none;
}

.hud-viewport.scanning .scan-line {
  opacity: 1;
  animation: sweep 0.55s ease-in-out;
}

@keyframes sweep {
  0% { top: 8%; }
  100% { top: 92%; }
}

.viewport-meta {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: rgba(203, 213, 225, 0.72);
  letter-spacing: 0.04em;
}
.viewport-meta.top-left { top: 14px; left: 28px; }
.viewport-meta.top-right { top: 14px; right: 28px; }

.bbox {
  position: absolute;
  border: 1.5px solid var(--emerald);
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.08);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.bbox.ng {
  border-color: var(--danger);
  background: rgba(244, 63, 94, 0.12);
}

.bbox-part {
  left: 30%;
  top: 34%;
  width: 19%;
  height: 33%;
}

.bbox-qr {
  left: 55%;
  top: 36%;
  width: 15%;
  height: 28%;
}

.bbox-label {
  position: absolute;
  top: -19px;
  left: -1px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--emerald);
  color: #06130f;
  white-space: nowrap;
}

.bbox.ng .bbox-label {
  background: var(--danger);
  color: #fff;
}

.viewport-verdict {
  position: absolute;
  bottom: 14px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.24rem 0.6rem;
  border-radius: 5px;
  letter-spacing: 0.05em;
}

.viewport-verdict.ok {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.viewport-verdict.ng {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.5);
}

.hud-stations {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.stations-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-subtle);
  margin-bottom: 0.55rem;
}

.station-dots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}

.st-cell {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-align: center;
  padding: 0.25rem 0;
  border-radius: 4px;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
}

.st-cell.fail {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.4);
}

.st-cell.pending {
  background: var(--surface-elevated);
  color: var(--text-subtle);
  border-color: var(--border);
}

.hud-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--surface-elevated);
}

.hud-readout {
  display: flex;
  flex-direction: column;
}

.readout-k {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-subtle);
}

.readout-v {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.btn-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-trigger:hover {
  background: var(--accent);
  color: #0a0d13;
  transform: translateY(-1px);
}

/* ==========================================================================
   Flagship Spotlight — Simple Vision
   ========================================================================== */
.flagship-section {
  padding: 2.5rem 0 4.5rem;
}

.flagship-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 158, 11, 0.13), transparent 44%),
    radial-gradient(circle at 88% 90%, rgba(56, 189, 248, 0.12), transparent 46%),
    var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: 22px;
  padding: 2.5rem;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(245, 158, 11, 0.08) inset;
}

[data-theme="light"] .flagship-card {
  box-shadow: 0 24px 60px rgba(217, 119, 6, 0.12);
}

.flagship-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.flagship-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #0a0d13;
  background: linear-gradient(90deg, var(--accent), #fbbf24);
  padding: 0.34rem 0.78rem;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.32);
}

.flagship-version {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--cyan);
  background: var(--cyan-soft);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
}

.flagship-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 2.25rem;
  align-items: start;
}

.flagship-title {
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 1rem;
}

.flagship-lead {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 58ch;
}

.pipeline-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.pipe-node {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.72rem;
  border-radius: 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
}

.pipe-node-accent {
  background: var(--emerald-soft);
  border-color: rgba(16, 185, 129, 0.42);
  color: var(--emerald);
}

.pipe-step {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
}

.pipe-node-accent .pipe-step {
  color: var(--emerald);
}

.pipe-arrow {
  font-family: var(--font-mono);
  color: var(--text-subtle);
  font-size: 0.85rem;
}

.flagship-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.btn-download-hero {
  padding: 0.85rem 1.45rem;
  font-size: 0.96rem;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.34);
}

.flagship-note {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.flagship-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.spec-tile {
  background: color-mix(in srgb, var(--surface-elevated) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.spec-tile:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.spec-k {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.spec-tile strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}

.spec-tile p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.project-card.is-flagship {
  border-color: var(--accent-border);
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.09), transparent 55%),
    var(--surface);
}

.flagship-pill-sm {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: #0a0d13;
  background: var(--accent);
  padding: 0.14rem 0.48rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Live OpenCV.js + YOLOX-Nano Browser Detector Workbench
   ========================================================================== */
.detector-workbench {
  margin-top: 2.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-strong);
}

.detector-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.detector-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.engine-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-subtle);
}

.engine-dot.loading {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 1.4s infinite;
}

.engine-dot.ready {
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.engine-dot.running {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse-dot 1s infinite;
}

.engine-dot.error {
  background: var(--danger);
}

.detector-title {
  font-size: 1.12rem;
  line-height: 1.25;
}

.detector-sub {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.detector-mode-group {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.42rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mode-btn:hover {
  color: var(--text);
}

.mode-btn.active {
  background: var(--accent);
  color: #0a0d13;
}

.detector-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.detector-dual-stage {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.stage-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #06090f;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
  transition: border-color 0.2s ease;
}

.stage-pane-output {
  border-color: rgba(56, 189, 248, 0.32);
}

.stage-pane-output::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.7), transparent);
  z-index: 3;
}

.pane-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(180deg, rgba(25, 34, 51, 0.95), rgba(18, 25, 38, 0.95));
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.69rem;
}

.pane-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #cbd5e1;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.pane-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.pane-dot-cyan {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.pane-pill {
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.pane-pill-fps {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.16);
}

.detector-stage {
  position: relative;
  min-height: 290px;
  aspect-ratio: 16 / 11;
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.06), transparent 68%),
    linear-gradient(180deg, #06090f 0%, #0b111c 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.stage-reticle {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.detector-stage video,
.detector-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  z-index: 2;
}

.detector-stage video.visible,
.detector-stage canvas.visible {
  display: block;
}

.detector-placeholder {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem;
  max-width: 310px;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.detector-placeholder.hidden {
  display: none;
}

.placeholder-orb {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.14);
  margin-bottom: 0.2rem;
}

.placeholder-orb-amber {
  color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.14);
}

.detector-placeholder p {
  color: #f1f5f9;
  font-family: var(--font-display);
  font-size: 0.98rem;
}

.detector-placeholder span {
  font-size: 0.8rem;
  line-height: 1.5;
}

.detector-controls-panel {
  background: color-mix(in srgb, var(--surface-elevated) 92%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detector-deck {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.detector-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.detector-actions-row .detector-trigger-btn {
  flex: 1 1 170px;
}

.detector-trigger-btn.is-running {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.35);
}

.upload-label {
  cursor: pointer;
}

.detector-tune-inline {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.tune-slider-wrap {
  flex: 1;
  display: grid;
  gap: 0.3rem;
}

.tune-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.tune-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Sleek Industrial Pill Switch */
.cv-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  flex-shrink: 0;
}

.cv-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.cv-switch input:checked + .switch-track {
  background: var(--cyan-soft);
  border-color: var(--cyan);
}

.cv-switch input:checked + .switch-track::after {
  transform: translateX(16px);
  background: var(--cyan);
}

.switch-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.detector-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
}

.dstat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.dstat-fps {
  border-color: rgba(56, 189, 248, 0.42);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), var(--surface));
}

.dstat-fps .dstat-v {
  color: var(--cyan);
}

.dstat-k {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
}

.dstat-v {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.detections-tray {
  display: grid;
  gap: 0.45rem;
}

.detections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.det-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.32);
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
}

.det-empty {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding: 5.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  max-width: 680px;
  margin-bottom: 3rem;
}

.section-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.75rem;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ==========================================================================
   Capabilities Grid
   ========================================================================== */
.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.35rem;
}

.cap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.cap-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.cap-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.15rem;
}

.cap-icon-cyan { background: var(--cyan-soft); color: var(--cyan); }
.cap-icon-emerald { background: var(--emerald-soft); color: var(--emerald); }
.cap-icon-violet { background: var(--violet-soft); color: var(--violet); }

.cap-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.cap-card p {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.cap-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.cap-list li {
  font-size: 0.85rem;
  color: var(--text);
  padding-left: 1.15rem;
  position: relative;
}

.cap-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ==========================================================================
   Projects Grid & Filters
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-btn {
  padding: 0.48rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-btn.active {
  background: var(--accent);
  color: #0a0d13;
  border-color: var(--accent);
  font-weight: 600;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.project-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.project-domain {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-stat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.project-card h3 {
  font-size: 1.14rem;
  margin-bottom: 0.55rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-metric-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 0.22rem 0.55rem;
  border-radius: 5px;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--text-muted);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
}

.project-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.card-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: opacity 0.2s ease;
}

.card-link:hover {
  opacity: 0.8;
}

.card-repo-link {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease;
}

.card-repo-link:hover {
  color: var(--text);
}

/* ==========================================================================
   Tech Stack Grid
   ========================================================================== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.stack-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

.stack-module-header {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.stack-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
}

.stack-module h3 {
  font-size: 1.02rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  padding: 0.32rem 0.62rem;
  border-radius: 6px;
}

.tech-tag.highlight {
  color: var(--text);
  border-color: var(--border-strong);
  font-weight: 500;
}

/* ==========================================================================
   Current Focus & Profile Card
   ========================================================================== */
.focus-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.focus-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.focus-checklist {
  display: grid;
  gap: 0.8rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
}

.check-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.profile-card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.profile-avatar-fallback {
  display: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent);
}

.profile-name {
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}

.profile-handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.profile-quote {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-style: italic;
  padding-left: 0.85rem;
  border-left: 2px solid var(--accent);
  margin-bottom: 1.35rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.pstat-val {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.02rem;
}

.pstat-lbl {
  font-size: 0.73rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   Connect Form & Footer
   ========================================================================== */
.connect-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2.5rem;
  align-items: start;
}

.connect-title {
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  margin-bottom: 0.9rem;
}

.connect-desc {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 48ch;
}

.connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contact-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 1rem;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.68rem 0.85rem;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-bottom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-top: 0.35rem;
}

.human-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.7rem;
  border-radius: 9px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.human-check input {
  width: 56px;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: center;
  outline: none;
}

.human-check input:focus {
  border-color: var(--accent);
}

.form-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  min-height: 1.2em;
}

.form-status.success {
  color: var(--emerald);
}

.form-status.error {
  color: var(--danger);
}

.form-status.sending {
  color: var(--cyan);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.35rem;
}

.footer-links a:hover {
  color: var(--text);
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 8, 14, 0.74);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: min(620px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.35rem;
  margin-top: 0.5rem;
}

.modal-body {
  padding: 1.35rem 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.modal-summary {
  color: var(--text-muted);
  font-size: 0.96rem;
}

.modal-section h4 {
  font-size: 0.86rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 0.7rem;
}

.modal-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.1rem 1.5rem 1.4rem;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Scroll Reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .status-dot { animation: none; }
  .hud-viewport.scanning .scan-line { animation: none; }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 980px) {
  .hero-grid,
  .focus-panel,
  .flagship-grid,
  .connect-grid,
  .detector-dual-stage,
  .detector-deck {
    grid-template-columns: 1fr;
  }

  .detector-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .projects-grid,
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-menu-btn {
    display: grid;
  }

  .status-pill .status-text {
    display: none;
  }

  .capabilities-grid,
  .projects-grid,
  .stack-grid,
  .flagship-specs,
  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .flagship-card {
    padding: 1.5rem;
  }

  .hero {
    padding: 3rem 0 3.5rem;
  }

  .hero-metrics {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .metric-divider {
    display: none;
  }
}
