/* Shared site header (homepage + inner pages) */

.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--color-brand);
  color: #fff;
  padding: 0.5em 1em;
  z-index: 10000;
  transform: translateY(-120%);
  transition: transform 0.3s;
}

.skip-link:focus {
  transform: translateY(0);
  clip: auto;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(19, 22, 25, 0.28);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  z-index: 1000;
  overflow-x: clip;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

.header:not(.header--scrolled):not(.header--solid) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .header:not(.header--scrolled):not(.header--solid) {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(19, 22, 25, 0.82);
  }
}

.header--scrolled,
.header--solid {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.05),
    0 4px 24px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.header--scrolled .header__container,
.header--solid .header__container {
  border-bottom: none;
}

.header__container {
  display: flex;
  align-items: center;
  position: relative;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0.65rem var(--layout-padding-end) 0.65rem var(--layout-padding-start);
  min-height: 80px;
  border-bottom: none;
  transition: border-bottom 0.3s ease;
}

.header__start,
.header__end {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.header__start .logo,
.header__end > .header__cta,
.header__end > .header__contact--desktop,
.header__container > .header__cta--mobile {
  pointer-events: auto;
}

.header__start {
  justify-content: flex-start;
}

.header__end {
  justify-content: flex-end;
  gap: 1.75rem;
  flex-shrink: 0;
}

.header__end > .header__cta,
.header__end > .header__contact--desktop {
  flex-shrink: 0;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  user-select: none;
}

.header__container > .hamburger,
.header__container > .header__contact--mobile,
.header__container > .header__cta--mobile {
  display: none;
}

.logo__name {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
  color: #ffffff;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.header--scrolled .logo__name,
.header--solid .logo__name {
  color: var(--color-ink);
}

.logo__title {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 0.15em;
  transition: color 0.3s ease;
}

.header--scrolled .logo__title,
.header--solid .logo__title {
  color: #2c2c2c;
}

.nav {
  display: flex;
  gap: clamp(0.85rem, 1.5vw, 2rem);
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 16rem;
  right: 28rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  min-width: 0;
}

.header .nav__link {
  font-size: 1.05rem;
  color: #ffffff;
  font-weight: 500;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 0.5em 0;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.nav__link:hover::after {
  width: 100%;
}

.header--scrolled .nav__link,
.header--solid .nav__link {
  color: #2c2c2c;
}

.header--scrolled .nav__link::after,
.header--solid .nav__link::after {
  background: var(--color-brand);
}

.header--scrolled .nav__link:hover,
.header--solid .nav__link:hover {
  color: var(--color-brand);
}

.header__contact {
  display: flex;
  gap: 1.5vw;
  align-items: center;
}

.header__contact.header__contact--desktop {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.header .header__contact--desktop .contact__link {
  font-size: 0.92rem;
  line-height: 1.3;
}

.header .contact__link {
  font-size: 1rem;
  color: #ffffff;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.header .contact__link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.header--scrolled .contact__link,
.header--solid .contact__link {
  color: #3a3a3a;
}

.header--scrolled .contact__link:hover,
.header--solid .contact__link:hover {
  color: var(--color-brand);
}

.header__contact--mobile {
  display: none;
  flex-direction: column;
  gap: 0.2em;
  align-items: center;
  margin: 0 0 0.2em 0;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  justify-content: center;
  align-items: center;
  height: 44px;
  width: 44px;
  min-height: 44px;
  min-width: 44px;
  position: relative;
  z-index: 1100;
  padding: 0;
}

.hamburger:focus {
  outline: none;
}

.hamburger:focus-visible {
  outline: 0.125rem solid var(--color-brand);
  outline-offset: 0.2rem;
}

.hamburger__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  transition: all 0.3s ease;
  border-radius: 1px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.hamburger__bar:first-child {
  top: 12px;
}

.hamburger__bar:nth-child(2) {
  top: 19px;
}

.hamburger__bar:last-child {
  top: 26px;
}

.header--scrolled .hamburger__bar,
.header--solid .hamburger__bar {
  background: #000;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.12);
  z-index: 999;
  display: none;
  flex-direction: column;
  padding: 0;
  max-height: calc(100vh - var(--header-height, 80px));
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.mobile-nav.show {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
  animation: mobileNavFadeIn 0.3s;
}

.mobile-nav.hide {
  opacity: 0;
  pointer-events: none;
  animation: mobileNavFadeOut 0.2s forwards;
}

@keyframes mobileNavFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes mobileNavFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

.mobile-nav__link {
  color: #1a1a1a;
  font-size: 1.15rem;
  padding: 0;
  text-align: center;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: none;
  font-weight: 500;
  position: relative;
  border-radius: 0;
  margin: 0;
  letter-spacing: -0.01em;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  transition: opacity 0.3s ease;
}

.mobile-nav__link:last-child::after {
  display: none;
}

.mobile-nav__link:hover,
.mobile-nav__link:focus-visible {
  color: #ffffff;
  background: var(--color-brand-deep);
}

.mobile-nav__link:hover::after,
.mobile-nav__link:focus-visible::after {
  opacity: 0;
}

.nav__link--active,
.mobile-nav__link--active {
  position: relative;
}

.header .nav__link.nav__link--active {
  font-weight: 600;
}

.header .nav__link.nav__link--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ffffff;
}

.header--scrolled .header .nav__link.nav__link--active,
.header--solid .header .nav__link.nav__link--active {
  color: var(--color-brand);
}

.header--scrolled .header .nav__link.nav__link--active::after,
.header--solid .header .nav__link.nav__link--active::after {
  background: var(--color-brand);
}

.mobile-nav__link--active {
  color: #ffffff;
  font-weight: 600;
  background: var(--color-brand-deep);
}

.hamburger.active .hamburger__bar:first-child {
  top: 19px;
  transform: translateX(-50%) rotate(45deg);
}

.hamburger.active .hamburger__bar:last-child {
  top: 19px;
  transform: translateX(-50%) rotate(-45deg);
}

.hamburger.active .hamburger__bar:nth-child(2) {
  opacity: 0;
  transform: translateX(-50%) scaleX(0);
}

body.page-inner {
  padding-top: var(--header-offset, 80px);
}

.header a.header__cta {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  border-radius: 0.375rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  border: 0.125rem solid var(--color-brand);
  background: var(--color-brand);
  color: #ffffff;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.header--solid a.header__cta.header__cta--desktop,
.header a.header__cta.header__cta--desktop {
  display: inline-flex;
}

.header a.header__cta.header__cta--mobile {
  display: none;
}

.header a.header__cta:hover,
.header a.header__cta:focus-visible {
  background: var(--color-brand-deep);
  border-color: var(--color-brand-deep);
  color: #ffffff;
}

.header:not(.header--scrolled):not(.header--solid) a.header__cta.header__cta--desktop {
  background: #ffffff;
  color: var(--color-brand);
  border-color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.header:not(.header--scrolled):not(.header--solid) a.header__cta.header__cta--desktop:hover,
.header:not(.header--scrolled):not(.header--solid) a.header__cta.header__cta--desktop:focus-visible {
  background: var(--color-brand);
  color: #ffffff;
  border-color: #ffffff;
}

.header:not(.header--scrolled):not(.header--solid) a.header__cta.header__cta--mobile {
  background: #ffffff;
  color: var(--color-brand);
  border-color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.header:not(.header--scrolled):not(.header--solid) a.header__cta.header__cta--mobile:hover,
.header:not(.header--scrolled):not(.header--solid) a.header__cta.header__cta--mobile:focus-visible {
  background: var(--color-brand);
  color: #ffffff;
  border-color: #ffffff;
}

.mobile-nav a.mobile-nav__cta {
  display: none;
}

@media (max-width: 1560px) {
  .nav {
    left: 14.5rem;
    right: 26.5rem;
  }

  .header .nav__link {
    font-size: 0.98rem;
  }
}

@media (max-width: 1460px) {
  .nav {
    left: 13.5rem;
    right: 25.5rem;
    gap: 0.75rem;
  }

  .header .nav__link {
    font-size: 0.92rem;
  }

  .header a.header__cta {
    font-size: 0.7rem;
    padding: 0.65rem 1rem;
  }

  .header .header__contact--desktop .contact__link {
    font-size: 0.86rem;
  }
}

@media (max-width: 1360px) and (min-width: 901px) {
  .header__container > .nav {
    display: none;
  }

  .header__container > .hamburger {
    display: flex;
    position: absolute;
    left: 2vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
  }

  .header__start {
    padding-left: 2.75rem;
  }
}

@media (max-width: 1200px) {
  .header .contact__link {
    font-size: 0.88rem;
  }
}

@media (max-width: 900px) {
  .header {
    padding-bottom: 0;
  }

  .header__container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    align-items: center;
    row-gap: 0.35rem;
    min-height: auto;
    padding: 0.5rem var(--layout-padding-inline-mobile) 0.6rem;
    position: relative;
  }

  .header__container > .nav {
    display: none;
  }

  .header__contact--desktop,
  .header a.header__cta.header__cta--desktop,
  .header__end {
    display: none;
  }

  .header__container > .hamburger {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    position: relative;
    transform: none;
    justify-self: start;
    align-self: center;
    z-index: 3;
  }

  .header a.header__cta.header__cta--mobile {
    display: inline-flex;
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    align-self: center;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 44px;
    padding: 0.65rem 1rem;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
    text-align: center;
    pointer-events: auto;
  }

  .header__start {
    grid-column: 1;
    grid-row: 1;
    flex: none;
    width: 100%;
    justify-content: center;
    padding: 0;
    min-width: 0;
  }

  .header__container > .header__contact--mobile {
    display: flex;
    grid-column: 1;
    grid-row: 3;
  }

  .logo {
    align-items: center;
    margin: 0 auto;
    padding-top: 0;
    text-align: center;
    position: relative;
    left: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
  }

  .logo__name {
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .logo__title {
    font-size: clamp(0.625rem, 2.8vw, 0.72rem);
    margin-top: 0.1em;
    letter-spacing: 0.16em;
  }

  .header__contact--mobile {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    align-items: center;
    padding: 0.15rem 0 0;
    font-size: clamp(0.8125rem, 2vw, 0.9rem);
    margin-top: 0;
  }

  .header__contact--mobile .contact__link {
    font-size: clamp(0.8125rem, 2vw, 0.9rem);
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }

  .header--scrolled .header__contact--mobile,
  .header--solid .header__contact--mobile {
    border-top: none;
  }
}
