/* =============================================================================
   ELYSIUM DESIGN SYSTEM — BASE
   Reset, styles d'éléments par défaut, et utilitaires de mise en page.
   Dépend de tokens.css.
   ============================================================================= */

/* ---------------------------------------------------------------- 1. RESET */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--ely-font-body);
  font-size: var(--ely-text-md);
  line-height: var(--ely-leading-normal);
  color: var(--ely-text);
  background-color: var(--ely-bg);
  background-image: var(--ely-gradient-page);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { background: none; border: none; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

ul[class], ol[class] { list-style: none; padding: 0; }

/* ------------------------------------------------- 2. ÉLÉMENTS PAR DÉFAUT */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ely-font-heading);
  font-weight: var(--ely-weight-semibold);
  line-height: var(--ely-leading-tight);
  letter-spacing: var(--ely-tracking-tight);
  color: var(--ely-text);
  text-wrap: balance;
}

h1 { font-size: var(--ely-text-4xl); letter-spacing: var(--ely-tracking-tighter); }
h2 { font-size: var(--ely-text-3xl); letter-spacing: var(--ely-tracking-tighter); }
h3 { font-size: var(--ely-text-2xl); }
h4 { font-size: var(--ely-text-xl); }
h5 { font-size: var(--ely-text-lg); font-weight: var(--ely-weight-medium); }
h6 {
  font-size: var(--ely-text-sm);
  font-weight: var(--ely-weight-semibold);
  letter-spacing: var(--ely-tracking-wider);
  text-transform: uppercase;
  color: var(--ely-text-secondary);
}

p { text-wrap: pretty; }

a {
  color: var(--ely-text-accent);
  text-decoration: none;
  transition: color var(--ely-duration-fast) var(--ely-ease-out),
              text-shadow var(--ely-duration-fast) var(--ely-ease-out);
}

a:hover {
  color: var(--ely-cyan-200);
  text-shadow: var(--ely-glow-text-sm);
}

strong, b { font-weight: var(--ely-weight-semibold); color: var(--ely-white); }

code, kbd, samp, pre {
  font-family: var(--ely-font-mono);
  font-size: 0.9em;
}

code {
  padding: 0.15em 0.4em;
  border-radius: var(--ely-radius-xs);
  background: var(--ely-accent-soft);
  border: var(--ely-border-width) solid var(--ely-border-subtle);
  color: var(--ely-cyan-200);
}

hr {
  height: 1px;
  border: none;
  background: var(--ely-gradient-swoosh);
  opacity: 0.5;
}

::selection {
  background: rgba(56, 198, 255, 0.30);
  color: var(--ely-white);
}

/* ------------------------------------------------------- 3. ACCESSIBILITÉ */

/* Un seul anneau de focus pour tout le système. Ne jamais faire outline:none
   sans le remplacer. */
:focus-visible {
  outline: none;
  box-shadow: var(--ely-focus-ring);
  border-radius: var(--ely-radius-xs);
}

.ely-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ely-skip-link {
  position: absolute;
  top: var(--ely-space-2);
  left: var(--ely-space-2);
  z-index: var(--ely-z-toast);
  padding: var(--ely-space-3) var(--ely-space-5);
  border-radius: var(--ely-radius-sm);
  background: var(--ely-accent);
  color: var(--ely-text-on-accent);
  font-weight: var(--ely-weight-semibold);
  transform: translateY(-200%);
  transition: transform var(--ely-duration-fast) var(--ely-ease-out);
}
.ely-skip-link:focus { transform: translateY(0); }

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

/* ------------------------------------------------------- 4. BARRE DE SCROLL */

* { scrollbar-width: thin; scrollbar-color: var(--ely-navy-500) transparent; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--ely-navy-500);
  border-radius: var(--ely-radius-full);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ely-navy-400); background-clip: content-box; }

/* ============================================================================
   5. LAYOUT
   ============================================================================ */

.ely-container {
  width: 100%;
  max-width: var(--ely-container);
  margin-inline: auto;
  padding-inline: var(--ely-gutter);
}
.ely-container--wide  { max-width: var(--ely-container-wide); }
.ely-container--prose { max-width: var(--ely-container-prose); }

.ely-section {
  position: relative;
  padding-block: var(--ely-section-y);
}
.ely-section--tight { padding-block: var(--ely-section-y-tight); }

/* Grille auto-responsive : les colonnes se replient toutes seules. */
.ely-grid {
  display: grid;
  gap: var(--ely-space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.ely-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); }
.ely-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.ely-grid--tight { gap: var(--ely-space-4); }
.ely-grid--loose { gap: var(--ely-space-10); }

/* La grille à 4 colonnes descend en 2×2 puis en 1. En auto-fit pur elle passe
   par un 3+1 qui laisse un élément orphelin en largeur intermédiaire. */
@media (max-width: 900px) { .ely-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .ely-grid--4 { grid-template-columns: 1fr; } }

.ely-stack     { display: flex; flex-direction: column; gap: var(--ely-space-4); }
.ely-stack--sm { gap: var(--ely-space-2); }
.ely-stack--lg { gap: var(--ely-space-8); }

.ely-row {
  display: flex;
  align-items: center;
  gap: var(--ely-space-4);
  flex-wrap: wrap;
}
.ely-row--between { justify-content: space-between; }
.ely-row--center  { justify-content: center; }

/* ============================================================================
   6. TYPOGRAPHIE UTILITAIRE
   ============================================================================ */

/* Le sur-titre en petites capitales espacées — signature éditoriale du kit. */
.ely-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--ely-space-2);
  font-family: var(--ely-font-heading);
  font-size: var(--ely-text-xs);
  font-weight: var(--ely-weight-semibold);
  letter-spacing: var(--ely-tracking-widest);
  text-transform: uppercase;
  color: var(--ely-cyan-300);
}
.ely-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--ely-gradient-swoosh);
}

.ely-lead {
  font-size: var(--ely-text-lg);
  line-height: var(--ely-leading-relaxed);
  color: var(--ely-text-secondary);
  max-width: 60ch;
}

/* Le wordmark : script du logo. Court uniquement. */
.ely-wordmark {
  font-family: var(--ely-font-display);
  font-weight: var(--ely-weight-regular);
  line-height: 1.4;                    /* le script a de longues hampes */
  letter-spacing: var(--ely-tracking-normal);
  color: var(--ely-cyan-50);
  text-shadow: var(--ely-glow-text-md);
}

.ely-gradient-text {
  background: var(--ely-gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ely-text-muted     { color: var(--ely-text-muted); }
.ely-text-secondary { color: var(--ely-text-secondary); }
.ely-text-accent    { color: var(--ely-text-accent); }
.ely-text-center    { text-align: center; }

/* ============================================================================
   7. EFFETS SIGNATURE
   ============================================================================ */

.ely-glow-text    { text-shadow: var(--ely-glow-text-md); }
.ely-glow-text-lg { text-shadow: var(--ely-glow-text-lg); }
.ely-glow         { box-shadow: var(--ely-glow-md); }
.ely-glow-lg      { box-shadow: var(--ely-glow-lg); }

/* Surface vitrée — la texture de base de tous les conteneurs du kit. */
.ely-glass {
  background: var(--ely-surface-glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: var(--ely-border-width) solid var(--ely-border);
  border-radius: var(--ely-radius-lg);
}

/* Le trait lumineux du logo, en séparateur. */
.ely-swoosh {
  height: 1px;
  width: 100%;
  border: none;
  background: var(--ely-gradient-swoosh);
  opacity: 0.75;
}
.ely-swoosh--glow {
  height: 2px;
  filter: drop-shadow(0 0 6px rgba(56, 198, 255, 0.9));
}

/* Halo radial derrière un bloc. À poser sur un parent en position:relative. */
.ely-halo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
    ellipse 60% 55% at 50% 45%,
    rgba(29, 111, 224, 0.28) 0%,
    rgba(56, 198, 255, 0.10) 35%,
    transparent 70%
  );
}

/* Champ d'étoiles — les points scintillants du logo. */
.ely-starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px   at 28% 68%, rgba(180,234,255,0.70), transparent),
    radial-gradient(2px 2px   at 47% 12%, rgba(255,255,255,0.60), transparent),
    radial-gradient(1px 1px   at 63% 82%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1.5px 1.5px at 78% 34%, rgba(180,234,255,0.85), transparent),
    radial-gradient(1px 1px   at 88% 61%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px   at 36% 44%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1.5px 1.5px at 92% 15%, rgba(122,220,255,0.70), transparent);
  background-repeat: no-repeat;
  animation: ely-twinkle 5s var(--ely-ease-in-out) infinite;
}

@keyframes ely-twinkle {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* Bordure lumineuse au survol — utilisée par les cards interactives. */
.ely-hairline-top {
  position: relative;
}
.ely-hairline-top::before {
  content: "";
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: var(--ely-gradient-swoosh);
  opacity: 0;
  transition: opacity var(--ely-duration-normal) var(--ely-ease-out);
}
.ely-hairline-top:hover::before { opacity: 1; }
