/* Рівно — стиль сайту rivno.app. Палітра і шрифти — з app/src/theme/tokens.ts і typography.ts.
   Без скриптів; лише Google Fonts (Unbounded — заголовки, Manrope — текст). */

:root {
  color-scheme: light dark;
  --bg: #F7F4EE;
  --surface: #FFFFFF;
  --surface-muted: #EFEBE3;
  --text: #1B1C1E;
  --text-2: #5E6168;
  --line: #E6E1D8;
  --accent: #1F7A6E;
  --accent-text: #1D7267;
  --on-accent: #FFFFFF;
  --mark-other: #1B1C1E;
  --mark-you: #1F7A6E;
  --mark-pupil-other: #FFFFFF;
  --mark-pupil-you: #FFFFFF;
  --role-kb: #B43C2A;
  --role-a: #1D7267;
  --role-fc: #6F4CD2;
  --radius: 16px;
  --gutter: 20px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --surface: #1C1F23;
    --surface-muted: #24282D;
    --text: #F2EFE9;
    --text-2: #A3A7AE;
    --line: #2C3036;
    --accent: #3FA796;
    --accent-text: #40AB99;
    --on-accent: #0E1A18;
    --mark-other: #E8E4DC;
    --mark-you: #3FA796;
    --mark-pupil-other: #121417;
    --mark-pupil-you: #FFFFFF;
    --role-kb: #E47965;
    --role-a: #40AB99;
    --role-fc: #A28CEB;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-wrap: break-word;
}

a { color: var(--accent-text); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font: 600 clamp(30px, 6vw, 44px)/1.15 Unbounded, system-ui, sans-serif; letter-spacing: -0.01em; }
h2 { font: 500 clamp(21px, 3.6vw, 26px)/1.25 Unbounded, system-ui, sans-serif; margin-top: 48px; }
h3 { font-weight: 700; font-size: 18px; margin-top: 28px; }
p, ul, ol { margin: 12px 0 0; }
ul, ol { padding-inline-start: 1.25em; }
li + li { margin-top: 6px; }
strong { font-weight: 700; }

.wrap { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.wide { max-width: calc(980px + 2 * var(--gutter)); }

/* Шапка */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
         font: 600 20px/1 Unbounded, system-ui, sans-serif; }
.brand .mark { width: 44px; height: auto; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 500; font-size: 15px; }
.nav a { color: var(--text-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* Знак «Горизонт погляду» */
.mark .o { fill: var(--mark-other); }
.mark .y { fill: var(--mark-you); }
.mark .po { fill: var(--mark-pupil-other); }
.mark .py { fill: var(--mark-pupil-you); }

/* Документи */
.doc { padding: 40px 0 72px; }
.doc .lead { color: var(--text-2); }
.meta { color: var(--text-2); font-size: 15px; margin-top: 8px; }
.lang-switch { display: inline-flex; gap: 8px; margin-top: 20px; font-size: 15px; font-weight: 600; }
.lang-switch a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-top: 28px; }
.toc ol { margin: 8px 0 0; }
.note { background: var(--surface-muted); border-radius: var(--radius); padding: 16px 20px; margin-top: 20px; }
.lang-block { border-top: 1px solid var(--line); margin-top: 64px; padding-top: 8px; }

table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
th, td { text-align: start; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 700; background: var(--surface-muted); }
.table-scroll { overflow-x: auto; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-top: 12px; }
details[open] { padding-bottom: 18px; }
summary { cursor: pointer; font-weight: 700; }
details p:first-of-type { margin-top: 10px; }

/* Лендинг */
.hero { padding: 56px 0 24px; text-align: center; }
.hero .mark { width: min(220px, 60vw); height: auto; display: block; margin: 0 auto 28px; }
.hero h1 { font-size: clamp(40px, 9vw, 64px); }
.hero .tagline { font: 500 clamp(19px, 3.4vw, 24px)/1.35 Manrope, system-ui, sans-serif; margin-top: 12px; }
.hero .sub { color: var(--text-2); max-width: 46ch; margin: 16px auto 0; }
.cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.store-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 14px;
             background: var(--text); color: var(--bg); font-weight: 700; text-decoration: none; cursor: default; }
.store-btn small { display: block; font-weight: 500; font-size: 12px; opacity: .8; line-height: 1.1; }
.store-btn span { line-height: 1.2; text-align: start; }
.store-btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.soon { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        color: var(--accent-text); border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px; margin-top: 14px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-top: 0; }
.card p { color: var(--text-2); margin-top: 8px; }
.roles .card h3::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%;
                          margin-inline-end: 8px; vertical-align: middle; background: var(--c, var(--accent)); }
.roles .p { --c: var(--role-kb); }
.roles .a { --c: var(--role-a); }
.roles .c { --c: var(--role-fc); }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 44px; margin-top: 16px; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 30px; height: 30px;
                    border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700;
                    display: grid; place-items: center; font-size: 15px; }
.section { padding: 8px 0 24px; }

/* Підвал */
.foot { border-top: 1px solid var(--line); color: var(--text-2); font-size: 15px; padding: 28px 0 40px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot a { color: var(--text-2); }

@media (max-width: 480px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
}
