@import url('https://fonts.googleapis.com/css2?family=Mrs+Saint+Delafield&display=swap');

/* Navbar Layout */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: var(--spacing-md) var(--spacing-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1001;
  /* Must be above the menu overlay */
  mix-blend-mode: difference;
  /* Highly premium effect: text adapts to background */
}

.navbar a {
  position: relative;
}

.navbar-left,
.navbar-center,
.navbar-right {
  flex: 1;
}

.navbar-left {
  display: flex;
  align-items: center;
}

.navbar-center {
  text-align: center;
}

.navbar-right {
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  align-items: center;
}

/* Theme Toggle Button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  /* Fixed white — see .nav-link comment above. */
  color: var(--nav-ink);
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme='light'] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme='light'] .theme-toggle .icon-moon {
  display: block;
}

.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(20deg);
}

.nav-link {
  font-size: 0.9rem;
  font-style: italic;
  font-family: serif;
  letter-spacing: 0.5px;
  /* Fixed white (not the theme-reactive token): mix-blend-mode: difference
     on .navbar only produces guaranteed contrast against any backdrop when
     the source color is pure white. */
  color: var(--nav-ink);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
}

.brand-logo-img {
  height: 32px;
  width: auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.brand-logo-text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  opacity: 0.6;
  /* Fixed white — see .nav-link comment above. */
  color: var(--nav-ink);
  position: absolute;
  bottom: -8px;
  z-index: 10;
  text-transform: uppercase;
  font-weight: 300;
  white-space: nowrap;
  pointer-events: none;
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.05);
  opacity: 0.8;
}

/* Premium Hamburger Toggle Button */
.menu-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  position: relative;
  width: 32px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1002;
  /* Top-most */
}

.menu-toggle-line {
  display: block;
  height: 2px;
  /* Fixed white — see .nav-link comment above. */
  background-color: var(--nav-ink);
  transition:
    transform 0.4s cubic-bezier(0.7, 0, 0.3, 1),
    width 0.4s cubic-bezier(0.7, 0, 0.3, 1),
    background-color 0.4s ease;
}

.menu-toggle-line.line-1 {
  width: 100%;
}

.menu-toggle-line.line-2 {
  width: 65%;
  align-self: flex-start;
}

/* Hover effect */
.menu-toggle:hover .menu-toggle-line.line-2 {
  width: 100%;
}

/* Active State (X) */
.menu-toggle.is-active .menu-toggle-line.line-1 {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-active .menu-toggle-line.line-2 {
  width: 100%;
  transform: translateY(-6px) rotate(-45deg);
}

/* Menu Overlay Container */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

.menu-overlay-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(var(--color-bg-dark-rgb), 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.menu-overlay-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  padding: 0 var(--spacing-xl);
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: var(--spacing-xl);
  align-items: center;
  z-index: 2;
  box-sizing: border-box;
}

/* Overlay Navigation */
.menu-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-nav-item {
  overflow: hidden;
  margin-bottom: var(--spacing-sm);
}

.menu-nav-link {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-family: serif;
  font-style: italic;
  color: var(--color-text-light);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: var(--spacing-md);
  line-height: 1;
  transition:
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    color 0.4s ease;
  transform-origin: left;
}

.menu-nav-num {
  font-size: 1rem;
  font-family: var(--font-brand);
  font-style: normal;
  color: rgba(var(--ink), 0.3);
  font-weight: 300;
}

/* Navigation Hover Animation */
.menu-nav-link:hover {
  color: var(--color-accent);
  transform: translateX(20px) skewX(-5deg);
}

/* Sidebar Info Panel */
.menu-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding-left: var(--spacing-xl);
  border-left: 1px solid rgba(var(--ink), 0.1);
  box-sizing: border-box;
}

.menu-sidebar-section {
  opacity: 0;
  transform: translateY(20px);
}

.menu-sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(var(--ink), 0.4);
  margin-bottom: var(--spacing-xs);
  margin-top: 0;
  font-family: var(--font-brand);
}

.menu-sidebar-text {
  font-size: 1rem;
  color: var(--color-text-light);
  margin: 0;
  line-height: 1.6;
  font-family: var(--font-primary);
  font-weight: 300;
}

.menu-social-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.menu-social-link {
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 1rem;
  transition:
    color 0.3s ease,
    padding-left 0.3s ease;
  display: inline-block;
}

.menu-social-link:hover {
  color: var(--color-accent);
  padding-left: 5px;
}

/* Body Scroll Lock */
body.menu-open {
  overflow: hidden;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .navbar {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .menu-overlay-content {
    padding: 0 var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: var(--spacing-sm) var(--spacing-sm);
  }

  .brand-logo-img {
    height: 24px;
  }

  .navbar-right .nav-link {
    display: none;
    /* Hide 'Let's talk' on mobile header to focus on hamburger */
  }

  .menu-overlay-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-md);
  }

  .menu-sidebar {
    border-left: none;
    padding-left: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--spacing-md);
  }

  .menu-sidebar-section {
    flex: 1 1 40%;
  }

  .menu-nav-link {
    font-size: clamp(2rem, 8vw, 3rem);
  }
}