:root {
  --bg: #fffaf6;
  --surface: #ffffff;
  --surface-2: #fbf1ea;
  --text: #2a1418;
  --muted: #6d5a5c;
  --border: #ecdcd2;
  --accent: #e0582f;
  --accent-strong: #c93a2c;
  --accent-soft: #fde7d6;
  --code-bg: #f7ece4;
  --warn-bg: #fff4dd;
  --warn-border: #f0c36a;
  --radius: 12px;
  --max: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17100f;
    --surface: #211715;
    --surface-2: #2a1d1a;
    --text: #f6ece6;
    --muted: #b9a7a2;
    --border: #3b2c28;
    --accent: #f58a3d;
    --accent-strong: #ffb067;
    --accent-soft: #3a2218;
    --code-bg: #2a1d1a;
    --warn-bg: #33270f;
    --warn-border: #8a6a24;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent-strong); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; }
pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; line-height: 1.5;
}
pre code { background: none; padding: 0; }
kbd {
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  padding: 0.05em 0.4em; background: var(--surface);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: var(--max); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: 0.18em; }
.brand img { width: 30px; height: 30px; }
@media (max-width: 640px) { .site-header { position: static; } }
.site-header nav { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 4px 0; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }
.site-header nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

main { max-width: var(--max); margin: 0 auto; padding: 24px 16px 64px; }
.prose { max-width: 760px; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 24px 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 26px; margin: 48px 0 12px; line-height: 1.25; }
h3 { font-size: 19px; margin: 28px 0 8px; }
.lede { font-size: 20px; color: var(--muted); max-width: 700px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; font-weight: 600; color: var(--accent-strong); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 24px 0 8px; }
.hero .logo-light, .hero .logo-dark { width: 300px; max-width: 80%; margin-bottom: 8px; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { .logo-light { display: none !important; } .logo-dark { display: block !important; } }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; gap: 24px; } }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 8px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px; text-decoration: none; font-weight: 600;
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #1b0f0c; } }
.btn:hover { filter: brightness(1.05); }

/* Cards and grids */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

table { border-collapse: collapse; width: 100%; margin: 12px 0 20px; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.note, .warn {
  border-radius: 10px; padding: 12px 16px; margin: 16px 0;
  background: var(--accent-soft); border-left: 4px solid var(--accent);
}
.warn { background: var(--warn-bg); border-left-color: var(--warn-border); }
.note p, .warn p { margin: 0.3em 0; }

ol.steps { counter-reset: s; list-style: none; padding: 0; }
ol.steps > li { counter-increment: s; position: relative; padding-left: 44px; margin: 0 0 20px; }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px;
}

/* Before / after slider */
.compare {
  position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border);
  background: #000; user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: ew-resize;
}
.compare img { width: 100%; pointer-events: none; }
.compare .after-wrap { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .after-wrap img { width: 100%; height: 100%; object-fit: cover; }
.compare .divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.5);
}
.compare .divider::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; color: #222; border-radius: 999px; padding: 2px 8px; font-weight: 700; font-size: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,.4); white-space: nowrap; line-height: 1.4;
}
.compare .tag {
  position: absolute; top: 10px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(0,0,0,.6); color: #fff; letter-spacing: .04em;
}
.compare .tag.before { left: 10px; }
.compare .tag.after { right: 10px; background: rgba(224,88,47,.9); }
.compare .divider, .compare .tag { pointer-events: none; }
/* Kept for keyboard and screen readers; dragging is handled on the photo (compare.js). */
.compare input[type=range] {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; margin: 0; pointer-events: none;
}
.compare:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; }

.sample h3 { margin: 0 0 4px; }
.sample .meta { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.samples { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }

.downloads td:first-child { white-space: nowrap; }

.toc { font-size: 15px; background: var(--surface-2); border-radius: 10px; padding: 12px 18px; }
.toc ul { margin: 6px 0; padding-left: 18px; }

footer.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
footer.site-footer .inner { max-width: var(--max); margin: 0 auto; padding: 20px 16px 40px; display: flex; gap: 8px 24px; flex-wrap: wrap; }
footer.site-footer a { color: var(--muted); }

/* App screenshots */
figure.shot { margin: 20px 0; }
figure.shot img { border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(0,0,0,.12); }
figure.shot.small img { width: 300px; }
.shots { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.shots figure.shot { margin: 8px 0; }
