/* ==========================================================================
   Skyloria — base : tokens, reset, typographie, mise en page, utilitaires
   Palette tirée du logo (or + bleu marine + bleu ciel) et des matériaux
   Minecraft (herbe, terre, pierre, redstone). Aucun néon.
   ========================================================================== */

/* ---------- Polices auto-hébergées (licence SIL OFL 1.1 : assets/fonts/OFL-*.txt) ----------
   « latin » couvre tout le français ; « latin-ext » n'est téléchargé que si un caractère en a besoin.
   Outfit et Pixelify Sans sont variables : un fichier par alphabet couvre toutes les graisses utilisées
   (Outfit 400 à 800, Pixelify Sans 400 à 700) ; Bungee n'a qu'une graisse. Les fichiers « latin » sont
   préchargés dans le <head> (outils/layout.py). La version de Google Fonts est dans le nom du fichier
   (outfit-v15…) : le navigateur peut les garder un an. */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/outfit-v15-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/outfit-v15-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Bungee";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/bungee-v17-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Bungee";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/bungee-v17-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/pixelify-sans-v3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/pixelify-sans-v3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  /* --- Fonds & surfaces (nuit au-dessus des îles) --- */
  --bg-0: #061229;
  --bg-1: #0a1a3a;
  --surface-1: #0f2348;
  --surface-2: #14305e;
  --surface-3: #1a3a70;
  --glass: rgba(15, 35, 72, 0.62);
  --glass-strong: rgba(10, 26, 58, 0.86);
  --line: rgba(143, 211, 255, 0.12);
  --line-strong: rgba(143, 211, 255, 0.22);

  /* --- Texte --- */
  --text-1: #f2f6ff;
  --text-2: #b9c6e0;
  --text-3: #8394b6;
  --ink-on-gold: #1d1400;

  /* --- Or du logo (rampe validée pour les raretés : 700 -> 300) --- */
  --gold-300: #ffe38d;
  --gold-400: #ffd447;
  --gold-500: #f4bf2b;
  --gold-600: #d8a00d;
  --gold-650: #b98408;
  --gold-700: #996a06;

  /* --- Ciel --- */
  --sky-200: #bfe6ff;
  --sky-300: #8fd3ff;
  --sky-400: #4fb8ff;
  --sky-500: #25a3f5;
  --sky-600: #1683d6;
  --sky-700: #0d5fa8;

  /* --- Bleu marine du contour du logo --- */
  --navy-600: #0b2f6b;
  --navy-700: #082357;
  --navy-800: #061a40;

  /* --- Matériaux Minecraft --- */
  --grass-400: #7ccf4f;
  --grass-500: #5cb83a;
  --grass-600: #3f8f27;
  --dirt-500: #8b5a2b;
  --dirt-600: #6b4423;
  --stone-400: #9aa0a8;
  --stone-500: #7a808a;
  --redstone-500: #e5484d;
  --amethyst-400: #b18cff;

  /* --- Statut (réservé : toujours avec icône + texte) --- */
  --status-good: var(--grass-500);
  --status-bad: var(--redstone-500);
  --status-wait: var(--gold-500);

  /* --- Typographie --- */
  --font-ui: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bungee", "Outfit", system-ui, sans-serif;
  --font-pixel: "Pixelify Sans", "Outfit", system-ui, sans-serif;

  --fs-xs: 0.78rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.2rem, 1.08rem + 0.5vw, 1.45rem);
  --fs-xl: clamp(1.5rem, 1.2rem + 1.4vw, 2.15rem);
  --fs-2xl: clamp(1.95rem, 1.4rem + 2.4vw, 3.1rem);
  --fs-3xl: clamp(2.3rem, 1.5rem + 3.8vw, 4.4rem);

  /* --- Espacements (base 4px) --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --gutter: clamp(16px, 4vw, 32px);
  --section-y: clamp(3.5rem, 2.5rem + 4.5vw, 6rem);
  --container: 1200px;

  /* --- Rayons : arrondis discrets, on reste "bloc" --- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* --- Ombres --- */
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px -18px rgba(0, 0, 0, 0.75);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --shadow-gold: 0 14px 34px -14px rgba(244, 191, 43, 0.55);

  /* --- Mouvement : court et fluide --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 150ms;
  --dur-2: 260ms;
  --dur-3: 420ms;
  --dur-4: 700ms;

  /* --- Plans --- */
  --z-header: 50;
  --z-menu: 45;
  --z-toast: 80;
  --z-tooltip: 90;

  --header-h: 72px;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  hanging-punctuation: first last;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-1);
  background-color: var(--bg-0);
  background-image:
    radial-gradient(1100px 520px at 50% -8%, rgba(37, 163, 245, 0.16), transparent 62%),
    linear-gradient(180deg, var(--bg-0) 0%, #071735 48%, var(--bg-0) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Ciel étoilé en pixels, très discret, fixé derrière tout le site */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' shape-rendering='crispEdges'%3E%3Cg fill='%23bfe6ff'%3E%3Crect x='12' y='30' width='2' height='2' opacity='.5'/%3E%3Crect x='88' y='14' width='2' height='2' opacity='.3'/%3E%3Crect x='150' y='60' width='3' height='3' opacity='.35'/%3E%3Crect x='210' y='22' width='2' height='2' opacity='.45'/%3E%3Crect x='40' y='120' width='2' height='2' opacity='.25'/%3E%3Crect x='120' y='150' width='2' height='2' opacity='.4'/%3E%3Crect x='196' y='132' width='2' height='2' opacity='.3'/%3E%3Crect x='66' y='206' width='3' height='3' opacity='.3'/%3E%3Crect x='176' y='214' width='2' height='2' opacity='.45'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 55%, transparent 100%);
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Spécificité nulle : le padding d'une classe de composant (.nav__list…) doit toujours l'emporter. */
:where(ul[role="list"], ol[role="list"]) {
  list-style: none;
  padding: 0;
}

table {
  border-collapse: collapse;
}

::selection {
  background: var(--gold-400);
  color: var(--ink-on-gold);
}

:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* Barre de défilement discrète */
html {
  scrollbar-color: var(--surface-3) var(--bg-0);
  scrollbar-width: thin;
}

/* ---------- Typographie ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-transform: uppercase;
}

/* Relief "bloc" façon logo : extrusion bleu marine */
.extrude {
  text-shadow:
    0 2px 0 var(--navy-700),
    0 4px 0 var(--navy-800),
    0 12px 24px rgba(0, 0, 0, 0.45);
}

.pixel {
  font-family: var(--font-pixel);
  letter-spacing: 0.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-pixel);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky-300);
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--gold-400);
  box-shadow: 0 0 0 2px rgba(255, 212, 71, 0.18);
  transform: rotate(45deg);
}

.text-gold {
  color: var(--gold-400);
}

.text-muted {
  color: var(--text-3);
}

.lead {
  font-size: var(--fs-md);
  color: var(--text-2);
  max-width: 62ch;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ---------- Mise en page ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(860px + 2 * var(--gutter));
}

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

.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.section-head {
  display: grid;
  gap: var(--space-3);
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem);
}

.section-head--center {
  justify-items: center;
  text-align: center;
}

.section-head--center .lead {
  margin-inline: auto;
}

.section-title {
  font-size: var(--fs-2xl);
}

.stack {
  display: grid;
  gap: var(--stack-gap, var(--space-4));
}

/* Grilles à une colonne : la colonne ne doit jamais grandir avec la taille native
   d'une image (sinon débordement horizontal sur mobile). */
.stack,
.section-head,
.hero__inner,
.page-hero__inner,
.footer-brand,
.event-card,
.voteparty,
.player-card,
.viz,
.faq,
.stack-chart,
.bars,
.mobile-menu,
.mobile-menu__list,
.staff-card__body {
  grid-template-columns: minmax(0, 1fr);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-3));
}

/* Grille "plan de construction" : rappel des blocs, masquée en radial */
.blueprint {
  position: relative;
  isolation: isolate;
}

.blueprint::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(143, 211, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 211, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

/* ---------- Utilitaires ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-sm);
  background: var(--gold-400);
  color: var(--ink-on-gold);
  font-weight: 700;
  transition: top var(--dur-2) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
}

[hidden] {
  display: none !important;
}

/* ---------- Apparition au défilement ----------
   translate/scale (propriétés individuelles) plutôt que transform :
   elles se combinent avec les effets de survol et l'inclinaison 3D. */
.js [data-reveal] {
  opacity: 0;
  translate: 0 22px;
  scale: 0.985;
  transition:
    opacity var(--dur-4) var(--ease-out),
    translate var(--dur-4) var(--ease-out),
    scale var(--dur-4) var(--ease-out),
    transform var(--dur-3) var(--ease-out),
    border-color var(--dur-3) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 70ms), calc(var(--reveal-i, 0) * 70ms), calc(var(--reveal-i, 0) * 70ms), 0s, 0s, 0s, 0s;
}

.js [data-reveal="left"] {
  translate: -26px 0;
  scale: none;
}

.js [data-reveal="right"] {
  translate: 26px 0;
  scale: none;
}

.js [data-reveal="zoom"] {
  translate: none;
  scale: 0.94;
}

.js [data-reveal].is-visible {
  opacity: 1;
  translate: none;
  scale: none;
}

/* Filet de sécurité : si le JavaScript ne démarre pas (fichier bloqué, erreur…), les blocs apparaissent
   d'eux-mêmes au bout de 2,5 s. main.js pose .reveal-ready dès que l'apparition au défilement est en place
   (et boot.js retire .js si le module principal ne se charge pas du tout). */
.js:not(.reveal-ready) [data-reveal] {
  animation: reveal-safety var(--dur-4) var(--ease-out) 2.5s forwards;
}

@keyframes reveal-safety {
  to {
    opacity: 1;
    translate: none;
    scale: none;
  }
}

/* ---------- Transitions entre pages (navigateurs compatibles) ---------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vt-out 180ms var(--ease-in-out) both;
}

::view-transition-new(root) {
  animation: vt-in 380ms var(--ease-out) both;
}

::view-transition-group(site-header) {
  animation: none;
}

@keyframes vt-out {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

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

  .js [data-reveal] {
    opacity: 1;
    translate: none;
    scale: none;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}
