:root {
    --global-header-height: 76px;
    --global-header-bg: oklch(18% 0.035 218 / 0.96);
    --global-header-ink: oklch(96% 0.014 77);
    --global-header-muted: oklch(83% 0.018 75);
    --global-header-line: oklch(96% 0.014 77 / 0.26);
    --global-header-accent: oklch(69% 0.13 41);
    --global-header-panel: oklch(15% 0.03 218);
    --global-header-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.global-header,
.global-header *,
.global-command-dialog,
.global-command-dialog * {
    box-sizing: border-box;
}

  .global-header {
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0;
    left: 0;
    display: grid;
    height: var(--global-header-height);
    grid-template-columns: minmax(160px, 1fr) auto minmax(320px, 1fr);
    align-items: center;
    padding-inline: max(24px, calc((100vw - 1320px) / 2));
    border-bottom: 1px solid oklch(96% 0.014 77 / 0.12);
    background: var(--global-header-bg);
    color: var(--global-header-ink);
    font-family: "Manrope", "Avenir Next", sans-serif;
    backdrop-filter: blur(18px) saturate(1.05);
    -webkit-backdrop-filter: blur(18px) saturate(1.05);
    transition:
      box-shadow 180ms ease,
      background-color 180ms ease;
    view-transition-name: site-header;
  }

  .global-header.is-scrolled {
    box-shadow: 0 12px 38px oklch(8% 0.025 218 / 0.18);
  }

  .global-brand {
    display: inline-flex;
    width: max-content;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    color: var(--global-header-ink);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-decoration: none;
  }

  .global-brand svg {
    width: 25px;
    height: auto;
    fill: currentColor;
  }

  .global-brand-dot {
    color: var(--global-header-accent);
  }

  .global-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(28px, 4vw, 58px);
  }

  .global-nav > a {
    position: relative;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--global-header-muted);
    font-size: 0.79rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    text-decoration: none;
    transition: color 150ms ease;
  }

  .global-nav > a::after {
    position: absolute;
    right: 0;
    bottom: 6px;
    left: 0;
    height: 1px;
    background: var(--global-header-accent);
    content: "";
    opacity: 0;
    transform: scaleX(0.25);
    transition:
      opacity 160ms ease,
      transform 220ms var(--global-header-ease);
  }

  .global-nav > a:hover,
  .global-nav > a[aria-current="page"] {
    color: var(--global-header-ink);
  }

  .global-nav > a:hover::after,
  .global-nav > a[aria-current="page"]::after {
    opacity: 1;
    transform: scaleX(1);
  }

  .global-actions {
    display: flex;
    justify-self: end;
    align-items: center;
    gap: 9px;
  }

  .global-site-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 6px;
    padding-inline: 9px;
    color: var(--global-header-muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 150ms ease;
  }

  .global-site-link span {
    color: var(--global-header-accent);
    transition: transform 180ms var(--global-header-ease);
  }

  .global-site-link:hover {
    color: var(--global-header-ink);
  }

  .global-site-link:hover span {
    transform: translate(2px, -2px);
  }

  .global-site-link.is-signed-in {
    min-width: 42px;
    min-height: 42px;
    justify-content: center;
    padding-inline: 0;
    border: 1px solid var(--global-header-line);
    border-radius: 50%;
    color: var(--global-header-ink);
    font-size: 0.82rem;
    font-weight: 800;
  }

  .global-icon-button,
  .global-menu-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--global-header-line);
    border-radius: 50%;
    background: transparent;
    color: var(--global-header-ink);
    font: inherit;
    cursor: pointer;
    transition:
      border-color 150ms ease,
      background-color 150ms ease,
      transform 150ms var(--global-header-ease);
  }

  .global-icon-button:hover,
  .global-menu-button:hover {
    border-color: oklch(96% 0.014 77 / 0.7);
    background: oklch(96% 0.014 77 / 0.08);
  }

  .global-icon-button:active,
  .global-menu-button:active,
  .global-cta:active {
    transform: scale(0.96);
  }

  .global-theme-icon {
    position: relative;
    width: 17px;
    height: 17px;
    overflow: hidden;
    border: 1.5px solid currentColor;
    border-radius: 50%;
  }

  .global-theme-icon::after {
    position: absolute;
    inset: -2px 50% -2px -2px;
    background: currentColor;
    content: "";
    transition: transform 240ms var(--global-header-ease);
  }

  :root[data-theme="dark"] .global-theme-icon::after {
    transform: translateX(100%);
  }

  .global-command {
    grid-auto-flow: column;
    grid-template-columns: auto auto;
    gap: 1px;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: -0.05em;
  }

  .global-command span {
    font-size: 0.88rem;
    font-weight: 500;
  }

  .global-cta {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding-inline: 21px;
    border: 1px solid var(--global-header-ink);
    border-radius: 999px;
    background: var(--global-header-ink);
    color: oklch(16% 0.03 218);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    text-decoration: none;
    transition:
      background-color 150ms ease,
      color 150ms ease,
      transform 150ms var(--global-header-ease);
  }

  .global-cta:hover {
    background: transparent;
    color: var(--global-header-ink);
  }

  .global-menu-button {
    position: relative;
    display: none;
  }

  .global-menu-button span {
    position: absolute;
    width: 16px;
    height: 1px;
    background: currentColor;
    transition: transform 220ms var(--global-header-ease);
  }

  .global-menu-button span:first-child {
    transform: translateY(-3px);
  }

  .global-menu-button span:last-child {
    transform: translateY(3px);
  }

  .global-header.menu-open .global-menu-button span:first-child {
    transform: rotate(45deg);
  }

  .global-header.menu-open .global-menu-button span:last-child {
    transform: rotate(-45deg);
  }

  .global-nav-tools {
    display: none;
  }

  .global-header :where(a, button):focus-visible,
  .global-command-dialog :where(input, button):focus-visible {
    outline: 2px solid var(--global-header-accent);
    outline-offset: 3px;
  }

  .global-command-dialog {
    width: min(620px, calc(100vw - 32px));
    max-width: none;
    margin: max(10vh, 80px) auto auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid oklch(96% 0.014 77 / 0.18);
    border-radius: 22px;
    background: var(--global-header-panel);
    color: var(--global-header-ink);
    box-shadow: 0 30px 90px oklch(5% 0.02 218 / 0.46);
    font-family: "Manrope", "Avenir Next", sans-serif;
  }

  .global-command-dialog::backdrop {
    background: oklch(8% 0.025 218 / 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  .global-command-search {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid oklch(96% 0.014 77 / 0.12);
  }

  .global-command-search > span:first-child {
    color: var(--global-header-accent);
    font-size: 1.1rem;
    text-align: center;
  }

  .global-command-search input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: 600 1rem/1.4 "Manrope", "Avenir Next", sans-serif;
  }

  .global-command-search input::placeholder {
    color: var(--global-header-muted);
  }

  .global-command-search kbd {
    padding: 5px 7px;
    border: 1px solid var(--global-header-line);
    border-radius: 7px;
    color: var(--global-header-muted);
    font: 700 0.66rem/1 "Manrope", "Avenir Next", sans-serif;
  }

  .global-command-list {
    display: grid;
    gap: 4px;
    max-height: min(430px, 62vh);
    margin: 0;
    padding: 8px;
    overflow: auto;
    list-style: none;
  }

  .global-command-item {
    display: grid;
    width: 100%;
    min-height: 54px;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .global-command-item:hover,
  .global-command-item.is-active {
    background: oklch(96% 0.014 77 / 0.09);
  }

  .global-command-index {
    color: var(--global-header-accent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
  }

  .global-command-label {
    font-size: 0.88rem;
    font-weight: 750;
  }

  .global-command-meta {
    color: var(--global-header-muted);
    font-size: 0.68rem;
    font-weight: 650;
  }

  .global-command-empty {
    padding: 30px 18px;
    color: var(--global-header-muted);
    font-size: 0.82rem;
    text-align: center;
  }

  @media (max-width: 1100px) {
    .global-header {
      grid-template-columns: minmax(120px, 1fr) auto minmax(320px, 1fr);
      padding-inline: 22px;
    }

    .global-nav {
      gap: 24px;
    }
  }

  @media (max-width: 820px) {
    .global-header {
      grid-template-columns: 1fr auto;
      padding-inline: 16px;
    }

    .global-nav {
      position: fixed;
      z-index: -1;
      top: var(--global-header-height);
      right: 0;
      left: 0;
      display: grid;
      grid-template-columns: 1fr;
      gap: 0;
      padding: 16px 20px 22px;
      border-bottom: 1px solid oklch(96% 0.014 77 / 0.15);
      background: var(--global-header-panel);
      opacity: 0;
      pointer-events: none;
      transform: translateY(-10px);
      visibility: hidden;
      transition:
        opacity 180ms ease,
        transform 240ms var(--global-header-ease),
        visibility 0s linear 240ms;
    }

    .global-header.menu-open .global-nav {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
      visibility: visible;
      transition-delay: 0s;
    }

    .global-nav > a {
      min-height: 58px;
      border-bottom: 1px solid oklch(96% 0.014 77 / 0.12);
      font-size: 1.2rem;
    }

    .global-nav > a::after {
      display: none;
    }

    .global-nav-tools {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 8px;
      padding-top: 15px;
    }

    /* A keyboard-shortcut chip means nothing on a phone. */
    .global-nav-tools .global-command {
      display: none;
    }

    .global-nav-tools .global-site-link {
      display: inline-flex;
      justify-self: start;
      padding-inline: 0;
    }

    .global-actions > .global-site-link,
    .global-actions > .global-icon-button {
      display: none;
    }

    .global-menu-button {
      display: inline-grid;
    }
  }

  @media (max-width: 430px) {
    .global-brand {
      font-size: 0.88rem;
    }

    .global-brand svg {
      width: 23px;
    }

    .global-actions {
      gap: 7px;
    }

    .global-cta {
      min-height: 40px;
      padding-inline: 15px;
      font-size: 0.72rem;
    }

    .global-menu-button {
      width: 40px;
      height: 40px;
    }
  }

@media (prefers-reduced-motion: reduce) {
    .global-header *,
    .global-command-dialog * {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
    }
}
