/* Shared public navigation. Headers: 50; back to top: 100; trigger: 110; photo lightbox: 300.
   Native modal dialog lives in the top layer. The decorative grain at 9999 ignores pointer events. */
/* Existing header links keep their desktop layout; the shared drawer replaces the mobile trigger.
   Without the component, the existing header remains a working navigation fallback. */
.site-navigation-ready .site-header .container {
  padding-right: calc(clamp(16px, 2vw, 28px) + 56px + 20px + var(--lang-switch-width, 0px) + env(safe-area-inset-right, 0px));
}
.site-navigation-ready .site-header .nav-toggle { display: none; }

/* Cross-page entry makes one layout-ready jump, then reveals the selected completed scene. */
.site-section-arriving body > main,
.site-section-arriving body > footer,
.site-section-arriving body > .home-menu-toggle,
.site-section-arriving body > .back-to-top { visibility: hidden; }

.home-menu-toggle {
  --menu-inset: clamp(16px, 2vw, 28px);
  position: fixed;
  top: calc(var(--menu-inset) + env(safe-area-inset-top, 0px));
  right: calc(var(--menu-inset) + env(safe-area-inset-right, 0px));
  z-index: 110;
  width: 56px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.home-menu-toggle[hidden] { display: none; }
.home-menu-toggle:hover,
.home-menu-toggle:focus-visible { color: var(--color-accent); }
.home-menu-toggle:focus-visible { outline: 1px solid var(--color-accent); outline-offset: -8px; }

/* Over a lime / off-white surface (html.chrome-on-light, set by js/site-navigation.js together with the RO / EN
   switch in css/i18n.css) the lines turn near-black; lime would disappear there, so hover/focus keep the dark lines. */
.chrome-on-light body > .home-menu-toggle,
.chrome-on-light body > .home-menu-toggle:hover,
.chrome-on-light body > .home-menu-toggle:focus-visible { color: var(--color-bg); }
.chrome-on-light body > .home-menu-toggle:focus-visible { outline-color: currentColor; }
.home-menu__link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 5px; }

.home-menu-toggle span {
  width: 22px;
  height: 2px;
  flex: none;
  background: currentColor;
  transform-origin: center;
  transition: transform 200ms ease, opacity 160ms ease;
}

.home-menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  overflow: hidden;
}

.home-menu::backdrop {
  background: rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.home-menu__panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(520px, max(420px, 40vw));
  padding: calc(32px + env(safe-area-inset-top, 0px)) clamp(24px, 3vw, 40px) calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vh, 40px);
  background: rgba(10, 10, 11, 0.88);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 220ms ease, opacity 160ms ease;
}

.home-menu.is-open .home-menu__panel { transform: translateX(0); opacity: 1; }
.home-menu__header { min-height: 56px; padding-right: 64px; display: flex; align-items: center; flex: none; }
.home-menu__brand { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
/* Keep close reachable while the drawer's contents scroll in short viewports. */
.home-menu-toggle--close { position: absolute; }
.home-menu.is-open .home-menu-toggle--close span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.home-menu.is-open .home-menu-toggle--close span:nth-child(2) { opacity: 0; }
.home-menu.is-open .home-menu-toggle--close span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.home-menu__nav { display: flex; flex-direction: column; gap: 8px; flex: none; }
.home-menu__link,
.home-menu__link:visited {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 0;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.015em;
  transition: color 160ms ease, transform 160ms ease;
}
.home-menu__link:hover,
.home-menu__link:focus-visible { color: var(--color-accent); transform: translateX(4px); }
/* Opened by touch or mouse, the drawer focuses the panel itself, without a ring (Tab then reaches the first link as
   usual). The visitor's current destination (js/site-navigation.js) always carries aria-current; on phones (the
   full-width drawer below) it also wears the same lime state. */
.home-menu__panel:focus { outline: none; }

/* Holds the RO / EN switch (js/i18n.js, css/i18n.css) at the bottom of the drawer. */
.home-menu__language-slot { min-height: 24px; width: 88px; margin-top: auto; flex: none; }

@media (max-width: 640px) {
  .home-menu__panel { width: 100%; gap: 24px; padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
  .home-menu__link { font-size: 32px; }
  .home-menu__link[aria-current] { color: var(--color-accent); transform: translateX(4px); }
}

@media (max-width: 360px) {
  /* The countdown can consume the hero's flexible top space. Keep the lines above its badge,
     including that packed state, while retaining the full 56px touch target and matching close control. */
  .home-menu-toggle {
    top: env(safe-area-inset-top, 0px);
    justify-content: flex-start;
    padding-top: 8px;
  }
  .home-menu__link { font-size: 28px; }
}

@media (max-height: 500px) {
  .home-menu__panel { gap: 16px; padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-menu__panel,
  .home-menu-toggle,
  .home-menu-toggle span,
  .home-menu__link { transition: none; }
  .home-menu__panel { transform: none; }
}
