:root {
  color-scheme: light dark;

  --bg-light: #fafaf9;
  --bg-dark: #0d1117;
  --surface-light: #ffffff;
  --surface-dark: #141922;
  --raised-light: #f3f4f6;
  --raised-dark: #1b2230;

  --fg-light: #14181f;
  --fg-dark: #edf1f7;
  --muted-light: #4b5563;
  --muted-dark: #9aa4b5;
  --subtle-light: #5c6675;
  --subtle-dark: #8792a5;

  --line-light: rgba(20, 24, 31, 0.11);
  --line-dark: rgba(237, 241, 247, 0.12);

  --accent-light: #15624a;
  --accent-dark: #52c49b;
  --accent-hover-light: #104e3b;
  --accent-hover-dark: #6ad3ad;
  --accent-ink-light: #ffffff;
  --accent-ink-dark: #081e17;
  --accent-soft-light: rgba(21, 98, 74, 0.08);
  --accent-soft-dark: rgba(82, 196, 155, 0.12);

  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --raised: var(--raised-light);
  --fg: var(--fg-light);
  --muted: var(--muted-light);
  --subtle: var(--subtle-light);
  --line: var(--line-light);
  --accent: var(--accent-light);
  --accent-hover: var(--accent-hover-light);
  --accent-ink: var(--accent-ink-light);
  --accent-soft: var(--accent-soft-light);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --max-w: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --raised: var(--raised-dark);
    --fg: var(--fg-dark);
    --muted: var(--muted-dark);
    --subtle: var(--subtle-dark);
    --line: var(--line-dark);
    --accent: var(--accent-dark);
    --accent-hover: var(--accent-hover-dark);
    --accent-ink: var(--accent-ink-dark);
    --accent-soft: var(--accent-soft-dark);
  }
}

@supports (color: light-dark(white, black)) {
  :root {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --raised: light-dark(var(--raised-light), var(--raised-dark));
    --fg: light-dark(var(--fg-light), var(--fg-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --subtle: light-dark(var(--subtle-light), var(--subtle-dark));
    --line: light-dark(var(--line-light), var(--line-dark));
    --accent: light-dark(var(--accent-light), var(--accent-dark));
    --accent-hover: light-dark(var(--accent-hover-light), var(--accent-hover-dark));
    --accent-ink: light-dark(var(--accent-ink-light), var(--accent-ink-dark));
    --accent-soft: light-dark(var(--accent-soft-light), var(--accent-soft-dark));
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  accent-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-inline-size: 100%;
  block-size: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: color 150ms var(--ease);
}

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

:where(a:any-link, button, summary, [tabindex="0"]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 100;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
}

.wrap {
  max-inline-size: var(--max-w);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Header & Navigation */
.site-header {
  border-block-end: 1px solid var(--line);
  background: var(--bg);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-block-size: 64px;
  padding-block: 12px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--fg);
}

.brand img {
  inline-size: 32px;
  block-size: 32px;
  flex-shrink: 0;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-nav ul,
.lang-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-nav a,
.lang-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 32px;
  padding-inline: 2px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  border-block-end: 2px solid transparent;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.site-nav a:hover,
.lang-nav a:hover {
  color: var(--fg);
}

.lang-nav {
  padding-inline-start: 16px;
  border-inline-start: 1px solid var(--line);
}

.lang-nav a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
  border-block-end-color: var(--accent);
}

/* Hero */
.hero {
  padding-block: 56px 40px;
}

.hero-eyebrow {
  margin: 0 0 12px;
  font: 500 13px/1.4 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--subtle);
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
  max-inline-size: 24ch;
}

h1:focus {
  outline: none;
}

.h1-sub {
  display: block;
  margin-block-start: 6px;
  color: var(--muted);
  font-weight: 500;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.24;
  letter-spacing: -0.015em;
}

.lead {
  margin: 0 0 24px;
  max-inline-size: 68ch;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
}

.lead strong {
  color: var(--fg);
  font-weight: 600;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-block: 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-block-size: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--line);
}

.btn-secondary:hover {
  background: var(--raised);
  color: var(--fg);
}

.hero-meta {
  margin: 0 0 36px;
  font: 400 13px/1.6 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--subtle);
}

.hero-figure {
  margin: 0;
}

.shot {
  inline-size: 100%;
  border-radius: var(--radius-lg);
}

.hero-figure figcaption {
  margin-block-start: 12px;
  font-size: 13px;
  color: var(--subtle);
}

/* Spec Strip */
.spec-strip {
  list-style: none;
  margin: 0;
  padding: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.spec-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.spec-value {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  margin-block-end: 4px;
}

.spec-label {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* Sections */
.section {
  padding-block: 56px;
  border-block-start: 1px solid var(--line);
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
}

.section-lead {
  margin: 0 0 28px;
  max-inline-size: 70ch;
  color: var(--muted);
  font-size: 16px;
}

p {
  margin-block: 0 14px;
  max-inline-size: 72ch;
}

p:last-child {
  margin-block-end: 0;
}

/* Feature Bento / Structured List */
.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.feature-card p {
  font-size: 15px;
  color: var(--muted);
}

.feature-card p strong {
  color: var(--fg);
  font-weight: 500;
}

.shot-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-block-start: 28px;
}

.shot-pair figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.shot-pair img {
  border-radius: 6px;
}

.shot-pair figcaption {
  margin-block-start: 10px;
  padding-inline: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* Keycaps & Code */
kbd {
  display: inline-block;
  padding: 1px 6px;
  font: 500 12px/1.5 var(--font-mono);
  color: var(--fg);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  vertical-align: baseline;
}

code {
  font: 400 0.9em/1.5 var(--font-mono);
  background: var(--raised);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  margin: 16px 0 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font: 400 13px/1.6 var(--font-mono);
}

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

/* Responsive Data Tables */
.table-wrap {
  overflow-x: auto;
  max-inline-size: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  container-type: inline-size;
}

table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 1.55;
  text-align: start;
}

th,
td {
  text-align: start;
}

caption {
  padding: 14px 18px;
  text-align: start;
  font-size: 13px;
  font-weight: 500;
  color: var(--subtle);
  border-block-end: 1px solid var(--line);
  background: var(--raised);
}

thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: var(--raised);
  color: var(--fg);
  font-weight: 600;
  padding: 12px 16px;
  border-block-end: 1px solid var(--line);
  white-space: nowrap;
}

tbody th,
tbody td {
  padding: 12px 16px;
  border-block-end: 1px solid var(--line);
  vertical-align: top;
}

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

tbody th {
  font-weight: 600;
  color: var(--fg);
  background: var(--surface);
  white-space: nowrap;
}

tbody td {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@container (width < 600px) {
  .table-wrap table,
  .table-wrap caption,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

  .table-wrap caption {
    inline-size: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody tr {
    padding: 12px 16px;
    border-block-end: 1px solid var(--line);
  }

  .table-wrap tbody tr:last-child {
    border-block-end: 0;
  }

  .table-wrap tbody th,
  .table-wrap tbody td {
    padding: 4px 0;
    border: 0;
    white-space: normal;
  }

  .table-wrap tbody th {
    font-size: 15px;
    padding-block-end: 6px;
  }

  .table-wrap td:nth-child(2)::before {
    content: var(--col-2) " ";
    font-weight: 600;
    color: var(--fg);
  }

  .table-wrap td:nth-child(3)::before {
    content: var(--col-3) " ";
    font-weight: 600;
    color: var(--fg);
  }

  .table-wrap td:nth-child(4)::before {
    content: var(--col-4) " ";
    font-weight: 600;
    color: var(--fg);
  }
}

/* Download & Boundaries Split */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel ul {
  margin: 12px 0 0;
  padding-inline-start: 20px;
  color: var(--muted);
  font-size: 15px;
}

.panel li {
  margin-block-end: 8px;
}

.panel li:last-child {
  margin-block-end: 0;
}

/* Native Accordion FAQ */
.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.faq-list summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::before {
  content: "";
  inline-size: 16px;
  block-size: 16px;
  flex-shrink: 0;
  background-color: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}

.faq-list details[open] > summary::before {
  rotate: 0deg;
}

.faq-list details::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.faq-list details:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .faq-list summary::before {
    transition: rotate 180ms var(--ease);
  }

  .faq-list details::details-content {
    transition: block-size 220ms var(--ease), content-visibility 220ms var(--ease), display 220ms var(--ease);
    transition-behavior: allow-discrete;
  }
}

.faq-body {
  padding: 0 20px 18px 46px;
  color: var(--muted);
  font-size: 15px;
}

/* Footer */
.site-footer {
  border-block-start: 1px solid var(--line);
  padding-block: 32px 48px;
  color: var(--subtle);
  font-size: 14px;
}

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

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .lang-nav {
    border-inline-start: 0;
    padding-inline-start: 0;
  }
}

@media (pointer: coarse) {
  .site-nav a,
  .lang-nav a {
    min-block-size: 44px;
    padding-inline: 6px;
  }

  .faq-list summary {
    min-block-size: 52px;
  }
}

@media (forced-colors: active) {
  .lang-nav a[aria-current="page"] {
    border-block-end-color: Highlight;
  }

  .faq-list summary::before {
    background-color: ButtonText;
  }
}
