/* PECKE · Expandable GREYMAC Notch Navigation + ES/EN Selector (ANTIGRAVITY-005) */

.site-header {
  position: fixed;
  top: var(--frame-inset);
  left: 0;
  right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.notch {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: var(--notch-h);
  color: var(--paper);
  user-select: none;
}

.notch__wing {
  width: 64px;
  height: var(--notch-h);
  flex: 0 0 64px;
  display: block;
}

.notch__wing-fill {
  fill: var(--bezel);
}

.notch__wing-stroke {
  fill: none;
  stroke: rgba(238, 242, 244, 0.18);
  stroke-width: 1;
}

@media (min-width: 960px) {
  .notch__wing {
    width: 84px;
    flex: 0 0 84px;
  }
}

.notch__mid {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--notch-h);
  background: var(--bezel);
  border-bottom: 1px solid rgba(238, 242, 244, 0.18);
  width: 148px;
  transition: width 520ms var(--ease);
  overflow: visible;
}

@media (min-width: 960px) {
  .notch__mid {
    width: 124px;
  }
  .site-header.is-menu-open .notch__mid {
    width: min(740px, calc(100vw - 2 * var(--frame-inset) - 240px));
  }
}

/* Centered PECKE trigger — never shifts on mobile */
.notch__logo {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding-inline: 14px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  color: #ffffff;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 420ms var(--ease), color 180ms var(--ease);
}

.notch__logo:hover,
.notch__logo:focus-visible {
  color: var(--accent-soft);
}

.site-header.is-menu-open .notch__logo {
  transform: scale(1.06);
  color: #ffffff;
}

@media (max-width: 959px) {
  .notch__logo {
    position: fixed;
    top: var(--frame-inset);
    left: 50%;
    transform: translateX(-50%);
    height: var(--notch-h);
    z-index: 130;
  }
  .site-header.is-menu-open .notch__logo {
    transform: translateX(-50%);
  }
}

/* Desktop expandable inline links inside notch */
.notch__links {
  display: none;
}

@media (min-width: 960px) {
  .notch__links {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 124px 1fr;
    align-items: center;
    padding-inline: 16px;
    pointer-events: none;
  }

  .site-header.is-menu-open .notch__links {
    pointer-events: auto;
  }

  .notch__side {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 8px;
  }

  .notch__spacer {
    width: 124px;
    height: 100%;
  }

  .notch__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-inline: 10px;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(238, 242, 244, 0.72);
    text-decoration: none;
    white-space: nowrap;
    opacity: 0;
    filter: blur(5px);
    transform: translateY(6px) scale(0.98);
    transition:
      opacity 360ms var(--ease),
      filter 400ms var(--ease),
      transform 420ms var(--ease),
      color 180ms var(--ease);
    transition-delay: calc((2 - var(--stagger, 0)) * 30ms);
  }

  .site-header.is-menu-open .notch__link {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0) scale(1);
    transition-delay: calc(var(--stagger, 0) * 55ms + 90ms);
  }

  .notch__links:has(.notch__link:hover) .notch__link:not(:hover):not([aria-current="page"]) {
    color: rgba(238, 242, 244, 0.42);
  }

  .notch__link:hover,
  .notch__link:focus-visible {
    color: #ffffff;
  }

  .notch__link[aria-current="page"] {
    color: var(--accent-soft);
  }
}

/* Single-row expandable notch only — no secondary sub-bar */

/* Discrete ES | EN language selector */
.lang-switch {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bezel);
  border: 1px solid rgba(238, 242, 244, 0.18);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(238, 242, 244, 0.52);
}

.lang-switch--desktop {
  display: none;
}

@media (min-width: 960px) {
  .lang-switch--desktop {
    position: fixed;
    top: calc(var(--frame-inset) + 6px);
    right: calc(var(--frame-inset) + 18px);
    z-index: 125;
    display: inline-flex;
  }
}

.lang-switch__btn {
  padding: 2px 6px;
  border-radius: 999px;
  color: rgba(238, 242, 244, 0.56);
  transition: color 180ms var(--ease), background-color 180ms var(--ease);
}

.lang-switch__btn:hover,
.lang-switch__btn:focus-visible {
  color: #ffffff;
}

.lang-switch__btn[aria-pressed="true"] {
  color: #ffffff;
  background: rgba(238, 242, 244, 0.14);
}

.lang-switch__sep {
  opacity: 0.35;
  user-select: none;
}

/* Mobile single hamburger / X button on the right */
.notch__burger {
  position: fixed;
  top: calc(var(--frame-inset) + 2px);
  right: calc(var(--frame-inset) + 14px);
  z-index: 135;
  width: 40px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  background: var(--bezel);
  border: 1px solid rgba(238, 242, 244, 0.18);
  border-radius: 999px;
  pointer-events: auto;
  transition: color var(--dur-fast) var(--ease);
}

.notch__burger-box {
  position: relative;
  width: 18px;
  height: 12px;
  display: block;
}

.notch__burger-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 300ms var(--ease), opacity 200ms var(--ease), top 300ms var(--ease);
}

.notch__burger-line:nth-child(1) { top: 0; }
.notch__burger-line:nth-child(2) { top: 5px; }
.notch__burger-line:nth-child(3) { top: 10px; }

.site-header.is-menu-open .notch__burger-line:nth-child(1) {
  top: 5px;
  transform: rotate(45deg);
}

.site-header.is-menu-open .notch__burger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.site-header.is-menu-open .notch__burger-line:nth-child(3) {
  top: 5px;
  transform: rotate(-45deg);
}

@media (min-width: 960px) {
  .notch__burger {
    display: none;
  }
}

/* Mobile Fullscreen Black Overlay Panel */
.nav-overlay {
  position: fixed;
  inset: var(--frame-inset);
  z-index: 115;
  border-radius: var(--radius-frame);
  background: var(--bezel);
  color: var(--paper);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 320ms var(--ease), transform 360ms var(--ease);
}

.nav-overlay.is-open {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 960px) {
  .nav-overlay {
    display: none !important;
  }
}

.nav-overlay__inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: calc(var(--notch-h) + 32px) 24px 32px;
}

.mobile-menu__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(238, 242, 244, 0.52);
  margin-bottom: 14px;
}

.mobile-menu__pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.mobile-menu__page-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5.6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(238, 242, 244, 0.78);
  opacity: 0;
  filter: blur(5px);
  transform: translateY(10px);
  transition:
    opacity 320ms var(--ease),
    filter 320ms var(--ease),
    transform 360ms var(--ease),
    color 180ms var(--ease);
}

.nav-overlay.is-open .mobile-menu__page-link {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition-delay: calc(var(--i, 0) * 18ms + 24ms);
}

.mobile-menu__page-link[aria-current="page"],
.mobile-menu__page-link:hover {
  color: #ffffff;
}

.mobile-menu__divider {
  height: 1px;
  width: 100%;
  background: rgba(238, 242, 244, 0.16);
  margin-block: 4px;
}

.mobile-menu__projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mobile-menu__project-link {
  display: grid;
  gap: 4px;
  text-decoration: none;
  color: rgba(238, 242, 244, 0.85);
  opacity: 0;
  filter: blur(4px);
  transform: translateY(8px);
  transition: opacity 320ms var(--ease), filter 320ms var(--ease), transform 360ms var(--ease);
}

.nav-overlay.is-open .mobile-menu__project-link {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition-delay: calc(var(--i, 0) * 24ms + 120ms);
}

.mobile-menu__project-name {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
}

.mobile-menu__project-place {
  font-size: 0.65rem;
  color: rgba(238, 242, 244, 0.52);
}

.mobile-menu__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(238, 242, 244, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .notch__mid,
  .notch__logo,
  .notch__link,
  .notch__burger-line,
  .nav-overlay,
  .mobile-menu__page-link,
  .mobile-menu__project-link {
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    filter: none !important;
    transform: none !important;
  }
  .site-header.is-menu-open .notch__link,
  .nav-overlay.is-open .mobile-menu__page-link,
  .nav-overlay.is-open .mobile-menu__project-link {
    opacity: 1 !important;
  }
}
