:root {
  color-scheme: dark light;
  --bg: #0b0e14;
  --bg-soft: #11151f;
  --panel: #161b27;
  --text: #e7ecf3;
  --muted: #9aa6b8;
  --line: #232a39;
  --accent: #2563eb;
  --accent-2: #9333ea;
  --nav-bg: rgba(11, 14, 20, 0.72);
  --code-bg: #0e1219;
  --hero-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
  --radius: 16px;
  --wrap: 1080px;
}

/* Light theme — follows the user's system preference */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-soft: #f4f6fa;
    --panel: #ffffff;
    --text: #14181f;
    --muted: #5b6675;
    --line: #e3e8ef;
    --accent: #2563eb;
    --accent-2: #9333ea;
    --nav-bg: rgba(255, 255, 255, 0.78);
    --code-bg: #f0f3f7;
    --hero-shadow: 0 24px 50px -28px rgba(20, 30, 50, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 28px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand img { width: 42px; height: 42px; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text b { font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.brand-text small { font-weight: 400; font-size: .82rem; color: var(--accent); letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 24px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 999px;
  font-weight: 600; transition: transform .12s ease, background .2s ease, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3b82f6; }
.btn-ghost { border: 1px solid var(--line); color: var(--text); padding: 8px 16px; }
.btn-ghost:hover { border-color: var(--accent-2); }
.badge {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  border: 1px dashed var(--line); color: var(--muted); font-size: .85rem;
}

/* App Store / Mac App Store badges */
.stores { display: flex; gap: 14px; flex-wrap: wrap; }
.cta-band .stores { justify-content: center; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  background: #000; color: #fff; border: 1px solid #2b2b2b;
  border-radius: 12px; padding: 9px 18px; min-width: 180px;
  transition: border-color .2s, transform .12s;
}
.store:hover { border-color: #555; transform: translateY(-2px); }
.store:active { transform: translateY(0); }
.store .apple { width: 21px; height: 25px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.12; }
.store small { font-size: .62rem; letter-spacing: .02em; opacity: .9; }
.store b { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.copyright { opacity: .7; }

/* Hero */
.hero { padding: 72px 0 40px; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  margin: 0 0 10px; font-weight: 700; font-size: .95rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 46ch; }
.hero-cta { display: flex; align-items: center; gap: 16px; margin: 26px 0 14px; flex-wrap: wrap; }
.fineprint { color: var(--muted); font-size: .85rem; }

.hero-art .card {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--hero-shadow);
}
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-art .grid line { stroke: var(--line); stroke-width: 1; }
.hero-art .trace { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hero-art .trace2 { stroke: var(--accent-2); stroke-width: 1.75; opacity: .85; }
.hero-art .marker { stroke: #f5c451; stroke-width: 1.5; }
.hero-art .mk { fill: #1a1206; font-size: 11px; font-weight: 700; text-anchor: middle;
  paint-order: stroke; stroke: #f5c451; stroke-width: 10px; stroke-linejoin: round; }
.readout {
  display: flex; gap: 22px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line); flex-wrap: wrap;
}
.readout div { display: flex; flex-direction: column; }
.readout span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.readout b { font-variant-numeric: tabular-nums; font-size: 1.05rem; }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section.alt { background: var(--bg-soft); }

.grid-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: border-color .2s, transform .12s;
}
.feature:hover { border-color: var(--accent-2); transform: translateY(-3px); }
.feature .ic { font-size: 1.7rem; }
.feature h3 { font-size: 1.1rem; margin: 12px 0 6px; }
.feature p { color: var(--muted); margin: 0; font-size: .96rem; }
code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .85em; }

/* Platforms */
.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.checks { list-style: none; padding: 0; margin: 18px 0 0; }
.checks li { padding: 8px 0 8px 28px; position: relative; color: var(--muted); }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.device-row { display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.device { background: #05070b; border: 2px solid var(--line); border-radius: 18px; padding: 8px; }
.device .screen {
  border-radius: 10px;
  background:
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 28px),
    linear-gradient(120deg, rgba(37,99,235,.14), rgba(147,51,234,.14)), var(--bg-soft);
}
.device.mac { width: 280px; }
.device.mac .screen { height: 170px; }
.device.phone { width: 96px; border-radius: 22px; }
.device.phone .screen { height: 190px; }

/* Format */
.format .lead { max-width: 60ch; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chips span {
  padding: 8px 14px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line); color: var(--muted); font-size: .9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Changelog */
.changelog { list-style: none; padding: 0; margin: 0; max-width: 720px; }
.changelog > li {
  display: grid; grid-template-columns: 120px 1fr; gap: 24px;
  padding: 26px 0; border-top: 1px solid var(--line);
}
.changelog > li:first-child { border-top: 0; padding-top: 0; }
.rel-meta { display: flex; flex-direction: column; gap: 6px; }
.ver {
  align-self: start; font-weight: 700; font-size: .95rem; color: #fff;
  background: var(--accent); padding: 3px 12px; border-radius: 999px;
}
.date { color: var(--muted); font-size: .85rem; }
.rel-body h3 { font-size: 1.1rem; margin: 0 0 12px; }
.rel-body ul { margin: 0; padding-left: 18px; color: var(--muted); }
.rel-body li { padding: 3px 0; }

/* CTA */
.cta-band { padding: 72px 0; text-align: center; border-top: 1px solid var(--line);
  background: radial-gradient(600px 200px at 50% 0, rgba(37,99,235,.14), transparent); }
.cta-inner p { color: var(--muted); margin: 8px 0 24px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--muted); }
.footer-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.footer .brand img { width: 24px; height: 24px; }
.footer p { margin: 0; font-size: .85rem; max-width: 60ch; }
.footer a { color: var(--accent-2); }

/* Responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .grid-features { grid-template-columns: 1fr 1fr; }
  .platforms { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  .grid-features { grid-template-columns: 1fr; }
  .changelog > li { grid-template-columns: 1fr; gap: 10px; }
}
