@font-face {
  font-family: "Instrument Sans";
  src: url(fonts/instrument-latin-wght-normal.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #08080a;
  --ink: #f4f1ea;
  --muted: #b4afa4;
  --gold: #d9b064;
  --gold-hi: #f3d995;
  --line: rgba(244, 241, 234, 0.14);
  --font: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --plat-y: 15%;          /* altura de la plataforma desde abajo */
  --car-w: min(58vw, 760px, 92vh);
  color-scheme: dark;
  accent-color: var(--gold);
  scrollbar-color: #3b352a var(--bg);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { color: var(--ink); font-family: var(--font); line-height: 1.5; -webkit-tap-highlight-color: transparent; }
body.is-intro { overflow: hidden; }
::selection { background: var(--gold); color: #000; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 99; background: var(--gold); color: #000; padding: 10px 14px; font-weight: 700; }
.skip:focus { top: 12px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 26px;
  font: 700 14px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.16s var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #120d03; }
.btn-line { border-color: rgba(217, 176, 100, 0.5); color: var(--ink); background: rgba(8, 8, 10, 0.4); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 12px; }
.link { background: none; border: 0; color: var(--muted); font: 500 14px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

/* ── ENTRADA: PUERTA ── */
.gate { position: fixed; inset: 0; z-index: 50; overflow: hidden; background: #050506; }
.gate-wall {
  position: absolute; inset: 0;
  background:
    var(--puerta, none) center / cover no-repeat,
    radial-gradient(60% 40% at 50% 0%, rgba(217, 176, 100, 0.22), transparent 70%),
    linear-gradient(180deg, #121214 0%, #0a0a0b 62%, #050506 100%);
}
.door {
  position: absolute; left: 50%; top: 9vh; width: min(78vw, 980px); height: 56vh; transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%, rgba(0, 0, 0, 0.35)) 0 0 / 100% 12.5% repeat-y,
    linear-gradient(180deg, transparent calc(100% - 1px), rgba(217, 176, 100, 0.55) calc(100% - 1px)) 0 0 / 100% 12.5% repeat-y,
    #0e0e10;
  box-shadow: 0 0 0 10px #17171a, 0 0 0 11px rgba(217, 176, 100, 0.25), 0 40px 80px rgba(0, 0, 0, 0.6);
  transition: transform 1.4s var(--ease-io);
}
.has-puerta .door { opacity: 0; }
.door-light { position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: var(--gold-hi); box-shadow: 0 0 24px 6px rgba(243, 217, 149, 0.55); opacity: 0; transition: opacity 0.4s ease; }
.gate-copy { position: absolute; left: 0; right: 0; bottom: max(5vh, 24px); z-index: 2; text-align: center; display: grid; gap: 12px; justify-items: center; padding: 0 16px; }
.gate-brand { font-weight: 700; letter-spacing: 0.42em; font-size: clamp(26px, 5vw, 46px); padding-left: 0.42em; }
.gate-sub { color: var(--muted); font-size: 15px; margin-top: -6px; }
.gate.is-opening .door { transform: translate(-50%, -105%); }
.gate.is-opening .door-light { opacity: 1; }
.gate.is-opening .gate-copy { opacity: 0; transition: opacity 0.3s ease; }
.gate.is-gone { opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0s linear 0.6s; }

/* ── GARAJE ── */
.garage { position: relative; height: 100vh; height: 100svh; min-height: 600px; overflow: hidden; isolation: isolate; }
.scene {
  position: absolute; inset: 0; z-index: -1; transform-origin: 50% 70%;
  perspective: 1400px; perspective-origin: 50% 60%;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.scene.dragging { cursor: grabbing; }
.is-intro .scene { transform: scale(1.16); }
.scene.dolly { transition: transform 1.8s var(--ease-out); transform: none; }

/* Fondo: imagen generada del garaje o garaje dibujado provisional */
.bg { position: absolute; inset: 0; background: #070708; }
.bg.has-img { background: var(--garaje) center / cover no-repeat; }
.bg.has-img > * { display: none; }
.ph-ceiling {
  position: absolute; left: 0; right: 0; top: 0; height: 30%;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(16.66% - 2px), rgba(243, 217, 149, 0.3) calc(16.66% - 2px) 16.66%),
    linear-gradient(180deg, #0b0b0c, #121214);
  transform: perspective(600px) rotateX(-62deg); transform-origin: top;
}
.ph-wall {
  position: absolute; left: 0; right: 0; top: 18%; height: 42%;
  background:
    radial-gradient(42% 70% at 50% 100%, rgba(217, 176, 100, 0.16), transparent 70%),
    repeating-linear-gradient(90deg, #0d0d0f 0 9%, rgba(217, 176, 100, 0.35) 9% 9.2%),
    #0d0d0f;
}
.ph-floor {
  position: absolute; left: -20%; right: -20%; bottom: 0; height: 44%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='1' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .85 0 0 0 0 .69 0 0 0 0 .39 0 0 0 9 -7.6'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23f)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #151517 0%, #050506 100%);
  transform: perspective(500px) rotateX(58deg); transform-origin: top;
}

/* Foco de estudio sobre la plataforma */
.spot { position: absolute; left: 50%; top: -10%; width: 70vw; height: 110%; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(48% 60% at 50% 72%, rgba(255, 236, 196, 0.13), transparent 70%); }

.platform {
  position: absolute; left: 50%; bottom: var(--plat-y); width: calc(var(--car-w) * 1.12); aspect-ratio: 4.2 / 1;
  transform: translate(-50%, 50%); border-radius: 50%; overflow: hidden;
  background: radial-gradient(closest-side, #1c1c1f 58%, #0c0c0e 96%);
  box-shadow: 0 0 0 2px rgba(243, 217, 149, 0.85), 0 0 36px 6px rgba(217, 176, 100, 0.3), 0 30px 60px rgba(0, 0, 0, 0.75);
}
.platform-sweep {
  position: absolute; inset: -40%;
  background: conic-gradient(from 0deg, transparent 0 300deg, rgba(243, 217, 149, 0.2) 340deg, transparent 360deg);
  animation: sweep 9s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }

/* Carrusel 3D */
.track { list-style: none; position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.slot {
  position: absolute; left: 50%; bottom: var(--plat-y); width: var(--car-w); margin-left: calc(var(--car-w) / -2);
  transform-origin: 50% 100%;
  transform: translate3d(var(--x, 0), 0, var(--z, 0)) rotateY(var(--ry, 0deg)) scale(var(--s, 1));
  opacity: var(--op, 1); filter: brightness(var(--br, 1));
  transition: transform 0.75s var(--ease-out), opacity 0.5s ease, filter 0.5s ease;
  will-change: transform;
}
.slot.instant { transition: none; }
.car { position: relative; }
.car img { width: 100%; height: auto; }
.car .ref {
  position: absolute; left: 0; right: 0; top: 100%; transform: scaleY(-1); opacity: 0.22;
  -webkit-mask-image: linear-gradient(0deg, #000 0%, transparent 38%); mask-image: linear-gradient(0deg, #000 0%, transparent 38%);
}
.car::after { /* sombra de contacto */
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -2%; height: 12%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.75), transparent); z-index: -1;
}
/* Foto real provisional (con fondo): se funde con un óvalo */
.slot.is-photo .car img:first-child {
  -webkit-mask-image: radial-gradient(62% 72% at 50% 56%, #000 50%, transparent 76%);
  mask-image: radial-gradient(62% 72% at 50% 56%, #000 50%, transparent 76%);
}
.slot.is-photo .ref { display: none; }
.slot.is-photo { bottom: calc(var(--plat-y) - 4%); }

.vignette { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.6) 0%, transparent 20%, transparent 52%, rgba(8, 8, 10, 0.95) 100%),
              radial-gradient(120% 90% at 50% 60%, transparent 55%, rgba(8, 8, 10, 0.7) 100%); }

/* ── HUD ── */
.top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: max(16px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 0; }
.logo { font-weight: 700; letter-spacing: 0.32em; font-size: 15px; }
.logo span { color: var(--gold); }
.counter { font-size: 13px; font-weight: 700; letter-spacing: 0.2em; color: var(--muted); font-variant-numeric: tabular-nums; }
.hud {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0 clamp(16px, 4vw, 40px) max(20px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: end;
}
.bay { color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.hud h1 { font-size: clamp(30px, 4.6vw, 58px); line-height: 1; letter-spacing: -0.02em; margin: 6px 0 12px; text-wrap: balance; }
.info > * { transition: opacity 0.3s ease, transform 0.3s var(--ease-out); }
.info.swap > * { opacity: 0; transform: translateY(6px); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 13px; padding: 5px 10px; border: 1px solid rgba(217, 176, 100, 0.4); color: var(--gold-hi); background: rgba(8, 8, 10, 0.45); }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, max-content)); gap: 4px 24px; margin-top: 14px; }
.specs div { display: grid; }
.specs dt { font-size: 12px; color: var(--muted); }
.specs dd { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; }
.rotate-hint { font-size: 13px; color: var(--muted); }
.rail { display: flex; align-items: center; gap: 10px; min-width: 0; }
.arrow { width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid rgba(217, 176, 100, 0.45); background: rgba(8, 8, 10, 0.55); color: var(--ink); cursor: pointer; transition: border-color 0.2s ease, transform 0.16s var(--ease-out); }
.arrow:active { transform: scale(0.94); }
.arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bays { list-style: none; display: flex; gap: 6px; position: relative; }
.bays button {
  width: 44px; height: 52px; border: 1px solid var(--line); background: rgba(8, 8, 10, 0.55); color: var(--muted);
  font: 700 13px var(--font); font-variant-numeric: tabular-nums; cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.bays button[aria-selected="true"] { color: #120d03; background: var(--gold); border-color: var(--gold); }

/* ── LISTA ── */
.fleet { padding: 96px 0; background: linear-gradient(180deg, #08080a, #0e0e10); border-top: 1px solid rgba(217, 176, 100, 0.25); }
.fleet h2 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.02em; }
.fleet-sub { color: var(--muted); margin: 8px 0 40px; }
.fleet-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.fleet-grid li { border: 1px solid var(--line); background: #0f0f11; display: flex; flex-direction: column; }
.fleet-grid img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.fleet-grid .fb { padding: 16px; display: grid; gap: 12px; flex: 1; align-content: space-between; }
.fleet-grid h3 { font-size: 18px; }
.fleet-grid .row { display: flex; gap: 10px; flex-wrap: wrap; }
.foot { padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.demo-note { flex-basis: 100%; font-size: 12px; opacity: 0.8; }

@media (hover: hover) and (pointer: fine) {
  .btn-gold:hover { background: var(--gold-hi); }
  .btn-line:hover, .arrow:hover, .bays button:hover { border-color: var(--gold); color: var(--ink); }
  .link:hover { color: var(--ink); }
}

@media (max-width: 760px) {
  :root { --car-w: 86vw; --plat-y: 47%; }
  .hud { grid-template-columns: 1fr; }
  .rail { justify-content: space-between; }
  .bays { overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; scroll-snap-type: x mandatory; }
  .bays li { scroll-snap-align: center; flex-shrink: 0; }
  .cta .btn { flex: 1 1 100%; }
  .rotate-hint { flex-basis: 100%; text-align: center; }
  .counter { display: none; }
  .ph-floor { height: 56%; }
  .door { width: 88vw; height: 46vh; top: 10vh; }
}

@media (prefers-reduced-motion: reduce) {
  .door { transition: opacity 0.4s ease; }
  .gate.is-opening .door { transform: translateX(-50%); opacity: 0; }
  .is-intro .scene, .scene.dolly { transform: none; transition: none; }
  .slot { transition: opacity 0.3s ease; }
  .platform-sweep { animation: none; }
  .info > * { transition: opacity 0.2s ease; }
  .info.swap > * { transform: none; }
}
