/* ==========================================================================
   Параф — стили лендинга
   Палитра «бумага и чернила»: тёплая бумага, фиолетовые чернила, сургуч.
   ========================================================================== */

:root {
  /* Бумага */
  --paper: #F7F5F0;
  --paper-2: #EFEBE2;
  --card: #FFFFFF;
  --line: #E4E0D6;
  --line-2: #D6D1C4;

  /* Текст */
  --text: #1A1733;
  --text-2: #55516E;
  --text-3: #6E6A85;

  /* Чернила — основной цвет бренда */
  --ink: #4535D6;
  --ink-hover: #3A2BC0;
  --ink-text: #4535D6;
  --ink-soft: #ECEAFD;
  --ink-line: #CFCAF8;

  /* Ночь — тёмные секции */
  --night: #15122E;
  --night-2: #1F1B42;
  --night-line: #2F2A5C;
  --night-text: #EEECF7;
  --night-text-2: #B4AFD0;
  --ink-on-night: #A99EFF;

  /* Сургуч — акцент */
  --wax: #CC4420;
  --wax-soft: #FCE7DF;

  /* Статусы */
  --ok: #14805A;
  --ok-soft: #E2F3EB;
  --wait: #945A00;
  --wait-soft: #FDF0D8;

  /* Документ всегда остаётся «бумажным» */
  --doc: #FFFFFF;
  --doc-text: #1A1733;
  --doc-text-2: #5B5773;
  --doc-line: #ECE9F2;
  --sign-ink: #23308F;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-paper: 0 1px 0 rgba(26, 23, 51, .04), 0 18px 40px -18px rgba(26, 23, 51, .22);
  --shadow-float: 0 1px 0 rgba(26, 23, 51, .05), 0 24px 48px -16px rgba(26, 23, 51, .28);

  --font-sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1200px;
  --gutter: 24px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #100E22;
    --paper-2: #16132E;
    --card: #1B1838;
    --line: #2A2650;
    --line-2: #39335F;
    --text: #EEECF7;
    --text-2: #B4AFD0;
    --text-3: #9A95B8;
    --ink: #5B4BF0;
    --ink-hover: #6C5DF5;
    --ink-text: #A99EFF;
    --ink-soft: #231F4A;
    --ink-line: #3A3380;
    --night: #0B0A18;
    --night-2: #17142F;
    --night-line: #2A2650;
    --wax-soft: #3A1E17;
    --ok: #4CC894;
    --ok-soft: #13301F;
    --wait: #F0B455;
    --wait-soft: #33260F;
    --shadow-paper: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .7);
    --shadow-float: 0 1px 0 rgba(0, 0, 0, .3), 0 24px 48px -16px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}

/* Base ------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--ink-text); text-underline-offset: 3px; }
a:hover { color: var(--ink-hover); }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* Accent: italic serif words, the «handwritten» voice of the brand */
.accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.14em;
  letter-spacing: -0.01em;
  line-height: 0.9;
  color: var(--ink-text);
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  --btn-h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--btn-h);
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 16px/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { --btn-h: 44px; padding: 0 18px; font-size: 15px; }
.btn-lg { --btn-h: 56px; padding: 0 28px; font-size: 17px; border-radius: 14px; }

.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 8px 20px -10px rgba(69, 53, 214, .7); }
.btn-primary:hover { background: var(--ink-hover); color: #fff; }

.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }

.btn-light { background: #fff; color: var(--night); }
.btn-light:hover { background: #F1EEFF; color: var(--night); }

.btn-outline-light { border-color: rgba(255, 255, 255, .4); color: #fff; }
.btn-outline-light:hover { border-color: #fff; color: #fff; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* Header ----------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 72px;
}

.brand { display: inline-flex; flex: none; }
.logo { height: 30px; width: auto; }
.logo-mark { fill: none; stroke: var(--ink-text); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.logo-word { fill: var(--text); }

.nav { margin-inline: auto; }
.nav ul { display: flex; gap: 4px; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--text); background: var(--paper-2); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.link-quiet {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.link-quiet:hover { color: var(--ink-text); }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.menu-toggle .i-close,
.menu-toggle[aria-expanded="true"] .i-open { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: inline; }

.mobile-menu { border-top: 1px solid var(--line); background: var(--paper); }
.mobile-menu nav { padding-block: 12px 20px; display: grid; gap: 12px; }
.mobile-menu a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

/* Hero ------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 72px 0 104px;
  isolation: isolate;
}
.hero::before {
  /* Dot grid, like a page from a notebook */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 20%, transparent 72%);
  opacity: .55;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

.hero h1 {
  margin-top: 24px;
  font-size: clamp(42px, 5.4vw, 74px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero h1 .accent { display: inline-block; position: relative; white-space: nowrap; padding-bottom: .12em; }

.flourish {
  position: absolute;
  left: -3%;
  bottom: -0.32em;
  width: 106%;
  height: auto;
  aspect-ratio: 420 / 40;
  overflow: visible;
}
.flourish path {
  fill: none;
  stroke: var(--wax);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.1s cubic-bezier(.65, 0, .35, 1) .5s forwards;
}

.lead {
  max-width: 540px;
  margin-top: 28px;
  color: var(--text-2);
  font-size: 19px;
  line-height: 1.6;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 32px;
  color: var(--text-2);
  font-size: 15px;
}
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points li::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Hero visual: the document that gets signed */
.hero-visual {
  position: relative;
  padding: 20px 56px 72px 36px;
}

.doc-stack,
.doc {
  border-radius: 18px;
  background: var(--doc);
}
.doc-stack {
  position: absolute;
  inset: 38px 34px 52px 62px;
  border: 1px solid var(--line);
  transform: rotate(3.5deg);
  box-shadow: var(--shadow-paper);
  opacity: .9;
}

.doc {
  position: relative;
  padding: 32px 34px 46px;
  border: 1px solid color-mix(in srgb, var(--doc-text) 8%, transparent);
  box-shadow: var(--shadow-float);
  color: var(--doc-text);
  animation: rise .8s cubic-bezier(.2, .7, .2, 1) both;
}

.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.doc-kicker { color: var(--doc-text-2); font-size: 12px; font-weight: 500; letter-spacing: .02em; }
.doc-title { margin-top: 2px; font-size: 17px; font-weight: 600; line-height: 1.3; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-wait { background: #FDF0D8; color: #945A00; }
.status-ok { background: #E2F3EB; color: #14805A; }
.section-dark .status-ok { background: rgba(76, 200, 148, .14); color: #6FDDAE; }

.status-swap { display: grid; justify-items: end; flex: none; }
.status-swap > * { grid-area: 1 / 1; }
.status-swap .status-wait { animation: fade-out .3s ease 2.7s forwards; }
.status-swap .status-ok { opacity: 0; animation: pop-in .4s cubic-bezier(.2, .9, .3, 1.4) 2.8s forwards; }

.doc-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--doc-line);
  color: var(--doc-text-2);
  font-size: 12px;
}
.doc-text { margin-top: 14px; color: var(--doc-text-2); font-size: 12.5px; line-height: 1.55; }
.doc-h { margin-top: 16px; font-size: 12.5px; font-weight: 600; }

.doc-lines { display: grid; gap: 7px; margin-top: 9px; }
.doc-lines span { display: block; width: var(--w); height: 6px; border-radius: 3px; background: var(--doc-line); }

.doc-sign {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 26px;
}
.sign-slot {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 86px;
  border-bottom: 1.5px solid var(--doc-text);
}
.sign-slot-here::before {
  /* the «sign here» zone */
  content: "";
  position: absolute;
  inset: -4px -6px 0;
  border: 1.5px dashed color-mix(in srgb, var(--wax) 55%, transparent);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, var(--wax) 5%, transparent);
  animation: fade-out .4s ease 2.5s forwards;
}
.signature { width: 100%; height: 58px; overflow: visible; }
.signature path {
  fill: none;
  stroke: var(--sign-ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
}
.signature-2 path { stroke-dashoffset: 1; animation: draw 1.3s cubic-bezier(.55, .1, .35, 1) 1.2s forwards; }

.sign-cap {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  color: var(--doc-text-2);
  font-size: 11px;
  white-space: nowrap;
}

.sign-here {
  position: absolute;
  top: -14px;
  left: -2px;
  z-index: 1;
  padding: 4px 16px 4px 10px;
  background: var(--wax);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
  border-radius: 4px 0 0 4px;
  animation: fade-out .3s ease 1.1s forwards;
}

.seal {
  position: absolute;
  right: 22px;
  bottom: 50px;
  width: 124px;
  height: 124px;
  opacity: 0;
  mix-blend-mode: multiply;
  transform: rotate(-14deg) scale(1.6);
  animation: stamp .45s cubic-bezier(.2, .9, .3, 1.2) 2.6s forwards;
  pointer-events: none;
}

.float-card {
  position: absolute;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-float);
}

.route {
  top: 36%;
  right: 0;
  width: 262px;
  padding: 16px 16px 10px;
  animation: rise .8s cubic-bezier(.2, .7, .2, 1) .35s both;
}
.fc-title { color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.route ol { margin-top: 10px; }
.route li {
  display: grid;
  grid-template-columns: 32px 1fr 20px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.route li:first-child { border-top: 0; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--av);
  color: var(--av-text);
  font-size: 12px;
  font-weight: 700;
}
.who { display: grid; min-width: 0; line-height: 1.25; }
.who b { font-size: 14px; font-weight: 600; }
.who small { color: var(--text-3); font-size: 12px; }

.check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ok); }
.check svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.is-now .check { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); animation: check-on .3s ease 2.8s forwards; }
.is-now .check svg { opacity: 0; animation: pop-in .3s ease 2.8s forwards; }

.swap { display: grid; }
.swap > * { grid-area: 1 / 1; }
.swap-a { animation: fade-out .3s ease 2.7s forwards; }
.swap-b { opacity: 0; animation: pop-in .3s ease 2.8s forwards; }

.toast {
  left: 0;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 14px 14px;
  opacity: 0;
  animation: toast-in .5s cubic-bezier(.2, .8, .2, 1) 3.1s forwards;
}
.toast b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.toast small { display: block; color: var(--text-3); font-size: 12px; }
.toast-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--ok-soft); }
.toast-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Strip ------------------------------------------------------------------ */

.strip { border-block: 1px solid var(--line); background: var(--card); }
.strip-inner { display: flex; align-items: center; gap: 28px; padding-block: 22px; }
.strip-title { flex: none; color: var(--text-3); font-size: 14px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}

/* Sections --------------------------------------------------------------- */

.section { padding-block: 112px; }
.section-alt { background: var(--paper-2); }

.section-head { max-width: 720px; }
.section-head-center { margin-inline: auto; text-align: center; }
.section-head-center .section-lead { margin-inline: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }

.section h2 {
  margin-top: 16px;
  font-size: clamp(32px, 3.8vw, 52px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
}
.section-lead { max-width: 600px; margin-top: 18px; color: var(--text-2); font-size: 18px; }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 56px;
  counter-reset: step;
}
.step {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.step-art {
  display: grid;
  align-content: center;
  gap: 12px;
  height: 200px;
  padding: 22px;
  border-radius: 14px;
  background: var(--paper);
  overflow: hidden;
}
.step-num {
  margin: 24px 12px 0;
  color: var(--ink-text);
  font-family: var(--font-serif);
  font-size: 28px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
}
.step h3 { margin: 10px 12px 0; font-size: 22px; font-weight: 600; }
.step p { margin: 10px 12px 0; color: var(--text-2); font-size: 16px; }

.drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 64px;
  border: 1.5px dashed var(--ink-line);
  border-radius: 12px;
  color: var(--text-3);
  font-size: 14px;
}
.drop-icon { width: 20px; height: 20px; fill: none; stroke: var(--ink-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.file-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-paper);
}
.file-ext { padding: 7px 7px; border-radius: 8px; background: var(--wax); color: #fff; font-size: 11px; font-weight: 700; }
.file-name { display: grid; font-size: 14px; font-weight: 600; line-height: 1.3; }
.file-name small { color: var(--text-3); font-size: 12px; font-weight: 400; }
.file-done { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); }
.file-done svg { width: 13px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.signers { display: grid; gap: 8px; }
.signers li {
  display: grid;
  grid-template-columns: 22px 32px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.order { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--ink-soft); color: var(--ink-text); font-size: 12px; font-weight: 700; }
.add-signer { justify-self: start; color: var(--ink-text); font-size: 14px; font-weight: 600; }

.mini-doc {
  position: relative;
  display: grid;
  gap: 8px;
  width: 170px;
  justify-self: center;
  padding: 20px 18px 54px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--doc);
  box-shadow: var(--shadow-paper);
  transform: rotate(-2deg);
}
.mini-doc span { width: var(--w); height: 5px; border-radius: 3px; background: var(--doc-line); }
.mini-doc img { position: absolute; right: 12px; bottom: 8px; width: 58px; height: 58px; transform: rotate(-12deg); mix-blend-mode: multiply; }
.mini-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: center;
  color: var(--ink-text);
  font-size: 14px;
  font-weight: 600;
}
.mini-download svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Bento */
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 56px;
}
.tile {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.tile-wide { grid-column: span 2; }
.tile h3 { font-size: 21px; font-weight: 600; }
.tile p { margin-top: 10px; color: var(--text-2); font-size: 16px; }
.tile-art { display: flex; align-items: center; justify-content: center; min-height: 150px; margin-bottom: 24px; border-radius: 14px; background: var(--paper); }
.tile-copy { max-width: 520px; }

.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.levels li {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.levels b { margin-top: 8px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.levels span { font-size: 15px; font-weight: 500; line-height: 1.35; }
.levels small { color: var(--text-3); font-size: 13px; line-height: 1.4; }
.level-bars { display: flex; gap: 4px; }
.level-bars i { width: 22px; height: 6px; border-radius: 3px; background: var(--line-2); }
.level-bars i.on { background: var(--ink); }

.pages { gap: 12px; }
.page {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  width: 74px;
  height: 100px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--doc);
  box-shadow: var(--shadow-paper);
}
.page:nth-child(1) { transform: rotate(-4deg) translateY(4px); }
.page:nth-child(3) { transform: rotate(4deg) translateY(4px); }
.page i { width: var(--w); height: 4px; border-radius: 2px; background: var(--doc-line); }
.page em {
  position: absolute;
  right: 8px;
  bottom: 6px;
  color: var(--sign-ink);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
}

.template dl { display: grid; gap: 10px; margin: 0; padding: 18px; }
.template dl > div { display: grid; grid-template-columns: 76px auto; align-items: center; gap: 10px; }
.template dt { color: var(--text-3); font-size: 13px; }
.template dd { margin: 0; font-size: 14px; }
.var {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ink-soft);
  color: var(--ink-text);
  font-weight: 600;
  white-space: nowrap;
}

.route-map { gap: 0; padding-inline: 12px; }
.node {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.node.is-done { border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.node.is-now { border-color: var(--ink); color: var(--ink-text); box-shadow: 0 0 0 4px var(--ink-soft); }
.edge { width: 14px; height: 2px; flex: none; background: var(--line-2); }

.phone-code { flex-direction: column; gap: 12px; }
.phone-label { color: var(--text-3); font-size: 13px; }
.code { display: flex; gap: 8px; }
.code i {
  display: grid;
  place-items: center;
  width: 40px;
  height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--card);
  font-size: 20px;
  font-style: normal;
  font-weight: 600;
}
.code i.caret { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ink-soft); }
.phone-btn { padding: 8px 40px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; }

.tile-split { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
.log { display: grid; gap: 8px; margin-top: 20px; }
.log li { display: flex; gap: 12px; color: var(--text-2); font-size: 14px; }
.log time { flex: none; color: var(--text); font-family: var(--font-mono); font-size: 13px; font-weight: 600; }

.code-block {
  margin: 0;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--night);
  color: #DAD6F2;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}
.c-k { color: #FFB59C; font-weight: 700; }
.c-s { color: #B7ADFF; }
.c-v { color: #8FE3BD; }

/* Security */
.section-dark { background: var(--night); color: var(--night-text); }
.section-dark .eyebrow { color: var(--ink-on-night); }
.section-dark .accent { color: var(--ink-on-night); }
.section-dark .section-lead { color: var(--night-text-2); }

.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}
.sec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; margin-top: 44px; }
.sec-list svg { width: 28px; height: 28px; fill: none; stroke: var(--ink-on-night); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sec-list h3 { margin-top: 14px; font-size: 18px; font-weight: 600; }
.sec-list p { margin-top: 6px; color: var(--night-text-2); font-size: 15px; }

.cert {
  position: relative;
  margin: 0;
  padding: 28px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius-lg);
  background: var(--night-2);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6);
}
.cert-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-bottom: 20px; border-bottom: 1px solid var(--night-line); }
.cert-title { font-size: 19px; font-weight: 600; }
.cert-grid { display: grid; gap: 16px; margin: 20px 0 0; }
.cert-grid dt { color: var(--night-text-2); font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.cert-grid dd { margin: 4px 0 0; font-size: 15px; }
.mono { font-family: var(--font-mono); font-size: 14px !important; letter-spacing: .02em; color: #D8D3FF; }

.cert-signers { display: grid; gap: 10px; margin-top: 22px; }
.cert-signers li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--night-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
}
.cert-signers .who small { color: var(--night-text-2); }
.cert-signers time { color: var(--night-text-2); font-family: var(--font-mono); font-size: 12px; }

.cert-foot { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-top: 22px; }
.qr { width: 76px; height: 76px; padding: 6px; border-radius: 8px; background: #fff; }
.qr path { fill: var(--night); }
.cert-foot p { color: var(--night-text-2); font-size: 14px; }
.cert-seal { width: 84px; height: 84px; transform: rotate(-12deg); filter: brightness(1.9) saturate(.8); opacity: .9; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 56px; align-items: stretch; }
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.plan h3 { font-size: 22px; font-weight: 600; }
.plan-for { margin-top: 6px; color: var(--text-3); font-size: 15px; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 24px; }
.price b { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.price span { color: var(--text-3); font-size: 14px; }
.plan ul { display: grid; gap: 12px; margin: 28px 0 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.plan li { display: flex; gap: 10px; color: var(--text-2); font-size: 15px; line-height: 1.45; }
.plan li::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: none;
  background: var(--ink-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.plan .btn { margin-top: auto; }
.plan-featured { border: 2px solid var(--ink); box-shadow: 0 30px 60px -30px rgba(69, 53, 214, .45); }
.plan-badge {
  position: absolute;
  top: -14px;
  left: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 64px; align-items: start; }
.faq-list { display: grid; gap: 12px; }
.faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color .2s;
}
.faq-list details[open] { border-color: var(--line-2); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 22px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  width: 12px;
  height: 12px;
  flex: none;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .2s;
}
.faq-list details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.faq-list details p { padding: 0 22px 20px; color: var(--text-2); font-size: 16px; }

/* CTA */
.cta { padding-block: 24px 112px; }
.cta-card {
  position: relative;
  overflow: hidden;
  padding: 80px 64px;
  border-radius: 28px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  isolation: isolate;
}
.cta-mark {
  position: absolute;
  right: -110px;
  bottom: -120px;
  z-index: -1;
  width: 420px;
  height: 420px;
  opacity: .16;
}
.cta-mark path { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.cta-card h2 { font-size: clamp(34px, 4.4vw, 58px); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.cta-card .accent { color: #fff; }
.cta-card p { margin-top: 18px; color: rgba(255, 255, 255, .82); font-size: 19px; }
.cta-card .cta-row { justify-content: center; }

/* Footer */
.site-footer { padding-top: 72px; border-top: 1px solid var(--line); background: var(--card); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer-brand p { max-width: 280px; margin-top: 16px; color: var(--text-2); font-size: 15px; }
.site-footer h2 { color: var(--text-3); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.site-footer ul { display: grid; gap: 4px; margin-top: 12px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 36px; color: var(--text); font-size: 15px; text-decoration: none; }
.site-footer nav a:hover { color: var(--ink-text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 14px;
}

/* Reveal on scroll (only when JS is on) */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-visible { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }

/* Animations --------------------------------------------------------------- */

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fade-out { to { opacity: 0; visibility: hidden; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-14deg) scale(1.6); }
  70% { opacity: .95; transform: rotate(-14deg) scale(.94); }
  100% { opacity: .9; transform: rotate(-14deg) scale(1); }
}
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes check-on { to { background: var(--ok); box-shadow: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1080px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-actions { margin-left: auto; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero-copy { max-width: 680px; }
  .hero-visual { max-width: 620px; width: 100%; margin-inline: auto; }
  .security-grid, .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-wide { grid-column: span 2; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .steps, .plans { grid-template-columns: minmax(0, 1fr); }
  .steps { max-width: 520px; margin-inline: auto; }
  .plans { max-width: 460px; margin-inline: auto; }
  .strip-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .tile-split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .header-inner { gap: 12px; min-height: 64px; }
  .logo { height: 26px; }
  .header-actions .link-quiet,
  .header-actions .btn { display: none; }
  .hero { padding: 40px 0 72px; }
  .hero h1 { font-size: clamp(36px, 10.4vw, 48px); }
  .lead { font-size: 17px; }
  .cta-row .btn { flex: 1 1 100%; }
  .hero-visual { padding: 12px 0 64px; }
  .doc { padding: 22px 18px 20px; }
  .doc-title { font-size: 15px; }
  .doc-head { flex-direction: column; gap: 10px; }
  .status-swap { justify-items: start; }
  .doc-stack { inset: 24px 6px 50px 14px; }
  .route { display: none; }
  .toast { left: 0; right: 0; bottom: 0; }
  .seal { width: 96px; height: 96px; right: 10px; bottom: 30px; }
  .section { padding-block: 72px; }
  .section-lead { font-size: 17px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .tile-wide { grid-column: auto; }
  .tile { padding: 22px; }
  .levels { grid-template-columns: minmax(0, 1fr); }
  .route-map { flex-wrap: wrap; row-gap: 8px; }
  .sec-list { grid-template-columns: minmax(0, 1fr); }
  .cert { padding: 20px; }
  .cert-foot { grid-template-columns: auto 1fr; }
  .cert-seal { display: none; }
  .cert-signers li { grid-template-columns: 32px 1fr; }
  .cert-signers time { grid-column: 2; }
  .cta { padding-bottom: 72px; }
  .cta-card { padding: 56px 22px; border-radius: 22px; }
  .cta-mark { width: 260px; height: 260px; right: -60px; bottom: -70px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}

/* Кнопки-ссылки «Войти» (в шапке и мобильном меню) ------------------------- */

.link-quiet {
  border: 0;
  background: none;
  cursor: pointer;
  font: 500 15px/1 var(--font-sans);
}
.mobile-menu .m-login {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: 500 16px/1 var(--font-sans);
  text-align: left;
  cursor: pointer;
}

/* Окно входа и регистрации ------------------------------------------------- */

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--night) 55%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: modal-fade .2s ease;
}
.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 32px 32px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-float);
  animation: modal-rise .28s cubic-bezier(.2, .7, .2, 1);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.modal-close:hover { background: var(--paper-2); color: var(--text); }
.modal-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.modal-mark { display: block; }
.modal-mark svg { width: 44px; height: 44px; }
.modal-mark rect { fill: var(--ink); }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 22px 0 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--paper-2);
}
.tab {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font: 500 15px/1 var(--font-sans);
  cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.tab.is-active {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-paper);
}

.auth-panel[hidden] { display: none; }
.auth-panel { margin-top: 20px; }
.auth-panel h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.modal-lead { margin-top: 6px; color: var(--text-2); font-size: 15px; }

.field { display: grid; gap: 6px; margin-top: 16px; }
.field label { font-size: 14px; font-weight: 600; }
.field input {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--paper);
  color: var(--text);
  font: 16px var(--font-sans);
}
.field input:focus-visible { border-color: var(--ink); outline: 3px solid var(--ink-soft); outline-offset: 0; }

.auth-panel > .btn { width: 100%; margin-top: 22px; }

.form-error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--wax-soft, #FCE7DF);
  color: #A8361A;
  font-size: 14px;
  font-weight: 500;
}

.modal-switch { margin-top: 18px; color: var(--text-2); font-size: 14px; text-align: center; }
.linklike {
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink-text);
  font: 600 14px/1 var(--font-sans);
  cursor: pointer;
}
.linklike:hover { color: var(--ink-hover); text-decoration: underline; }

.reg-done { margin-top: 20px; text-align: center; }
.reg-done-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink-soft);
  color: var(--ink-text);
}
.reg-done-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.reg-done h3 { margin-top: 14px; font-size: 20px; font-weight: 600; }
.reg-done p { margin-top: 8px; color: var(--text-2); font-size: 15px; overflow-wrap: anywhere; }
.reg-done .reg-hint { margin-top: 10px; color: var(--text-3); font-size: 13px; }

@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-card { animation: none; }
}

@media (max-width: 640px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal-card {
    width: 100%;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    animation: modal-sheet .3s cubic-bezier(.2, .8, .2, 1);
  }
  @keyframes modal-sheet { from { transform: translateY(100%); } }
}

/* [hidden] должен скрывать даже элементы с заданным display (поля формы). */
.modal [hidden] { display: none !important; }
.form-error { background: #FCE7DF; color: #A8361A; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .form-error { background: #3A1E17; color: #FFB4A0; }
}
