/* Global nav — shared across portfolio and inner pages.
   Requires in page :root: --plum, --ivory, --charcoal, --warm-white, --terracotta */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

/* Inner wrapper constrains nav content to match page content width */
.nav-content {
  max-width: 1920px;
  margin: 0 auto;
  padding: 1rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(245, 239, 224, 0.75);
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

nav.scrolled .nav-logo {
  color: #6B2D6E;
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--ivory);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  transition: background 0.3s ease;
}

.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
  transform: scale(1.7);
  transform-origin: 50% 15%;
}

nav.scrolled .nav-avatar {
  background: transparent;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  background: rgba(20, 16, 14, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 0.5rem 1.8rem;
  transition: background 0.4s ease, border-radius 0.4s ease, padding 0.4s ease;
}

.nav-links a {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: #F5EFE0;
  text-transform: uppercase;
  text-decoration: none;
}

nav.scrolled {
  background: rgb(245, 239, 224);
  backdrop-filter: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

nav.scrolled .nav-links {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  padding: 0;
}

nav.scrolled .nav-links a {
  color: #1E1A18;
  font-weight: 400;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 14, 0.55);
  border: none;
  border-radius: 50%;
  color: #F5EFE0;
  font-size: 1.25rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

nav.scrolled .nav-toggle {
  background: rgba(30, 26, 24, 0.12);
  color: #1E1A18;
}

@media (max-width: 900px) {
  .nav-content {
    padding: 1rem 1.25rem;
  }
  .nav-links {
    gap: 1.25rem;
    padding: 0.4rem 1rem;
  }
  .nav-links a {
    font-size: 0.75rem;
  }
}

/* Phone landscape: match hero-left padding so logo aligns with content edges */
@media (max-height: 500px) {
  .nav-content {
    padding: 0.6rem 1.5rem;
  }
}

@media (max-width: 640px) {
  nav {
    position: fixed; /* ensure nav is the containing block for dropdown */
  }
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    margin-top: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    border-radius: 12px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease, visibility 0.25s;
    background: var(--charcoal) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }
  nav.scrolled .nav-links {
    background: var(--plum) !important;
  }
  nav.nav-open .nav-links {
    max-height: 320px;
    opacity: 1;
    visibility: visible;
  }
  .nav-links li {
    border-bottom: 1px solid rgba(245, 239, 224, 0.15);
  }
  .nav-links li:last-child {
    border-bottom: none;
  }
  .nav-links a {
    display: block;
    padding: 0.85rem 1.25rem;
    font-size: 0.8rem;
    color: var(--ivory) !important;
  }
  .nav-logo {
    font-size: 0.95rem;
  }
}

/* 360px (e.g. Galaxy S8): compact nav so logo doesn’t overlap hero headline */
@media (max-width: 360px) {
  .nav-content {
    padding: 0.75rem 0.75rem;
  }
  .nav-logo {
    font-size: 0.8rem;
    gap: 0.35rem;
  }
  .nav-avatar {
    width: 24px;
    height: 24px;
  }
}

@media (min-width: 1600px) {
  .nav-content {
    padding: 1rem 5rem;
  }
  .nav-logo {
    font-size: 1.05rem;
    gap: 0.75rem;
  }
  .nav-avatar {
    width: 34px;
    height: 34px;
  }
  .nav-links {
    padding: 0.65rem 2.25rem;
    gap: 3rem;
  }
  .nav-links a {
    font-size: 0.82rem;
  }
}
