:root {
  --bg: #ffffff;
  --bg-elevated: #fafafa;
  --fg: #0b0d12;
  --fg-muted: #5b6473;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e6e8ee;
  --code-bg: #0f1116;
  --code-fg: #e6e8ee;
  --radius: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --bg-elevated: #11141b;
    --fg: #f5f6f8;
    --fg-muted: #c5cdda;
    --accent: #2563eb;
    --accent-hover: #60a5fa;
    --border: #232a3a;
    --code-bg: #11141b;
    --code-fg: #e6e8ee;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: none;
}

a.button,
a.card,
.site-nav .brand,
.site-nav nav a {
  text-decoration: none;
}

header.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(10px);
}

.site-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav .brand {
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
}

.site-nav .brand img {
  height: 22px;
  width: auto;
  display: block;
}

/* The supplied logo is light/white (designed for dark backgrounds).
   In light mode, invert it so it shows up on white. Works for the
   monochrome logo; if a true dark-on-light variant is provided later,
   swap to a <picture> element instead. */
@media (prefers-color-scheme: light) {
  .site-nav .brand img {
    filter: invert(1);
  }
}

.site-nav nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  font-size: 14px;
}

.site-nav nav a {
  color: var(--fg-muted);
}

.site-nav nav a:hover {
  color: var(--fg);
  text-decoration: none;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  list-style: none;
  color: var(--fg-muted);
  font-size: 14px;
  user-select: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: '\25BE';
  font-size: 10px;
  opacity: 0.6;
}

.nav-dropdown summary:hover,
.nav-dropdown[open] summary {
  color: var(--fg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 11;
}

.site-nav .nav-dropdown-menu a {
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--fg);
  font-size: 14px;
  text-decoration: none;
}

.site-nav .nav-dropdown-menu a:hover {
  background: var(--bg-elevated);
  color: var(--fg);
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 24px 96px;
  position: relative;
}

.page-actions {
  position: absolute;
  top: 56px;
  right: 24px;
  z-index: 5;
  font-size: 13px;
}

.page-actions-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.page-actions-trigger:hover {
  border-color: var(--fg-muted);
}

.page-actions-trigger[aria-expanded='true'] {
  border-color: var(--accent);
}

.page-actions-trigger .chevron {
  opacity: 0.6;
  font-size: 10px;
}

.page-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 260px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-actions-menu[hidden] {
  display: none;
}

.page-actions-menu > * {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.page-actions-menu > *:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}

.page-actions-menu .action-title {
  font-weight: 500;
}

.page-actions-menu .action-sub {
  font-size: 12px;
  color: var(--fg-muted);
}

.page-actions-toast {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 6;
}

.page-actions-toast[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .page-actions {
    position: static;
    margin: 0 0 16px;
  }
  .page-actions-menu {
    right: auto;
    left: 0;
  }
}

main.wide {
  max-width: 1100px;
}

h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

h2 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
}

h3 {
  font-size: 18px;
  margin: 28px 0 8px;
}

p {
  color: var(--fg);
  margin: 12px 0;
}

p.lead {
  font-size: 18px;
  color: var(--fg-muted);
  margin-bottom: 32px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

figure {
  margin: 24px 0;
  text-align: center;
}

figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  border-radius: 8px;
}

figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--fg-muted);
  font-style: italic;
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
}

pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--bg-elevated);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--fg-muted);
  text-decoration: none;
  transform: translateY(-1px);
}

.card h3 {
  margin: 0 0 6px;
  color: var(--fg);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 14px;
}

.callout {
  border-left: 3px solid var(--fg-muted);
  background: var(--bg-elevated);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
  font-size: 15px;
}

.callout strong {
  color: var(--fg);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
  font-size: 14.5px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--fg-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero {
  padding: 32px 0 8px;
}

.hero .eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 15px;
  margin-top: 8px;
}

.button:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

.button.secondary:hover {
  border-color: var(--fg-muted);
  background: var(--bg-elevated);
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 13px;
}

/* ---------- Changelog ---------- */
.cl-entry {
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  scroll-margin-top: 80px;
}

.cl-entry:first-of-type {
  padding-top: 8px;
}

.cl-entry:last-of-type {
  border-bottom: 0;
}

.cl-entry-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.cl-entry-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cl-entry-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-muted);
}

.cl-entry-meta time {
  font-variant-numeric: tabular-nums;
}

.cl-entry-body > :first-child {
  margin-top: 4px;
}

.cl-entry-body > :last-child {
  margin-bottom: 0;
}

.cl-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1;
}

.cl-chip-added {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}
.cl-chip-fixed {
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
}
.cl-chip-improved {
  color: #6b21a8;
  background: #f3e8ff;
  border: 1px solid #e9d5ff;
}
.cl-chip-deprecated {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}
.cl-chip-removed {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

@media (prefers-color-scheme: dark) {
  .cl-chip-added {
    color: #86efac;
    background: rgba(20, 83, 45, 0.4);
    border-color: #166534;
  }
  .cl-chip-fixed {
    color: #93c5fd;
    background: rgba(30, 58, 138, 0.4);
    border-color: #1e40af;
  }
  .cl-chip-improved {
    color: #d8b4fe;
    background: rgba(88, 28, 135, 0.4);
    border-color: #6b21a8;
  }
  .cl-chip-deprecated {
    color: #fcd34d;
    background: rgba(120, 53, 15, 0.4);
    border-color: #92400e;
  }
  .cl-chip-removed {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.4);
    border-color: #991b1b;
  }
}
