/* ─────────────────────────────────────────────────────────────
   SaqtauAI — сайт как продолжение приложения.
   Токены, радиусы и приёмы взяты из mobile/src/theme.ts и экранов:
   кремовый холст, Cormorant в заголовках, серифные цифры
   в показателях, кикеры капсом, радиусы 4–8, волосяные рамки,
   персиковая полоса подсказки. Больших теней нет нигде.
   ───────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  --canvas: #FBF9F2;
  --surface: #FFFFFF;
  --surface-alt: #F1EEF6;
  --surface-warm: #FCDEC5;

  --ink: #2E2A3D;
  --muted: #6E6880;
  --subtle: #9A94A8;
  --line: #E7E2EC;
  --line-strong: #C9C2D4;

  --brand: #6B5CA5;
  --brand-solid: #5B4E93;
  --brand-mid: #8F84B0;
  --brand-label: #6257A0;   /* тот же оттенок, но проходит AA на мелком кегле */
  --brand-soft: #E7E2F0;
  --accent: #EDBE93;
  --accent-ink: #A9662F;

  --mint: #D8F2F2;
  --mint-ink: #3F6F8A;
  --alert: #A8524F;

  --r-s: 4px;
  --r: 8px;
  --pill: 999px;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Onest, "Segoe UI", system-ui, sans-serif;

  --shell: 1080px;
  --gutter: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: var(--r-s); }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }

/* Кикер — приём из приложения */
.kicker { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-label); }
.kaz { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); }

/* ── Шапка ───────────────────────────────────────────── */
.top { display: flex; align-items: center; gap: 14px; padding: 18px 0 12px; }
.top .word { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; text-decoration: none; color: var(--ink); }
.langs { margin-left: auto; display: flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; background: var(--surface); }
.langs button {
  font: inherit; font-size: 0.78rem; font-weight: 600;
  background: transparent; border: 0; border-right: 1px solid var(--line);
  padding: 7px 13px; color: var(--muted); cursor: pointer;
}
.langs button:last-child { border-right: 0; }
.langs button[aria-pressed="true"] { background: var(--brand-solid); color: #FFF; }
.langs button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Навигация в духе таб-бара приложения */
.demo-bar {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-warm); border-left: 3px solid var(--accent-ink);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  padding: 11px 14px; margin-bottom: 16px;
  font-size: 0.86rem; line-height: 1.45; color: #5C3A18;
}
.demo-bar b { font-weight: 700; color: #472B10; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.tabs a {
  display: grid; justify-items: center; gap: 4px;
  padding: 8px 16px 9px; text-decoration: none;
  color: var(--subtle); font-size: 0.78rem; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabs a:hover { color: var(--muted); }
.tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

/* ── Кнопки ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; border-radius: var(--r); padding: 15px 26px; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.btn-main { background: var(--brand-solid); color: #FFFFFF; }
.btn-main:hover { background: #4C4180; }
.btn-soft { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { border-color: var(--brand-mid); }
.btn-sm { padding: 10px 18px; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ── Поверхности ─────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.strip { background: var(--surface-warm); border-radius: var(--r); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.strip .ic { width: 26px; height: 26px; flex: none; border-radius: var(--pill); background: rgba(255, 255, 255, 0.65); display: grid; place-items: center; }
.strip .tx b { display: block; font-size: 0.92rem; }
.strip .tx span { font-size: 0.86rem; color: #6B4B2C; }

/* Тонкая пульсовая линия — разделитель из приложения */
.err-text { margin: 0; }
.err-tips { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.err-tips li { font-size: 0.88rem; color: #6B3532; }
.err-tech { font-size: 0.76rem; color: #8A5F5D; font-variant-numeric: tabular-nums; }

.pulse-line { margin: 26px auto 0; max-width: 520px; }
.err-text { margin: 0; }
.err-tips { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.err-tips li { font-size: 0.88rem; color: #6B3532; }

.pulse-line svg { display: block; width: 100%; height: 34px; }

/* ── Секции ──────────────────────────────────────────── */
.section { margin-top: clamp(34px, 4vw, 56px); padding-top: 26px; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); margin-top: 10px; }
.section .lede { margin-top: 12px; color: var(--muted); max-width: 56ch; }

/* Строки «название — значение», как в приложении */
.rows { display: grid; margin-top: 22px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row .n { font-weight: 600; }
.row .n small { display: block; font-weight: 400; font-size: 0.86rem; color: var(--muted); margin-top: 3px; max-width: 58ch; }
.row .val { font-family: var(--serif); font-size: 1.6rem; color: var(--brand); white-space: nowrap; }
.row .val em { font-style: normal; font-family: var(--sans); font-size: 0.72rem; color: var(--subtle); margin-left: 5px; }

/* Показатели тройкой — как на главном экране */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { text-align: center; padding: 6px 8px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric .k { font-size: 0.74rem; color: var(--muted); }
.metric .v { display: block; font-family: var(--serif); font-size: 2.4rem; line-height: 1.05; color: var(--brand); margin-top: 4px; }
.metric .u { font-size: 0.7rem; color: var(--subtle); }

/* Статус */
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mint-ink); background: var(--mint); border-radius: var(--pill); padding: 4px 12px; }
.state::before { content: ""; width: 6px; height: 6px; border-radius: var(--pill); background: currentColor; }
.state.watch { color: var(--accent-ink); background: var(--surface-warm); }
.state.alert { color: var(--alert); background: #F6DEDA; }

.tag-demo { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); border: 1px solid var(--accent); border-radius: var(--r-s); padding: 3px 9px; }

/* ── Подвал ──────────────────────────────────────────── */
footer { padding: 28px 0 46px; margin-top: clamp(30px, 4vw, 50px); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: flex-start; }
footer .legal { font-size: 0.82rem; color: var(--subtle); max-width: 56ch; }
footer .links { margin-left: auto; display: flex; gap: 18px; font-size: 0.86rem; }
footer .links a { color: var(--muted); text-decoration: none; }
footer .links a:hover { color: var(--ink); }

@media (max-width: 700px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabs a { padding: 8px 11px 9px; font-size: 0.72rem; }
}
@media (max-width: 620px) {
  :root { --gutter: 18px; }
  .row .val { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
