/* Pactum landing — тема «Чернила» (dark). Токены — из брендбука (04_Токены). */

/* --- Примитивы (бренд) --- */
:root {
  --p-ink-900: #0E1322;
  --p-ink-800: #171E33;
  --p-ink-700: #1E2742;
  --p-ink-600: #283049;
  --p-paper: #F1EDE4;
  --p-muted: #A2A8B9;
  --p-muted-strong: #C6CBD8;
  --p-seal: #EF5B40;
  --p-seal-press: #D94A30;
  --p-seal-text: #FF8268;
  --p-success: #5CCB9C;
  --p-danger: #FF7A94;
  --p-warning: #E8B45A;

  /* --- Семантика --- */
  --surface: var(--p-ink-900);
  --surface-raised: var(--p-ink-800);
  --surface-card: var(--p-ink-700);
  --line: var(--p-ink-600);
  --text: var(--p-paper);
  --text-muted: var(--p-muted);
  --accent: var(--p-seal);
  --accent-press: var(--p-seal-press);
  --accent-text: var(--p-seal-text);

  --font-serif: "Source Serif 4", Georgia, serif;
  --font-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
}

/* --- Шрифты (self-hosted, fontsource) --- */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./fonts/source-serif-4-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/ibm-plex-mono-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/ibm-plex-mono-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}

/* --- База --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 760px; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; text-wrap: balance; }

/* --- Шапка --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--p-ink-900) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}
.wordmark {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
}
.seal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-left: 3px;
}
.site-nav { display: none; gap: 24px; margin-left: 16px; }
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 160ms ease-out;
}
.site-nav a:hover { color: var(--text); }
.header-row .btn { margin-left: auto; }

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #0E1322; }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--p-muted-strong); }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: 16px; }

/* --- Hero --- */
.hero { padding: 64px 0 72px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 32px;
}
.lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.hero-note { font-size: 14px; color: var(--text-muted); }

.hero-visual { display: flex; flex-direction: column; gap: 16px; }
.card-visual {
  background: linear-gradient(145deg, var(--p-ink-700), var(--p-ink-800) 60%, var(--p-ink-900));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  aspect-ratio: 8 / 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  transform: rotate(-2deg);
}
.card-visual-top { display: flex; justify-content: space-between; align-items: baseline; }
.card-visual-brand { font-family: var(--font-serif); font-size: 20px; font-weight: 600; }
.card-visual-brand::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 2px;
}
.card-visual-network { font-family: var(--font-sans); font-weight: 700; font-style: italic; letter-spacing: 0.04em; color: var(--text-muted); }
.card-visual-pan { font-family: var(--font-mono); font-size: clamp(15px, 2.4vw, 19px); letter-spacing: 0.06em; color: var(--text); }
.card-visual-bottom {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.ledger-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.ledger-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  color: var(--text-muted);
}
.ledger-row + .ledger-row { border-top: 1px dashed var(--line); }
.ledger-in { color: var(--p-success); }
.ledger-out { color: var(--text); }

/* --- Секции --- */
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-title {
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.section-sub { color: var(--text-muted); max-width: 38rem; margin-bottom: 32px; font-size: 17px; }

/* --- Шаги --- */
.steps { list-style: none; display: grid; gap: 16px; }
.step {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 16px;
}
.step h3 { font-size: 20px; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 15px; }

/* --- Тарифы --- */
.tariff-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.tariff {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.tariff--accent { border-color: var(--accent); }
.tariff-name { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-bottom: 8px; }
.tariff-value { font-family: var(--font-serif); font-size: 30px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.tariff--accent .tariff-value { color: var(--accent-text); }
.tariff-note { font-size: 14px; color: var(--text-muted); }
.tariff-compare { margin-top: 20px; font-size: 14px; color: var(--text-muted); }

/* --- Каталог --- */
.catalog-controls { display: grid; gap: 16px; margin-bottom: 24px; }
.catalog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0 18px;
  color: var(--text-muted);
}
.catalog-search:focus-within { border-color: var(--p-muted-strong); }
.catalog-search input {
  flex: 1;
  min-height: 48px;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
}
.catalog-search input::placeholder { color: var(--text-muted); }
.catalog-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}
.filter-chip:hover { color: var(--text); border-color: var(--p-muted-strong); }
.filter-chip[aria-pressed="true"] { background: var(--text); color: var(--p-ink-900); border-color: var(--text); }

.catalog-status { color: var(--text-muted); font-size: 15px; margin-bottom: 12px; min-height: 1.5em; }
.catalog-list { list-style: none; display: grid; gap: 10px; }
.merchant {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}
.merchant-main { flex: 1; min-width: 0; }
.merchant-name { font-weight: 600; font-size: 16px; }
.merchant-note { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.merchant-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--text-muted);
  white-space: nowrap;
}
.merchant-badge svg { flex: 0 0 auto; }
.merchant-badge--works { color: var(--p-success); border-color: color-mix(in srgb, var(--p-success) 45%, transparent); }
.merchant-badge--unstable { color: var(--p-warning); border-color: color-mix(in srgb, var(--p-warning) 45%, transparent); }
.merchant-badge--blocked { color: var(--p-danger); border-color: color-mix(in srgb, var(--p-danger) 45%, transparent); }
.catalog-foot { margin-top: 20px; font-size: 14px; color: var(--text-muted); }

/* --- FAQ --- */
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
  list-style: none;
  padding: 8px 32px 8px 0;
  position: relative;
  transition: color 160ms ease-out;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 200ms ease-out;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list summary:hover { color: var(--accent-text); }
.faq-list details p { color: var(--text-muted); margin: 0 0 20px; max-width: 62ch; }

/* --- Финальный CTA --- */
.final-cta { text-align: left; }
.final-cta .section-sub { margin-bottom: 28px; }

/* --- Футер --- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; }
.footer-grid { display: grid; gap: 32px; margin-bottom: 32px; }
.wordmark--footer { font-size: 22px; }
.footer-note { color: var(--text-muted); font-size: 13px; margin-top: 12px; line-height: 1.6; }
.footer-links { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 160ms ease-out;
}
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-muted); font-size: 13px; }

/* --- Появление (не гейтит контент) --- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy, .hero-visual { animation: rise 480ms ease-out both; }
  .hero-visual { animation-delay: 120ms; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* --- Планшет / десктоп --- */
@media (min-width: 768px) {
  .site-nav { display: flex; }
  .hero { padding: 96px 0; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 64px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .tariff-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 88px 0; }
  .footer-grid { grid-template-columns: 1fr auto; align-items: start; }
}
@media (min-width: 1024px) {
  .tariff-grid { grid-template-columns: repeat(4, 1fr); }
  .tariff--accent { grid-column: span 1; }
}
