/* ===================================================================
   Justice4U — Liquid Glass + Gothic Couture
   Feuille partagée : tokens, primitives verre, typographie gothique,
   navigation, boutons, footer, arrière-plan ambiant, ornements.
   =================================================================== */

:root {
  /* Palette — deep forest + electric mint + ionised cyan */
  --ink-0: #05100b;
  --ink-1: #081a11;
  --ink-2: #0b2418;
  --ink-3: #0f3122;
  --mint: #00ffa3;
  --mint-soft: #6effc7;
  --cyan: #4cc9ff;
  --cyan-soft: #a2e4ff;
  --gold: #e9c46a;
  --rose: #ff6b85;
  --white: #f4fff9;
  --muted: #7f9a8d;
  --muted-2: #4e6b5e;
  --line: rgba(180, 255, 220, 0.10);
  --line-strong: rgba(180, 255, 220, 0.20);

  /* Liquid Glass — tokens empilables */
  --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 50%, rgba(0,255,163,0.04) 100%);
  --glass-bg-strong: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 50%, rgba(0,255,163,0.07) 100%);
  --glass-border: rgba(255,255,255,0.14);
  --glass-border-lit: rgba(0,255,163,0.35);
  --glass-inner-light: inset 0 1px 0 rgba(255,255,255,0.14), inset 0 -1px 0 rgba(0,0,0,0.35);
  --glass-shadow: 0 10px 40px -12px rgba(0,0,0,0.6), 0 30px 80px -30px rgba(0,255,163,0.12);

  /* Typographie */
  --font-display: 'Fraunces', 'Playfair Display', serif;
  --font-body: 'Inter Tight', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'DM Mono', monospace;
  --font-gothic: 'UnifrakturCook', 'UnifrakturMaguntia', 'MedievalSharp', cursive;

  /* Motion */
  --ease-out-cubic: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
}

[data-theme="light"] {
  --ink-0: #f2f7f3;
  --ink-1: #eaf3ec;
  --ink-2: #dfece2;
  --ink-3: #d2e4d6;
  --mint: #0a7c4a;
  --mint-soft: #0fa968;
  --cyan: #0469a8;
  --cyan-soft: #2c8fc8;
  --gold: #9b7513;
  --rose: #c8284f;
  --white: #0a1a10;
  --muted: #516b5e;
  --muted-2: #7f9a8d;
  --line: rgba(10, 50, 30, 0.10);
  --line-strong: rgba(10, 50, 30, 0.20);
  --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.35) 50%, rgba(10,124,74,0.08) 100%);
  --glass-bg-strong: linear-gradient(135deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.45) 50%, rgba(10,124,74,0.12) 100%);
  --glass-border: rgba(10, 50, 30, 0.14);
  --glass-border-lit: rgba(10, 124, 74, 0.4);
  --glass-inner-light: inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -1px 0 rgba(0,0,0,0.04);
  --glass-shadow: 0 10px 40px -12px rgba(20,60,40,0.15), 0 30px 80px -30px rgba(10,124,74,0.18);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink-0);
  color: var(--white);
  font-family: var(--font-body);
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  transition: background 0.6s var(--ease-out-cubic), color 0.6s var(--ease-out-cubic);
}

/* ========== Arrière-plan ambiant — plan de verre liquide animé ========== */
.ambient {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient::before,
.ambient::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.6;
  will-change: transform;
}
.ambient::before {
  width: 60vmax; height: 60vmax;
  top: -20vmax; left: -10vmax;
  background: radial-gradient(circle, var(--mint) 0%, transparent 60%);
  animation: drift1 24s var(--ease-in-out-quart) infinite alternate;
}
.ambient::after {
  width: 50vmax; height: 50vmax;
  bottom: -15vmax; right: -10vmax;
  background: radial-gradient(circle, var(--cyan) 0%, transparent 60%);
  animation: drift2 32s var(--ease-in-out-quart) infinite alternate;
  opacity: 0.35;
}
.ambient-grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
  opacity: 0.4;
}
[data-theme="light"] .ambient::before { opacity: 0.32; }
[data-theme="light"] .ambient::after { opacity: 0.22; }
[data-theme="light"] .ambient-grain { background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.05) 1px, transparent 0); }

@keyframes drift1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(10vmax, 6vmax) scale(1.2); }
}
@keyframes drift2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-8vmax, -4vmax) scale(1.15); }
}

/* ========== Primitives de verre liquide ========== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inner-light), var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inner-light), var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
/* Lumière d'arête — signature verre liquide */
.glass::before,
.glass-strong::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.45), transparent 30%, transparent 70%, rgba(0,255,163,0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
/* Éclat spéculaire coulissant */
.glass-sheen::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 50%; height: 200%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  transform: rotate(15deg);
  transition: left 0.9s var(--ease-out-cubic);
  pointer-events: none;
}
.glass-sheen:hover::after { left: 120%; }

/* ========== Typographie ========== */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 0.92;
}
.gothic {
  font-family: var(--font-gothic);
  font-weight: 400;
  letter-spacing: 0;
}
.mono { font-family: var(--font-mono); }

/* Lettrine — grande initiale gothique */
.dropcap::first-letter {
  font-family: var(--font-gothic);
  float: left;
  font-size: 5.5em;
  line-height: 0.78;
  padding: 0.05em 0.1em 0 0;
  color: var(--mint);
  text-shadow: 0 0 30px rgba(0, 255, 163, 0.3);
}

/* Sur-titre / eyebrow */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mint);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: '';
  width: 28px; height: 1px;
  background: currentColor;
}

/* Ornement inter-sections */
.ornament {
  text-align: center;
  padding: 24px 0;
  color: var(--mint);
  opacity: 0.3;
  font-size: 14px;
  letter-spacing: 20px;
  user-select: none;
  font-family: var(--font-gothic);
}

/* ========== Boutons ========== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-cubic);
  position: relative;
  overflow: hidden;
  border-radius: 999px;
}
.btn-primary {
  background: var(--mint);
  color: var(--ink-0);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 8px 24px -6px rgba(0,255,163,0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 12px 32px -6px rgba(0,255,163,0.7); }
.btn-ghost {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  color: var(--white);
}
.btn-ghost:hover { border-color: var(--glass-border-lit); transform: translateY(-2px); }

/* ========== Navigation ========== */
.nav {
  position: fixed; top: 16px; left: 16px; right: 16px; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px;
  border-radius: 999px;
  gap: 14px;
}
.nav-logo {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--white);
  text-decoration: none;
  display: flex; align-items: baseline; gap: 2px;
  flex-shrink: 0;
}
.nav-logo .g {
  font-family: var(--font-gothic);
  font-style: normal;
  color: var(--mint);
  font-size: 1.35em;
  line-height: 1;
}
.nav-links { display: flex; gap: 8px; list-style: none; align-items: center; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.nav-links .cta,
.nav-overlay-links .cta {
  background: var(--mint);
  color: var(--ink-0);
  font-weight: 500;
}
.nav-links .cta:hover,
.nav-overlay-links .cta:hover { background: var(--mint-soft); color: var(--ink-0); }

/* Zone droite de la nav — contient theme toggle + burger */
.nav-end {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

/* Bascule de thème */
.theme-toggle {
  width: 44px; height: 32px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
  flex-shrink: 0;
}
.theme-toggle::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--mint);
  transition: transform 0.3s var(--ease-out-cubic);
  box-shadow: 0 0 12px rgba(0,255,163,0.5);
}
[data-theme="light"] .theme-toggle::before { transform: translateX(12px); background: var(--gold); box-shadow: 0 0 12px rgba(233,196,106,0.4); }

/* Bouton hamburger — visible uniquement sur mobile */
.nav-burger {
  display: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  width: 40px; height: 40px;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.nav-burger:hover { border-color: var(--glass-border-lit); }
.nav-burger span {
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 1.6px;
  background: var(--white);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform 0.35s var(--ease-out-cubic), opacity 0.25s;
}
.nav-burger span:nth-child(1) { transform: translate(-50%, calc(-50% - 6px)); }
.nav-burger span:nth-child(3) { transform: translate(-50%, calc(-50% + 6px)); }
.nav-burger.is-open span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translate(-50%, -50%) rotate(-45deg); }

/* Overlay de navigation mobile — plein écran en verre liquide */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: linear-gradient(180deg, rgba(5,16,11,0.85), rgba(5,16,11,0.95));
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 120px 32px 60px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out-cubic);
}
[data-theme="light"] .nav-overlay {
  background: linear-gradient(180deg, rgba(242,247,243,0.88), rgba(242,247,243,0.96));
}
.nav-overlay.is-open { opacity: 1; pointer-events: auto; }
.nav-overlay-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  width: 100%;
  max-width: 360px;
}
.nav-overlay-links li { width: 100%; }
.nav-overlay-links a {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 30px;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.015em;
  padding: 14px 20px;
  border-radius: 16px;
  transition: color 0.2s, background 0.2s;
  transform: translateY(16px);
  opacity: 0;
}
.nav-overlay.is-open .nav-overlay-links a {
  animation: overlayLinkIn 0.5s var(--ease-out-cubic) forwards;
}
.nav-overlay.is-open .nav-overlay-links li:nth-child(1) a { animation-delay: 0.08s; }
.nav-overlay.is-open .nav-overlay-links li:nth-child(2) a { animation-delay: 0.14s; }
.nav-overlay.is-open .nav-overlay-links li:nth-child(3) a { animation-delay: 0.20s; }
.nav-overlay.is-open .nav-overlay-links li:nth-child(4) a { animation-delay: 0.26s; }
.nav-overlay.is-open .nav-overlay-links li:nth-child(5) a { animation-delay: 0.32s; }
.nav-overlay.is-open .nav-overlay-links li:nth-child(6) a { animation-delay: 0.38s; }
.nav-overlay.is-open .nav-overlay-links li:nth-child(7) a { animation-delay: 0.44s; }
@keyframes overlayLinkIn { to { transform: translateY(0); opacity: 1; } }
.nav-overlay-links a:hover { color: var(--mint); background: rgba(0,255,163,0.06); }
.nav-overlay-links .cta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-style: normal;
  padding: 16px 24px;
  border-radius: 999px;
  margin-top: 16px;
}
body.nav-locked { overflow: hidden; }

/* Utilitaires */
.container { max-width: 1280px; margin: 0 auto; padding: 0 40px; position: relative; z-index: 1; }
.section { padding: 120px 0; position: relative; z-index: 1; }

/* ========== Footer ========== */
footer {
  padding: 60px 40px 40px;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px;
}
.footer-logo { font-family: var(--font-display); font-style: italic; font-size: 20px; color: var(--mint); }
.footer-logo .g { font-family: var(--font-gothic); font-style: normal; font-size: 1.3em; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }
.footer-copy { color: var(--muted-2); font-family: var(--font-mono); font-size: 11px; }

/* Barre de défilement */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,255,163,0.15); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,163,0.3); }

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Mobile — navigation, conteneur, sections */
@media (max-width: 900px) {
  .nav { padding: 8px 8px 8px 20px; top: 10px; left: 10px; right: 10px; }
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav-overlay { display: flex; }
  .nav-logo { font-size: 19px; }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .section { padding: 72px 0; }
  .nav-end { gap: 6px; }
}

@media (max-width: 420px) {
  .nav { padding: 6px 6px 6px 16px; }
  .nav-logo { font-size: 17px; }
  .theme-toggle { width: 40px; height: 28px; }
  .theme-toggle::before { width: 22px; height: 22px; top: 2px; left: 2px; }
  [data-theme="light"] .theme-toggle::before { transform: translateX(12px); }
}