/* Base : polices, échelle, reset, boutons. Les COULEURS viennent exclusivement des variables posées par js/theme.js
   (moteur lumen) : --bg --surface --surface2 --text --muted --primary --primary-hover --primary-subtle --on-primary
   --accent --accent-subtle --on-accent --border --ring --radius. Aucune valeur hex/rgb/hsl dans ce projet. */
@font-face { font-family: "Instrument Sans"; font-weight: 400 700; font-display: swap; src: url("../fonts/instrument-sans-var.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400 700; font-display: swap; src: url("../fonts/geist-mono-var.woff2") format("woff2"); }

:root {
    color-scheme: dark light;
    --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
    --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --gutter: clamp(1rem, 4vw, 2.5rem);
    --maxw: 1240px;
    --nav-h: 4.5rem;
    --r-lg: calc(var(--radius, 14px) + 8px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); background: var(--bg, Canvas); }
body {
    margin: 0; min-height: 100vh; overflow-x: clip;
    background: var(--bg, Canvas); color: var(--text, CanvasText);
    font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 100; left: 1rem; top: -4rem; padding: .7rem 1.1rem; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 600; text-decoration: none; }
.skip:focus { top: 1rem; }
.sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }

.eyebrow { display: flex; align-items: center; gap: .7rem; font: 500 .78rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 1.6rem; height: 2px; background: var(--primary); }
.title { margin-top: .9rem; font-size: clamp(2.2rem, 5.4vw, 4.2rem); line-height: 1; letter-spacing: -.035em; font-weight: 650; text-wrap: balance; }
.title em, .hero h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.01em; color: var(--primary); }
.title em { font-size: 1.08em; }

/* Boutons : états (survol, focus, désactivé) uniquement avec des paires validées par le moteur */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    min-height: 3rem; padding: 0 1.6rem; border-radius: 999px; border: 1.5px solid transparent;
    font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
    transition: background-color .2s, color .2s, border-color .2s, transform .25s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-sm { min-height: 2.5rem; padding: 0 1.1rem; font-size: .9rem; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--primary); }
.btn-ghost:hover { background: var(--surface2); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--surface2); color: var(--muted); border-color: transparent; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text); transition: background-color .2s; }
.icon-btn:hover { background: var(--surface2); }

/* Bascule play / pause et soleil / lune */
[data-play] .ico-pause, [data-play][aria-pressed="true"] .ico-play { display: none; }
[data-play][aria-pressed="true"] .ico-pause { display: block; }
.ico-moon { display: none; }
[data-mode="light"] .ico-moon { display: block; }
[data-mode="light"] .ico-sun { display: none; }

/* Apparition au scroll : CSS pur, contenu visible sans support ni JavaScript */
@keyframes rise { from { opacity: 0; transform: translateY(36px); } }
@supports (animation-timeline: view()) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* Bascule clair / sombre : aucune transition pendant le changement (voir js/theme.js) */
html.no-anim *, html.no-anim *::before, html.no-anim *::after { transition: none !important; }
