:root {
  --bg: #efefef;
  --ink: #0b0b0b;
  --mute: #666666;
  --line: #d4d4d4;
  --card: #fafafa;
  --red: #d71921;
  --gut: clamp(16px, 5vw, 80px);
}
.dark { --bg: #000; --ink: #f2f2f2; --mute: #8c8c8c; --line: #222; --card: #0e0e0e; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 "IBM Plex Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
section, footer {
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }

.doto { font-family: "Doto", monospace; font-weight: 900; letter-spacing: -.02em; line-height: .92; text-transform: uppercase; }
.mono { font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.tag { color: var(--mute); margin-bottom: 20px; }
.dots { /* design-exception: dot grid — source: product concept (dot-matrix display), limited to hero + shop */
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 14%, transparent) 1px, transparent 1.4px);
  background-size: 18px 18px;
}

/* NAV: mix-blend keeps it readable on light and dark backgrounds */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 22px var(--gut);
  color: #fff; mix-blend-mode: difference;
}
.logo { font: 900 22px/1 "Doto", monospace; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 6px; }
.logo i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.nav nav { display: flex; gap: 28px; margin-left: auto; font: 12px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.nav nav a { opacity: .7; transition: opacity .2s; }
.nav nav a:hover { opacity: 1; }
.nav-cta { font: 12px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; border: 1px solid currentColor; padding: 9px 16px; border-radius: 2px; }

/* HERO */
.hero { min-height: 100svh; display: grid; align-content: center; padding: 120px var(--gut) 80px; position: relative; }
.hero h1 { font-size: clamp(72px, 15vw, 240px); }
.hero .lede { max-width: 30ch; margin-top: 32px; font-size: 19px; }
.scroll-hint { position: absolute; bottom: 32px; left: var(--gut); display: flex; align-items: center; gap: 10px; color: var(--mute); }
.scroll-hint span { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* SCROLL-DRIVEN SCENES */
.scene { height: var(--len); position: relative; }
.sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; grid-template-columns: minmax(280px, 1fr) 1.7fr; align-items: center; gap: 24px;
  padding: 0 var(--gut);
}
.copy h2 { font-size: clamp(44px, 5.4vw, 88px); margin-bottom: 22px; }
.copy > p:not(.tag):not(.meter) { max-width: 34ch; color: color-mix(in srgb, var(--ink) 75%, transparent); }
.parts { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: p; display: grid; gap: 8px; }
.parts li { counter-increment: p; color: var(--mute); transition: color .3s; display: flex; gap: 12px; align-items: center; }
.parts li::before { content: counter(p, decimal-leading-zero); width: 26px; }
.parts li::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); opacity: 0; transition: opacity .3s; }
.parts li.on { color: var(--ink); }
.parts li.on::after { opacity: 1; }
.meter { font-size: 40px; margin-top: 28px; color: var(--mute); }
.meter b { color: var(--ink); font-weight: 900; }

.stage { position: relative; height: 100%; }

/* --- Produits : rendu WebGL (gl.js) --- */
.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* --- Dive into the screen --- */
.dive .sticky { display: block; }
.dive-label { position: absolute; left: var(--gut); top: 50%; translate: 0 -50%; font-size: clamp(40px, 5vw, 80px); opacity: calc(1 - var(--p, 0) * 3); }
.phone-front {
  position: absolute; left: 50%; top: 50%; width: 300px; height: 620px; margin: -310px 0 0 -150px;
  padding: 4px; border-radius: 50px;
  background: linear-gradient(145deg, #8f8f8f, #ececec 18%, #7b7b7b 46%, #d6d6d6 78%, #888);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .28), 0 0 0 1px rgba(0, 0, 0, .2);
  transform: scale(var(--zoom, 1));
  will-change: transform; /* a single rasterised texture keeps the zoom smooth */
}
/* side buttons */
.phone-front::before, .phone-front::after { content: ""; position: absolute; width: 4px; border-radius: 2px; background: linear-gradient(90deg, #777, #d5d5d5); }
.phone-front::before { right: -3px; top: 150px; height: 70px; }
.phone-front::after { left: -3px; top: 120px; height: 110px; }
.dive.zooming .phone-front { box-shadow: none; }
.screen { position: relative; height: 100%; border-radius: 46px; border: 7px solid #050505; background: #000; overflow: hidden; display: grid; place-items: center; }
.screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(125deg, rgba(255, 255, 255, .1), transparent 35%, transparent 60%, rgba(255, 255, 255, .05)); pointer-events: none; }
.punch { position: absolute; top: 14px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #3b3f70 0 15%, #0b0c18 40%, #000 70%); box-shadow: 0 0 0 1.5px #111; }
.status { position: absolute; top: 14px; left: 26px; right: 26px; display: flex; justify-content: space-between; color: #f2f2f2; font-size: 10px; opacity: var(--ui, 1); }
.screen-ui { display: grid; justify-items: center; gap: 14px; color: #f2f2f2; opacity: var(--ui, 1); }
.screen-ui .clock { font-size: 82px; }
.widgets { display: flex; gap: 12px; margin-top: 18px; }
.widgets i { width: 52px; height: 52px; border-radius: 50%; background: #1a1a1a; }
.widgets .w-ring { box-shadow: inset 0 0 0 4px #f2f2f2; }
.widgets .w-ring.red { box-shadow: inset 0 0 0 4px var(--red); }
.widgets .w-dot { background: radial-gradient(#f2f2f2 1.5px, transparent 2px) 0 0 / 8px 8px, #1a1a1a; }
.dive.done { --bg: #000; }

/* OS (inside the screen) */
.os { padding: 160px var(--gut) 140px; }
.os h2, .shop h2 { font-size: clamp(48px, 8vw, 128px); margin-bottom: 64px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 28px; min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; }
.card .mono { color: var(--mute); }
.card.wide { grid-column: span 2; }
.big { font-size: 64px; }
.ring { width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(var(--ink) calc(var(--v) * 360deg), #2a2a2a 0); -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 59%); mask: radial-gradient(circle, transparent 0 58%, #000 59%); }
.eq { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.eq i { flex: 1; background: radial-gradient(circle, var(--ink) 3px, transparent 3.5px) center bottom / 9px 9px repeat-y; height: 30%; animation: eq 1.1s ease-in-out infinite alternate; }
.eq i:nth-child(3n) { animation-delay: -.4s; } .eq i:nth-child(4n+1) { animation-delay: -.8s; } .eq i:nth-child(5n+2) { animation-duration: .8s; }
@keyframes eq { to { height: 100%; } }
.toggle { width: 88px; height: 48px; border-radius: 99px; background: var(--red); position: relative; }
.toggle::after { content: ""; position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border-radius: 50%; background: #fff; }

/* BOUTIQUE */
.shop { padding: 160px var(--gut); }
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.product { background: var(--card); border-radius: 4px; padding: 32px; display: grid; gap: 10px; }
.product h3 { font-size: 26px; font-weight: 500; }
.product > p:not(.mono) { color: var(--mute); }
.price { font-size: 48px; margin: 24px 0 12px; }
.btn { justify-self: start; background: var(--ink); color: var(--bg); padding: 13px 26px; border-radius: 2px; font: 12px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; transition: background .25s; }
.btn:hover { background: var(--red); color: #fff; }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 48px var(--gut); }
.foot .mono { color: var(--mute); }

/* Apparitions */
.js .reveal { opacity: 0; translate: 0 28px; transition: opacity .8s, translate .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; translate: 0 0; }

/* Mobile: scene on top, compact text below */
@media (max-width: 820px) {
  .nav nav { display: none; }
  .nav-cta { margin-left: auto; }
  .sticky { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding-bottom: 28px; }
  .stage { grid-row: 1; height: 100%; min-height: 0; }
  .copy { grid-row: 2; }
  .copy h2 { font-size: 38px; margin-bottom: 8px; }
  .copy > p:not(.tag):not(.meter), .parts { display: none; }
  .copy .tag { margin-bottom: 10px; }
  .meter { font-size: 28px; margin-top: 8px; }
  .dive-label { top: 14%; translate: 0; }
  .card.wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scene { height: auto; }
  .sticky { position: relative; }
  .leds, .eq i, .scroll-hint span { animation: none; }
}
