:root {
  --bg: #f7f7f9;
  --surface: #ffffff;
  --fg: #0f1115;
  --muted: #5f6470;
  --faint: #8a8f9a;
  --line: rgba(15, 17, 21, 0.08);
  --accent: #5b5bd6;
  --accent-soft: rgba(91, 91, 214, 0.1);
  --glow: rgba(91, 91, 214, 0.18);
  --header: rgba(247, 247, 249, 0.75);
  --shadow: 0 1px 2px rgba(15, 17, 21, 0.04), 0 8px 24px rgba(15, 17, 21, 0.06);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c10;
    --surface: #13151b;
    --fg: #e8e9ee;
    --muted: #a0a5b1;
    --faint: #6f7480;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #8f90ff;
    --accent-soft: rgba(143, 144, 255, 0.12);
    --glow: rgba(143, 144, 255, 0.16);
    --header: rgba(11, 12, 16, 0.7);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p, li { overflow-wrap: anywhere; }
img { display: block; }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar { max-width: 1080px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.bar nav { display: flex; gap: 20px; font-size: 0.92rem; }
.bar nav a { color: var(--muted); }
.bar nav a:hover { color: var(--fg); text-decoration: none; }

.site-footer { border-top: 1px solid var(--line); margin-top: 80px; }
.site-footer .bar { height: auto; padding: 28px 16px; flex-wrap: wrap; color: var(--faint); font-size: 0.88rem; }
.site-footer a { color: var(--muted); }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: -260px; width: 900px; height: 600px; transform: translateX(-50%);
  pointer-events: none; background: radial-gradient(closest-side, var(--glow), transparent);
}
.hero-inner { position: relative; max-width: 1080px; margin: 0 auto; padding: 88px 16px 56px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.035em; margin: 20px 0 16px; max-width: 15ch; }
.hero p { color: var(--muted); font-size: 1.12rem; max-width: 52ch; margin: 0; }

.section { max-width: 1080px; margin: 0 auto; padding: 24px 16px; }
.section h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 600; margin: 0 0 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.grid .card:hover { transform: translateY(-2px); border-color: var(--accent-soft); }
.card-top { display: flex; align-items: center; gap: 14px; }
.icon { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); flex: none; }
.card h3 { margin: 0; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.3; }
.card .tag { color: var(--faint); font-size: 0.84rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; flex: 1; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--fg); font-size: 0.86rem; font-weight: 500;
}
.pill:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.pill.soon, .pill.soon:hover { color: var(--faint); border-color: var(--line); border-style: dashed; cursor: default; }

.contact-card { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.contact-card h3 { margin-bottom: 4px; }
.contact-card p { flex: none; }
.button {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px;
  background: var(--fg); color: var(--bg); font-weight: 600; font-size: 0.94rem;
}
.button:hover { text-decoration: none; opacity: 0.88; }

/* ---------- legal documents ---------- */
.doc-head { max-width: 1080px; margin: 0 auto; padding: 44px 16px 8px; }
.crumbs { font-size: 0.86rem; color: var(--faint); margin-bottom: 22px; }
.crumbs a { color: var(--muted); }
.app-line { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.app-line .icon { width: 48px; height: 48px; border-radius: 12px; }
.app-line strong { display: block; font-size: 1rem; line-height: 1.3; }
.app-line span { color: var(--faint); font-size: 0.86rem; }
.doc-head h1 { font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 8px; }
.doc-head .muted { color: var(--muted); margin: 0; font-size: 0.95rem; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin-top: 24px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tabs a { padding: 8px 16px; border-radius: 9px; color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.tabs a:hover { text-decoration: none; color: var(--fg); }
.tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.doc-layout { max-width: 1080px; margin: 0 auto; padding: 24px 16px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
@media (min-width: 960px) {
  .doc-layout { grid-template-columns: 220px minmax(0, 720px); gap: 56px; }
}
.toc { font-size: 0.88rem; }
.toc-inner { position: sticky; top: 84px; }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.4; }
.toc li a:hover { color: var(--fg); text-decoration: none; }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); }
.toc details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.toc summary { cursor: pointer; font-weight: 600; color: var(--fg); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
@media (min-width: 960px) {
  .toc details { background: none; border: 0; padding: 0; }
  .toc summary { color: var(--faint); cursor: default; list-style: none; pointer-events: none; }
  .toc summary::-webkit-details-marker { display: none; }
}

.doc > p:first-child { font-size: 1.08rem; }
.doc h2 { font-size: 1.25rem; letter-spacing: -0.015em; margin: 44px 0 10px; scroll-margin-top: 84px; }
.doc h2:first-of-type { margin-top: 32px; }
.doc p, .doc li { color: var(--muted); }
.doc p:first-child, .doc strong { color: var(--fg); }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--accent); }
.doc .anchor { opacity: 0; margin-left: 8px; color: var(--faint); font-weight: 400; }
.doc h2:hover .anchor { opacity: 1; }
.to-top { margin-top: 48px; font-size: 0.9rem; }

/* ---------- copy buttons ---------- */
button.pill { font: inherit; font-size: 0.86rem; font-weight: 500; cursor: pointer; background: transparent; }
.pill.copied, .pill.copied:hover { border-color: #22a06b; color: #22a06b; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.head-actions .tabs { margin-top: 0; }

/* ---------- app pages ---------- */
.app-hero { position: relative; overflow: hidden; }
.app-hero::before {
  content: ""; position: absolute; left: 50%; top: -280px; width: 900px; height: 600px; transform: translateX(-50%);
  pointer-events: none; background: radial-gradient(closest-side, var(--glow), transparent);
}
.app-hero-inner { position: relative; max-width: 1080px; margin: 0 auto; padding: 44px 16px 16px; }
.app-title { display: flex; align-items: center; gap: 20px; }
.icon-lg { width: 96px; height: 96px; border-radius: 24px; }
.app-title h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 6px; }
.app-title .tag { margin: 0; color: var(--faint); font-size: 0.92rem; }
.app-short { font-size: 1.15rem; color: var(--muted); max-width: 56ch; margin: 22px 0 22px; }
.app-hero .links { align-items: center; }
.button-soon { background: var(--accent-soft); color: var(--accent); cursor: default; }
.button-soon:hover { opacity: 1; }

.shots {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px;
  scrollbar-width: thin;
}
.shots a { flex: none; scroll-snap-align: start; }
.shots img {
  width: 220px; height: auto; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.feature { width: 100%; max-width: 860px; height: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }

.app-doc { max-width: 720px; }
.app-doc .lead { font-size: 1.15rem; color: var(--fg); }
.app-doc h2 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 36px 0 8px;
}

.legal-box { max-width: 720px; gap: 10px; }
.legal-box h3 { margin-bottom: 4px; }
.legal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.legal-label { font-weight: 600; min-width: 130px; }
.legal-row code {
  flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; font: 0.86rem/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}

@media (max-width: 600px) {
  .bar nav { gap: 14px; }
  .shots img { width: 180px; }
  .icon-lg { width: 72px; height: 72px; border-radius: 18px; }
  .hero-inner { padding-top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}
.card-link { color: inherit; }
.card-link:hover { color: var(--accent); text-decoration: none; }
