/* ═══════════════════════════════════════
   SCHOOL CLAUDE — Unified Navigation
   Premium SaaS Clean style (Linear/Vercel-inspired)
   Single source of truth. No duplicate media queries.
   ═══════════════════════════════════════ */

:root {
  --nav-h: 68px;
  --nav-bg: rgba(8, 8, 14, 0.82);
  --nav-bg-solid: #08080E;
  --nav-border: rgba(255, 255, 255, 0.07);
}

/* ─────────────────────────────────────────
   Skip Navigation (WCAG 2.4.1)
───────────────────────────────────────── */
.skip-nav {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: #F5C040;
  color: #0D0D14;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 1.25rem;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.15s;
  white-space: nowrap;
}
.skip-nav:focus-visible { top: 0; }

/* ─────────────────────────────────────────
   Base bar
───────────────────────────────────────── */
.nav,
.site-nav,
.dashboard-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--nav-border);
  transition: background 0.25s, box-shadow 0.25s;
}

.nav.scrolled,
.site-nav.scrolled {
  background: rgba(8, 8, 14, 0.97);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
  border-bottom-color: transparent;
}

/* Gold→teal seam line that fades in only when scrolled (premium polish) */
.nav::after,
.site-nav::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(245, 192, 64, 0) 18%,
    rgba(245, 192, 64, 0.55) 50%,
    rgba(46, 222, 201, 0.40) 72%,
    transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.nav.scrolled::after,
.site-nav.scrolled::after { opacity: 1; }

/* ─────────────────────────────────────────
   Inner layout
───────────────────────────────────────── */
.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding-inline: 1.75rem;
  max-width: 1300px;
  margin-inline: auto;
  gap: 0.25rem;
}

/* dashboard-nav is the outer bar — height comes from var(--nav-h) above, not height:100% */
.dashboard-nav {
  display: flex;
  align-items: center;
  padding-inline: 1.75rem;
  max-width: 1300px;
  margin-inline: auto;
  gap: 0.25rem;
}

/* ─────────────────────────────────────────
   Logo
───────────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  min-height: 44px;
  color: rgba(240, 240, 255, 0.85);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
  /* override styles.css gradient */
  background: none !important;
  -webkit-text-fill-color: unset !important;
  background-clip: unset !important;
}
.nav-logo:hover {
  color: #fff;
  transform: translateY(-1px);
  text-shadow: 0 0 18px rgba(245, 192, 64, 0.25);
}
.nav-logo:hover .nav-logo-img {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(245, 192, 64, 0.35));
}

.nav-logo-img {
  height: 28px;
  width: auto;
  mix-blend-mode: screen;
  opacity: 0.88;
  flex-shrink: 0;
  transition: opacity 0.18s, filter 0.22s;
}

/* ─────────────────────────────────────────
   Links row (desktop)
───────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline: auto;
  list-style: none;
  padding: 0;
}

.nav-link {
  position: relative;
  color: rgba(240, 240, 255, 0.55);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.14s, transform 0.14s;
  background: transparent;
}

/* Underline bar — grows from center, gold→teal gradient */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  right: 50%;
  height: 2px;
  background: linear-gradient(90deg, #F5C040 0%, #2EDEC9 100%);
  border-radius: 2px;
  transition:
    left  0.22s cubic-bezier(0.22, 1, 0.36, 1),
    right 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.15s;
  opacity: 0;
  pointer-events: none;
}

/* Hover: ghost underline + lift */
.nav-link:hover {
  color: rgba(240, 240, 255, 0.95);
  background: transparent;
  transform: translateY(-1px);
}
.nav-link:hover::after {
  left: 14%;
  right: 14%;
  opacity: 0.7;
}

/* Active: full underline + gold text */
.nav-link.active,
.nav-link[aria-current="page"] {
  color: #F5C040;
  background: transparent;
}
.nav-link.active::after,
.nav-link[aria-current="page"]::after {
  left: 8%;
  right: 8%;
  opacity: 1;
}

/* Skills special button */
.nav-link-skills {
  color: #E8A020 !important;
  background: rgba(232, 160, 32, 0.08) !important;
  border: 1px solid rgba(232, 160, 32, 0.22);
  font-weight: 700 !important;
  transition: color 0.14s, background 0.18s, border-color 0.18s, box-shadow 0.22s, transform 0.14s;
}
.nav-link-skills:hover {
  color: #F5C040 !important;
  background: rgba(232, 160, 32, 0.16) !important;
  border-color: rgba(232, 160, 32, 0.4);
  box-shadow: 0 0 0 3px rgba(232, 160, 32, 0.10), 0 4px 14px -4px rgba(232, 160, 32, 0.4);
}
.nav-link-skills::after { display: none !important; }

/* ─────────────────────────────────────────
   Actions area (desktop)
───────────────────────────────────────── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   Focus visible rings (WCAG 2.4.11)
───────────────────────────────────────── */
.nav-link:focus-visible,
.nav-toggle:focus-visible,
.nav-logo:focus-visible,
.nav-drawer-cta:focus-visible,
.btn-ghost:focus-visible,
.btn-primary:focus-visible {
  outline: 3px solid #F5C040;
  outline-offset: 3px;
  border-radius: 6px;
}

/* ─────────────────────────────────────────
   Hamburger (hidden on desktop)
───────────────────────────────────────── */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: rgba(240, 240, 255, 0.9);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
  padding: 0;
  line-height: 1;
}
.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

/* Active state when drawer open */
.mobile-open .nav-toggle {
  background: rgba(232, 160, 32, 0.12);
  border-color: rgba(232, 160, 32, 0.38);
  color: #F5C040;
}

/* ─────────────────────────────────────────
   Mobile CTA pill — hidden everywhere
───────────────────────────────────────── */
.nav-cta-mobile {
  display: none !important;
}

/* Drawer CTA hidden on desktop (mobile-only) */
.nav-drawer-cta {
  display: none;
}

/* ═══════════════════════════════════════
   MOBILE  (≤ 768px)
   Bar: Logo + [Hamburger]
   Drawer: full-width panel below bar
═══════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --nav-h: 56px; }

  /* Solid bar — no bleed-through */
  .nav,
  .site-nav,
  .dashboard-nav {
    background: var(--nav-bg-solid) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding-top: env(safe-area-inset-top, 0);
    height: calc(var(--nav-h) + env(safe-area-inset-top, 0));
    box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 2px 16px rgba(0,0,0,0.5);
  }
  .nav.scrolled, .site-nav.scrolled {
    background: var(--nav-bg-solid) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 2px 16px rgba(0,0,0,0.5);
  }

  /* Tighter inner padding */
  .nav-inner,
  .dashboard-nav {
    padding-inline: 14px;
    gap: 8px;
  }

  /* Logo */
  .nav-logo {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(100% - 64px);
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(0.8rem, 3.5vw, 0.92rem);
    color: #F0F0FF !important;
    -webkit-text-fill-color: #F0F0FF !important;
  }
  .nav-logo-img { height: 24px; }

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

  /* Hide desktop actions bar */
  .nav-actions { display: none !important; }

  /* ── Drawer (slide-down panel) ─────── */
  /* Safari iOS: rely on opacity+transform only (no visibility juggling).
     z-index 1000 keeps it above page content (sticky sidebars, hero
     canvas, install modal hooks etc.). isolation: isolate gives it
     its own stacking context so iOS compositing layers can't bleed. */
  .nav-links {
    position: fixed;
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0));
    inset-inline: 0;
    max-height: calc(100dvh - var(--nav-h) - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--nav-bg-solid);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 12px;
    margin: 0;
    /* Hidden by default — opacity+transform only, no visibility */
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.28s ease-out,
      opacity 0.22s ease-out;
    z-index: 1000;
    isolation: isolate;
    /* Promote to its own compositor layer so Safari renders correctly */
    will-change: transform, opacity;
    -webkit-transform: translateY(-110%);
  }

  .mobile-open .nav-links,
  .nav-links.open {
    transform: translateY(0);
    -webkit-transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* Drawer link rows */
  .nav-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    font-size: 0.97rem;
    font-weight: 600;
    color: rgba(240, 240, 255, 0.88);
    border-radius: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    min-height: 52px;
    background: transparent;
    /* No underline animation in drawer */
    transform: none !important;
    transition: background 0.12s, color 0.12s;
  }
  .nav-link::after { display: none !important; }
  .nav-link:last-of-type { border-bottom: none; }
  .nav-link:active { background: rgba(255,255,255,0.06); }

  /* Hover in drawer */
  .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(240, 240, 255, 0.95);
    transform: none !important;
  }

  .nav-link.active,
  .nav-link[aria-current="page"] {
    color: #F5C040;
    background: rgba(232,160,32,0.10);
    border-bottom-color: rgba(232,160,32,0.15);
  }

  .nav-link-skills {
    color: #F5C040 !important;
    background: rgba(232,160,32,0.07) !important;
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
  }

  /* CTA at bottom of drawer */
  .nav-drawer-cta {
    display: flex !important;
    margin: 8px 4px 4px;
    padding: 14px 20px;
    background: #E8A020;
    color: #0D0D14 !important;
    font-size: 0.97rem;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    justify-content: center;
    min-height: 52px;
    align-items: center;
    transition: background 0.15s, transform 0.15s;
  }
  .nav-drawer-cta:hover {
    background: #F5C040;
    transform: none;
  }

  .nav-links::after {
    content: '';
    display: block;
    height: calc(8px + env(safe-area-inset-bottom, 0));
  }
}

/* ═══════════════════════════════════════
   SMALL PHONE  (≤ 480px)
═══════════════════════════════════════ */
@media (max-width: 480px) {
  .nav-inner,
  .dashboard-nav { padding-inline: 12px; }

  .nav-logo {
    font-size: clamp(0.76rem, 3.2vw, 0.86rem);
    max-width: calc(100% - 64px);
  }
  .nav-logo-img { height: 22px; }
}
