/* Page d'accueil de Tentaclue : la même identité que le back-office (encre violette, papier
   lilas, couleurs du poulpe, Zilla Slab et Figtree). Le haut de page est la salle sombre où
   l'on projette : la démonstration y joue une vraie question, le poulpe derrière l'écran. */

@font-face { font-family: "Zilla Slab"; font-weight: 700; font-display: swap; src: url("/static/fonts/zilla-slab-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 300 900; font-display: swap; src: url("/static/fonts/figtree-latin.woff2") format("woff2"); }

:root {
  --nuit: #1b1140;
  --nuit-2: #2a1d63;
  --nuit-3: #3a2a85;
  --clair: #f3f0fa;
  --lilas: #c9bdf0;
  --papier: #f3f0fa;
  --surface: #ffffff;
  --encre: #1b1140;
  --doux: #625a80;
  --trait: #ddd6ee;
  --corail: #ff615e;
  --corail-fonce: #e8463f;
  --focus-ring: #d13a33;
  /* Les couleurs des réponses du jeu. */
  --a0: #d63a3a; --a1: #2f6fdf; --a2: #f2b705; --a3: #2f9a2a;
  --bloc: #1b1140;
  --display: "Zilla Slab", Georgia, serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --papier: #150d33; --surface: #1f1647; --encre: #f3f0fa; --doux: #a99fcb; --trait: #3a2e70; --focus-ring: #ff8a7a; --bloc: #2a1d63; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--papier); color: var(--encre); font: 400 1.0625rem/1.6 var(--text); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0 0 .8em; }
a { color: inherit; text-decoration-color: var(--corail); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.hero :focus-visible { outline-color: #ff8a7a; }
img { max-width: 100%; height: auto; }
.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; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7em 1.3em;
  font: 700 1rem/1.2 var(--text); color: #1b1140; background: var(--corail); border-radius: 12px; text-decoration: none;
  touch-action: manipulation; transition: background-color .15s ease;
}
.btn:hover { background: var(--corail-fonce); }
.btn.ghost { background: transparent; color: var(--clair); box-shadow: inset 0 0 0 1.5px rgba(243, 240, 250, .4); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--clair); }

/* ---------- Haut de page ---------- */
.hero { background: var(--nuit); color: var(--clair); overflow: hidden; }
.top { max-width: 76rem; margin: 0 auto; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.wordmark { display: inline-flex; align-items: center; gap: .5em; font: 700 1.45rem/1 var(--display); text-decoration: none; }
.top-link { color: var(--lilas); font-weight: 600; padding: .6em 0; }
.top-link:hover { color: var(--clair); }

.hero-grid {
  max-width: 76rem; margin: 0 auto; padding: 40px 24px 88px;
  display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center;
}
.pitch h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); letter-spacing: -.015em; margin-bottom: .35em; }
.pitch .lead { font-size: 1.25rem; color: var(--lilas); max-width: 26em; margin-bottom: 1.6em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* ---------- La démonstration ---------- */
/* L'écran laisse 17 % à droite pour le téléphone, qui ne mord que son bord ; le poulpe,
   derrière l'écran, passe la tête par-dessus. */
.demo { position: relative; margin: 0; padding: 22% 17% 56px 0; container-type: inline-size; }
.peek {
  position: absolute; z-index: 0; width: 38%; right: 21%; top: 1%;
  transform: rotate(-8deg);
}
.screen {
  position: relative; z-index: 1; aspect-ratio: 16 / 10; display: flex; flex-direction: column;
  padding: 4.2% 4.8%; border-radius: 16px; background: var(--nuit-2);
  box-shadow: 0 0 0 10px #0d0826, 0 30px 80px rgba(120, 90, 255, .25);
  font-size: clamp(.6rem, 2.6cqi, 1rem);
}
.screen-head { display: flex; justify-content: space-between; color: var(--lilas); font-weight: 600; font-size: .95em; }
.screen-head b { color: var(--clair); font-variant-numeric: tabular-nums; }
.question { font: 700 2.05em/1.15 var(--display); margin: .55em 0 .5em; }
.timer { height: .5em; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-bottom: 1em; }
.timer span { display: block; height: 100%; width: 0%; background: var(--corail); border-radius: inherit; }
.answers { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .7em; flex: 1; }
.answers li {
  position: relative; display: flex; align-items: center; gap: .7em; padding: 0 1em; border-radius: 10px;
  font-weight: 700; font-size: 1.15em; color: #fff; transition: opacity .3s ease, transform .3s ease;
}
.answers b { display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 6px; background: rgba(0, 0, 0, .22); font-size: .85em; }
.answers i { margin-left: auto; font-style: normal; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .3s ease; }
.a0 { background: var(--a0); } .a1 { background: var(--a1); } .a2 { background: var(--a2); color: #1b1140 !important; } .a3 { background: var(--a3); }
.fact { margin: .8em 0 0; color: var(--lilas); font-style: italic; min-height: 1.6em; opacity: 0; transition: opacity .4s ease; }

.phone {
  position: absolute; z-index: 2; right: 0; bottom: 0; width: 22%; min-width: 104px; aspect-ratio: 9 / 18;
  padding: 7px; border-radius: 26px; background: #0d0826; transform: rotate(-5deg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.phone-screen { height: 100%; border-radius: 20px; background: #f3f0fa; color: #1b1140; padding: 14% 10% 10%; display: flex; flex-direction: column; font-size: clamp(.55rem, 1.9cqi, .85rem); }
.me { display: flex; justify-content: space-between; font-weight: 600; margin: 0 0 .8em; }
.me b { font-variant-numeric: tabular-nums; }
.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; }
.pads span { display: grid; place-items: center; border-radius: 10px; font: 700 1.6em/1 var(--display); color: #fff; transition: transform .15s ease, box-shadow .15s ease, opacity .3s ease; }
.pads .tapped { transform: scale(.92); box-shadow: 0 0 0 3px #1b1140; }
.verdict { margin: .8em 0 0; min-height: 2.6em; font-weight: 700; text-align: center; opacity: 0; transition: opacity .3s ease; }
.verdict.ok b { color: #1f7a3d; }
.verdict.ko { color: #a52914; }

/* État révélé (aussi l'état figé, sans animation ni JavaScript). */
.demo .answers li:not(.good) { opacity: .35; }
.demo .answers i, .demo .fact, .demo .verdict { opacity: 1; }
.demo .timer span { width: 0%; }
.demo .answers .good { box-shadow: 0 0 0 3px #fff; }
/* Pendant la question : tout est ouvert, le sablier court. */
.demo.asking .answers li { opacity: 1; box-shadow: none; }
.demo.asking .answers i, .demo.asking .fact, .demo.asking .verdict { opacity: 0; }
.demo.asking .pads .tapped ~ span, .demo.asking .pads span:has(~ .tapped) { opacity: .45; }
.demo.asking.sent .verdict { opacity: 1; }
.demo.asking .timer span { width: 100%; }
.demo.running .timer span { transition: width var(--ask, 6s) linear; }
.demo.asking.running .timer span { width: 0%; }

.pause {
  position: absolute; z-index: 3; left: 0; bottom: 0; min-height: 44px; padding: 0 1em;
  border: 0; border-radius: 10px; background: rgba(243, 240, 250, .1); color: var(--lilas);
  font: 600 .9rem/1 var(--text); cursor: pointer;
}
.pause:hover { background: rgba(243, 240, 250, .18); color: var(--clair); }

@media (prefers-reduced-motion: reduce) {
  .answers li, .answers i, .fact, .pads span, .verdict, .btn { transition: none; }
}

/* ---------- Sections ---------- */
main section { max-width: 76rem; margin: 0 auto; padding: 72px 24px 0; }
main h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .35em; }
.intro { color: var(--doux); font-size: 1.15rem; max-width: 36em; margin-bottom: 1.6em; }

.spaces { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.space {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between;
  gap: 1em 1.6em; flex-wrap: wrap; padding: 24px 28px 24px 36px; border-radius: 16px; background: var(--surface);
}
.space::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; background: var(--band); }
[data-hue="0"] { --band: var(--a0); } [data-hue="1"] { --band: var(--a1); } [data-hue="2"] { --band: var(--a2); } [data-hue="3"] { --band: var(--a3); }
.space h3 { font-size: 1.9rem; }
.tagline { color: var(--doux); margin: .2em 0 0; }
.next { margin: .55em 0 0; }
.next strong { font-weight: 700; }
.live { display: inline-flex; align-items: center; gap: .5em; margin: .7em 0 0; font-weight: 600; }
.live .dot { width: .65em; height: .65em; border-radius: 50%; background: var(--a3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a3) 25%, transparent); }
.space .btn { min-width: 9rem; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.2em 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: block; margin-bottom: .2em;
  font: 700 4.2rem/1 var(--display); color: var(--corail);
}
.steps h3 { font-size: 1.45rem; margin-bottom: .45em; }
.steps p { color: var(--doux); }

.clubs {
  display: grid; grid-template-columns: 3fr 2fr; gap: 32px 56px; align-items: center;
}
main .clubs { margin-top: 72px; padding: 48px; border-radius: 24px; background: var(--bloc); color: var(--clair); max-width: calc(76rem - 48px); }
.clubs h2 { color: var(--clair); }
.clubs p { color: var(--lilas); max-width: 34em; }
.contact { justify-self: end; text-align: center; }
.contact .email { margin: .8em 0 0; color: var(--lilas); user-select: all; overflow-wrap: anywhere; }

.foot { max-width: 76rem; margin: 0 auto; padding: 56px 24px 40px; color: var(--doux); font-size: .95rem; }
.foot p { margin: 0 0 .4em; }
.foot-links { display: flex; flex-wrap: wrap; gap: .4em 1.6em; }
.foot-links a { padding: .5em 0; }
.credit { font-size: .85rem; }

/* ---------- Écrans étroits ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; padding-bottom: 56px; }
  .demo { padding: 22% 17% 52px 0; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps li { display: grid; grid-template-columns: 4rem 1fr; column-gap: 12px; }
  .steps li::before { grid-row: span 2; font-size: 3.4rem; }
  .clubs { grid-template-columns: 1fr; }
  .contact { justify-self: start; text-align: left; }
}
@media (max-width: 600px) {
  .top, .hero-grid, main section, .foot { padding-left: 16px; padding-right: 16px; }
  main .clubs { margin: 56px 16px 0; padding: 28px 20px; max-width: none; }
  main section { padding-top: 56px; }
  .space { padding: 20px 20px 20px 28px; }
  .space .btn { width: 100%; }
  .demo { padding: 22% 15% 48px 0; }
  .phone { width: 27%; min-width: 0; border-radius: 18px; padding: 5px; }
  .phone-screen { border-radius: 15px; }
  .pause { font-size: .8rem; }
}
