/* ========================================
   Race Link Live - Marketing Site Styles
   Dark theme, no gradients, high-tech motorsports vibe
   ======================================== */

/* CSS Variables */
:root {
    /* Colors - Dark theme with electric lime accent */
    --bg: #0a0a0b;
    --bg-alt: #111113;
    --surface: #18181b;
    --border: #27272a;
    --border-light: #3f3f46;
    
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --accent: #84cc16;
    --accent-hover: #a3e635;
    --accent-muted: rgba(132, 204, 22, 0.15);
    
    /* Typography */
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Layout */
    --container-max: 1200px;
    --container-narrow: 800px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg);
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--bg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

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

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-narrow {
    max-width: var(--container-narrow);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-light);
}

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

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 11, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

/* Disable backdrop-filter on mobile to fix iOS Safari rendering bug.
   Safari's backdrop-filter creates a stacking context that causes 
   fixed/transformed children (the mobile menu) to render behind the nav. */
@media (max-width: 768px) {
    .nav {
        background: #0a0a0b;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    position: relative;
    z-index: 103;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--text-primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    list-style: none;
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    position: absolute;
    left: 6px;
    transition: all var(--transition-fast);
}

.hamburger {
    top: 15px;
}

.hamburger::before {
    content: '';
    top: -6px;
}

.hamburger::after {
    content: '';
    top: 6px;
}

.nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        z-index: 102;
    }
    
    .nav-menu {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        background-color: #0a0a0b;
        padding-top: 80px;
        padding-left: 24px;
        padding-right: 24px;
        padding-bottom: 24px;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        z-index: 101;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    .nav-links li {
        display: block;
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 16px 0;
        font-size: 1.125rem;
        color: #a1a1aa;
        border-bottom: 1px solid #27272a;
        text-decoration: none;
    }
    
    .nav-links a:hover,
    .nav-links a:focus {
        color: #fafafa;
    }
    
    .nav-cta {
        margin-top: 24px;
        display: flex;
        justify-content: center;
        width: 100%;
    }
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.hero-tag {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

.hero-title {
    margin-bottom: var(--space-lg);
}

.hero-subtitle {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: var(--space-xl);
    max-width: 540px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.race-map-illustration {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.course-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 3s ease forwards;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

.racer-dot {
    animation: pulse 2s ease-in-out infinite;
}

.racer-1 { animation-delay: 0s; }
.racer-2 { animation-delay: 0.2s; }
.racer-3 { animation-delay: 0.4s; }
.racer-4 { animation-delay: 0.6s; }
.racer-5 { animation-delay: 0.8s; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.scroll-indicator {
    position: absolute;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-visual {
        order: -1;
        margin-bottom: var(--space-xl);
    }
    
    .race-map-illustration {
        max-width: 300px;
    }
}

/* Section Styles */
.section {
    padding: var(--space-4xl) 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-sm);
}

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

.section-subtitle {
    font-size: 1.0625rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Problem Section */
.problem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.problem-card {
    padding: var(--space-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.problem-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.problem-card h3 {
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.problem-card p {
    font-size: 0.9375rem;
}

/* Solution Grid */
.solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.solution-item {
    padding: var(--space-lg);
    border-left: 2px solid var(--border);
    transition: border-color var(--transition-fast);
}

.solution-item:hover {
    border-color: var(--accent);
}

.solution-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.solution-item h3 {
    margin-bottom: var(--space-sm);
    font-size: 1.125rem;
}

.solution-item p {
    font-size: 0.9375rem;
}

/* Persona Grid */
.persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.persona-card {
    padding: var(--space-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color var(--transition-fast);
}

.persona-card:hover {
    border-color: var(--accent);
}

.persona-icon {
    margin-bottom: var(--space-lg);
}

.persona-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.persona-tagline {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent);
    margin-bottom: var(--space-lg);
}

.persona-list {
    list-style: none;
}

.persona-list li {
    position: relative;
    padding-left: var(--space-lg);
    margin-bottom: var(--space-sm);
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.persona-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background: var(--border-light);
    border-radius: 50%;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.feature-card {
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.feature-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.feature-card h4 {
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Steps Section */
.steps-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.step-card {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    padding: var(--space-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 50%;
    margin-bottom: var(--space-lg);
}

.step-content h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
}

.step-content p {
    font-size: 0.9375rem;
}

.step-visual {
    margin-top: var(--space-lg);
    display: flex;
    justify-content: center;
}

.step-connector {
    color: var(--border);
}

@media (max-width: 900px) {
    .steps-grid {
        flex-direction: column;
    }
    
    .step-connector {
        transform: rotate(90deg);
    }
    
    .step-card {
        max-width: none;
        width: 100%;
    }
}

/* Trust Section */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.trust-card {
    padding: var(--space-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.trust-card svg {
    margin-bottom: var(--space-lg);
}

.trust-card h4 {
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.trust-card p {
    font-size: 0.9375rem;
}

/* FAQ Section */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-lg);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
    transition: background var(--transition-fast);
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.02);
}

.faq-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.faq-item[open] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 var(--space-lg) var(--space-lg);
}

.faq-answer p {
    font-size: 0.9375rem;
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

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

.cta-subtitle {
    font-size: 1.0625rem;
    margin-bottom: var(--space-xl);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

/* Footer */
.footer {
    padding: var(--space-3xl) 0 var(--space-xl);
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-brand .nav-logo {
    margin-bottom: var(--space-sm);
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
    
    .course-path {
        animation: none;
        stroke-dashoffset: 0;
    }
    
    .racer-dot {
        animation: none;
    }
    
    .scroll-indicator {
        animation: none;
    }
    
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .nav,
    .scroll-indicator,
    .hero-visual {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        padding: 2rem 0;
    }
}
