:root {
  color-scheme: light;
  --ink: #111;
  --muted: #666;
  --line: #dedede;
  --paper: #fff;
  --white: #fff;
  --accent: #111;
  --accent-hover: #333;
  --subtle: #f4f4f4;
  --content-width: 1120px;
  --header-height: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: -10000px;
  top: 8px;
  z-index: 30;
  padding: 10px 14px;
  background: var(--white);
}
.skip:focus { left: 8px; }
.wrap { width: min(var(--content-width), calc(100% - 48px)); margin: 0 auto; }

.site-header {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}
.topbar {
  height: 100%;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  text-decoration: none;
}
.brand-logo { display: block; width: 36px; height: 36px; border-radius: 7px; object-fit: cover; }
.top-actions { display: flex; align-items: center; gap: 22px; }
.nav { display: flex; gap: 18px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.languages { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.languages button {
  min-height: 32px;
  border: 0;
  border-radius: 4px;
  padding: 5px 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.languages button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.site-header.is-scrolled { border-color: #242424; background: #111; color: #fff; }
.site-header.is-scrolled .brand,
.site-header.is-scrolled .nav a,
.site-header.is-scrolled .nav a[aria-current="page"] { color: #fff; }
.site-header.is-scrolled .languages { border-color: #4a4a4a; background: #191919; }
.site-header.is-scrolled .languages button { color: #ddd; }
.site-header.is-scrolled .languages button[aria-pressed="true"] { background: #fff; color: #111; }
.site-header.is-scrolled a:hover { color: #ddd; }
.site-header :focus-visible { outline-color: currentColor; }

@media (max-width: 760px) {
  :root { --header-height: 108px; }
  .wrap { width: min(var(--content-width), calc(100% - 32px)); }
  .topbar { flex-wrap: wrap; align-content: center; padding: 8px 0; row-gap: 8px; }
  .top-actions { gap: 12px; }
  .nav { gap: 12px; }
}

@media (max-width: 430px) {
  .brand { font-size: 16px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .nav { font-size: 13px; }
  .languages button { padding: 5px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-header { transition-duration: .01ms; }
}
