/* ==========================================================================
   ATOMIC REEL — base
   Typographie, couleurs de section (nuit / crème), focus, accessibilité.
   ========================================================================== */

html {
  background: var(--c-night);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--c-night);
  color: var(--c-text);
  font-family: var(--f-text);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--c-orange);
  color: var(--c-night);
}

/* --- Titres ------------------------------------------------------------ */

h1, h2, h3, h4 {
  color: inherit;
  font-family: var(--f-display);
  font-weight: 750;
  letter-spacing: var(--ls-display);
  line-height: var(--lh-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 650; line-height: 1.15; }
h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.25; }

p, li {
  max-width: var(--measure);
  text-wrap: pretty;
}

strong { font-weight: 600; }

/* --- Sections : deux ambiances ----------------------------------------- */

.ar-dark {
  background: var(--c-navy);
  color: var(--c-text);
}

.ar-night {
  background: var(--c-night);
  color: var(--c-text);
}

.ar-light {
  background: var(--c-cream);
  color: var(--c-ink);
}

/* --- Liens -------------------------------------------------------------- */

a {
  color: var(--c-sun);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover { color: var(--c-star); }

.ar-light a { color: var(--c-teal); }
.ar-light a:hover { color: var(--c-ink); }

a, button, [role="button"], summary, label[for], select,
input[type="submit"], input[type="range"] {
  cursor: pointer;
}

/* Focus visible : anneau jaune étoile 3 px, partout.
   Quark déclare « a:focus { outline: 0 !important } » : entre deux !important, le sélecteur
   le plus spécifique gagne, et « a:focus » bat « :focus-visible ». D'où « html … » ici. */
:focus { outline: none; }

html :focus-visible,
html a:focus-visible {
  outline: 3px solid var(--c-star) !important;
  outline-offset: 3px;
  border-radius: 4px;
}

html .ar-light :focus-visible,
html .ar-light a:focus-visible {
  outline-color: var(--c-teal) !important;
}

/* --- Labels mono (timecodes, numéros de plan) --------------------------- */

.ar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  margin: 0;
  color: var(--c-sun);
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: var(--ls-label);
  line-height: 1.4;
  text-transform: uppercase;
}

.ar-light .ar-label { color: var(--c-teal); }

.ar-label--soft { color: var(--c-text-soft); }
.ar-light .ar-label--soft { color: var(--c-ink-soft); }

/* --- Accessibilité ------------------------------------------------------ */

.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;
}

/* Lien d'évitement : invisible jusqu'au premier Tab */
.ar-skip {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-pill);
  background: var(--c-orange);
  color: var(--c-night);
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-decoration: none;
  text-transform: uppercase;
  transform: translateY(-200%);
}

.ar-skip:focus {
  color: var(--c-night);
  transform: none;
}

main:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
