/* Site header: logo, navigation, CTA; sticky with a background that fades in on scroll */
.site-header { position: sticky; top: 0; z-index: 50; }
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #07070cb3;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-line);
  opacity: 0;
}
@supports (animation-timeline: scroll()) {
  .site-header::before { animation: header-bg linear both; animation-timeline: scroll(); animation-range: 0 120px; }
}
@supports not (animation-timeline: scroll()) {
  .site-header::before { opacity: 1; }
}
@keyframes header-bg { to { opacity: 1; } }

/* Menu links jump to sections below the sticky header (76 px), with a little air */
html { scroll-padding-top: calc(76px + var(--space-4)); }
@media (prefers-reduced-motion: reduce) {
  .site-header::before { opacity: 1; }
}

/* The gaps are fixed (the same as 1.5rem and 2rem at the normal text size, step 4.13). With a larger text size setting
   the container (77.5rem = 1240 px at 16 px) and the mobile breakpoint (60em = 960 px) grow with it, so the desktop
   navigation only shows where it fits; the row may grow taller instead of spilling out (step 4.17) */
.site-header .container { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; width: min(77.5rem, 100% - 2 * var(--gutter)); min-height: 76px; }

.logo { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--color-text); text-decoration: none; font: 700 1.125rem var(--font-display); letter-spacing: -0.01em; }
/* The mark "Vlna mw" (inline SVG, docs/decisions.md 2026-11-10): own size, no tile; the colour of the name next to it in high contrast mode */
.logo-mark { flex: none; width: 36px; height: 20px; }
@media (forced-colors: active) { .logo-mark path { stroke: currentColor; } }
/* A very narrow window for the text size (320 px with text at 200 %): the longest word of the name and the menu button
   leave no room for the decorative mark, so only the name stays and the bar keeps its height */
@media (max-width: 11em) { :is(.site-header, .mobile-menu) .logo-mark { display: none; } }

.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav ul { display: flex; gap: 32px; list-style: none; padding: 0; }
.main-nav a:not(.btn) { color: var(--color-muted); text-decoration: none; font-size: 0.9375rem; transition: color var(--duration-fast); }
.main-nav a:not(.btn):hover { color: var(--color-text); }

/* Mobile menu (native popover, no JS needed to open/close) */
.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--color-line-strong); background: #ffffff0a; cursor: pointer; place-items: center; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--color-text); }
.menu-toggle span { position: relative; }
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }

.mobile-menu {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: var(--space-6) var(--gutter) var(--space-8);
  background: #07070cf2;
  color: var(--color-text);
  backdrop-filter: blur(16px);
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out), display 0.25s allow-discrete, overlay 0.25s allow-discrete;
}
.mobile-menu:popover-open { display: flex; opacity: 1; }
@starting-style { .mobile-menu:popover-open { opacity: 0; } }
.mobile-menu .menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-close { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--color-line-strong); background: #ffffff0a; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.mobile-menu ul { list-style: none; padding: 0; margin-top: var(--space-12); display: grid; gap: var(--space-2); }
.mobile-menu ul a { display: block; overflow-wrap: anywhere; padding: var(--space-3) 0; color: var(--color-text); text-decoration: none; font: 700 2rem var(--font-display); letter-spacing: -0.02em; border-bottom: 1px solid var(--color-line); }
.mobile-menu .btn { margin-top: auto; justify-content: center; }

@media (max-width: 60em) {
  .main-nav { display: none; }
  .menu-toggle { display: grid; }
}

/* Browsers without popover: no menu button, the regular navigation wraps below the logo instead */
@supports not selector(:popover-open) {
  .mobile-menu, .menu-toggle { display: none; }
  @media (max-width: 60em) {
    .site-header .container { flex-wrap: wrap; height: auto; padding-block: var(--space-4); gap: var(--space-3) var(--space-6); }
    .main-nav { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
    .main-nav ul { flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
  }
}
