/* EZ Home Trainer : site de présentation.
   La page est une séance : le scroll fait office de chrono (app.js). Nuit violette pour les actes,
   crème de l'app pour les passages calmes, orange signal de l'icône pour l'effort. */
:root {
  --night: #1c1530;
  --night-2: #2a2145;
  --night-3: #3a3058;
  --signal: #ff7a1a;
  --signal-deep: #d9580a;
  --creme: #f8f1e6;
  --paper: #fffaf2;
  --ice: #5b8ef0;
  --cendre: #8e889b;
  --ink: #1c1530;
  --muted: #625a73;
  --display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --text: "Familjen Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--ink); font: 18px/1.6 var(--text); }
body.home { background: var(--night); }
a { color: var(--signal-deep); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- En-tête : posé sur la scène, lisible sur nuit, orange et crème ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; max-width: 1120px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.top nav { display: flex; gap: 20px; font-size: 15px; }
.top nav a { color: inherit; opacity: .75; text-decoration: none; }
.top nav a:hover { opacity: 1; }
.bar { position: fixed; inset: 0 0 auto; z-index: 20; max-width: none; color: var(--creme); }
.bar.on-light { color: var(--ink); }

/* ---------- Actes : scène collante, le scroll sert de chrono ---------- */
.act { position: relative; }
#depart { height: 380vh; }
#seance { height: 560vh; }
#rampe { height: 460vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* Acte 1 */
.start-stage { display: grid; place-items: center; background: var(--night); color: var(--creme); }
.typed { position: absolute; top: 20vh; left: 0; right: 0; margin: 0 auto; padding: 0 24px; max-width: 900px; text-align: center;
  font-size: clamp(20px, 3.2vw, 34px); font-weight: 500; line-height: 1.3; color: var(--creme); transition: opacity .3s; min-height: 2.6em; }
.caret { display: inline-block; width: 3px; height: 1em; background: var(--signal); vertical-align: -.12em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.count { position: absolute; top: 50%; left: 0; right: 0; margin-top: -.42em; text-align: center; font-family: var(--display); font-weight: 900;
  font-size: min(70vh, 80vw); line-height: .84; color: var(--signal); opacity: 0; font-variant-numeric: tabular-nums; will-change: transform, opacity; }
.hint { position: absolute; bottom: 7vh; left: 0; right: 0; text-align: center; margin: 0; font-size: 15px; color: var(--cendre); }
.hint::after { content: ""; display: block; width: 2px; height: 44px; margin: 14px auto 0; background: linear-gradient(var(--signal), transparent); animation: drip 1.6s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.flood { position: absolute; inset: 0; background: var(--signal); clip-path: circle(0% at 50% 55%); }
.headline { position: absolute; left: 0; right: 0; bottom: 9vh; padding: 0 clamp(24px, 6vw, 96px); color: var(--ink); }
.headline h1 { font-family: var(--display); font-weight: 900; font-size: clamp(64px, 11.5vw, 190px); line-height: .84; letter-spacing: -.005em; margin: 0 0 28px; }
.headline .line { display: block; overflow: hidden; padding-bottom: .04em; }
.headline .line > span, .headline .sub > span { display: block; will-change: transform; }
.headline .line:nth-child(2) { color: var(--paper); }
.headline .sub { margin: 0; max-width: 40ch; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.45; overflow: hidden; font-weight: 500; }

/* Acte 2 : console du tapis */
.run-stage { background: var(--night); color: var(--creme); display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0 48px; padding: 88px clamp(24px, 6vw, 96px) 40px; --phase: var(--ice); transition: background-color .6s ease; }
.run-stage[data-kind="work"] { --phase: var(--signal); background: #241838; }
.run-stage[data-kind="rest"] { --phase: var(--cendre); }
.run-head { grid-column: 1 / -1; }
.run-head h2 { font-size: clamp(17px, 1.6vw, 20px); font-weight: 500; color: var(--cendre); margin: 0; max-width: 46ch; }
.console { align-self: center; min-width: 0; grid-row: 2; grid-column: 1; }
.step-row { display: flex; align-items: baseline; gap: 20px; font-family: var(--display); font-weight: 800; font-size: clamp(28px, 3.6vw, 48px); line-height: 1; }
.step { color: var(--phase); transition: color .4s; }
.clock { color: var(--cendre); font-variant-numeric: tabular-nums; }
.speed { font-family: var(--display); font-weight: 900; font-size: clamp(110px, min(25vw, 31vh), 360px); line-height: .82; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: .06em; margin: 12px 0 6px; color: var(--creme); }
.speed small { font-size: .17em; font-weight: 800; color: var(--phase); letter-spacing: .02em; transition: color .4s; }
.incline { font-size: clamp(20px, 2vw, 26px); color: var(--cendre); }
.incline b { font-family: var(--display); font-weight: 800; font-size: 1.6em; color: var(--creme); font-variant-numeric: tabular-nums; }
.voice { margin: 22px 0 14px; padding: 4px 0 4px 18px; border-left: 4px solid var(--phase); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.4; max-width: 44ch; color: var(--creme); transition: border-color .4s; }
.voice.pop { animation: pop .5s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateX(-10px); } }
.listen { font: inherit; font-size: 15px; font-weight: 600; color: var(--creme); background: transparent; border: 1.5px solid var(--night-3); border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.listen:hover { border-color: var(--phase); }
.listen::before { content: ""; display: inline-block; width: 0; height: 0; border-left: 9px solid var(--phase); border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-right: 10px; vertical-align: 0; }
.run-phone { margin: 0; align-self: center; grid-row: 2; grid-column: 2; }
.run-phone img { height: min(58vh, 620px); width: auto; border-radius: 34px; border: 7px solid #0c0914; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7); }

/* Profils de séance (tapis et rampe) : barres fantômes, barres allumées jusqu'à la tête de lecture */
.profile { grid-column: 1 / -1; position: relative; height: clamp(70px, 12vh, 120px); margin-top: 28px; }
.profile .bars { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 3px; }
.profile .bars i { display: block; flex-basis: 0; min-width: 2px; }
.profile .ghost i { background: var(--night-3); }
.profile .playhead { position: absolute; top: -10px; bottom: -6px; width: 2px; background: var(--creme); margin-left: -1px; }
.profile .playhead::before { content: ""; position: absolute; top: -6px; left: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--creme); }

/* Acte 3 : test rampe, sur crème */
.ramp-stage { background: var(--creme); color: var(--ink); display: grid; grid-template-rows: auto 1fr auto; padding: 88px clamp(24px, 6vw, 96px) 40px; }
.ramp-head h2 { font-family: var(--display); font-weight: 900; font-size: clamp(48px, 7vw, 96px); line-height: .9; margin: 0 0 8px; }
.ramp-head p { margin: 0; font-size: clamp(18px, 1.8vw, 22px); color: var(--muted); }
.ramp-read { align-self: center; }
.watts { font-family: var(--display); font-weight: 900; font-size: clamp(120px, min(27vw, 36vh), 380px); line-height: .82; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: .04em; }
.watts small { font-size: .2em; color: var(--signal-deep); }
.mood { margin: 14px 0 0; font-size: clamp(22px, 2.6vw, 34px); font-weight: 600; }
.ramp-profile .ghost i { background: #e6dccd; }
.ramp-profile .playhead, .ramp-profile .playhead::before { background: var(--ink); }
.ftp { position: absolute; inset: 0; display: grid; align-content: center; padding: 0 clamp(24px, 6vw, 96px); opacity: 0; pointer-events: none; }
.ftp .stop { font-family: var(--display); font-weight: 900; font-size: clamp(56px, 9vw, 130px); line-height: .9; margin: 0 0 18px; color: var(--signal-deep); }
.ftp .result { margin: 0; font-size: clamp(26px, 3.4vw, 44px); font-weight: 600; }
.ftp .result b { font-family: var(--display); font-weight: 900; font-size: 1.9em; }
.ftp .note { margin: 6px 0 0; color: var(--muted); max-width: 42ch; }

/* ---------- Passages calmes ---------- */
.quiet { background: var(--creme); color: var(--ink); padding: 120px 0; }
.quiet h2 { font-family: var(--display); font-weight: 900; font-size: clamp(44px, 6vw, 84px); line-height: .92; margin: 0 0 22px; }
.quiet p { color: var(--muted); max-width: 52ch; }
.quiet h3 { font-size: 19px; margin: 0 0 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.shots-pair { display: flex; gap: 20px; justify-content: center; }
.shots-pair img, .modes img { border-radius: 30px; border: 1px solid #e6dccd; box-shadow: 0 30px 60px -36px rgba(28, 21, 48, .5); background: #fff; }
.shots-pair img { width: 46%; max-width: 250px; }
.shots-pair img + img { margin-top: 64px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 96px; padding-top: 40px; border-top: 2px solid var(--ink); }
.facts p { margin: 0; font-size: 16px; }
.how { padding-bottom: 140px; }
.bike { background: var(--paper); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 48px; }
.modes figure { margin: 0; }
.modes img { width: 78%; margin: 0 auto 28px; }
.modes p { margin: 0; font-size: 16px; }
.device-list { margin: 0; border-top: 2px solid var(--ink); }
.device-list > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 16px 0; border-bottom: 1px solid #e0d5c4; }
.device-list dt { font-weight: 700; }
.device-list dd { margin: 0; color: var(--muted); font-size: 15px; grid-column: 1; }
.device-list dd.tag { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 13px; font-weight: 700; color: var(--signal-deep); background: #ffe6d2; border-radius: 999px; padding: 3px 12px; }
.device-list dd.tag.ok { color: #1e6b3a; background: #dcf1e2; }
.device-list dd.tag.exp { color: var(--muted); background: #ece4d8; }
.faq { padding-top: 40px; }
.faq .wrap { max-width: 800px; }
.faq details { border-bottom: 1px solid #e0d5c4; padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 19px; }
.faq details p { margin: 10px 0 0; }

/* ---------- Final ---------- */
.finale { background: var(--signal); color: var(--ink); text-align: center; padding: 96px 24px 120px; }
.finale img { width: min(280px, 60vw); margin: 0 auto 8px; }
.finale h2 { font-family: var(--display); font-weight: 900; font-size: clamp(110px, 24vw, 340px); line-height: .8; margin: 0 0 20px; }
.finale p { margin: 0 0 32px; font-size: clamp(19px, 2vw, 24px); font-weight: 500; }
.cta { display: inline-block; background: var(--ink); color: var(--creme); text-decoration: none; font-weight: 600; padding: 15px 28px; border-radius: 999px; }
.cta:hover { background: #000; }

/* ---------- Pied de page ---------- */
footer { background: var(--night); color: var(--cendre); padding: 32px 0 48px; font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer a { color: var(--creme); margin-left: 16px; }
footer .legal { flex-basis: 100%; font-size: 12px; }

/* ---------- Pages de texte (assistance, confidentialité) ---------- */
.doc { max-width: 760px; padding-block: 24px 72px; }
.doc h1 { font-family: var(--display); font-weight: 900; font-size: clamp(52px, 8vw, 88px); line-height: .9; margin: 24px 0 8px; }
.doc h2 { font-size: 21px; margin: 36px 0 8px; }
.doc p, .doc li { color: #3d3550; }
.doc .muted { color: var(--muted); font-size: 15px; }
.doc li { margin-bottom: 6px; }

/* ---------- Petits écrans ---------- */
@media (max-width: 820px) {
  .run-stage { grid-template-columns: 1fr; padding-top: 80px; }
  .run-phone { display: none; }
  .two, .modes, .facts { grid-template-columns: 1fr; }
  .two { gap: 40px; }
  .facts { gap: 28px; margin-top: 64px; }
  .modes img { width: 64%; }
  .quiet { padding: 88px 0; }
}
@media (max-width: 520px) {
  .top { padding: 14px 18px; }
  .top nav a:first-child { display: none; }
  .typed { top: 16vh; }
  .headline { bottom: 7vh; }
  .voice { margin-top: 18px; }
  .shots-pair img + img { margin-top: 40px; }
}

/* ---------- Mouvement réduit : pas de scènes collantes, états finaux ---------- */
.still #depart, .still #seance, .still #rampe { height: auto; }
.still .stage { position: relative; min-height: 100vh; }
.still .caret, .still .hint::after { animation: none; }
.still .voice.pop { animation: none; }
.still .ftp { position: relative; inset: auto; padding: 32px 0 0; }
.still .ramp-read { display: none; }
@media (prefers-reduced-motion: reduce) {
  .run-stage, .step, .speed small, .voice { transition: none; }
}
