/* Skip link (keyboard access). */
.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
}
.skip-link:focus { top: 1rem; }

:root {
  color-scheme: light;

  --page: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceef2;
  --grid: #e3e6eb;

  --ink: #171b21;
  --ink-soft: #4b5563;
  --muted: #6b7280;
  --border: #d8dde4;

  --primary: #2f5fbf;
  --primary-hover: #234b9b;
  --primary-soft: #eef3fb;
  --button-bg: #2f5fbf;
  --button-hover: #234b9b;
  --button-fg: #ffffff;
  --accent: #6b7280;
  --accent-soft: #f1f3f5;
  --danger: #b42318;
  --danger-soft: #fdecec;

  --chart-3: #94a3b8;
  --chart-4: #475569;
  --chart-5: #c0c7d1;
  --chart-6: #334155;
  --chart-7: #d4d9e0;

  --radius: 4px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --max-width: 1100px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --page: #12151a;
  --surface: #171b21;
  --surface-2: #1d2229;
  --surface-3: #252b34;
  --grid: #2b323c;

  --ink: #eef1f5;
  --ink-soft: #b6bfcc;
  --muted: #98a2b0;
  --border: #333b46;

  --primary: #82aaf5;
  --primary-hover: #a5c3fa;
  --primary-soft: #1b2941;
  --button-bg: #2f5fbf;
  --button-hover: #3b6fc7;
  --button-fg: #ffffff;
  --accent: #aeb8c6;
  --accent-soft: #262c35;
  --danger: #fda29b;
  --danger-soft: #3a2224;

  --chart-3: #7d8795;
  --chart-4: #c4ccd7;
  --chart-5: #5d6875;
  --chart-6: #e2e8f0;
  --chart-7: #47505c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0 0 0.75rem;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.35rem; }
li { margin-bottom: 0.35rem; }
img { max-width: 100%; display: block; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
a { color: inherit; text-decoration: none; }
a.inline-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
::selection { background: var(--primary-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

html {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--page);
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--page); }
*::-webkit-scrollbar-thumb { background: var(--border); border: 2px solid var(--page); }
*::-webkit-scrollbar-corner { background: var(--page); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max-width);
  min-height: 4.25rem;
  margin: 0 auto;
  padding: 0 var(--space-3);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding-right: 1rem;
  border-right: 1px solid var(--border);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}
.nav-brand .accent,
.footer-brand .accent { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  font-size: 0.86rem;
  font-weight: 500;
}
.nav-links a {
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-soft);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  border-bottom-color: var(--primary);
  color: var(--ink);
}
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  line-height: 1;
  cursor: pointer;
}
.theme-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Sections ---------- */
.section {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: 0; }
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}
.section-head { margin-bottom: 2.5rem; }
.section-head h2,
.section-head h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.section-head .kicker,
.hero-text .eyebrow {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.section-head p { color: var(--ink-soft); max-width: 70ch; }

.features,
.gallery { background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}
.btn-primary {
  border-color: var(--button-bg);
  background: var(--button-bg);
  color: var(--button-fg);
}
.btn-primary:hover {
  border-color: var(--button-hover);
  background: var(--button-hover);
}
.btn-ghost:hover,
.btn-outline:hover {
  border-color: var(--ink-soft);
  background: var(--surface-2);
}
.btn-block { width: 100%; }

/* ---------- Home hero ---------- */
.hero { background: var(--surface); }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}
@media (min-width: 860px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: var(--space-6);
  }
}
.hero-text h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  margin-bottom: 1.15rem;
}
.hero-text .accent-word { color: var(--primary); }
.hero-text p.lead {
  max-width: 60ch;
  margin-bottom: var(--space-3);
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.hero-actions .btn { flex: 0 1 auto; }
.hero-shot {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1240 / 820;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.hero-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Cards ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.feature-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.feature-card:hover { border-color: var(--ink-soft); }
.feature-card > svg,
.feature-icon {
  display: block;
  margin-bottom: 1rem;
  color: var(--primary);
}
.feature-icon svg { display: block; }
.feature-card h3 { font-size: 1.02rem; }
.feature-card p { color: var(--ink-soft); font-size: 0.92rem; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: var(--space-1); }
.note { max-width: 72ch; color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- Screenshot gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.gallery-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 0;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 1240 / 820;
  object-fit: cover;
}
.gallery-caption {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.84rem;
}

/* ---------- Call to action ---------- */
.cta {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.cta h2 { font-size: 1.5rem; }
.cta p { color: var(--ink-soft); margin-bottom: var(--space-3); }
.cta .hero-actions { justify-content: flex-start; }

/* ---------- Downloads ---------- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.download-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.download-chip {
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.download-card h3 { font-size: 1.15rem; }
.download-size {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--muted);
  font-size: 0.82rem;
}
.download-card .btn-block { margin-top: auto; }

/* ---------- Tables ---------- */
.versions-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.9rem;
}
.versions-table th,
.versions-table td {
  padding: 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.versions-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.version-badge {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}
.date-cell { color: var(--muted); font-size: 0.85rem; }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.faq-question:hover { background: var(--surface-2); }
.faq-answer {
  display: none;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.94rem;
}
.faq-item.open .faq-answer { display: block; }

/* ---------- Built with ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.stack-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
}
.stack-card:hover { border-color: var(--ink-soft); }
.stack-card svg { color: var(--ink-soft); }
.stack-card h3 { margin: var(--space-2) 0 0.25rem; font-size: 1rem; }
.stack-card p { color: var(--ink-soft); font-size: 0.85rem; }

/* ---------- What's new ---------- */
.whats-new { max-width: 760px; }
.whats-new h3 { margin-top: var(--space-4); font-size: 1.2rem; }
.whats-new ul { color: var(--ink-soft); }
.whats-new li { margin-bottom: 0.6rem; }

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--space-5) var(--space-3);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-brand {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-links a:hover { color: var(--primary); }
.footer-note { color: var(--muted); font-size: 0.78rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
@media (max-width: 719px) {
  .header-inner {
    height: auto;
    min-height: 4rem;
    flex-wrap: wrap;
    padding: 0.6rem var(--space-2);
  }
  .nav-links {
    order: 2;
    flex-basis: 100%;
    gap: 1rem;
    overflow-x: auto;
  }
  .section { padding: var(--space-5) 0; }
  .hero-text h1 { font-size: 2.25rem; }
  .section-inner,
  .hero-inner { padding: 0 var(--space-2); }
}
