/* ============================================================
   Snaffi the Snail
   ============================================================ */

/* ── Tokens ──────────────────────────────────────────────── */
:root {
    --c-hero: #A27CF8;
    --c-sponsors: #FFD572;
    --c-dark: #281275;

    --font-d: 'Oswald', sans-serif; /* wordmark only */
    --font: 'Raleway', sans-serif;

    --pad: 3rem;
    --max: 1280px;
    --gap: 3.5rem;

    --ease: cubic-bezier(.25, .46, .45, .94);
    --t: .3s;
    --tm: .65s;
}

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

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

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: #1a1a1a;
    background: var(--c-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* One place for heading styles – sections inherit color */
h1, h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

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

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

ul {
    list-style: none;
}

p + p {
    margin-top: .85em;
}

/* ── Container ───────────────────────────────────────────── */
.container {
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--pad);
}

/* ============================================================
   HERO  #A27CF8
   ============================================================ */
.section-hero {
    position: relative;
    background: var(--c-hero);
    color: #000;
    overflow: hidden;
}

.hero__logo {
    position: absolute;
    top: 1.5rem;
    right: var(--pad);
    z-index: 10;
}

.hero__logo img {
    height: 52px;
    width: auto;
}

/* flex row: wordmark (2) | text (3) */
.hero__inner {
    display: flex;
    align-items: flex-start;
    gap: var(--gap);
    padding-top: 5rem;
    padding-bottom: 70px;
}

/* Left: Oswald wordmark */
.hero__wordmark {
    flex: 2;
    font-family: var(--font-d);
    font-size: 5rem;
    font-weight: 700;
    line-height: .88;
    text-transform: uppercase;
    letter-spacing: -.01em;
    display: flex;
    flex-direction: column;
}

.hero__wordmark span {
    display: block;
}

.hero__subheadline {
    max-width: 500px;
}

/* Right: headline + body */
.hero__content {
    max-width: 60%;
    align-self: flex-end;
    padding-top: 80px;
}

/* Outside .container → true left-edge bleed */
.hero__snail {
    position: absolute;
    left: 0;
    bottom: 70px;
    width: 500px;
    pointer-events: none;
    z-index: 10;
}

/* ============================================================
   ABOUT  #ffffff
   ============================================================ */
.section-about {
    position: relative;
    background: #fff;
    color: #000;
    display: flex;
    align-items: flex-end;
    min-height: 480px;
    overflow: visible; /* car bleeds up into hero */
}

.about__headline {
    max-width: 500px;
}

/* Car: top-right, overlaps into hero */
.about__car {
    position: absolute;
    top: -10%;
    right: 0;
    width: 45%;
    z-index: 20;
    pointer-events: none;
}

/* Left: text */
.about__text-col {
    flex: 1;
    align-self: center;
    padding: 1.5rem 4rem 3rem var(--pad);
}

/* Right: chart image bleeds to right viewport edge */
.about__visual-col {
    flex: 1;
    align-self: flex-end;
    overflow: hidden;
}

.about__visual-col img {
    width: 100%;
    display: block;
}

/* ============================================================
   SPONSORS  #FFD572
   ============================================================ */
.section-sponsors {
    position: relative;
    background: var(--c-sponsors);
    color: #000;
    padding-block: 4rem;
    overflow: hidden;
}

/* Content shifts right past the character */
.sponsors__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding-left: 460px;
    padding-right: var(--pad);
    max-width: var(--max);
    margin-inline: auto;
}

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

/* White card: uniform size, no shadow */
.sponsors__item {
    background: #fff;
    border-radius: 10px;
    width: 120px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
}

.sponsors__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: opacity var(--t) var(--ease);
}

.sponsors__link:hover {
    opacity: .8;
}

.sponsors__logo {
    max-width: 96px;
    max-height: 38px;
    object-fit: contain;
}

/* Character: vertically centered on section */
.sponsors__snail {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    margin-block: auto;
    height: fit-content;
    width: 460px;
    pointer-events: none;
}

/* ============================================================
   SEASON  #281275
   ============================================================ */
.section-season {
    background: var(--c-dark);
    color: #fff;
    padding-block: 4rem;
    overflow: hidden;
}

.season__inner {
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.season__text-col {
    flex: 1;
}

.season__intro {
    opacity: .78;
    max-width: 460px;
    margin-bottom: 1.5rem;
}

.season__next-race {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.season__next-race-label {
    font-weight: 700;
}

/* Date + track map on the same row */
.season__date-track {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: .25rem;
}

.season__race-date {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1;
}

.season__track-icon img {
    height: 56px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* Flag + location below the date */
.season__flag-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .4rem;
}

.season__flag img {
    height: 18px;
    border-radius: 2px;
}

.season__race-location {
    opacity: .88;
    font-weight: 600;
}

.season__calendar-link {
    font-size: .85rem;
    color: rgba(255, 255, 255, .9);
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-top: .5rem;
    transition: color var(--t) var(--ease);
}

.season__calendar-link:hover {
    color: #fff;
}

.season__boombox {
    flex: 1;
    max-width: 420px;
}

/* ============================================================
   GALLERY  #281275
   ============================================================ */
.race-gallery {
    background: var(--c-dark);
    color: #fff;
    padding-block: 1rem 4rem;
}

.race-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-top: 1.25rem;
}

.race-gallery__item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.race-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--tm) var(--ease);
}

.race-gallery__item:hover img {
    transform: scale(1.05);
}

.race-gallery__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, .4));
    opacity: 0;
    transition: opacity var(--t) var(--ease);
}

.race-gallery__item:hover .race-gallery__overlay {
    opacity: 1;
}

/* ============================================================
   FOOTER  #281275
   ============================================================ */
.site-footer {
    background: var(--c-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-top: 2rem;
    padding-bottom: 2rem;
    overflow: hidden;
}

.footer__disco-ball {
    width: 100%;
    margin-bottom: 2rem;
    animation: float 5s ease-in-out infinite;
}

.footer__links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .4rem;
}

.footer__link-item {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.footer__link {
    font-size: .85rem;
    color: rgba(255, 255, 255, .5);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--t) var(--ease);
}

.footer__link:hover {
    color: #fff;
}

.footer__separator {
    color: rgba(255, 255, 255, .3);
    font-size: .85rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.js-animate-from-left {
    opacity: 0;
    transform: translateX(-80px);
}

.js-animate-from-right {
    opacity: 0;
    transform: translateX(80px);
}

.js-fade-up {
    opacity: 0;
    transform: translateY(32px);
}

.js-bounce-in {
    opacity: 0;
    transform: translateY(60px) scale(.88);
}

.is-animated {
    opacity: 1 !important;
    transform: none !important;
    transition: opacity var(--tm) var(--ease), transform var(--tm) var(--ease);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-14px);
    }
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t) var(--ease);
}

.lightbox-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: 2px solid rgba(255, 255, 255, .4);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--t), background var(--t);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, .14);
    border-color: #fff;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .1);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.35rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t);
    backdrop-filter: blur(4px);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, .2);
}

.lightbox-nav--prev {
    left: 1.25rem;
}

.lightbox-nav--next {
    right: 1.25rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --pad: 1.5rem;
        --gap: 2rem;
    }

    .hero__inner {
        flex-direction: column;
        padding-bottom: 2rem;
    }

    .hero__wordmark {
        font-size: 3.5rem;
    }

    .hero__snail {
        width: 350px;
        top: 200px;
    }

    .hero__content {
        max-width: 100%;
        padding-top: 160px;
        align-self: unset;
    }

    .section-about {
        flex-direction: column;
        min-height: unset;
    }

    .about__text-col {
        max-width: 100%;
        padding: 3rem var(--pad) 2rem;
    }

    .about__car {
        width: 300px;
        top: initial;
        bottom: 0;
    }

    .about__visual-col {
        width: 100%;
    }

    .sponsors__inner {
        padding-left: 160px;
    }

    .sponsors__snail {
        width: 150px;
    }

    .sponsors__item {
        width: 130px;
        height: 68px;
    }

    .season__inner {
        flex-direction: column;
    }

    .season__boombox {
        max-width: 360px;
    }

    .race-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .sponsors__snail, .sponsors__flames {
        display: none;
    }

    .sponsors__inner {
        padding-left: var(--pad);
    }

    .race-gallery__grid {
        grid-template-columns: 1fr;
    }

    .lightbox-nav--prev {
        left: .5rem;
    }

    .lightbox-nav--next {
        right: .5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .js-animate-from-left, .js-animate-from-right,
    .js-fade-up, .js-bounce-in {
        opacity: 1;
        transform: none;
    }
}
