:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #fa2d48;
  --accent-2: #7a1fd1;
  --card: #ffffff;
  --radius: 18px;
  --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-soft: #111113;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #2c2c2e;
    --card: #1c1c1e;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(180%) blur(20px); background: color-mix(in srgb, var(--bg) 80%, transparent); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand img { width: 28px; height: 28px; }
.nav .links { margin-left: auto; display: flex; gap: 20px; font-size: 15px; }
.nav .links a { color: var(--muted); }
.nav .links a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { text-align: center; padding: 88px 0 56px; }
.hero-banner { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.hero h1 { font-size: clamp(40px, 7vw, 72px); line-height: 1.05; letter-spacing: -0.03em; margin: 24px 0 12px; }
.hero h1 span { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lede { font-size: clamp(19px, 2.4vw, 24px); color: var(--muted); max-width: 680px; margin: 0 auto 32px; }
.buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 16px; }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.secondary { background: var(--bg-soft); color: var(--text); border: 1px solid var(--line); }
.btn:hover { text-decoration: none; opacity: .9; }
.platforms { margin-top: 18px; color: var(--muted); font-size: 14px; }

/* Sections */
section { padding: 64px 0; }
section.soft { background: var(--bg-soft); }
h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 12px; }
.section-lede { color: var(--muted); font-size: 19px; max-width: 640px; margin: 0 0 36px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin-bottom: 14px; }
.card h3 { margin: 0 0 6px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }

.devices { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.device { border-radius: var(--radius); padding: 28px; color: #fff; min-height: 240px; display: flex; flex-direction: column; justify-content: flex-end; }
.device h3 { font-size: 26px; margin: 0 0 8px; }
.device ul { margin: 0; padding-left: 18px; opacity: .92; font-size: 15px; }
.device.phone { background: linear-gradient(145deg, #fa2d48, #8c0d59); }
.device.watch { background: linear-gradient(145deg, #5c4df2, #1a8cf2); }
.device.mac { background: linear-gradient(145deg, #1ab38c, #0d598c); }

/* Screenshots */
#screenshots { scroll-margin-top: 56px; }
#screenshots + .soft { border-top: 1px solid var(--line); }
.screenshot-group + .screenshot-group { margin-top: 42px; }
.screenshot-group h3 { font-size: 26px; margin: 0 0 16px; }
.screenshot-grid { display: grid; gap: 12px; }
.screenshot-iphone, .screenshot-watch { grid-template-columns: repeat(auto-fill, 100px); }
.screenshot-mac { grid-template-columns: repeat(auto-fill, clamp(128px, 35vw, 195px)); }
.screenshot-grid figure { margin: 0; }
.screenshot-grid a, .screenshot-overview a { display: block; border-radius: 12px; }
#screenshots a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#screenshots img { display: block; height: auto; border-radius: 12px; }
.screenshot-grid img { width: 100%; }
.screenshot-grid figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }
.screenshot-overview { margin-top: 8px; }
.screenshot-overview a { width: fit-content; max-width: 100%; margin-top: 12px; }
.screenshot-overview img { max-width: min(100%, 480px); max-height: 260px; width: auto; }

/* Screenshot viewer */
html:has(#screenshot-viewer[open]) { overflow: hidden; }
#screenshot-viewer {
  width: min(100%, 1200px);
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 12px clamp(12px, 3vw, 32px);
  border: 0;
  background: transparent;
  color: #fff;
}
#screenshot-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
#screenshot-viewer::backdrop { background: rgba(12, 12, 15, .96); }
.viewer-toolbar, .viewer-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.viewer-toolbar { font-weight: 600; }
.viewer-stage { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; touch-action: pinch-zoom; user-select: none; }
.viewer-stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-caption { text-align: center; font-size: 15px; }
.viewer-count { display: block; color: #c3c3ca; font-size: 13px; }
#screenshot-viewer button {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid #63636b;
  border-radius: 50%;
  background: #27272d;
  color: inherit;
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}
#screenshot-viewer button:hover { background: #42424b; }
#screenshot-viewer button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.privacy-banner { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.privacy-banner .big { font-size: 56px; }

/* Docs pages */
.doc { padding: 56px 0 80px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(34px, 5vw, 48px); letter-spacing: -0.02em; margin: 0 0 6px; }
.doc .updated { color: var(--muted); margin: 0 0 32px; }
.doc h2 { font-size: 24px; margin: 36px 0 10px; }
.doc h3 { font-size: 19px; margin: 24px 0 8px; }
.doc p, .doc li { color: var(--text); }
.doc ul { padding-left: 22px; }
.doc pre { overflow-x: auto; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); }
.doc pre code { white-space: pre; }
.doc :not(pre) > code { overflow-wrap: anywhere; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { background: var(--bg-soft); }
.callout { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 18px 0; }
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 10px 0 0; }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; gap: 16px 28px; flex-wrap: wrap; align-items: center; }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--muted); }
footer .fine { width: 100%; font-size: 12px; }

@media (max-width: 640px) {
  .nav .links { gap: 14px; font-size: 14px; }
  .nav .links .hide-sm { display: none; }
  .hero { padding: 56px 0 40px; }
  section { padding: 48px 0; }
}
