/* ============================================================
   Tuto-CRPE — base.css
   Reset, variables (thème clair par défaut), typographie,
   conteneurs, éléments utilitaires.
   Le mode sombre est défini dans theme-dark.css.
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ---------- Variables — thème clair (défaut) ---------- */
:root {
  /* Surfaces */
  --bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;

  /* Texte */
  --text: #0f172a;
  --muted: #64748b;

  /* Marque */
  --primary: #4f46e5;        /* indigo */
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-soft-text: #4338ca;
  --link: #4f46e5;
  --gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);

  /* Accents sémantiques */
  --accent-soft: #fef3c7;
  --accent-soft-text: #92400e;

  --success: #15803d;
  --success-soft: #dcfce7;
  --success-soft-text: #15803d;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-soft-text: #b91c1c;

  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-soft-text: #92400e;

  /* Ombres & focus */
  --ring: 0 0 0 3px rgba(79, 70, 229, .25);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .08);

  /* Rayons — carrés */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 6px;

  /* Surlignage lisible */
  --mark-bg: #fef08a;
  --mark-text: #1e293b;
  --mark-green-bg: #86efac;
  --mark-green-text: #14532d;

  /* Layout */
  --header-h: 68px;
  --container: 1120px;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: 1.15rem; }

/* ---------- Surlignage lisible ---------- */
mark {
  background: var(--mark-bg);
  color: var(--mark-text);
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 600;
}

p { margin: 0 0 1em; }

a {
  color: var(--link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 2px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: 72px;
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

/* ---------- Utilitaires ---------- */
.sr-only, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary-soft-text);
  background: var(--primary-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  text-decoration: none;
}

/* ============================ ORQUES DÉCORATIVES ============================ */
.orca-deco {
  position: fixed;
  bottom: -20px;
  width: 180px;
  height: auto;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  color: var(--primary);
  transition: opacity 0.3s ease;
}
.orca-deco.left {
  left: -20px;
  transform: scaleX(-1);
}
.orca-deco.right {
  right: -20px;
}
.orca-deco svg {
  width: 100%;
  height: auto;
}
@media (max-width: 768px) {
  .orca-deco {
    width: 100px;
    opacity: 0.05;
  }
}
