:root {
  color-scheme: light dark;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #162133;
  --muted: #4f5d73;
  --line: #d7deea;
  --brand: #1257a1;
  --brand-soft: #e6f1ff;
  --ok: #156b3b;
  --link: #0f4b91;
  --header-bg: #ffffffea;
  --body-grad-a: #edf4ff;
  --body-grad-b: #f9fbff;
  --code-bg: #0f1622;
  --code-ink: #f0f4fb;
  --table-head-bg: #edf4ff;
  --table-head-ink: #20314f;
  --footer-bg: #f1f6ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, var(--body-grad-a) 0%, var(--bg) 45%, var(--body-grad-b) 100%);
  line-height: 1.55;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

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

.topbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.brand-logo {
  width: 170px;
  max-width: 40vw;
  display: block;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}

.hero {
  padding: 3.25rem 0 2.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.74rem;
  color: var(--brand);
  margin: 0 0 0.5rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2.4vw, 2.6rem);
  line-height: 1.15;
}

h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
}

h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.lead {
  color: var(--muted);
  max-width: 72ch;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
}

.chip {
  border: 1px solid #bfd0eb;
  background: #f3f8ff;
  color: #1a3b64;
  border-radius: 999px;
  padding: 0.24rem 0.64rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.hero-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.hero-links a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.section {
  padding: 2.35rem 0;
}

.section.alt {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

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

.card ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.card li+li {
  margin-top: 0.35rem;
}

pre {
  margin: 0;
  border: 1px solid #ced8e8;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  overflow: auto;
}

code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.9rem;
}

.note {
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 7px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid #e2e8f2;
  padding: 0.63rem 0.72rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  background: var(--table-head-bg);
  color: var(--table-head-ink);
  font-size: 0.88rem;
}

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

.gallery {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 0.65rem;
}

figure img {
  width: 100%;
  height: auto;
  border-radius: 9px;
  display: block;
}

figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

a {
  color: var(--link);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.3rem 0;
  background: var(--footer-bg);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.footer-content p {
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0b;
    --panel: #141418;
    --ink: #f1f4fb;
    --muted: #c2c8d6;
    --line: #2b2f38;
    --brand: #72b6ff;
    --brand-soft: #151b28;
    --ok: #81db9a;
    --link: #9fcbff;
    --header-bg: #0c0c0fee;
    --body-grad-a: #131316;
    --body-grad-b: #080809;
    --code-bg: #060608;
    --code-ink: #eef2fa;
    --table-head-bg: #1b1f26;
    --table-head-ink: #d9e5f7;
    --footer-bg: #0d0d11;
  }

  .chip {
    border-color: #35445f;
    background: #141c2b;
    color: #d9eaff;
  }

  .section.alt {
    background: linear-gradient(180deg, #111217 0%, #0b0b0f 100%);
  }

  th,
  td {
    border-bottom-color: #2f3440;
  }

  pre {
    border-color: #2f3542;
  }

  .note {
    border-left-color: #79baff;
    background: #121a29;
  }

  figure img {
    border: 1px solid #2e3440;
  }
}

@media (max-width: 960px) {

  .two-col,
  .three-col,
  .gallery {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    justify-content: flex-start;
    row-gap: 0.45rem;
  }

  .site-header {
    position: static;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: calc(100% - 1rem);
  }

  .section {
    padding: 1.7rem 0;
  }

  h1 {
    font-size: clamp(1.45rem, 6.4vw, 1.95rem);
  }

  .table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  table {
    min-width: 0;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.65rem;
  }

  td {
    border-bottom: 1px solid var(--line);
    padding: 0.48rem 0.2rem;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
    font-weight: 700;
  }
}