/* =========================================================================
   AEGIS — Design system
   Sobre, inspiré d'Apple. Thème clair, grande typographie, animations fluides.
   ========================================================================= */

/* ----------------------------------------------------------------- Tokens */
:root {
  /* Surfaces */
  --bg: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-dark: #0a0a12;

  /* Texte */
  --text: #1d1d1f;
  --text-secondary: #515154;
  --text-tertiary: #86868b;
  --text-on-dark: #f5f5f7;
  --text-on-dark-soft: #a1a1aa;

  /* Accent (blurple Discord, sobrement employé) */
  --accent: #5865f2;
  --accent-strong: #4752c4;
  --accent-soft: rgba(88, 101, 242, 0.10);
  --accent-glow: rgba(88, 101, 242, 0.35);

  /* Accents secondaires pour les pictos */
  --c-green: #22c55e;
  --c-amber: #f59e0b;
  --c-red: #ef4444;
  --c-pink: #ec4899;
  --c-cyan: #06b6d4;
  --c-violet: #8b5cf6;

  /* Bordures */
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --border-on-dark: rgba(255, 255, 255, 0.10);

  /* Rayons */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.12);
  --shadow-accent: 0 18px 50px -12px var(--accent-glow);

  /* Typo */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;

  /* Layout */
  --container: 1120px;
  --container-wide: 1280px;
  --nav-h: 56px;

  /* Easing */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.06;
}

p { margin: 0; }

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

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

button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--accent-strong); }

/* ------------------------------------------------------------- Utilities */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}
.container.wide { max-width: var(--container-wide); }

.section { padding-block: clamp(72px, 11vw, 150px); }
.section-sm { padding-block: clamp(48px, 7vw, 90px); }

.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  letter-spacing: -0.035em;
}

.section-lead {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin-top: 20px;
  line-height: 1.5;
}

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

.text-gradient {
  background: linear-gradient(120deg, var(--accent) 0%, var(--c-violet) 60%, var(--c-pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----------------------------------------------------------------- Buttons */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 50px;
  padding-inline: 26px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 1rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    background 0.3s var(--ease-soft), opacity 0.3s;
  will-change: transform;
}
.btn svg { width: 19px; height: 19px; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 22px 55px -10px var(--accent-glow); }

.btn-secondary {
  --btn-bg: var(--bg-subtle);
  --btn-fg: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { --btn-bg: #ececef; }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
}
.btn-ghost:hover { --btn-bg: var(--bg-subtle); }

.btn-light {
  --btn-bg: #fff;
  --btn-fg: #0a0a12;
}
.btn-light:hover { --btn-bg: #fff; }

.btn-sm { height: 42px; padding-inline: 20px; font-size: 0.94rem; }
.btn-lg { height: 56px; padding-inline: 32px; font-size: 1.06rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 540;
  transition: gap 0.3s var(--ease);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.link-arrow:hover { gap: 10px; }
.link-arrow:hover svg { transform: translateX(2px); }

/* ----------------------------------------------------------------- Navbar */
.nav {
  position: fixed;
  top: var(--banner-h, 0px);
  left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease-soft), background 0.4s var(--ease-soft), top 0.45s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav__inner {
  position: relative;
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 620;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}
.brand .brand__mark { width: 26px; height: 26px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  /* Menus centrés dans la barre, indépendamment du logo et du bouton */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav__links a {
  padding: 7px 13px;
  border-radius: var(--r-pill);
  font-size: 0.92rem;
  font-weight: 480;
  color: var(--text-secondary);
  transition: color 0.25s, background 0.25s;
}
.nav__links a:hover { color: var(--text); background: var(--bg-subtle); }
.nav__links a.active { color: var(--text); font-weight: 540; }

.nav__cta { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.nav__toggle {
  display: none;
  margin-left: auto;
  width: 42px; height: 42px;
  border: none; background: transparent;
  border-radius: var(--r-sm);
  position: relative;
}
.nav__toggle span {
  position: absolute; left: 11px; right: 11px; height: 1.6px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
.nav__toggle span:nth-child(1) { top: 16px; }
.nav__toggle span:nth-child(2) { top: 24px; }
.nav__toggle span:nth-child(3) { top: 24px; }
.nav__toggle span:nth-child(4) { top: 32px; }
body.menu-open .nav__toggle span:nth-child(1),
body.menu-open .nav__toggle span:nth-child(4) { opacity: 0; }
body.menu-open .nav__toggle span:nth-child(2) { transform: rotate(45deg); }
body.menu-open .nav__toggle span:nth-child(3) { transform: rotate(-45deg); }

/* Menu mobile */
.nav__mobile {
  position: fixed;
  inset: calc(var(--banner-h, 0px) + var(--nav-h)) 0 0 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
body.menu-open .nav__mobile { opacity: 1; transform: none; pointer-events: auto; }
.nav__mobile a {
  padding: 16px 8px;
  font-size: 1.5rem;
  font-weight: 580;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
}
.nav__mobile .btn { margin-top: 18px; align-self: flex-start; }

/* ----------------------------------------------------------------- Footer */
.footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding-block: 64px 40px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.8fr repeat(2, 1fr);
  gap: 40px;
}
.footer__brand .brand { font-size: 1.15rem; margin-bottom: 14px; }
.footer__brand p { max-width: 280px; line-height: 1.55; }
.footer__col h4 {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}
.footer__col a {
  display: block;
  padding: 6px 0;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------- Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal-scale.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal-scale { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------------- Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding-inline: 11px;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 560;
  letter-spacing: 0;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge--all { background: rgba(34, 197, 94, 0.10); color: #15803d; border-color: rgba(34, 197, 94, 0.2); }
.badge--staff { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.22); }
.badge--admin { background: rgba(239, 68, 68, 0.10); color: #b91c1c; border-color: rgba(239, 68, 68, 0.2); }
.badge--manage { background: var(--accent-soft); color: var(--accent-strong); border-color: rgba(88, 101, 242, 0.2); }

/* --------------------------------------------------------- Code & copy block */
.code {
  position: relative;
  background: #0d1117;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.code__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.code__dot { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.code__dot:nth-child(2) { background: #febc2e; }
.code__dot:nth-child(3) { background: #28c840; }
.code__title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #8b949e;
}
.code__copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding-inline: 11px;
  border-radius: var(--r-xs);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #c9d1d9;
  font-size: 0.78rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.code__copy svg { width: 14px; height: 14px; }
.code__copy:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.code__copy.copied { color: #3fb950; border-color: rgba(63, 185, 80, 0.4); }
.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  color: #e6edf3;
  tab-size: 2;
}
.code pre .c-com { color: #8b949e; }
.code pre .c-cmd { color: #7ee787; }
.code pre .c-flag { color: #79c0ff; }
.code pre .c-str { color: #a5d6ff; }

/* ----------------------------------------------------------------- Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s;
}

/* ----------------------------------------------------------- Page header */
.page-head {
  padding-top: calc(var(--nav-h) + 80px);
  padding-bottom: 40px;
  text-align: center;
}
.page-head h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  letter-spacing: -0.04em;
}
.page-head .section-lead { margin-inline: auto; }

/* --------------------------------------------------------- Bandeau CTA (partagé) */
.cta-band {
  position: relative;
  border-radius: var(--r-xl);
  padding: clamp(48px, 8vw, 96px) 40px;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(120% 140% at 50% 0%, #1c1d4d 0%, #0a0a12 60%);
  color: #fff;
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(88,101,242,0.5), transparent 45%),
    radial-gradient(circle at 80% 60%, rgba(236,72,153,0.35), transparent 45%);
  opacity: 0.8;
}
.cta-band > * { position: relative; }
.cta-band h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -0.04em; }
.cta-band p { color: #c7c9e8; font-size: clamp(1.05rem, 2vw, 1.3rem); margin: 20px auto 36px; max-width: 540px; }
.cta-band__btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
/* Bouton fantôme sur fond sombre : reste lisible au survol (texte blanc conservé). */
.cta-band .btn-ghost { --btn-fg: #fff; border-color: rgba(255, 255, 255, 0.22); }
.cta-band .btn-ghost:hover { --btn-bg: rgba(255, 255, 255, 0.14); --btn-fg: #fff; }

/* --------------------------------------------------- Bandeau de langue (Apple-like) */
body { padding-top: var(--banner-h, 0px); transition: padding-top 0.45s var(--ease); }

.locale-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 110;
  background: #f5f5f7;
  border-bottom: 1px solid var(--border);
  transform: translateY(-101%);
  transition: transform 0.45s var(--ease);
}
.locale-bar.in { transform: none; }
.locale-bar__inner {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.locale-bar__text { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--text-secondary); }
.locale-bar__text svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.locale-bar__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.locale-bar__select {
  position: relative; display: flex; align-items: center;
  height: 40px; padding: 0 34px 0 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm);
}
.locale-bar__check { color: var(--accent); margin-right: 8px; font-size: 0.82rem; }
.locale-bar__select select {
  appearance: none; -webkit-appearance: none;
  border: none; background: transparent; outline: none; cursor: pointer;
  font-family: inherit; font-size: 0.95rem; font-weight: 500; color: var(--text);
}
.locale-bar__chev { position: absolute; right: 11px; width: 16px; height: 16px; color: var(--text-tertiary); pointer-events: none; }
.locale-bar__cont {
  height: 40px; padding-inline: 22px; border: none; border-radius: var(--r-pill);
  background: #1d1d1f; color: #fff; font-weight: 500; font-size: 0.92rem;
  transition: background 0.2s;
}
.locale-bar__cont:hover { background: #000; }
.locale-bar__close {
  width: 34px; height: 34px; border: none; background: transparent;
  color: var(--text-tertiary); border-radius: 50%; font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.locale-bar__close:hover { background: rgba(0,0,0,0.06); color: var(--text); }

@media (max-width: 620px) {
  .locale-bar__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .locale-bar__actions { width: 100%; }
  .locale-bar__select { flex: 1; }
}

/* --------------------------------------------------- Sélecteur de langue (nav) */
.lang-switch { position: relative; }
.lang-switch__btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding-inline: 12px;
  border: 1px solid var(--border); background: #fff;
  border-radius: var(--r-pill); color: var(--text-secondary);
  font-size: 0.84rem; font-weight: 560;
  transition: color 0.2s, border-color 0.2s;
}
.lang-switch__btn svg { width: 16px; height: 16px; }
.lang-switch__btn:hover { color: var(--text); border-color: var(--border-strong); }
.lang-switch__menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 180px; padding: 6px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top right;
  pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.lang-switch.open .lang-switch__menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-switch__item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; padding: 9px 12px; border: none; background: transparent;
  border-radius: var(--r-sm); font-size: 0.92rem; color: var(--text); font-weight: 480;
  transition: background 0.15s;
}
.lang-switch__item:hover { background: var(--bg-subtle); }
.lang-switch__item.current { color: var(--accent); font-weight: 560; }
.lang-switch__code { color: var(--text-tertiary); font-size: 0.76rem; font-family: var(--font-mono); }
.lang-switch__item.current .lang-switch__code { color: var(--accent); }

.lang-switch-mobile { display: flex; gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.lang-switch-mobile__item {
  flex: 1; height: 50px; border: 1px solid var(--border); background: #fff;
  border-radius: var(--r-md); font-size: 1rem; font-weight: 540; color: var(--text-secondary);
}
.lang-switch-mobile__item.current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* --------------------------------------------------------------- Helpers */
.dark { background: var(--bg-dark); color: var(--text-on-dark); }
.dark .section-lead { color: var(--text-on-dark-soft); }
.dark .eyebrow { color: #8b95ff; }

.grid { display: grid; gap: 20px; }

@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: block; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .footer__grid { grid-template-columns: 1fr; }
}
