/* ---------- Tokens ---------- */
:root {
  --bg: #0C0E10; --surface: #15181C; --line: #262B31;
  --ink: #ECEEF0; --muted: #98A2AC;
  --accent: #FFC400; --accent-ink: #0C0E10;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark light;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F7F5EF; --surface: #FFFFFF; --line: #E2DDD1;
    --ink: #14171A; --muted: #555C64;
    --accent-ink: #14171A;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 16px; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
h3 { font-size: 1.15rem; }
p, ul, dl { margin: 0 0 16px; max-width: 68ch; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--muted); transition: 140ms color, 140ms text-decoration-color, 140ms border-color, 140ms transform; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--accent); color: var(--accent-ink); padding: 8px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }

/* ---------- Header and footer ---------- */
.bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.site-header { border-bottom: 1px solid var(--line); }
.site-header .bar { padding-top: 16px; padding-bottom: 16px; }
.wordmark { font: 700 15px/1 var(--mono); letter-spacing: .18em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.wordmark::before { content: ""; width: 10px; height: 10px; background: var(--accent); }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-header nav a { text-decoration: none; font-size: 15px; color: var(--muted); }
.site-header nav a:hover { color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; color: var(--muted); font: 400 13px/1.5 var(--mono); }
.site-footer .bar { padding-top: 24px; padding-bottom: 32px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }

/* ---------- Labels, buttons ---------- */
.label { font: 400 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 24px; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; border-radius: 8px; text-decoration: none; border: 1px solid var(--line); font-weight: 600; font-size: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { transform: translateY(-1px); }
.btn:focus-visible { outline-color: var(--ink); }
.glyph { flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; margin-top: 32px; }
.plain { font-size: 16px; }
.play { margin: 32px 0 0; }
.play .note { color: var(--muted); font-size: 14px; margin: 16px 0 0; }

/* ---------- Blocks ---------- */
.block { padding: 56px 0; border-top: 1px solid var(--line); }
.block.first { border-top: 0; padding-top: 56px; }
.hero { padding: 96px 0 80px; }
.hero h1 { max-width: 18em; margin-bottom: 24px; }
.lead { color: var(--muted); max-width: 60ch; font-size: 1.1rem; }
.prose p { color: var(--ink); }
.list { padding-left: 1.2em; }
.list li { margin-bottom: 8px; }
.list li::marker { color: var(--muted); }
.sub { margin-bottom: 16px; }
.cols { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .cols { grid-template-columns: 3fr 2fr; gap: 64px; } }
.facts { margin: 0; border-top: 1px solid var(--line); align-self: start; }
.facts div { display: flex; gap: 16px; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 400 13px/1.65 var(--mono); color: var(--muted); }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.big { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: 16px; overflow-wrap: anywhere; }

/* ---------- App cards ---------- */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; grid-template-columns: 1fr; max-width: none; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: 140ms border-color, 140ms transform; }
.card:hover { border-color: var(--muted); transform: translateY(-2px); }
.card-link { display: flex; gap: 20px; align-items: flex-start; padding: 28px; height: 100%; color: var(--ink); text-decoration: none; border-radius: 12px; }
.icon, .icon-lg { border-radius: 14px; flex: none; background: var(--line); }
.icon { width: 64px; height: 64px; }
.icon-lg { width: 88px; height: 88px; }
.card-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.card-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.card-cat { font: 400 12px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.card-line { color: var(--muted); font-size: 16px; line-height: 1.5; margin-top: 8px; }
.arrow { color: var(--muted); font-size: 1.25rem; line-height: 1; transition: 140ms color, 140ms transform; }
.card:hover .arrow { color: var(--ink); transform: translateX(2px); }

/* ---------- Narrow screens ---------- */
@media (max-width: 480px) {
  .wrap { padding: 0 20px; }
  .site-header .bar { flex-wrap: nowrap; gap: 12px; }
  .wordmark { font-size: 13px; letter-spacing: .08em; gap: 8px; white-space: nowrap; }
  .site-header nav { flex-wrap: nowrap; gap: 8px 16px; }
  .site-header nav a { font-size: 14px; }
  .hero { padding: 64px 0 56px; }
  .card-link { padding: 24px 20px; gap: 16px; }
}

/* ---------- App page ---------- */
.back { margin: 32px 0 0; font: 400 14px/1.5 var(--mono); }
.back a { color: var(--muted); }
.app-head { display: flex; gap: 24px; align-items: center; padding: 32px 0 24px; }
.app-head h1 { margin-bottom: 8px; }
.cat { font: 400 13px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 0; }
.shotstrip { margin: 40px 0 0; }
.shots { list-style: none; padding: 0 0 8px; margin: 0; display: flex; gap: 16px; overflow-x: auto; max-width: none; }
.shots li { flex: none; }
.shots img { height: 420px; width: auto; border-radius: 12px; border: 1px solid var(--line); display: block; }
figcaption { color: var(--muted); font-size: 14px; margin-top: 16px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); padding-top: 32px; max-width: none; }
.pager a { text-decoration: none; font-weight: 600; }
.pager .label { display: block; margin-bottom: 8px; }
.pager .next { text-align: right; }

/* ---------- Privacy policy ---------- */
.policy-layout { display: grid; gap: 8px 64px; grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
.policy { min-width: 0; padding: 24px 0 0; }
.policy h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.policy h2 { font-size: 1.35rem; margin: 0 0 16px; }
.policy h3 { margin-bottom: 12px; }
.policy .num { font-family: var(--mono); color: var(--muted); font-weight: 400; margin-right: .35em; }
.policy .ps { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.policy p, .policy ul, .policy ol { max-width: 70ch; }
.policy li { margin-bottom: 8px; }
.policy li::marker { color: var(--muted); }
.policy code { font: 400 .88em var(--mono); overflow-wrap: anywhere; }
.policy-meta { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15px; max-width: none; }
.policy-meta div { display: flex; gap: 16px; flex-wrap: wrap; }
.policy-meta dt { font-family: var(--mono); color: var(--muted); min-width: 8em; }
.policy-meta dd { margin: 0; overflow-wrap: anywhere; }
.policy .summary { font-size: 1.1em; margin-top: 24px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; }
.toc { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 20px 24px; margin: 24px 0 0; }
.toc .label { margin-bottom: 12px; }
.toc ol { list-style: none; padding: 0; margin: 0; max-width: none; font-size: 15px; line-height: 1.4; }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0; text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--ink); }
.toc .num { font-family: var(--mono); margin-right: .4em; }
@media (min-width: 960px) {
  .policy-layout { grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
  .policy-side { order: -1; position: sticky; top: 24px; }
  .toc { border: 0; background: none; padding: 0; margin-top: 32px; border-left: 1px solid var(--line); padding-left: 20px; }
}
.sdk { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 20px 24px 4px; margin: 0 0 20px; max-width: 70ch; }
.sdk dl { margin: 0; max-width: none; }
.sdk dl div { padding: 12px 0; border-top: 1px solid var(--line); }
.sdk dt { font: 400 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.sdk dd { margin: 0; }
.perms { width: 100%; max-width: 70ch; border-collapse: collapse; font-size: 15px; margin: 0 0 16px; }
.perms caption { text-align: left; color: var(--muted); font: 400 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; padding-bottom: 8px; }
.perms th, .perms td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-top: 1px solid var(--line); }
.perms thead th { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.perms tbody th { font-weight: 400; width: 42%; }
.perms tr:last-child th, .perms tr:last-child td { border-bottom: 1px solid var(--line); }
@media (max-width: 560px) { .perms thead { display: none; } .perms tr, .perms th, .perms td { display: block; width: auto !important; } .perms tbody th { padding-bottom: 2px; border-top: 1px solid var(--line); } .perms td { border-top: 0; padding-top: 0; } }
.policies { list-style: none; padding: 0; }
.policies li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding: 14px 0; border-bottom: 1px solid var(--line); max-width: 70ch; }
.policies .when { color: var(--muted); font: 400 13px/1.65 var(--mono); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
  .card:hover, .card:hover .arrow, .btn.primary:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --line: #bbb; --ink: #000; --muted: #333; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
  .skip, .site-header, .site-footer, .back, .policy-side { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .policy-layout { display: block; }
  .policy .ps { break-inside: auto; }
  .policy h2, .policy h3 { break-after: avoid; }
  .sdk, .perms tr { break-inside: avoid; }
  .policy .summary { border-left-color: #000; }
  a { color: #000; text-decoration: underline; }
  .policy a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; overflow-wrap: anywhere; }
}
