/* NAV */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: 70px;
  /* background: #000; */
    border-bottom: 1px solid rgba(var(--dz-fg-rgb), 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  z-index: 9999999;

  transform: translateY(0);

  /* 🔥 COMBINE ALL TRANSITIONS */
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.25s ease;

     will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);

  background: transparent;
}

/* 🔻 HIDE NAV */
nav.nav-hidden {
  transform: translateY(-110%);
}

/* 🔺 SHOW NAV WITH BG */
nav.nav-visible {
  background: var(--dz-bg);
    border-bottom: 1px solid rgba(var(--dz-fg-rgb), 0.12);
  /* height: 70px; */
  /* optional premium */
  /* backdrop-filter: blur(8px); */
}

/* HOME — BG FROM THE FIRST PIXEL
   Everywhere else the nav starts transparent and only takes the page
   colour once you scroll past 20px (js/header.js adds .nav-visible).
   On the home page it carries that colour over the hero too, so the
   bar is solid from the top rather than fading in on the first
   scroll. Scoped by .hero, which only index.html has — no extra class
   on the markup, and the injected header needs no page awareness.
   .menu-open below still overrides this when the menu is open. */
body:has(.hero) nav {
  background: var(--dz-bg);
}

/* 🚫 MENU OPEN (NO BG CONFLICT) */
nav.menu-open {
  background: transparent !important;
  border-bottom: none !important;
}

nav.menu-open.nav-visible {
  border-bottom: none;
}

/* LOGO + TOGGLER */
.nav-logo,
.nav-toggler {
  padding: 1rem;
  cursor: pointer;
}

.nav-logo img {
  width: 150px;
  height: auto;
}

/* TOGGLER */
.nav-toggler {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-toggler span {
  width: 40px;
  height: 2px;
  background: var(--dz-fg);
  transition: 0.4s;
}

.nav-toggler.open span:first-child {
  transform: translateY(3.5px) rotate(45deg) scaleX(0.75);
}

.nav-toggler.open span:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg) scaleX(0.75);
}

/* RIGHT SIDE — theme switch, then the menu toggler */
.nav-actions {
  display: flex;
  align-items: center;
}

/* THEME SWITCH — round outline like the footer's Back to top; fills
   with the ink colour on hover. The icon shows the mode you switch TO
   (sun in dark mode, moon in light) — js/main.js keeps it in sync. */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;

  color: var(--dz-fg);
  background: none;
  border: 1px solid rgba(var(--dz-fg-rgb), 0.25);
  border-radius: 50%;
  cursor: pointer;

  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.theme-toggle i {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--dz-bg);
  background: var(--dz-fg);
  border-color: var(--dz-fg);
}

.theme-toggle:focus-visible {
  outline: 1px solid var(--dz-fg);
  outline-offset: 3px;
}

/* the new icon turns in after each switch */
.theme-toggle.is-switching i {
  animation: themeIconIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes themeIconIn {
  from { transform: rotate(-90deg) scale(0.5); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle.is-switching i {
    animation: none;
  }
}


/* MENU */
.nav-content {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}


.nav-items-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* 🔥 key */
  height: 100%;
}

.nav-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: scaleY(0);
  transform-origin: top;
}

.nav-bg:nth-child(1) {
  background: var(--dz-surface-1);
}

.nav-bg:nth-child(2) {
  background: var(--dz-surface-2);
}

.nav-bg:nth-child(3) {
  background: var(--dz-surface-3);
}

.nav-bg:nth-child(4) {
  background: var(--dz-surface-2);
}

.nav-items {
  display: flex;
  height: 100vh;
  gap: 2rem;
  padding: 8rem 2rem 4rem 2rem;
  background: var(--dz-bg);
  clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%);
  pointer-events: auto;
}

.menu-reveal {
  overflow: hidden;
  display: block;
  width: fit-content;
  clip-path: inset(0 0 100% 0);
}

/* LAYOUT FIX */
.nav-primary-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* BASE LINK */
.nav-primary-links a {
  position: relative;
  display: inline-block;
  width: fit-content;
  overflow: hidden;
  color: #797979;
  text-decoration: none;
  line-height: 1.1;
  font-size: 6.5rem;
  font-family: "degular", sans-serif;
  font-weight: var(--dz-heading-weight);
  will-change: transform, clip-path;
}


/* TEXT LAYERS */
.nav-primary-links a span {
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.3s ease;
}


/* SECOND TEXT */
.nav-primary-links a span:nth-child(2) {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
}

/* HOVER SLIDE */
.nav-primary-links a:hover span:first-child {
  transform: translateY(-100%);
}

.nav-primary-links a:hover span:last-child {
  transform: translateY(0);
}

/* ACTIVE STATE */
.nav-primary-links a.active span:nth-child(1),
.nav-primary-links a.active span:nth-child(2) {
  color: #FF6500;
}

.nav-primary-links a {
  font-size: 6.5rem;
}

.nav-content a .line {
  transform: translateY(100%);
}

.nav-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 100%;
  margin-left: auto;
}

.nav-right>* {
  width: 340px;
  /* keeps nice column */
}

.nav-social-links {
  align-items: flex-start;
}

.nav-location {
  text-align: left;
}

.nav-footer {
  justify-content: flex-start;
}

/* CONTAINER */
.nav-social-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

/* LINK */
.nav-social-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 14px;
  color: rgba(var(--dz-fg-rgb), calc(0.7 + var(--dz-text-lift)));
  transition: color 0.3s ease;
}

/* ICON WRAPPER */
.nav-social-links .icon {
  display: inline-block;
}

/* ICON */
.nav-social-links i {
  font-size: 14px;
  transition: filter 0.3s ease;
}

/* 🔥 HOVER */
.nav-social-links a:hover {
  color: var(--dz-fg);
}

/* 👉 TRIGGER ANIMATION */
.nav-social-links a:hover .icon {
  animation: arrowReenter45 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ✨ DIAGONAL RE-ENTER (↗ direction) */
@keyframes arrowReenter45 {
  0% {
    transform: translate(0, 0);
    opacity: 1;
  }

  40% {
    transform: translate(10px, -10px);
    /* go ↗ */
    opacity: 0;
  }

  41% {
    transform: translate(-10px, 10px);
    /* re-enter ↙ */
    opacity: 0;
  }

  100% {
    transform: translate(0, 0);
    opacity: 1;
  }
}

.nav-location {
  max-width: 360px;
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
}

.nav-location .label {
  /* typography now comes from the shared .dz-eyebrow */
  margin-bottom: 20px;
}

.nav-location .muted {
  opacity: calc(0.5 + var(--dz-text-lift));
}


/* FOOTER (bottom-right) */
.nav-footer {
  position: static;
  bottom: 2rem;
  right: 2rem;

  display: flex;
  align-items: center;
  gap: 40px;

  font-size: 12px;
  color: rgba(var(--dz-fg-rgb), calc(0.6 + var(--dz-text-lift)));
}

/* LINKS */
.nav-footer-links {
  display: flex;
  gap: 30px;
}

.nav-footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-footer a:hover {
  color: var(--dz-fg);
}



/* MOBILE */
@media (max-width: 1000px) {
  .nav-items {
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
  }

  .nav-legal,
  .nav-secondary-links {
    display: none;
  }
}


/* ==========================================================
   PHONE  (≤ 767px)
   Bar: logo and toggler sit on the shared 1.25rem gutter.
   Menu: one column — the six links as a tight display stack
   that fills the width, then socials as a single row, the
   studio address, and the legal line pinned to the bottom.
========================================================== */
@media (max-width: 1024px) {
  nav {
    height: 64px;
    padding: 0 0.25rem;
  }

  .nav-logo img {
    width: 118px;
  }

  .nav-actions {
    gap: 0.25rem;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .nav-toggler span {
    width: 32px;
  }

  .nav-content,
  .nav-items {
    height: 100vh;
    height: 100dvh;
  }

  .nav-items {
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
    padding: 6.5rem var(--dz-gutter) 1.75rem;
    overflow-y: auto;
  }

  .nav-left {
    height: auto;
    flex: 0 0 auto;
  }

  .nav-primary-links {
    gap: 0.15rem;
  }

  .nav-primary-links a {
    font-size: clamp(2.6rem, 13.5vw, 3.6rem);
    line-height: 1.02;
    color: rgba(var(--dz-fg-rgb), 0.45);
  }

  /* the right column becomes the menu's foot */
  .nav-right {
    height: auto;
    margin-left: 0;
    align-items: stretch;
    gap: 1.75rem;
  }

  .nav-right > * {
    width: auto;
  }

  .nav-social-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.6rem 1.25rem;
  }

  .nav-social-links a {
    font-size: 14px;
  }

  .nav-location {
    max-width: none;
    font-size: 14px;
    line-height: 1.55;
  }

  .nav-location .label {
    margin-bottom: 0.75rem;
  }

  .nav-footer {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(var(--dz-fg-rgb), 0.1);
    font-size: 11px;
  }

  .nav-footer-links {
    gap: 1.25rem;
  }
}