/* ═══════════════════════════════════════════════════════════
   OLORINS CODEX — Feuille de style partagée
   Univers Guild Wars 2 · Esthétique Éther & Magie
   v2 — Responsive · Min font 12px · Optimisé
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@400;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Rajdhani:wght@300;400;500&display=swap');

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

/* ══ Variables ════════════════════════════════════════════ */
:root {
  /* Palette Éther */
  --bg:         #07050f;
  --bg2:        #0c0818;
  --surface:    #110d20;
  --surface2:   #16112a;
  --surface3:   #1d1735;

  --gold:       #d4a843;
  --gold2:      #f0cc7a;
  --gold-dim:   #8a6a20;
  --violet:     #7c4fd4;
  --violet2:    #a67ee8;
  --violet-dim: #3d2568;
  --teal:       #3ecfcf;
  --teal2:      #7de8e8;
  --rose:       #e05080;
  --green:      #5dd47a;

  --text:       #e8dff5;
  --text-dim:   #6a5a8a;
  --text-mid:   #a898c8;

  --border:     rgba(212,168,67,0.18);
  --border-v:   rgba(124,79,212,0.25);
  --border-t:   rgba(62,207,207,0.2);

  --glow-gold:   0 0 28px rgba(212,168,67,0.35);
  --glow-violet: 0 0 28px rgba(124,79,212,0.4);
  --glow-teal:   0 0 28px rgba(62,207,207,0.35);

  --nav-h:   64px;
  --panel-t: 0.55s cubic-bezier(0.77,0,0.175,1);

  /* Échelle typographique — min 12px */
  --fs-xs:   14px;
  --fs-sm:   15px;
  --fs-base: 17px;
  --fs-md:   19px;
  --fs-lg:   22px;
  --fs-xl:   clamp(20px, 2.5vw, 28px);
  --fs-2xl:  clamp(24px, 3.5vw, 40px);
  --fs-3xl:  clamp(30px, 5vw, 60px);

  /* Rune pattern */
  --rune-bg: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%237c4fd4' stroke-width='0.4' opacity='0.18'%3E%3Ccircle cx='30' cy='30' r='28'/%3E%3Cpolygon points='30,4 55,20 55,40 30,56 5,40 5,20'/%3E%3Cline x1='30' y1='4' x2='30' y2='56'/%3E%3Cline x1='5' y1='20' x2='55' y2='40'/%3E%3Cline x1='5' y1='40' x2='55' y2='20'/%3E%3C/g%3E%3C/svg%3E");
}

/* ══ Base ═════════════════════════════════════════════════ */
html {
  /* Safari iOS < 15 : hauteur réelle sans barre d'adresse */
  height: -webkit-fill-available;
  height: 100%;
}

body {
  width: 100%;
  /* Cascade dvh : vh (universel) → svh (stable, barre visible) → dvh (dynamique) */
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Rune overlay */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background-image: var(--rune-bg);
  background-size: 60px 60px;
  opacity: 0.4;
}
/* Grain */
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.28;
}

/* ══ Navigation ══════════════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 clamp(16px, 4vw, 48px);
  gap: clamp(8px, 2vw, 24px);
  background: linear-gradient(to bottom, rgba(7,5,15,0.98), rgba(7,5,15,0.8));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
nav::after {
  content: '';
  position: absolute; bottom: 0; left: clamp(16px, 4vw, 48px); right: clamp(16px, 4vw, 48px); height: 1px;
  background: linear-gradient(90deg, transparent, var(--violet), var(--gold), var(--violet), transparent);
  opacity: 0.5;
}

.nav-logo {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 700; letter-spacing: 0.08em;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212,168,67,0.6), 0 0 40px rgba(212,168,67,0.2);
  margin-right: auto; text-decoration: none;
  white-space: nowrap;
}
.nav-logo span { color: var(--violet2); }

.nav-links {
  display: flex; gap: 2px; align-items: center;
  /* Menu hamburger mobile géré par JS/toggle */
}

.nav-link {
  padding: clamp(6px,1vw,9px) clamp(10px,1.5vw,20px);
  font-family: 'Cinzel', serif; font-size: var(--fs-xs);
  font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); cursor: pointer;
  border: 1px solid transparent; border-radius: 2px;
  transition: all 0.25s; text-decoration: none;
  position: relative; white-space: nowrap;
}
.nav-link::before {
  content: ''; position: absolute; bottom: -1px; left: 25%; right: 25%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity 0.25s;
}
.nav-link:hover  { color: var(--text-mid); border-color: var(--border); }
.nav-link.active { color: var(--gold); border-color: var(--border); }
.nav-link.active::before { opacity: 1; }

/* Nav mobile — burger */
.nav-burger {
  display: none;
  background: none; border: 1px solid var(--border-v);
  color: var(--text-dim); padding: 6px 10px;
  font-size: var(--fs-md); cursor: pointer; transition: all 0.2s;
  flex-shrink: 0;
}
.nav-burger:hover { border-color: var(--gold); color: var(--gold); }

/* Overlay menu mobile */
.nav-mobile-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 199;
  background: rgba(7,5,15,0.97); backdrop-filter: blur(12px);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding-top: var(--nav-h);
}
.nav-mobile-overlay.open { display: flex; }
.nav-mobile-overlay .nav-link {
  font-size: var(--fs-sm); padding: 14px 32px; width: 80%;
  text-align: center; border-color: var(--border-v);
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; align-items: center; }
}

/* ══ Page header ══════════════════════════════════════════ */
.page-header {
  padding: clamp(36px, 5vw, 52px) clamp(20px, 5vw, 64px) clamp(24px, 3vw, 36px);
  position: relative;
  background: linear-gradient(to bottom, rgba(12,8,24,0.9), transparent);
}
.page-header::after {
  content: '';
  position: absolute; bottom: 0;
  left: clamp(20px, 5vw, 64px); right: clamp(20px, 5vw, 64px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.page-eyebrow {
  font-family: 'Cinzel', serif; font-size: var(--fs-xs); letter-spacing: 0.3em;
  color: var(--violet2); text-transform: uppercase; margin-bottom: 10px; opacity: 0.8;
}
.page-title {
  font-family: 'Cinzel', serif; font-size: var(--fs-2xl);
  font-weight: 700; color: var(--gold);
  text-shadow: 0 0 30px rgba(212,168,67,0.3);
  margin-bottom: 12px; line-height: 1.15;
}
.page-intro {
  font-family: 'Cormorant Garamond', serif; font-size: var(--fs-md);
  font-weight: 300; font-style: italic;
  color: var(--text-mid); max-width: 640px; line-height: 1.8;
}

/* ══ Utilities ════════════════════════════════════════════ */
.divider {
  width: 100%; height: 1px; margin: 32px 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.divider-gold {
  width: 100%; height: 1px; margin: 32px 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.3;
}

/* Tag générique */
.tag {
  display: inline-block; padding: 2px 10px;
  font-family: 'Cinzel', serif; font-size: var(--fs-xs); letter-spacing: 0.07em;
  color: var(--text-dim); border: 1px solid var(--border-v);
}

/* ══ Scrollbar ════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--violet-dim); border-radius: 3px; }

/* ══ Animations ═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes etherPulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}
@keyframes runeRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ══ Shared card ══════════════════════════════════════════ */
.ether-card {
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative; overflow: hidden;
  transition: all 0.35s;
}
.ether-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity 0.35s;
}
.ether-card:hover {
  border-color: rgba(212,168,67,0.4);
  box-shadow: var(--glow-gold), inset 0 0 40px rgba(124,79,212,0.06);
  transform: translateY(-4px);
}
.ether-card:hover::before { opacity: 1; }

/* ══ Profession colors ════════════════════════════════════ */
.prof-elementalist { color: #e05050; }
.prof-mesmer       { color: #d070c8; }
.prof-necromancer  { color: #52c87a; }
.prof-guardian     { color: #72b8ff; }
.prof-warrior      { color: #ffd060; }
.prof-ranger       { color: #80c050; }
.prof-thief        { color: #c06060; }
.prof-engineer     { color: #c88020; }
.prof-revenant     { color: #cc4444; }

/* ══ Responsive helpers ═══════════════════════════════════ */
@media (max-width: 900px) {
  :root { --nav-h: 56px; }
}
@media (max-width: 480px) {
  :root {
    --fs-xs:   12px;
    --fs-sm:   12px;
    --fs-base: 14px;
    --fs-md:   15px;
  }
}

/* ══ Loading state ════════════════════════════════════════ */
.loading {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 60px 20px;
  font-family: 'Cinzel', serif; font-size: var(--fs-xs); letter-spacing: 0.2em;
  color: var(--text-dim);
}
.loading-gem {
  width: 10px; height: 10px; background: var(--gold);
  transform: rotate(45deg);
  animation: etherPulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(212,168,67,0.7);
}

/* ══ Modal base ═══════════════════════════════════════════ */
.modal-overlay-base {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(7,5,15,0.88);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 40px);
}
.modal-box-base {
  background: var(--surface); border: 1px solid var(--border-v);
  max-width: 680px; width: 100%;
  max-height: 90vh; max-height: 90svh; overflow-y: auto;
  position: relative;
}

/* ══ Hauteur dynamique cross-browser ════════════════════════
   --real-vh : 1% de la vraie hauteur visible, injectée par JS.
   Usage : height: calc(var(--real-vh, 1vh) * 100)
   Couvre Safari < 15.4 et navigateurs sans svh/dvh.
═══════════════════════════════════════════════════════════ */
