/* Ashlyn Speed Racing — site styles.
   Visual values mirror the live Vercel site; deviations made for WCAG 2.2 AA are marked "a11y". */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/inter-latin-var.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Orbitron";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("../fonts/orbitron-latin-var.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --primary-red: #ff0040;
    --button-red: #ed003b; /* a11y: #ff0040 gives 3.94:1 with white text; #ed003b gives 4.50:1 */
    --electric-blue: #00d4ff;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --text-light: #ffffff;
    --text-gray: #cccccc;
    --accent-purple: #8b00ff;
    --neon-green: #00ff88;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --focus-ring: var(--electric-blue);
    --font-body: "Inter", sans-serif;
    --font-display: "Orbitron", monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 8rem; /* a11y 2.4.11: keep anchored/focused content clear of the fixed header */
}

body {
    font-family: var(--font-body);
    background: var(--dark-bg);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

ul {
    list-style: none;
}

iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Accessibility helpers ---------- */

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.75rem 1.25rem;
    background: var(--darker-bg);
    color: var(--text-light);
    border: 2px solid var(--electric-blue);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

main:focus {
    outline: none;
}

/* ---------- Header ---------- */

.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.site-header.is-scrolled {
    background: rgba(5, 5, 5, 0.98);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 60px;
    width: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 0, 64, 0.3);
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-red);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
    color: var(--electric-blue);
}

.nav-menu a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--electric-blue);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu a:hover::after,
.nav-menu a:focus-visible::after {
    width: 80%;
}

/* ---------- Icons ---------- */

.icon {
    display: inline-block;
    height: 1em;
    vertical-align: -0.125em;
    overflow: visible;
}

/* ---------- Layout ---------- */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(45deg, var(--electric-blue), var(--neon-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--electric-blue); /* fallback when background-clip:text is unsupported */
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    position: relative;
    overflow: hidden;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, var(--button-red), var(--accent-purple));
    color: #fff;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 0, 64, 0.3);
}

/* ---------- Featured video ---------- */

.featured-video {
    padding-top: 120px;
    padding-bottom: 2rem;
    background: var(--darker-bg);
    border-bottom: 1px solid var(--glass-border);
}

.featured-video-container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 100%;
    height: 450px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
}

/* ---------- Shop ---------- */

.shop-section {
    padding: 4rem 2rem;
    background: var(--dark-bg);
    border-bottom: 1px solid var(--glass-border);
}

.shop-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.shop-graphic {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
}

.shop-graphic img {
    display: block;
    width: 100%;
    height: auto;
}

.shop-video {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
    overflow: hidden;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 0, 64, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.1) 0%, transparent 50%);
    /* a11y 2.2.2: the live pulse loops forever; here it runs once (4s) and holds. */
    opacity: 1;
    animation: pulse 4s ease-in-out 1;
}

@keyframes pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    width: 100%;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    animation: slideInLeft 1s ease-out;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-transform: uppercase;
    background: linear-gradient(45deg, var(--primary-red), var(--electric-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary-red);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-gray);
    margin-bottom: 2rem;
}

.achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

.achievement-badge {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-red);
    border-radius: 25px;
    background: rgba(255, 0, 64, 0.1);
    backdrop-filter: blur(10px);
    color: var(--primary-red);
    font-size: 0.9rem;
    font-weight: 600;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-video {
    position: relative;
    animation: slideInRight 1s ease-out;
}

.video-container {
    position: relative;
    width: 100%;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--electric-blue);
    font-size: 1.5rem;
    line-height: 1.6;
    /* a11y 2.2.2: live bounces forever; here it bounces for 4s then rests. */
    animation: bounce 2s 2;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Mazda section ---------- */

.mazda-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
}

.mazda-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.mazda-info h3 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.mazda-info p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

/* ---------- Carousel ---------- */

.carousel {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.8s ease-in-out;
}

.carousel-slide.is-active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-nav,
.carousel-toggle {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-nav .icon,
.carousel-toggle .icon {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8)); /* a11y 1.4.11: keeps white glyphs visible on light photos */
}

.carousel-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev { left: 20px; }
.carousel-next { right: 20px; }

/* a11y 2.2.2: pause/play control for the auto-rotating slideshow (not on live). */
.carousel-toggle {
    left: 20px;
    bottom: 14px;
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    z-index: 10;
}

.carousel-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.carousel-toggle .icon-when-paused,
.carousel.is-paused .carousel-toggle .icon-when-playing {
    display: none;
}

.carousel.is-paused .carousel-toggle .icon-when-paused {
    display: inline-block;
}

.carousel-indicators {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
}

/* a11y 2.5.8: 24x24 hit area around the live 12px dot. */
.carousel-dot {
    position: relative;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.carousel-dot::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); /* a11y 1.4.11 */
    transition: all 0.3s ease;
}

.carousel-dot.is-active::before {
    background: var(--electric-blue);
    transform: scale(1.2);
}

.carousel :focus-visible {
    outline-offset: 1px;
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.6);
}

/* ---------- Bio ---------- */

.bio-preview {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
}

.bio-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 4rem;
    align-items: center;
}

.bio-image {
    width: 100%;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.bio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bio-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-gray);
}

.bio-text p {
    margin-bottom: 1.5rem;
}

/* ---------- Schedule ---------- */

.schedule-section {
    padding: 6rem 2rem;
    background: var(--dark-bg);
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.race-card {
    padding: 2rem;
    border-radius: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.race-card:hover {
    transform: translateY(-5px);
    border-color: var(--electric-blue);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.2);
}

.race-date {
    color: var(--electric-blue);
    font-size: 1.1rem;
    font-weight: 600;
}

.race-name {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.6;
    margin: 0.5rem 0;
}

.race-location {
    color: var(--text-gray);
}

/* ---------- Partners ---------- */

.partners-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
}

.partners-grid,
.partners-row-2 {
    display: grid;
    align-items: center;
    justify-items: center;
}

.partners-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 3rem;
}

.partners-row-2 {
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.partners-grid > li,
.partners-row-2 > li {
    width: 100%;
}

.partner-logo {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    filter: grayscale(20%) brightness(120%);
    transition: all 0.3s ease;
}

.partner-logo:hover,
.partner-logo:focus-visible {
    transform: translateY(-5px);
    border-color: var(--electric-blue);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.2);
    filter: grayscale(0%) brightness(100%);
}

.partner-logo img {
    width: auto;
    height: auto;
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}

.partner-logo.large { height: 180px; }
.partner-logo.large img { max-width: 150px; max-height: 150px; }
.partner-logo.small { height: 120px; }
.partner-logo.small img { max-width: 100px; max-height: 100px; }

/* ---------- Instagram ---------- */

.instagram-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
}

.instagram-intro {
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.instagram-post {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.instagram-post:hover {
    transform: scale(1.05);
    border-color: var(--electric-blue);
}

.instagram-post iframe {
    border-radius: 15px;
    overflow: hidden;
}

.instagram-cta {
    text-align: center;
    margin-top: 2rem;
}

/* ---------- Footer ---------- */

.site-footer {
    padding: 3rem 2rem 1rem;
    background: var(--darker-bg);
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.social-links a {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-gray);
    font-size: 1.8rem;
    transition: all 0.3s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
    color: var(--electric-blue);
    transform: translateY(-3px);
    border-color: var(--electric-blue);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.footer-text {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.footer-credit {
    color: var(--text-gray);
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-credit a {
    color: var(--electric-blue);
    /* a11y 1.4.1: live relies on colour alone (1.09:1 vs surrounding text); underline added. */
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: all 0.3s ease;
}

.footer-credit a:hover,
.footer-credit a:focus-visible {
    color: var(--primary-red);
}

/* ---------- Scroll reveal (JS adds .reveal-ready to <html>) ---------- */

.reveal-ready .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .mazda-content,
    .bio-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-links a {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .partners-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .partners-row-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .partner-logo.large { height: 120px; }
    .partner-logo.small { height: 100px; }

    .shop-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .partners-row-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .social-links {
        gap: 0.5rem;
    }

    .social-links a {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
        font-size: 1.2rem;
    }
}

/* Reflow (WCAG 1.4.10) at 320 px */
@media (max-width: 360px) {
    .social-links {
        gap: 0.375rem;
    }

    .social-links a {
        width: 36px;
        height: 36px;
    }

    .brand-name {
        font-size: 1.35rem;
        letter-spacing: 1px;
    }

    /* a11y 2.5.8 / 2.2.2: lift the pause button above the centered dots so they no longer overlap it. */
    .carousel-toggle {
        bottom: 62px; /* dots: 14px + 24px tall; leaves a 24px gap */
    }
}

/* ---------- Reduced motion (a11y 2.3.3 / 2.2.2) ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .btn:hover,
    .carousel-nav:hover,
    .race-card:hover,
    .partner-logo:hover,
    .partner-logo:focus-visible,
    .instagram-post:hover,
    .social-links a:hover,
    .social-links a:focus-visible,
    .brand-logo:hover {
        transform: none;
    }

    .carousel-nav:hover {
        transform: translateY(-50%);
    }
}
