/* ==========================================================================
   Animations - scroll reveals, hero garage-lights effect, motion
   ========================================================================== */

/* ---------- Scroll reveal ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    will-change: opacity, transform;
}
[data-reveal="left"] { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal].revealed { opacity: 1; transform: translate(0, 0) scale(1); }

@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ==========================================================================
   Garage-lights hero
   "Lights off" until the pointer enters, then everything lights up with gloss.
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    cursor: default;
}

/* Background photograph of the car in the garage */
.garage-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.12) saturate(0.7);
    transform: scale(1.08);
    transition: filter 1.1s var(--ease), transform 6s var(--ease);
    z-index: -3;
}

/* Heavy dark overlay = lights off */
.garage-dark {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 120% at 50% 120%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.94) 75%),
        linear-gradient(180deg, rgba(4, 6, 10, 0.9), rgba(4, 6, 10, 0.78));
    transition: opacity 1s var(--ease);
    z-index: -2;
}

/* Ceiling light beams (off by default) */
.garage-beams { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.beam {
    position: absolute;
    top: -10%;
    width: 26%;
    height: 130%;
    background: linear-gradient(180deg, rgba(204, 34, 41, 0.55), rgba(204, 34, 41, 0.05) 55%, transparent 80%);
    filter: blur(22px);
    opacity: 0;
    transform: translateY(-30px) scaleY(0.6);
    transform-origin: top center;
    transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
    mix-blend-mode: screen;
}
.beam-1 { left: 4%; }
.beam-2 { left: 38%; width: 30%; }
.beam-3 { right: 4%; }

/* Floor glow pools under the beams */
.garage-beams::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 40%;
    background: radial-gradient(80% 100% at 50% 100%, rgba(204, 34, 41, 0.22), transparent 70%);
    opacity: 0;
    transition: opacity 1s var(--ease);
}

/* Gloss / wet-paint shine sweep */
.gloss {
    position: absolute;
    top: 0;
    left: -60%;
    width: 50%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.18) 45%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0.18) 55%, transparent);
    transform: skewX(-18deg);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
}

/* ----- Lit state (added by garage-lights.js) ----- */
.hero.lit .garage-bg { filter: brightness(0.92) saturate(1.08); transform: scale(1); }
.hero.lit .garage-dark { opacity: 0; }
.hero.lit .garage-beams::after { opacity: 1; }
.hero.lit .beam { opacity: 1; transform: translateY(0) scaleY(1); animation: flicker 2.4s var(--ease) 0.1s; }
.hero.lit .beam-1 { transition-delay: 0.05s; }
.hero.lit .beam-2 { transition-delay: 0.22s; }
.hero.lit .beam-3 { transition-delay: 0.38s; }
.hero.lit .gloss { animation: sweep 1.5s var(--ease) 0.5s; }

@keyframes flicker {
    0% { opacity: 0; }
    8% { opacity: 1; }
    12% { opacity: 0.4; }
    16% { opacity: 1; }
    22% { opacity: 0.7; }
    28% { opacity: 1; }
    100% { opacity: 1; }
}

@keyframes sweep {
    0% { left: -60%; opacity: 0; }
    25% { opacity: 1; }
    100% { left: 120%; opacity: 0; }
}

/* Hero content */
.hero-content { position: relative; z-index: 2; padding-top: 80px; }
.hero-content .eyebrow { opacity: 0; transform: translateY(20px); transition: 0.8s var(--ease) 0.2s; }
.hero-content h1 {
    font-size: clamp(2.6rem, 6.4vw, 5.2rem);
    max-width: 14ch;
    opacity: 0; transform: translateY(28px); transition: 0.9s var(--ease) 0.32s;
}
.hero-content .hero-sub {
    color: var(--muted); max-width: 52ch; margin: 22px 0 34px; font-size: 1.12rem;
    opacity: 0; transform: translateY(24px); transition: 0.9s var(--ease) 0.46s;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; opacity: 0; transform: translateY(24px); transition: 0.9s var(--ease) 0.6s; }
.hero.lit .hero-content .eyebrow,
.hero.lit .hero-content h1,
.hero.lit .hero-content .hero-sub,
.hero.lit .hero-actions { opacity: 1; transform: translateY(0); }

/* Hint prompt */
.hero-hint {
    position: absolute;
    bottom: 34px; left: 50%; transform: translateX(-50%);
    color: var(--gold); font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase;
    display: flex; align-items: center; gap: 10px; z-index: 2;
    transition: opacity 0.6s var(--ease);
}
.hero-hint::before { content: ""; width: 30px; height: 1px; background: var(--gold); }
.hero-hint .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulse 1.6s infinite; }
.hero.lit .hero-hint { opacity: 0; pointer-events: none; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(204, 34, 41, 0.5); }
    50% { box-shadow: 0 0 0 10px rgba(204, 34, 41, 0); }
}

/* Float-in helper for grouped cards */
@keyframes floatUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
