/* ============================================================
   HSEI.IO — nav.css
   Global navigation (SPECIFICATION v1.2 · Section 10.1) + footer
   + mobile drawer.
   Mobile-first: burger by default, desktop links only on wide screens.
   ============================================================ */

/* ---------- NAV ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--nav-height);
  padding: 12px 24px;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 0.5px solid var(--border-gold);
  position: sticky;
  top: 0;
  z-index: 99;
}
.nav.scrolled {
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.4);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}
.nav-logo-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.nav-logo-img {
  display: block;
  width: auto;
  height: 34px;
  flex-shrink: 0;
}
.nlogo-text {
  color: var(--gold);
  line-height: 1;
}
.nlogo-sub {
  display: none;
  color: rgba(228, 184, 174, 0.5);
  margin: 0;
  max-width: 108px;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
}

/* Hidden on mobile/tablet — shown only on wide desktop */
.nav-links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 14px;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}
.nav-links li {
  flex-shrink: 0;
}
.nav-links a {
  color: var(--text-muted);
  transition: color 0.18s ease;
  white-space: nowrap;
  display: block;
}
.nav-links a:hover,
.nav-links a.act {
  color: var(--gold);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-science {
  display: none;
  color: var(--text-ghost);
  transition: color 0.18s ease;
  white-space: nowrap;
}
.nav-science:hover {
  color: var(--teal-accent);
}

/* ---------- LANGUAGE TOGGLE (Section 9.3) ---------- */
.lang-toggle {
  display: flex;
  gap: 1px;
  border: 0.5px solid var(--border-gold-md);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.lang-btn {
  padding: 4px 8px;
  color: var(--text-ghost);
  background: transparent;
  transition: all 0.2s ease;
}
.lang-btn:hover {
  color: var(--text-muted);
}
.lang-btn.on {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.nav-cta {
  padding: 8px 16px;
  white-space: nowrap;
}

/* ---------- HAMBURGER ---------- */
.nav-hamburger {
  display: flex;
  width: 34px;
  height: 34px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 7px;
  border: 0.5px solid var(--border-neutral-md);
  border-radius: 4px;
  flex-shrink: 0;
  background: transparent;
  cursor: pointer;
}
.nav-hamburger span {
  display: block;
  height: 1.5px;
  background: var(--gold);
  transition: all 0.2s ease;
}

/* ---------- MOBILE DRAWER ---------- */
.nav-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(1, 14, 16, 0.6);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.nav-drawer-backdrop.open {
  display: block;
  opacity: 1;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 86vw);
  height: 100%;
  background: var(--bg-surface);
  border-left: 0.5px solid var(--border-gold);
  padding: 24px;
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}
.nav-drawer[hidden] {
  display: none !important;
}
.nav-drawer.open {
  display: flex;
  transform: translateX(0);
}
.nav-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--border-neutral);
  padding-bottom: 16px;
}
.nav-drawer .drawer-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.nav-drawer .drawer-links a {
  color: var(--text-main);
}
.nav-drawer .drawer-links a:hover {
  color: var(--gold);
}
.nav-drawer .drawer-science {
  color: var(--teal-accent);
}
.drawer-close {
  color: var(--text-muted);
  padding: 4px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

/* ---------- FOOTER (Section 11.1) ---------- */
.footer {
  border-top: 0.5px solid var(--border-gold);
  padding: 28px 36px 0;
  margin-top: 8px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
}
.ft-brand {
  color: var(--gold);
  margin-bottom: 6px;
}
.ft-tag {
  color: var(--text-ghost);
  margin-bottom: 10px;
  max-width: 320px;
}
.ft-sci {
  color: var(--teal-accent);
}
.ft-col {
  color: var(--text-ghost);
  margin-bottom: 12px;
}
.ft-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ft-links a {
  color: var(--text-muted);
  transition: color 0.18s ease;
}
.ft-links a:hover {
  color: var(--gold);
}
.ft-links a.ac {
  color: var(--teal-accent);
}
.footer-bottom {
  max-width: 1080px;
  margin: 18px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 0 20px;
  border-top: 0.5px solid rgba(228, 184, 174, 0.05);
}
.footer-copy {
  color: rgba(232, 229, 222, 0.18);
}

/* ---------- DESKTOP NAV ---------- */
@media (min-width: 1400px) {
  .nlogo-sub {
    display: block;
  }
  .nav-science {
    display: inline;
  }
  .nav-links {
    display: flex;
    gap: 16px;
  }
  .nav-hamburger {
    display: none;
  }
}

@media (min-width: 1400px) and (max-width: 1540px) {
  .nav-links {
    gap: 12px;
  }
  .nav-links a {
    font-size: 12px;
    letter-spacing: 0.02em;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 767px) {
  .nav {
    padding: 12px 16px;
  }
  .nlogo-sub {
    display: none;
  }
  .nav-cta {
    display: none;
  }
  .footer {
    padding: 28px 16px 0;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 1399px) {
  .nlogo-sub {
    display: none;
  }
}
