:root {
  --bg: #f3efe6;
  --bg-raised: #fffcf6;
  --ink: #1c1915;
  --muted: #5e584f;
  --line: #e2d9cc;
  --accent: #2436c7;
  --accent-ink: #182790;
  --tide: #0f766e;
  --warn-bg: #f8ead3;
  --warn-ink: #6d3d0c;
  --shadow: 0 18px 50px rgba(40, 32, 18, 0.08);
  --code-bg: #efe7da;
  --ghost-line: #cfc6b8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  --measure: 72rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #141210;
  --bg-raised: #211e19;
  --ink: #f4efe6;
  --muted: #b7aea1;
  --line: #3c362e;
  --accent: #9aa6ff;
  --accent-ink: #c9d0ff;
  --tide: #7ddec9;
  --warn-bg: #3a2c18;
  --warn-ink: #f3d7ae;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --code-bg: #2c2823;
  --ghost-line: #4d463c;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .logo-positive { display: none; }
  :root[data-theme="system"] .logo-negative { display: block; }
  :root[data-theme="system"] {
    --bg: #141210;
    --bg-raised: #211e19;
    --ink: #f4efe6;
    --muted: #b7aea1;
    --line: #3c362e;
    --accent: #9aa6ff;
    --accent-ink: #c9d0ff;
    --tide: #7ddec9;
    --warn-bg: #3a2c18;
    --warn-ink: #f3d7ae;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --code-bg: #2c2823;
    --ghost-line: #4d463c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 480px at 80% -10%, rgba(36, 54, 199, 0.08), transparent 60%),
    radial-gradient(900px 420px at -10% 20%, rgba(15, 118, 110, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent-ink); text-underline-offset: 0.18em; }

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

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

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.5rem 0.8rem;
  z-index: 10;
}

.skip:focus { top: 0.75rem; }

.wrap {
  width: min(var(--measure), calc(100% - 2.5rem));
  margin-inline: auto;
}

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

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  line-height: 0;
}

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

.brand-logo { height: 2.35rem; width: auto; }
.logo-negative { display: none; }
:root[data-theme="dark"] .logo-positive { display: none; }
:root[data-theme="dark"] .logo-negative { display: block; }

.mark { width: 2.15rem; height: 2.15rem; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.1rem;
}

.nav a, .footer-nav a {
  color: var(--ink);
  text-decoration: none;
}

.nav a:hover, .footer-nav a:hover { text-decoration: underline; }

.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.35em; }

.menu { position: relative; }
.menu summary {
  display: block;
  list-style: none;
  cursor: pointer;
  color: var(--ink);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; font-size: 0.75em; }
.menu summary:hover { text-decoration: underline; }
.menu::details-content {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 3;
}
.menu-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-width: 11.5rem;
  padding: 0.35rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.menu-panel a { display: block; padding: 0.35rem 0.65rem; white-space: nowrap; }

.lang-menu summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.lang-menu .menu-panel,
.lang-menu::details-content { left: auto; right: 0; }
.lang-menu .menu-panel a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  letter-spacing: 0;
}
.lang-menu a[aria-current="true"] { text-decoration: underline; text-underline-offset: 0.3em; }
.flag {
  width: 1.15rem;
  height: 0.75rem;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--line);
}

.theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--ink);
  cursor: pointer;
}
.theme svg { width: 1.05rem; height: 1.05rem; }
.theme .icon { display: none; }
:root[data-theme="light"] .theme .icon-light,
:root[data-theme="dark"] .theme .icon-dark,
:root[data-theme="system"] .theme .icon-system { display: block; }

.hero { padding: 3.4rem 0 1.5rem; text-align: center; }

h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; line-height: 1.12; }

h1 { margin: 0 auto 1rem; max-width: 18ch; font-size: clamp(2.6rem, 6vw, 4.4rem); }

.lede, .page-intro {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.18rem;
}

.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 650;
}

.button.primary { background: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-ink); color: white; }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--ghost-line); }
.button.ghost:hover { background: var(--bg-raised); color: var(--ink); }

.stage {
  margin: 2.4rem auto 0;
  width: min(52rem, 100%);
  background: #1c1915;
  color: #f6f1e8;
  border-radius: 1rem 1rem 0.4rem 0.4rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}

.stage-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.85rem;
  background: #2a261f;
}

.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #6d655b; }
.dot:nth-child(1) { background: #d4654a; }
.dot:nth-child(2) { background: #e0b15a; }
.dot:nth-child(3) { background: #6ea36a; }

.omnibox {
  margin-left: 0.45rem;
  flex: 1;
  background: #14120f;
  color: #d9d0c3;
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.stage-body { padding: 1.4rem 1.5rem 1.6rem; }
.stage-body strong { font-family: var(--serif); font-size: 1.55rem; font-weight: 560; }
.stage-body p { margin: 0.4rem 0 0; color: #d5cdc1; }

.features { padding: 3.2rem 0 1rem; }

.features h2, .page-head h1 { max-width: none; text-align: left; }

.feature-grid, .contact-grid, .download-grid {
  display: grid;
  gap: 1rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}

.feature-grid { grid-template-columns: repeat(3, 1fr); }
.contact-grid { grid-template-columns: repeat(2, 1fr); }
.download-grid { grid-template-columns: repeat(4, 1fr); }

.feature, .contact-card, .download-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.feature, .contact-card { padding: 1.15rem 1.15rem 1.2rem; }

.feature h3, .contact-card h2 { margin: 0 0 0.35rem; font-size: 1.35rem; }

.feature p, .contact-card p { margin: 0; color: var(--muted); }

.prose-list { margin: 1.2rem 0 0; padding-left: 1.2rem; max-width: 40rem; }
.prose-list li { margin: 0.45rem 0; }
.page-head { padding: 2.6rem 0 0.4rem; }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin: 0 0 0.8rem; }
.page-intro { margin-left: 0; }

.release-line { margin: 0.8rem 0 0; color: var(--tide); font-weight: 650; }

.note {
  margin: 1.4rem 0 0;
  padding: 0.9rem 1rem;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 0.8rem;
}

.download-card { position: relative; display: flex; flex-direction: column; min-height: 9.5rem; }
.download-card a.file {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
  padding: 1.05rem 1rem 0.85rem;
  color: var(--ink);
  text-decoration: none;
}
.download-card a.file:hover .file-name { color: var(--accent); text-decoration: underline; }
.file-name { font-weight: 700; }
.file-meta { color: var(--muted); font-size: 0.92rem; }
.sum {
  margin: auto 1rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.suggest {
  display: none;
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: var(--tide);
  color: white;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.download-card.is-suggested { border-color: var(--tide); }
.download-card.is-suggested .suggest { display: inline; }

.prose { padding: 0.5rem 0 2rem; max-width: 46rem; }
.prose h2 { margin: 2rem 0 0.4rem; font-size: 2rem; }
.prose h3 { margin: 1.3rem 0 0.3rem; font-size: 1.25rem; }
.prose p { color: var(--muted); }
.prose li { margin: 0.25rem 0; }
code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 0.08em 0.35em;
  border-radius: 0.3rem;
}

main { flex: 1 0 auto; }

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.4rem;
  color: var(--muted);
}

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

.site-footer p { margin: 0.25rem 0; }
.footer-nav { display: flex; gap: 1rem; flex-wrap: wrap; }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
}
.gate h1 { font-size: 2.4rem; }
.gate-links { display: flex; justify-content: center; gap: 0.8rem; margin-top: 1rem; }

@media (max-width: 900px) {
  .feature-grid, .download-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 901px) {
  .burger { display: none; }
}

@media (max-width: 900px) {
  .header-tools { position: relative; gap: 0.7rem; }
  .burger {
    display: grid;
    place-items: center;
    order: 1;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-raised);
    color: var(--ink);
    cursor: pointer;
  }
  .burger::before {
    content: "";
    width: 0.95rem;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
  }
  .nav { display: none; }
  .nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 4;
    gap: 0.15rem;
    min-width: 13rem;
    max-width: calc(100vw - 1.5rem);
    padding: 0.45rem;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 0.55rem;
  }
  .nav.is-open > a,
  .nav.is-open .menu summary { padding: 0.4rem 0.55rem; }
  .nav.is-open .menu,
  .nav.is-open .menu-panel,
  .nav.is-open .menu::details-content { position: static; }
  .nav.is-open .menu-panel {
    min-width: 0;
    margin: 0 0 0.2rem 0.45rem;
    padding: 0;
    background: transparent;
    border: 0;
  }
}

@media (max-width: 640px) {
  .wrap { width: min(var(--measure), calc(100% - 1.5rem)); }
  .feature-grid, .contact-grid, .download-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 2.2rem; }
}

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