/* LAMPSI Detail Studio (ClientDriven concept): tokens, nav, shared parts and the wash panel.
   Every size is a multiple of --u, one pixel of the 1440 x 810 design canvas (see SPEC-video-B-exact.md). */
:root {
  --u: min(calc(100vw / 1440), calc(100vh / 810));
  --bg: #050408;
  --red: #dc0c38;
  --red-ink: #e8174b;
  --red-small: #f23d63;   /* the same red, a step lighter, for the tiny eyebrows (readable on near-black) */
  --tan: #b59a7c;
  --foam: #f6f0e4;
  --grey: rgba(255, 255, 255, .58);
  --edge: rgba(255, 255, 255, .08);
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --side: calc(56 * var(--u));
  /* The car pictures are drawn at this share of the panel's width, held to its bottom right corner, so the car sits
     in the right two thirds as it does in the video. 1 = the full width of the panel. */
  --car-fit: .9;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: #fff; font-family: var(--sans); -webkit-font-smoothing: antialiased; }
img, video, canvas { display: block; }
p, h1, h2, dl, dd, ol, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 90; padding: 10px 16px; border-radius: 99px; background: #fff; color: #0b0a0d; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- type ---------- */
.eyebrow { font: 500 max(10px, calc(13 * var(--u))) / 1 var(--mono); letter-spacing: .23em; text-transform: uppercase; color: var(--red-small); }
.mono { font: 500 max(9px, calc(11 * var(--u))) / 1 var(--mono); letter-spacing: .23em; text-transform: uppercase; color: var(--grey); }
.display { font: 400 calc(99 * var(--u)) / 1.03 var(--serif); letter-spacing: -.005em; }
.display em { font-style: italic; color: var(--red-ink); transition: color .6s; }
.accent { color: var(--accent, var(--tan)) !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: calc(9 * var(--u)); height: calc(52 * var(--u)); padding: 0 calc(24 * var(--u));
  border: 0; border-radius: 99px; font: 600 max(12px, calc(16.5 * var(--u))) / 1 var(--sans); color: #fff; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .25s, box-shadow .25s; }
.btn.red { background: var(--red); }
.btn.dark { background: #1a1a1a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); padding: 0 calc(22 * var(--u)); }
.btn .arrow { width: calc(14 * var(--u)); height: calc(12 * var(--u)); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.btn:active { transform: scale(.96); }
@media (hover: hover) {
  .btn.red:hover { background: #f01446; box-shadow: 0 calc(8 * var(--u)) calc(28 * var(--u)) rgba(220, 12, 56, .38); transform: translateY(-1px); }
  .btn.dark:hover { background: #262628; transform: translateY(-1px); }
  .btn:hover .arrow { transform: translateX(3px); }
}

/* ---------- nav ---------- */
.nav { position: fixed; z-index: 50; left: calc(24 * var(--u)); right: calc(24 * var(--u)); top: calc(18 * var(--u)); height: calc(68 * var(--u));
  display: flex; align-items: center; border-radius: calc(20 * var(--u)); background: rgba(12, 11, 13, .72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.logo { display: flex; align-items: center; gap: calc(13 * var(--u)); margin-left: calc(24 * var(--u)); font: 600 max(13px, calc(18 * var(--u))) / 1 var(--sans); letter-spacing: .25em; text-decoration: none; }
.hex { width: calc(27 * var(--u)); height: calc(31 * var(--u)); flex: none; fill: none; stroke: var(--red-ink); stroke-width: 2.6; stroke-linejoin: round; }
.tabs { position: relative; margin-left: auto; display: grid; grid-template-columns: repeat(5, calc(112 * var(--u))); height: calc(42 * var(--u)); }
.tab { position: relative; z-index: 1; display: grid; place-items: center; border-radius: 99px; font: 500 max(11px, calc(16 * var(--u))) / 1 var(--sans);
  color: rgba(255, 255, 255, .8); text-decoration: none; transition: color .35s; }
.tab.on { color: #0b0a0d; }
.tab-pill { position: absolute; left: 0; top: 0; width: 20%; height: 100%; border-radius: 99px; background: #fff; transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .55s var(--ease); }
@media (hover: hover) { .tab:not(.on):hover { color: #fff; } }
.nav-cta { height: calc(48 * var(--u)); min-width: calc(143 * var(--u)); padding: 0 calc(18 * var(--u)); margin: 0 calc(13 * var(--u)) 0 calc(59 * var(--u)); font-size: max(12px, calc(16 * var(--u))); }

/* ---------- shared panel parts ---------- */
.panel { position: relative; height: 100vh; overflow: hidden; background: var(--bg); }
.pic { position: absolute; inset: 0; overflow: hidden; isolation: isolate; }   /* isolate: the layers inside stay under the words */
.pic > img, .pic > video, .pic > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* the car picture: a 16:9 box, --car-fit of the panel wide, in the bottom right corner */
.wash .pic, .wraps .pic { inset: auto 0 0 auto; width: calc(var(--car-fit) * 100%); aspect-ratio: 16 / 9; }
/* the shade keeps the words readable and melts the picture's left and top edges into the page */
.shade { position: absolute; inset: 0; pointer-events: none; --gap-left: calc((1 - var(--car-fit)) * 100%); --gap-top: max(0px, calc(100vh - var(--car-fit) * 56.25vw));
  background: linear-gradient(90deg, var(--bg) var(--gap-left), rgba(5, 4, 8, .66) calc(var(--gap-left) + 12%), rgba(5, 4, 8, 0) 46%),
    linear-gradient(180deg, var(--bg) var(--gap-top), rgba(5, 4, 8, 0) calc(var(--gap-top) + 3.5%)), linear-gradient(0deg, rgba(5, 4, 8, .5), rgba(5, 4, 8, 0) 20%); }
/* a box exactly where the picture is drawn, so the hood dot can be pinned to a spot on the car */
.cover { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

.badge-slot { position: absolute; right: calc(79 * var(--u)); bottom: calc(79 * var(--u)); width: calc(112 * var(--u)); height: calc(112 * var(--u)); z-index: 3; }
.badge { position: relative; width: 100%; height: 100%; border-radius: 50%; background: #0b0a0d; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 calc(10 * var(--u)) calc(30 * var(--u)) rgba(0, 0, 0, .4); }
.badge-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 24s linear infinite; }
.badge-ring text { font: 500 8.4px var(--mono); fill: rgba(255, 255, 255, .92); }
.badge .hex { position: absolute; left: 50%; top: 50%; width: calc(31 * var(--u)); height: calc(35 * var(--u)); transform: translate(-50%, -50%); stroke-width: 2.2; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 1. the wash ---------- */
.wash { position: relative; height: 430vh; background: var(--bg); }
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; --accent: var(--tan); }
.still { opacity: 0; }
.still.on { opacity: 1; }
.wash .pic::after { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: var(--dip, 0); pointer-events: none; }   /* a cut in the film dips to dark */
section:focus, footer:focus { outline: none; }   /* panels take focus after a nav jump; they are not controls */
#wash-film { opacity: 0; transition: opacity .5s; }
.stage.has-film #wash-film { opacity: 1; }
.stage.has-film .still { visibility: hidden; }

.hero { position: absolute; left: calc(57 * var(--u)); top: calc(110 * var(--u)); }
.hero h1 { margin: calc(14 * var(--u)) 0 0 calc(-1 * var(--u)); font-size: calc(104 * var(--u)); line-height: calc(108 * var(--u)); }
.hero h1 em { transition: none; }
.lede { margin-top: calc(13 * var(--u)); font: 400 max(13px, calc(17.6 * var(--u))) / calc(27.5 * var(--u)) var(--sans); color: rgba(255, 255, 255, .8); }
.hero-btns { display: flex; gap: calc(9 * var(--u)); margin-top: calc(17 * var(--u)); }

.gloss { position: absolute; left: var(--side); bottom: calc(155 * var(--u)); width: calc(266 * var(--u)); height: calc(106 * var(--u)); border-radius: calc(14 * var(--u));
  background: rgba(13, 13, 13, .84); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.gloss .mono { position: absolute; left: calc(21 * var(--u)); top: calc(49 * var(--u)); font-size: max(8px, calc(11 * var(--u))); letter-spacing: .2em; color: rgba(255, 255, 255, .6); }
.gloss-num { position: absolute; right: calc(18 * var(--u)); top: calc(15 * var(--u)); font: 400 calc(54 * var(--u)) / 1 var(--serif); font-variant-numeric: lining-nums; }
.segs { position: absolute; left: calc(19 * var(--u)); right: calc(17 * var(--u)); top: calc(77 * var(--u)); height: calc(13 * var(--u)); display: flex; gap: calc(3 * var(--u)); }
.segs i { flex: 1; border-radius: 1px; background: #2f2f2f; }
.segs i.on { background: var(--accent); }

.steps { position: absolute; left: var(--side); bottom: calc(62 * var(--u)); width: calc(1120 * var(--u)); }
.track { position: relative; height: calc(3 * var(--u)); min-height: 2px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(255, 255, 255, .22); }
.fill { position: absolute; inset: 0; border-radius: 2px; background: var(--red-ink); transform-origin: 0 50%; transform: scaleX(.2); will-change: transform; }
.steps ol { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: calc(14 * var(--u)); list-style: none;
  font: 700 max(9px, calc(13 * var(--u))) / 1 var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.steps li { color: rgba(255, 255, 255, .4); transition: color .45s; white-space: nowrap; }   /* a step not reached yet stays dim, as in the video */
.steps li.on { color: #fff; }

.hotspot { position: absolute; left: 30%; top: 44%; width: calc(56 * var(--u)); height: calc(56 * var(--u)); margin: calc(-28 * var(--u)) 0 0 calc(-28 * var(--u));
  padding: 0; border: 0; border-radius: 50%; background: none; opacity: 0; pointer-events: none; transition: opacity .5s; }
.hotspot i { position: absolute; inset: calc(15 * var(--u)); border-radius: 50%; background: #fff; box-shadow: 0 0 calc(18 * var(--u)) rgba(255, 255, 255, .8); }
.hotspot::before { content: ""; position: absolute; inset: calc(4 * var(--u)); border-radius: 50%; border: 1px solid rgba(255, 255, 255, .55); animation: ping 2s ease-out infinite; }
.stage.clean .hotspot { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .hotspot:hover i { transform: scale(1.25); } }
.hotspot i { transition: transform .3s var(--ease); }
@keyframes ping { 0% { transform: scale(.55); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

/* the round lens that grows from the hood dot into the ceramic panel */
.lens { position: fixed; inset: 0; z-index: 40; pointer-events: none; visibility: hidden; clip-path: circle(0 at var(--x, 50%) var(--y, 50%)); }
.lens img { width: 100%; height: 100%; object-fit: cover; }
.lens::after { content: ""; position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: calc(var(--r, 0px) * 2); height: calc(var(--r, 0px) * 2); margin: calc(var(--r, 0px) * -1) 0 0 calc(var(--r, 0px) * -1);
  border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), inset 0 0 40px rgba(255, 255, 255, .25); }
.lens.on { visibility: visible; }

/* ---------- entrance (the first seconds of the video) ---------- */
.rise { animation: rise .9s var(--ease) both; animation-delay: calc(var(--d, 0) * 110ms + 120ms); }
@keyframes rise { from { opacity: 0; transform: translateY(calc(16 * var(--u))); } }
.nav { animation: drop .9s var(--ease) .25s both; }
@keyframes drop { from { opacity: 0; transform: translateY(calc(-14 * var(--u))); } }
.reveal { opacity: 0; transform: translateY(calc(22 * var(--u))); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rise, .nav, .badge-ring, .hotspot::before { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tab-pill, .btn, .steps li { transition: none; }
}
