/* ==========================================================================
   PIT CREW HUB - SIM RACING TELEMETRY TOOLING
   Official Design System & Stylesheet
   Brand Color Tokens:
     --color-racing-blue:   #004080
     --color-asphalt-grey:  #404040
     --color-velocity-red:  #E60000
     --color-speed-white:   #FFFFFF
     --color-track-orange:  #FF8000
     --color-carbon-black:  #101010
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,600;0,700;0,800;0,900;1,400;1,700&display=swap');

:root {
  /* Revamped KMP Application Color System (with Velocity Violet Accent) */
  --color-racing-blue: #3B82F6;
  --color-racing-blue-dark: #1A2B4C;
  --color-racing-blue-light: #60A5FA;
  --color-racing-blue-glow: rgba(59, 130, 246, 0.4);
  
  --color-cyan-accent: #38BDF8;
  --color-emerald-accent: #10B981;

  --color-asphalt-grey: #334155;
  --color-asphalt-grey-light: #475569;
  --color-asphalt-grey-dark: #1E293B;

  --color-velocity-violet: #A855F7;
  --color-velocity-violet-hover: #C084FC;
  --color-velocity-violet-glow: rgba(168, 85, 247, 0.45);

  --color-speed-white: #F8FAFC;
  --color-speed-offwhite: #E2E8F0;
  --color-speed-muted: #9EAFC9;

  --color-track-orange: #FF9800;
  --color-track-orange-glow: rgba(255, 152, 0, 0.35);

  --color-carbon-black: #0F172A;
  --color-carbon-card: #1E293B;
  --color-carbon-card-hover: #26334D;
  
  /* Typography */
  --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Container & Layout */
  --max-width: 1240px;
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  background-color: var(--color-carbon-black);
  color: var(--color-speed-white);
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  background-color: var(--color-carbon-black);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(168, 85, 247, 0.18) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  min-height: 100vh;
}

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

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

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-speed-white);
}

.text-gradient-violet, .text-gradient-red {
  background: linear-gradient(135deg, var(--color-speed-white) 0%, #E9D5FF 50%, var(--color-velocity-violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-blue {
  background: linear-gradient(135deg, var(--color-speed-white) 30%, #80B3FF 70%, var(--color-racing-blue-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-velocity-violet) 0%, #7E22CE 100%);
  color: var(--color-speed-white);
  box-shadow: 0 4px 20px var(--color-velocity-violet-glow), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-velocity-violet-hover) 0%, var(--color-velocity-violet) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-speed-white);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-racing-blue-light);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0, 64, 128, 0.25);
  border: 1px solid var(--color-racing-blue);
  color: #80B3FF;
}

.badge-violet, .badge-red {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--color-velocity-violet);
  color: #E9D5FF;
}

.badge-orange {
  background: rgba(255, 128, 0, 0.2);
  border-color: var(--color-track-orange);
  color: #FFC280;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(16, 16, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0;
  transition: all var(--transition-fast);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.brand-title-group {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--color-speed-white);
  line-height: 1.1;
}

.brand-tagline {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--color-track-orange);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-speed-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-speed-white);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--color-velocity-red);
  transition: width var(--transition-fast);
  border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-speed-white);
  font-size: 24px;
  cursor: pointer;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 20px;
  line-height: 1.05;
}

.hero-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--color-speed-offwhite);
  margin-bottom: 36px;
  max-width: 580px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
}

.detected-os-text {
  font-size: 12px;
  color: var(--color-speed-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Live Telemetry Cockpit Demo (Hero Right Column / Visual Mockup)
   ========================================================================== */
.cockpit-preview {
  position: relative;
  background: rgba(24, 24, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.8),
    0 0 40px var(--color-racing-blue-glow);
  backdrop-filter: blur(10px);
}

.cockpit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #4ADE80;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: #4ADE80;
  border-radius: 50%;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* RPM Shift Lights Bar */
.shift-lights-bar {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 8px;
}

.shift-light {
  flex: 1;
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.1s ease;
}

.shift-light.green.active { background: #22C55E; box-shadow: 0 0 10px #22C55E; }
.shift-light.yellow.active { background: #EAB308; box-shadow: 0 0 10px #EAB308; }
.shift-light.red.active { background: #A855F7; box-shadow: 0 0 12px #A855F7; animation: flashViolet 0.4s infinite alternate; }

@keyframes flashViolet {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Dashboard Gauges Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.dash-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 16px;
  text-align: center;
}

.dash-card-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--color-speed-muted);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.speed-value-group {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.speed-value {
  font-size: 42px;
  font-weight: 900;
  color: var(--color-speed-white);
  line-height: 1;
}

.speed-unit {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-speed-muted);
}

.gear-display {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 900;
  color: var(--color-velocity-violet);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid var(--color-velocity-violet);
  border-radius: 8px;
  height: 54px;
}

/* Input Pedals Visual Bar */
.pedal-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.pedal-label {
  font-size: 10px;
  font-weight: 700;
  width: 45px;
  color: var(--color-speed-muted);
}

.pedal-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.pedal-fill-throttle {
  height: 100%;
  width: 85%;
  background: linear-gradient(90deg, #10B981, #34D399);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  border-radius: 5px;
}

.pedal-fill-brake {
  height: 100%;
  width: 15%;
  background: linear-gradient(90deg, #EF4444, #F87171);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  border-radius: 5px;
}

/* Simulated Voice Radio Callout */
.radio-callout-box {
  background: linear-gradient(135deg, rgba(0, 64, 128, 0.3) 0%, rgba(16, 16, 16, 0.9) 100%);
  border: 1px solid var(--color-racing-blue);
  border-radius: var(--border-radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.radio-icon {
  font-size: 22px;
  color: var(--color-track-orange);
  animation: pulseSpeaker 1.2s infinite alternate;
}

@keyframes pulseSpeaker {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); color: var(--color-velocity-violet); }
}

.radio-text-group {
  display: flex;
  flex-direction: column;
}

.radio-speaker {
  font-size: 10px;
  font-weight: 800;
  color: var(--color-track-orange);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.radio-message {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-speed-white);
  font-style: italic;
}

/* ==========================================================================
   Feature Grid Section
   ========================================================================== */
.features-section {
  padding: 100px 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
}

.section-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-track-orange);
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-size: clamp(28px, 3.5vw, 44px);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--color-speed-muted);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--color-carbon-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  padding: 28px 20px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-racing-blue), var(--color-velocity-violet));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-6px);
  background: var(--color-carbon-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(168, 85, 247, 0.2);
}

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

.feature-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(0, 64, 128, 0.2);
  border: 1px solid var(--color-racing-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
  color: var(--color-speed-white);
}

.feature-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 13.5px;
  color: var(--color-speed-muted);
  line-height: 1.55;
}

/* ==========================================================================
   Brand & Visual Heritage Showcase Section
   ========================================================================== */
.brand-showcase-section {
  padding: 80px 0;
  background: rgba(0, 64, 128, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.brand-image-box {
  background: rgba(16, 16, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.brand-image-box img {
  border-radius: var(--border-radius);
  width: 100%;
}

.brand-text-content h3 {
  font-size: 32px;
  margin-bottom: 16px;
}

.brand-text-content p {
  font-size: 16px;
  color: var(--color-speed-offwhite);
  margin-bottom: 24px;
}

.brand-pillar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pillar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
}

.pillar-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-velocity-violet);
  color: var(--color-speed-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}

/* ==========================================================================
   Download Hub Section
   ========================================================================== */
.downloads-section {
  padding: 100px 0;
  position: relative;
  scroll-margin-top: 80px;
}

.os-detected-banner {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.25) 0%, rgba(59, 130, 246, 0.3) 100%);
  border: 1px solid var(--color-velocity-violet);
  border-radius: var(--border-radius);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.os-detected-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
}

.download-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.download-card {
  background: var(--color-carbon-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  height: 100%;
}

.download-card.highlighted {
  border-color: var(--color-velocity-violet);
  box-shadow: 0 0 30px var(--color-velocity-violet-glow);
  transform: translateY(-4px);
}

.download-card.highlighted::after {
  content: 'RECOMMENDED';
  position: absolute;
  top: -12px;
  background: var(--color-velocity-violet);
  color: var(--color-speed-white);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 50px;
  white-space: nowrap;
}

.download-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-6px);
}

.platform-icon {
  font-size: 34px;
  margin-bottom: 12px;
  color: var(--color-speed-white);
}

.platform-name {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
  white-space: nowrap;
}

.platform-sub {
  font-size: 11px;
  color: var(--color-speed-muted);
  margin-bottom: 16px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
}

.download-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: auto;
}

.download-btn-group .btn {
  padding: 8px 6px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: #0A0A0A;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.footer-desc {
  font-size: 14px;
  color: var(--color-speed-muted);
  max-width: 360px;
}

.footer-col-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-speed-white);
  margin-bottom: 18px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 14px;
  color: var(--color-speed-muted);
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-speed-muted);
}

.telemetry-status-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #80B3FF;
  background: rgba(0, 64, 128, 0.2);
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--color-racing-blue);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .download-cards-grid, .features-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 16px;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
  }
  .download-card {
    flex: 0 0 210px;
    scroll-snap-align: start;
  }
  .feature-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
  }
}

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .brand-showcase-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .mobile-toggle {
    display: block;
  }
  .hero-title {
    font-size: 36px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
