/* ============================================================
   SKÀLI ÉVÉNEMENTS — design system « Éditorial blanc »
   ------------------------------------------------------------
   Pages : hyrox.html, hyrox-inscription.html, hyrox-confirmation.html,
   evenements.html. Les autres pages Hyrox (live, dossier, bénévoles…)
   gardent css/hyrox.css.

   Principe : fond papier, typographie condensée noire très grande, un
   seul accent (jaune HYROX) posé comme un coup de surligneur, hairlines,
   numérotation éditoriale des sections (01, 02…). Aucune décoration qui
   ne porte pas d'information.
   ============================================================ */

:root {
    --paper: #ffffff;
    --paper-2: #f6f6f4;
    --ink: #0b0b0b;
    --ink-2: #454545;
    --ink-3: #767676;            /* #8a8a8a → #767676 : 4,5:1 sur blanc (a11y) */
    --line: #e7e7e4;
    --line-2: #cfcfcb;
    --yellow: #FFE500;
    --yellow-soft: #fff7a8;
    --ok: #15803d;
    --ok-bg: #ecfdf3;
    --err: #b91c1c;
    --err-bg: #fef2f2;
    --nav-bg: rgba(255,255,255,.92);
    --accent: var(--yellow);

    --font-display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
    --font-body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;

    --gutter: clamp(16px, 4vw, 40px);
    --max: 1120px;
    --max-narrow: 680px;
    --radius: 10px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Thème « nuit » (pages /e/<slug> en page.theme = 'nuit', infinity.html) — D14.
   --ink-3 #8b98b8 ≥ 4,5:1 sur #070c1c. L'accent remplace le jaune partout. */
body[data-theme="nuit"] {
    --paper: #070c1c; --paper-2: #0c1530; --ink: #eef4ff; --ink-2: #b7c4de; --ink-3: #8b98b8;
    --line: rgba(183,196,222,.16); --line-2: rgba(183,196,222,.35);
    --accent: #7fe3ff; --yellow: var(--accent); --yellow-soft: rgba(127,227,255,.18);
    --ok-bg: rgba(21,128,61,.18); --err-bg: rgba(185,28,28,.18); --nav-bg: rgba(7,12,28,.7);
    --ok: #4ade80; --err: #f87171;
}
/* Accent personnalisé (page.accent) : JS pose body.dataset.accent = '1' ET
   body.style.setProperty('--accent', hex) — toujours les deux, sinon cycle. */
body[data-accent] { --yellow: var(--accent); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
::selection { background: var(--yellow); color: var(--ink); }

/* ------------------------------------------------------------ typo */
.display { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; line-height: .92; letter-spacing: -.01em; }
.h-xl { font-size: clamp(56px, 12vw, 160px); }
.h-l  { font-size: clamp(40px, 7vw, 88px); }
.h-m  { font-size: clamp(28px, 4.2vw, 48px); }
.h-s  { font-size: clamp(22px, 3vw, 30px); }
.kicker { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--ink-3); }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); line-height: 1.55; max-width: 34em; }
.small { font-size: 13px; color: var(--ink-3); }
.mark { background: linear-gradient(transparent 55%, var(--yellow) 55%, var(--yellow) 92%, transparent 92%); padding: 0 .08em; }
.num { font-family: var(--font-display); font-weight: 900; font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ layout */
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: var(--max-narrow); margin: 0 auto; padding-inline: var(--gutter); }
.rule { border: 0; border-top: 1px solid var(--line); }
.rule-strong { border: 0; border-top: 2px solid var(--ink); }
.section { padding-block: clamp(48px, 8vw, 104px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 16px clamp(16px, 3vw, 40px); align-items: end; margin-bottom: clamp(24px, 4vw, 48px); }
.section-head .index { font-family: var(--font-display); font-weight: 900; font-size: clamp(40px, 6vw, 72px); line-height: .8; color: var(--ink); position: relative; }
.section-head .index::after { content: ''; position: absolute; left: -.06em; right: -.06em; bottom: .02em; height: .32em; background: var(--yellow); z-index: -1; }
.section-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 3vw, 32px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 3vw, 32px); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ nav */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: var(--nav-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.nav-in { max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: 20px; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 10px; }
.brand .dot { width: 10px; height: 10px; background: var(--yellow); border-radius: 50%; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a { font-size: 14px; font-weight: 600; padding: 12px 14px; border-radius: 999px; color: var(--ink-2); }   /* cible ≥ 44 px */
.nav-links a:hover { background: var(--paper-2); color: var(--ink); }
.nav-links a.is-cta { background: var(--ink); color: var(--paper); }
.nav-links a.is-cta:hover { background: #222; }
@media (max-width: 640px) { .nav-links a:not(.is-cta) { display: none; } }

/* ------------------------------------------------------------ boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 18px;
    padding: 14px 24px; border-radius: 999px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
    transition: transform .18s var(--ease), background .18s, color .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-yellow { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn-yellow:hover { box-shadow: 0 8px 24px rgba(255,229,0,.35); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-lg { font-size: 22px; padding: 18px 32px; }
.btn-sm { font-size: 15px; padding: 12px 16px; }   /* cible ≥ 44 px */
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .arrow { transition: transform .18s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ------------------------------------------------------------ cartes / choix */
.choice { display: grid; gap: 10px; }
.choice-2 { grid-template-columns: repeat(2, 1fr); }
.choice-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .choice-3 { grid-template-columns: 1fr; } }
.card {
    position: relative; text-align: left; width: 100%;
    border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--paper);
    padding: 16px 16px 14px; min-height: 84px;
    transition: border-color .15s, background .15s, transform .15s var(--ease);
}
.card:hover { border-color: var(--ink); }
.card[aria-pressed="true"], .card.is-on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.card[aria-pressed="true"] .card-sub, .card.is-on .card-sub { color: rgba(255,255,255,.7); }
.card[aria-pressed="true"]::after, .card.is-on::after { content: ''; position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); }
.card:disabled { opacity: .45; cursor: not-allowed; }
.card-title, .card-sub, .card-price { display: block; }
.card-title { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 22px; line-height: 1; }
.card-sub { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }
.card-price { font-family: var(--font-display); font-weight: 900; font-size: 26px; margin-top: 10px; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    border: 1.5px solid var(--line-2); border-radius: 999px; padding: 11px 16px; font-weight: 600; font-size: 15px; background: var(--paper);
    transition: border-color .15s, background .15s, color .15s;
}   /* padding 11px : cible ≥ 44 px */
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.yellow { background: var(--yellow); color: var(--ink); }

/* ------------------------------------------------------------ formulaire */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.field input, .field select {
    width: 100%; padding: 13px 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--paper);
    font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--yellow-soft); }
.field :is(input, select)[aria-invalid="true"] { border-color: var(--err); }
.field .err { font-size: 13px; color: var(--err); display: none; }
.field :is(input, select)[aria-invalid="true"] ~ .err { display: block; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .fields-2 { grid-template-columns: 1fr; } }
.person { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; display: grid; gap: 12px; }
.person:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.person-head { display: flex; align-items: baseline; gap: 10px; }
.person-head .n { font-family: var(--font-display); font-weight: 900; font-size: 22px; }

/* ------------------------------------------------------------ étapes (inscription) */
.steps { display: grid; gap: 0; }
.step { border-top: 1px solid var(--line); padding: 26px 0; transition: opacity .2s; scroll-margin-top: 72px; }
.step:first-child { border-top: 0; }
.step-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; }
.step-head .index { font-family: var(--font-display); font-weight: 900; font-size: 34px; line-height: 1; color: var(--ink); position: relative; width: 56px; }
.step-head .index::after { content: ''; position: absolute; left: 0; right: 14px; bottom: 2px; height: 9px; background: var(--yellow); z-index: -1; opacity: 0; transition: opacity .2s; }
.step.is-active .step-head .index::after { opacity: 1; }
.step-head h2 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 26px; line-height: 1; margin: 0; }
.step-head .summary { font-size: 14px; color: var(--ink-2); margin-top: 4px; min-height: 1em; }
.step-head .edit { font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; visibility: hidden; }
.step.is-done .step-head .edit { visibility: visible; }
.step-body { padding-top: 18px; display: grid; gap: 14px; }
.step.is-locked { opacity: .35; pointer-events: none; }
.step.is-done .step-body { display: none; }
.step.is-done.is-open .step-body { display: grid; }
.step.is-done .step-head .summary { color: var(--ink); font-weight: 600; }
.step-hint { font-size: 13.5px; color: var(--ink-3); }

/* barre du total, collée en bas */
.ticket {
    position: sticky; bottom: 0; z-index: 40;
    background: var(--paper); border-top: 2px solid var(--ink);
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
}
.ticket-in { max-width: var(--max-narrow); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ticket .label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ink-3); }
.ticket .total { font-family: var(--font-display); font-weight: 900; font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.ticket .total .was { font-size: 16px; color: var(--ink-3); text-decoration: line-through; margin-right: 8px; font-weight: 700; }
.ticket .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
@media (max-width: 480px) { .ticket .total { font-size: 26px; } .ticket .btn { font-size: 16px; padding: 12px 18px; } }

/* messages */
.notice { border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; font-size: 14.5px; display: flex; gap: 10px; align-items: flex-start; }
.notice.err { border-color: var(--err); background: var(--err-bg); color: var(--err); }
.notice.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.notice.yellow { border-color: var(--yellow); background: var(--yellow-soft); color: var(--ink); }

/* ------------------------------------------------------------ hero (landing) */
.hero { padding-block: clamp(40px, 8vw, 96px) clamp(32px, 6vw, 64px); }   /* padding-block : <header class="hero wrap"> garde la gouttière de .wrap */
.hero .dates { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .25em; }
.hero .dates .sep { color: var(--ink-3); font-weight: 700; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; font-weight: 600; color: var(--ink-2); }
.hero .meta span::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--yellow); border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; align-items: center; }
.hero .status { font-size: 14px; color: var(--ink-2); }

/* listes éditoriales */
.list { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.list-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-row .n { font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--ink-3); }
.list-row .t { font-weight: 700; font-size: 17px; }
.list-row .d { font-size: 14px; color: var(--ink-2); }
.list-row .v { font-family: var(--font-display); font-weight: 800; font-size: 18px; white-space: nowrap; }

/* prix */
.price-card { border: 2px solid var(--ink); border-radius: 14px; padding: 22px; display: grid; gap: 6px; position: relative; overflow: hidden; }
.price-card .who { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 24px; line-height: 1; }
.price-card .amount { font-family: var(--font-display); font-weight: 900; font-size: clamp(44px, 6vw, 64px); line-height: 1; margin-top: 8px; }
.price-card .per { font-size: 14px; color: var(--ink-2); }
.price-card.is-featured { background: var(--ink); color: var(--paper); }
.price-card.is-featured .per { color: rgba(255,255,255,.7); }
.price-card .tag { position: absolute; top: 14px; right: -34px; transform: rotate(35deg); background: var(--yellow); color: var(--ink); font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; padding: 4px 44px; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--font-display); font-weight: 900; font-size: 24px; color: var(--ink-3); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 0 16px; color: var(--ink-2); font-size: 15.5px; max-width: 60ch; }

/* événements (index) */
.ev { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.ev .when { font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 4vw, 40px); line-height: 1; }
.ev .name { font-weight: 700; font-size: 18px; margin-top: 6px; }
.ev .blurb { color: var(--ink-2); font-size: 14.5px; margin-top: 4px; }
.ev.is-past { opacity: .75; }
@media (max-width: 560px) { .ev { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ footer */
.footer { border-top: 2px solid var(--ink); padding: 32px 0 calc(32px + env(safe-area-inset-bottom, 0px)); font-size: 14px; color: var(--ink-2); }
.footer-in { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------ pages /e/<slug> (§8.7) */
@media (max-width: 420px) { .choice-2 { grid-template-columns: 1fr; } }
.card:focus-visible, .chip:focus-visible, .btn:focus-visible, .nav-links a:focus-visible, .brand:focus-visible,
.faq summary:focus-visible, .footer a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.steps ol { counter-reset: s; list-style: none; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.steps li::before { counter-increment: s; content: counter(s, decimal-leading-zero); font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--ink-3); }
.hero-cover { margin-top: 24px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-radius: 14px; }
.preview-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--yellow); color: #0b0b0b; font-weight: 700; text-align: center; padding: 8px; font-size: 14px; }
body.has-preview .nav { top: 37px; }
/* Texte long rendu par md() : titres h3/h4, listes, liens */
.prose { font-size: 16.5px; color: var(--ink-2); max-width: 64ch; display: grid; gap: 14px; }
.prose h3 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 24px; line-height: 1; color: var(--ink); margin-top: 10px; }
.prose h4 { font-weight: 700; font-size: 17px; color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; display: grid; gap: 6px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.prose strong { color: var(--ink); }
.steps .prose ol { padding-left: 0; }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; background: var(--paper-2); }
.price-card .desc { font-size: 14.5px; color: var(--ink-2); }
.price-card.is-featured .desc { color: rgba(255,255,255,.7); }
.price-card .avail { font-size: 13px; font-weight: 700; margin-top: 4px; }
.price-card .avail.low { color: var(--err); }
.price-card.is-off { opacity: .55; }
body[data-theme="nuit"] .price-card.is-featured { background: var(--paper-2); color: var(--ink); }
/* Nuit : les fonds accent (cyan) gardent une encre sombre, l'encre claire n'y contraste pas */
body[data-theme="nuit"] .btn-yellow { color: #0b0b0b; }
body[data-theme="nuit"] .nav-links a.is-cta { background: var(--yellow); color: #0b0b0b; }
body[data-theme="nuit"] .nav-links a.is-cta:hover { background: var(--yellow); opacity: .85; }
body[data-theme="nuit"] .mark, body[data-theme="nuit"] .pill.yellow, body[data-theme="nuit"] ::selection { color: #0b0b0b; }
[data-theme="nuit"] .sky { position: fixed; inset: 0; z-index: -1; background:
    radial-gradient(1200px 600px at 20% -10%, rgba(127,227,255,.22), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(47,184,230,.16), transparent 60%),
    radial-gradient(800px 800px at 60% 110%, rgba(20,40,90,.6), transparent 60%),
    var(--paper); }
[data-theme="nuit"] .sky::after { content: ''; position: absolute; inset: 0; opacity: .07; mix-blend-mode: screen;
    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'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* ------------------------------------------------------------ motion */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal .7s var(--ease) forwards; }
.reveal.d1 { animation-delay: .08s; } .reveal.d2 { animation-delay: .18s; } .reveal.d3 { animation-delay: .28s; } .reveal.d4 { animation-delay: .4s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; opacity: 1; transform: none; }
    * { transition: none !important; }
}
