/* Help center: the app's Ink design system (ios/Design tokens: colors, radii, Inter Tight + Inter, the surface shadow).
   The app is light only; the dark theme here keeps the same roles on a dark ground. */

@font-face {
  font-family: "Inter Tight";
  src: url("fonts/InterTight.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f2f2ee;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #4b4b4b;
  --faint: #9a9a94;
  --line: #e6e6e0;
  --divider: #eeeee9;
  --soft: #e4e4df;
  --blue: #2d5bff;
  --blue-soft: #dce6ff;
  --axi: #7c4dff;
  --axi-soft: #eee8ff;
  --yellow: #ffd23f;
  --green: #22c55e;
  --tile: #eee8ff;
  --tile-ink: #111111;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 8px 20px rgba(17, 17, 17, 0.06);
  --r-card: 22px;
  --r-tile: 16px;
  --display: "Inter Tight", "Inter", -apple-system, system-ui, sans-serif;
  --ui: "Inter", -apple-system, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121214;
    --paper: #1c1c1f;
    --ink: #f2f2ee;
    --muted: #b8b8b2;
    --faint: #7c7c77;
    --line: #2f2f34;
    --divider: #27272b;
    --soft: #2a2a2e;
    --blue: #7d99ff;
    --blue-soft: #1d2747;
    --axi: #a88bff;
    --axi-soft: #2a2142;
    --tile: #e9e2ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121214;
  --paper: #1c1c1f;
  --ink: #f2f2ee;
  --muted: #b8b8b2;
  --faint: #7c7c77;
  --line: #2f2f34;
  --divider: #27272b;
  --soft: #2a2a2e;
  --blue: #7d99ff;
  --blue-soft: #1d2747;
  --axi: #a88bff;
  --axi-soft: #2a2142;
  --tile: #e9e2ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 700 20px/1 var(--display); letter-spacing: -0.02em; flex: none; }
.brand:hover, .brand-sub:hover { text-decoration: none; }
.brand img { flex: none; }
.brand-sub { color: var(--muted); font: 500 20px/1 var(--display); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub:hover { color: var(--ink); }
.top-end { display: flex; align-items: center; gap: 8px; flex: none; }
.langs { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--soft); }
.langs a { padding: 6px 10px; border-radius: 9px; color: var(--muted); font: 700 14px/1 var(--display); }
.langs a[aria-current] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.langs a:hover { text-decoration: none; color: var(--ink); }
.theme {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.theme-ico {
  width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("img/icon-moon.svg") center / contain no-repeat; mask: url("img/icon-moon.svg") center / contain no-repeat;
}

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text axi" "search axi";
  column-gap: 24px; align-items: end; padding: 40px 0 28px;
}
.hero-text { grid-area: text; min-width: 0; }
.hero .search { grid-area: search; }
.hero-axi { grid-area: axi; position: relative; display: block; width: 180px; aspect-ratio: 180 / 218; align-self: center; }
.hero-axi img, .hero-axi canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Owner 20.11: with motion allowed the page waits (hidden, .axi-wait from the <head> script) until Rive's first frame
   and opens with Axi moving (.axi-live); on a blocker it opens with the static Axi (.axi-static). Without JS or with
   reduced motion the static Axi is there from the start. Nothing fades or swaps in front of the eyes. */
.hero-axi canvas { opacity: 0; }
.axi-js .hero-axi img { opacity: 0; }
.axi-live .hero-axi canvas { opacity: 1; }
.axi-js.axi-static .hero-axi img { opacity: 1; }
h1 { font: 700 44px/1.08 var(--display); letter-spacing: -0.03em; margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.5; margin: 0 0 22px; max-width: 620px; }

/* Search */
.search { position: relative; max-width: 620px; }
.search input {
  width: 100%; height: 56px; padding: 0 18px 0 50px;
  border: 1px solid var(--line); border-radius: var(--r-tile); background: var(--paper); color: var(--ink);
  font: 500 17px/1 var(--ui); box-shadow: var(--shadow); -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--blue); }
.search-ico {
  position: absolute; left: 18px; top: 18px; width: 20px; height: 20px; background: var(--faint); pointer-events: none;
  -webkit-mask: url("img/icon-search.svg") center / contain no-repeat; mask: url("img/icon-search.svg") center / contain no-repeat;
}
.results {
  position: absolute; left: 0; right: 0; top: 62px; z-index: 5; max-height: 60vh; overflow: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-tile); box-shadow: var(--shadow); padding: 6px;
}
.results a { display: block; padding: 10px 12px; border-radius: 12px; color: var(--ink); }
.results a:hover, .results a[aria-selected="true"] { background: var(--soft); text-decoration: none; }
.results .r-sec { display: block; color: var(--faint); font-size: 13px; line-height: 18px; }
.results .r-title { display: block; font: 700 16px/1.3 var(--display); letter-spacing: -0.01em; }
.results .r-snip { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 2px; }
.results mark { background: var(--axi-soft); color: inherit; border-radius: 4px; padding: 0 1px; }
.results .r-empty { padding: 12px; color: var(--muted); }

/* Section grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-bottom: 48px; }
.sec {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.sec:hover { text-decoration: none; border-color: var(--axi); transform: translateY(-1px); }
.sec-text { display: flex; flex-direction: column; min-width: 0; }
.sec-title { font: 700 19px/1.25 var(--display); letter-spacing: -0.02em; }
.sec-intro { color: var(--muted); font-size: 15px; line-height: 1.4; margin-top: 4px; }
.sec-count { color: var(--faint); font-size: 13px; margin-top: 8px; }

.ico {
  flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--tile); color: var(--tile-ink);
  display: grid; place-items: center;
}
.ico img { width: 30px; height: 30px; }
.ico-mask::before {
  content: ""; width: 24px; height: 24px; background: var(--tile-ink);
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
.ico-battery svg { width: 32px; height: 32px; }
.ico-big { width: 64px; height: 64px; border-radius: 18px; }
.ico-big img { width: 40px; height: 40px; }
.ico-big.ico-mask::before { width: 32px; height: 32px; }
.ico-big.ico-battery svg { width: 42px; height: 42px; }

/* Section page */
.crumbs { padding: 24px 0 16px; font: 700 15px/1 var(--display); }
.crumbs a { color: var(--muted); }
.sec-head { display: flex; gap: 18px; align-items: center; padding: 28px 0 8px; }
.sec-head h1 { margin: 0 0 6px; font-size: 38px; }
.sec-head .lead { margin: 0; }
.cols { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 20px 0 8px; align-items: start; }
.toc { position: sticky; top: 84px; }
.toc-title { margin: 0 0 8px; color: var(--faint); font: 700 13px/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 7px 10px; border-radius: 10px; color: var(--muted); font-size: 15px; line-height: 1.35; }
.toc a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.arts { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.art {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow);
  padding: 22px 24px;
}
.art:target { border-color: var(--axi); box-shadow: 0 0 0 3px var(--axi-soft), var(--shadow); }
.art h2 { font: 700 22px/1.25 var(--display); letter-spacing: -0.02em; margin: 0 0 10px; }
.art h2 .anchor { color: var(--ink); }
.art p { margin: 0 0 12px; }
.art p:last-child, .art ul:last-child, .art ol:last-child { margin-bottom: 0; }
.art ul, .art ol { margin: 0 0 12px; padding-left: 22px; }
.art li { margin: 4px 0; }
.art li::marker { color: var(--axi); }
.art strong { font-weight: 700; }

.pager { display: flex; justify-content: space-between; gap: 12px; padding: 24px 0 48px; }
.pager a {
  padding: 14px 18px; border-radius: var(--r-tile); background: var(--paper); border: 1px solid var(--line);
  color: var(--ink); font: 700 16px/1.2 var(--display); box-shadow: var(--shadow);
}
.pager a:hover { text-decoration: none; border-color: var(--axi); }
.pager span { color: var(--axi); }

/* Site pages: Terms and Privacy as one long document, the home page's two-column tiles, 404 */
.doc {
  max-width: 780px; margin: 28px auto 48px; padding: 36px 44px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow);
}
.doc h1 { font-size: 40px; margin: 0 0 8px; }
.doc .meta { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.doc h2 { font: 700 22px/1.3 var(--display); letter-spacing: -0.02em; margin: 34px 0 10px; }
.doc p { margin: 0 0 14px; line-height: 1.65; }
.doc ul { margin: 0 0 14px; padding-left: 22px; }
.doc li { margin: 6px 0; line-height: 1.6; }
.doc li::marker { color: var(--axi); }
.doc h3 { font: 700 18px/1.3 var(--display); letter-spacing: -0.01em; margin: 22px 0 8px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-2 .sec { align-items: center; }
.hero-home { grid-template-areas: "text axi"; align-items: center; }
.hero-404 { grid-template-areas: "text axi"; padding-bottom: 64px; }
.hero-404-axi { grid-area: axi; width: 180px; height: auto; align-self: center; }

.support-line { margin: 4px 0 56px; color: var(--muted); font-size: 15px; user-select: text; -webkit-user-select: text; }
.support-line a { color: var(--blue); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 15px; }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot p { margin: 0; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .toc { position: static; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
}
@media (max-width: 600px) {
  .doc { margin: 16px auto 32px; padding: 22px 18px; border-radius: 18px; }
  .doc h1 { font-size: 30px; }
  .doc h2 { font-size: 20px; margin-top: 28px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero-404, .hero-home { grid-template-areas: "text axi"; }
  .hero-404-axi { width: 88px; align-self: start; }
  body { font-size: 16px; }
  .top-row { height: 56px; }
  .brand { font-size: 18px; }
  .brand img { width: 30px; height: 30px; }
  .brand-sub { display: none; }
  .langs a { padding: 6px 8px; }
  .hero { padding: 24px 0 20px; column-gap: 12px; grid-template-areas: "text axi" "search search"; align-items: start; }
  .hero-axi { width: 88px; align-self: start; margin-top: 4px; }
  h1 { font-size: 32px; }
  .lead { font-size: 16px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .sec { padding: 16px; border-radius: 18px; }
  .sec-head { padding-top: 20px; gap: 14px; align-items: flex-start; }
  .sec-head h1 { font-size: 28px; }
  .ico-big { width: 52px; height: 52px; border-radius: 15px; }
  .ico-big img { width: 32px; height: 32px; }
  .art { padding: 18px; border-radius: 18px; }
  .art h2 { font-size: 20px; }
  .pager { flex-direction: column; }
  .pager .next { text-align: right; }
}
@media (prefers-reduced-motion: reduce) { .sec { transition: none; } }
