/* 24H — site (accueil + page d'invitation /j/). Se charge APRÈS style.css, qui garde les bases
   (polices, jetons, boutons, en-tête, pied de page, pages légales) et reste utilisé tel quel par
   les pages saisonnières. Jetons = 24H/DesignSystem/Theme.swift (Palette, SnowMercy.Palette). */

:root {
  --ice: #bfe8f5;          /* Theme.SnowMercy.Palette.ice */
  --nice: #45d483;         /* gentil */
  --naughty: #ff5a5a;      /* vilain, LED d'hiver */
  --cream: #e8dcc4;        /* Chronicle, cassettes : seulement là */
  --on-accent: var(--bg);
}

/* ——— Grain : une seule matière, très légère ——— */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ——— En-tête du site ——— */
.site-header .wrap { gap: 16px; }
.header-right { display: flex; align-items: center; gap: 18px; }
.header-right .meta { display: none; }
@media (min-width: 640px) { .header-right .meta { display: inline; } }

/* ——— Écran réel (capture), jamais dans un faux iPhone ——— */
.shot {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border-strong); border-radius: 18px;
  background: var(--sunken);
}
.shot-wrap { position: relative; }
.tape {
  position: absolute; z-index: 2; width: 92px; height: 26px;
  background: rgba(242, 240, 236, 0.16); border-left: 1px dashed rgba(242, 240, 236, 0.18); border-right: 1px dashed rgba(242, 240, 236, 0.18);
}
.note {
  position: absolute; z-index: 3;
  font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap;
}
.note::before { content: ""; display: inline-block; width: 34px; height: 1px; background: currentColor; vertical-align: middle; margin-right: 10px; }

/* ——— Accueil : ouverture ——— */
.open { padding: clamp(32px, 6vw, 80px) 0 0; overflow: hidden; border-bottom: 1px solid var(--border); }
.open-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
.open-copy { container-type: inline-size; min-width: 0; padding-bottom: clamp(8px, 4vw, 56px); }
.open h1 { font-size: min(16.5cqi, 128px); margin: 20px 0 0; line-height: 0.88; }
.open h1 .accent { display: block; }
.open .lead { font-size: clamp(16px, 2.2vw, 18px); color: var(--ink-70); max-width: 38ch; margin: 28px 0 30px; }
.open .lead strong { color: var(--ink); font-weight: 600; }
.open-visual { position: relative; justify-self: center; width: min(78vw, 340px); margin-bottom: -2px; }
.open-visual .shot { transform: rotate(2deg); border-radius: 18px 18px 0 0; border-bottom: 0; }
.open-visual .tape { top: -10px; left: 50%; transform: translateX(-50%) rotate(-3deg); }
.open-visual .note { top: -30px; left: 4px; display: none; }
@media (min-width: 900px) {
  .open-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: 56px; }
  .open-copy { padding-bottom: 96px; }
  .open-visual { justify-self: end; width: 100%; max-width: 380px; }
  .open-visual .note { display: block; }
}

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.soon { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-45); }

/* Formulaire « J'ai un code » */
.code-form { display: flex; gap: 8px; max-width: 420px; width: 100%; }
.code-form .input {
  flex: 1; min-width: 0; height: 56px; padding: 0 16px;
  background: var(--sunken); border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: var(--ink); font: 400 24px/1 var(--display); letter-spacing: 0.22em; text-transform: uppercase;
}
.code-form .input::placeholder { color: var(--ink-25); letter-spacing: 0.22em; }
.code-form .input:focus { outline: none; border-color: var(--accent); }
.code-form .btn { flex: none; padding: 0 20px; }
.code-label { display: block; margin-bottom: 10px; }

/* ——— Sections ——— */
.sec { padding: clamp(72px, 10vw, 128px) 0; border-bottom: 1px solid var(--border); }
.sec-head { display: grid; gap: 14px; margin-bottom: clamp(36px, 5vw, 56px); max-width: 760px; }
.sec-head h2 { font-size: clamp(40px, 8vw, 76px); }
.sec-head p:not(.meta) { color: var(--ink-70); max-width: 52ch; font-size: 17px; }

/* Le déroulé : 4 écrans en bande. Téléphone : on fait glisser. */
.reel {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(72vw, 270px); gap: 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 18px; scrollbar-width: thin;
  list-style: none;
}
.reel > li { scroll-snap-align: start; display: grid; align-content: start; gap: 16px; }
.reel .shot { aspect-ratio: 640 / 1060; object-fit: cover; object-position: top; }
.reel .shot.is-bottom { object-position: bottom; }
.reel .step { display: flex; gap: 12px; align-items: baseline; }
.reel .step .meta { color: var(--accent); }
.reel h3 { font-size: 26px; line-height: 0.95; }
.reel p { font-size: 15px; color: var(--ink-60); }
.reel > li:nth-child(2) .shot { transform: rotate(-1.2deg); }
.reel > li:nth-child(4) .shot { transform: rotate(1deg); }
@media (min-width: 1000px) {
  .reel { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; margin: 0; padding: 0; }
}

/* L'imprévue : la seule section tout orange */
.surprise { background: var(--accent); color: var(--bg); border-bottom: 0; overflow: hidden; }
.surprise .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.surprise .meta { color: rgba(10, 10, 11, 0.62); }
.surprise h2 { color: var(--bg); font-size: clamp(56px, 13vw, 132px); line-height: 0.86; margin-top: 14px; }
.surprise p:not(.meta) { color: rgba(10, 10, 11, 0.82); font-size: 18px; max-width: 40ch; margin-top: 22px; }
.surprise p strong { color: var(--bg); font-weight: 600; }
.surprise .shot-wrap { width: min(70vw, 300px); justify-self: center; }
.surprise .shot { border: 2px solid var(--bg); transform: rotate(-2.5deg); }
.surprise .tape { background: rgba(242, 240, 236, 0.32); border-color: rgba(10, 10, 11, 0.18); top: -10px; right: 22px; transform: rotate(7deg); }
@media (min-width: 900px) { .surprise .wrap { grid-template-columns: 1.2fr 0.8fr; } .surprise .shot-wrap { justify-self: end; } }

/* La bande : fiche technique en lignes */
.crew-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
.crew-grid .shot-wrap { width: min(76vw, 320px); justify-self: center; }
.facts { list-style: none; border-top: 1px solid var(--border); }
.facts li { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.facts .meta { color: var(--ink-45); }
.facts p { color: var(--ink-85); font-size: 17px; }
.facts p .muted { color: var(--ink-45); }
@media (min-width: 640px) { .facts li { grid-template-columns: 150px 1fr; gap: 24px; align-items: baseline; } }
@media (min-width: 900px) { .crew-grid { grid-template-columns: 5fr 7fr; align-items: start; } .crew-grid .shot-wrap { justify-self: start; position: sticky; top: 96px; } }

/* Android */
.android {
  display: grid; gap: 18px; padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--stripes);
}
.android h2 { font-size: clamp(34px, 6vw, 56px); }
.android p { color: var(--ink-85); max-width: 56ch; font-size: 17px; }

/* Questions */
.qa { border-top: 1px solid var(--border); max-width: 820px; }
.qa details { border-bottom: 1px solid var(--border); }
.qa summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-family: var(--display); font-size: 22px; text-transform: uppercase; color: var(--ink); line-height: 1.05;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-family: var(--mono); font-size: 22px; color: var(--ink-45); }
.qa details[open] summary::after { content: "–"; color: var(--accent); }
.qa details p { padding: 0 0 24px; color: var(--ink-70); max-width: 62ch; }

/* Fin de page */
.last { padding: clamp(80px, 12vw, 150px) 0; }
.last h2 { font-size: clamp(44px, 10vw, 104px); max-width: 12ch; margin-top: 18px; }
.last .cta-row { margin-top: 36px; }

/* ——————————————————————————————————————————————————————————————
   Page d'invitation /j/
   —————————————————————————————————————————————————————————————— */
.inv { padding-top: clamp(28px, 6vw, 72px); padding-bottom: clamp(64px, 9vw, 110px); container-type: inline-size; }
.inv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; }
.inv h1 { font-size: min(15cqi, 116px); line-height: 0.88; margin-top: 22px; overflow-wrap: anywhere; }
.inv .lead { font-size: clamp(16px, 2.2vw, 18px); color: var(--ink-70); max-width: 44ch; margin-top: 22px; }
.inv .lead strong { color: var(--ink); font-weight: 600; }

.onair { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.onair i { width: 8px; height: 8px; border-radius: 1px; background: currentColor; animation: led 1.6s steps(2, jump-none) infinite; }
@keyframes led { 50% { opacity: 0.25; } }

/* Le tableau : comme la carte programme du lobby */
.board {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 36px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
}
.board > div { padding: 18px 18px 20px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.board > div:nth-child(2n) { border-right: 0; }
.board .big { text-transform: uppercase; font-family: var(--display); font-size: clamp(40px, 9vw, 64px); line-height: 0.95; color: var(--ink); margin-top: 8px; }
.board .big small { font-size: 0.45em; color: var(--ink-45); margin-left: 4px; }
.board .sub { font-size: 13px; color: var(--ink-45); margin-top: 6px; }
.board .is-accent { color: var(--accent); }
@media (min-width: 720px) { .board { grid-template-columns: repeat(4, minmax(0, 1fr)); } .board > div:nth-child(2n) { border-right: 1px solid var(--border); } .board > div:last-child { border-right: 0; } .board > div { border-bottom: 0; } }

/* Les cases de missions : 12 carrés, comme le direct */
.cases { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; margin-top: 14px; max-width: 420px; }
.cases span { aspect-ratio: 1; border: 1px solid var(--border-strong); background: var(--sunken); border-radius: 1px; }
.cases span.on { background: var(--accent); border-color: var(--accent); }

/* Rejoindre : deux colonnes, iPhone / Android */
.join { display: grid; gap: 16px; margin-top: 40px; }
.join-card { padding: clamp(22px, 4vw, 32px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--sunken); display: grid; gap: 16px; align-content: start; }
.join-card h2 { font-size: 34px; }
.join-card ol { list-style: none; display: grid; gap: 14px; counter-reset: s; }
.join-card li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--ink-85); }
.join-card li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--accent); padding-top: 4px; }
.join-card p { color: var(--ink-70); }
.join-card .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.join-card .code-big { font-family: var(--display); font-size: clamp(44px, 12vw, 72px); letter-spacing: 0.12em; color: var(--accent); line-height: 1; }
@media (min-width: 820px) { .join { grid-template-columns: 1.15fr 0.85fr; } }

.inv-retry { margin-top: 36px; }
.skeleton { color: transparent !important; background: var(--surface); border-radius: 2px; }

/* ——— Thème SnowMercy (session d'hiver) : la glace remplace l'orange ——— */
.theme-snow { --accent: var(--ice); --accent-hover: #d3f0f9; --accent-tint: rgba(191, 232, 245, 0.1); }
.theme-snow .onair { color: var(--naughty); }
.theme-snow .cases span.on { background: var(--ice); border-color: var(--ice); }
.garland { display: none; position: relative; height: 26px; margin-top: -1px; overflow: hidden; }
.theme-snow .garland { display: block; }
.garland::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--border-strong); }
.garland i {
  position: absolute; top: 6px; width: 7px; height: 10px; border-radius: 3px 3px 4px 4px;
  background: var(--naughty); box-shadow: 0 0 8px currentColor;
}
.garland i:nth-child(3n+2) { background: var(--nice); color: var(--nice); }
.garland i:nth-child(3n) { background: var(--ice); color: var(--ice); }
.garland i:nth-child(3n+1) { color: var(--naughty); }
.snowfall { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.theme-snow .snowfall { display: block; }
.snowfall b { position: absolute; top: -10px; width: 3px; height: 3px; border-radius: 50%; background: var(--ink); opacity: 0.5; animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh); } }
.theme-snow main, .theme-snow .site-footer { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .onair i, .snowfall b { animation: none; }
  .snowfall { display: none !important; }
  html { scroll-behavior: auto; }
}

/* En-tête plein (pas de verre dépoli : interdit par la DA) */
.site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.board .big.is-word { font-size: clamp(26px, 5.4vw, 40px); line-height: 1; margin-top: 14px; }
