/* ==========================================================================
   VALIANT RACING — STYLESHEET
   Dark 2x2 Twill Carbon Fibre Base + Restrained Blue, Purple & Gold Accents
   ========================================================================== */

:root {
  --bg-obsidian: #06070B;
  --surface-card: rgba(12, 15, 24, 0.86);
  --surface-elevated: rgba(18, 22, 34, 0.92);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-accent: rgba(124, 58, 237, 0.35);

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent-blue: #3B82F6;
  --accent-purple: #8B5CF6;
  --accent-gold: #D4AF37;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
}

/* Carbon Fibre 2x2 Twill Weave Background */
body {
  margin: 0;
  background-color: #06070B;
  background-image:
    linear-gradient(27deg, #090b10 5px, transparent 5px),
    linear-gradient(207deg, #090b10 5px, transparent 5px),
    linear-gradient(27deg, #10131c 5px, transparent 5px),
    linear-gradient(207deg, #10131c 5px, transparent 5px),
    linear-gradient(90deg, #0b0d14 10px, transparent 10px),
    linear-gradient(#0b0d14 25%, #07090e 25%, #07090e 50%, transparent 50%, transparent 75%, #0d1018 75%, #0d1018);
  background-size: 20px 20px;
  background-position: 0 0, 10px 0, 10px -10px, 0 10px, 0 0, 0 0;
  color: var(--text-primary);
  overflow-x: hidden;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* Typography Helpers */
h1, h2, h3, h4 {
  margin: 0 0 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.12;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(59, 130, 246, 0.12);
  color: #CBD5E1;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.22);
}

.text-gold { color: var(--accent-gold); }
.text-blue { color: var(--accent-blue); }
.text-purple { color: var(--accent-purple); }
.muted { color: var(--text-muted); font-size: 0.88rem; }
.mt-12 { margin-top: 0.75rem; }
.mt-24 { margin-top: 1.5rem; }
.full-width { width: 100%; }

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 7, 11, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  width: min(1240px, 94vw);
  margin: 0 auto;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-crest {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  background: #0F1320;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
}

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

.brand-title {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.42);
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.15rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.btn-primary {
  background: #1D4ED8;
  border-color: #3B82F6;
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #2563EB;
}

.btn-secondary {
  background: rgba(15, 19, 32, 0.9);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent-purple);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--accent-gold);
}

.btn-ghost:hover {
  background: rgba(212, 175, 55, 0.08);
}

.btn-gold-outline {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.45);
  color: var(--accent-gold);
  font-size: 0.82rem;
  padding: 0.48rem 0.9rem;
}

.btn-gold-outline:hover {
  background: rgba(212, 175, 55, 0.16);
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.75);
}

.badge-blue {
  color: #60A5FA;
  border-color: rgba(59, 130, 246, 0.35);
}

.badge-purple {
  color: #C084FC;
  border-color: rgba(139, 92, 246, 0.35);
}

.badge-gold {
  color: var(--accent-gold);
  border-color: rgba(212, 175, 55, 0.38);
}

/* Page Views */
.page-view {
  padding: 3.5rem 0 4rem;
  animation: fadeIn 0.25s ease;
}

.page-view[hidden] {
  display: none;
}

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

/* Hero Section */
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 62ch;
  margin-bottom: 1.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-telemetry-card,
.panel-card {
  background: var(--surface-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.status-dot {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-gold);
}

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

.stat-box {
  background: rgba(6, 7, 11, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.95rem;
}

.stat-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

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

.card-footer-note {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 2.5rem 0;
}

/* Grids & Lists */
.pillars-grid,
.tiers-grid,
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.card-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.inline-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 1px solid var(--accent-blue);
  padding-bottom: 2px;
}

.section-header {
  max-width: 720px;
  margin-bottom: 2rem;
}

.section-header .badge {
  margin-bottom: 0.65rem;
}

.spec-list,
.check-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.spec-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
}

.spec-list span {
  color: var(--text-muted);
}

.check-list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.check-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent-gold);
}

.check-list.small li {
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}

/* Sponsors */
.tier-featured {
  border-color: rgba(212, 175, 55, 0.48);
  background: rgba(16, 19, 30, 0.92);
}

.tier-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.sponsor-cta-box {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.sponsor-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sponsor-form input {
  background: rgba(6, 7, 11, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.sponsor-form input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.form-feedback {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.88rem;
  color: var(--accent-gold);
}

/* 3D Preview Lab */
.preview-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr;
  gap: 1.25rem;
  align-items: stretch;
}

.viewer-frame {
  position: relative;
  min-height: 490px;
  background: radial-gradient(circle at 50% 45%, rgba(30, 41, 59, 0.42), rgba(6, 7, 11, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.viewer-frame.drag-over {
  border-color: var(--accent-gold);
  box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.35);
}

#preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.viewer-hud-top,
.viewer-hud-bottom {
  position: absolute;
  left: 1rem;
  right: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.viewer-hud-top { top: 1rem; }
.viewer-hud-bottom { bottom: 1rem; justify-content: flex-start; }

.hud-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: rgba(6, 7, 11, 0.75);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.cam-btn {
  pointer-events: auto;
  background: rgba(12, 15, 24, 0.88);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  cursor: pointer;
}

.cam-btn.active,
.cam-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.25rem;
  border: 1px dashed rgba(139, 92, 246, 0.5);
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.06);
  cursor: pointer;
  transition: background 0.18s ease;
}

.upload-box:hover {
  background: rgba(139, 92, 246, 0.12);
}

.upload-box span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Transition Band & Scroll-Driven 3D Showcase */
.transition-band {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 10, 16, 0.92);
  padding: 2.5rem 0;
}

.transition-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-gold);
}

.scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--accent-gold), transparent);
}

#scrollytelling-track {
  position: relative;
  height: 380vh;
}

.sticky-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(20, 26, 42, 0.55), rgba(6, 7, 11, 0.98));
}

#scroll-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scroll-progress-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-gold));
}

.stage-overlay {
  position: absolute;
  bottom: 2.5rem;
  left: 4vw;
  max-width: 430px;
  pointer-events: none;
}

.stage-card {
  display: none;
  background: rgba(10, 12, 20, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.35rem;
}

.stage-card.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

.stage-card .badge {
  margin-bottom: 0.55rem;
}

.stage-controls {
  position: absolute;
  bottom: 2.5rem;
  right: 4vw;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 7, 11, 0.96);
  padding: 1.75rem 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

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

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

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .hero-grid,
  .two-col-grid,
  .pillars-grid,
  .tiers-grid,
  .workflow-grid,
  .preview-layout,
  .sponsor-cta-box {
    grid-template-columns: 1fr;
  }

  .nav-actions {
    display: none;
  }

  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 0;
  }
}
