@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,600;0,800;1,400&family=Space+Grotesk:wght@500;700;800&family=Syne:wght@700;800&display=swap');

:root {
  --bg: #050608;
  --bg-surface: #0a0d14;
  --bg-card: rgba(14, 18, 26, 0.75);
  --bg-card-hover: rgba(22, 28, 42, 0.9);
  --border: rgba(255, 184, 0, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(245, 184, 46, 0.45);
  --g: #f5b82e;
  --g-bright: #ffc848;
  --g-glow: rgba(245, 184, 46, 0.15);
  --cyan: #4de8ff;
  --cyan-glow: rgba(77, 232, 255, 0.15);
  --green: #4eff9b;
  --green-glow: rgba(78, 255, 155, 0.15);
  --red: #ff5c5c;
  --fg: #e2e8f0;
  --fg-muted: #94a3b8;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --display: "Space Grotesk", sans-serif;
  --brand: "Syne", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
}

body {
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  min-height: 100vh;
}

/* Scanlines and Dither Backdrop */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 65%, rgba(0, 0, 0, 0.5));
  mix-blend-mode: multiply;
}

/* Atmospheric Aurora Mesh & Ambient Dither */
.ambient-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(245, 184, 46, 0.08) 0%, transparent 48%),
    radial-gradient(circle at 82% 22%, rgba(77, 232, 255, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 68%, rgba(78, 255, 155, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 20% 85%, rgba(245, 184, 46, 0.05) 0%, transparent 40%);
  filter: blur(50px);
  opacity: 0.9;
  animation: aurora-breathe 14s ease-in-out infinite alternate;
}

@keyframes aurora-breathe {
  0% { transform: scale(1) translate(0, 0); opacity: 0.8; }
  50% { transform: scale(1.04) translate(10px, -15px); opacity: 1; }
  100% { transform: scale(0.98) translate(-10px, 15px); opacity: 0.85; }
}

.dither-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: radial-gradient(rgba(245, 184, 46, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.7;
}

main, header, footer {
  position: relative;
  z-index: 10;
}

/* Header */
.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  background: rgba(5, 6, 8, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  max-width: 100vw;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--g);
}

.logo-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  background: rgba(245, 184, 46, 0.12);
  border: 1px solid var(--g);
  border-radius: 3px;
  color: var(--g);
}

.logo-title {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: #fff;
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--g);
  border-color: rgba(245, 184, 46, 0.3);
  background: rgba(245, 184, 46, 0.06);
}

.nav-cta {
  color: #000 !important;
  background: var(--g) !important;
  border: 1px solid var(--g) !important;
  font-weight: 700;
}

.nav-cta:hover {
  background: var(--g-bright) !important;
  box-shadow: 0 0 14px rgba(245, 184, 46, 0.4);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 70px 24px 60px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--g);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
  background: rgba(245, 184, 46, 0.08);
  border: 1px solid rgba(245, 184, 46, 0.25);
  padding: 5px 14px;
  border-radius: 20px;
}

.hero h1 {
  font-family: var(--brand);
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.12;
  color: #fff;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

h2, h3 {
  font-family: var(--display);
  letter-spacing: -0.01em;
}

.hero h1 span {
  color: var(--g);
  text-shadow: 0 0 25px rgba(245, 184, 46, 0.3);
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 780px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--g);
  color: #000;
  border: 1px solid var(--g);
}

.btn-primary:hover {
  background: var(--g-bright);
  box-shadow: 0 0 20px rgba(245, 184, 46, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--g);
  color: var(--g);
  background: rgba(245, 184, 46, 0.05);
}

/* Physical AI Live HUD & Uncommon Web Canvas */
.hud-wrapper {
  position: relative;
  max-width: 920px;
  width: 100%;
  margin: 0 auto 40px;
  background: rgba(10, 13, 20, 0.9);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(245, 184, 46, 0.08);
}

/* Conic Border Beam */
.hud-wrapper::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  padding: 2px;
  background: conic-gradient(from 0deg, transparent 0%, var(--g) 25%, transparent 50%, var(--cyan) 75%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: border-rotate 8s linear infinite;
  opacity: 0.7;
}

@keyframes border-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hud-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.hud-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--green);
  background: rgba(78, 255, 155, 0.1);
  border: 1px solid rgba(78, 255, 155, 0.3);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.hud-live-tag::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hud-targets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hud-sensor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
  font-size: 0.72rem;
  color: var(--fg-muted);
  flex-wrap: wrap;
}

.sensor-pill-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sensor-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-size: 0.70rem;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sensor-pill:hover, .sensor-pill.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(77, 232, 255, 0.12);
  box-shadow: 0 0 8px rgba(77, 232, 255, 0.2);
}

.webcam-btn {
  background: rgba(78, 255, 155, 0.08);
  border: 1px solid rgba(78, 255, 155, 0.3);
  color: var(--green);
  font-size: 0.70rem;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.webcam-btn:hover, .webcam-btn.active {
  background: var(--green);
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(78, 255, 155, 0.35);
}

.target-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.target-pill:hover, .target-pill.active {
  border-color: var(--g);
  color: var(--g);
  background: rgba(245, 184, 46, 0.12);
  box-shadow: 0 0 10px rgba(245, 184, 46, 0.2);
}

.hud-sfx-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.hud-sfx-toggle.on {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(77, 232, 255, 0.1);
}

.canvas-container {
  position: relative;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: #030406;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#fieldkitCanvas {
  display: block;
  width: 100%;
  height: 380px;
  cursor: crosshair;
}

.hud-bottombar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  color: var(--fg-muted);
}

.hud-instruction {
  color: var(--cyan);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Interactive Mission State Machine Workbench */
.workbench-box {
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 24px;
  margin: 0 auto 70px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.workbench-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.wb-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-size: 0.82rem;
  font-family: var(--mono);
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.wb-tab:hover, .wb-tab.active {
  color: #000;
  background: var(--g);
  border-color: var(--g);
  font-weight: 700;
}

.wb-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.wb-col {
  background: rgba(4, 6, 10, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 16px;
}

.wb-label {
  font-size: 0.74rem;
  color: var(--g);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-weight: 700;
}

.wb-step-title {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 8px;
}

.wb-step-desc {
  font-size: 0.86rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.wb-voice-bubble {
  background: rgba(77, 232, 255, 0.08);
  border-left: 3px solid var(--cyan);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
  font-size: 0.84rem;
  color: var(--fg);
  margin-bottom: 14px;
}

.wb-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.wb-btn {
  padding: 8px 16px;
  font-size: 0.84rem;
  font-family: var(--mono);
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--g);
  background: rgba(245, 184, 46, 0.12);
  color: var(--g);
  transition: all 0.15s ease;
}

.wb-btn:hover {
  background: var(--g);
  color: #000;
}

.wb-btn.secondary {
  border-color: var(--border-subtle);
  background: transparent;
  color: var(--fg-muted);
}

.wb-btn.secondary:hover {
  border-color: var(--fg);
  color: #fff;
}

/* Interactive Mission DAG Node Visualizer */
.dag-container {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: rgba(4, 7, 12, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dag-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.dag-track {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  padding-bottom: 4px;
}

.dag-node {
  background: rgba(14, 18, 26, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
  position: relative;
}

.dag-node:hover {
  border-color: var(--g);
  background: rgba(245, 184, 46, 0.08);
  transform: translateY(-2px);
}

.dag-node.active {
  border-color: var(--g);
  background: rgba(245, 184, 46, 0.15);
  box-shadow: 0 0 14px rgba(245, 184, 46, 0.25);
}

.dag-node.completed {
  border-color: var(--green);
  background: rgba(78, 255, 155, 0.08);
}

.dag-node.interlock {
  border-color: var(--cyan);
  background: rgba(77, 232, 255, 0.08);
  border-style: dashed;
}

.dag-node-badge {
  font-size: 0.65rem;
  font-family: var(--mono);
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dag-node.completed .dag-node-badge { color: var(--green); }
.dag-node.active .dag-node-badge { color: var(--g); }
.dag-node.interlock .dag-node-badge { color: var(--cyan); }
.dag-node:not(.completed):not(.active):not(.interlock) .dag-node-badge { color: var(--fg-muted); }

.dag-node-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.dag-connector {
  display: flex;
  align-items: center;
  color: var(--fg-muted);
  font-size: 0.8rem;
}

.dag-connector.completed {
  color: var(--green);
}

/* In-Browser Mission YAML Builder & Validator Playground */
.yaml-builder-wrap {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.yaml-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.yaml-templates-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.yaml-tpl-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-size: 0.72rem;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.yaml-tpl-btn:hover {
  border-color: var(--g);
  color: var(--g);
  background: rgba(245, 184, 46, 0.1);
}

.yaml-editor-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  margin-bottom: 16px;
}

.yaml-editor-pane {
  display: flex;
  flex-direction: column;
}

.yaml-textarea {
  width: 100%;
  height: 220px;
  background: #020305;
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 12px;
  resize: vertical;
  outline: none;
  tab-size: 2;
}

.yaml-textarea:focus {
  border-color: var(--g);
  box-shadow: 0 0 14px rgba(245, 184, 46, 0.2);
}

.yaml-validation-output {
  height: 220px;
  background: #030407;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cyan);
}

.yaml-actions-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.yaml-run-btn {
  background: var(--g);
  color: #000;
  border: 1px solid var(--g);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.yaml-run-btn:hover {
  background: var(--g-bright);
  box-shadow: 0 0 14px rgba(245, 184, 46, 0.4);
}

/* Architectural Pipeline Flow Visualizer */
.arch-flow-wrap {
  max-width: 920px;
  width: 100%;
  margin: 0 auto 60px;
  background: rgba(10, 14, 22, 0.94);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 24px rgba(245, 184, 46, 0.06);
}

.arch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.arch-title-group h3 {
  font-size: 1.15rem;
  color: #fff;
  font-family: var(--display);
  margin-bottom: 4px;
}

.arch-title-group p {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.flow-tier {
  width: 100%;
  position: relative;
}

.flow-tier.center {
  display: flex;
  justify-content: center;
}

.flow-tier.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.flow-node {
  background: rgba(4, 7, 12, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 18px 20px;
  position: relative;
  transition: all 0.25s ease;
  cursor: default;
}

.flow-node:hover {
  border-color: var(--border-bright);
  background: rgba(14, 20, 32, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(245, 184, 46, 0.1);
}

.flow-node.highlight {
  border-color: var(--g);
  box-shadow: 0 0 20px rgba(245, 184, 46, 0.25);
}

.flow-node-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.flow-node-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--display);
}

.flow-badge-live {
  font-size: 0.68rem;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.flow-badge-live.gold {
  color: var(--g);
  background: rgba(245, 184, 46, 0.12);
  border: 1px solid rgba(245, 184, 46, 0.3);
}

.flow-badge-live.cyan {
  color: var(--cyan);
  background: rgba(77, 232, 255, 0.12);
  border: 1px solid rgba(77, 232, 255, 0.3);
}

.flow-badge-live.green {
  color: var(--green);
  background: rgba(78, 255, 155, 0.12);
  border: 1px solid rgba(78, 255, 155, 0.3);
}

.flow-node-desc {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.flow-metric-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.flow-chip {
  font-size: 0.70rem;
  font-family: var(--mono);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 3px;
}

/* Animated Flow Bus Connectors */
.flow-bus {
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.flow-bus svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bus-line {
  stroke: rgba(245, 184, 46, 0.3);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  animation: bus-dash 2s linear infinite;
}

.bus-line.cyan {
  stroke: rgba(77, 232, 255, 0.3);
}

@keyframes bus-dash {
  to { stroke-dashoffset: -20; }
}

/* Content Container */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Bento Grid */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 70px;
}

.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 24px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(350px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(245, 184, 46, 0.08), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 16px rgba(245, 184, 46, 0.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hw-badge {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--cyan);
  background: rgba(77, 232, 255, 0.08);
  border: 1px solid rgba(77, 232, 255, 0.25);
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

/* Interactive Code Snippets & Copy Buttons */
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  color: var(--g);
  border-color: var(--g);
  background: rgba(245, 184, 46, 0.1);
}

.copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
  background: rgba(78, 255, 155, 0.15);
}

/* MCP Live Query Tester */
.mcp-console-wrap {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.mcp-console-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mcp-tool-select {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-bright);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
}

.mcp-run-btn {
  background: var(--cyan);
  color: #000;
  border: 1px solid var(--cyan);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mcp-run-btn:hover {
  box-shadow: 0 0 14px rgba(77, 232, 255, 0.4);
}

kbd {
  display: inline-block;
  padding: 2px 5px;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--g);
  background: rgba(245, 184, 46, 0.1);
  border: 1px solid rgba(245, 184, 46, 0.3);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.bento-card.wide {
  grid-column: span 2;
}

.card-glyph {
  font-size: 1.8rem;
  color: var(--g);
  margin-bottom: 12px;
}

.bento-card h3 {
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 10px;
}

.bento-card p {
  color: var(--fg-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* Section Header */
.sec-head {
  text-align: center;
  margin-bottom: 40px;
}

.sec-head h2 {
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 12px;
}

.sec-head p {
  color: var(--fg-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}

/* Comparison Table */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 70px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

th, td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--g);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.col-old {
  color: #ef4444;
}

.col-new {
  color: var(--green);
  font-weight: 600;
}

/* Contribution Call to Action */
.contribute-box {
  background: linear-gradient(145deg, rgba(245, 184, 46, 0.08), rgba(14, 18, 26, 0.9));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  margin-bottom: 60px;
}

.contribute-box h2 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 16px;
}

.contribute-box p {
  color: var(--fg-muted);
  max-width: 680px;
  margin: 0 auto 28px;
  font-size: 1.02rem;
  line-height: 1.7;
}

/* Spec Badges */
.badge-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.spec-chip {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--fg);
}

/* Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 36px 24px;
  text-align: center;
  color: #64748b;
  font-size: 0.88rem;
}

footer a {
  color: var(--g);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Triple Viewport Responsiveness */
@media (max-width: 960px) {
  .yaml-editor-grid {
    grid-template-columns: 1fr;
  }
  .flow-tier.split {
    grid-template-columns: 1fr;
  }
  .wb-panel {
    grid-template-columns: 1fr;
  }
  .bento {
    grid-template-columns: 1fr;
  }
  .bento-card.wide {
    grid-column: span 1;
  }
  .bar {
    padding: 10px 14px;
    gap: 8px;
    max-width: 100vw;
  }
  nav {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: calc(100vw - 180px);
  }
  nav::-webkit-scrollbar {
    display: none;
  }
  .nav-link {
    padding: 3px 6px;
    font-size: 0.76rem;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .bar {
    padding: 10px 12px;
    gap: 8px;
  }
  .logo-title {
    font-size: 0.90rem;
    letter-spacing: 0.04em;
  }
  nav {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar {
    display: none;
  }
  .nav-link {
    padding: 3px 6px;
    font-size: 0.74rem;
    white-space: nowrap;
  }
  #fieldkitCanvas {
    height: 260px;
  }
  .arch-flow-wrap {
    padding: 16px 12px;
  }
  .hud-wrapper {
    padding: 10px;
    margin-bottom: 24px;
  }
  .hud-topbar, .hud-bottombar {
    font-size: 0.70rem;
  }
  .target-pill {
    font-size: 0.68rem;
    padding: 2px 6px;
  }
  .workbench-box {
    padding: 14px 10px;
  }
  .wb-tab {
    font-size: 0.72rem;
    padding: 4px 8px;
  }
  .hero {
    padding: 36px 12px 30px;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    justify-content: center;
    font-size: 0.88rem;
    padding: 10px 16px;
  }
  .diagram-wrap {
    padding: 12px;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
  }
  .diagram-wrap pre {
    font-size: 0.62rem;
    line-height: 1.25;
  }
  .table-wrap {
    max-width: calc(100vw - 24px);
    overflow-x: auto;
  }
  table {
    font-size: 0.78rem;
  }
  th, td {
    padding: 10px 12px;
  }
  .contribute-box {
    padding: 24px 14px;
  }
  .container {
    padding: 0 12px 60px;
    max-width: 100vw;
    overflow-x: hidden;
  }
}
