/* Keep readable fallback text when a webfont misses the initial paint window. */
@font-face {
  font-family: 'Inter Stable';
  src: url('../fonts/inter.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
}

@font-face {
  font-family: 'JetBrains Mono Stable';
  src: url('../fonts/jetbrains-mono.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 800;
  font-display: optional;
}

:root {
  --mono: 'JetBrains Mono Stable', Consolas, monospace;
}

body {
  font-family: 'Inter Stable', system-ui, sans-serif;
}

/* Reserve header geometry across navigation enhancement and font loading. */
@media (max-width: 1100px) {
  .site-header .nav-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 72px;
    align-items: center;
    gap: 0 8px;
    min-height: 64px;
    padding-block: 7px;
  }

  .site-header .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
    gap: 8px;
    font-size: clamp(.8rem, 4vw, 1rem);
    line-height: 1.1;
  }

  .site-header .brand img {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .site-header .menu-toggle {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    width: 44px;
    height: 44px;
  }

  .site-header .nav-actions {
    grid-column: 3;
    grid-row: 1;
    width: 72px;
    min-width: 0;
    justify-content: flex-end;
    gap: 0;
  }

  .site-header .nav-portal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    min-height: 44px;
    font-size: .75rem;
    line-height: 1.25;
  }

  .site-header .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding-block: 4px;
    border-top: 1px solid var(--line-soft);
  }

  .js-root .site-header .main-nav {
    display: none;
  }

  .js-root .site-header .main-nav.is-open {
    display: flex;
  }

  .site-header .main-nav > a,
  .site-header .nav-branch > a {
    display: block;
    padding: 7px 0;
  }

  .site-header .nav-branch {
    display: block;
  }

  .site-header .nav-drop summary {
    position: absolute;
    top: 0;
    left: 63px;
    padding: 10px;
  }

  .site-header .nav-fly {
    position: static;
    width: 100%;
    box-shadow: none;
    margin-bottom: 7px;
  }

  .site-header .button-nav {
    display: none;
  }

  .site-header .nav-mobile-lobby {
    display: block !important;
  }

  .js-root .site-header .menu-toggle {
    display: grid !important;
    width: 44px;
    height: 44px;
    margin-left: 0;
  }
}
