/* AutoArchitect AI — Style
   Design: Linear exact (see DESIGN.md)
   Font: SF Pro Display / Inter */

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

:root {
  /* Surfaces */
  --canvas:    #010102;
  --surface-1: #1c1c1f;
  --surface-2: #232328;
  --surface-3: #2a2a30;
  --surface-4: #303038;

  /* Hairlines */
  --hairline:          #23252a;
  --hairline-strong:   #3a3d44;
  --hairline-tertiary: #1a1c20;

  /* Brand — lavender, used scarcely */
  --primary:       #5e6ad2;
  --primary-hover: #828fff;
  --primary-focus: #5e69d1;

  /* Text */
  --ink:          #f7f8f8;
  --ink-muted:    #d0d6e0;
  --ink-subtle:   #8a8f98;
  --ink-tertiary: #62666d;

  /* Semantic */
  --success:     #27a644;
  --success-h:   #34d058;
  --success-dim: rgba(39, 166, 68, 0.10);
  --warn:        #d97706;
  --danger:      #dc2626;

  /* Spacing — 4px base */
  --space-xxs:     4px;
  --space-xs:      8px;
  --space-sm:      12px;
  --space-md:      16px;
  --space-lg:      24px;
  --space-xl:      32px;
  --space-xxl:     48px;
  --space-section: 96px;

  /* Radius */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-pill: 9999px;

  /* Legacy aliases — keep for pipeline/animation/JS references */
  --bg:         var(--canvas);
  --surface:    var(--surface-1);
  --surface2:   var(--surface-2);
  --surface3:   var(--surface-3);
  --border:     var(--hairline);
  --border2:    var(--hairline-strong);
  --text:       var(--ink);
  --muted:      var(--ink-subtle);
  --muted2:     var(--ink-tertiary);
  --purple:     var(--primary);
  --purple-h:   var(--primary-hover);
  --purple-dim: rgba(94, 106, 210, 0.12);
  --green:      var(--success);
  --green-h:    var(--success-h);
  --green-dim:  var(--success-dim);
  --amber:      var(--warn);
  --red:        var(--danger);
  --r:          var(--r-md);
  --r-sm-old:   var(--r-sm);
}

html {
  scroll-behavior: smooth;
  background:      var(--canvas);
}

body {
  background:  transparent;
  color:       var(--ink);
  font-family: -apple-system, "SF Pro Display", BlinkMacSystemFont,
               "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  font-size:   16px;
  line-height: 1.5;
  min-height:  100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.05px;
}

/* ── PAGE BACKGROUND VIDEO ─────────────────────── */

.page-bg-video {
  position:       fixed;
  top:            0;
  left:           0;
  width:          100vw;
  height:         100vh;
  z-index:        -2;
  overflow:       hidden;
  pointer-events: none;
}

.page-bg-video video {
  position:   absolute;
  top:        50%;
  left:       50%;
  width:      100%;
  height:     100%;
  object-fit: cover;
  transform:  translate(-50%, -50%);
  opacity:    0.45;
  filter:     blur(2px);
}

.page-bg-fade {
  position:   absolute;
  inset:      0;
  background:
    radial-gradient(ellipse at center,
      transparent 0%,
      rgba(1, 1, 2, 0.4) 60%,
      rgba(1, 1, 2, 0.85) 100%);
  pointer-events: none;
}

/* ── NAV ───────────────────────────────────────── */

.nav {
  position:      sticky;
  top:           0;
  z-index:       100;
  background:    rgba(1, 1, 2, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
  padding:       0 var(--space-lg);
  height:        52px;
}

.nav-inner {
  max-width:       1024px;
  margin:          0 auto;
  height:          100%;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             var(--space-md);
}

.nav-logo {
  font-size:       15px;
  font-weight:     600;
  color:           var(--ink);
  text-decoration: none;
  letter-spacing:  -0.3px;
  white-space:     nowrap;
}
.nav-logo span { color: var(--primary-hover); }

.nav-links {
  display:     flex;
  align-items: center;
  gap:         2px;
}

.nav-link {
  color:           var(--ink-subtle);
  text-decoration: none;
  font-size:       14px;
  font-weight:     500;
  padding:         6px var(--space-sm);
  border-radius:   var(--r-sm);
  transition:      color 150ms ease, background 150ms ease;
}
.nav-link:hover { color: var(--ink); background: var(--surface-1); }

.btn-nav-try {
  background:    var(--primary);
  border:        none;
  color:         #fff;
  font-family:   inherit;
  font-size:     14px;
  font-weight:   500;
  padding:       6px 14px;
  border-radius: var(--r-md);
  cursor:        pointer;
  transition:    background 150ms ease;
  white-space:   nowrap;
  letter-spacing: 0;
}
.btn-nav-try:hover { background: var(--primary-hover); }

/* ── MAIN ──────────────────────────────────────── */

main {
  max-width:      720px;
  margin:         0 auto;
  padding:        60px var(--space-lg) 80px;
  display:        flex;
  flex-direction: column;
  gap:            var(--space-xxl);
}

/* ── HERO ──────────────────────────────────────── */

.hero {
  position:        relative;
  min-height:      90vh;
  display:         flex;
  align-items:     center;
  justify-content: center;
  background:      transparent;
}

.hero-badge {
  display:        inline-flex;
  align-items:    center;
  gap:            7px;
  background:     var(--surface-1);
  border:         1px solid var(--hairline-strong);
  border-radius:  var(--r-pill);
  padding:        5px 14px;
  font-size:      13px;
  font-weight:    500;
  color:          var(--ink-subtle);
  letter-spacing: 0.4px;
  margin-bottom:  var(--space-xl);
}

.badge-dot {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    var(--success-h);
  flex-shrink:   0;
  animation:     bdot 2s ease-in-out infinite;
}
@keyframes bdot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.hero-title {
  font-size:      5rem;
  font-weight:    600;
  color:          var(--ink);
  letter-spacing: -3px;
  line-height:    1.05;
  margin-bottom:  var(--space-lg);
}

.hero-sub {
  font-size:      16px;
  color:          var(--ink-muted);
  max-width:      480px;
  margin:         0 auto var(--space-xs);
  line-height:    1.5;
  font-weight:    400;
  letter-spacing: -0.05px;
}

.hero-scope {
  font-size:     14px;
  color:         var(--ink-subtle);
  margin-bottom: var(--space-xl);
  font-style:    italic;
  line-height:   1.5;
}

.hero-cta {
  display:         flex;
  gap:             var(--space-xs);
  align-items:     center;
  flex-wrap:       wrap;
  justify-content: center;
  margin-top:      var(--space-xl);
}

.hero-content {
  position:        relative;
  z-index:         1;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  text-align:      center;
  max-width:       900px;
  padding:         0 var(--space-lg);
}

.primary-btn {
  display:         inline-flex;
  align-items:     center;
  padding:         8px 14px;
  background:      var(--primary);
  color:           #fff;
  font-size:       14px;
  font-weight:     500;
  border-radius:   var(--r-md);
  text-decoration: none;
  letter-spacing:  0;
  transition:      background 150ms ease;
}
.primary-btn:hover { background: var(--primary-hover); }

.secondary-btn {
  display:         inline-flex;
  align-items:     center;
  padding:         8px 14px;
  background:      var(--surface-1);
  color:           var(--ink);
  font-size:       14px;
  font-weight:     500;
  text-decoration: none;
  border-radius:   var(--r-md);
  border:          1px solid var(--hairline);
  transition:      background 150ms ease, border-color 150ms ease;
}
.secondary-btn:hover { background: var(--surface-2); border-color: var(--hairline-strong); }

/* ── INPUT CARD ─────────────────────────────────── */

.input-card {
  background:    var(--surface-1);
  border:        1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow:      hidden;
  transition:    border-color 150ms ease;
}
.input-card:hover { border-color: var(--hairline-strong); }

.input-card-inner { padding: var(--space-lg); }

.textarea-wrap { position: relative; margin-bottom: var(--space-md); }

textarea {
  width:          100%;
  background:     var(--surface-2);
  border:         1px solid var(--hairline);
  border-radius:  var(--r-md);
  color:          var(--ink);
  font-family:    inherit;
  font-size:      15px;
  line-height:    1.5;
  padding:        12px 14px 36px;
  resize:         none;
  outline:        none;
  transition:     border-color 150ms ease;
  min-height:     96px;
  letter-spacing: -0.05px;
}
textarea:focus {
  border-color: var(--primary);
  box-shadow:   0 0 0 3px rgba(94, 106, 210, 0.15);
}
textarea::placeholder { color: var(--ink-tertiary); }

.textarea-hint {
  position:       absolute;
  bottom:         10px;
  right:          12px;
  font-size:      11px;
  color:          var(--ink-tertiary);
  pointer-events: none;
}

.chips {
  display:       flex;
  flex-wrap:     wrap;
  gap:           var(--space-xxs);
  align-items:   center;
  margin-bottom: var(--space-lg);
}

.chip-label { font-size: 13px; color: var(--ink-tertiary); font-weight: 500; }

.chip {
  background:    transparent;
  border:        1px solid var(--hairline-strong);
  color:         var(--ink-subtle);
  font-family:   inherit;
  font-size:     13px;
  font-weight:   500;
  padding:       4px 10px;
  border-radius: var(--r-pill);
  cursor:        pointer;
  transition:    all 150ms ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary-hover); background: rgba(94, 106, 210, 0.08); }

.btn-launch {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--space-xs);
  width:           100%;
  background:      var(--primary);
  border:          none;
  color:           #fff;
  font-family:     inherit;
  font-size:       14px;
  font-weight:     500;
  padding:         10px var(--space-lg);
  border-radius:   var(--r-md);
  cursor:          pointer;
  transition:      background 150ms ease;
  letter-spacing:  0;
}
.btn-launch:hover    { background: var(--primary-hover); }
.btn-launch:active   { opacity: 0.9; }
.btn-launch:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── SPINNER ────────────────────────────────────── */

.spinner {
  width:     16px;
  height:    16px;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PIPELINE SECTION ───────────────────────────── */

.pipeline-section { animation: fadeUp 0.3s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pipeline-card {
  background:    var(--surface-1);
  border:        1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow:      hidden;
}

.pipeline-header {
  padding:       var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--hairline);
}

.pipeline-title-row {
  display:       flex;
  align-items:   center;
  gap:           10px;
  margin-bottom: 14px;
}

.pipeline-title {
  font-size:      13px;
  font-weight:    500;
  color:          var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pipeline-problem {
  font-size:     14px;
  color:         var(--ink);
  font-weight:   500;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
  max-width:     420px;
}

.pipeline-progress-wrap {
  height:        2px;
  background:    var(--hairline);
  border-radius: 2px;
  overflow:      hidden;
}

.pipeline-progress-bar {
  height:        100%;
  background:    var(--primary);
  border-radius: 2px;
  width:         0%;
  transition:    width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── PIPELINE STEPS ─────────────────────────────── */

.pipeline-steps { padding: var(--space-xs) 0; }

.ps {
  display:     flex;
  align-items: flex-start;
  gap:         var(--space-sm);
  padding:     10px var(--space-lg);
  animation:   fadeIn 0.22s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.ps-icon {
  flex-shrink:     0;
  width:           20px;
  height:          20px;
  margin-top:      1px;
  display:         flex;
  align-items:     center;
  justify-content: center;
}

.ps-icon-check {
  width:           20px;
  height:          20px;
  border-radius:   50%;
  background:      var(--success-dim);
  border:          1px solid var(--success);
  display:         flex;
  align-items:     center;
  justify-content: center;
}
.ps-icon-check svg { color: var(--success-h); }

.ps-icon-spin {
  width:           20px;
  height:          20px;
  border-radius:   50%;
  background:      rgba(94, 106, 210, 0.12);
  border:          1px solid var(--primary);
  display:         flex;
  align-items:     center;
  justify-content: center;
}
.ps-icon-spin svg { color: var(--primary-hover); animation: spin 0.9s linear infinite; }

.ps-icon-pending {
  width:         20px;
  height:        20px;
  border-radius: 50%;
  background:    var(--surface-3);
  border:        1px solid var(--hairline-strong);
}

.ps-body       { flex: 1; min-width: 0; }
.ps-main       { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.ps-main.muted { color: var(--ink-subtle); font-weight: 400; }
.ps-detail     { font-size: 13px; color: var(--ink-subtle); margin-top: 2px; }
.ps-time       { flex-shrink: 0; font-size: 12px; color: var(--ink-tertiary); min-width: 36px; text-align: right; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ── NEURAL NETWORK VIZ ─────────────────────────── */

.nn-viz {
  margin:        var(--space-xs) var(--space-lg) var(--space-md);
  background:    var(--canvas);
  border:        1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow:      hidden;
  animation:     fadeIn 0.3s ease both;
}

#nnCanvas {
  display: block;
  width:   100%;
  height:  160px;
}

.nn-metrics {
  display:       flex;
  gap:           0;
  border-top:    1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.nn-metric {
  flex:           1;
  display:        flex;
  flex-direction: column;
  align-items:    center;
  padding:        var(--space-xs) 10px;
  border-right:   1px solid var(--hairline);
}
.nn-metric:last-child { border-right: none; }

.nn-metric-lbl {
  font-size:      11px;
  color:          var(--ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.nn-metric-val {
  font-size:            14px;
  font-weight:          600;
  color:                var(--primary-hover);
  font-variant-numeric: tabular-nums;
  margin-top:           2px;
}

.nn-log {
  padding:        var(--space-xs) var(--space-sm);
  min-height:     74px;
  max-height:     74px;
  overflow:       hidden;
  display:        flex;
  flex-direction: column;
  justify-content: flex-end;
  gap:            2px;
}

.nn-log-line {
  font-size:     12px;
  color:         var(--ink-subtle);
  font-family:   'Menlo', 'Consolas', monospace;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
  animation:     fadeIn 0.15s ease both;
}
.nn-log-line:last-child { color: var(--ink); }

/* ── AGENT NETWORK ──────────────────────────────── */

.agent-network {
  margin:        0 var(--space-lg) var(--space-lg);
  padding:       var(--space-md);
  background:    var(--surface-2);
  border:        1px solid var(--hairline);
  border-radius: var(--r-md);
  animation:     fadeUp 0.3s ease both;
}

.agent-network-label {
  font-size:      13px;
  font-weight:    500;
  color:          var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom:  14px;
}

.agent-network-nodes { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; }

.an-node {
  background:    var(--surface-3);
  border:        1px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  padding:       var(--space-xs) 14px;
  text-align:    center;
  min-width:     90px;
}
.an-node.primary { border-color: var(--primary); background: rgba(94, 106, 210, 0.12); }

.an-node-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.an-node-sub   { font-size: 11px; color: var(--ink-subtle); margin-top: 2px; }
.an-arrow      { color: var(--ink-tertiary); font-size: 1rem; flex-shrink: 0; }

.agent-network-meta { font-size: 12px; color: var(--ink-subtle); margin-top: 10px; }

/* ── RESULTS SECTION ───────────────────────────── */

.results-section { animation: fadeUp 0.35s ease both; }

.results-card {
  background:       rgba(1, 1, 2, 0.85);
  backdrop-filter:  blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border:           1px solid rgba(94, 106, 210, 0.15);
  border-radius:    16px;
  padding:          32px;
  position:         relative;
}

.results-card::before {
  content:     '';
  position:    absolute;
  top:         0;
  left:        0;
  width:       100%;
  height:      1px;
  background:  linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  opacity:     0.4;
  border-radius: 16px 16px 0 0;
  pointer-events: none;
}

.results-top {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  gap:             var(--space-md);
  margin-bottom:   var(--space-lg);
  padding-bottom:  var(--space-lg);
  border-bottom:   1px solid var(--hairline);
}

.results-acc-num {
  font-size:      3.5rem;
  font-weight:    600;
  color:          var(--success-h);
  letter-spacing: -2px;
  line-height:    1;
}

.results-acc-label {
  font-size:      13px;
  color:          var(--ink-subtle);
  margin-top:     5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.results-acc-context {
  margin-top:  8px;
  font-size:   12px;
  color:       var(--ink-subtle);
  line-height: 1.5;
  max-width:   200px;
}

.results-acc-context.ctx-verified {
  color: var(--success-h);
}

.acc-caveat {
  display:     block;
  font-size:   11px;
  color:       var(--warn);
  margin-top:  3px;
  line-height: 1.4;
}

.results-right {
  display:        flex;
  flex-direction: column;
  align-items:    flex-end;
  gap:            var(--space-xs);
}

.verified-badge {
  display:       inline-flex;
  align-items:   center;
  gap:           6px;
  background:    var(--success-dim);
  border:        1px solid var(--success);
  color:         var(--success-h);
  font-size:     13px;
  font-weight:   500;
  padding:       4px 10px;
  border-radius: var(--r-pill);
}

.results-problem-name {
  font-size:  13px;
  color:      var(--ink-subtle);
  text-align: right;
  max-width:  280px;
}

.results-meta-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   var(--space-xs);
  margin-bottom:         var(--space-lg);
}

.rmeta-card {
  background:    var(--surface-2);
  border:        1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding:       14px var(--space-md);
}

.rmeta-val { font-size: 1.25rem; font-weight: 600; color: var(--primary-hover); line-height: 1; }
.rmeta-lbl { font-size: 12px; color: var(--ink-subtle); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.4px; }

.results-actions { display: flex; gap: var(--space-xs); }

.btn-download {
  flex:            1;
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--space-xs);
  background:      var(--success);
  border:          none;
  color:           #fff;
  font-family:     inherit;
  font-size:       14px;
  font-weight:     500;
  padding:         10px var(--space-lg);
  border-radius:   var(--r-md);
  cursor:          pointer;
  transition:      background 150ms ease;
  letter-spacing:  0;
}
.btn-download:hover    { background: var(--success-h); }
.btn-download:active   { opacity: 0.9; }
.btn-download:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background:    transparent;
  border:        1px solid var(--hairline-strong);
  color:         var(--ink-subtle);
  font-family:   inherit;
  font-size:     14px;
  font-weight:   500;
  padding:       10px var(--space-lg);
  border-radius: var(--r-md);
  cursor:        pointer;
  transition:    all 150ms ease;
  white-space:   nowrap;
}
.btn-secondary:hover { border-color: var(--ink-subtle); color: var(--ink); }

.download-hint { font-size: 13px; color: var(--success-h); margin-top: var(--space-xs); text-align: center; min-height: 18px; }

/* ── HOW IT WORKS ───────────────────────────────── */

.hiw-section {
  border-top:            1px solid var(--hairline);
  padding:               var(--space-section) var(--space-lg);
  background:            rgba(1, 1, 2, 0.65);
  backdrop-filter:       blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.hiw-inner {
  max-width: 1024px;
  margin:    0 auto;
}

.hiw-heading { text-align: center; margin-bottom: var(--space-xxl); }

.hiw-label {
  display:        inline-block;
  font-size:      13px;
  font-weight:    500;
  color:          var(--primary-hover);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom:  var(--space-sm);
}

.hiw-title {
  font-size:      2.5rem;
  font-weight:    600;
  color:          var(--ink);
  letter-spacing: -1px;
  line-height:    1.15;
}

.hiw-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   var(--space-md);
}

.hiw-card {
  background:    var(--surface-1);
  border:        1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding:       var(--space-lg);
  transition:    background 150ms ease, border-color 150ms ease;
}
.hiw-card:hover {
  background:   var(--surface-2);
  border-color: var(--hairline-strong);
}

.hiw-icon {
  width:           36px;
  height:          36px;
  border-radius:   var(--r-sm);
  background:      var(--surface-2);
  border:          1px solid var(--hairline-strong);
  display:         flex;
  align-items:     center;
  justify-content: center;
  color:           var(--ink-subtle);
  margin-bottom:   var(--space-md);
}

.hiw-icon.hiw-icon-purple {
  background:   rgba(94, 106, 210, 0.12);
  border-color: var(--primary);
  color:        var(--primary-hover);
}

.hiw-icon.hiw-icon-green {
  background:   var(--success-dim);
  border-color: var(--success);
  color:        var(--success-h);
}

.hiw-step {
  font-size:      13px;
  font-weight:    500;
  color:          var(--ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom:  var(--space-xxs);
}

.hiw-card-title {
  font-size:      22px;
  font-weight:    500;
  color:          var(--ink);
  letter-spacing: -0.4px;
  line-height:    1.25;
  margin-bottom:  var(--space-xs);
}

.hiw-card-body {
  font-size:   14px;
  color:       var(--ink-subtle);
  line-height: 1.5;
}

/* ── VERIFIED RESULTS ───────────────────────────── */

.verified-results {
  border-top:            1px solid var(--hairline);
  padding:               var(--space-section) var(--space-lg);
  text-align:            center;
  background:            rgba(1, 1, 2, 0.65);
  backdrop-filter:       blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.vr-inner {
  max-width: 960px;
  margin:    0 auto;
}

.vr-label {
  font-size:      13px;
  font-weight:    500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color:          var(--primary-hover);
  margin-bottom:  var(--space-sm);
}

.vr-title {
  font-size:      2.5rem;
  font-weight:    600;
  letter-spacing: -1px;
  color:          var(--ink);
  margin-bottom:  var(--space-xs);
  line-height:    1.15;
}

.vr-sub {
  font-size:     14px;
  color:         var(--ink-subtle);
  margin-bottom: var(--space-xxl);
  line-height:   1.5;
}

.vr-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   var(--space-md);
}

.vr-card {
  background:    var(--surface-1);
  border:        1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding:       var(--space-lg) var(--space-md);
  text-align:    center;
  cursor:        pointer;
  transition:    background 150ms ease, border-color 150ms ease;
}
.vr-card:hover {
  background:   var(--surface-2);
  border-color: var(--hairline-strong);
}
.vr-card.expanded {
  border-color: var(--primary);
  background:   rgba(94, 106, 210, 0.06);
}

.vr-card-front { pointer-events: none; }

.vr-icon {
  font-size:     1.4rem;
  margin-bottom: var(--space-xs);
  display:       block;
}

.vr-domain {
  font-size:     14px;
  font-weight:   500;
  color:         var(--ink-muted);
  margin-bottom: var(--space-sm);
  line-height:   1.4;
}

.vr-cta {
  font-size:   13px;
  font-weight: 500;
  color:       var(--primary-hover);
  transition:  opacity 150ms ease;
}
.vr-card.expanded .vr-cta { display: none; }

.vr-card-details {
  max-height: 0;
  overflow:   hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.vr-card.expanded .vr-card-details { max-height: 260px; }

.vr-accuracy {
  font-size:      2.5rem;
  font-weight:    600;
  color:          var(--ink);
  line-height:    1;
  margin:         var(--space-md) 0 var(--space-sm);
  letter-spacing: -1.5px;
}

.vr-detail-row {
  display:         flex;
  justify-content: space-between;
  align-items:     flex-start;
  gap:             var(--space-xs);
  padding:         5px 0;
  border-top:      1px solid var(--hairline);
  text-align:      left;
}

.vr-dl {
  font-size:   12px;
  font-weight: 500;
  color:       var(--ink-tertiary);
  white-space: nowrap;
  padding-top: 1px;
  flex-shrink: 0;
}

.vr-dv {
  font-size:   13px;
  color:       var(--ink-muted);
  text-align:  right;
  line-height: 1.4;
}

.vr-hide {
  font-size:   13px;
  font-weight: 500;
  color:       var(--ink-tertiary);
  margin-top:  var(--space-sm);
  transition:  color 150ms ease;
}
.vr-hide:hover { color: var(--ink-subtle); }

/* ── USE CASES ─────────────────────────────────── */

.uc-section {
  border-top:            1px solid var(--hairline);
  padding:               64px var(--space-lg);
  text-align:            center;
  background:            rgba(1, 1, 2, 0.65);
  backdrop-filter:       blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.uc-inner {
  max-width: 780px;
  margin:    0 auto;
}

.uc-label {
  font-size:      13px;
  font-weight:    500;
  color:          var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom:  var(--space-lg);
}

.uc-pills {
  display:         flex;
  flex-wrap:       wrap;
  gap:             var(--space-xs);
  justify-content: center;
}

.uc-pill {
  background:    var(--surface-2);
  border:        1px solid var(--hairline-strong);
  color:         var(--ink-subtle);
  font-size:     13px;
  font-weight:   500;
  padding:       5px 12px;
  border-radius: var(--r-pill);
  transition:    all 150ms ease;
  cursor:        default;
}
.uc-pill:hover { border-color: var(--primary); color: var(--primary-hover); background: rgba(94, 106, 210, 0.08); }

/* ── FOOTER ──────────────────────────────────────── */

.footer {
  border-top:            1px solid var(--hairline);
  padding:               var(--space-xl) var(--space-lg);
  background:            rgba(1, 1, 2, 0.8);
  backdrop-filter:       blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.footer-inner {
  max-width:       960px;
  margin:          0 auto;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             var(--space-lg);
}

.footer-left {}

.footer-logo {
  font-size:   14px;
  font-weight: 600;
  color:       var(--ink);
}
.footer-logo span { color: var(--primary-hover); }

.footer-tagline { font-size: 13px; color: var(--ink-subtle); margin-top: 3px; }

.footer-links {
  display:     flex;
  align-items: center;
  gap:         2px;
}

.footer-link {
  color:           var(--ink-subtle);
  text-decoration: none;
  font-size:       13px;
  padding:         4px 9px;
  border-radius:   var(--r-sm);
  transition:      color 150ms ease;
  white-space:     nowrap;
}
.footer-link:hover { color: var(--ink); }

.footer-right {
  text-align: right;
  font-size:  13px;
  color:      var(--ink-tertiary);
}

/* ── UTILITY ────────────────────────────────────── */

.hidden { display: none !important; }

/* ── QUICK-START CHIPS ──────────────────────────── */

.quick-start { margin-bottom: var(--space-md); }

.qs-label {
  font-size:     13px;
  color:         var(--ink-tertiary);
  font-weight:   500;
  margin-bottom: var(--space-xs);
}

.qs-chip-row {
  display:   flex;
  flex-wrap: wrap;
  gap:       6px;
}

.qs-chip {
  background:    transparent;
  border:        1px solid var(--hairline-strong);
  color:         var(--ink-subtle);
  font-family:   inherit;
  font-size:     13px;
  font-weight:   500;
  padding:       4px 11px;
  border-radius: var(--r-pill);
  cursor:        pointer;
  transition:    all 150ms ease;
}
.qs-chip:hover {
  border-color: var(--primary);
  color:        var(--primary-hover);
  background:   rgba(94, 106, 210, 0.08);
}
.qs-chip.active {
  border-color: var(--primary);
  color:        var(--primary-hover);
  background:   rgba(94, 106, 210, 0.12);
  font-weight:  500;
}

/* ── SCOPE WARNING ───────────────────────────────── */

.scope-warning {
  display:       flex;
  align-items:   center;
  gap:           var(--space-xs);
  background:    rgba(217, 119, 6, 0.08);
  border:        1px solid rgba(217, 119, 6, 0.30);
  border-radius: var(--r-sm);
  padding:       9px 14px;
  margin-bottom: var(--space-sm);
  animation:     fadeIn 0.2s ease both;
}

.scope-warn-icon  { font-size: 14px; flex-shrink: 0; }
.scope-warn-text  { font-size: 13px; color: var(--warn); font-weight: 500; }
.scope-warn-redirect { font-size: 13px; color: var(--ink-subtle); margin-left: 4px; }

/* ── CONSTRAINT CHIPS ───────────────────────────── */

.constraints { margin-bottom: var(--space-md); }

.constraint-row {
  display:    flex;
  flex-wrap:  wrap;
  gap:        6px;
  margin-top: var(--space-xs);
}

.constraint-chip {
  background:    transparent;
  border:        1px solid var(--hairline-strong);
  color:         var(--ink-subtle);
  font-family:   inherit;
  font-size:     13px;
  font-weight:   500;
  padding:       4px 11px;
  border-radius: var(--r-sm);
  cursor:        pointer;
  transition:    all 150ms ease;
  user-select:   none;
}
.constraint-chip:hover { border-color: var(--hairline-strong); color: var(--ink); }
.constraint-chip.selected {
  background:   rgba(94, 106, 210, 0.12);
  border-color: var(--primary);
  color:        var(--primary-hover);
  font-weight:  500;
}

/* ── SHIMMER ────────────────────────────────────── */

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.shimmer {
  background:      linear-gradient(90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation:       shimmer 1.5s ease-in-out infinite;
  border-radius:   var(--r-xs);
  color:           var(--ink-tertiary);
  padding:         1px 6px;
  display:         inline-block;
}

/* ── RESPONSIVE ─────────────────────────────────── */

@media (max-width: 860px) {
  .vr-grid  { grid-template-columns: repeat(2, 1fr); }
  .hiw-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .hero-title        { font-size: 2.5rem; letter-spacing: -1.5px; }
  .hero-cta          { flex-direction: column; align-items: center; }
  .results-meta-grid { grid-template-columns: 1fr 1fr; }
  .results-top       { flex-direction: column; }
  .results-right     { align-items: flex-start; }
  .nav-links         { display: none; }
  main               { padding: 40px var(--space-md) 40px; }
  .hiw-grid          { grid-template-columns: 1fr; }
  .hiw-section       { padding: 64px var(--space-md); }
  .uc-section        { padding: 48px var(--space-md); }
  .vr-grid           { grid-template-columns: 1fr; }
  .footer-inner      { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
  .footer-right      { text-align: left; }
}

/* ── AMBIENT ORBS ───────────────────────────────── */

.ambient-orbs {
  position:       fixed;
  inset:          0;
  pointer-events: none;
  z-index:        -1;
  overflow:       hidden;
}

.orb {
  position:      absolute;
  border-radius: 50%;
  filter:        blur(120px);
  opacity:       0.12;
}

.orb-1 {
  width:      600px;
  height:     600px;
  background: var(--primary);
  top:        -200px;
  left:       -200px;
  animation:  float-1 20s ease-in-out infinite;
}

.orb-2 {
  width:      500px;
  height:     500px;
  background: #7c3aed;
  bottom:     -150px;
  right:      -150px;
  animation:  float-2 25s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(100px, 50px); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(-80px, -40px); }
}

/* ── HERO BG GRID ───────────────────────────────── */

.hero-bg-grid {
  position:         absolute;
  inset:            0;
  z-index:          0;
  background-image:
    linear-gradient(rgba(94, 106, 210, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 106, 210, 0.04) 1px, transparent 1px);
  background-size:  80px 80px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  mask-image:       radial-gradient(ellipse at center, black 20%, transparent 70%);
  pointer-events:   none;
  animation:        grid-pulse 8s ease-in-out infinite;
}

@keyframes grid-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.9; }
}

/* ── PAGE ENTRANCE ANIMATIONS ───────────────────── */

.fade-up {
  opacity:   0;
  transform: translateY(20px);
  animation: entranceFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.fade-up-d1 { animation-delay: 0.08s; }
.fade-up-d2 { animation-delay: 0.18s; }
.fade-up-d3 { animation-delay: 0.28s; }
.fade-up-d4 { animation-delay: 0.40s; }

@keyframes entranceFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── SCROLL-TRIGGERED ANIMATIONS ────────────────── */

.scroll-fade {
  opacity:    0;
  transform:  translateY(24px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-fade.visible {
  opacity:   1;
  transform: translateY(0);
}

/* ── LUCIDE ICON SIZING ──────────────────────────── */

.qs-chip svg.lucide,
.constraint-chip svg.lucide {
  width:          13px;
  height:         13px;
  vertical-align: -2px;
  margin-right:   4px;
  flex-shrink:    0;
  stroke-width:   2;
}

.vr-icon svg.lucide {
  width:        24px;
  height:       24px;
  stroke-width: 1.75;
  color:        var(--ink-subtle);
}

/* ── ENHANCED HOVER EFFECTS ─────────────────────── */

.hiw-card:hover {
  transform: translateY(-2px);
}

.vr-card:hover {
  transform: translateY(-2px);
}

.primary-btn:hover {
  box-shadow: 0 4px 16px rgba(94, 106, 210, 0.35);
}

.btn-launch:hover {
  box-shadow: 0 4px 16px rgba(94, 106, 210, 0.3);
}

.hiw-card  { will-change: transform; }
.vr-card   { will-change: transform; }

/* ── ANIMATED AGENT NETWORK ARROW ───────────────── */

.an-arrow {
  display:         flex;
  align-items:     center;
  flex-shrink:     0;
  color:           var(--ink-tertiary);
}

.an-arrow svg { display: block; }

/* ── LIVE TRAINING DASHBOARD ────────────────────── */

.training-dash {
  margin-top:     10px;
  padding:        14px 16px;
  background:     var(--surface-2);
  border:         1px solid var(--hairline);
  border-radius:  var(--r-md);
  display:        flex;
  flex-direction: column;
  gap:            10px;
  animation:      entranceFadeUp 0.3s cubic-bezier(0.16,1,0.3,1) both;
}

.td-top-row {
  display:     flex;
  align-items: center;
  gap:         8px;
}

.td-phase {
  font-size:      11px;
  font-weight:    600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color:          var(--primary-hover);
}

.td-status {
  font-size:  13px;
  color:      var(--ink-muted);
  min-height: 18px;
  transition: opacity 0.25s ease;
}

.td-progress-row {
  display:     flex;
  align-items: center;
  gap:         10px;
}

.td-progress-track {
  flex:          1;
  height:        4px;
  background:    var(--surface-4);
  border-radius: 2px;
  overflow:      hidden;
}

.td-progress-fill {
  height:        100%;
  width:         0%;
  background:    var(--primary);
  border-radius: 2px;
  transition:    width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Indeterminate shimmer — active when backend training exceeds simulation time */
.td-progress-track.indeterminate .td-progress-fill {
  width:           100% !important;
  transition:      none;
  background:      linear-gradient(
    90deg,
    transparent 0%,
    var(--primary) 30%,
    #a5b4fc 50%,
    var(--primary) 70%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation:       td-shimmer 1.5s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes td-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.td-progress-pct {
  font-size:           12px;
  font-weight:         500;
  color:               var(--ink-subtle);
  min-width:           34px;
  text-align:          right;
  font-variant-numeric: tabular-nums;
}

.td-epoch-label {
  font-size:           12px;
  color:               var(--ink-subtle);
  font-variant-numeric: tabular-nums;
}

.td-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap:    8px;
}

.td-metric {
  padding:       9px 10px;
  background:    var(--surface-1);
  border:        1px solid var(--hairline);
  border-radius: var(--r-sm);
  text-align:    center;
}

.td-metric-val {
  font-size:           17px;
  font-weight:         600;
  color:               var(--ink);
  letter-spacing:      -0.4px;
  line-height:         1.2;
  font-variant-numeric: tabular-nums;
}

.td-metric-lbl {
  font-size:      10px;
  color:          var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top:     3px;
}

.td-cinematic-row {
  position:      relative;
  width:         100%;
  height:        240px;
  margin-top:    16px;
  border-radius: 12px;
  overflow:      hidden;
  background:    var(--surface-1);
  border:        1px solid var(--hairline);
}

.td-nn-bg {
  position: absolute;
  top:      0;
  left:     0;
  width:    100%;
  height:   100%;
  z-index:  1;
  opacity:  0.35;
  filter:   blur(0.5px);
}

.td-nn-bg canvas {
  width:   100%;
  height:  100%;
  display: block;
}

.td-nn-bg::after {
  content:        '';
  position:       absolute;
  top:            0;
  left:           0;
  width:          100%;
  height:         100%;
  background:     radial-gradient(ellipse at center, transparent 0%, rgba(1, 1, 2, 0.4) 100%);
  pointer-events: none;
}

.td-loss-fg {
  position:        absolute;
  top:             0;
  left:            0;
  width:           100%;
  height:          100%;
  z-index:         2;
  padding:         16px 24px;
  display:         flex;
  flex-direction:  column;
  justify-content: flex-end;
  pointer-events:  none;
}

.td-loss-label {
  font-size:      11px;
  font-weight:    500;
  letter-spacing: 0.4px;
  color:          var(--ink-subtle);
  text-transform: uppercase;
  margin-bottom:  8px;
  align-self:     flex-start;
}

.td-loss-chart {
  width:  100%;
  height: 140px;
  filter: drop-shadow(0 0 12px rgba(94, 106, 210, 0.4));
}

/* ── FADE-UP D5 ─────────────────────────────────── */

.fade-up-d5 { animation-delay: 0.52s; }

/* ── HERO VIZ ────────────────────────────────────── */

.hero-viz {
  margin:    var(--space-xl) auto var(--space-xs);
  max-width: 440px;
  width:     100%;
}

.hero-viz-svg {
  width:   100%;
  height:  auto;
  display: block;
}

.hero-viz-svg text {
  font-family: -apple-system, "SF Pro Display", BlinkMacSystemFont,
               "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
}

/* ── SECTION GLOW ────────────────────────────────── */

.section-glow {
  position:  relative;
  isolation: isolate;
}

.section-glow::before {
  content:        '';
  position:       absolute;
  inset:          0;
  pointer-events: none;
  z-index:        -1;
  background:     radial-gradient(
    ellipse 70% 45% at 50% 0%,
    rgba(94, 106, 210, 0.07) 0%,
    transparent 62%
  );
}

/* ── HIW CARD PERSONALITY PATTERNS ──────────────── */

.hiw-card { position: relative; overflow: hidden; }

/* Card 1 — sparse dot grid (describe / input) */
.hiw-card-1::before {
  content:        '';
  position:       absolute;
  inset:          0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(94,106,210,0.45) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, transparent 55%);
  mask-image:         linear-gradient(135deg, rgba(0,0,0,0.3) 0%, transparent 55%);
}

/* Card 2 — diagonal mesh (build / brain) */
.hiw-card-2::before {
  content:        '';
  position:       absolute;
  inset:          0;
  pointer-events: none;
  background-image:
    linear-gradient( 45deg, rgba(94,106,210,0.22) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(94,106,210,0.22) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, transparent 55%);
  mask-image:         linear-gradient(135deg, rgba(0,0,0,0.3) 0%, transparent 55%);
}

/* Card 3 — green corner glow (deploy) */
.hiw-card-3::before {
  content:        '';
  position:       absolute;
  inset:          0;
  pointer-events: none;
  background:     radial-gradient(ellipse at top right, rgba(39,166,68,0.1) 0%, transparent 60%);
}

/* ── TRAINING DASHBOARD 2-COLUMN ROW ─────────────── */

@media (max-width: 768px) {
  .td-cinematic-row {
    height: 180px;
  }

  .td-nn-bg {
    opacity: 0.25;
  }

  .td-loss-chart {
    height: 100px;
  }
}

/* ── PAGE VIDEO — mobile ────────────────────────── */

@media (max-width: 768px) {
  .hero {
    min-height: 75vh;
  }
  .page-bg-video video {
    opacity: 0.3;
    filter:  blur(4px);
  }
}

/* ── DOMAIN ICONS (Verified Results) ────────────── */

.vr-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  margin-bottom: 16px;
  transition: all 200ms ease;
}

.vr-icon i,
.vr-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
  stroke-width: 1.5;
}

.vr-card:hover .vr-icon {
  background: var(--surface-2);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.vr-card:hover .vr-icon i,
.vr-card:hover .vr-icon svg {
  color: var(--primary-hover);
}

@media (max-width: 768px) {
  .vr-icon {
    width: 40px;
    height: 40px;
  }

  .vr-icon i,
  .vr-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* ── REDUCED MOTION ─────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:       0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:      0.01ms !important;
  }
  .scroll-fade    { opacity: 1; transform: none; }
  .fade-up        { opacity: 1; transform: none; }
  .page-bg-video video { display: none; }
  .page-bg-video {
    background:
      radial-gradient(ellipse at center,
        rgba(94, 106, 210, 0.08) 0%,
        transparent 70%),
      var(--canvas);
  }
}
