.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: background 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
}

.site-header.scrolled {
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.9rem 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-identity {
  flex: 0 1 32%;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 1rem;
  overflow: hidden;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: #F0EDE8;
  text-decoration: none;
  text-transform: uppercase;
}
.logo span {
  display: block;
}
.logo .logo-accent {
  color: #D4A373;
}

.logo-title {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-image {
  display: flex;
  align-items: center;
  max-width: min(var(--header-logo-size), 200px);
}
.logo-image .custom-logo-link {
  display: block;
  line-height: 0;
}
.logo-image .custom-logo {
  display: block;
  width: min(var(--header-logo-size), 200px);
  max-width: 100%;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}

.main-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 2.5vw, 2.5rem);
}

.nav-links {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 2.2rem;
  list-style: none;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.nav-links li {
  position: relative;
}

.nav-links .sub-menu {
  position: absolute;
  top: 100%;
  left: -1rem;
  z-index: 1002;
  display: block;
  min-width: 190px;
  padding: 0.65rem 0;
  background: rgba(18, 18, 20, 0.98);
  border: 1px solid rgba(240, 237, 232, 0.1);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.nav-links li:hover > .sub-menu,
.nav-links li:focus-within > .sub-menu,
.nav-links li.submenu-open > .sub-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-links li.submenu-open > .sub-menu {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}
.nav-links .sub-menu li {
  width: 100%;
}
.nav-links .sub-menu a {
  display: block;
  padding: 0.7rem 1rem;
  font-size: 0.68rem;
  white-space: nowrap;
}
.nav-links .sub-menu .sub-menu {
  top: -0.65rem;
  left: calc(100% + 1px);
}
.submenu-toggle {
  display: none;
}

.nav-links a {
  font-size: clamp(0.62rem, 0.7vw, 0.72rem);
  font-weight: 500;
  letter-spacing: clamp(0.08em, 0.12vw, 0.12em);
  text-transform: uppercase;
  color: #A8A4A0;
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #D4A373;
  transition: width 0.3s ease;
}
.nav-links a:hover {
  color: #F0EDE8;
}
.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  flex: 0 0 auto;
  font-size: 0.7rem;
  padding: 0.75rem 1.6rem;
  min-width: 168px;
  white-space: nowrap;
}

.main-nav:has(> .nav-cta + .nav-cta) > .nav-cta {
  min-width: 0;
  padding: 0.65rem 1rem;
}

@media (min-width: 901px) and (max-width: 1150px) {
  .header-inner {
    gap: 1rem;
  }
  .site-identity {
    flex-basis: 28%;
  }
  .nav-links {
    gap: 0.85rem;
  }
  .nav-cta {
    min-width: 150px;
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (min-width: 901px) {
  .logo-image {
    max-width: 100%;
  }
  .logo-image .custom-logo {
    width: min(var(--header-logo-size), 100%);
  }
  .logo-title {
    min-width: 0;
  }
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: #F0EDE8;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 900px) {
  .site-identity {
    flex: 1 1 auto;
    max-width: calc(100% - 42px);
  }
  .logo-image {
    flex: 0 0 auto;
  }
  .logo-title {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }
  .main-nav {
    position: fixed;
    top: var(--sawundswing-header-offset);
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: calc(100vh - var(--sawundswing-header-offset));
    background: #121214;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .main-nav.open {
    right: 0;
  }
  .nav-links {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.8rem;
  }
  .nav-links a {
    font-size: 0.9rem;
    letter-spacing: 0.15em;
  }
  .nav-links li {
    width: 100%;
    text-align: center;
  }
  .nav-links .menu-item-has-children > a {
    display: inline-block;
    max-width: calc(100% - 2rem);
  }
  .submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.35rem;
    border: 1px solid rgba(240, 237, 232, 0.25);
    background: transparent;
    color: #A8A4A0;
    cursor: pointer;
    font-size: 0.75rem;
  }
  .submenu-toggle[aria-expanded="true"] {
    color: #D4A373;
    border-color: #D4A373;
  }
  .nav-links .sub-menu {
    position: static;
    display: none;
    min-width: 0;
    padding: 0.4rem 0 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
  .nav-links li.submenu-open > .sub-menu {
    display: block;
  }
  .nav-links .sub-menu a {
    padding: 0.55rem 0.5rem;
    font-size: 0.76rem;
  }
  .nav-links .sub-menu .sub-menu {
    left: auto;
  }
  .hamburger {
    display: flex;
  }
  .nav-cta {
    font-size: 0.8rem;
    padding: 1rem 2rem;
    top: -0.75rem;
  }

  .main-nav:has(> .nav-cta + .nav-cta) > .nav-cta {
    min-height: 44px;
    padding: 0.7rem 1rem;
  }
}

@media (max-width: 480px) {
  .site-identity {
    gap: 0.5rem;
  }
  .logo-title {
    max-width: 150px;
    font-size: 0.95rem;
  }
}
