/* ============================================================
   Lamborghini Veneno — PREMIUM cinematic presentation (AX-SZHN)
   Axionis · craft at the speed of AI
   Built on the proven scroll engine. Key changes vs original:
   - Hero veil reworked so the CAR stays fully visible (no heavy
     center vignette; only soft bottom fade for the wordmark).
   - NO spec data over the car. Dedicated .specs section instead.
   - Large clickable .gallery grid + full .lightbox.
   ============================================================ */

:root {
  --bg: #08080a;
  --bg-soft: #0e0e11;
  --ink: #f4f2ee;
  --muted: #8a8a92;
  /* DELIBERATE DUAL-ACCENT SYSTEM for the Veneno (see README "Design decisions").
     --accent  = the LIGHT: warm arancio amber, matching the orange rim-light
                 baked into all six cinematic renders + Lamborghini's signature.
     --rosso   = the MARQUE: a refined Veneno racing red, derived from Car Zero's
                 Italian tricolore stripe and its red calipers / rim-edges /
                 taillights. Used for editorial structure, never as a glow. */
  --accent: #ff6a2b;        /* arancio — harmonises with the render rim-light */
  --accent-soft: #ffc196;
  --rosso: #c81226;         /* Veneno racing red (tricolore / caliper red) */
  --rosso-soft: #e34357;
  --verde: #2f9e5b;         /* tricolore green — used only as a 1px hair detail */
  --line: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(20, 20, 24, 0.34);
  --glass-line: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Anton", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

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

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* <picture> wraps the cinematic <img> so mobile can swap in a 9:16 portrait
   render. It must be a full-size block so the existing media/img sizing rules
   (and the GSAP #heroImg / [data-parallax] selectors on the inner img) all keep
   working unchanged on desktop. */
picture { display: block; width: 100%; height: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--rosso-soft); }

/* ============ GLASS TILES (frosted info panels) ============
   Reintroduced from the client-approved "ops" look: low-alpha fill,
   backdrop blur, hairline border, soft shadow. NEVER placed over the
   car's face/body in the hero — only docked at a hero edge or living
   inside the specs / world sections. */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
/* a single warm hairline at the top edge ties tiles to the render light */
.glass::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  opacity: 0.6;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(14, 14, 17, 0.92); }
}

body.lenis, html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ============ PROGRESS BAR ============ */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 200;
  box-shadow: 0 0 18px rgba(255, 106, 43, 0.6);
}

/* ============ AMBIENT LIGHT (from the Axionis site's ember effects) ============
   Two ambient effects only, kept OFF the car photos: a site-wide film grain for a
   cinematic texture, and a drifting ember "aurora" behind the dark, photo-free
   sections (statement + specs). Adapted to the page's --accent (arancio). */

/* film grain — fixed overlay, below the lightbox (z<900) so the enlarged photo stays clean */
.grain {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ember aurora — drifting warm light field behind the dark, photo-free sections.
   z-index:-1 + isolation keeps it behind the section's content but above its bg. */
.statement, .specs { position: relative; isolation: isolate; }
.statement::before, .specs::before {
  content: ""; position: absolute; inset: -20% -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 22% 30%, rgba(255, 106, 43, 0.16), transparent 60%),
    radial-gradient(35% 45% at 78% 24%, rgba(255, 122, 82, 0.10), transparent 60%),
    radial-gradient(50% 60% at 60% 82%, rgba(200, 18, 38, 0.08), transparent 66%);
  filter: blur(26px);
  animation: aurora 20s ease-in-out infinite alternate;
}
@keyframes aurora {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  50% { transform: translate3d(3%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(-1%, 3%, 0) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .statement::before, .specs::before { animation: none; }
}

/* ============ HERO — car must stay fully visible ============ */
.hero { position: relative; height: 100svh; overflow: hidden; }
.hero__media { position: absolute; inset: -8% 0; will-change: transform; }
.hero__media img { transform: scale(1.08); }
/* IMPORTANT: only a soft bottom fade for the wordmark — NO central
   vignette that would dim the car. The car reads clean and full-bleed. */
.hero__veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(8,8,10,0.92) 0%, rgba(8,8,10,0.45) 18%, transparent 42%),
    linear-gradient(to bottom, rgba(8,8,10,0.40) 0%, transparent 22%);
}
.hero__content {
  position: absolute; left: 0; right: 0; bottom: clamp(7vh, 11vh, 13vh);
  text-align: center; padding: 0 1.2rem; z-index: 5;
}
.hero__eyebrow {
  overflow: hidden; margin-bottom: 0.7rem;
  font-size: 0.78rem; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--accent-soft); padding-left: 0.42em;
}
.hero__eyebrow span { display: inline-block; }
.hero__title { line-height: 0.9; }
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(4rem, 16vw, 15rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 4px 40px rgba(0,0,0,0.5);
}
.hero__sub { overflow: hidden; margin-top: 1.1rem; }
.hero__sub span {
  display: inline-block; max-width: 34ch;
  color: var(--ink); opacity: 0.92; font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  letter-spacing: 0.04em;
}
/* Hero glass chip — docked at the LEFT edge, clear of the centred car.
   Holds three quick facts only; never overlaps the car's face/body. */
.hero__chip {
  position: absolute; z-index: 6;
  left: clamp(1.2rem, 4vw, 3rem); bottom: clamp(7vh, 11vh, 13vh);
  display: flex; gap: clamp(1rem, 2.4vw, 2rem);
  padding: 1rem 1.4rem; max-width: min(86vw, 30rem);
}
.hero__chip .chip__item { text-align: left; }
.hero__chip .chip__v {
  display: block; font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.1rem); line-height: 1; color: var(--ink);
}
.hero__chip .chip__k {
  display: block; margin-top: 0.35rem; font-size: 0.62rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
@media (max-width: 900px) { .hero__chip { display: none; } }

.hero__scroll {
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
  font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted);
}
.hero__scroll i {
  width: 1px; height: 38px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollPulse 1.8s var(--ease) infinite;
}
@keyframes scrollPulse {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Hero text is hidden until the JS intro animates it in — prevents the flash where it
   appeared, vanished, then slid in. JS reveals it (animated, or instantly under reduced
   motion). Fallback: if the user prefers reduced motion, CSS reveals it regardless. */
.hero__eyebrow span,
.hero__title .line > span,
.hero__sub span,
.hero__scroll { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .hero__eyebrow span,
  .hero__title .line > span,
  .hero__sub span,
  .hero__scroll { visibility: visible; }
}

/* ============ STATEMENT ============ */
.statement {
  min-height: 80vh; display: grid; place-items: center;
  padding: 14vh clamp(1.4rem, 8vw, 10rem);
}
.statement__text {
  font-size: clamp(1.4rem, 3.2vw, 2.6rem);
  font-weight: 500; line-height: 1.32; max-width: 26ch; text-align: center;
  letter-spacing: -0.01em;
}
.reveal-words .word { display: inline-block; opacity: 0.12; transition: opacity 0.4s; }

/* ============ WORLD (parallax chapters) ============ */
.world { position: relative; height: 100svh; overflow: hidden; }
.world__media { position: absolute; inset: -12% 0; will-change: transform; }
.world__media img { transform: scale(1.18); }
/* Side-only gradients so the car body stays visible behind the text. */
/* Lighter than before: the glass caption tiles now carry legibility, so the
   side gradient only needs to seat the tile — the car reads through more. */
.world::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(8,8,10,0.6) 0%, rgba(8,8,10,0.12) 40%, transparent 60%);
}
.world[data-theme="salt"]::after,
.world[data-theme="night"]::after {
  background: linear-gradient(270deg, rgba(8,8,10,0.6) 0%, rgba(8,8,10,0.12) 40%, transparent 60%);
}
.world__caption {
  position: absolute; z-index: 4; bottom: clamp(10vh, 16vh, 20vh);
  left: clamp(1.4rem, 6vw, 6rem); max-width: 30rem;
}
/* Frosted glass caption tile — keeps scroll-world copy legible over the
   moving photography while letting the car read through the blur. */
.world__caption.glass {
  padding: clamp(1.6rem, 2.6vw, 2.2rem) clamp(1.6rem, 2.6vw, 2.2rem) clamp(1.5rem, 2.4vw, 2rem);
  border-radius: 16px; max-width: min(86vw, 32rem);
}
.world__caption--right { left: auto; right: clamp(1.4rem, 6vw, 6rem); text-align: right; }
/* dock to the TOP instead of the bottom — used where the car's front sits low in the
   frame (salt flats, night) so the tile never covers the car. */
.world__caption--top { top: clamp(8vh, 14vh, 18vh); bottom: auto; }
.world__index {
  display: block; font-size: 0.75rem; letter-spacing: 0.35em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem;
}
.world__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 5.2rem); line-height: 0.95;
  text-transform: uppercase; letter-spacing: 0.01em; margin-bottom: 1rem;
}
.world__body { color: var(--muted); font-size: clamp(0.95rem, 1.4vw, 1.15rem); max-width: 34ch; }
.world__caption--right .world__body { margin-left: auto; }
/* inside the glass tile the body sits on a blurred panel, so lift it for legibility */
.world__caption.glass .world__body { color: #cfcfd6; }

/* ============ SPECS — dedicated section, never over the car ============ */
.specs {
  background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: clamp(5rem, 13vh, 11rem) clamp(1.4rem, 6vw, 6rem);
}
.specs__head { max-width: 1200px; margin: 0 auto clamp(3rem, 6vw, 5rem); text-align: center; }
.specs__eyebrow {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-size: 0.75rem; letter-spacing: 0.35em;
  text-transform: uppercase; color: var(--rosso-soft); margin-bottom: 1rem;
}
/* tricolore hair — green / white / red — the Car Zero racing stripe, in miniature */
.specs__eyebrow::before {
  content: ""; width: 34px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--verde) 0 33%, var(--ink) 33% 66%, var(--rosso) 66% 100%);
}
.specs__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: 0.98; text-transform: uppercase;
}
.specs__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 1.8vw, 1.4rem);
  max-width: 1200px; margin: 0 auto;
}
/* Each stat is now a frosted GLASS tile (.stat carries .glass in markup). */
.stat {
  text-align: left; padding: clamp(1.4rem, 2.2vw, 1.9rem) clamp(1.3rem, 2vw, 1.7rem) clamp(1.2rem, 1.8vw, 1.5rem);
  border-radius: 14px;
}
/* override the generic warm top-hairline with a sharp red marque rule */
.stat.glass::before {
  background: var(--rosso); height: 2px; width: 42px; left: clamp(1.3rem, 2vw, 1.7rem); right: auto;
  opacity: 0.95;
}
.stat__num {
  display: block; font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; color: var(--ink);
}
.stat__label {
  display: block; margin-top: 0.6rem; font-size: 0.7rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.specs__note {
  max-width: 60ch; margin: clamp(3rem, 6vw, 4.5rem) auto 0; text-align: center;
  color: var(--muted); font-size: clamp(0.92rem, 1.3vw, 1.05rem); line-height: 1.7;
}

/* ============ GALLERY — large & clickable ============ */
.gallery { padding: clamp(5rem, 12vh, 10rem) clamp(1.4rem, 6vw, 6rem); }
.gallery__head { max-width: 1280px; margin: 0 auto clamp(2.5rem, 5vw, 4rem); }
.gallery__eyebrow {
  display: block; font-size: 0.75rem; letter-spacing: 0.35em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem;
}
.gallery__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 5.5rem); line-height: 0.95; text-transform: uppercase;
}
.gallery__lead { margin-top: 1rem; color: var(--muted); max-width: 46ch; font-size: clamp(0.95rem, 1.4vw, 1.1rem); }
.gallery__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.8rem, 1.4vw, 1.4rem); max-width: 1280px; margin: 0 auto;
}
.gallery__item {
  position: relative; display: block; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft);
  aspect-ratio: 4 / 3; padding: 0;
}
.gallery__item--wide { grid-column: span 2; aspect-ratio: 16 / 9; }
.gallery__item img {
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
  filter: saturate(0.95) brightness(0.92);
}
.gallery__item:hover img, .gallery__item:focus-visible img { transform: scale(1.06); filter: saturate(1.05) brightness(1); }
.gallery__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gallery__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 1.4rem 1.2rem 1rem; text-align: left;
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
  background: linear-gradient(to top, rgba(8,8,10,0.85), transparent);
  opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s;
}
.gallery__item:hover .gallery__cap, .gallery__item:focus-visible .gallery__cap { opacity: 1; transform: translateY(0); }
.gallery__item::after {
  content: "⤢"; position: absolute; top: 0.9rem; right: 1rem; z-index: 2;
  font-size: 1.1rem; color: var(--ink); opacity: 0; transition: opacity 0.4s;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.gallery__item:hover::after, .gallery__item:focus-visible::after { opacity: 0.85; }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(4,4,6,0.96); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s;
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__figure { max-width: 90vw; max-height: 86vh; margin: 0; }
.lightbox__img {
  width: auto; height: auto; max-width: 90vw; max-height: 78vh;
  object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8);
  transform: scale(0.96); transition: transform 0.35s var(--ease);
}
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__cap {
  text-align: center; margin-top: 1rem; color: var(--ink);
  font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase;
}
.lightbox__close {
  position: absolute; top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem); z-index: 3;
  width: 52px; height: 52px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--ink);
  font-size: 1.8rem; line-height: 1; transition: background 0.3s, transform 0.3s;
}
.lightbox__close:hover { background: var(--accent); color: #120800; transform: rotate(90deg); }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 56px; height: 56px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--ink);
  font-size: 2rem; line-height: 1; transition: background 0.3s, color 0.3s;
}
.lightbox__nav:hover { background: var(--accent); color: #120800; }
.lightbox__nav--prev { left: clamp(0.8rem, 3vw, 2.4rem); }
.lightbox__nav--next { right: clamp(0.8rem, 3vw, 2.4rem); }
.lightbox__count {
  position: absolute; bottom: clamp(1rem, 3vw, 2rem); left: 50%; transform: translateX(-50%);
  z-index: 3; font-size: 0.8rem; letter-spacing: 0.2em; color: var(--muted);
}

/* ============ LEGEND / CTA ============ */
.legend { position: relative; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.legend__media { position: absolute; inset: -10% 0; will-change: transform; }
.legend__media img { transform: scale(1.1); }
.legend__veil {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 110% at 50% 55%, transparent 34%, rgba(8,8,10,0.9) 100%);
}
.legend__content { position: relative; z-index: 4; text-align: center; padding: 0 1.2rem; }
.legend__eyebrow {
  display: block; font-size: 0.75rem; letter-spacing: 0.38em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.2rem;
}
.legend__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 7rem); text-transform: uppercase; line-height: 0.95;
}
.legend__price { margin: 1.2rem 0 2rem; color: var(--muted); letter-spacing: 0.08em; }
.legend__price strong { color: var(--ink); font-weight: 600; }
.legend__cta {
  display: inline-block; font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase;
  background: var(--rosso); color: #fff; font-weight: 600;
  padding: 1.1rem 2.6rem; border-radius: 999px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  box-shadow: 0 10px 40px -10px rgba(200, 18, 38, 0.7);
}
.legend__cta:hover { transform: translateY(-3px); box-shadow: 0 18px 50px -10px rgba(200, 18, 38, 0.9); }

/* ============ FOOTER ============ */
.footer { background: var(--bg); padding: clamp(3rem, 8vw, 6rem) clamp(1.4rem, 6vw, 6rem) 2.5rem; }
.footer__top { overflow: hidden; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.footer__big {
  font-family: var(--font-display); font-size: clamp(4rem, 22vw, 20rem);
  line-height: 0.8; letter-spacing: 0.02em; color: var(--bg-soft);
  -webkit-text-stroke: 1px var(--line); display: block;
}
.footer__bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin-top: 1.6rem; font-size: 0.8rem; color: var(--muted);
}
.footer__bottom a { color: var(--accent); }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .specs__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================================================
   MOBILE / PORTRAIT (≤900px) rules live in css/mobile.css, loaded
   after this file. Kept separate to stay under the 500-LoC ceiling.
   =========================================================== */

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .hero__scroll i { animation: none; }
  .gallery__item img { transition: none; }
  * { scroll-behavior: auto !important; }
}
