/**
 * Erebora Landing Page - Base Styles
 * Reset, layout, sections, typography
 */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Premium noise texture overlay for premium feel */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
}

/* Remove default button styles */
button {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

/* Remove default list styles */
ul, ol {
    list-style: none;
}

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

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-extrabold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-wide);
}

h1 { font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl)); }
h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-2xl)); }
h4 { font-size: var(--text-lg); }

p {
    line-height: var(--leading-relaxed);
}

strong {
    font-weight: var(--font-bold);
}

/* ===== FUNNEL SECTIONS ===== */
.funnel-section {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: var(--space-2) var(--section-padding);
    padding-bottom: calc(var(--space-2) + var(--mobile-bar-height));
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.funnel-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Click-funnel mode: Only show active section */
.funnel-section:not(.active) {
    display: none;
}

.section-content {
    width: 100%;
    max-width: var(--container-max);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    text-align: center;
}

.section-title {
    color: #D4AF37;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
    background: rgba(26, 26, 26, 0.9);
    display: inline-block;
    padding: var(--space-2) var(--space-6);
    border-radius: var(--radius-full);
    letter-spacing: var(--tracking-wider);
}

.section-subtitle {
    color: var(--ink-dim);
    font-size: var(--text-lg);
    margin-top: calc(var(--space-2) * -1);
}

/* ===== PROGRESS INDICATOR ===== */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    padding-left: 60px; /* Room for back button */
    padding-right: 60px; /* Symmetric balance */
}

@media (max-width: 480px) {
    .progress-indicator {
        padding-left: 50px;
        padding-right: 50px;
        gap: var(--space-1);
    }
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 2px solid var(--ring);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    color: var(--ink-dim);
    transition: var(--transition-base);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .progress-step {
        width: 28px;
        height: 28px;
        font-size: var(--text-xs);
    }
}

.progress-step.active {
    background: var(--cta-gradient);
    border-color: var(--cta1);
    color: var(--bg);
}

.progress-step.completed {
    background: var(--success);
    border-color: var(--success);
    color: var(--bg);
}

.progress-line {
    width: 40px;
    height: 2px;
    background: var(--ring);
    transition: var(--transition-base);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .progress-line {
        width: 20px;
    }
}

.progress-line.completed {
    background: var(--success);
}

.progress-label {
    width: 100%;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--ink-dim);
    margin-top: var(--space-2);
}

@media (max-width: 480px) {
    .progress-label {
        font-size: var(--text-xs);
    }
}

/* ===== SECTION NAVIGATION ===== */
.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: center;
    margin-top: var(--space-6);
    width: 100%;
}

/* ===== GRIDS ===== */
.bike-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    width: 100%;
    max-width: var(--container-max);
    perspective: 1000px;
}

/* Center last visible card when odd count (JS-toggled class, desktop only) */
@media (min-width: 769px) {
    .bike-grid > .bike-card.bike-card-centered {
        grid-column: 1 / -1;
        width: calc((100% - var(--space-6)) / 2);
        justify-self: center;
    }
}

@media (max-width: 768px) {
    .bike-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    width: 100%;
}

@media (max-width: 1024px) {
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .benefits-grid {
        grid-template-columns: 1fr;
    }
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    width: 100%;
}

@media (max-width: 1024px) {
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--ring);
    padding: var(--space-10) var(--space-6);
    padding-bottom: calc(var(--space-10) + var(--mobile-bar-height));
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
    max-width: var(--container-max);
    margin: 0 auto;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.footer-col h4 {
    color: var(--ink);
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    font-weight: var(--font-extrabold);
}

.footer-col p {
    color: var(--ink);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.footer-col a {
    color: var(--ink);
    transition: var(--transition-fast);
}

.footer-col a:hover {
    color: var(--ink);
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

@media (max-width: 768px) {
    .social-links {
        justify-content: center;
    }
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-card-elevated);
    border: 1px solid var(--ring);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.social-links a:hover {
    background: var(--ink);
    border-color: var(--ink);
}

.social-links svg {
    width: 20px;
    height: 20px;
    fill: var(--ink);
    transition: var(--transition-base);
}

.social-links a:hover svg {
    fill: var(--bg);
}

.footer-bottom {
    max-width: var(--container-max);
    margin: var(--space-8) auto 0;
    padding-top: var(--space-6);
    border-top: 1px solid var(--ring);
    text-align: center;
}

.footer-bottom p {
    color: var(--ink);
    font-size: var(--text-sm);
}

.footer-seo {
    font-size: var(--text-xs);
    color: var(--ink-dim);
    opacity: 0.8;
    margin-top: var(--space-2);
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-gold {
    color: var(--cta1);
}

.text-success {
    color: var(--success);
}

.text-dim {
    color: var(--ink-dim);
}

/* First section visible immediately for fast Speed Index - only when active */
#section-hero.active {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
