/*
 * Site de présentation d’Inkarelle.
 * Mise en page éditoriale : grands titres en Instrument Serif, texte en Manrope,
 * le hublot de la marée comme fil rouge. Couleurs reprises de src/theme/colors.ts
 * (docs/design.md) ; la couleur vive vient des couvertures, le reste reste pâle.
 */

/* ---------- Jetons ---------- */

:root {
  /* Interface (mêmes valeurs que l’app) */
  --bg: #F4F1EA;
  --surface: #FBFAF6;
  --surface-2: #EEEAE1;
  --border: #E4DED2;
  --text: #22262A;
  --muted: #5C646B;
  --ghost: #7F868B;
  --primary: #3D6352;
  --primary-hover: #33574A;
  --on-primary: #FFFFFF;
  --primary-soft: #DCE8DF;
  --blue: #DDE7EF;
  --on-blue: #3E5A70;
  --lilac: #E4E0EF;
  --on-lilac: #5B4E80;
  --sand: #F0E7D3;
  --on-sand: #7A6337;
  --blush: #F2E0D7;
  --on-blush: #8A4E3C;
  --green: #E7ECE3;
  --on-green: #4E6647;
  --shadow: 34 38 42;
  --device: #2A2E33;
  --device-edge: #4A5058;
  --grain-opacity: .07;

  /* Bande de nuit (mode focus) */
  --night-bg: #1D2631;
  --night-surface: #283341;
  --night-border: #3A4655;
  --night-text: #ECE8DF;
  --night-muted: #B5BEC7;
  --night-primary: #A9C9B4;

  /* Cadres des hublots : fond et détail de chaque couleur de couverture */
  --frame-coral: #F2E0D7;
  --frame-coral-ink: #8A4E3C;
  --frame-blue: #DDE7EF;
  --frame-blue-ink: #3E5A70;
  --frame-sage: #DCE8DF;
  --frame-sage-ink: #3D6352;
  --frame-lilac: #E4E0EF;
  --frame-lilac-ink: #5B4E80;
  --frame-sand: #F0E7D3;
  --frame-sand-ink: #7A6337;
  --frame-green: #E7ECE3;
  --frame-green-ink: #4E6647;

  /* Typographie */
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-lexend: "Lexend", "Manrope", system-ui, sans-serif;
  --fs-mega: clamp(3.5rem, 8vw + 1rem, 8.4rem);
  --fs-display: clamp(2.6rem, 6vw, 5.8rem);
  --fs-h3: clamp(1.75rem, 2.6vw, 2.4rem);
  --fs-lead: clamp(1.075rem, 1.5vw, 1.3rem);
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-label: .75rem;

  /* Rayons de l’app : 12, 18, 22, 999 */
  --r-sm: 12px;
  --r-btn: 18px;
  --r-card: 22px;
  --r-pill: 999px;

  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(88px, 12vw, 176px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

/* Illustration (hublot, ciel, eau) : version jour */
:root,
.ill-day {
  --ill-night: 0;
  --sky-top: #D5E3EA;
  --sky-bottom: #F6EEDD;
  --sun: #F1D29B;
  --water: #8DB4C8;
  --water-deep: #57869F;
  --water-light: #D3E6EE;
  --sandbed: #E8D8B5;
  --sandbed-deep: #D2BB8E;
  --pebble: #B7AE9F;
  --algae: #7EA88A;
  --algae-deep: #557D63;
  --fish: #F8F3E9;
  --ink: #2B3A44;
  --star: #FFF8E6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #212427;
    --surface: #2E3236;
    --surface-2: #282B2F;
    --border: #43484D;
    --text: #ECE8DF;
    --muted: #BCC1C5;
    --ghost: #6F767C;
    --primary: #A9C9B4;
    --primary-hover: #BAD6C3;
    --on-primary: #17201B;
    --primary-soft: #33453A;
    --blue: #304050;
    --on-blue: #A9C3D4;
    --lilac: #3D384F;
    --on-lilac: #C3BAE0;
    --sand: #443D2E;
    --on-sand: #D9C49A;
    --blush: #4A3833;
    --on-blush: #E8A99A;
    --green: #3A4236;
    --on-green: #C2D4B4;
    --shadow: 8 10 12;
    --device: #3A3F45;
    --device-edge: #555B62;
    --grain-opacity: .05;
    --night-bg: #1A2129;
    --night-surface: #252E38;
    --night-border: #37424E;
    --frame-coral: #E8A99A;
    --frame-coral-ink: #7A4B40;
    --frame-blue: #A9C3DC;
    --frame-blue-ink: #3E5A70;
    --frame-sage: #A9CDB2;
    --frame-sage-ink: #3D6352;
    --frame-lilac: #C3B5E6;
    --frame-lilac-ink: #5B4E80;
    --frame-sand: #E3CC94;
    --frame-sand-ink: #7A6337;
    --frame-green: #C2D4B4;
    --frame-green-ink: #4E6647;
    --ill-night: 1;
    --sky-top: #1A2637;
    --sky-bottom: #33475C;
    --sun: #ECE3C8;
    --water: #4B7089;
    --water-deep: #2C4A5F;
    --water-light: #8FB2C6;
    --sandbed: #6A6152;
    --sandbed-deep: #544C40;
    --pebble: #8A8274;
    --algae: #6F9B81;
    --algae-deep: #4E7460;
    --fish: #CBD8E0;
    --ink: #DDE4E8;
    --star: #F4EEDB;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #212427;
  --surface: #2E3236;
  --surface-2: #282B2F;
  --border: #43484D;
  --text: #ECE8DF;
  --muted: #BCC1C5;
  --ghost: #6F767C;
  --primary: #A9C9B4;
  --primary-hover: #BAD6C3;
  --on-primary: #17201B;
  --primary-soft: #33453A;
  --blue: #304050;
  --on-blue: #A9C3D4;
  --lilac: #3D384F;
  --on-lilac: #C3BAE0;
  --sand: #443D2E;
  --on-sand: #D9C49A;
  --blush: #4A3833;
  --on-blush: #E8A99A;
  --green: #3A4236;
  --on-green: #C2D4B4;
  --shadow: 8 10 12;
  --device: #3A3F45;
  --device-edge: #555B62;
  --grain-opacity: .05;
  --night-bg: #1A2129;
  --night-surface: #252E38;
  --night-border: #37424E;
  --frame-coral: #E8A99A;
  --frame-coral-ink: #7A4B40;
  --frame-blue: #A9C3DC;
  --frame-blue-ink: #3E5A70;
  --frame-sage: #A9CDB2;
  --frame-sage-ink: #3D6352;
  --frame-lilac: #C3B5E6;
  --frame-lilac-ink: #5B4E80;
  --frame-sand: #E3CC94;
  --frame-sand-ink: #7A6337;
  --frame-green: #C2D4B4;
  --frame-green-ink: #4E6647;
  --ill-night: 1;
  --sky-top: #1A2637;
  --sky-bottom: #33475C;
  --sun: #ECE3C8;
  --water: #4B7089;
  --water-deep: #2C4A5F;
  --water-light: #8FB2C6;
  --sandbed: #6A6152;
  --sandbed-deep: #544C40;
  --pebble: #8A8274;
  --algae: #6F9B81;
  --algae-deep: #4E7460;
  --fish: #CBD8E0;
  --ink: #DDE4E8;
  --star: #F4EEDB;
  color-scheme: dark;
}

/* Illustration forcée en version nuit (bande du mode focus, carte « Clair et sombre ») */
.ill-night {
  --ill-night: 1;
  --sky-top: #1A2637;
  --sky-bottom: #33475C;
  --sun: #ECE3C8;
  --water: #4B7089;
  --water-deep: #2C4A5F;
  --water-light: #8FB2C6;
  --sandbed: #6A6152;
  --sandbed-deep: #544C40;
  --pebble: #8A8274;
  --algae: #6F9B81;
  --algae-deep: #4E7460;
  --fish: #CBD8E0;
  --ink: #DDE4E8;
  --star: #F4EEDB;
  --frame-blue: #A9C3DC;
  --frame-sand: #E3CC94;
}

.ill-day {
  --frame-sand: #F0E7D3;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}

img,
canvas,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

p,
h1,
h2,
h3,
dl,
dd,
ul,
ol,
figure,
blockquote,
pre {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

em {
  font-style: italic;
}

::selection {
  background: var(--sand);
  color: var(--on-sand);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .3s var(--ease);
}

.skip:focus {
  transform: none;
}

/* Grain de papier, très léger, sur toute la page */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .13  0 0 0 0 .15  0 0 0 0 .16  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Typographie commune ---------- */

.label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.label::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.label--plain::before {
  display: none;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: .98;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.display em,
.h3 em,
.hero__title em,
.launch__title em,
.offer__title em,
.plan__name em {
  color: var(--primary);
}

.display--md {
  font-size: clamp(2.4rem, 4.6vw, 4.4rem);
}

.h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h3);
  line-height: 1.05;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.lead {
  max-width: 34em;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 24px;
  border: 0;
  border-radius: var(--r-btn);
  background: var(--primary);
  color: var(--on-primary);
  font-size: .975rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .3s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
  box-shadow: 0 14px 30px -18px rgb(var(--shadow) / .55);
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn__icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .4s var(--ease);
}

.btn:hover .btn__icon {
  transform: translateY(2px);
}

.btn--small {
  min-height: 44px;
  padding: 10px 18px;
  font-size: .875rem;
  box-shadow: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: transparent;
  cursor: pointer;
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}

.icon-btn:hover {
  background: var(--surface);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 0;
  right: 0;
  z-index: 50;
  padding-inline: 12px;
  pointer-events: none;
}

.nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin-inline: auto;
  padding: 8px 8px 8px 18px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  pointer-events: auto;
  transition: background-color .6s var(--ease), border-color .6s var(--ease);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
}

.brand__mark {
  width: 30px;
  height: 30px;
}

.brand__ring {
  fill: var(--frame-coral);
}

.brand__sky {
  fill: var(--sky-bottom);
}

.brand__water {
  fill: var(--water);
}

.brand__line {
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 1.4 1.8;
  opacity: .8;
}

.brand__edge {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.2;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: -.01em;
}

.nav__links {
  display: flex;
  gap: 4px;
}

.nav__links a {
  padding: 10px 14px;
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  transition: color .3s var(--ease), background-color .3s var(--ease);
}

.nav__links a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle__sun {
  display: none;
}

.theme-toggle[data-mode="dark"] .theme-toggle__sun {
  display: block;
}

.theme-toggle[data-mode="dark"] .theme-toggle__moon {
  display: none;
}

.nav__menu-btn {
  display: none;
}

.nav__sheet {
  display: grid;
  gap: 2px;
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.nav__sheet a {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.1;
  text-decoration: none;
}

.nav__sheet a:hover {
  background: var(--surface);
}

@media (max-width: 900px) {
  .nav__links {
    display: none;
  }

  .nav__menu-btn {
    display: inline-grid;
  }
}

@media (max-width: 420px) {
  .nav__cta {
    display: none;
  }
}

/* ---------- Ouverture ---------- */

.hero {
  position: relative;
  padding-top: calc(env(safe-area-inset-top, 0px) + clamp(120px, 14vw, 170px));
  padding-bottom: clamp(56px, 7vw, 96px);
  isolation: isolate;
}

.hero__wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(36% 42% at 82% 28%, color-mix(in srgb, var(--blue) 85%, transparent), transparent 70%),
    radial-gradient(30% 36% at 8% 78%, color-mix(in srgb, var(--blush) 70%, transparent), transparent 72%),
    radial-gradient(26% 30% at 58% 96%, color-mix(in srgb, var(--primary-soft) 70%, transparent), transparent 70%);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

.hero__copy {
  display: grid;
  gap: clamp(22px, 2.6vw, 34px);
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  padding: 8px 14px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--muted);
}

.eyebrow__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-mega);
  line-height: .9;
  letter-spacing: -.025em;
}

.hero__title .line {
  display: block;
}

.hero__lead {
  max-width: 31em;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.hero__date {
  font-size: var(--fs-small);
  color: var(--muted);
}

.hero__date strong {
  font-weight: 600;
  color: var(--text);
}

.hero__session {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
}

.hero__session-head {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.hero__book {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.2;
}

.hublot {
  width: 100%;
}

.hublot--hero {
  width: min(100%, 540px);
  aspect-ratio: 1.2 / 1;
}

.timer {
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.hero__hint {
  display: grid;
  font-size: var(--fs-small);
  color: var(--muted);
  text-align: center;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(48px, 7vw, 96px);
  border-top: 1px solid var(--border);
}

.facts__item {
  display: grid;
  gap: 6px;
  padding: 22px clamp(12px, 2vw, 28px) 0 0;
}

.facts__item + .facts__item {
  padding-left: clamp(12px, 2vw, 28px);
  border-left: 1px solid var(--border);
}

.facts dt {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  line-height: 1.05;
}

.facts dd {
  max-width: 24em;
  font-size: var(--fs-small);
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .hero__title .line,
  .hero__lead,
  .hero__cta,
  .eyebrow {
    animation: rise 1.2s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 110ms + 120ms);
  }

  .eyebrow {
    --i: -1;
  }

  .hero__lead {
    --i: 3;
  }

  .hero__cta {
    --i: 4;
  }

  .hero__session {
    animation: fade 1.6s var(--ease) .35s both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
    transform: scale(.97);
  }
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__session {
    order: 2;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .facts__item,
  .facts__item + .facts__item {
    padding: 18px 0;
    border-left: 0;
  }

  .facts__item + .facts__item {
    border-top: 1px solid var(--border);
  }
}

/* ---------- Couvertures générées ---------- */

.cover {
  --c-bg: var(--blush);
  --c-fg: var(--on-blush);
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: space-between;
  width: 132px;
  aspect-ratio: 2 / 3;
  padding: 14px 12px 14px 18px;
  border-radius: 4px 10px 10px 4px;
  background: var(--c-bg);
  color: var(--c-fg);
  box-shadow: inset 5px 0 0 color-mix(in srgb, var(--c-fg) 14%, transparent), 0 22px 34px -26px rgb(var(--shadow) / .6);
  overflow: hidden;
}

.cover__author {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.cover__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.02;
  text-wrap: balance;
}

.cover--coral { --c-bg: var(--blush); --c-fg: var(--on-blush); }
.cover--blue { --c-bg: var(--blue); --c-fg: var(--on-blue); }
.cover--sage { --c-bg: var(--primary-soft); --c-fg: var(--primary); }
.cover--lilac { --c-bg: var(--lilac); --c-fg: var(--on-lilac); }
.cover--sand { --c-bg: var(--sand); --c-fg: var(--on-sand); }
.cover--green { --c-bg: var(--green); --c-fg: var(--on-green); }

.shelf {
  padding-block: clamp(48px, 6vw, 80px) 0;
}

.shelf__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 28px;
}

.shelf__note {
  font-size: var(--fs-small);
  color: var(--muted);
}

.shelf__viewport {
  overflow: hidden;
  padding-block: 8px 28px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.shelf__track {
  display: flex;
  gap: 18px;
  width: max-content;
  padding-inline: var(--gutter);
}

.shelf__track .cover:nth-child(3n + 2) {
  width: 118px;
  margin-top: 14px;
}

.shelf__track .cover:nth-child(4n) {
  width: 146px;
}

@media (prefers-reduced-motion: no-preference) {
  .shelf__track.is-looping {
    animation: shelf 90s linear infinite;
  }

  .shelf__viewport:hover .shelf__track {
    animation-play-state: paused;
  }
}

@keyframes shelf {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .shelf__viewport {
    overflow-x: auto;
  }
}

/* ---------- Manifeste ---------- */

.manifesto {
  padding-block: var(--section);
}

.manifesto__text {
  max-width: 17em;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.4vw, 5.2rem);
  line-height: 1.04;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.manifesto__text .w {
  transition: color .6s var(--ease);
}

.manifesto__text.is-split .w {
  color: var(--ghost);
}

.manifesto__text.is-split .w.is-lit {
  color: var(--text);
}

/* ---------- Titres de section ---------- */

.section-head {
  display: grid;
  gap: 22px;
  margin-bottom: clamp(48px, 7vw, 96px);
}

.section-head--split {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: end;
  gap: 22px 64px;
}

.section-head--split > div {
  display: grid;
  gap: 22px;
}

@media (max-width: 900px) {
  .section-head--split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- La boucle ---------- */

.loop {
  padding-block: 0 var(--section);
}

.loop__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
}

.loop__steps {
  display: grid;
}

.step {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 78vh;
  padding-block: 32px;
  border-top: 1px solid var(--border);
  opacity: .38;
  transition: opacity .7s var(--ease);
}

.step:last-child {
  border-bottom: 1px solid var(--border);
}

.step.is-active {
  opacity: 1;
}

.step__head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.step__num {
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.step__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: -.015em;
}

.step__body {
  display: grid;
  gap: 16px;
  max-width: 30em;
  padding-left: calc(20px + 1.6em);
}

.step__body p:first-child {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--muted);
}

.step__meta {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.loop__stage {
  position: sticky;
  top: 11vh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 22px;
  height: 80vh;
  min-height: 560px;
}

.loop__dots {
  display: flex;
  gap: 8px;
}

.loop__dots li {
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  transition: background-color .6s var(--ease), width .6s var(--ease);
}

.loop__dots li.is-active {
  width: 40px;
  background: var(--primary);
}

@media (max-width: 959px) {
  .loop__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .loop__stage {
    position: relative;
    top: 0;
    order: -1;
    height: auto;
    min-height: 0;
  }

  .step {
    min-height: 0;
    gap: 0;
    padding-block: 0;
    opacity: 1;
  }

  .step__head {
    width: 100%;
    min-height: 64px;
    padding-block: 16px;
    opacity: .45;
    transition: opacity .5s var(--ease);
  }

  .step.is-active .step__head {
    opacity: 1;
  }

  .step__title {
    font-size: clamp(1.75rem, 7vw, 2.4rem);
  }

  .step__body {
    display: none;
    padding-bottom: 22px;
  }

  .step.is-active .step__body {
    display: grid;
  }
}

/* ---------- Téléphone ---------- */

.phone {
  width: min(100%, 330px);
  aspect-ratio: 330 / 690;
  max-height: 100%;
  padding: 9px;
  border-radius: 54px;
  background: var(--device);
  box-shadow:
    inset 0 0 0 1.5px var(--device-edge),
    0 60px 90px -50px rgb(var(--shadow) / .55),
    0 30px 40px -30px rgb(var(--shadow) / .35);
}

@media (min-width: 960px) {
  .phone {
    width: auto;
    height: clamp(500px, calc(80vh - 60px), 690px);
  }
}

.phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 45px;
  background: var(--bg);
  container-type: inline-size;
  transition: background-color .6s var(--ease);
}

.phone__status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 14cqw;
  padding-inline: 8cqw 7cqw;
  font-size: 4.2cqw;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.phone__island {
  width: 30cqw;
  height: 9cqw;
  border-radius: 99px;
  background: #16181B;
}

.phone__icons {
  display: flex;
  align-items: flex-end;
  gap: 1cqw;
}

.phone__icons i {
  display: block;
  width: 1.2cqw;
  border-radius: 1px;
  background: var(--text);
}

.phone__icons i:nth-child(1) { height: 1.8cqw; }
.phone__icons i:nth-child(2) { height: 2.6cqw; }
.phone__icons i:nth-child(3) { width: 6cqw; height: 3cqw; margin-left: 1cqw; border-radius: 1cqw; }

.phone__home {
  position: absolute;
  bottom: 2.4cqw;
  left: 50%;
  z-index: 3;
  width: 36cqw;
  height: 1.5cqw;
  border-radius: 2cqw;
  background: var(--text);
  opacity: .8;
  transform: translateX(-50%);
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 3.6cqw;
  padding: 17cqw 6cqw 10cqw;
  font-size: 4cqw;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3%) scale(.985);
  transition: opacity .7s var(--ease), transform .9s var(--ease), visibility 0s linear .7s;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .7s var(--ease), transform .9s var(--ease), visibility 0s;
}

.app-kicker {
  font-size: 3.4cqw;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-title {
  margin-top: -2cqw;
  font-family: var(--font-display);
  font-size: 9.2cqw;
  line-height: 1.05;
}

.app-hint {
  font-size: 3.6cqw;
  color: var(--muted);
}

.app-hint--center {
  text-align: center;
  padding-inline: 4cqw;
}

.app-btn {
  display: grid;
  place-items: center;
  min-height: 14cqw;
  margin-top: auto;
  padding-inline: 5cqw;
  border-radius: 5.4cqw;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 4.2cqw;
  font-weight: 600;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}

.app-round {
  display: grid;
  flex: none;
  place-items: center;
  width: 10cqw;
  height: 10cqw;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
}

.app-round svg {
  width: 50%;
  height: 50%;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.app-round--lg {
  width: 14cqw;
  height: 14cqw;
}

.app-pill {
  padding: 1cqw 3cqw;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 3.4cqw;
  font-weight: 600;
}

.scanner {
  position: relative;
  display: grid;
  place-items: center;
  height: 48cqw;
  border-radius: 5cqw;
  background: #1F2428;
  overflow: hidden;
}

.barcode {
  width: 52%;
  height: 34%;
  border-radius: 1cqw;
  background:
    repeating-linear-gradient(90deg, #EDEAE3 0 1.5px, transparent 1.5px 3px, #EDEAE3 3px 6px, transparent 6px 7.5px, #EDEAE3 7.5px 8.5px, transparent 8.5px 11px),
    #1F2428;
  opacity: .9;
}

.scanner__line {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 50%;
  height: 1.5px;
  background: #A9C9B4;
  box-shadow: 0 0 10px 1px rgb(169 201 180 / .5);
}

.scanner__corner {
  position: absolute;
  width: 8cqw;
  height: 8cqw;
  border: 0 solid #ECE8DF;
}

.scanner__corner--tl { top: 5cqw; left: 6cqw; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 3cqw; }
.scanner__corner--tr { top: 5cqw; right: 6cqw; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 3cqw; }
.scanner__corner--bl { bottom: 5cqw; left: 6cqw; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 3cqw; }
.scanner__corner--br { bottom: 5cqw; right: 6cqw; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 3cqw; }

.found {
  display: flex;
  gap: 4cqw;
  padding: 3.6cqw;
  border: 1px solid var(--border);
  border-radius: 5.6cqw;
  background: var(--surface);
}

.cover--mini {
  width: 19cqw;
  padding: 2cqw 1.6cqw 2cqw 2.6cqw;
  border-radius: 1cqw 2cqw 2cqw 1cqw;
  box-shadow: inset 1.2cqw 0 0 color-mix(in srgb, var(--c-fg) 14%, transparent);
}

.cover--mini .cover__author {
  font-size: 1.7cqw;
}

.cover--mini .cover__title {
  font-size: 3cqw;
}

.found__info {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.2cqw;
  min-width: 0;
}

.found__title {
  font-family: var(--font-display);
  font-size: 5.6cqw;
  line-height: 1.05;
}

.found__meta {
  font-size: 3.4cqw;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 1.4cqw 3cqw;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 3.3cqw;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--muted);
}

.chip--green { background: var(--green); border-color: transparent; color: var(--on-green); }
.chip--sand { background: var(--sand); border-color: transparent; color: var(--on-sand); }
.chip--blue { background: var(--blue); border-color: transparent; color: var(--on-blue); }
.chip--lilac { background: var(--lilac); border-color: transparent; color: var(--on-lilac); }
.chip--blush { background: var(--blush); border-color: transparent; color: var(--on-blush); }

.chip--on {
  box-shadow: inset 0 0 0 1.5px var(--on-sand);
}

.chip--on-neutral {
  background: var(--text);
  border-color: transparent;
  color: var(--bg);
}

.chip--xs {
  justify-self: start;
  padding: 1cqw 2.4cqw;
  font-size: 2.9cqw;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: 3cqw;
}

.app-topbar__book {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 4.8cqw;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hublot--phone {
  aspect-ratio: 1.2 / 1;
  margin-top: 2cqw;
}

.app-timer {
  font-size: 13cqw;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.03em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 3cqw;
  margin-top: auto;
}

.app-actions .app-btn {
  flex: 1;
  margin-top: 0;
}

.app-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
  font-size: 3.8cqw;
  color: var(--muted);
}

.app-modal-head strong {
  font-weight: 700;
  color: var(--text);
}

.app-modal-head__ok {
  font-weight: 700;
  color: var(--primary);
}

.app-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2cqw;
}

.app-chips--row {
  flex-wrap: nowrap;
  overflow: hidden;
}

.app-fields {
  display: flex;
  gap: 2.6cqw;
}

.app-field {
  display: grid;
  gap: .4cqw;
  padding: 2.6cqw 3.4cqw;
  border: 1px solid var(--border);
  border-radius: 3.6cqw;
  background: var(--surface);
  min-width: 0;
}

.app-field span {
  font-size: 2.9cqw;
  color: var(--muted);
}

.app-field strong {
  font-size: 3.8cqw;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-field--grow {
  flex: 1;
}

.app-quote {
  padding: 4cqw;
  border-radius: 4cqw;
  background: var(--sand);
  color: var(--on-sand);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 5.4cqw;
  line-height: 1.2;
}

.app-note {
  display: grid;
  gap: 1cqw;
  font-size: 3.7cqw;
}

.app-note span {
  font-size: 3cqw;
  color: var(--muted);
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1.8cqw;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: .9cqw 2.6cqw;
  border-radius: 99px;
  border: 1px solid var(--border);
  font-size: 3.1cqw;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.tag::before {
  content: "#";
  margin-right: .15em;
  opacity: .6;
}

.tag--add::before {
  content: none;
}

.tag--add {
  border-style: dashed;
}

.app-search {
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  min-height: 11cqw;
  padding-inline: 3.4cqw;
  border-radius: 3.6cqw;
  background: var(--surface-2);
  font-size: 3.8cqw;
}

.app-search svg {
  width: 4.6cqw;
  height: 4.6cqw;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.app-group {
  margin-top: 1cqw;
  font-size: 3cqw;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-card {
  display: grid;
  gap: 1.6cqw;
  padding: 3.6cqw;
  border: 1px solid var(--border);
  border-radius: 4.6cqw;
  background: var(--surface);
}

.note-card__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 5.2cqw;
  line-height: 1.15;
}

.note-card__text {
  font-size: 3.6cqw;
  color: var(--muted);
}

/* Les puces du site (hors téléphone) gardent une taille fixe */
.note .chip,
.card .chip {
  padding: 5px 11px;
  font-size: .8125rem;
}

.note .tag,
.card .tag {
  padding: 3px 10px;
  font-size: .8125rem;
}

/* ---------- La marée ---------- */

.tide {
  padding-block: var(--section);
  border-top: 1px solid var(--border);
}

.tide__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.tide__visual {
  display: grid;
  place-items: center;
  min-width: 0;
}

.hublot--big {
  width: min(100%, 620px);
  aspect-ratio: 1.2 / 1;
}

.tide__copy {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.tide__control {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
}

.tide__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.tide__row label {
  font-size: var(--fs-small);
  font-weight: 600;
}

.tide__row output {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  --fill: 48%;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary) var(--fill), var(--border) var(--fill));
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary) var(--fill), var(--border) var(--fill));
}

input[type="range"]::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 6px 14px -6px rgb(var(--shadow) / .5);
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--surface);
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

input[type="range"]:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.tide__scale {
  position: relative;
  height: 18px;
  margin: -8px 14px 0;
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tide__scale span {
  position: absolute;
  left: calc(var(--p) * 100%);
  transform: translateX(-50%);
  white-space: nowrap;
}

.tide__scale .tide__goal {
  color: var(--primary);
}

.tide__stage {
  min-height: 3.2em;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-small);
  color: var(--muted);
}

.rules {
  display: grid;
  gap: 0;
}

.rules li {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-small);
}

.rules strong {
  font-weight: 600;
}

.rules span {
  color: var(--muted);
}

@media (max-width: 900px) {
  .tide__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .rules li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .tide__control {
    padding: 18px;
  }

  .tide__scale .tide__goal {
    font-size: 0;
  }

  .tide__scale .tide__goal::after {
    content: "20";
    font-size: var(--fs-label);
  }
}

/* ---------- Mode focus (bande de nuit) ---------- */

.focus {
  position: relative;
  padding-block: var(--section);
  background: var(--night-bg);
  color: var(--night-text);
  overflow: hidden;
  isolation: isolate;
}

.focus::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(30% 40% at 78% 30%, rgb(169 195 220 / .12), transparent 70%),
    radial-gradient(24% 30% at 12% 90%, rgb(195 181 230 / .08), transparent 70%);
}

.focus .label,
.focus .lead,
.focus__facts dd {
  color: var(--night-muted);
}

.focus .display em {
  color: var(--night-primary);
}

.focus__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(48px, 6vw, 96px);
}

.focus__copy {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.focus__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--night-border);
}

.focus__facts dt {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.1;
}

.focus__facts dd {
  font-size: var(--fs-small);
}

.focus__visual {
  position: relative;
  display: grid;
  justify-items: center;
  min-height: 520px;
  padding-top: 8px;
}

.notif {
  position: absolute;
  left: 50%;
  display: grid;
  gap: 2px;
  width: min(88%, 340px);
  padding: 14px 18px;
  border: 1px solid var(--night-border);
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--night-surface) 88%, transparent);
  color: var(--night-text);
  font-size: var(--fs-small);
  transform: translateX(-50%);
  filter: blur(2.5px);
}

.notif__app {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--night-muted);
}

.notif--1 { top: 0; opacity: .5; transform: translateX(-50%) scale(.9); }
.notif--2 { top: 56px; opacity: .65; transform: translateX(-50%) scale(.95); }
.notif--3 { top: 116px; opacity: .8; }

.shield {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 380px);
  margin-top: 150px;
  padding: 28px 28px 24px;
  border: 1px solid var(--night-border);
  border-radius: 30px;
  background: var(--night-surface);
  text-align: center;
  box-shadow: 0 40px 80px -40px rgb(0 0 0 / .6);
}

.hublot--shield {
  width: 150px;
  aspect-ratio: 1;
  margin-bottom: 6px;
}

.shield__title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.1;
  text-wrap: balance;
}

.shield__text {
  font-size: var(--fs-small);
  color: var(--night-muted);
}

.shield__btn {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border-radius: var(--r-btn);
  background: var(--night-primary);
  color: #17201B;
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .focus.is-seen .notif {
    animation: hush 2.4s var(--ease) both;
  }

  .focus.is-seen .notif--2 { animation-delay: .15s; }
  .focus.is-seen .notif--3 { animation-delay: .3s; }
}

@keyframes hush {
  from {
    filter: blur(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .focus__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .focus__facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Annotations ---------- */

.notes {
  padding-block: var(--section);
}

.notes__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.note {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}

.note:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 50px -40px rgb(var(--shadow) / .5);
}

.note:nth-child(even) {
  margin-top: 40px;
}

.note__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.note__where {
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.note__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.65rem;
  line-height: 1.15;
}

.note__text {
  font-size: .9875rem;
  line-height: 1.55;
}

.note__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.note__book {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: .8125rem;
  font-weight: 600;
}

.swatch {
  flex: none;
  width: 10px;
  height: 14px;
  border-radius: 2px 3px 3px 2px;
  background: var(--c, var(--blush));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
}

.swatch--coral { --c: var(--frame-coral); }
.swatch--blue { --c: var(--frame-blue); }
.swatch--lilac { --c: var(--frame-lilac); }

@media (max-width: 1100px) {
  .notes__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .notes__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .note:nth-child(even) {
    margin-top: 0;
  }
}

.export {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  margin-top: clamp(64px, 9vw, 128px);
  padding: clamp(24px, 4vw, 56px);
  border-radius: calc(var(--r-card) + 10px);
  background: var(--surface-2);
}

.export__copy {
  display: grid;
  gap: 18px;
  justify-items: start;
  min-width: 0;
}

.export__copy p {
  max-width: 28em;
  color: var(--muted);
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--bg);
  border: 1px solid var(--border);
}

.seg__btn {
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

.seg__btn[aria-selected="true"],
.seg__btn[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

.seg--small .seg__btn {
  min-height: 36px;
  padding: 6px 14px;
}

.export__preview {
  min-width: 0;
}

.md {
  overflow-x: auto;
  min-height: 390px;
  padding: 28px;
  border-radius: var(--r-card);
  background: var(--night-bg);
  color: var(--night-text);
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: .84rem;
  line-height: 1.7;
  white-space: pre;
  tab-size: 2;
}

.md__h1 { color: #E8C9A0; font-weight: 700; }
.md__h2 { color: #A9C9B4; font-weight: 700; }
.md__q { color: #D9C49A; }
.md__muted { color: var(--night-muted); }

.pdf {
  display: grid;
  place-items: center;
  min-height: 390px;
  padding: 24px;
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--border) 60%, var(--surface-2));
}

.pdf[hidden] {
  display: none;
}

.pdf__page {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(100%, 360px);
  aspect-ratio: 210 / 297;
  padding: 34px 32px;
  border-radius: 4px;
  background: #FFFDF8;
  color: #22262A;
  box-shadow: 0 30px 50px -30px rgb(0 0 0 / .35);
  align-content: start;
  overflow: hidden;
}

.pdf__kicker {
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #5C646B;
}

.pdf__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.02;
}

.pdf__chapter {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #E4DED2;
  font-size: .6875rem;
  font-weight: 700;
  color: #3D6352;
}

.pdf__quote {
  padding-left: 10px;
  border-left: 2px solid #D9C49A;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.2;
}

.pdf__meta {
  font-size: .625rem;
  color: #5C646B;
}

.pdf__text {
  font-size: .75rem;
  line-height: 1.5;
}

.pdf__folio {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  font-size: .625rem;
  text-align: center;
  color: #5C646B;
}

@media (max-width: 900px) {
  .export {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Habitude (grille de cartes) ---------- */

.habit {
  padding-block: var(--section);
  border-top: 1px solid var(--border);
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: clamp(22px, 2.4vw, 32px);
  border: 1px solid var(--border);
  border-radius: calc(var(--r-card) + 6px);
  background: var(--surface);
}

.card__text {
  max-width: 34em;
  font-size: .9375rem;
  color: var(--muted);
}

.card__text--small {
  font-size: var(--fs-small);
}

.card--streak { grid-column: span 7; background: var(--primary-soft); border-color: transparent; }
.card--stats { grid-column: span 5; }
.card--discover { grid-column: span 4; }
.card--font { grid-column: span 4; }
.card--themes { grid-column: span 4; }
.card--promises { grid-column: span 12; background: transparent; }

.card--streak .label,
.card--streak .card__text,
.card--streak .streak__record {
  color: color-mix(in srgb, var(--text) 78%, var(--primary-soft));
}

.card__top {
  display: grid;
  gap: 6px;
}

.streak__count {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 600;
}

.streak__num {
  font-family: var(--font-display);
  font-size: clamp(4.4rem, 8vw, 7rem);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.03em;
  color: var(--primary);
}

.streak__record {
  font-size: var(--fs-small);
}

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(6px, 1.2vw, 14px);
  margin-block: 8px;
}

.week li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  font-size: var(--fs-label);
  font-weight: 700;
  color: color-mix(in srgb, var(--text) 78%, var(--primary-soft));
}

.hublot--mini {
  width: 100%;
  max-width: 58px;
  aspect-ratio: 1;
}

.week__hook {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40%;
  max-width: 22px;
  aspect-ratio: 1;
  fill: none;
  stroke: var(--on-blue);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translate(-50%, calc(-50% - 11px));
}

.week__today span {
  padding: 0 7px;
  border-radius: 99px;
  background: var(--primary);
  color: var(--on-primary);
}

.stats__big {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4.2vw, 3.6rem);
  line-height: 1;
  letter-spacing: -.02em;
}

.stats__big span {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  letter-spacing: 0;
  color: var(--muted);
}

/* Graphique : une seule série, échelle 0–40 min sur 140 px */
.chart {
  --h: 140px;
  --max: 40;
}

.chart__plot {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 2px;
  height: calc(var(--h) + 26px);
  padding-bottom: 26px;
}

.chart__plot::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  height: 1px;
  background: var(--border);
}

.chart__goal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(26px + var(--h) * var(--v) / var(--max));
  z-index: 1;
  border-top: 1.5px dashed color-mix(in srgb, var(--text) 45%, transparent);
  pointer-events: none;
}

.chart__legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
}

.chart__legend i {
  width: 22px;
  border-top: 1.5px dashed color-mix(in srgb, var(--text) 45%, transparent);
}

.chart__col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  cursor: default;
}

.chart__bar {
  width: min(62%, 30px);
  height: calc(var(--h) * var(--v) / var(--max));
  border-radius: 4px 4px 0 0;
  background: var(--primary);
  opacity: .85;
  transition: opacity .3s var(--ease);
}

.chart__col--today .chart__bar {
  opacity: .45;
}

.chart__col:hover .chart__bar {
  opacity: 1;
}

.chart__day {
  position: absolute;
  bottom: -22px;
  font-size: .6875rem;
  font-weight: 700;
  color: var(--muted);
}

.chart__value {
  margin-bottom: 4px;
  font-size: .75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chart__col::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% - 20px);
  left: 50%;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  pointer-events: none;
}

.chart__col:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chart__col:first-of-type::after { left: 0; transform: translate(0, 4px); }
.chart__col:first-of-type:hover::after { transform: none; }
.chart__col:last-child::after { left: auto; right: 0; transform: translate(0, 4px); }
.chart__col:last-child:hover::after { transform: none; }

.stats__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.stats__row dt {
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--muted);
}

.stats__row dd {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stats__note {
  font-size: .75rem;
  color: var(--muted);
}

.mini-shelf {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.cover--tiny {
  width: calc((100% - 20px) / 3);
  max-width: 96px;
  padding: 10px 8px 10px 12px;
}

.cover--tiny .cover__author {
  font-size: 7.5px;
}

.cover--tiny .cover__title {
  font-size: 1.05rem;
}

.sources {
  font-size: var(--fs-small);
  font-weight: 600;
}

.font-sample {
  display: grid;
  gap: 8px;
  min-height: 7.5em;
  padding: 18px;
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: 1.125rem;
  line-height: 1.5;
  transition: letter-spacing .5s var(--ease), word-spacing .5s var(--ease), line-height .5s var(--ease);
}

.font-sample span {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.font-sample.is-lexend {
  font-family: var(--font-lexend);
}

.font-sample.is-wide {
  letter-spacing: .06em;
  word-spacing: .16em;
  line-height: 1.8;
}

.font-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
}

.switch__track {
  position: relative;
  width: 42px;
  height: 26px;
  border-radius: 99px;
  background: var(--border);
  transition: background-color .35s var(--ease);
}

.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 6px rgb(var(--shadow) / .25);
  transition: transform .35s var(--ease);
}

.switch[aria-checked="true"] .switch__track {
  background: var(--primary);
}

.switch[aria-checked="true"] .switch__thumb {
  transform: translateX(16px);
}

.themes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border-radius: var(--r-card);
  border: 1px solid var(--border);
}

.themes__side {
  display: grid;
  place-items: center;
  padding: 22px 12px;
  background: #F4F1EA;
}

.themes__side--night {
  background: #212427;
}

.hublot--theme {
  width: min(100%, 132px);
  aspect-ratio: 1;
}

.promises {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.promises li {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.promises svg {
  width: 26px;
  height: 26px;
  margin-bottom: 6px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.promises strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.1;
}

.promises span {
  font-size: var(--fs-small);
  color: var(--muted);
}

@media (max-width: 1100px) {
  .card--streak,
  .card--stats {
    grid-column: span 12;
  }

  .card--discover,
  .card--font {
    grid-column: span 6;
  }

  .card--themes {
    grid-column: span 12;
  }

  .card--themes .themes {
    max-width: 420px;
  }

  .promises {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .card--discover,
  .card--font {
    grid-column: span 12;
  }

  .promises {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Pleine mer ---------- */

.offer {
  padding-block: var(--section);
  border-top: 1px solid var(--border);
}

.offer__banner {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(380px, 42vw, 540px);
  overflow: hidden;
  border-radius: calc(var(--r-card) + 12px);
  isolation: isolate;
}

.seascape {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.offer__banner-copy {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 4vw, 56px);
}

.offer__banner-copy .lead {
  color: var(--text);
}

.offer__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4rem, 12vw, 11rem);
  line-height: .85;
  letter-spacing: -.035em;
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.plan {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--border);
  border-radius: calc(var(--r-card) + 6px);
  background: var(--surface);
}

.plan--full {
  background: var(--primary-soft);
  border-color: transparent;
}

.plan__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 3.4vw, 3rem);
  line-height: 1;
}

.plan__desc {
  color: var(--muted);
}

.plan--full .plan__desc {
  color: color-mix(in srgb, var(--text) 78%, var(--primary-soft));
}

.plan__list {
  display: grid;
  margin-top: 12px;
}

.plan__list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-block: 12px;
  border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}

.plan__list li::before {
  content: "";
  flex: none;
  width: 12px;
  height: 7px;
  border-left: 1.6px solid var(--primary);
  border-bottom: 1.6px solid var(--primary);
  transform: translateY(-3px) rotate(-45deg);
}

.offer__note {
  margin-top: 20px;
  font-size: var(--fs-small);
  color: var(--muted);
}

@media (max-width: 720px) {
  .plans {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Questions ---------- */

.faq {
  padding-block: var(--section);
  border-top: 1px solid var(--border);
}

.faq__grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 96px);
}

.faq__head {
  display: grid;
  align-content: start;
  gap: 22px;
}

@media (min-width: 901px) {
  .faq__head {
    position: sticky;
    top: 120px;
    align-self: start;
  }
}

.faq__list {
  border-top: 1px solid var(--border);
}

.qa {
  border-bottom: 1px solid var(--border);
}

.qa summary {
  position: relative;
  display: block;
  padding: 24px 56px 24px 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary::before,
.qa summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform .45s var(--ease);
}

.qa summary::after {
  transform: rotate(90deg);
}

.qa[open] summary::after {
  transform: rotate(0);
}

.qa p {
  max-width: 36em;
  padding-bottom: 26px;
  font-size: 1.0625rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .faq__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Lancement ---------- */

.launch {
  position: relative;
  padding-block: var(--section);
  text-align: center;
  isolation: isolate;
}

.launch__wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(40% 50% at 50% 60%, color-mix(in srgb, var(--blue) 80%, transparent), transparent 70%),
    radial-gradient(22% 30% at 20% 30%, color-mix(in srgb, var(--sand) 80%, transparent), transparent 70%),
    radial-gradient(22% 30% at 82% 26%, color-mix(in srgb, var(--lilac) 80%, transparent), transparent 70%);
}

.launch__inner {
  display: grid;
  justify-items: center;
  gap: 26px;
}

.launch__title {
  display: grid;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 7.6rem);
  line-height: .92;
  letter-spacing: -.025em;
}

.launch__date {
  font-family: var(--font-body);
  font-size: .2em;
  font-weight: 600;
  letter-spacing: .3em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.launch .lead {
  text-align: center;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 22px 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--surface);
  text-align: left;
}

.store svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.store span {
  display: grid;
  font-weight: 600;
  line-height: 1.2;
}

.store small {
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- Pied de page ---------- */

.footer {
  padding-block: 24px 40px;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.footer__word {
  --fill: 0%;
  font-family: var(--font-display);
  font-size: clamp(5rem, 22.5vw, 21rem);
  line-height: .95;
  letter-spacing: -.045em;
  text-align: center;
  color: transparent;
  background: linear-gradient(0deg, var(--water) var(--fill), color-mix(in srgb, var(--text) 9%, transparent) var(--fill));
  -webkit-background-clip: text;
  background-clip: text;
  user-select: none;
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-small);
  color: var(--muted);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
}

/* ---------- Petit hublot de lecture (progression dans la page) ---------- */

.progress {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 18px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 40;
  width: 52px;
  height: 52px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  pointer-events: none;
}

.progress.is-shown {
  opacity: 1;
  transform: none;
}

.hublot--progress {
  width: 100%;
  height: 100%;
}

@media (max-width: 600px) {
  .progress {
    right: calc(env(safe-area-inset-right, 0px) + 12px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    width: 40px;
    height: 40px;
  }
}

/* ---------- Apparition des blocs (joue seulement quand un bloc arrive par le bas) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .is-revealing {
    animation: rise 1.1s var(--ease) both;
    animation-delay: var(--d, 0ms);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
  }
}

/* ---------- Page introuvable (404.html) ---------- */

.lost {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 48px;
  text-align: center;
  isolation: isolate;
}

.lost__inner {
  display: grid;
  justify-items: center;
  gap: 22px;
}

.hublot--lost {
  width: min(62vw, 240px);
  aspect-ratio: 1;
}

.lost .lead {
  text-align: center;
}
