@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Brand Colors */
  --bg-main: #06070a;
  --bg-surface: #0e1118;
  --bg-surface-elevated: #161b26;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Accent Colors per Series */
  --accent-f1: #ff1e56;     /* Neon Sport Red */
  --accent-wec: #0082ff;    /* Le Mans Blue */
  --accent-imsa: #10b981;   /* Sebring Green */
  --accent-indy: #f97316;   /* Speedway Orange */
  --accent-general: #e10600; /* Sport Red */

  /* Glassmorphism Defaults */
  --glass-bg: rgba(14, 17, 24, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(16px);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  /* Fonts */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-elevated);
  border-radius: 4px;
  border: 2px solid var(--bg-main);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition-fast);
}

.header--scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--glass-shadow);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 28px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active {
  position: relative;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-f1), var(--accent-general));
  border-radius: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.75rem;
  transition: var(--transition-fast);
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-f1), var(--accent-general));
  color: white;
  box-shadow: 0 4px 20px rgba(255, 30, 86, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 30, 86, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  padding-top: 10rem;
  padding-bottom: 6rem;
  position: relative;
  overflow: hidden;
}

/* Premium Background Glows */
.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 20%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(255, 30, 86, 0.15) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -10%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(225, 6, 0, 0.1) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-f1);
  gap: 0.5rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-f1);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-f1);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 1.1;
  font-weight: 900;
}

.hero-title span {
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.hero-badges {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.hero-badges img {
  height: 40px;
  opacity: 0.85;
  transition: var(--transition-fast);
}

.hero-badges img:hover {
  opacity: 1;
  transform: scale(1.02);
}

/* Phone Mockup in Hero */
.mockup-container {
  display: flex;
  justify-content: center;
  position: relative;
}

.phone-mockup {
  width: 320px;
  height: 640px;
  background: #000;
  border-radius: 40px;
  border: 12px solid #161b26;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(225, 6, 0, 0.15);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-screen {
  flex: 1;
  background: #0c0e14;
  display: flex;
  flex-direction: column;
  color: #fff;
  font-size: 0.75rem;
}

.phone-header {
  height: 50px;
  background: #121620;
  padding: 15px 15px 5px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.phone-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
}

.phone-battery {
  display: flex;
  gap: 4px;
}

.phone-body {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.mock-card {
  background: #181d28;
  border-radius: 12px;
  padding: 10px;
  border-left: 4px solid var(--accent-f1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition-normal);
}

.mock-card--wec { border-left-color: var(--accent-wec); }
.mock-card--imsa { border-left-color: var(--accent-imsa); }
.mock-card--indy { border-left-color: var(--accent-indy); }

.mock-meta {
  display: flex;
  justify-content: space-between;
  color: #64748b;
  font-size: 0.65rem;
}

.mock-event {
  font-weight: 700;
  font-size: 0.8rem;
}

.mock-track {
  color: #94a3b8;
}

.mock-timer {
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--accent-f1);
  border: 1px dashed rgba(255, 30, 86, 0.2);
}

/* Series Showcase Tabs */
.series-section {
  padding: 6rem 0;
  background: var(--bg-surface);
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-title {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 900;
}

.series-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.tab-btn.active[data-series="f1"] {
  background: rgba(255, 30, 86, 0.15);
  border-color: var(--accent-f1);
  color: var(--accent-f1);
}

.tab-btn.active[data-series="wec"] {
  background: rgba(0, 130, 255, 0.15);
  border-color: var(--accent-wec);
  color: var(--accent-wec);
}

.tab-btn.active[data-series="imsa"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-imsa);
  color: var(--accent-imsa);
}

.tab-btn.active[data-series="indy"] {
  background: rgba(249, 115, 22, 0.15);
  border-color: var(--accent-indy);
  color: var(--accent-indy);
}

.series-display {
  background: var(--bg-surface-elevated);
  border-radius: 1.5rem;
  padding: 2.5rem;
  border: 1px solid var(--glass-border);
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: center;
  box-shadow: var(--glass-shadow);
  min-height: 400px;
}

.series-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.series-name {
  font-size: 2.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.series-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  transition: var(--transition-fast);
}

.schedule-row:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.schedule-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.schedule-name {
  font-weight: 700;
  font-size: 1rem;
}

.schedule-track {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.schedule-time {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.schedule-date {
  font-weight: 700;
  font-size: 0.95rem;
}

.schedule-hours {
  color: var(--accent-general);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Timezone Toggle Switch */
.tz-selector-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tz-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface-elevated);
  transition: .4s;
  border-radius: 34px;
  border: 1px solid var(--glass-border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-primary);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-general);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Features Grid */
.features-section {
  padding: 6rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: 1.25rem;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-general), transparent);
  transform: translateX(-100%);
  transition: var(--transition-slow);
}

.feature-card:hover::before {
  transform: translateX(100%);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--glass-shadow);
  border-color: rgba(225, 6, 0, 0.2);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  background: rgba(225, 6, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-general);
  font-size: 1.5rem;
}

.feature-card:nth-child(2) .feature-icon {
  background: rgba(255, 30, 86, 0.1);
  color: var(--accent-f1);
}

.feature-card:nth-child(3) .feature-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-imsa);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Call to Action Section */
.cta-section {
  padding: 8rem 0;
  position: relative;
  overflow: hidden;
}

.cta-container {
  background: linear-gradient(135deg, rgba(22, 27, 38, 0.8), rgba(14, 17, 24, 0.8));
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  padding: 4rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.cta-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 30, 86, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.cta-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  max-width: 700px;
}

.cta-description {
  font-size: 1.15rem;
  max-width: 550px;
}

/* Footer styling */
.footer {
  padding: 4rem 0 2rem 0;
  border-top: 1px solid var(--glass-border);
  background: #030406;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.footer-logo img {
  height: 32px;
  width: auto;
  display: block;
}

.footer-description {
  max-width: 380px;
}

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

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-disclaimer {
  line-height: 1.5;
}

/* --- Scroll Entry-Exit Animations (CSS View Timeline) --- */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes reveal-up {
      from {
        opacity: 0;
        transform: translateY(40px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Apply animations to major sections and cards as they enter scrollport */
    .feature-card,
    .series-display,
    .cta-container,
    .hero-content,
    .mockup-container {
      animation: reveal-up auto linear forwards;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }
}

/* Fallback class for browsers without view-timeline support (manipulated by JS observer) */
.reveal-fallback {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-fallback.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Breakpoints */
@media (max-width: 968px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  
  .hero-content {
    align-items: center;
  }

  .hero-description {
    margin: 0 auto;
  }

  .series-display {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.75rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 576px) {
  .nav-links {
    display: none; /* simple mobile fallback: hide links */
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .cta-container {
    padding: 3rem 1.5rem;
  }
}
