/* ================================================================
   NAV.CSS — Responsive navigation
   Desktop (>768px): inline links, glass pill on scroll
   Tablet/Mobile (≤768px): hamburger menu, fullscreen overlay
================================================================ */

/* ── BASE NAV SHELL ──────────────────────────────────────── */
nav {
  position:   fixed;
  top:        0; left: 0; right: 0;
  z-index:    100;
  padding:    16px 0;
  transition: padding 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── NAV INNER ────────────────────────────────────────────── */
.nav-inner {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  max-width:       var(--max-w);
  width:           100%;
  margin:          0 auto;
  padding:         0 var(--gutter);
  border-radius:   0;
  background:      transparent;
  border:          none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:      none;
  transition:
    max-width      0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    padding        0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-radius  0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background     0.45s ease,
    border-color   0.45s ease,
    box-shadow     0.45s ease;
}

/* ── SCROLLED — floating glass pill ──────────────────────── */
nav.scrolled { padding: 10px var(--gutter); }

nav.scrolled .nav-inner {
  max-width:               min(var(--max-w), calc(100vw - calc(var(--gutter) * 2)));
  padding:                 16px 22px;
  border-radius:           100px;
  background:              rgb(71 71 71 / 35%);
  backdrop-filter:         blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    0 1px 3px  rgba(0,0,0,0.28),
    0 4px 16px rgba(0,0,0,0.16),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
[data-theme="light"] nav.scrolled .nav-inner {
  background:   rgba(253, 249, 242, 0.35);
  box-shadow:   0 1px 2px rgba(0,0,0,0.05), 0 3px 12px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.95);
}

/* ── LOGO ─────────────────────────────────────────────────── */
.nav-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.nav-logo img { height: 32px; transition: opacity var(--fast), transform var(--fast); }
[data-theme="light"] .nav-logo img { /* filter: brightness(0.15) sepia(1) hue-rotate(10deg) saturate(3); */}
.nav-logo:hover img { opacity: 0.75; transform: scale(1.04); }

/* ── DESKTOP LINKS ────────────────────────────────────────── */
.nav-links {
  display:     flex;
  align-items: center;
  gap:         28px;
  list-style:  none;
  margin-left: auto;   /* always flush to right edge */
}
.nav-link {
  color:           var(--text-secondary);
  text-decoration: none;
  font-size:       0.8125rem;
  font-weight:     500;
  letter-spacing:  0.06em;
  text-transform:  uppercase;
  white-space:     nowrap;
  transition:      color 0.20s;
}
.nav-link:hover  { color: var(--gold); }
.nav-link.active { color: var(--gold); }

/* ── LINKEDIN ─────────────────────────────────────────────── */
.nav-linkedin { display: flex; align-items: center; }
.nav-linkedin img { height: 20px; opacity: 1; transition: opacity var(--fast), transform var(--fast); }
.nav-linkedin:hover img { opacity: 1; transform: scale(1.08); }

/* ── THEME TOGGLE ─────────────────────────────────────────── */
.theme-toggle {
  display:       flex;
  align-items:   center;
  background:    var(--bg-card);
  border:        1px solid var(--border-subtle);
  border-radius: 100px;
  padding:       3px;
  transition:    border-color var(--fast), background var(--transition);
}
[data-theme="dark"]  .theme-toggle { background: rgba(0,0,0,0.72); border-color: rgba(255,255,255,0.10); }
[data-theme="light"] .theme-toggle { background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.18); }
.theme-toggle:hover { border-color: var(--gold-border); }
.toggle-btn {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius:   100px;
  border:          none;
  background:      transparent;
  cursor:          pointer;
  font-size:       14px;
  line-height:     1;
  color:           var(--text-muted);
  transition:      background var(--fast), transform var(--fast);
}
.toggle-btn:hover  { transform: scale(1.1) rotate(8deg); }
.toggle-btn.active { background: var(--gold); box-shadow: 0 1px 4px rgba(0,0,0,0.25); filter: none; }

/* ── MOBILE-ONLY THEME TOGGLE — hidden on desktop ───────────── */
.theme-toggle--mobile { display: none; }

/* ── HAMBURGER BUTTON — hidden on desktop ─────────────────── */
.nav-hamburger {
  display:         none;
  align-items:     center;
  justify-content: center;
  width:  38px; height: 38px;
  border-radius:   10px;
  background:      transparent;
  border:          1px solid var(--border-subtle);
  cursor:          pointer;
  flex-direction:  column;
  gap:             5px;
  padding:         9px 8px;
  transition:      background var(--fast), border-color var(--fast);
  flex-shrink:     0;
}
.nav-hamburger:hover { background: var(--gold-dim); border-color: var(--gold-border); }
.nav-hamburger span {
  display:       block;
  width:  100%; height: 1.5px;
  background:    var(--text-secondary);
  border-radius: 2px;
  transition:    transform 0.3s ease, opacity 0.3s ease, background 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); background: var(--gold); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); background: var(--gold); }


/* ── MOBILE MENU OVERLAY ──────────────────────────────────── */
.nav-mobile-menu {
  display:    none;              /* shown via JS */
  position:   fixed;
  inset:      0;
  z-index:    99;
  padding:    80px var(--gutter) 40px;
  background: rgba(9, 8, 10, 0.97);
  backdrop-filter:         blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  flex-direction: column;
  align-items:    center;
  justify-content:center;
  gap:            8px;
  /* Entrance animation */
  opacity:   0;
  transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
[data-theme="light"] .nav-mobile-menu {
  background: rgba(253, 249, 242, 0.97);
}
.nav-mobile-menu.open {
  display:   flex;
  opacity:   1;
  transform: translateY(0);
}
.nav-mobile-link {
  font-family:     var(--font-body);
  font-size:       1.5rem;
  font-weight: 500;
  letter-spacing:  -0.01em;
  color:           var(--text-secondary);
  text-decoration: none;
  padding:         14px 24px;
  border-radius:   12px;
  width:           100%;
  max-width:       320px;
  text-align:      center;
  transition:      color 0.2s, background 0.2s;
}
.nav-mobile-link:hover,
.nav-mobile-link.active { color: var(--gold); background: var(--gold-dim); }

/* Mobile menu bottom controls */
.nav-mobile-controls {
  margin-top:    32px;
  display:       flex;
  align-items:   center;
  gap:           20px;
}
.nav-mobile-linkedin img { height: 24px; opacity: 0.6; }
.nav-mobile-linkedin:hover img { opacity: 1; }


/* ── TABLET (≤960px) ──────────────────────────────────────── */
@media (max-width: 960px) {
  nav.scrolled { padding: 10px var(--gutter-md); }
  nav.scrolled .nav-inner {
    max-width: calc(100vw - calc(var(--gutter-md) * 2));
    padding:   16px 18px;
  }
  .nav-inner  { padding: 0 var(--gutter-md); }
  .nav-links  { gap: 18px; }
}

/* ── MOBILE (≤768px) — show hamburger, hide inline links ──── */
@media (max-width: 768px) {
  nav.scrolled { padding: 8px var(--gutter-sm); }
  nav.scrolled .nav-inner {
    max-width:     calc(100vw - calc(var(--gutter-sm) * 2));
    padding:       16px 16px;
    border-radius: 20px;
  }
  .nav-inner     { padding: 0 var(--gutter-sm); }

  /* Hide desktop nav links and desktop toggle on mobile */
  .nav-links            { display: none; }
  .theme-toggle:not(.theme-toggle--mobile) { display: none; }

  /* Show hamburger + mobile toggle */
  .nav-hamburger        { display: flex; }
  .theme-toggle--mobile { display: flex; }

  .nav-right-controls {
    display:     flex;
    align-items: center;
    gap:         10px;
  }
}

@media (max-width: 480px) {
  .nav-logo img { height: 26px; }
  .toggle-btn   { width: 24px; height: 24px; font-size: 12px; }
}
