:root {
  color-scheme: light dark;
  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --background: #F6F7F9;
  --panel: #FFFFFF;
  --raised: #EEF1F5;
  --wash: #E9EDF2;
  --border: #D5DCE6;
  --border-ui: #5D6F88;
  --foreground: #0F1A2B;
  --muted: #425066;
  --primary: #14243D;
  --primary-foreground: #FFFFFF;
  --accent-text: #6E4F00;
  --accent-soft: #FEF5DA;
  --accent-line: #D4B14A;
  --success-soft: #E6F3EC;
  --success-line: #9ECBB4;
  --success-text: #0A5835;
  --ring: #14243D;

  --shadow-sm: 0 1px 2px rgb(15 26 43 / 0.06);
  --shadow-md: 0 4px 12px rgb(15 26 43 / 0.08);
  --duration-fast: 120ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  scrollbar-color: var(--border-ui) var(--background);

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
    --background: #0A1019;
    --panel: #111926;
    --raised: #182334;
    --wash: #151E2B;
    --border: #263449;
    --border-ui: #68788E;
    --foreground: #EBF0F7;
    --muted: #B6C2D4;
    --primary: #E9EEF6;
    --primary-foreground: #0A1019;
    --accent-text: #F4BA17;
    --accent-soft: #3B3115;
    --accent-line: #8A6E1C;
    --success-soft: #133224;
    --success-line: #2C6F51;
    --success-text: #80DFB3;
    --ring: #F4BA17;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
    --shadow-md: 0 4px 14px rgb(0 0 0 / 0.45);
  }

  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) {
    --background: #0A1019;
    --panel: #111926;
    --raised: #182334;
    --wash: #151E2B;
    --border: #263449;
    --border-ui: #68788E;
    --foreground: #EBF0F7;
    --muted: #B6C2D4;
    --primary: #E9EEF6;
    --primary-foreground: #0A1019;
    --accent-text: #F4BA17;
    --accent-soft: #3B3115;
    --accent-line: #8A6E1C;
    --success-soft: #133224;
    --success-line: #2C6F51;
    --success-text: #80DFB3;
    --ring: #F4BA17;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
    --shadow-md: 0 4px 14px rgb(0 0 0 / 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0.01ms;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}

*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  z-index: 200;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible {
  width: auto;
  height: auto;
  min-height: 44px;
  padding: 12px 16px;
  clip-path: none;
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: relative;
  z-index: 50;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--foreground);
  min-height: 44px;
  white-space: nowrap;
}

.logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: grid;
  place-items: center;
  flex: none;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}

.nav-link:hover {
  color: var(--foreground);
  background: var(--raised);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.btn-primary:hover { opacity: 0.92; }

.btn-secondary {
  background: var(--panel);
  color: var(--foreground);
  border-color: var(--border-ui);
}
.btn-secondary:hover { background: var(--raised); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--wash);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--foreground);
}
.badge--mono { font-family: var(--font-mono); }
.badge--gold { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

/* Hero */
.hero-section {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
  margin: 0 0 12px;
  letter-spacing: 0.04em;
}

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  color: var(--foreground);
  margin: 0;
}

.hero-title {
  font-size: clamp(1.85rem, 1.3rem + 2.4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
}

.lead {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 54ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.terminal-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
}

.terminal-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Sections */
.section {
  padding: 40px 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 800;
  margin-bottom: 6px;
}

.section-sub {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.demo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.step-num {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
}

.card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

/* Accessible Single-Row Scrollable Tabs */
.tab-list {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.tab-list button {
  position: relative;
  flex: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.tab-list button:hover { color: var(--foreground); }

.tab-list button:focus-visible { outline-offset: -2px; }

.tab-list button[aria-selected="true"] {
  color: var(--foreground);
}

.tab-list button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 10px 0;
  border-block-end: 3px solid var(--ring);
}

/* Zero box styles directly on [role="tabpanel"] for hidden=until-found */
.panels-stack,
[role="tabpanel"],
[role="tabpanel"] > .panel-card,
.code-block,
pre {
  min-width: 0;
  max-width: 100%;
}

[role="tabpanel"] {
  margin: 0;
  padding: 0;
  border: 0;
}

[role="tabpanel"] > .panel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

[role="tabpanel"] > .panel-card h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

[role="tabpanel"] > .panel-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14.5px;
}

.code-block {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

pre {
  margin: 0;
  width: 100%;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--foreground);
}

code { font-family: var(--font-mono); font-size: 13px; }

.copy-btn {
  appearance: none;
  min-width: 68px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-ui);
  background: var(--panel);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.copy-btn:hover { background: var(--raised); }

.showcase-frame {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: var(--panel);
}

.showcase-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
}

.showcase-img--light { display: block; }
.showcase-img--dark { display: none; }

:root:has(> head > meta[name="color-scheme"][content="dark"]) .showcase-img--light { display: none; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .showcase-img--dark { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .showcase-img--light { display: none; }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .showcase-img--dark { display: block; }
}

/* Container-Query Responsive Release Notes Table */
.table-wrap {
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.table-head th {
  background: var(--raised);
  font-family: var(--font-display);
  font-weight: 700;
}

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }

.pass-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--success-soft);
  border: 1px solid var(--success-line);
  color: var(--success-text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 28px 0;
  font-size: 14px;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@container (width < 600px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tbody tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }
  tbody tr:last-child { border-bottom: 0; }
  tbody th, tbody td {
    padding: 4px 0;
    border-bottom: 0;
  }
  tbody td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--muted);
  }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 680px) {
  .nav-bar {
    padding-block: 8px;
    gap: 4px 8px;
  }
  .nav-links {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 0 4px;
    border-top: 1px solid var(--border);
    padding-top: 4px;
  }
  .nav-link {
    padding: 4px 8px;
  }
}
