:root {
  color-scheme: light;
  --bg: #f3f1ea;
  --bg-elev: #fffcf6;
  --ink: #1c1b17;
  --muted: #4e4a42;
  --line: #e3ddd0;
  --accent: #3f2d86;
  --accent-soft: #efeafc;
  --warm: #8a3e0a;
  --warm-soft: #fde8d4;
  --shadow: 0 16px 40px rgba(28, 27, 23, 0.08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 1120px;
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #131311;
    --bg-elev: #1d1c19;
    --ink: #f4f1e8;
    --muted: #c8c1b3;
    --line: #333027;
    --accent: #d4c6ff;
    --accent-soft: #2a2440;
    --warm: #f0b27a;
    --warm-soft: #3a2a1c;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
section[id], h2[id], h3[id] { scroll-margin-top: 96px; }
h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); margin: 0.2em 0 0.35em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0 0 0.4em; }
h3 { font-size: 1.35rem; margin: 0 0 0.35em; }
p { margin: 0 0 0.9em; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 5;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(760px, calc(100% - 40px)); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
}
.brand svg { display: block; color: var(--ink); }
.brand-accent { fill: var(--accent); }
.primary { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.primary a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.primary a:hover { text-decoration: underline; }
.lang { margin-left: auto; display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-elev); }
.lang a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
}
.lang a[aria-current="true"] { background: var(--ink); color: var(--bg); }
.github {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 650;
}

.hero { padding: 48px 0 20px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 36px; align-items: center; }
.hero-grid > *, .try-grid > *, .split > *, .cards > *, .steps > *, .why > *, .linkcards > *, .footer-grid > * { min-width: 0; }
.kicker {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
}
.lede { font-size: 1.15rem; max-width: 38rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 650;
  border: 1px solid transparent;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-elev); text-decoration: none; }
.btn-tiny {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 0.85rem;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
}

.frame, .card-shot, .phone {
  margin: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 10px 4px;
}
.frame img, .card-shot img, .phone img { display: block; width: 100%; border-radius: 12px; }
figcaption { color: var(--muted); font-size: 0.9rem; padding: 10px 6px 8px; }

.band { padding: 10px 0 28px; }
.why {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.why li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 650;
}

.section { padding: 56px 0; }
.section-alt { background: color-mix(in srgb, var(--ink) 4%, var(--bg)); }
.intro { color: var(--muted); max-width: 42rem; }
.steps {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.steps li, .cards li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 8px;
}
.num { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--accent); margin-bottom: 8px; }
.cards {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.cards p, .steps p { color: var(--muted); }

.split {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-top: 8px;
}
.phone { max-width: 320px; margin: 36px auto 0; }

.try-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.code-caption { font-size: 0.92rem; color: var(--muted); margin: 0; }
pre {
  margin: 0;
  max-width: 100%;
  padding: 18px 18px 18px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: auto;
  background: #1c1b17;
  color: #f4f1ea;
  border-radius: 14px;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.65;
}
code { font-family: inherit; }

.linkcards {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.linkcards a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.linkcards a:hover { border-color: var(--accent); }
.linkcards span { color: var(--muted); }
.roadmap {
  margin-top: 36px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.roadmap ul { margin: 0 0 12px; padding-left: 1.2em; }
.roadmap li { margin: 0.35em 0; }

.faq details {
  border-top: 1px solid var(--line);
  padding: 4px 0;
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 4px;
}
.faq summary:hover { color: var(--accent); }
.answer { white-space: pre-line; }

.download {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.pill {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--warm-soft);
  color: var(--warm);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fine { color: var(--muted); font-size: 0.92rem; }
.pill [data-download-version] { text-transform: none; letter-spacing: 0; }
.download-platforms[hidden] { display: none; }
.download-platforms:not([hidden]) {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0 0;
  padding: 0;
}
.download-platforms a { font-weight: 650; }

.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.site-footer p { color: var(--muted); margin: 6px 0 0; }

@media (max-width: 900px) {
  .hero-grid, .try-grid, .split, .steps, .why, .cards { grid-template-columns: 1fr; }
  .linkcards { grid-template-columns: 1fr; }
  .lang { margin-left: 0; }
  .hero { padding-top: 28px; }
  .section { padding: 40px 0; }
  section[id], h2[id], h3[id] { scroll-margin-top: 148px; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .cards, .why { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
