/* /book — Structural Blueprint. Fonts are self-hosted (see /fonts); never add Google Fonts. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-400-cyrillic.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-400-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-400-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;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-500-cyrillic.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-500-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-500-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;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-condensed-600-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-condensed-600-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;
}
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-condensed-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-condensed-700-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-condensed-700-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;
}
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-condensed-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-cyrillic.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-400-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-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;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #111316;
  --surface: #1c2024;
  --text: #e4e2dc;
  --muted: #9ba0a6;
  --line: #5b6672;
  --accent: #e0995c;
  --accent-hover: #f0ad72;
  --accent-active: #c97d42;
  --link: #5b8dbf;
  --link-hover: #7ba6d1;
  --error: #c4544a;
  --error-text: #e8837a; /* светлее #C4544A: контраст текста ≥ AA на тёмном фоне */
  --success: #7fa876;
  --disabled-bg: #3a3f45;
  --disabled-text: #6b7178;

  --font-d: 'IBM Plex Sans Condensed', 'IBM Plex Sans', system-ui, sans-serif;
  --font-b: 'IBM Plex Sans', system-ui, sans-serif;
  --font-m: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  color: var(--text);
  font: 400 15px/1.65 var(--font-b);
}

h1, h2, h3 { font-family: var(--font-d); font-weight: 700; margin: 0; color: var(--text); }
h1 { font-size: clamp(34px, 9vw, 52px); line-height: 1.1; }
h2 { font-size: clamp(27px, 6.5vw, 38px); line-height: 1.15; }
h3 { font-size: clamp(21px, 4.5vw, 26px); line-height: 1.25; font-weight: 600; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding-top: 48px; padding-bottom: 72px; }
.lead { color: var(--muted); font-size: 17px; max-width: 560px; margin: 16px 0 40px; }
.muted { color: var(--muted); }

.caption {
  font: 500 11px/1.4 var(--font-m);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.mono { font: 400 13px/1.5 var(--font-m); color: var(--muted); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  background: var(--accent); color: var(--bg); padding: 8px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* header / brand */
.site-header { border-bottom: 1px solid #2a2d31; }
.header-row { display: flex; align-items: center; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__mark { width: 40px; height: 40px; flex: none; display: block; }
.nowrap { white-space: nowrap; }
.brand__name { font: 700 18px/1 var(--font-d); letter-spacing: 0.06em; }
.site-footer { border-top: 1px solid #2a2d31; padding: 20px 0; }

/* form layout */
.form { display: grid; gap: 28px; }
.group { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 20px; }
.group legend { padding: 0; margin-bottom: 16px; font: 600 26px/1.25 var(--font-d); }
@media (max-width: 600px) { .group legend { font-size: 22px; } }

/* Dimension mark 2: разделитель с засечками и подписью */
.divider { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.divider__line { position: relative; flex: 1; height: 9px; border-left: 1px solid var(--line); }
.divider__line::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.divider__line--end { border-left: 0; border-right: 1px solid var(--line); }

/* fields */
.field { display: grid; gap: 8px; }
label, .label { font-weight: 500; }
.opt { font: 400 11px var(--font-m); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-left: 6px; }
.hint { color: var(--muted); font-size: 13px; }
.field__meta { display: flex; justify-content: space-between; gap: 12px; }

input[type='text'], input[type='email'], input[type='tel'], textarea, select {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 11px 12px;
  font: 400 16px/1.5 var(--font-b); /* 16px: iOS не зумит поле */
  transition: border-color 120ms var(--ease);
}
textarea { resize: vertical; min-height: 140px; }
input::placeholder, textarea::placeholder { color: #8a9097; }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
[aria-invalid='true'] { border-color: var(--error) !important; }
.error { margin: 0; color: var(--error-text); font-size: 14px; }
.error::before { content: '× '; font-family: var(--font-m); }

select { appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; }

/* honeypot */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* radio cards + Dimension mark 1 */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 2px;
  padding: 20px; cursor: pointer; font-weight: 400;
  transition: border-color 200ms var(--ease);
}
.card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.card__top { display: flex; align-items: center; gap: 10px; }
.card__text { color: var(--text); flex: 1; }
.radio-dot { width: 14px; height: 14px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; }
.card:has(input:checked) { border-color: var(--accent); }
.card:has(input:checked) .radio-dot { border-color: var(--accent); }
.card:has(input:checked) .radio-dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.card::before, .card::after {
  content: ''; position: absolute; width: 11px; height: 11px; opacity: 0; pointer-events: none;
  transition: opacity 200ms var(--ease);
}
.card::before { top: -1px; left: -1px; border-top: 1px solid var(--accent); border-left: 1px solid var(--accent); }
.card::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--accent); border-right: 1px solid var(--accent); }
.card:hover::before, .card:hover::after,
.card:has(input:focus-visible)::before, .card:has(input:focus-visible)::after { opacity: 1; }
.card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

/* цена в карточке платного разбора */
.price { display: inline-flex; align-items: baseline; gap: 10px; }
.price__old { font: 400 13px/1.4 var(--font-m); color: var(--muted); text-decoration: line-through; }
.price__new { font: 500 15px/1.4 var(--font-m); color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* channel segmented radios */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label { position: relative; font-weight: 400; }
.segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 9px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 2px; transition: border-color 120ms var(--ease), color 120ms var(--ease); }
.segmented label:hover span { border-color: var(--muted); }
.segmented input:checked + span { border-color: var(--accent); color: var(--accent); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

/* checkbox */
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin: 2px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 2px; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ''; width: 5px; height: 10px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* buttons / alert */
.btn {
  appearance: none; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--accent); color: var(--bg); padding: 14px 28px;
  font: 600 16px/1.2 var(--font-b); width: 100%;
  transition: background-color 120ms var(--ease);
}
@media (min-width: 640px) { .btn { width: auto; justify-self: start; } }
.btn:hover { background: var(--accent-hover); }
.btn:active { background: var(--accent-active); }
.btn:disabled { background: var(--disabled-bg); color: var(--disabled-text); cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 10px 20px; width: auto; }
.btn--ghost:hover { background: transparent; color: var(--accent-hover); border-color: var(--accent-hover); }
.alert { border: 1px solid var(--error); border-left-width: 3px; background: var(--surface); padding: 16px 18px; display: grid; gap: 12px; justify-items: start; }
.alert p { margin: 0; color: var(--text); }
.turnstile { min-height: 65px; }

/* confirmation */
.panel { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--success); border-radius: 2px; padding: 28px; display: grid; gap: 12px; }
.panel .caption { color: var(--success); }
.panel h2:focus { outline: none; }
.confirm__text { margin: 0; font-size: 18px; }
.panel p.muted { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

[hidden] { display: none !important; }
.error[hidden] { display: none; }

/* юридическая страница (/privacy/) */
.legal .legal__meta { margin: 12px 0 0; }
.legal .legal__meta + .legal__meta { margin-top: 4px; }
.legal section { margin-top: 36px; }
.legal h2 { font-size: clamp(21px, 4.5vw, 26px); line-height: 1.25; font-weight: 600; margin-bottom: 12px; }
.legal p { margin: 0 0 12px; max-width: 70ch; }
.legal ul { margin: 0 0 12px; padding-left: 20px; max-width: 70ch; }
.legal li { margin-bottom: 6px; }
.legal li::marker { color: var(--accent); }
