nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(17, 17, 17, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #2A2A2A;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  padding: 0 32px;
  z-index: 1000;
  transition: box-shadow 0.3s, background-color 0.4s, border-color 0.4s;
  box-shadow: rgba(17, 12, 46, 0.02) 0px 1px 4px 0px;
}

nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.35;
  pointer-events: none;
}

nav.scrolled {
  box-shadow: var(--shadow-md);
}

/* ── Logo (center column) ── */
nav > a:has(.nav-logo-text) {
  justify-self: center;
}

.nav-logo-text {
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
}

.nav-logo-text p {
  margin: 0;
}

.phase-one {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  text-transform: uppercase;
  color: #F8F6F2;
  font-weight: 700;
  letter-spacing: 0.12em;
  transition: color 0.4s;
}

.visuals {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
}

/* ── Left section — desktop nav links ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a:not(.pov-btn) {
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  color: #AAAAAA;
  letter-spacing: 0.3px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
  white-space: nowrap;
}

.nav-links a:not(.pov-btn):hover {
  color: #F8F6F2;
  background: #1A1A1A;
  border-color: #2A2A2A;
}

.nav-icon {
  width: 0;
  height: 13px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-3px);
  transition: width 0.22s ease, opacity 0.22s ease, transform 0.22s ease, margin-right 0.22s ease;
  margin-right: 0;
}

.nav-links a:not(.pov-btn):hover .nav-icon {
  width: 13px;
  opacity: 1;
  transform: translateX(0);
  margin-right: 5px;
}

.nav-links a:not(.pov-btn):hover {
  color: var(--black);
  background: var(--mist);
  border-color: var(--divider);
}

.nav-links a:not(.pov-btn)::after {
  display: none;
}

/* ── Right section ── */
.nav-right-group {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-self: end;
  min-width: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1100;
}

/* Theme toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid #3A3A3A;
  color: #F8F6F2;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
  background: #1A1A1A;
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

.theme-toggle:active {
  transform: translateY(0) scale(0.95);
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}
[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}
.theme-toggle .sun-icon {
  display: none;
}
.theme-toggle .moon-icon {
  display: block;
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: #1A1A1A;
}

.bar {
  width: 20px;
  height: 2px;
  background-color: #F8F6F2;
  display: block;
  transition: all 0.3s ease-in-out;
  border-radius: 10px;
}

#mobile-menu.is-active .bar:nth-child(2) {
  opacity: 0;
  transform: translateX(-8px);
}
#mobile-menu.is-active .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#mobile-menu.is-active .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Left book button (all sizes) */
#nav-rspn-btn {
  display: flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
}

#nav-rspn-btn .label {
  white-space: nowrap;
}

#nav-rspn-btn .icon {
  width: 26px;
  opacity: 1;
  flex-shrink: 0;
}

.nav-book-btn {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 20px;
  width: fit-content;
}

/* ── Glass overlay ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ═══════════════════════════════════════════
   MOBILE / TABLET  (≤1100px)
   ═══════════════════════════════════════════ */
@media (max-width: 1100px) {
  nav {
    height: 60px;
    padding: 0 16px;
    grid-template-columns: 1fr auto 1fr;
  }

  .menu-toggle {
    display: flex;
  }

  /* Nav links become side drawer */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    height: 100dvh;
    background: #0d0d0d;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 64px 32px;
    gap: 4px;
    z-index: 1000;
    transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    border-left: 1px solid #2A2A2A;
  }

  .nav-links.active {
    right: 0;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.10);
  }

  .nav-links li {
    width: 100%;
    opacity: 0;
    transform: translateX(12px);
    transition: all 0.35s ease;
    text-align: center;
  }

  .nav-links li:not(:last-child)::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: var(--divider);
    margin: 0;
  }

  .nav-links.active li {
    opacity: 1;
    transform: translateX(0);
  }

  .nav-links.active li:nth-child(1) { transition-delay: 0.06s; }
  .nav-links.active li:nth-child(2) { transition-delay: 0.12s; }
  .nav-links.active li:nth-child(3) { transition-delay: 0.18s; }
  .nav-links.active li:nth-child(4) { transition-delay: 0.24s; }
  .nav-links.active li:nth-child(5) { transition-delay: 0.30s; }

  .nav-links a:not(.pov-btn) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    font-size: 21px;
    font-family: var(--serif);
    font-weight: 700;
    color: #F8F6F2;
    border-radius: 0;
    letter-spacing: 0.3px;
    width: 100%;
    transition: color 0.2s, background 0.2s, padding-left 0.2s;
  }

  .nav-links a:not(.pov-btn):hover {
    color: var(--gold);
    background: rgba(200, 134, 26, 0.08);
    padding-left: 32px;
  }

  .nav-links .nav-icon {
    width: 20px;
    height: 20px;
    opacity: 1;
    margin-right: 0;
    flex-shrink: 0;
    color: var(--gold);
  }

  #nav-rspn-btn {
    z-index: 1200;
  }

  .phase-one {
    font-size: 18px;
  }

  .visuals {
    font-size: 10px;
    letter-spacing: 0.3em;
  }
}

/* ═══════════════════════════════════════════
   SMALL PHONE  (≤600px)
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
  nav {
    padding: 0 12px;
    height: 56px;
  }

  #nav-rspn-btn .pov-btn {
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    width: auto;
    padding: 0 12px;
    border-radius: 8px;
  }

  #nav-rspn-btn .icon {
    width: 16px;
  }

  #nav-rspn-btn .icon svg {
    width: 16px;
    height: 16px;
  }

  #nav-rspn-btn .label {
    display: inline;
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  #nav-rspn-btn .btn-inner {
    gap: 6px;
  }

  .nav-right {
    gap: 8px;
  }

  .phase-one {
    font-size: 16px;
    letter-spacing: 0.08em;
  }

  .visuals {
    font-size: 9px;
    letter-spacing: 0.25em;
  }

  .nav-links {
    width: 100%;
    padding: 48px 24px 32px;
    gap: 2px;
  }

  .nav-links a:not(.pov-btn) {
    font-size: 19px;
    padding: 15px 20px;
  }

  .nav-links .nav-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 400px) {
  .phase-one {
    font-size: 14px;
    letter-spacing: 0.06em;
  }

  .visuals {
    font-size: 8px;
    letter-spacing: 0.2em;
  }

  #nav-rspn-btn .pov-btn {
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    padding: 0 8px;
  }

  #nav-rspn-btn .icon {
    width: 14px;
  }

  #nav-rspn-btn .icon svg {
    width: 14px;
    height: 14px;
  }

  #nav-rspn-btn .label {
    font-size: 9px;
    letter-spacing: 1px;
  }

  #nav-rspn-btn .btn-inner {
    gap: 5px;
  }
}
