/* Header and menu. */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--head-bg); color: var(--head-ink);
  border-bottom: 1px solid var(--head-line);
}

.header-row { display: flex; align-items: center; gap: 18px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { height: 40px; width: auto; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.45rem; letter-spacing: 0; line-height: 1; }
.brand-sub { display: none; font-family: var(--display); font-weight: 700; font-size: .92rem; padding-left: 10px; border-left: 3px solid var(--sky); line-height: 1.1; }

/* The logo hangs free on white. On navy (and in dark mode) it gets a white edge. */
.sticker { filter: var(--sticker); }
:root[data-theme="dark"] .brand-logo { filter: var(--sticker); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo { filter: var(--sticker); } }

/* Menu: a dropdown on phones, a row from 900px */
.nav {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--head-bg); border-bottom: 1px solid var(--head-line);
  padding: 8px var(--gutter) 20px; color: var(--head-ink);
}
.nav.open { display: grid; }
.nav a { padding: .85rem 0; font-weight: 700; font-size: 1.1rem; text-decoration: none; border-bottom: 1px solid var(--head-line); }
.nav a:last-child { border-bottom: 0; }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: transparent; border: 2px solid var(--head-ink); border-radius: 50%; color: var(--head-ink);
}
.icon-btn:hover { background: var(--head-ink); color: var(--head-bg); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* "Live demo" button: in the bar on desktop, in the menu on phones */
.head-cta { display: none; }
.nav-pick { font-weight: 700; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--sky); text-decoration-thickness: 3px; text-underline-offset: 6px; }

@media (min-width: 900px) {
  .brand-sub { display: inline; }
  .menu-btn { display: none; }
  .head-cta { display: inline-flex; }
  .nav-pick { display: none; }
  .nav { display: flex; position: static; background: none; border: 0; padding: 0; gap: 28px; margin-left: 36px; }
  .nav.open { display: flex; }
  .nav a { padding: .3rem 0; font-size: 1rem; border: 0; text-decoration: none; }
  .nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--sky); }
}
/* Seven links plus the button need tighter spacing on narrow desktops */
@media (min-width: 900px) and (max-width: 1199px) {
  .nav { gap: 16px; margin-left: 18px; }
  .nav a { font-size: .95rem; }
  .brand-sub { display: none; }
}
