﻿/* =============================================================================
   NAVBAR  v18 — theme-aware, cinematic, premium
   -----------------------------------------------------------------------------
   Architecture
     • Bar is fully transparent by default — no background, no border, no shadow.
     • Each <section> declares its palette via  data-nav-theme="light" | "dark".
       The default (no attribute) is dark.
     • main.js observes sections with IntersectionObserver and mirrors the
       active section's theme onto  <header data-theme="...">.
     • CSS animates color, logo-filter and a subtle glass backdrop between
       the two states. No flicker, no layout shift, no transform tricks.

   States
     [data-theme="dark"]   — sits over a dark section (default).
                             Light text, inverted (white) logo, no background.
     [data-theme="light"]  — sits over a light section (cream #ede8df etc.).
                             Ink (dark) text, regular logo, soft translucent
                             dark glass background for legibility at speed.

   Dependencies (tokens.css):
     --ink, --ink-deep, --warm-white, --bronze, --bronze-pale, --bronze-light,
     --content-max, --page-gutter, --nav-height, --font-sc, --font-display,
     --ease-out
   ============================================================================= */


/* ══════════════════════════════════════════════════════════════════════
   BASE BAR
   ══════════════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;                   /* top-left-right = 0 */
  z-index: 1500;                       /* above overlays, below lightbox */
  height: var(--nav-height, 76px);
  /* Allow the logo to read taller than the band itself without growing
     the nav. Children with large height extend past the bar. */
  overflow: visible;
  display: flex;
  align-items: center;
  /* Fully transparent by default. No border. No shadow. */
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: auto;
  /* Smoothly cross-fade any property the theme toggles. */
  transition:
    background-color 0.5s var(--ease-out),
    backdrop-filter  0.5s var(--ease-out),
    -webkit-backdrop-filter 0.5s var(--ease-out),
    color            0.5s var(--ease-out);
}
/* Nuke any pseudo-element that other stylesheets (or a past version of
   this file) might have used to draw a line under the bar. */
.nav::before,
.nav::after { content: none !important; display: none !important; }

.nav-inner {
  width: 100%;
  max-width: var(--content-max, 1320px);
  margin: 0 auto;
  padding: 0 var(--page-gutter, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 32px);
}


/* ══════════════════════════════════════════════════════════════════════
   BRAND (LOGO)
   ══════════════════════════════════════════════════════════════════════ */
.nav-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 4px 0;
  color: inherit;
  transition: opacity 0.3s;
}
.nav-brand:hover { opacity: 0.82; }

.nav-brand-logo {
  /* Logo intentionally overflows the nav band so it reads larger
     without forcing the navbar itself to grow taller. */
  height: clamp(96px, 9vw, 124px);
  width: auto;
  display: block;
  /* Filter is the ONLY thing that changes with the theme — crisp, no swap,
     no double-download. Default state is inverted (white) for dark bg. */
  filter: brightness(0) invert(1);
  opacity: 0.95;
  transition: filter 0.5s var(--ease-out), height 0.4s var(--ease-out);
  will-change: filter;
}


/* ══════════════════════════════════════════════════════════════════════
   LINKS (desktop)
   ══════════════════════════════════════════════════════════════════════ */
.nav-links {
  display: flex;
  gap: clamp(22px, 3.2vw, 40px);
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}
.nav-links a {
  position: relative;
  font-family: var(--font-sc);
  font-size: clamp(10px, 0.8vw, 11px);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: currentColor;                 /* inherits the theme color */
  opacity: 0.78;
  padding: 10px 2px;
  white-space: nowrap;
  transition: opacity 0.3s, color 0.3s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 1px;
  background: var(--bronze-pale);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out), background-color 0.3s;
}
.nav-links a:hover,
.nav-links a.is-active { opacity: 1; }
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); }


/* ══════════════════════════════════════════════════════════════════════
   ACTIONS (CTA + BURGER)
   ══════════════════════════════════════════════════════════════════════ */
.nav-actions {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 18px);
  flex: 0 0 auto;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sc);
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  padding: 10px 16px;
  color: currentColor;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: transparent;
  opacity: 0.9;
  white-space: nowrap;
  transition:
    background 0.3s var(--ease-out),
    color      0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    opacity    0.3s;
}
.nav-cta:hover {
  background: var(--bronze-pale);
  color: var(--ink-deep);
  border-color: var(--bronze-pale);
  opacity: 1;
}
.nav-cta svg { transition: transform 0.3s; }
.nav-cta:hover svg { transform: translateX(3px); }


/* ══════════════════════════════════════════════════════════════════════
   BURGER
   ══════════════════════════════════════════════════════════════════════ */
.nav-burger {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  /* Sit above the .mobile-nav overlay (z-index 9550 in components.css) so a
     second tap on the burger always closes the menu. */
  z-index: 9600;
  -webkit-tap-highlight-color: transparent;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition:
    transform 0.35s var(--ease-out),
    opacity 0.2s,
    width 0.35s var(--ease-out),
    background-color 0.4s;
}
.nav-burger span:nth-child(2) { width: 16px; }
.nav-burger span:nth-child(3) { width: 11px; }

.nav-burger[aria-expanded="true"] span:nth-child(1) {
  width: 22px;
  transform: translateY(6.5px) rotate(45deg);
}
.nav-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-burger[aria-expanded="true"] span:nth-child(3) {
  width: 22px;
  transform: translateY(-6.5px) rotate(-45deg);
}


/* ══════════════════════════════════════════════════════════════════════
   THEMES — applied to  <header data-theme="…">
   ══════════════════════════════════════════════════════════════════════ */

/* Default (no theme attr yet) behaves as dark */
.nav,
.nav[data-theme="dark"] {
  color: var(--warm-white);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.nav[data-theme="dark"] .nav-brand-logo {
  filter: brightness(0) invert(1);
}
.nav[data-theme="dark"] .nav-links a,
.nav[data-theme="dark"] .nav-cta {
  /* Subtle drop-shadow so text reads over lively video without a plate. */
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}

/* LIGHT — sitting over a cream / ivory section */
.nav[data-theme="light"] {
  color: var(--ink-deep);
  /* Soft translucent dark-glass for legibility, not loud. */
  background: rgba(246, 242, 236, 0.72);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}
.nav[data-theme="light"] .nav-brand-logo {
  filter: none;                         /* logo reads on light bg */
  opacity: 0.92;
}
.nav[data-theme="light"] .nav-links a,
.nav[data-theme="light"] .nav-cta {
  text-shadow: none;
}
.nav[data-theme="light"] .nav-links a::after {
  background: var(--bronze);
}

/* Navbar transparent when scrolled to top (hero) */
body[data-scroll="top"] .nav {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}


/* ══════════════════════════════════════════════════════════════════════
   MOBILE DRAWER
   ══════════════════════════════════════════════════════════════════════ */
.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 8, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
  z-index: 1550;
}
.nav-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 380px);
  background: var(--ink, #141210);
  color: var(--warm-white);
  border-left: 1px solid rgba(196, 167, 108, 0.14);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.50);
  padding:
    calc(env(safe-area-inset-top, 0px) + var(--nav-height, 76px) + 24px)
    36px
    calc(env(safe-area-inset-bottom, 0px) + 36px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  z-index: 1600;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease-out), visibility 0s 0.45s;
  visibility: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.45s var(--ease-out), visibility 0s;
}
.nav-drawer::-webkit-scrollbar { display: none; }

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-drawer-links a {
  display: block;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(22px, 5vw, 28px);
  color: var(--warm-white);
  padding: 14px 0;
  border-bottom: 1px solid rgba(196, 167, 108, 0.10);
  transition: color 0.3s, padding-left 0.4s var(--ease-out);
}
.nav-drawer-links a:hover,
.nav-drawer-links a:focus-visible {
  color: var(--bronze-pale);
  padding-left: 10px;
}

/* ── Drawer footer — unified editorial buttons ──────────────────────── */
.nav-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(196, 167, 108, 0.18);
  padding-top: 24px;
  margin-top: 8px;
}

/* Shared base for both drawer buttons */
.nav-drawer-cta,
.nav-drawer-shop {
  display: flex !important;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(196, 167, 108, 0.22);
  background: transparent;
  font-family: var(--font-sc);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--warm-white, #f6f2ec);
  transition: background 0.35s var(--ease-out), border-color 0.35s, color 0.35s, transform 0.35s var(--ease-out);
  margin: 0;
  border-radius: 0;
}
.nav-drawer-cta span,
.nav-drawer-shop span {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-drawer-cta svg,
.nav-drawer-shop svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--bronze-pale, #c4a76c);
  transition: transform 0.35s var(--ease-out);
}

/* PRIMARY — bronze-tinted, slightly weightier */
.nav-drawer-cta {
  background: rgba(196, 167, 108, 0.08);
  border-color: rgba(196, 167, 108, 0.42);
  color: var(--bronze-pale, #c4a76c);
}
.nav-drawer-cta:hover {
  background: rgba(196, 167, 108, 0.16);
  border-color: var(--bronze-pale, #c4a76c);
  color: var(--bronze-light, #d4b87a);
}
.nav-drawer-cta:hover svg { transform: translateX(4px); }

/* SECONDARY — ghost outline */
.nav-drawer-shop {
  color: rgba(232, 226, 214, 0.82);
}
.nav-drawer-shop:hover {
  background: rgba(196, 167, 108, 0.06);
  border-color: rgba(196, 167, 108, 0.42);
  color: var(--bronze-pale, #c4a76c);
}
.nav-drawer-shop:hover svg { transform: translate(3px, -3px); }

/* studio meta tagline */
.nav-drawer-meta {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.22);
  text-align: center;
  padding-top: 12px;
}


/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE — unified breakpoints: 1024 / 900 / 480
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .nav-links { gap: 24px; }
  .nav-inner { gap: 18px; }
  .nav-cta   { padding: 9px 14px; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  /* Keep the Shop CTA visible next to the burger on mobile — sized down. */
  .nav-cta {
    display: inline-flex;
    padding: 8px 12px;
    font-size: 9px;
    letter-spacing: 0.28em;
    gap: 6px;
  }
  .nav-cta svg { width: 11px; height: 11px; }
  .nav-burger { display: flex; }
  .nav-brand-logo { height: 84px; }
  /* Group the Shop CTA + burger together on the right side. */
  .nav-inner { gap: 10px; }
  .nav-actions { display: inline-flex; align-items: center; gap: 8px; }
}

@media (max-width: 480px) {
  .nav { height: 64px; }
  .nav-brand-logo { height: 72px; }
  .nav-inner { padding: 0 14px; gap: 8px; }
  .nav-cta { padding: 7px 10px; font-size: 9px; letter-spacing: 0.22em; }
  .nav-cta span { display: inline; }
  .nav-actions { gap: 6px; }
}

@media (max-width: 360px) {
  /* Very narrow: keep CTA but hide its arrow icon to save space */
  .nav-cta svg { display: none; }
}


/* Lock body while drawer is open — JS adds .nav-open */
body.nav-open { overflow: hidden; }


/* Reduced motion — respect OS preference */
@media (prefers-reduced-motion: reduce) {
  .nav,
  .nav-brand-logo,
  .nav-drawer,
  .nav-drawer-backdrop,
  .nav-burger span,
  .nav-links a,
  .nav-links a::after {
    transition-duration: 0.01s !important;
  }
}
