/*
  mysaver.pro, direction A "Бумага и сигнал" (same tokens as web/src/index.css).
  One accent (vermilion), Manrope 400/600, radius 8px. Light and dark follow the
  system setting. Status colours are a separate set and never the only carrier.
*/

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --surface-page: #f4f5f7;
  --surface-panel: #ffffff;
  --surface-sunk: #eceef1;
  --ink: #14171c;
  --ink-muted: #5c6068;
  --line: #e0e3e8;
  --input: #8a8f98;

  --brand: #e4572e;
  --color-action-primary: #d23e15;
  --color-action-primary-hover: #b8350f;
  --color-action-primary-ink: #ffffff;
  --color-action-link: #b8350f;

  --color-feedback-success: #167a52;
  --color-feedback-warning: #9a6700;
  --color-feedback-danger: #c42b27;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --radius: 8px;
  --wrap: 1200px;
  --gutter: 16px;
  --header-h: 64px;
  --font: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-page: #121418;
    --surface-panel: #181b20;
    --surface-sunk: #0e1013;
    --ink: #eceef1;
    --ink-muted: #a9aeb7;
    --line: #262a31;
    --input: #6b717b;

    --brand: #f0693f;
    --color-action-primary: #f0693f;
    --color-action-primary-hover: #ff8a63;
    --color-action-primary-ink: #14171c;
    --color-action-link: #ff8a63;

    --color-feedback-success: #4fd18b;
    --color-feedback-warning: #e5b143;
    --color-feedback-danger: #f0605a;
  }
}

@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1280px) { :root { --gutter: 48px; } }

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, b, strong, dt { font-weight: 600; }
h1, h2, h3 { margin: 0; text-wrap: balance; hyphens: none; }
p, ul, ol, dl, dd, figure { margin: 0; }
p, li, dd { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--color-action-link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--color-action-primary); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.nowrap { white-space: nowrap; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 20;
  background: var(--surface-panel); color: var(--ink);
  padding: 10px 16px; border-radius: var(--radius);
}
.skip:focus { top: 12px; }

/* buttons and quiet links */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  border: 0; border-radius: var(--radius);
  background: var(--color-action-primary); color: var(--color-action-primary-ink);
  font: 600 16px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color 320ms var(--ease), transform 500ms var(--ease);
}
.btn:hover { background: var(--color-action-primary-hover); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.btn--small { min-height: 44px; padding: 10px 16px; font-size: 15px; }
.btn--block { width: 100%; }

.link-quiet {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none;
}
.link-quiet:hover { text-decoration: underline; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface-page) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top__row { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 600; font-size: 18px; text-decoration: none; letter-spacing: -0.01em;
}
.logo__mark { width: 16px; height: 16px; border-radius: 4px; background: var(--brand); }
.top__nav { display: none; gap: 28px; margin-left: 16px; }
.top__nav a { color: var(--ink-muted); text-decoration: none; font-size: 15px; }
.top__nav a:hover { color: var(--ink); }
.top__actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
@media (min-width: 1024px) { .top__nav { display: flex; } }
@media (max-width: 420px) {
  .top__actions { gap: 12px; }
  .top__actions .btn--small { padding: 10px 12px; font-size: 14px; }
}

/* hero, scheme C: text left at the lower third, real screen right to the window edge */
.hero {
  display: grid;
  gap: 40px;
  padding: 48px 0 0;
  overflow: hidden;
}
.hero__text { padding: 0 var(--gutter); max-width: 640px; }
.hero__title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: .98;
  letter-spacing: -0.035em;
}
.soon {
  display: inline-block; vertical-align: super;
  margin-left: .35em; padding: .1em .55em .15em;
  border: 1px solid var(--color-action-link); border-radius: 999px;
  color: var(--color-action-link);
  font-size: max(.2em, 12px); line-height: 1.4; letter-spacing: .02em;
}
.hero__sub { margin-top: 28px; font-size: clamp(1.25rem, 2vw, 1.625rem); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.hero__lead { margin-top: 16px; max-width: 34em; color: var(--ink-muted); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 24px; margin-top: 32px; }
.hero__login { min-height: 48px; }
.micro { margin-top: 12px; font-size: 13px; color: var(--ink-muted); }
.hero__shot { min-width: 0; }
.hero__shot img { width: 100%; }
@media (max-width: 767px) {
  .hero__shot { padding: 0 var(--gutter); }
  .hero__shot img { max-width: 390px; margin: 0 auto; border-radius: var(--radius); }
  .hero__shot figcaption { padding: 12px 0 0; }
}
.hero__shot figcaption { padding: 12px var(--gutter) 0; font-size: 13px; color: var(--ink-muted); }

@media (min-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
    align-items: end;
    gap: 56px;
    min-height: min(calc(100svh - var(--header-h)), 860px);
    padding: 56px 0 64px;
  }
  .hero__text { padding-left: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); padding-right: 0; max-width: none; }
  .hero__shot { align-self: center; }
  .hero__shot img { width: max(100%, 640px); max-width: none; }
  .hero__shot figcaption { padding-left: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__title, .hero__sub, .hero__lead, .hero__cta, .hero__shot {
    animation: enter 900ms var(--ease) both;
  }
  .hero__sub { animation-delay: 100ms; }
  .hero__lead { animation-delay: 150ms; }
  .hero__cta { animation-delay: 250ms; }
  .hero__shot { animation-delay: 350ms; }
}
@keyframes enter {
  from { opacity: 0; transform: translateY(28px); filter: blur(14px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* sections */
.section { padding: 80px 0; }
.section--panel { background: var(--surface-panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (min-width: 1024px) { .section { padding: 120px 0; } }
.section__head { max-width: 760px; }
.kicker { font-size: 15px; font-weight: 600; color: var(--color-action-link); }
.section h2 {
  margin-top: 12px;
  font-size: clamp(1.875rem, 3.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.section__lead { margin-top: 20px; max-width: 36em; color: var(--ink-muted); }
.note { margin-top: 12px; font-size: 13px; color: var(--ink-muted); }

.split { display: grid; gap: 48px; }
@media (min-width: 1024px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 80px; align-items: start; }
  .split--wide-right { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

/* before / after */
.ba { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 48px; align-items: center; }
.ba__label { margin-bottom: 10px; font-size: 15px; font-weight: 600; color: var(--ink-muted); }
.ba__arrow { width: 40px; height: 20px; margin: 0 auto; transform: rotate(90deg); fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 768px) {
  .ba { grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); gap: 24px; }
  .ba__arrow { width: 56px; height: 28px; transform: none; margin-top: 30px; }
}
.sheet { background: var(--surface-panel); border-radius: var(--radius); padding: 20px 24px 22px; }
.section--panel .sheet { background: var(--surface-page); }
.sheet__name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.sheet__meta { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--ink-muted); }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.sheet__links, .sheet__files { list-style: none; padding: 0; margin-top: 14px; border-top: 1px solid var(--line); }
.sheet__links li, .sheet__files li {
  display: flex; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 15px; line-height: 1.4; min-width: 0;
}
.sheet__links .host {
  flex: none; width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 13px; color: var(--ink-muted);
}
.sheet__files li .sheet__meta { margin-left: auto; }
@media (max-width: 559px) {
  .sheet__links li { flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
  .sheet__links .host { width: 100%; }
  .sheet__files li { overflow-wrap: anywhere; }
}
.sheet__more { margin-top: 12px; font-size: 14px; color: var(--ink-muted); }

/* steps: a real sequence, so the numbers carry meaning */
.steps { list-style: none; padding: 0; margin-top: 64px; display: grid; gap: 32px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.steps li { border-top: 1px solid var(--ink); padding-top: 20px; }
.steps__n { font-size: 14px; font-weight: 600; color: var(--color-action-link); }
.steps h3 { margin-top: 8px; font-size: 21px; line-height: 1.2; letter-spacing: -0.015em; }
.steps p { margin-top: 10px; color: var(--ink-muted); font-size: 16px; max-width: 32em; }

/* facts list */
.facts { margin-top: 32px; border-top: 1px solid var(--line); }
.facts > div { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 560px) { .facts > div { grid-template-columns: 9.5em minmax(0, 1fr); gap: 16px; } }
.facts dt { font-size: 16px; }
.facts dd { font-size: 16px; color: var(--ink-muted); }

/* project map */
.map { background: var(--surface-page); border-radius: var(--radius); padding: 24px; }
.map__project {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  padding: 16px 20px; border-radius: var(--radius);
  background: var(--surface-panel); border-left: 0;
  box-shadow: inset 0 0 0 1.5px var(--brand);
}
.map__title { font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.map__meta { font-size: 14px; color: var(--ink-muted); }
.map__cols { display: grid; gap: 16px; margin-top: 28px; position: relative; }
@media (min-width: 560px) {
  .map__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map__cols::before {
    content: ''; position: absolute; left: 16.66%; right: 16.66%; top: -16px;
    border-top: 1.5px solid var(--brand);
  }
  .map__col::before {
    content: ''; position: absolute; left: 50%; top: -16px; height: 16px;
    border-left: 1.5px solid var(--brand);
  }
  .map__cols::after {
    content: ''; position: absolute; left: 50%; top: -28px; height: 12px;
    border-left: 1.5px solid var(--brand);
  }
}
.map__col { position: relative; }
.map__src { font-size: 14px; font-weight: 600; color: var(--ink-muted); padding: 0 2px 8px; }
.map__folder {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 10px 12px;
  background: var(--surface-panel); border-radius: var(--radius);
  font-size: 15px; line-height: 1.3;
}
.ico--s { width: 16px; height: 16px; color: var(--ink-muted); }

/* agents */
.agents__media { display: grid; gap: 24px; }
.shot img { width: 100%; border-radius: var(--radius); background: var(--surface-page); }
.shot figcaption { margin-top: 10px; font-size: 13px; color: var(--ink-muted); }
@media (prefers-color-scheme: dark) {
  .shot img { filter: brightness(.88); }
}
.code {
  overflow-x: auto; border-radius: var(--radius);
  background: var(--surface-sunk); color: var(--ink);
}
.code pre { margin: 0; padding: 18px 20px; font: 14px/1.6 var(--mono); }

/* security ledger */
.ledger { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.ledger li { display: grid; gap: 8px; padding: 20px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 560px) { .ledger li { grid-template-columns: 11.5em minmax(0, 1fr); gap: 24px; } }
.ledger p { font-size: 16px; color: var(--ink-muted); }
.ledger b { color: var(--ink); }
.ledger__tag { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.5; }
.ledger__tag::before { content: ''; flex: none; width: 8px; height: 8px; margin-top: .45em; border-radius: 2px; }
.ledger__tag--no { color: var(--color-feedback-success); }
.ledger__tag--no::before { background: var(--color-feedback-success); }
.ledger__tag--pass { color: var(--color-feedback-warning); }
.ledger__tag--pass::before { background: var(--color-feedback-warning); }
.ledger__tag--yes { color: var(--ink); }
.ledger__tag--yes::before { background: var(--ink); }

/* sources */
.sources { list-style: none; padding: 0; margin-top: 40px; border-top: 1px solid var(--line); }
.sources li { display: grid; gap: 6px; padding: 24px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .sources li { grid-template-columns: 14em minmax(0, 1fr); gap: 32px; } }
.sources h3 { font-size: 21px; letter-spacing: -0.015em; }
.sources p { color: var(--ink-muted); max-width: 40em; }

/* beta */
.fit { margin-top: 32px; }
.fit h3 { font-size: 17px; margin-top: 20px; }
.fit p, .fit ul { margin-top: 6px; color: var(--ink-muted); font-size: 16px; }
.fit ul { padding-left: 1.1em; }

.form { background: var(--surface-page); border-radius: var(--radius); padding: 28px 24px; }
@media (min-width: 768px) { .form { padding: 36px; } }
.form__title { font-size: 22px; letter-spacing: -0.015em; margin-bottom: 20px; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.opt { font-weight: 400; color: var(--ink-muted); }
.field input, .field textarea {
  display: block; width: 100%;
  min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--input); border-radius: var(--radius);
  background: var(--surface-panel); color: var(--ink);
  font: 400 16px/1.4 var(--font);
  transition: border-color 320ms var(--ease);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--color-action-primary); outline-offset: 1px; border-color: transparent; }
.field input[aria-invalid='true'] { border-color: var(--color-feedback-danger); }
.field__hint { margin-top: 6px; font-size: 13px; color: var(--ink-muted); }
.field__hint--error { color: var(--color-feedback-danger); font-weight: 600; }
::placeholder { color: var(--ink-muted); opacity: .8; }

.check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; margin: 8px 0 20px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--color-action-primary); }
.check label { font-size: 14px; line-height: 1.5; color: var(--ink-muted); }
.check--error label { color: var(--color-feedback-danger); }
.turnstile { margin-bottom: 20px; min-height: 65px; }
.form__status { margin-top: 14px; font-size: 15px; line-height: 1.5; min-height: 1.5em; }
.form__status--ok { color: var(--color-feedback-success); font-weight: 600; }
.form__status--error { color: var(--color-feedback-danger); }

/* footer */
.foot { padding: 48px 0 56px; }
.foot__row { display: grid; gap: 28px; }
@media (min-width: 768px) { .foot__row { grid-template-columns: 1fr auto; align-items: start; } }
.foot__small { margin-top: 10px; font-size: 14px; color: var(--ink-muted); }
.foot__nav { display: grid; gap: 4px; }
.foot__nav a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink); font-size: 15px; }

/* legal pages */
.doc { padding: 56px 0 96px; }
.doc__body { max-width: 760px; }
.doc h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; }
.doc h2 { margin-top: 48px; font-size: 24px; line-height: 1.2; letter-spacing: -0.015em; }
.doc p, .doc ul, .doc ol { margin-top: 14px; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li + li { margin-top: 6px; }
.doc .meta { margin-top: 12px; color: var(--ink-muted); font-size: 15px; }
.ph { background: color-mix(in srgb, var(--color-feedback-warning) 18%, transparent); padding: 0 .2em; border-radius: 3px; }
.table-wrap { overflow-x: auto; margin-top: 16px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; }

@media print {
  .top, .skip, .foot__nav { display: none; }
  body { background: #fff; color: #000; }
}
