/* Lets the menu backdrop's fade transition; without it the fade
   simply switches. */
@property --fade {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 16px var(--section-padding-x);
  background: rgba(242, 242, 242, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  transition: transform 0.3s ease;
}

.site-header--hidden {
  transform: translateY(-100%);
}

.site-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-header__logo-img--desktop { display: block; width: 133px; height: 33px; }
.site-header__logo-img--mobile  { display: none; width: 95px; height: 23.75px; }

.logo-eye { transition: fill 0.8s ease; }

.site-header__group--desktop {
  display: flex;
  align-items: center;
  gap: 0;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 32px;
  border-radius: 32px;
  background: var(--color-cards-bg);
}
.site-header__nav a {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: var(--font-size-nav);
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.site-header__lang { text-transform: uppercase; }

.site-header__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  aspect-ratio: 1;
  border-radius: 100px;
  background: var(--color-cards-bg);
}
.site-header__icon-btn img { width: 23px; height: 23px; display: block; }

.site-header__login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: 67.203px;
  background: var(--color-cards-bg);
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: var(--font-size-nav);
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.site-header__group--mobile { display: none; }
.site-header__menu-backdrop,
.site-header__menu-panel { display: none; }

@media (max-width: 988px) {
  .site-header {
    padding: 12px 20px;
  }
  .site-header__logo-img--desktop { display: none; }
  .site-header__logo-img--mobile  { display: block; }

  .site-header__group--desktop { display: none; }
  .site-header__group--mobile {
    display: flex;
    align-items: center;
    gap: 0;
  }

  .site-header__login--mobile {
    padding: 8px 20px;
    border-radius: 71.653px;

    box-shadow: 4px 4px 6.2px rgba(0, 0, 0, 0.02);
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 18px;
  }

  .site-header__burger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    aspect-ratio: 1;
    padding: 8px;
    border: none;
    border-radius: 32px;
    background: var(--color-cards-bg);
    cursor: pointer;
  }

  .site-header__burger-icon {
    position: relative;
    display: block;
    width: 23px;
    height: 23px;
  }
  .site-header__burger-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 17px;
    height: 1.4px;
    background: var(--color-text);
    border-radius: 1px;
    transform: translate(-50%, -50%) translateY(-2.5px);
    transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
  }
  .site-header__burger-bar:nth-child(2) {
    transform: translate(-50%, -50%) translateY(2.5px);
  }
  .site-header__burger[aria-expanded="true"] .site-header__burger-bar:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg);
  }
  .site-header__burger[aria-expanded="true"] .site-header__burger-bar:nth-child(2) {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  /* On mobile the header's tint and blur live on this sibling instead
     of the header: at rest it is exactly the header's background,
     open it stretches down past the viewport with a progressive fade
     growing at its leading edge. Fade length is PROPOSED. */
  .site-header {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .site-header__menu-backdrop {
    --fade: 0px;
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height-mobile);
    z-index: 99;
    background: rgba(242, 242, 242, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    -webkit-mask-image: linear-gradient(#000 calc(100% - var(--fade)), transparent);
    mask-image: linear-gradient(#000 calc(100% - var(--fade)), transparent);
    pointer-events: none;
    /* GSAP's power2.out, so it moves like the site's hovers. */
    transition: height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), --fade 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.3s ease;
  }
  body.mobile-menu-open .site-header__menu-backdrop {
    --fade: 60px;
    height: calc(100vh / var(--zoom) + var(--fade));
    pointer-events: auto;
  }
  /* Follows the header when it hides on scroll. */
  .site-header--hidden + .site-header__menu-backdrop {
    transform: translateY(-100%);
  }

  /* Panel spans the content width under the header, above it in the
     stack. Figma butts it against the header; a card gap keeps its top
     corners clear of the header's edge — her call. */
  .site-header__menu-panel {
    position: fixed;
    top: calc(var(--header-height-mobile) + var(--gap-content-to-cta));
    left: var(--section-padding-x-mobile);
    right: var(--section-padding-x-mobile);
    z-index: 101;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 30px;
    background: var(--color-cards-bg);
    border-radius: var(--radius-medium);
    /* Same shadow as the header's mobile pills. */
    box-shadow: 4px 4px 6.2px rgba(0, 0, 0, 0.02);
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  .site-header__menu-panel[aria-hidden="false"] {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  .site-header__menu-panel nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 16px;
  }
  .site-header__menu-panel nav a {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 24px;
    line-height: normal;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
  }

  .site-header__menu-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 16px 32px;
    border-radius: 67.203px;
    /* The buttons token, not the frame's #cbffa0 — her call. */
    background: var(--color-accent-buttons);
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 18px;
    color: var(--color-text);
    text-decoration: none;
  }
}

@media (max-width: 286px) {
  .site-header__login--mobile { display: none; }
}
