/* ─── SHARED NAV COMPONENT ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.5s, backdrop-filter 0.5s;
}

.nav.scrolled {
  background: rgba(13,10,20,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(232,115,89,0.1);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-bottom 0.3s ease;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(232,115,89,0.25);
}

.nav-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-brand-logo .logo-fallback {
  display: none;
}

.nav-brand-logo img.img-error + .logo-fallback,
.nav-brand-logo img[data-failed] ~ .logo-fallback {
  display: flex;
}

.logo-j-styled {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--cream);
  background: linear-gradient(135deg, #1A1228 0%, #2A1F3D 100%);
  border: 1px solid rgba(232,115,89,0.2);
  border-radius: 10px;
  letter-spacing: 1px;
}

.nav-brand-text {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--cream);
}

.tm {
  font-size: 0.4em;
  font-weight: 300;
  opacity: 0.5;
  vertical-align: super;
  letter-spacing: 0;
  font-family: var(--sans);
  margin-left: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.nav-link {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: rgba(250,240,232,0.55);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  display: block;
  height: 1px;
  background: #E87359;
  width: 0;
  transition: width 0.3s ease;
  margin-top: 4px;
}

.nav-link:hover {
  color: #FAF0E8;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: #E87359;
}

.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  padding: 10px 24px;
  background: rgba(250,240,232,0.28);
  border: 1px solid rgba(250,240,232,0.48);
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  transition: all 0.5s cubic-bezier(.23,1,.32,1);
  letter-spacing: 0.3px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.nav-cta.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-cta:hover {
  background: rgba(232,115,89,0.15);
  border-color: rgba(232,115,89,0.3);
  transform: translateY(-1px);
}

/* ─── MOBILE MENU ─── */
.nav-mobile-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(250,240,232,0.15);
  background: rgba(250,240,232,0.04);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.4s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.nav-mobile-toggle span {
  display: block;
  position: absolute;
  left: 50%;
  height: 1px;
  background: rgba(250,240,232,0.5);
  transition: all 0.4s ease;
  transform-origin: center;
}

.nav-mobile-toggle span:first-child {
  width: 14px;
  top: 13px;
  margin-left: -7px;
}

.nav-mobile-toggle span:last-child {
  width: 10px;
  top: 18px;
  margin-left: -5px;
}

/* Light section (over white/light backgrounds) */
.nav--light .nav-mobile-toggle {
  border-color: rgba(232,115,89,0.35);
  background: rgba(232,115,89,0.08);
}

.nav--light .nav-mobile-toggle span {
  background: rgba(13,10,20,0.65);
}

/* Open state (always the same regardless of section) */
.nav-mobile-toggle.open {
  border-color: rgba(232,115,89,0.5);
  background: rgba(232,115,89,0.15);
}

.nav-mobile-toggle.open span {
  background: rgba(250,240,232,0.9);
}

.nav-mobile-toggle.open span:first-child {
  width: 14px;
  top: 16px;
  margin-left: -7px;
  transform: rotate(45deg);
}

.nav-mobile-toggle.open span:last-child {
  width: 14px;
  top: 16px;
  margin-left: -7px;
  transform: rotate(-45deg);
}

.nav-mobile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: rgba(13,10,20,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(232,115,89,0.1);
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9) translateY(-8px);
  transform-origin: top right;
  transition: all 0.35s cubic-bezier(0.23,1,0.32,1);
  z-index: 200;
}

.nav-mobile-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.nav-mobile-dropdown a {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: rgba(250,240,232,0.65);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.nav-mobile-dropdown a:hover {
  background: rgba(232,115,89,0.08);
  color: #E87359;
}

.nav-mobile-dropdown .mobile-menu-divider {
  height: 1px;
  background: rgba(232,115,89,0.06);
  margin: 0;
  border: none;
}

.nav-mobile-wrapper {
  display: none;
  position: relative;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 767px) {
  .nav { padding: 16px 20px; justify-content: space-between; align-items: center; gap: 12px; }
  .nav-brand-text { font-size: 20px; letter-spacing: 2px; }
  .nav-brand-logo { width: 34px; height: 34px; }
  .nav-links { display: none; }
  .nav-mobile-wrapper { display: block; position: relative; }
  .nav-mobile-toggle { display: flex; }
}

@media (max-width: 480px) {
  .nav { padding: 14px 16px; justify-content: space-between; align-items: center; gap: 10px; }
  .nav-brand-logo { width: 32px; height: 32px; border-radius: 8px; }
  .nav-brand-text { font-size: 18px; letter-spacing: 2px; }
  .nav-brand { gap: 10px; }
}
