/* ГРАФЕМА — сайт в стиле технического документа (дизайн v2, docs/plans/graphema-brand-site-app).
   Линейки, нумерованные разделы, таблицы-спецификации. Три шрифта: Cormorant Garamond (смысл),
   Golos Text (текст, подписи, данные). Все шрифты — со своего домена, OFL. */

/* ---------- Шрифты ---------- */
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-display: swap; src: url(/assets/fonts/cormorant-garamond-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: "Cormorant Garamond"; font-weight: 400; font-display: swap; src: url(/assets/fonts/cormorant-garamond-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url(/assets/fonts/cormorant-garamond-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: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url(/assets/fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap; src: url(/assets/fonts/golos-text-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: "Golos Text"; font-weight: 400; font-display: swap; src: url(/assets/fonts/golos-text-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap; src: url(/assets/fonts/golos-text-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: "Golos Text"; font-weight: 500; font-display: swap; src: url(/assets/fonts/golos-text-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }

/* ---------- Цвет: светлая / тёмная (по системе или по кнопке темы) ---------- */
:root {
  --paper: #EEEBE5; --surface: #F6F4F0; --ink: #1E1D1B; --graphite: #64615C; --rule: #D2CEC6; --red: #D23B2E;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --btn: #2E2C29;
  --radius: 6px;
  --pad: 56px; --label: 280px; --gap: 28px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --btn: #FFFFFF; --paper: #0B0B0C; --surface: #141416; --ink: #F2F2F0; --graphite: #8E8E8A; --rule: #2A2A2D; --red: #F0624F; color-scheme: dark; }
}
:root[data-theme="dark"], .inverse { --btn: #FFFFFF; --paper: #0B0B0C; --surface: #141416; --ink: #F2F2F0; --graphite: #8E8E8A; --rule: #2A2A2D; --red: #F0624F; color-scheme: dark; }

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--sans); overflow-wrap: break-word; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; }
p { margin: 0; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); }
.mono { font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.mono-s { font-family: var(--sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--graphite); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wordmark { display: block; fill: currentColor; aspect-ratio: 4937 / 714; height: auto; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; font: 500 18px/1.2 var(--serif); text-decoration: none; cursor: pointer; border: 1px solid var(--ink); padding: 11px 24px; border-radius: var(--radius); background: var(--ink); color: var(--paper); border-color: var(--btn); background: var(--btn); }
.btn:hover { opacity: .88; }
.btn-link { display: inline-flex; align-items: center; gap: 10px; font: 500 18px/1.2 var(--serif); text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--ink); padding: 4px 0; }
.btn-link:hover { border-bottom-width: 2px; padding-bottom: 3px; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { opacity: 1; background: rgba(22, 22, 22, .06); background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }

/* ---------- Шапка (как sp-ai.ru) ---------- */
.login-mobile { font-size: 14px; color: var(--graphite); text-decoration: none; white-space: nowrap; }
/* Переключатель языка: ссылка на тот же путь на хосте другого языка (graphema.ru ↔ graphema.ai37.tech) */
.lang-switch { flex: none; font: 500 12px/1 var(--sans); letter-spacing: .08em; color: var(--graphite); text-decoration: none; border: 1px solid var(--rule); border-radius: 13px; padding: 6px 9px; }
.lang-switch:hover { color: var(--ink); border-color: var(--ink); }
.site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); background: color-mix(in srgb, var(--paper) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { color: var(--ink); margin-right: auto; position: relative; display: block; }
/* Знак-закладка: при прокрутке надпись ГРАФЕМА сворачивается до Ф, а Ф ложится на закладку, свисающую от верхнего края шапки */
.wm-live { position: relative; z-index: 1; clip-path: inset(0 0 0 0); transition: clip-path .5s cubic-bezier(.2,.7,.2,1), opacity .35s ease .15s; }
.bookmark { position: absolute; left: -6px; top: -19px; width: 40px; height: 58px; padding: 6px 0 18px; display: grid; place-items: center; background: var(--ink); color: var(--paper); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%); transform: translateY(-110%); transition: transform .45s cubic-bezier(.2,.7,.2,1) .1s; }
.bookmark svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.is-scrolled .wm-live { clip-path: inset(0 100% 0 0); opacity: 0; }
.is-scrolled .bookmark { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .wm-live, .bookmark { transition: none; } }

/* Тумблер темы */
.theme-switch { position: relative; width: 48px; height: 26px; border-radius: 13px; border: 1px solid var(--rule); background: var(--surface); padding: 0; cursor: pointer; flex: none; color: var(--graphite); }
.theme-switch .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; transition: transform .25s ease; }
.theme-switch svg { width: 12px; height: 12px; }
.theme-switch .moon { display: none; }
.theme-switch[aria-checked="true"] .knob { transform: translateX(22px); }
.theme-switch[aria-checked="true"] .sun { display: none; }
.theme-switch[aria-checked="true"] .moon { display: block; }
.theme-switch:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.brand .wordmark { width: 150px; }
.nav { display: flex; gap: 24px; }
.nav a, .menu nav a { font-size: 14px; color: var(--graphite); text-decoration: none; }
.nav a:hover, .menu nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { font-weight: 500; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule); background: none; color: var(--graphite); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
.menu { display: none; position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 0; top: 46px; min-width: 220px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 16px; display: flex; flex-direction: column; }
.menu nav a { padding: 10px 0; border-top: 1px solid var(--rule); }
.menu nav a:first-child { border-top: 0; }

/* ---------- Первый экран ---------- */
.hero { box-sizing: border-box; min-height: min(calc(100vh - 61px), 560px); min-height: min(calc(100svh - 61px), 560px); display: flex; flex-direction: column; padding-top: 18px; padding-bottom: 40px; }
.hero-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 64px; align-items: start; align-content: center; padding: 40px 0; }
.hero-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--graphite); }
.hero h1 { font-size: clamp(36px, 4vw, 56px); line-height: 1.02; letter-spacing: -.01em; margin: 0; }
.hero-body { max-width: 540px; padding-top: 6px; }
.hero-body .lead { text-wrap: pretty; }
.hero-body .ctas .btn { white-space: nowrap; }
.hero-body .ctas .btn { flex: 1 1 auto; }
.hero-body .ctas .btn-outline { flex: 0 0 auto; min-width: 200px; }
.hero-body .ctas { gap: 8px; }
.lead { font: 400 19px/1.45 var(--serif); max-width: 620px; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 22px; }

/* ---------- Разделы ---------- */
.section { padding-bottom: 56px; }
.section:first-of-type { margin-top: 32px; }
.section-top { display: grid; grid-template-columns: var(--label) 1fr; gap: var(--gap); border-top: 1px solid var(--ink); padding-top: 20px; }
.index { font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.index b { font-weight: 400; color: var(--ink); margin-right: 6px; }
.section h2, .lead-section h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; max-width: 760px; margin-bottom: 20px; }
.content > * + * { margin-top: 24px; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 48px 300px 1fr; gap: var(--gap); padding: 14px 0; border-top: 1px solid var(--rule); }
.row .num { font-family: var(--sans); font-size: 13px; color: var(--graphite); padding-top: 3px; font-variant-numeric: tabular-nums; }
.row h3 { font-size: 19px; font-weight: 500; line-height: 1.3; }
.row .text { color: var(--graphite); }
.row .text.ink { color: var(--ink); }
.row .vs { display: block; margin-top: 10px; color: var(--graphite); }

/* Таблица-спецификация */
.spec { width: 100%; border-collapse: collapse; }
.spec thead th { font: 500 19px/1.3 var(--serif); text-align: left; padding: 10px 24px 10px 0; border-bottom: 1px solid var(--ink); }
.spec th[scope="row"] { font: 400 11px/1.6 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); text-align: left; width: 200px; padding: 14px 24px 12px 0; vertical-align: top; }
.spec td { padding: 12px 24px 12px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.spec tbody th { border-top: 1px solid var(--rule); }
.spec .price td { font-weight: 500; }
.table-title { color: var(--graphite); }

/* Тарифы: карточки */
.plan-label .plan-group-note { font-size: 14px; color: var(--graphite); margin-top: 10px; max-width: 240px; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.plan { display: flex; flex-direction: column; border-top: 1px solid var(--rule); padding-top: 16px; }
.plan h3 { font-size: 21px; font-weight: 500; line-height: 1.2; font-variant-numeric: lining-nums; }
.plan-price { margin-top: 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan-price b { font: 500 32px/1.1 var(--serif); letter-spacing: -.005em; font-variant-numeric: lining-nums; }
.plan-price span { font-size: 14px; color: var(--graphite); }
.plan-alt { font-size: 14px; color: var(--graphite); margin-top: 4px; min-height: 1.55em; }
.plan-spec { margin: 16px 0 0; }
.plan-spec div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); }
.plan-spec dt { font-size: 14px; color: var(--graphite); }
.plan-spec dd { margin: 0; font-size: 14px; text-align: right; }
.plan-cta { margin-top: 16px; }
.plan-cta .btn { width: 100%; box-sizing: border-box; }

.note { border-left: 2px solid var(--red); padding: 2px 0 2px 18px; font: 400 18px/1.45 var(--serif); max-width: 700px; }
.inline-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.fine { font-size: 14px; color: var(--graphite); max-width: 820px; }

/* ---------- Заявка (тёмный раздел, форма как бланк) ---------- */
.inverse { background: var(--paper); color: var(--ink); }
.inverse { --btn: #FFFFFF; }
.lead-section { padding-bottom: 56px; }
.lead-section .section-top { border-top-color: var(--paper); }
.form .field { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: baseline; border-bottom: 1px solid var(--rule); padding: 10px 0; }
.form label.k { font: 400 11px/1.6 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.form input:not([type="checkbox"]), .form textarea { width: 100%; background: transparent; border: 0; color: var(--ink); font: 400 15px/1.5 var(--sans); padding: 4px 0; resize: vertical; }
.form input::placeholder, .form textarea::placeholder { color: var(--graphite); opacity: .7; }
.form input:focus-visible, .form textarea:focus-visible { outline: none; box-shadow: 0 1px 0 0 var(--ink); }
.consent { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 14px; color: var(--graphite); }
.consent input { appearance: none; width: 16px; height: 16px; border-radius: 3px; border: 1px solid var(--ink); margin: 0; flex: none; display: grid; place-items: center; cursor: pointer; }
.consent input:checked::after { content: ""; width: 8px; height: 8px; background: var(--ink); }
.consent a { color: var(--ink); }
.accept-note { margin-top: 12px; font-size: 12px; color: var(--graphite); }
.accept-note a { color: inherit; }
.consent-note { margin: 8px 0 0 28px; font-size: 13px; color: var(--graphite); }
.consent-note a, .fine a { color: inherit; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 28px; }
.form-actions .muted a { color: inherit; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form-status { margin-top: 16px; font-weight: 500; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--ink); }
.form-status.err { color: var(--red); }

/* ---------- Подвал ---------- */
.site-footer { border-top: 1px solid var(--ink); }
.site-footer .wrap { display: grid; grid-template-columns: var(--label) repeat(4, 1fr); gap: var(--gap); padding-top: 32px; padding-bottom: 40px; }
.site-footer .wordmark { width: 200px; color: var(--ink); }
.site-footer p { font-size: 14px; color: var(--graphite); }
.site-footer a { color: inherit; }

/* ---------- Страница тарифов / служебные ---------- */
.page-head { padding-top: 18px; padding-bottom: 36px; }
.page-head h1 { font-size: clamp(36px, 4vw, 56px); line-height: 1.02; margin-top: 32px; }
.prose { max-width: 760px; }
.prose h2 { font-size: 22px; margin: 32px 0 10px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 4px; }
.prose a { color: var(--ink); }
.doc { max-width: 820px; min-width: 0; overflow-wrap: break-word; }
.doc .doc-meta { color: var(--graphite); font-size: 14px; margin-bottom: 20px; }
.doc-table { overflow-x: auto; margin: 4px 0 16px; }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-top: 1px solid var(--rule); }
.doc-table thead th { font-weight: 500; border-top: 0; border-bottom: 1px solid var(--ink); }
.doc-table tbody th { font-weight: 400; color: var(--graphite); }
.doc-list { list-style: none; padding: 0 !important; margin: 0 0 24px; }
.doc-list li { display: grid; gap: 2px; padding: 14px 0; border-top: 1px solid var(--rule); margin: 0 !important; }
.doc-list li:last-child { border-bottom: 1px solid var(--rule); }
.doc-list a { font: 500 21px/1.25 var(--serif); text-decoration: none; }
.doc-list a:hover { text-decoration: underline; }
.doc-list span { color: var(--graphite); font-size: 14px; }
.hero-meta a { color: inherit; text-decoration: none; }
@media print {
  .site-header, .site-footer, .theme-toggle, .menu { display: none !important; }
  :root { --paper: #fff; --ink: #000; --graphite: #444; --rule: #bbb; }
  body { background: #fff; }
  .page-head { padding-top: 0; }
  .section-top { display: block; border-top: 0; }
  .section-top > span { display: none; }
  .doc-table table { min-width: 0; }
  .doc-table { overflow: visible; }
  a { color: #000; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  :root { --label: 220px; }
  .row { grid-template-columns: 40px 1fr; }
  .row .text { grid-column: 2; }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .site-footer .brand-col { grid-column: 1 / -1; }
}
@media (max-width: 1200px) {
  .hero-body .ctas { display: grid; grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .plans { grid-template-columns: 1fr; gap: 28px; }
  .plan-alt { min-height: 0; }
  .plan-alt:empty { display: none; }
  :root { --pad: 20px; --gap: 16px; }
  .nav { display: none; }
  .menu { display: block; }
  .login-mobile { display: inline; }
  .hero { min-height: 0; padding-bottom: 48px; }
  .hero-main { grid-template-columns: 1fr; row-gap: 24px; padding: 24px 0 0; }
  .hero-meta p + p { display: none; }
  .br-wide { display: none; }
  .section-top { grid-template-columns: 1fr; }
  .lead { font-size: 17px; }
  .section { padding-bottom: 44px; }
  .section-top .index { margin-bottom: 4px; }
  .note { font-size: 17px; }
  .form .field { grid-template-columns: 1fr; gap: 4px; }
  .btn.wide-mobile { width: 100%; }
}
@media (min-width: 901px) { .login-mobile { display: none; } }
@media (max-width: 640px) {
  .spec thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .spec, .spec tbody, .spec tr, .spec th, .spec td { display: block; width: 100%; }
  .spec tr { border-top: 1px solid var(--rule); padding: 12px 0; }
  .spec th[scope="row"], .spec td, .spec tbody th { border: 0; padding: 2px 0; }
  .spec td::before { content: attr(data-label) " — "; color: var(--graphite); }
  .site-footer .wrap { grid-template-columns: 1fr; }
  /* С переключателем языка в шапке на телефоне пять элементов — сжимаем промежутки, чтобы меню не уезжало за край */
  .site-header .wrap { gap: 12px; }
}
@media (max-width: 370px) {
  .brand .wordmark { width: 120px; }
}
