/* ==========================================================================
   Audi A3 40 TFSIe — scroll-driven product page
   Dark stage, red accents, content floating over a fixed WebGL canvas.
   ========================================================================== */

:root {
    --bg: #040405;
    --ink: #ffffff;
    --ink-dim: rgba(255, 255, 255, 0.62);
    --ink-faint: rgba(255, 255, 255, 0.34);
    --red: #cc0000;
    --red-hot: #ff2233;
    --line: rgba(255, 255, 255, 0.12);
    --font: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --pad: clamp(1.5rem, 6vw, 6rem);
}

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

html { scroll-behavior: auto; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-weight: 300;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Lenis */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

::selection { background: var(--red); color: #fff; }

/* ==========================================================================
   Audi four rings, drawn in CSS so there's no logo asset to ship
   ========================================================================== */

.rings { display: inline-flex; align-items: center; line-height: 0; }
.rings i {
    width: 0.95em; height: 0.95em;
    border: 0.11em solid currentColor;
    border-radius: 50%;
    display: block;
}
.rings i + i { margin-left: -0.30em; }

/* ==========================================================================
   Loader
   ========================================================================== */

.loader {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1.6rem;
    background: var(--bg);
    transition: opacity 0.7s ease, visibility 0.7s ease;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__rings {
    display: inline-flex; align-items: center; line-height: 0;
    font-size: 2.6rem; color: var(--ink);
    animation: pulse 1.7s ease-in-out infinite;
}
.loader__rings i {
    width: 0.95em; height: 0.95em;
    border: 0.10em solid currentColor; border-radius: 50%; display: block;
}
.loader__rings i + i { margin-left: -0.30em; }
.loader span {
    font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase;
    color: var(--ink-faint);
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ==========================================================================
   Fixed 3D stage
   ========================================================================== */

.stage { position: fixed; inset: 0; z-index: 0; }

#webgl-canvas {
    display: block; width: 100%; height: 100%;
    /* Radial wash keeps the car sitting in a pool of light rather than a void. */
    background:
        radial-gradient(120% 90% at 50% 42%, #16181f 0%, #0a0b0e 45%, #040405 100%);
}

.stage__vignette {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(80% 70% at 50% 45%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.62) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 22%,
                        rgba(0, 0, 0, 0) 74%, rgba(0, 0, 0, 0.75) 100%);
}

/* ==========================================================================
   Sticky product bar
   ========================================================================== */

.subnav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    display: flex; align-items: center; justify-content: space-between; gap: 2rem;
    padding: 1.05rem var(--pad);
    transition: background 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease;
    border-bottom: 1px solid transparent;
}
.subnav.is-stuck {
    background: rgba(6, 6, 8, 0.72);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border-bottom-color: var(--line);
}
.subnav__brand { display: flex; align-items: center; gap: 0.85rem; }
.subnav__brand .rings { font-size: 1.05rem; }
.subnav__brand strong {
    font-size: 0.86rem; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
}
.subnav__links { display: flex; gap: 2.2rem; }
.subnav__links a {
    color: var(--ink-dim); text-decoration: none;
    font-size: 0.74rem; letter-spacing: 0.15em; text-transform: uppercase;
    transition: color 0.25s ease;
}
.subnav__links a:hover { color: var(--ink); }

/* Scroll progress rail under the bar */
.progress {
    position: fixed; top: 0; left: 0; right: 0; z-index: 201;
    height: 2px; background: transparent; pointer-events: none;
}
.progress span {
    display: block; height: 100%; transform: scaleX(0); transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--red), var(--red-hot));
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.92em 2.1em;
    font-family: inherit; font-size: 0.76rem; font-weight: 500;
    letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none;
    border-radius: 100px; border: 1px solid transparent;
    transition: transform 0.25s ease, background 0.25s ease,
                border-color 0.25s ease, color 0.25s ease;
    white-space: nowrap;
}
.btn--solid { background: var(--red); color: #fff; }
.btn--solid:hover { background: var(--red-hot); transform: translateY(-2px); }
.btn--ghost { border-color: rgba(255, 255, 255, 0.3); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: rgba(255, 255, 255, 0.07); }
.btn--lg { padding: 1.15em 2.9em; font-size: 0.82rem; margin-top: 2.6rem; }

/* ==========================================================================
   Section scaffolding
   ========================================================================== */

main { position: relative; z-index: 10; }

.sec {
    min-height: 118vh;
    display: flex; align-items: center;
    padding: 12vh var(--pad);
    position: relative;
}
.sec--hero { min-height: 100vh; }
.sec--tall { min-height: 130vh; }

.sec__inner { width: 100%; max-width: 1180px; margin: 0 auto; }
.sec__inner.center { text-align: center; }
.sec__inner.left { max-width: 1180px; }
.sec__inner.left > * { max-width: 32rem; }
.sec__inner.right { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.sec__inner.right > * { max-width: 32rem; }

/* ==========================================================================
   Type
   ========================================================================== */

.eyebrow {
    font-size: 0.7rem; font-weight: 500;
    letter-spacing: 0.28em; text-transform: uppercase;
    color: var(--red-hot);
    margin-bottom: 1.5rem;
}

.display {
    font-size: clamp(3.2rem, 12vw, 10.5rem);
    font-weight: 700; line-height: 0.88; letter-spacing: -0.035em;
    text-transform: uppercase;
    text-shadow: 0 18px 60px rgba(0, 0, 0, 0.75);
}
.display--sm { font-size: clamp(2.4rem, 7.5vw, 6.5rem); line-height: 0.94; }

.title {
    font-size: clamp(1.9rem, 4.6vw, 4rem);
    font-weight: 300; line-height: 1.06; letter-spacing: -0.025em;
    text-shadow: 0 12px 44px rgba(0, 0, 0, 0.7);
}
.title strong { font-weight: 700; }

.lede {
    margin-top: 1.8rem;
    font-size: clamp(1rem, 1.7vw, 1.4rem);
    line-height: 1.5; color: var(--ink-dim);
}
.sub {
    margin-top: 1.1rem;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: var(--ink-dim); letter-spacing: 0.01em;
}
.body {
    margin-top: 1.5rem;
    font-size: clamp(0.98rem, 1.25vw, 1.15rem);
    line-height: 1.68; color: var(--ink-dim);
    text-shadow: 0 6px 26px rgba(0, 0, 0, 0.8);
}

.hero__cta { margin-top: 3rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.scroll-hint {
    position: absolute; bottom: 5vh; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.scroll-hint span {
    font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--ink-faint);
}
.scroll-hint i {
    width: 1px; height: 64px; background: rgba(255, 255, 255, 0.16);
    position: relative; overflow: hidden; display: block;
}
.scroll-hint i::after {
    content: ''; position: absolute; left: 0; top: -100%;
    width: 100%; height: 100%; background: var(--ink);
    animation: rail 2.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes rail { 0% { top: -100%; } 100% { top: 100%; } }

/* ==========================================================================
   Highlight tiles
   ========================================================================== */

.tiles {
    list-style: none;
    margin-top: 3.5rem;
    display: grid; gap: 1px;
    /* minmax(0, 1fr) rather than 1fr — long labels otherwise widen their own
       column and the grid stops being even. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.tile {
    background: rgba(9, 10, 13, 0.62);
    padding: 2.3rem 1.2rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    transition: background 0.3s ease;
}
.tile:hover { background: rgba(22, 24, 30, 0.72); }
.tile__value {
    font-size: clamp(1.9rem, 3.4vw, 3rem);
    font-weight: 300; line-height: 1; letter-spacing: -0.02em;
}
.tile__value em {
    font-style: normal; font-size: 0.36em; font-weight: 400;
    margin-left: 0.3em; color: var(--ink-dim); letter-spacing: 0.04em;
}
.tile__label {
    font-size: 0.68rem; letter-spacing: 0.17em; text-transform: uppercase;
    color: var(--ink-faint);
}

/* ==========================================================================
   Pain points
   ========================================================================== */

.strikes {
    list-style: none;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem 1rem;
    margin-bottom: 3.2rem;
}
.strikes li {
    position: relative;
    padding: 0.55em 1.25em;
    font-size: clamp(0.82rem, 1.5vw, 1.05rem);
    color: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
}
.strikes li::after {
    content: ''; position: absolute; left: 12%; right: 12%; top: 50%;
    height: 1px; background: var(--red); opacity: 0.85;
}

.hello {
    margin-top: 1.6rem;
    font-size: clamp(1.3rem, 3vw, 2.4rem); font-weight: 300;
    color: var(--ink-dim);
}
.hello strong { color: var(--ink); font-weight: 700; }

/* ==========================================================================
   Inline stat row
   ========================================================================== */

.inline-stats {
    display: flex; flex-wrap: wrap; gap: 2.8rem;
    margin-top: 2.8rem;
}
.inline-stats > div { display: flex; flex-direction: column; gap: 0.35rem; }
.inline-stats b {
    font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 300; line-height: 1;
}
.inline-stats span {
    font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--ink-faint);
}

/* ==========================================================================
   Big number grid
   ========================================================================== */

.numbers {
    list-style: none;
    margin-top: 3.8rem;
    display: grid; gap: 2.6rem 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.numbers li { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.numbers__value {
    font-size: clamp(2.4rem, 5.5vw, 4.6rem);
    font-weight: 200; line-height: 1; letter-spacing: -0.04em;
    background: linear-gradient(180deg, #ffffff 30%, rgba(255, 255, 255, 0.45) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.numbers__unit {
    font-size: 0.82rem; color: var(--red-hot);
    letter-spacing: 0.12em; text-transform: uppercase;
}
.numbers__label {
    font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--ink-faint); margin-top: 0.3rem;
}

/* ==========================================================================
   Paint picker
   ========================================================================== */

.swatches {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 1.1rem;
    margin-top: 3rem;
}
.swatch {
    width: 56px; height: 56px; padding: 4px;
    border-radius: 50%; cursor: pointer;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.swatch span {
    display: block; width: 100%; height: 100%; border-radius: 50%;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.28),
                inset 0 -4px 8px rgba(0, 0, 0, 0.5);
}
.swatch:hover { transform: scale(1.09); border-color: rgba(255, 255, 255, 0.55); }
.swatch.is-active { border-color: var(--red-hot); transform: scale(1.13); }
.swatch:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 4px; }

.swatch-name {
    margin-top: 1.5rem;
    font-size: 0.76rem; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--ink-dim);
}

/* ==========================================================================
   Spec table
   ========================================================================== */

.specs {
    margin-top: 3.6rem;
    display: grid; gap: 1.2rem;
    grid-template-columns: repeat(2, 1fr);
    text-align: left;
}
.specs__group {
    background: rgba(9, 10, 13, 0.66);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.9rem 1.8rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.specs__group h3 {
    font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--red-hot);
    margin-bottom: 1.3rem;
}
.specs__group dl > div {
    display: flex; justify-content: space-between; gap: 1.5rem;
    padding: 0.72rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.specs__group dl > div:first-child { border-top: 0; }
.specs__group dt { font-size: 0.85rem; color: var(--ink-faint); flex-shrink: 0; }
.specs__group dd { font-size: 0.85rem; text-align: right; font-weight: 400; }

/* ==========================================================================
   Manifesto + footer
   ========================================================================== */

.manifesto {
    list-style: none;
    display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem 2.6rem;
    margin-bottom: 2.6rem;
}
.manifesto li {
    font-size: clamp(0.72rem, 1.3vw, 0.92rem); font-weight: 500;
    letter-spacing: 0.34em; color: var(--ink-faint);
}

.foot {
    position: relative; z-index: 10;
    text-align: center;
    padding: 5rem var(--pad) 4rem;
    background: linear-gradient(to bottom, rgba(4, 4, 5, 0) 0%, #040405 30%);
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.foot .rings { font-size: 1.5rem; color: var(--ink-faint); margin-bottom: 0.6rem; }
.foot p { font-size: 0.78rem; color: var(--ink-faint); }
.foot__legal { font-size: 0.7rem !important; color: rgba(255, 255, 255, 0.22) !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .subnav__links { display: none; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .specs { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .sec { min-height: 105vh; padding: 14vh var(--pad); }
    .sec__inner.right { align-items: flex-start; text-align: left; }
    .sec__inner.left > *, .sec__inner.right > * { max-width: 100%; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inline-stats { gap: 1.8rem; }
    .swatch { width: 48px; height: 48px; }
    .btn { padding: 0.9em 1.6em; font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-hint i::after, .loader__rings { animation: none; }
    html { scroll-behavior: auto; }
}
