/* Helio design system v2: components. Reads only tokens from tokens.css.
   Order: base, layout, type, controls, surfaces, chrome, feedback, content, charts, motion. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--t-body)/1.65 var(--font-ui);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
p { margin: 0; text-wrap: pretty; }
.nw { white-space: nowrap; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--accent-bg); color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-weight: 500; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: calc(var(--section) / 2); position: relative; }
.section--tight { padding-block: calc(var(--section) * .34); }
.section--flush-top { padding-top: 0; }
.wrap--narrow > * { max-width: 960px; } /* same left edge as every other section, narrower measure */
.stack-s { display: grid; gap: var(--s-3); align-content: start; }
.table-wrap { overflow-x: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[data-icon] { display: inline-flex; }
.band { background: var(--bg-sunken); border-block: var(--hair) solid var(--line-soft); }
.rule-top { border-top: var(--hair) solid var(--line); }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.split { display: grid; gap: var(--s-7); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .split { grid-template-columns: 5fr 7fr; gap: var(--s-8); } .split--even { grid-template-columns: 1fr 1fr; } .split--rev { grid-template-columns: 7fr 5fr; } }
.measure { max-width: calc(60 * var(--ch-ui)); }
.lead.measure { max-width: calc(60 * var(--ch-ui-300)); }
.measure-s { max-width: calc(44 * var(--ch-ui)); }
.center { text-align: center; margin-inline: auto; }

/* ---------- type ---------- */
.display, .h1, .h2 { font-family: var(--font-voice); font-style: italic; font-weight: 400; color: var(--text); }
.display { font-size: var(--t-display); line-height: 1.04; letter-spacing: -0.015em; }
.h1 { font-size: var(--t-h1); line-height: 1.06; letter-spacing: -0.01em; }
.h2 { font-size: var(--t-h2); line-height: 1.1; letter-spacing: -0.01em; }
.h3 { font: 500 var(--t-h3)/1.4 var(--font-ui); color: var(--text); }
.lead { font-size: var(--t-lead); line-height: 1.5; font-weight: 300; color: var(--text-2); }
.body-2 { color: var(--text-2); }
.small { font-size: var(--t-small); line-height: 1.55; }
.muted { color: var(--text-3); }
.eyebrow { font: 500 var(--t-eyebrow)/1.3 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.eyebrow--accent { color: var(--accent-ink); }
.voice { font-family: var(--font-voice); font-style: italic; }
.fig { font-family: var(--font-ui); font-style: normal; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.02em; }
.fig-xl { font: 300 var(--t-figure-xl)/1 var(--font-ui); letter-spacing: -0.02em; }
.fig-l { font: 300 var(--t-figure-l)/1.1 var(--font-ui); letter-spacing: -0.015em; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .acc { color: var(--accent-ink); }
.section-head { display: grid; gap: var(--s-4); margin-bottom: clamp(40px, 3vw + 24px, 72px); max-width: 760px; }
.section-head .eyebrow { margin-bottom: var(--s-1); }

/* ---------- buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 22px; border-radius: var(--r-pill);
  border: var(--hair) solid var(--edge-control); background: transparent; color: var(--text);
  font: 500 15px/1 var(--font-ui); letter-spacing: .005em; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background var(--d-fast) var(--ease-in), border-color var(--d-fast), color var(--d-fast), transform var(--d-fast), box-shadow var(--d-mid);
}
.btn:hover { border-color: var(--text-3); background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 0 var(--glow); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); box-shadow: 0 8px 28px -8px var(--glow), 0 0 0 6px var(--glow); }
.btn--ghost { border-color: transparent; padding-inline: 14px; }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn--sm { --h: 36px; padding: 0 16px; font-size: 14px; }
.btn--lg { --h: 52px; padding: 0 28px; font-size: 16px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; flex: none; }
.btn .arr { transition: transform var(--d-mid) var(--ease-in); }
.btn:hover .arr { transform: translateX(3px); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-ink); font-weight: 500; text-decoration: none; }
.link-arrow:hover { color: var(--text); }
.link-arrow .arr { transition: transform var(--d-mid) var(--ease-in); }
.link-arrow:hover .arr { transform: translateX(3px); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r-pill); border: var(--hair) solid transparent; background: transparent; color: var(--text-2); cursor: pointer; transition: background var(--d-fast), color var(--d-fast), border-color var(--d-fast); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
@media (pointer: coarse) { .btn { --h: 48px; } .btn--sm { --h: 44px; } .icon-btn { width: 44px; height: 44px; } }

/* ---------- fields ---------- */
.field { display: grid; gap: 8px; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: .01em; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 0 16px; border-radius: var(--r-s);
  border: var(--hair) solid var(--edge-control); background: var(--bg); color: var(--text);
  font-size: 16px; outline: none; transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast);
}
.textarea { padding: 12px 16px; min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--glow); }
.input[aria-invalid="true"] { border-color: var(--neg); }
.field .hint { font-size: 13px; color: var(--text-3); }
.field .err { font-size: 13px; color: var(--neg); }
.select { -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23a08b78' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; color: var(--text); min-height: 32px; }
.check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; border-radius: var(--r-xs); border: var(--hair) solid var(--edge-control); background: var(--bg); display: grid; place-items: center; cursor: pointer; transition: background var(--d-fast), border-color var(--d-fast); flex: none; }
.check input::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform var(--d-fast) var(--ease-in); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }

/* segmented control: tabs, person switch, period switch */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--surface); border: var(--hair) solid var(--line); }
.seg button { min-height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: background var(--d-mid) var(--ease-in), color var(--d-fast); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 oklch(1 0 0 / .05) inset, 0 1px 3px oklch(0 0 0 / .18); }
.seg--accent button[aria-pressed="true"], .seg--accent button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
@media (pointer: coarse) { .seg button { min-height: 40px; } }

/* ---------- chips and tags ---------- */
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: var(--hair) solid var(--line-strong); background: transparent; color: var(--text); font-size: 14px; cursor: pointer; transition: background var(--d-fast), border-color var(--d-fast), color var(--d-fast); white-space: nowrap; }
.chip:hover { border-color: var(--text-3); background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent-line); color: var(--text); }
.chip .x { opacity: .7; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
.tag--accent { background: var(--accent-bg); color: var(--accent-ink); }
.tag--neg { background: var(--neg-bg); color: var(--neg); }
.tag--pos { background: var(--pos-bg); color: var(--pos); }
.tag--line { background: transparent; border: var(--hair) solid var(--line-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; display: inline-block; }
.dot--pulse { background: var(--accent); box-shadow: 0 0 0 0 var(--glow); animation: pulse 2.4s var(--ease-in) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 oklch(0.84 0.125 78 / .45); } 70%, 100% { box-shadow: 0 0 0 8px oklch(0.84 0.125 78 / 0); } }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: var(--hair) solid var(--line); border-radius: var(--r-m); padding: clamp(20px, 1.5vw + 14px, 32px); }
.card--flat { background: transparent; }
.card--raised { background: var(--surface-2); }
.card--accent { border-color: var(--accent-line); }
.frame {
  position: relative; background: var(--bg); border-radius: var(--r-l); box-shadow: var(--shadow-frame);
  overflow: hidden; isolation: isolate;
}
.frame__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 14px clamp(16px, 2vw, 28px); border-bottom: var(--hair) solid var(--line-soft); background: color-mix(in oklab, var(--surface) 55%, var(--bg)); flex-wrap: wrap; }
.frame__body { padding: clamp(20px, 3vw, 44px); }
.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }
.glow-under { position: relative; }
.glow-under::before { content: ""; position: absolute; inset: 8% 6% -6%; z-index: -1; background: radial-gradient(60% 60% at 50% 40%, var(--glow), transparent 70%); filter: blur(30px); pointer-events: none; }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 500 11px/1.3 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 0 12px 12px; border-bottom: var(--hair) solid var(--line); white-space: nowrap; }
.table td { padding: 14px 12px; border-bottom: var(--hair) solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr { transition: background var(--d-fast); }
.table--hover tbody tr:hover { background: var(--surface); }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
@media (max-width: 640px) {
  .table--stack thead { display: none; }
  .table--stack tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 0; border-bottom: var(--hair) solid var(--line-soft); }
  .table--stack td { padding: 0; border: 0; }
  .table--stack td[data-l]::before { content: attr(data-l) " "; color: var(--text-3); }
}

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; transition: background var(--d-mid), border-color var(--d-mid), backdrop-filter var(--d-mid); border-bottom: var(--hair) solid transparent; }
.site-header.is-scrolled { background: color-mix(in oklab, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px); border-bottom-color: var(--line-soft); }
.site-header.is-now { transition: none; } /* landed on a #section: scrolled from the first frame */
.site-header__in { display: flex; align-items: center; gap: var(--s-5); height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.brand:hover { color: var(--text); }
.brand__mark { width: 26px; height: 26px; color: var(--accent); }
.brand__name { font: italic 500 23px/1 var(--font-voice); letter-spacing: -0.01em; }
.nav { display: none; gap: 2px; margin-left: var(--s-4); }
.nav a { padding: 8px 14px; border-radius: var(--r-pill); color: var(--text-2); text-decoration: none; font-size: 15px; transition: color var(--d-fast), background var(--d-fast); }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hdr-right .theme-btn { display: none; }
.menu-btn { display: inline-grid; }
@media (min-width: 1000px) {
  .nav { display: flex; }
  .hdr-right .theme-btn { display: inline-flex; }
  .menu-btn { display: none; }
}
/* 1000 to 1179 px: the ru/uk nav wrapped to two lines ("Как это / работает"); one line, a little tighter */
.nav a { white-space: nowrap; }
@media (min-width: 1000px) and (max-width: 1179px) { .nav { margin-left: 0; } .nav a { padding: 8px 9px; font-size: 14px; } }
@media (max-width: 420px) { .hdr-right .btn--primary { padding: 0 14px; } }
@media (max-width: 359px) { .hdr-right .btn--primary { display: none; } }

/* mobile sheet */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); padding: 0 var(--gutter) var(--s-6); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity var(--d-mid) var(--ease-in), transform var(--d-mid) var(--ease-in), visibility 0s var(--d-mid); }
.sheet.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 200ms var(--ease-in), transform 200ms var(--ease-in); } /* open in 200 ms, capped by the harness at 300 */
.sheet__top { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.sheet__nav { display: grid; align-content: start; gap: 2px; padding-top: var(--s-5); }
.sheet__nav a { font: italic 400 32px/1.25 var(--font-voice); color: var(--text); text-decoration: none; padding: 8px 0; border-bottom: var(--hair) solid var(--line-soft); }
.sheet__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }

/* language switch */
.lang { display: inline-flex; padding: 3px; border-radius: var(--r-pill); border: var(--hair) solid var(--line); gap: 2px; }
.lang button { min-width: 44px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-3); font: 600 11px/1 var(--font-ui); letter-spacing: .1em; cursor: pointer; transition: color var(--d-fast), background var(--d-fast); }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
@media (pointer: coarse) { .lang button { height: 38px; } }
.theme-btn .sun, [data-theme="light"] .theme-btn .moon { display: none; }

/* language menu: quiet, in the footer's base line; the list opens upwards */
.langmenu { position: relative; margin-left: auto; }
.langmenu__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 6px; margin-right: -6px; border: 0; background: none; color: var(--text-3); font: 500 13px/1 var(--font-ui); cursor: pointer; transition: color var(--d-fast); }
.langmenu__btn:hover, .langmenu__btn[aria-expanded="true"] { color: var(--text); }
.langmenu__btn .chev { transition: transform var(--d-fast); }
.langmenu__btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.site-footer .langmenu__list, .langmenu__list { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 184px; padding: 4px; gap: 2px; list-style: none; background: var(--surface); border: var(--hair) solid var(--line); border-radius: var(--r-s); box-shadow: var(--shadow-float); }
.langmenu__list[hidden] { display: none; }
.langmenu__list a { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-xs); background: none; color: var(--text-2); font: 500 14px/1 var(--font-ui); text-align: left; cursor: pointer; text-decoration: none; }
.langmenu__list a:hover, .langmenu__list a:focus-visible { background: var(--surface-2); color: var(--text); }
.langmenu__list a svg { visibility: hidden; color: var(--text); }
.langmenu__list a[aria-checked="true"] { color: var(--text); }
.langmenu__list a[aria-checked="true"] svg { visibility: visible; }
.langmenu__plain { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; font: 500 13px/1 var(--font-ui); } /* no JS: the languages as plain links */
.langmenu__plain a, .langmenu__plain span { display: inline-flex; align-items: center; min-height: 32px; }
.langmenu__plain a { color: var(--text-3); }
.langmenu__plain a:hover, .langmenu__plain span { color: var(--text); }
[data-theme="light"] .theme-btn .sun { display: block; }

/* ---------- footer ---------- */
.site-footer { border-top: var(--hair) solid var(--line-soft); padding-block: var(--s-9) var(--s-7); color: var(--text-2); font-size: 14px; }
.site-footer__grid { display: grid; gap: var(--s-7); grid-template-columns: 1fr 1fr; }
.site-footer__brand { grid-column: 1 / -1; display: grid; gap: var(--s-4); max-width: calc(36 * var(--ch-ui)); }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .site-footer__brand { grid-column: auto; } }
.site-footer h3 { font: 500 11px/1.3 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--s-4); }
.site-footer ul { list-style: none; display: grid; gap: 10px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer__base { margin-top: var(--s-8); padding-top: var(--s-5); border-top: var(--hair) solid var(--line-soft); display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; align-items: center; color: var(--text-3); font-size: 13px; }

/* ---------- iOS app banner (iPhone only, built by site.js): in the flow above the header, so it pushes the page down ---------- */
.app-banner { display: flex; align-items: center; gap: var(--s-3); padding: 6px var(--gutter) 6px calc(var(--gutter) - 8px); padding-top: calc(6px + env(safe-area-inset-top)); background: var(--surface-2); border-bottom: var(--hair) solid var(--line-soft); color: var(--text); }
.app-banner__ico { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.app-banner__txt { flex: 1; min-width: 0; text-wrap: balance; display: grid; font-size: 13px; line-height: 1.3; color: var(--text-2); }
.app-banner__txt strong { color: var(--text); font-weight: 600; font-size: 14px; }
.app-banner__get { flex: none; white-space: nowrap; }
.app-banner__x { flex: none; margin-right: -10px; }
.site-footer__app { color: var(--text-2); text-decoration: none; }
.site-footer__app:hover { color: var(--text); }

/* touch targets: 44px on phones, whatever the pointer reports */
@media (max-width: 480px), (pointer: coarse) {
  .btn--sm { --h: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .seg button, .chip { min-height: 44px; }
  .lang button { height: 44px; }
  .langmenu__btn, .langmenu__list a, .langmenu__plain a { min-height: 44px; }
  .check { min-height: 44px; }
  .qpill, .link-arrow, .brand { min-height: 44px; }
  .site-footer ul { gap: 0; }
  .site-footer li a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
}

/* ---------- feedback ---------- */
.toast-region { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-m); background: var(--surface-3); color: var(--text); border: var(--hair) solid var(--line-strong); box-shadow: var(--shadow-float); font-size: 14px; animation: toast-in var(--d-mid) var(--ease-in); }
.toast .dot { margin-top: 7px; color: var(--accent); }
.toast--neg .dot { color: var(--neg); }
.toast--pos .dot { color: var(--pos); }
.toast strong { font-weight: 500; }
.toast.is-out { animation: toast-out var(--d-mid) var(--ease-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
.empty { display: grid; justify-items: start; gap: 12px; padding: clamp(28px, 3vw, 44px); border: var(--hair) dashed var(--line-strong); border-radius: var(--r-m); }
.empty__title { font: italic 400 22px/1.3 var(--font-voice); color: var(--text); }
.empty p { color: var(--text-2); font-size: 15px; max-width: calc(46 * var(--ch-ui)); }
.empty p.empty__title { max-width: calc(46 * var(--ch-voice)); }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-s); background: var(--accent-bg); color: var(--text); font-size: 14px; }
.note .dot { margin-top: 7px; color: var(--accent); }
.note--err { background: var(--neg-bg); }
.note--err .dot { color: var(--neg); }
.note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* dialog */
.modal { border: 0; padding: 0; background: transparent; color: var(--text); width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.modal::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in var(--d-mid) var(--ease-in); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal__box { background: var(--surface); border: var(--hair) solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-float); padding: clamp(24px, 3vw, 36px); display: grid; gap: var(--s-5); }
.modal__head { display: flex; justify-content: space-between; align-items: start; gap: var(--s-4); }
.modal__head .icon-btn { flex: none; }
.modal__title { font: italic 400 30px/1.15 var(--font-voice); }

/* ---------- content components ---------- */
/* pricing card */
.plan { display: grid; gap: var(--s-5); align-content: start; padding: clamp(24px, 2vw + 16px, 40px); border-radius: var(--r-l); background: var(--surface); border: var(--hair) solid var(--line); position: relative; }
.plan__name { font: italic 400 30px/1.1 var(--font-voice); }
.plan__price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.plan__amount { font: 300 clamp(44px, 2vw + 34px, 60px)/1 var(--font-ui); letter-spacing: -0.03em; }
.plan__per { color: var(--text-2); font-size: 15px; }
.plan__list { list-style: none; display: grid; gap: 12px; font-size: 15px; color: var(--text-2); }
.plan__list li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; }
.plan__list svg { width: 18px; height: 18px; margin-top: 3px; color: var(--accent-ink); }
.plan__list strong { color: var(--text); font-weight: 500; }
.plan__foot { font-size: 13px; color: var(--text-3); }
.plan--accent { border-color: var(--accent-line); background: color-mix(in oklab, var(--surface) 88%, var(--accent)); }

/* FAQ accordion */
.faq { border-top: var(--hair) solid var(--line); }
.faq details { border-bottom: var(--hair) solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s-5); padding: 22px 0; font-size: 18px; font-weight: 500; color: var(--text); transition: color var(--d-fast); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent-ink); }
.faq summary .pm { width: 28px; height: 28px; flex: none; border-radius: 50%; border: var(--hair) solid var(--line-strong); position: relative; transition: transform var(--d-mid) var(--ease-in), background var(--d-fast); }
.faq summary .pm::before, .faq summary .pm::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); }
.faq summary .pm::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform var(--d-mid) var(--ease-in); }
.faq details[open] summary .pm::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq .faq__a { padding: 0 0 26px; color: var(--text-2); max-width: calc(68 * var(--ch-ui)); font-size: 16px; }
.faq .faq__a p + p { margin-top: 12px; }

/* step list */
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-5); } }
.step { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-content: start; }
.step__n { font: 500 12px/1 var(--font-ui); letter-spacing: .14em; color: var(--accent-ink); display: flex; align-items: center; gap: 12px; }
.step__n::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, var(--line-strong), transparent); }

/* fact grid */
.facts { display: grid; gap: 1px; background: var(--line-soft); border: var(--hair) solid var(--line-soft); border-radius: var(--r-l); overflow: hidden; grid-template-columns: 1fr; }
@media (min-width: 700px) { .facts { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .facts--4 { grid-template-columns: repeat(4, 1fr); } }
.fact { background: var(--bg-sunken); padding: clamp(22px, 2vw + 12px, 36px); display: grid; gap: 12px; align-content: start; }
.band .fact { background: var(--bg); }
.fact__ico { width: 36px; height: 36px; border-radius: var(--r-s); display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-ink); }
.fact__ico svg { width: 18px; height: 18px; }
.fact h3 { font: 500 18px/1.35 var(--font-ui); }
.fact p { color: var(--text-2); font-size: 15px; }

/* invented-family bar */
.invented-bar { position: sticky; top: 0; z-index: 55; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 44px; padding: 6px var(--gutter); background: var(--accent-bg); color: var(--text); font-size: 14px; border-bottom: var(--hair) solid var(--accent-line); flex-wrap: wrap; text-align: center; }
.invented-bar a { color: var(--text); font-weight: 600; }

/* person avatar */
.ava { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font: italic 500 14px/1 var(--font-voice); background: var(--surface-3); color: var(--text); flex: none; }
.ava--c1 { background: color-mix(in oklab, var(--c1) 30%, var(--surface)); }
.ava--c12 { background: color-mix(in oklab, var(--c12) 30%, var(--surface)); }

/* ---------- charts (shared by home, demo, tool, design system) ---------- */
.chart { position: relative; width: 100%; }
.chart svg { overflow: visible; }
.chart text { font-family: var(--font-ui); fill: var(--text); font-variant-numeric: tabular-nums; }
.chart .lbl { font-size: 13px; }
.chart .lbl-2 { font-size: 12px; fill: var(--text-3); }
.chart .val { font-size: 13px; fill: var(--text); font-weight: 500; }
.chart .dl { font-size: 12px; }
.chart .dl.up { fill: var(--neg); } .chart .dl.down { fill: var(--pos); } .chart .dl.eq { fill: var(--text-3); }
.sankey .flow { transition: opacity var(--d-mid) var(--ease-in); }
.sankey .node { transition: opacity var(--d-mid) var(--ease-in); }
.sankey.is-hovering .flow:not(.is-hot), .sankey.is-hovering .tgt:not(.is-hot) { opacity: .28; }
.sankey .tgt { cursor: pointer; outline: none; }
.sankey .tgt:focus-visible .hit { stroke: var(--focus); stroke-width: 2; }
.sankey .hit { fill: transparent; }
.bars .bar-g { cursor: pointer; }
.bars .bar-g .sel { fill: transparent; stroke: transparent; }
.bars .bar-g.is-sel .sel { fill: var(--accent-bg); stroke: var(--accent-line); }
.bars .bar-g:hover .sel { fill: var(--surface-2); }
.bars .bar-g.is-sel:hover .sel { fill: var(--accent-bg); }
.bars .bar-g:focus-visible { outline: none; }
.bars .bar-g:focus-visible .sel { stroke: var(--focus); stroke-width: 2; }
.bars .axis { font-size: 11px; letter-spacing: .1em; fill: var(--text-3); }
.bars .net { font-size: 11px; }
.treemap { display: grid; }
.tm-cell { position: absolute; border-radius: var(--r-s); overflow: hidden; padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; color: var(--text); border: 0; text-align: left; transition: filter var(--d-fast), transform var(--d-fast), opacity var(--d-mid); font: inherit; }
.tm-cell:hover { filter: brightness(1.08); }
.tm-cell .n { font-size: 13px; font-weight: 500; line-height: 1.25; }
.tm-cell .v { font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }
.tm-cell .n { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tm-cell.is-tiny { padding: 0; border-radius: var(--r-xs); }
.tm-cell.is-narrow { padding: 8px; }
.tm-cell.is-narrow .n { font-size: 12px; flex-shrink: 0; }
.tm-cell.is-narrow .v { font-size: 11px; white-space: nowrap; }
.tm-cell.is-narrow .p { display: none; }
.tm-cell.is-tiny .n, .tm-cell.is-tiny .v { display: none; }
.treemap.is-list { display: block; }
.treemap.is-list .sflow__list { border-left: 0; padding-left: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); text-align: center; padding-bottom: 4px; }
.cal .day { aspect-ratio: 1; border-radius: var(--r-xs); background: var(--surface); display: grid; align-content: space-between; padding: 6px; font-size: 11px; color: var(--text-3); position: relative; }
.cal .day b { font-weight: 500; color: var(--text); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.cal .day.is-empty { background: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: var(--r-pill); display: inline-block; }

/* ---------- demo overlay (L-029): 3-step intro, then the cabinet demo in a full-screen frame ---------- */
html.demo-open { overflow: hidden; }
.demo-ov { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--text); }
.demo-ov[open] { display: flex; flex-direction: column; }
.demo-ov::backdrop { background: var(--bg); }
.demo-ov__intro { flex: 1; display: grid; grid-template-rows: 1fr auto; padding: max(24px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.demo-ov__intro[hidden], .demo-ov__app[hidden] { display: none; }
.demo-ov__steps { display: grid; place-items: center; }
.demo-ov__step { grid-area: 1 / 1; display: grid; justify-items: center; text-align: center; gap: 10px; max-width: calc(30 * var(--ch-ui)); opacity: 0; transform: translateY(10px); transition: opacity var(--d-mid) var(--ease-in), transform var(--d-mid) var(--ease-in); pointer-events: none; }
.demo-ov__step.is-on { opacity: 1; transform: none; }
.demo-ov__art { width: 240px; height: 132px; display: grid; place-items: center; margin-bottom: 14px; }
@media (min-width: 900px) { .demo-ov__art { width: 320px; height: 176px; } .demo-ov__files span, .demo-ov__q { font-size: 16px; } }
.demo-ov__n { font: 500 12px/1 var(--font-ui); letter-spacing: .14em; color: var(--accent-ink); }
.demo-ov__t { font: italic 400 clamp(28px, 2vw + 20px, 40px)/1.12 var(--font-voice); }
.demo-ov__p { color: var(--text-2); }
.demo-ov__nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(560px, 100%); margin-inline: auto; }
.demo-ov__dots { display: flex; gap: 6px; }
.demo-ov__dots i { width: 24px; height: 3px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; position: relative; }
.demo-ov__dots i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.demo-ov[data-step="1"] .demo-ov__dots i:nth-child(1)::after, .demo-ov[data-step="2"] .demo-ov__dots i:nth-child(2)::after, .demo-ov[data-step="3"] .demo-ov__dots i:nth-child(3)::after { animation: demo-fill 2s linear forwards; }
.demo-ov[data-step="2"] .demo-ov__dots i:nth-child(1)::after, .demo-ov[data-step="3"] .demo-ov__dots i:nth-child(-n+2)::after { transform: none; }
@keyframes demo-fill { to { transform: none; } }
.demo-ov__files { display: grid; gap: 8px; width: 100%; }
.demo-ov__files span { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px; border-radius: var(--r-s); background: var(--surface-2); border: var(--hair) solid var(--line); font-size: 14px; opacity: 0; }
.demo-ov__files svg { width: 16px; height: 16px; color: var(--accent-ink); flex: none; }
.is-on .demo-ov__files span { animation: demo-drop var(--d-slow) var(--ease-in) forwards; animation-delay: calc(var(--i) * 280ms); }
@keyframes demo-drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.demo-ov__q { width: 100%; display: grid; gap: 12px; justify-items: start; padding: 16px; border-radius: var(--r-m); background: var(--surface); border: var(--hair) solid var(--line); text-align: left; font-size: 15px; }
.demo-ov__guess { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: var(--hair) solid var(--accent-line); color: var(--text); }
.demo-ov__guess svg { width: 16px; height: 16px; opacity: 0; }
.is-on .demo-ov__guess { animation: demo-pick 1s var(--ease-in) .6s forwards; }
.is-on .demo-ov__guess svg { animation: demo-show 1ms linear 1.2s forwards; }
@keyframes demo-pick { 60% { transform: scale(1.06); } to { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: none; } }
@keyframes demo-show { to { opacity: 1; } }
.demo-ov__art > svg { width: 100%; height: 100%; overflow: visible; }
.demo-ov__river { opacity: .85; clip-path: inset(0 100% 0 0); }
.is-on .demo-ov__river { animation: demo-flow 1.2s var(--ease-in) .2s forwards; }
@keyframes demo-flow { to { clip-path: inset(0 0 0 0); } }
.demo-ov__app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.demo-ov__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 2px 8px 2px 16px; padding-top: max(2px, env(safe-area-inset-top)); background: var(--surface); border-bottom: var(--hair) solid var(--line); font-size: 14px; }
.demo-ov__bar p { color: var(--text-2); line-height: 1.35; }
.demo-ov__bar a { color: var(--accent-ink); font-weight: 500; white-space: nowrap; }
.demo-ov__stage { flex: 1; position: relative; min-height: 0; }
.demo-ov__stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); opacity: 0; }
.demo-ov.is-loaded .demo-ov__stage iframe { opacity: 1; }
.demo-ov__load { position: absolute; inset: 0; display: grid; place-items: center; }
@media (max-width: 599px) { .hdr-login { display: none; } }

/* ---------- motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity var(--d-slow) var(--ease-in), transform var(--d-slow) var(--ease-in); transition-delay: var(--delay, 0ms); }
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal].is-now { transition: none; } /* on screen at load: no fade-in */
.no-js [data-reveal] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  /* transitions are off, not 1ms: a transition of any length shows the old value for one frame, so a class set by a script
     (the hero list's top margin) reached the screen a frame late and the page changed height between its first two frames */
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* no flash of Ukrainian source text before a ru/en dictionary is applied; shows anyway after 1.5 s */
html:not(.i18n-ready):not([data-lang="uk"]) body { opacity: 0; animation: i18n-late 0s 1.5s forwards; }
@keyframes i18n-late { to { opacity: 1; } }

/* waitlist dialog */
.wl-banks { border: 0; padding: 0; margin-inline: 0; margin-bottom: 0; min-inline-size: 0; display: grid; gap: var(--s-3); }
.wl-banks .label { margin-bottom: var(--s-2); }
.wl-banks__row { gap: 6px 20px; }
.wl-submit { width: 100%; }
.wl-submit[aria-busy="true"] { opacity: .7; cursor: progress; }
#wl-mail { width: 100%; }

/* sankey as a vertical list-flow under 520px of chart width (REQUIREMENTS §8) */
.sflow { display: grid; gap: var(--s-2); }
.sflow[hidden] { display: none; }
.sflow__cap { margin: 0; font: 500 11px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.sflow__list { list-style: none; margin: 0; padding: 0 0 0 var(--s-3); border-left: 2px solid var(--line); display: grid; gap: 2px; }
.sflow__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px var(--s-3); width: 100%; min-height: 44px; padding: var(--s-2) var(--s-2) var(--s-2) 0; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--text); font: inherit; text-align: left; }
button.sflow__row { cursor: pointer; padding-left: var(--s-2); margin-left: calc(-1 * var(--s-2)); width: calc(100% + var(--s-2)); }
button.sflow__row:hover { background: var(--surface-2); }
.sflow__n { font-size: 14px; line-height: 1.3; color: var(--text-2); overflow-wrap: anywhere; }
.sflow__v { font: 500 14px/1.3 var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sflow__d { font-size: 12px; font-weight: 400; margin-left: 4px; }
.sflow__d.up { color: var(--neg); } .sflow__d.down { color: var(--pos); } .sflow__d.eq { color: var(--text-3); }
.sflow__bar { grid-column: 1 / -1; height: 6px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; }
.sflow__bar i { display: block; height: 100%; border-radius: var(--r-pill); }
.sflow__mid { margin: var(--s-1) 0; display: flex; align-items: center; gap: var(--s-3); font: 500 15px/1.2 var(--font-ui); font-variant-numeric: tabular-nums; }
.sflow__mid::before, .sflow__mid::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.flow-head:has(+ .sankey.is-list), .flow-cap:has(+ .sankey.is-list) { display: none; }
.sankey.is-list { margin-top: var(--s-5); }
.bars__legend { margin: var(--s-2) 0 0; display: flex; gap: var(--s-5); font-size: 12px; color: var(--text-2); }
.bars__legend span { display: inline-flex; align-items: center; gap: 6px; }
.bars__legend i { width: 10px; height: 10px; border-radius: var(--r-pill); }
