/* =====================================================
   Vicarion — Header & Navigation · Revamp v4.0
   - Full-bleed glass header (Safari-friendly)
   - Logo hard-left + brand name (consistent scale)
   - Gold accent line + understated glow
   - Desktop links with animated underline beam
   - Mobile slide-in drawer (.nav-links.open)
   - CSS-only scrim: body.nav-open::after
   - Shrink-on-scroll (.header.shrink)
   ===================================================== */

/* -------- Brand tokens -------- */
:root{
  --gold:        #ffc107;
  --gold-2:      #ffb300;
  --gold-3:      #ffe082;
  --ink:         #000;

  --glass:        rgba(0,0,0,.42);
  --glass-strong: rgba(0,0,0,.72);
  --ring:         rgba(255,255,255,.12);

  --text-hi:     #f2f2f2;
  --text-lo:     #cfcfcf;

  --hdr-h:       72px;  /* keep in sync with page padding */
}

/* ---- Full-width glass header ---- */
.header{
  position: fixed; inset: 0 0 auto 0; height: var(--hdr-h);
  z-index: 1000;
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--ring);
  box-shadow: 0 8px 30px rgba(0,0,0,.38);
  transition: background .25s ease, height .25s ease, box-shadow .25s ease;
}

/* Slim gold beam under the header */
.header::after{
  content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px;
  background: linear-gradient(90deg, transparent, var(--gold) 35%, var(--gold-2) 65%, transparent);
  opacity: .25; pointer-events: none;
}

/* shrink on scroll (JS toggles .shrink) */
.header.shrink{
  height: 64px;
  background: var(--glass-strong);
  box-shadow: 0 10px 36px rgba(0,0,0,.5);
}

/* ---- Inner container aligns brand left, nav right ---- */
.header .container.header__inner{
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
}

/* ---- Brand: logo far-left + name ---- */
.brand-link{ display:flex; align-items:center; gap:12px; text-decoration:none; }
.logo{
  height: clamp(38px, 5.2vw, 52px); width:auto;
  filter: drop-shadow(0 0 8px rgba(255,193,7,.45));
  transition: transform .2s ease;
}
.brand-link:hover .logo{ transform: scale(1.04); }

.brand-name{
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 1.2px;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  background: linear-gradient(90deg, var(--gold-3), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(255,193,7,.45);
  white-space: nowrap;
}
.header.shrink .brand-name{ text-shadow: 0 0 6px rgba(255,193,7,.35); }

/* ---- Desktop navigation ---- */
.nav-links{
  display:flex; align-items:center; gap: clamp(14px, 2.6vw, 28px);
}

.nav-links a{
  position: relative;
  color: var(--text-hi);
  opacity: .92;
  padding-block: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
  transition: opacity .2s ease, transform .2s ease, filter .2s ease;
}

/* animated gold underline */
.nav-links a::after{
  content:""; position:absolute; left:14%; right:14%; bottom:-6px; height:2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
  opacity: .9;
  filter: drop-shadow(0 0 6px rgba(255,193,7,.55));
}

.nav-links a:hover,
.nav-links a:focus-visible{ opacity: 1; transform: translateY(-1px); }
.nav-links a:hover::after,
.nav-links a:focus-visible::after{ transform: scaleX(1); }

/* active page (aria-current) */
.nav-links a[aria-current="page"]{
  opacity: 1; filter: brightness(1.06);
}
.nav-links a[aria-current="page"]::after{ transform: scaleX(1); }

/* keyboard focus ring */
.nav-links a:focus-visible{
  outline: 2px solid #fff; outline-offset: 3px;
}

/* ---- Mobile hamburger (JS uses #hamburger & #hamburger-icon) ---- */
#hamburger{
  display: none;
  border: 2px solid var(--gold);
  color: var(--gold);
  background: rgba(255,193,7,.08);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 1.5rem;
  line-height: 1;
  transition: transform .2s ease, background .2s ease;
  margin-left: auto;
}
#hamburger:hover{ transform: scale(1.05); background: rgba(255,193,7,.14); }

/* ---- Mobile drawer + scrim ---- */
@media (max-width: 768px){
  #hamburger{ display:block; }

  .nav-links{
    position: fixed; top: var(--hdr-h); right: 0; bottom: 0;
    width: min(84vw, 320px);
    padding: 22px;
    display: flex; flex-direction: column; align-items: stretch; gap: 12px;
    background: rgba(0,0,0,.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-left: 1px solid var(--ring);
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 1001; /* above scrim */
  }
  .nav-links.open{ transform: translateX(0); }

  .nav-links a{
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
  }

  /* lock scroll when open (JS toggles .nav-open) and show scrim */
  body.nav-open{ overflow: hidden; }
  body.nav-open::after{
    content:""; position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000; /* under drawer, above page */
  }
}

/* ---- Light mode support ---- */
body.light-mode .header{
  background: rgba(255,255,255,.65);
  border-bottom-color: rgba(0,0,0,.08);
}
body.light-mode .header.shrink{ background: rgba(255,255,255,.8); }
body.light-mode .nav-links a{ color:#141414; }
body.light-mode .nav-links a:hover{ color:#000; }
body.light-mode .nav-links a::after{
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}
body.light-mode #hamburger{
  border-color: var(--gold-2);
  color: var(--gold-2);
  background: rgba(255,179,0,.12);
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}
