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

:root {
  --bg: #050508;
  --accent: #ff6d3a;
  --accent2: #ff8a5c;
  --cyan: #06b6d4;
  --green: #22c55e;
  --indigo: #6366f1;
  --orange: #ff6d3a;
  --text: #f0f0f2;
  --text-sec: #b0b0be;
  --text-dim: #7a7a8e;
  --surface: #0a0a10;
  --border: rgba(255, 255, 255, 0.06);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.labs-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(to bottom, rgb(5 5 8) 0%, rgb(5 5 8 / 90%) 70%, transparent 100%);
}

.nav-wordmark {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 35%);
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-wordmark:hover {
  color: rgb(255 255 255 / 60%);
  text-shadow: 0 0 20px rgb(230 50 38 / 30%);
}

.nav-sep {
  width: 1px;
  height: 14px;
  background: rgb(255 255 255 / 12%);
}

.nav-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.6rem, 0.55rem + 0.25vw, 0.75rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #e63226;
  text-decoration: none;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.6rem, 0.55rem + 0.25vw, 0.75rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(122 122 142);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.nav-tab:hover {
  color: rgb(176 176 190);
  border-color: rgb(255 255 255 / 6%);
}

.nav-tab--active {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-tabs {
  display: none;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: nowrap;
}

.hero-tabs a {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.6rem, 0.55rem + 0.25vw, 0.75rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(122 122 142);
  text-decoration: none;
  padding: 5px 4px;
  border-radius: 100px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.hero-tabs a.active {
  color: var(--accent);
  border-color: var(--accent);
}

.tab-sep {
  width: 1px;
  height: 12px;
  background: rgb(255 255 255 / 10%);
  flex-shrink: 0;
}

.nav-mini-tabs {
  display: none;
  margin-left: auto;
  gap: 6px;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.nav-mini-tabs.visible {
  opacity: 1;
  pointer-events: auto;
}

.mini-tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: rgb(122 122 142);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.mini-tab--active {
  color: var(--accent);
  border-color: var(--accent);
}

.hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 24px;
  position: relative;
  overflow: hidden;
}

.hero-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 109, 58, 0.15), transparent);
  position: relative;
}

.hero-divider::after {
  content: '';
  position: absolute;
  inset: -15px 0;
  background: linear-gradient(90deg, transparent, rgba(255, 109, 58, 0.04), transparent);
  filter: blur(10px);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255, 109, 58, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 30% 60%, rgba(255, 138, 92, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero-title {
  font-size: clamp(2.5rem, 4vw + 1rem, 5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #ffffff 20%, #555555 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s forwards;
}

.hero-sub {
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  color: var(--text-sec);
  max-width: 640px;
  line-height: 1.6;
  text-wrap: balance;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s forwards;
}

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

.section {
  padding: clamp(60px, 8vw, 120px) 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 30%, #666666 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-desc {
  font-size: 15px;
  color: var(--text-sec);
  max-width: 560px;
  line-height: 1.6;
  text-wrap: balance;
  margin-bottom: 48px;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.viewer-embed {
  background: var(--surface);
}

.interact-gate {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(5 5 8 / 50%);
  backdrop-filter: blur(2px);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.interact-gate.hidden {
  opacity: 0;
  pointer-events: none;
}

.interact-gate-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: rgb(255 255 255 / 50%);
  padding: 8px 20px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 100px;
}

.hud-label {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
  pointer-events: none;
}

.hud-tl {
  top: 16px;
  left: 16px;
}
.hud-tr {
  top: 16px;
  right: 16px;
}
.hud-bl {
  bottom: 16px;
  left: 16px;
}
.hud-br {
  bottom: 16px;
  right: 16px;
}

.hud-accent {
  color: var(--accent);
}
.hud-green {
  color: var(--green);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}

.stat-value.cyan {
  color: var(--cyan);
}
.stat-value.green {
  color: var(--green);
}
.stat-value.indigo {
  color: var(--indigo);
}
.stat-value.orange {
  color: var(--orange);
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ═══ FLOW STEPS ═══ */
.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-top: 48px;
}

.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px 24px;
  position: relative;
}

.flow-step:first-child {
  border-radius: 12px 0 0 12px;
}
.flow-step:last-child {
  border-radius: 0 12px 12px 0;
}

.flow-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.flow-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.flow-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .labs-nav {
    padding: 16px 20px;
  }
  .nav-tabs {
    display: none;
  }
  .nav-mini-tabs {
    display: flex;
  }
  .hero-tabs {
    display: flex;
  }
  .hero {
    padding: 60px 16px 40px;
    min-height: 40vh;
    justify-content: flex-start;
  }
  .hero-title {
    margin-top: 60px;
  }
  .hero-sub {
    font-size: 15px;
  }
  .section {
    padding: clamp(40px, 6vw, 80px) 16px;
  }
  .section-desc {
    font-size: 14px;
    margin-bottom: 32px;
  }
  .canvas-wrap {
    height: 380px !important;
  }
  .canvas-wrap[style*='height: 600px'] {
    height: 450px !important;
  }
  .canvas-wrap[style*='height: 500px'] {
    height: 420px !important;
  }
  .hud-label {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .hud-tl,
  .hud-bl {
    left: 10px;
  }
  .hud-tr,
  .hud-br {
    right: 10px;
  }
  .hud-tl,
  .hud-tr {
    top: 10px;
  }
  .hud-bl,
  .hud-br {
    bottom: 10px;
  }
  .flow-steps {
    grid-template-columns: 1fr !important;
  }
  .flow-step {
    border-radius: 0 !important;
  }
  .flow-step:first-child {
    border-radius: 12px 12px 0 0 !important;
  }
  .flow-step:last-child {
    border-radius: 0 0 12px 12px !important;
  }
  .stats-row {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .stat-card {
    padding: 20px;
  }
  .stat-card[style*='grid-column'] {
    grid-column: auto !important;
  }
  .stat-value {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .canvas-wrap {
    height: 260px !important;
    border-radius: 12px;
  }
  .canvas-wrap[style*='height: 600px'] {
    height: 320px !important;
  }
  .stat-value {
    font-size: 20px;
  }
  .flow-step {
    padding: 24px 16px;
  }
}
