/* ═══════════════════════════════════════
   BASE — Toutes les pages
   ═══════════════════════════════════════ */

:root {
  --ink-red: rgba(196,43,43,.18);
  --ink-blue: rgba(59,111,212,.18);
  --ink-green: rgba(45,140,78,.18);
  --ink-gold: rgba(232,201,122,.18);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .35;
  mix-blend-mode: screen;
}

main,
.site-footer,
.quest-bar {
  position: relative;
}

/* ═══ SCROLL PROGRESS ═══ */
#scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 2px; width: 0%;
  background: linear-gradient(to right, rgba(201,165,84,.3), var(--gold), var(--gold-light));
  box-shadow: 0 0 8px rgba(201,165,84,.4);
  transition: width .08s linear; pointer-events: none;
}

/* ═══ BACKGROUND STARS ═══ */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ═══════════════════════════════
   HEADER
   ═══════════════════════════════ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  background: linear-gradient(to bottom, rgba(8,11,22,.72) 0%, rgba(8,11,22,0) 100%);
  border-bottom: 1px solid rgba(201,165,84, 0);
  transition: background .4s ease, border-color .4s ease, backdrop-filter .4s ease;
}
.site-header.scrolled {
  background: rgba(8, 11, 22, .92);
  border-bottom-color: rgba(201,165,84, .12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.header-inner {
  width: 100%;
  max-width: 1200px; margin: 0 auto;
  padding: 0 2rem;
  height: var(--header-h);
  display: flex; align-items: center; gap: 2rem;
  box-sizing: border-box;
}

/* Logo */
.header-logo {
  display: flex; align-items: center; gap: .9rem;
  color: var(--gold); text-decoration: none; flex-shrink: 0;
}
.logo-sigil {
  width: 58px;
  height: 58px;
  max-width: 58px;
  max-height: 58px;
  display: block;
  filter: drop-shadow(0 0 12px rgba(201,165,84,.4));
  object-fit: contain;
}
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name {
  font-family: var(--font-head); font-size: .92rem;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-light);
}
.logo-tag {
  font-family: var(--font-body); font-weight: 300;
  font-size: .63rem; letter-spacing: .15em;
  color: rgba(201,165,84,.72); margin-top: .25rem;
}

/* Nav links */
.header-nav {
  display: flex; gap: 2.2rem; align-items: center;
  flex: 1; justify-content: center;
}
.header-nav a {
  font-family: var(--font-head); font-size: .75rem;
  letter-spacing: .3em; text-transform: uppercase;
  color: rgba(201,165,84,.88);
  transition: color .25s;
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .4rem;
}
.header-nav a::after {
  content: ''; position: absolute; bottom: 8px; left: .4rem; right: .4rem;
  height: 1px; background: var(--gold);
  transform: scaleX(0); transition: transform .25s;
  transform-origin: center;
}
.header-nav a:hover { color: var(--gold-light); }
.header-nav a:hover::after { transform: scaleX(1); }
.header-nav a[aria-current="page"] { color: var(--gold-light); }
.header-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Actions */
.header-actions { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }

/* Burger */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 0; min-width: 44px; min-height: 44px;
}
.nav-toggle span {
  display: block; width: 22px; height: 1.5px;
  background: var(--gold); transition: transform .3s, opacity .3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 490;
  background: rgba(8,11,22,.97); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; gap: 0;
  border-bottom: 1px solid rgba(201,165,84,.1);
  transform: translateY(-110%); transition: transform .4s cubic-bezier(.22,1,.36,1);
  pointer-events: none; visibility: hidden;
}
.mobile-nav.open { transform: translateY(0); pointer-events: all; visibility: visible; }
.mobile-nav a {
  font-family: var(--font-head); font-size: .7rem;
  letter-spacing: .3em; text-transform: uppercase;
  color: rgba(201,165,84,.75);
  padding: 1.2rem 2rem;
  border-bottom: 1px solid rgba(201,165,84,.07);
  transition: color .2s, background .2s;
}
.mobile-nav a:hover { color: var(--gold-light); background: rgba(201,165,84,.04); }
.footer-nav-col a,
.rgpd a {
  background-image: linear-gradient(90deg, rgba(201,165,84,.2), var(--gold-light), rgba(201,165,84,.2));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: color .25s ease, background-size .45s cubic-bezier(.22,1,.36,1);
}
.footer-nav-col a:hover,
.rgpd a:hover {
  background-size: 100% 1px;
}

/* ═══════════════════════════════
   FOOTER
   ═══════════════════════════════ */
.site-footer {
  position: relative; z-index: 2;
  border-top: 1px solid rgba(201,165,84,.12);
  padding: 4rem 0 0;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 2rem 3rem;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-logo {
  display: flex; align-items: center; gap: 1rem;
  color: var(--gold); text-decoration: none; margin-bottom: 1rem;
}
.footer-sigil { height: 52px; width: auto; }
.footer-logo-name {
  display: block; font-family: var(--font-head); font-size: .95rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--gold-light);
}
.footer-logo-tag {
  display: block; font-family: var(--font-body); font-weight: 300;
  font-size: .64rem; letter-spacing: .12em;
  color: rgba(201,165,84,.65); margin-top: .2rem;
}
.footer-nav-col { display: flex; flex-direction: column; gap: .7rem; }
.footer-col-title {
  font-family: var(--font-head); font-size: .6rem;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold-light); margin-bottom: .5rem;
}
.footer-nav-col a {
  font-family: var(--font-body); font-weight: 300;
  font-size: .8rem; letter-spacing: .06em;
  color: rgba(201,165,84,.6);
  transition: color .25s;
}
.footer-nav-col a:hover { color: var(--gold-light); }
.footer-muted {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: .8rem;
  letter-spacing: .06em;
  color: rgba(201,165,84,.62);
}
.footer-bottom {
  border-top: 1px solid rgba(201,165,84,.08);
  padding: 1.5rem 2rem;
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-bottom p, .footer-bottom a {
  font-family: var(--font-body); font-weight: 300;
  font-size: .75rem; letter-spacing: .08em;
  color: rgba(201,165,84,.65);
}
.footer-bottom a:hover { color: rgba(201,165,84,.88); }

.nav-active {
  color: var(--gold-light) !important;
}
.nav-active::after {
  transform: scaleX(1) !important;
}

html, body { width: 100%; max-width: 100%; overflow-x: clip; } /* clip ne casse pas sticky */

/* ── Animation d'entrée de page ── */
@keyframes pageEntry {
  0%   { opacity: 0; filter: blur(10px) brightness(.4); }
  45%  { opacity: .55; filter: blur(3px) brightness(.75); }
  100% { opacity: 1; filter: blur(0) brightness(1); }
}
.page-entry {
  animation: pageEntry 1.8s cubic-bezier(.25,0,.35,1) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .page-entry { animation: none; }
}

/* ── Transition de page ── */
.pt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse 55% 45% at 50% 50%, rgba(201,165,84,.07) 0%, transparent 60%),
    #080b16;
  transition: opacity .7s cubic-bezier(.4,0,.2,1);
}
.pt-overlay.pt-in {
  opacity: 1;
  pointer-events: all;
}
.pt-overlay.pt-out {
  opacity: 0;
  transition: opacity 1s cubic-bezier(.4,0,.2,1);
}

.header-logo { min-width: 0; flex: 0 0 auto; }

/* Responsive shell */
@media (max-width: 1200px) and (min-width: 901px) {
  .header-inner { padding-inline: 1.5rem; gap: 1.4rem; }
  .logo-sigil { width: 48px; height: 48px; max-width: 48px; max-height: 48px; }
  .logo-name { font-size: .76rem; }
  .logo-tag { font-size: .64rem; }
  .header-nav { gap: 1.4rem; }
}

@media (max-width: 900px) {
  .header-inner {
    position: relative;
    max-width: none;
    padding-left: 1rem;
    padding-right: 4rem;
    justify-content: space-between;
    gap: .75rem;
  }

  .header-actions {
    position: absolute;
    right: .75rem;
    top: 50%;
    z-index: 5;
    margin-left: 0;
    transform: translateY(-50%);
  }

  .header-nav { display: none; }
  .nav-toggle {
    position: relative;
    display: flex;
  }
  .logo-tag { display: none; }
  .logo-sigil { width: 44px; height: 44px; max-width: 44px; max-height: 44px; }
  .logo-text { max-width: calc(100vw - 7.5rem); overflow: hidden; }
  .logo-name { white-space: nowrap; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 1.5rem; padding-bottom: 2rem; }
  .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.2rem; }
}

@media (max-width: 600px) {
  .al-section { padding: 3.5rem 1.5rem; }
  .ap-section { padding: 3.5rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
