/* ==========================================================================
   SlOS · Base : polices, remise à zéro, cadre du téléphone, styles de texte
   ========================================================================== */

/* Polices hébergées localement (latin, SIL OFL, licences dans fonts/).
   Un navigateur ne télécharge une police que si un texte l'utilise :
   les polices alternatives ne sont donc chargées que lorsqu'on les choisit
   (ou qu'on ouvre l'écran Police, qui en montre un aperçu). */
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("../fonts/atkinson-hyperlegible-next.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, textarea, select {
  font: inherit; color: inherit; margin: 0;
  background: none; border: 0; padding: 0; border-radius: 0;
}
button { cursor: pointer; text-align: inherit; touch-action: manipulation; }
button:disabled, [aria-disabled="true"] { cursor: default; }
a { color: inherit; text-decoration: none; touch-action: manipulation; }
img { display: block; max-width: 100%; }
svg { display: block; flex-shrink: 0; }

/* Focus visible au clavier, discret mais net */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-border-strong); outline-offset: 2px; border-radius: var(--radius-xs); }
.accueil :focus-visible { outline-color: var(--color-home-content); }
h1:focus-visible { outline: none; }

.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* La zone d'annonce (lecteurs d'écran) suit la page : on la place en haut
   pour qu'elle ne crée pas 1 px de défilement sous la page */
#annonce { top: 0; left: 0; }

/* --------------------------------------------------------------------------
   Cadre : sur ordinateur, un téléphone de 360 × 760 centré.
   Sur mobile (< 600 px), l'interface prend tout l'écran.
   -------------------------------------------------------------------------- */
.page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--space-24); }
/* L'échelle du téléphone (--echelle-cadre) est calculée par js/cadre.js
   pour qu'il tienne dans la hauteur de la fenêtre avec de l'air autour. */
.appareil { zoom: var(--echelle-cadre, 1); }

/* Deux colonnes égales sur ordinateur : la présentation à gauche,
   le téléphone à droite. En dessous de 900 px, l'une sur l'autre. */
.presentation { max-width: 30rem; display: flex; flex-direction: column; gap: var(--space-10); }
.presentation-accroche { margin-top: calc(-1 * var(--space-8)); }
.presentation-intertitre { margin-top: var(--space-4); text-transform: uppercase; letter-spacing: .04em; }
.presentation-idees { display: flex; flex-direction: column; gap: var(--space-8); counter-reset: idee; }
.presentation-idees li { counter-increment: idee; padding-left: var(--space-24); position: relative; }
.presentation-idees li::before { content: counter(idee); position: absolute; left: 0; font-weight: 500; }
.presentation-idees strong { font-weight: 500; }
/* Pistes pour la suite : liste à tirets, en gris (ce n'est pas dans le prototype) */
.presentation-pistes { display: flex; flex-direction: column; gap: var(--space-4); color: var(--color-text-secondary); }
.presentation-pistes li { padding-left: var(--space-24); position: relative; }
.presentation-pistes li::before { content: "–"; position: absolute; left: 0; }
@media (min-width: 900px) {
  .page {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-32);
    padding: var(--space-24) clamp(var(--space-32), 5vw, 96px);
  }
  .presentation { justify-self: end; }
}
@media (min-width: 600px) and (max-width: 899.98px) {
  .page { gap: var(--space-32); padding: var(--space-32); }
}
.appareil {
  position: relative;
  width: 360px; height: 760px;
  border: var(--stroke-device) solid var(--color-border-strong);
  border-radius: var(--radius-screen);
  background: var(--color-bg-default);
  overflow: hidden;
  isolation: isolate;
}
.ecran {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--color-bg-default);
  overflow: hidden;
}

@media (max-width: 599.98px) {
  body { background: var(--color-bg-default); }
  .page { padding: 0; display: block; }
  .presentation { display: none; }
  .appareil {
    width: 100%; height: 100vh; height: 100dvh;
    border: 0; border-radius: 0;
    zoom: 1;
  }
  .ecran {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  /* Le vrai téléphone affiche déjà sa barre d'état */
  .barre-etat { display: none !important; }
  /* Le clavier dessiné laisse la place au vrai clavier */
  .clavier-dessine { display: none !important; }
  /* Évite le zoom automatique d'iOS au focus d'un champ (texte ≥ 16 px) */
  input, textarea { font-size: max(16px, 1em); }
}
.marge-bas { padding-bottom: env(safe-area-inset-bottom); }

/* --------------------------------------------------------------------------
   Styles de texte (Figma : SlOS/…)
   -------------------------------------------------------------------------- */
.t-display        { font-size: var(--font-size-display); font-weight: 500; line-height: 1.15; }
.t-title          { font-size: var(--font-size-title);   font-weight: 500; line-height: 1.2; }
.t-heading        { font-size: var(--font-size-heading); font-weight: 500; line-height: 1.25; }
.t-body           { font-size: var(--font-size-body);    font-weight: 400; line-height: 1.35; }
.t-body-strong    { font-size: var(--font-size-body);    font-weight: 500; line-height: 1.35; }
.t-small          { font-size: var(--font-size-small);   font-weight: 400; line-height: 1.35; }
.t-small-strong   { font-size: var(--font-size-small);   font-weight: 500; line-height: 1.35; }
.t-caption        { font-size: var(--font-size-caption); font-weight: 400; line-height: 1.3; }
.t-caption-strong { font-size: var(--font-size-caption); font-weight: 500; line-height: 1.3; }
.secondaire { color: var(--color-text-secondary); }

/* Zone qui défile verticalement */
.defile {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.defile::-webkit-scrollbar { display: none; }

/* Annonce des changements d'écran pour les lecteurs d'écran */
.annonce { position: absolute; }

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