:root {
  color-scheme: light;
  --page: #f6f8fb;
  --panel: #ffffff;
  --panel-muted: #f0f4f8;
  --ink: #102033;
  --muted: #5b6b7d;
  --subtle: #7a8797;
  --line: #d7dee8;
  --line-strong: #b9c5d4;
  --accent: #176b5b;
  --accent-strong: #0e4d40;
  --accent-soft: #e3f1ed;
  --code-bg: #152033;
  --code-ink: #f5f7fb;
  --shadow: 0 18px 45px rgb(16 32 51 / 0.08);
  --focus: #2563eb;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b111d;
    --panel: #111827;
    --panel-muted: #172033;
    --ink: #eef4ff;
    --muted: #bac7d8;
    --subtle: #8d9bb0;
    --line: #263246;
    --line-strong: #36445b;
    --accent: #5ee0c2;
    --accent-strong: #8df3da;
    --accent-soft: #122f2b;
    --code-bg: #050915;
    --code-ink: #f7fbff;
    --shadow: 0 18px 45px rgb(0 0 0 / 0.28);
    --focus: #8ab4ff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b111d;
  --panel: #111827;
  --panel-muted: #172033;
  --ink: #eef4ff;
  --muted: #bac7d8;
  --subtle: #8d9bb0;
  --line: #263246;
  --line-strong: #36445b;
  --accent: #5ee0c2;
  --accent-strong: #8df3da;
  --accent-soft: #122f2b;
  --code-bg: #050915;
  --code-ink: #f7fbff;
  --shadow: 0 18px 45px rgb(0 0 0 / 0.28);
  --focus: #8ab4ff;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.55;
  margin: 0;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

button,
a {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  align-self: start;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border-right: 1px solid var(--line);
  height: 100vh;
  overflow-y: auto;
  padding: 22px 18px;
  position: sticky;
  top: 0;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  letter-spacing: 0;
  width: 36px;
}

.brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1.15;
}

.brand span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
}

.theme-toggle {
  align-items: center;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 0.86rem;
  gap: 8px;
  justify-content: space-between;
  margin: 0 0 22px;
  min-height: 38px;
  padding: 6px 10px;
  width: 100%;
}

.theme-toggle-icon {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.nav-label {
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 26px 10px 8px;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  border-radius: 6px;
  color: var(--muted);
  display: block;
  font-size: 0.94rem;
  padding: 8px 10px;
  text-decoration: none;
}

.nav-list a:hover {
  background: var(--panel-muted);
  color: var(--ink);
}

.content {
  min-width: 0;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  min-height: 58px;
  padding: 0 34px;
}

.topbar a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

main {
  margin: 0 auto;
  max-width: 1120px;
  padding: 0 34px 56px;
}

section {
  scroll-margin-top: 24px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 5rem;
  letter-spacing: 0;
  line-height: 0.95;
}

h2 {
  font-size: 2rem;
  line-height: 1.1;
}

h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.hero {
  display: grid;
  gap: 30px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  padding: 70px 0 44px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.lede {
  color: var(--muted);
  font-size: 1.12rem;
  margin-top: 22px;
  max-width: 68ch;
}

.badges,
.actions,
.country-grid,
.recommended-grid,
.quick-grid,
.quality-grid {
  display: grid;
  gap: 12px;
}

.badges {
  grid-template-columns: repeat(auto-fit, minmax(120px, max-content));
  margin-top: 24px;
}

.badge {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.86rem;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
}

.badge strong {
  color: var(--ink);
}

.actions {
  grid-template-columns: repeat(auto-fit, minmax(168px, max-content));
  margin-top: 28px;
}

.button {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  text-decoration: none;
}

.button:hover {
  color: #ffffff;
  filter: brightness(1.04);
}

.button.secondary {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--ink);
}

.button.secondary:hover {
  color: var(--ink);
}

.hero-panel {
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  padding: 18px;
}

.hero-panel-row {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
}

.hero-panel-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 850;
}

.metric-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.section {
  border-top: 1px solid var(--line);
  padding: 40px 0;
}

.section-header {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  max-width: 760px;
}

.section-header p {
  color: var(--muted);
}

.recommended-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.code-card,
.file-table-wrap,
.schema-table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card {
  display: grid;
  gap: 12px;
  padding: 18px;
  text-decoration: none;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 32px rgb(16 32 51 / 0.08);
}

.card p {
  color: var(--muted);
}

.card-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.code-card {
  min-width: 0;
  overflow: hidden;
}

.code-card-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.code-card-header strong {
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.copy-button {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  min-height: 32px;
  padding: 5px 10px;
}

pre {
  background: var(--code-bg);
  color: var(--code-ink);
  margin: 0;
  overflow-x: auto;
  padding: 16px;
}

code {
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: 0.9rem;
}

.country-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.country-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.country-card-title {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.country-code {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 3px 9px;
}

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

.mini-link {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 5px 9px;
  text-decoration: none;
}

.file-table-wrap,
.schema-table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--subtle);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.mono {
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: 0.88rem;
}

.muted {
  color: var(--muted);
}

.quality-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quality-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 16px;
}

.quality-item strong {
  font-size: 1.1rem;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 26px 0 0;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: relative;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    justify-content: flex-start;
    padding: 14px 22px;
  }

  main {
    padding: 0 22px 44px;
  }

  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .hero,
  .recommended-grid,
  .quick-grid,
  .country-grid,
  .quality-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .sidebar {
    padding: 18px 14px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    display: none;
  }

  main {
    padding: 0 16px 36px;
  }

  .hero {
    padding-top: 38px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .actions,
  .badges {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
