/* Remise à zéro, typographie et utilitaires. Propriétés logiques uniquement (arabe de droite à gauche). */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html:lang(ar) body { font-family: var(--font-ar); line-height: 1.6; }
html:lang(ar) * { letter-spacing: 0 !important; }
[lang="ar"], [lang^="ar-"] { font-family: var(--font-ar); line-height: 1.7; }

@media (min-width: 1024px) {
  body { font-size: 1rem; }
}

h1, h2, h3, p, ul, ol, figure, fieldset, legend, pre { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: var(--accent-text); text-decoration: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}
h1:focus, .view:focus { outline: none; }

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Icônes au trait */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 32px; height: 32px; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* Logo (symbole #i-logo) */
.logo-bg { fill: var(--accent); stroke: none; }
.logo-fg { fill: #FFFFFF; stroke: #FFFFFF; }
.logo-wave { fill: none; stroke: #FFFFFF; }
.logo-wave-1 { opacity: .75; }
.logo-wave-2 { opacity: .45; }

/* Titres et textes */
.large-title {
  font-size: 2.125rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.title-2 { font-size: 1.375rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.section-title { font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.label { font-size: .8125rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
html:lang(ar) .label { text-transform: none; font-size: .875rem; }
.hint { font-size: .8125rem; line-height: 1.4; color: var(--text-2); }
html:lang(ar) .hint { font-size: .875rem; line-height: 1.6; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* Empilements */
.stack > * + * { margin-block-start: 16px; }
.stack-sm > * + * { margin-block-start: 10px; }
.stack-lg > * + * { margin-block-start: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* Squelettes de chargement */
.sk {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--sk-1) 25%, var(--sk-2) 37%, var(--sk-1) 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
}
@keyframes sk {
  from { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}

/* Écran d'attente avant le démarrage du JavaScript */
.boot { max-width: 680px; margin-inline: auto; padding: 72px 16px 0; }
.boot-title { width: 55%; height: 38px; }
.boot-card { height: 120px; margin-block-start: 20px; border-radius: var(--r-lg); }
.boot-line { height: 18px; margin-block-start: 16px; }
.boot-line.short { width: 60%; }
.boot-error { max-width: 480px; margin: 96px auto 0; padding: 0 20px; text-align: center; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

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