/* RGB-Аналитика — «нео-пергамент»: тёплая бумага, мягкий неоморфный объём, чернильные акценты от руки */

:root {
  --paper: #ece3cf;
  --card: #efe7d5;
  --well: #e6dcc5;
  --sh-d: rgba(124, 96, 58, .30);
  --sh-l: rgba(255, 251, 240, .92);
  --ink: #2a2017;
  --ink-soft: #6c5b47;
  --ink-faint: rgba(42, 32, 23, .22);
  /* Палитра выведена нашим же движком для ЦА сайта (ЛПР + маркетологи, трафик, дизайнеры):
     слой доверия — синий + коричневый, слой конверсии — красный (только на кнопках действия). */
  --accent: #2b508f;          /* синие чернила — бренд, компетентность */
  --accent-soft: rgba(43, 80, 143, .12);
  --accent-2: #815e43;        /* коричневый — надёжность, вторичный акцент */
  --cta: #c72137;             /* красный — только призывы к действию */
  --cta-2: #9f1a2c;
  --cta-soft: rgba(199, 33, 55, .12);
  --error-color: #b3261e;
  --warning-color: #b26b00;
  --text-muted-color: var(--ink-soft);
  --orb-blend: multiply;
  --grain-opacity: .38;
  --glow-1: rgba(255, 246, 222, .55);
  --glow-2: rgba(140, 100, 50, .14);
  /* синий фон страницы (основной цвет по расчёту для ЦА, ~60%) */
  --bg: #284b86;
  --bg-glow: rgba(120, 165, 235, .38);
  --bg-deep: rgba(10, 24, 56, .55);
  --bg-sh-d: rgba(7, 18, 44, .45);
  --on-bg: #f4ecdb;
  --on-bg-soft: rgba(244, 236, 219, .78);
  --on-bg-faint: rgba(244, 236, 219, .22);
  --on-bg-accent: #c4d8fa;
  --grain-bg: .22;
  --raise-bg: 12px 14px 30px rgba(7, 18, 44, .42), -6px -6px 18px rgba(140, 180, 245, .14);
  --raise-bg-sm: 5px 6px 14px rgba(7, 18, 44, .38), -3px -3px 10px rgba(140, 180, 245, .12);

  --f-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --f-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-hand: 'Caveat', 'Segoe Print', cursive;
  --font-family: var(--f-body);

  --r: 22px;
  --sketch: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --raise: 9px 9px 20px var(--sh-d), -9px -9px 20px var(--sh-l);
  --raise-sm: 4px 4px 10px var(--sh-d), -4px -4px 10px var(--sh-l);
  --press: inset 4px 4px 9px var(--sh-d), inset -4px -4px 9px var(--sh-l);
  --ease: cubic-bezier(.22, .9, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1d1913;
    --card: #221d17;
    --well: #1a1611;
    --sh-d: rgba(0, 0, 0, .55);
    --sh-l: rgba(255, 228, 180, .045);
    --ink: #ecdfc6;
    --ink-soft: #a8977d;
    --ink-faint: rgba(236, 223, 198, .18);
    --accent: #92b2e8;
    --accent-soft: rgba(146, 178, 232, .14);
    --accent-2: #c9a27e;
    --cta: #e5455a;
    --cta-2: #b52c3f;
    --cta-soft: rgba(229, 69, 90, .16);
    --error-color: #ff8a80;
    --warning-color: #ffb74d;
    --orb-blend: screen;
    --grain-opacity: .22;
    --glow-1: rgba(255, 210, 150, .05);
    --glow-2: rgba(0, 0, 0, .35);
    --paper: #131d33;
    --card: #19253e;
    --well: #141f35;
    --sh-d: rgba(0, 0, 0, .5);
    --sh-l: rgba(150, 185, 255, .05);
    --bg: #0f1a2f;
    --bg-glow: rgba(70, 110, 190, .28);
    --bg-deep: rgba(0, 0, 0, .45);
    --bg-sh-d: rgba(0, 0, 0, .5);
    --on-bg: #ece3d0;
    --on-bg-soft: rgba(236, 227, 208, .74);
    --on-bg-faint: rgba(236, 227, 208, .18);
    --on-bg-accent: #a9c4f2;
    --grain-bg: .16;
    --raise-bg: 12px 14px 30px rgba(0, 0, 0, .5), -5px -5px 16px rgba(120, 160, 240, .06);
    --raise-bg-sm: 5px 6px 14px rgba(0, 0, 0, .45), -3px -3px 10px rgba(120, 160, 240, .05);
  }
}
:root[data-theme="dark"] {
  --paper: #1d1913;
  --card: #221d17;
  --well: #1a1611;
  --sh-d: rgba(0, 0, 0, .55);
  --sh-l: rgba(255, 228, 180, .045);
  --ink: #ecdfc6;
  --ink-soft: #a8977d;
  --ink-faint: rgba(236, 223, 198, .18);
  --accent: #92b2e8;
  --accent-soft: rgba(146, 178, 232, .14);
  --accent-2: #c9a27e;
  --cta: #e5455a;
  --cta-2: #b52c3f;
  --cta-soft: rgba(229, 69, 90, .16);
  --error-color: #ff8a80;
  --warning-color: #ffb74d;
  --orb-blend: screen;
  --grain-opacity: .22;
  --glow-1: rgba(255, 210, 150, .05);
  --glow-2: rgba(0, 0, 0, .35);
  --paper: #131d33;
  --card: #19253e;
  --well: #141f35;
  --sh-d: rgba(0, 0, 0, .5);
  --sh-l: rgba(150, 185, 255, .05);
  --bg: #0f1a2f;
  --bg-glow: rgba(70, 110, 190, .28);
  --bg-deep: rgba(0, 0, 0, .45);
  --bg-sh-d: rgba(0, 0, 0, .5);
  --on-bg: #ece3d0;
  --on-bg-soft: rgba(236, 227, 208, .74);
  --on-bg-faint: rgba(236, 227, 208, .18);
  --on-bg-accent: #a9c4f2;
  --grain-bg: .16;
  --raise-bg: 12px 14px 30px rgba(0, 0, 0, .5), -5px -5px 16px rgba(120, 160, 240, .06);
  --raise-bg-sm: 5px 6px 14px rgba(0, 0, 0, .45), -3px -3px 10px rgba(120, 160, 240, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { interpolate-size: allow-keywords; }
/* подложка шапки шириной 100vw не должна давать горизонтальную прокрутку */
html, body { overflow-x: clip; }

html {
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 80% at 15% 0%, var(--glow-1), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, var(--glow-2), transparent 65%);
  background-attachment: fixed;
  min-height: 100%;
}

body {
  font-family: var(--f-body);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(16px, 4vw, 48px) 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* бумажное зерно */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .34  0 0 0 0 .2  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection { background: var(--accent); color: #fff8ee; }

a { color: var(--accent-2); text-underline-offset: 3px; }

.container {
  position: relative; z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: 560px;
  transition: max-width .6s var(--ease);
}
body.wide .container { max-width: 1140px; }

.form-card {
  background: var(--card);
  border-radius: calc(var(--r) + 6px);
  padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--raise);
  position: relative;
}
/* карандашная рамка поверх неоморфного объёма */
.form-card::after {
  content: '';
  position: absolute; inset: 10px;
  border: 1.5px solid var(--ink-faint);
  border-radius: var(--sketch);
  pointer-events: none;
}

/* ---------- Шапка ---------- */
.title-container {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 6px;
}
.rgb-orb { width: 48px; height: 48px; flex-shrink: 0; }
.theme-btn { position: absolute; top: 20px; right: 20px; z-index: 2; font-size: .95rem; }
.theme-btn::before { content: '☾'; }
:root[data-theme="dark"] .theme-btn::before { content: '☀'; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn::before { content: '☀'; } }
.rgb-orb circle, .loading-orb circle { mix-blend-mode: var(--orb-blend); opacity: .9; }
.orb-spin { transform-origin: 50% 52%; animation: orb 18s linear infinite; }
@keyframes orb { to { transform: rotate(360deg); } }

h1, .brand-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1;
  letter-spacing: .01em;
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 40%, var(--accent) 50%, var(--ink) 60%, var(--ink) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: ink-sheen 9s ease-in-out infinite;
}
@keyframes ink-sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

.tagline {
  text-align: center;
  font-family: var(--f-hand);
  font-size: 1.35rem;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

/* совместимость со старой разметкой (about.html, подсказки) */
.neon-glow-text { color: var(--accent); }

/* ---------- Форма ---------- */
.profile-form { display: flex; flex-direction: column; gap: 22px; }
.form-group { display: flex; flex-direction: column; }
.label-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

label {
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.help-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--ink-soft);
  box-shadow: var(--raise-sm);
  font: 700 .85rem/1 var(--f-body);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: box-shadow .2s, color .2s, transform .2s;
}
.help-btn:hover { color: var(--accent); transform: translateY(-1px); }
.help-btn:active { box-shadow: var(--press); transform: none; }

input[type="text"], textarea {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 16px;
  background: var(--well);
  box-shadow: var(--press);
  color: var(--ink);
  font: 500 1rem/1.5 var(--f-body);
  transition: box-shadow .25s;
}
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: .65; }
input[type="text"]:focus, textarea:focus {
  outline: none;
  box-shadow: var(--press), 0 0 0 2px var(--accent-soft), 0 0 0 1px var(--accent);
}
textarea { resize: vertical; min-height: 104px; }
.char-counter { text-align: right; font-size: .78rem; color: var(--ink-soft); margin-top: 6px; font-variant-numeric: tabular-nums; }

.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-item { cursor: pointer; }
.radio-item input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.radio-item span {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--raise-sm);
  font-weight: 600; font-size: .92rem;
  color: var(--ink-soft);
  transition: box-shadow .25s var(--ease), color .2s, transform .2s;
}
.radio-item:hover span { color: var(--ink); }
.radio-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.radio-item input:checked + span {
  box-shadow: var(--press);
  color: var(--accent);
  transform: scale(.98);
}

.submit-btn {
  position: relative; overflow: hidden;
  height: 56px;
  border: none; border-radius: 18px;
  background: linear-gradient(145deg, var(--cta), var(--cta-2));
  color: #fff6ea;
  font: 700 1.05rem var(--f-body);
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 6px 6px 16px var(--sh-d), -6px -6px 16px var(--sh-l), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.submit-btn::before { /* блик */
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-18deg);
  transition: left .7s var(--ease);
}
.submit-btn:hover:not(:disabled)::before { left: 120%; }
.submit-btn:hover:not(:disabled) { filter: brightness(1.05); }
.submit-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 3px 3px 8px rgba(0, 0, 0, .3); }
.submit-btn:disabled { cursor: wait; filter: saturate(.6) brightness(.95); }

.btn-text, .btn-loading { transition: opacity .3s; }
.btn-loading { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 10px; opacity: 0; }
.submit-btn.loading .btn-text { opacity: 0; }
.submit-btn.loading .btn-loading { opacity: 1; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Загрузка: шар крутится-вертится ---------- */
.loading-box {
  display: grid; justify-items: center; gap: 10px;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .5s var(--ease), opacity .4s, margin .4s;
}
.loading-box.show { max-height: 220px; opacity: 1; margin-top: 26px; }
.loading-orb { width: 86px; height: 86px; filter: drop-shadow(4px 6px 8px var(--sh-d)); }
.loading-box.show .orb-spin { animation-duration: 2.4s; }
.loading-box.show .loading-orb { animation: bob 1.2s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-6px); } }
.loading-lyrics {
  font-family: var(--f-hand);
  font-size: 1.6rem;
  color: var(--ink-soft);
  min-height: 2.2rem;
  text-align: center;
  transition: opacity .35s, filter .35s, transform .35s;
}
.loading-lyrics.swap { opacity: 0; filter: blur(4px); transform: translateY(6px); }

/* ---------- Ошибки ---------- */
.is-invalid { box-shadow: var(--press), 0 0 0 1.5px var(--error-color) !important; }
.radio-item.is-invalid span { color: var(--error-color); box-shadow: var(--raise-sm), 0 0 0 1.5px var(--error-color); }
.validation-error {
  display: none;
  color: var(--error-color);
  background: color-mix(in srgb, var(--error-color) 8%, transparent);
  border: 1.5px dashed color-mix(in srgb, var(--error-color) 45%, transparent);
  border-radius: var(--sketch);
  padding: 12px 16px;
  font-size: .92rem;
  text-align: center;
  animation: shake .4s;
}
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- Результат ---------- */
.result-container { display: none; }
.result-container.show { display: block; }

.report { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
#result-content, .profile-result { min-width: 0; }

.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--raise-sm);
  position: relative;
  min-width: 0;
  animation: rise .7s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms + 100ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } }

.report-head {
  padding: 26px 28px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--card) 85%, #fff 15%), var(--card));
}
.report-kicker { font-family: var(--f-hand); font-size: 1.25rem; color: var(--accent); }
.report-title {
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1.1;
  margin: 2px 0 14px;
}
.report-title .arrow { color: var(--accent); font-style: italic; padding: 0 .2em; }
.report-task { color: var(--ink-soft); font-style: italic; margin-top: 12px; max-width: 70ch; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: var(--press);
  font-size: .85rem; font-weight: 600;
  color: var(--ink-soft);
}
.chip b { color: var(--ink); }
.chip.accent { color: var(--accent); background: var(--accent-soft); box-shadow: none; }

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}
.report-grid .span-2 { grid-column: 1 / -1; }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-title {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  flex: 1;
  position: relative;
  padding-bottom: 6px;
}
/* чернильное подчёркивание, прорисовывается при появлении */
.card-title::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 4.5em; height: 8px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8' preserveAspectRatio='none'><path d='M2 5 C 30 1, 60 7, 118 3' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/></svg>") no-repeat left / 100% 100%;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8' preserveAspectRatio='none'><path d='M2 5 C 30 1, 60 7, 118 3' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/></svg>") no-repeat left / 100% 100%;
  clip-path: inset(0 100% 0 0);
  animation: draw-line .9s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 80ms + 450ms);
}
@keyframes draw-line { to { clip-path: inset(0 0 0 0); } }
.card-hint { font-size: .86rem; color: var(--ink-soft); margin: -6px 0 16px; line-height: 1.5; }
.card-icon { font-size: 1.15rem; opacity: .85; }

.muted { color: var(--ink-soft); font-weight: 400; }
.small { font-size: .82rem; }
.note { font-size: .82rem; color: var(--ink-soft); margin-top: 12px; }

/* шкалы */
.scale-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(90px, 1.6fr) 2.4em;
  align-items: center; gap: 12px;
  margin: 9px 0;
}
.scale-label { font-size: .9rem; font-weight: 500; }
.scale-track {
  height: 10px; border-radius: 999px;
  background: var(--well); box-shadow: inset 2px 2px 4px var(--sh-d), inset -2px -2px 4px var(--sh-l);
  overflow: hidden;
}
.scale-fill {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform-origin: left;
  animation: grow 1.1s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms + 300ms);
}
@keyframes grow { from { transform: scaleX(0); } }
.scale-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* стратегия */
.strategy-row { padding: 12px 0; border-bottom: 1.5px dashed var(--ink-faint); }
.strategy-row:last-child { border-bottom: none; }
.strategy-label { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.strategy-value { font-weight: 700; font-size: 1.05rem; margin-top: 2px; }
.dots { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.dots i.on { background: var(--accent); }

/* цвета */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.swatch {
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--raise-sm);
  padding: 10px;
  cursor: copy;
  border: none; text-align: left; color: inherit; font: inherit;
  transition: transform .2s;
}
.swatch:hover { transform: translateY(-2px); }
.swatch-fill {
  height: 110px; border-radius: 12px;
  position: relative; overflow: hidden;
  clip-path: circle(0% at 30% 40%);
  animation: blot 1s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 80ms + 350ms);
}
.swatch-fill::after { /* лёгкая фактура краски */
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 20% 10%, rgba(255, 255, 255, .25), transparent 55%), radial-gradient(100% 80% at 90% 100%, rgba(0, 0, 0, .18), transparent 60%);
}
@keyframes blot { to { clip-path: circle(150% at 30% 40%); } }
.swatch-meta { padding: 10px 4px 2px; }
.swatch-name { font-weight: 700; }
.swatch-hex { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .88rem; }
.swatch-role { font-family: var(--f-hand); font-size: 1.15rem; color: var(--accent); line-height: 1; }

/* фигуры */
.shapes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shape {
  display: grid; justify-items: center; align-content: start; text-align: center; gap: 6px;
  padding: 14px 10px;
  border-radius: 18px;
  background: var(--well);
  box-shadow: var(--press);
}
.shape svg { width: 92px; height: 92px; overflow: visible; }
.shape path {
  fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.4s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 80ms + 400ms);
}
.shape path.echo { stroke: var(--accent); stroke-width: 1.6; opacity: .7; animation-delay: calc(var(--i, 0) * 80ms + 700ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.shape-name { font-family: var(--f-display); font-size: 1.35rem; font-weight: 700; text-transform: capitalize; }
.shape-role { font-family: var(--f-hand); font-size: 1.1rem; color: var(--accent); line-height: 1; }
.shape-desc { font-size: .82rem; color: var(--ink-soft); }

/* TOV */
.stamps { display: flex; flex-wrap: wrap; gap: 10px; }
.stamp {
  padding: 6px 14px;
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: var(--sketch);
  font-family: var(--f-hand);
  font-size: 1.45rem; font-weight: 700; line-height: 1.1;
  transform: rotate(var(--tilt, -2deg));
  animation: stamp .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms + var(--d, 0ms) + 350ms);
}
@keyframes stamp { from { opacity: 0; transform: scale(1.6) rotate(var(--tilt, -2deg)); } }

/* драйверы */
.drivers { display: grid; gap: 14px; counter-reset: drv; }
.driver { display: grid; grid-template-columns: 2.2rem 1fr; gap: 10px; align-items: start; }
.driver::before {
  counter-increment: drv; content: counter(drv);
  font-family: var(--f-hand); font-size: 2rem; line-height: 1; color: var(--accent);
  text-align: center;
}
.driver-name { font-weight: 700; }
.driver-phrase { color: var(--ink); }
.driver-principle { font-size: .8rem; color: var(--ink-soft); }

.card.method { padding: 6px; }
.tov-scales { margin-top: 20px; display: grid; gap: 14px; }
.pole-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 1.4fr) minmax(0, 1fr); align-items: center; gap: 12px; }
.pole { font-size: .88rem; color: var(--ink-soft); }
.pole:first-child { text-align: right; }
.pole.on { color: var(--ink); font-weight: 700; }
.pole-track {
  position: relative; height: 10px; border-radius: 999px;
  background: var(--well); box-shadow: inset 2px 2px 4px var(--sh-d), inset -2px -2px 4px var(--sh-l);
}
.pole-track::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1.5px; background: var(--ink-faint); }
.pole-mark {
  position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 2px 2px 5px var(--sh-d), inset 0 1px 0 rgba(255, 255, 255, .35);
  animation: slide-in 1.1s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms + 400ms);
}
@keyframes slide-in { from { left: 50%; opacity: 0; } }

/* спойлеры */
details > summary { list-style: none; cursor: pointer; user-select: none; }
details > summary::-webkit-details-marker { display: none; }
details::details-content {
  block-size: 0; overflow: hidden;
  transition: block-size .45s var(--ease), content-visibility .45s allow-discrete;
}
details[open]::details-content { block-size: auto; }

.mini-spoiler { margin-top: 14px; }
.mini-spoiler > summary { font-size: .85rem; font-weight: 600; color: var(--accent-2); display: inline-flex; gap: 6px; align-items: center; }
.mini-spoiler > summary::before { content: '＋'; transition: transform .3s; display: inline-block; }
.mini-spoiler[open] > summary::before { transform: rotate(45deg); }

.section-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.prompt-spoiler {
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--raise-sm);
  margin-top: 14px;
  transition: box-shadow .3s;
}
.prompt-spoiler[open] { box-shadow: var(--press); }
.prompt-spoiler > summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.prompt-spoiler > summary::before {
  content: ''; width: 9px; height: 9px; flex-shrink: 0;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg); transition: transform .3s var(--ease);
}
.prompt-spoiler[open] > summary::before { transform: rotate(45deg); }
.prompt-title { font-weight: 700; flex: 1; }
.prompt-body { padding: 0 18px 18px; }
.prompt-text {
  white-space: pre-wrap; word-break: break-word;
  font-size: .9rem; line-height: 1.65;
  color: var(--ink);
  padding: 16px 18px;
  border-radius: 14px;
  background:
    repeating-linear-gradient(transparent 0 calc(1.65em - 1px), var(--ink-faint) calc(1.65em - 1px) 1.65em) 0 16px / 100% 1.65em,
    var(--well);
  max-height: 460px; overflow: auto;
}
.why-row { padding: 8px 0; border-bottom: 1px dashed var(--ink-faint); font-size: .9rem; }
.why-row:last-of-type { border-bottom: none; }

.copy-btn {
  border: none; border-radius: 999px;
  padding: 8px 16px;
  background: var(--card);
  box-shadow: var(--raise-sm);
  color: var(--accent);
  font: 700 .85rem var(--f-body);
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.copy-btn:hover { transform: translateY(-1px); }
.copy-btn:active, .copy-btn.done { box-shadow: var(--press); transform: none; }

.result-actions { display: flex; gap: 18px; margin-top: 30px; }
.result-actions button {
  flex: 1; height: 52px;
  border: none; border-radius: 16px;
  font: 700 1rem var(--f-body);
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.back-btn { background: var(--card); color: var(--ink-soft); box-shadow: var(--raise-sm); }
.back-btn:hover { color: var(--ink); }
.back-btn:active { box-shadow: var(--press); }
.download-btn { background: linear-gradient(145deg, #3a5c83, #28425f); color: #f3ead8; box-shadow: var(--raise-sm); }
.download-btn:active { transform: translateY(1px); }

.footnote { text-align: center; font-size: .78rem; color: var(--ink-soft); margin-top: 26px; }

/* ---------- Подсказки ---------- */
.tooltip-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; justify-content: center; align-items: center;
  background: rgba(40, 28, 15, .35);
  backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s, visibility .3s;
  padding: 16px;
}
.tooltip-modal.show { opacity: 1; visibility: visible; }
.tooltip-content {
  background: var(--card);
  padding: 30px 28px 24px;
  border-radius: var(--r);
  max-width: 460px; width: 100%;
  max-height: 85vh; overflow: auto;
  position: relative;
  box-shadow: var(--raise);
  font-size: .95rem;
  transform: translateY(14px) scale(.97);
  transition: transform .35s var(--ease);
}
.tooltip-modal.show .tooltip-content { transform: none; }
.tooltip-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--card); box-shadow: var(--raise-sm);
  font-size: 1.3rem; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.tooltip-close:active { box-shadow: var(--press); }
.tooltip-link {
  display: block; margin-top: 16px; padding: 10px;
  text-align: center; text-decoration: none; font-weight: 700;
  border-radius: 14px; box-shadow: var(--raise-sm);
}
.tooltip-link:active { box-shadow: var(--press); }

/* ---------- about.html ---------- */
.accordion-item {
  border-bottom: 1.5px dashed var(--ink-faint);
  display: grid; grid-template-rows: auto 0fr;
  transition: grid-template-rows .4s var(--ease);
}
.accordion-item:first-child { border-top: 1.5px dashed var(--ink-faint); }
.accordion-header {
  width: 100%; background: none; border: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 8px; cursor: pointer; text-align: left;
  font: 700 1.3rem var(--f-display); color: var(--ink);
}
.accordion-header:hover { color: var(--accent); }
.accordion-icon { width: 12px; height: 12px; position: relative; transition: transform .3s; flex-shrink: 0; }
.accordion-icon::before, .accordion-icon::after { content: ''; position: absolute; background: var(--accent); border-radius: 2px; }
.accordion-icon::before { width: 100%; height: 2px; top: 5px; }
.accordion-icon::after { height: 100%; width: 2px; left: 5px; }
.accordion-content { overflow: hidden; color: var(--ink-soft); padding: 0 8px; overflow-wrap: break-word; }
.accordion-content > *:last-child { padding-bottom: 20px; }
.accordion-item.active { grid-template-rows: auto 1fr; }
.accordion-item.active > .accordion-header { color: var(--accent); }
.accordion-item.active > .accordion-header .accordion-icon { transform: rotate(135deg); }
.sub-accordion-container { padding: 12px 0 4px; }
.sub-accordion-item { margin-top: 12px; }
.sub-accordion-item:first-child { margin-top: 0; border-top: none !important; }
.sub-accordion-header { font-size: 1.1rem !important; padding: 14px 0 !important; }
.sub-accordion-content { padding: 0 0 0 14px !important; }
.accordion-content p, .accordion-content ul, .accordion-content h4, .accordion-content h5 { margin-bottom: 1em; line-height: 1.7; }
.accordion-content h4 { font-size: 1.1rem; color: var(--accent); }
.accordion-content h5 { font-size: 1rem; color: var(--ink); }
.accordion-content b, .accordion-content strong { color: var(--ink); }
.accordion-content ul { padding-left: 20px; }
.accordion-content li { margin-bottom: .5em; }
.accordion-content i, .accordion-content em { display: block; margin: -.5em 0 1em; font-size: .9em; }
.quote-block { border-left: 3px solid var(--accent); padding-left: 15px; margin: 20px 0; font-family: var(--f-display); font-size: 1.15rem; font-style: italic; }
.about-content { line-height: 1.7; }
.about-back-link {
  display: flex; align-items: center; justify-content: center;
  height: 52px; margin-top: 30px;
  border-radius: 16px; background: var(--card); box-shadow: var(--raise-sm);
  color: var(--ink-soft); font-weight: 700; text-decoration: none;
  transition: color .2s;
}
.about-back-link:hover { color: var(--accent); }
.about-back-link:active { box-shadow: var(--press); }

/* ---------- Адаптив ---------- */
@media (max-width: 820px) {
  .report-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body { padding-inline: 10px; }
  .form-card { padding: 22px 14px; }
  .form-card::after { inset: 6px; }
  .report, .report-grid { gap: 18px; }
  .scale-row { grid-template-columns: minmax(0, 1fr) minmax(60px, 1fr) 2em; }
  .pole-row { grid-template-columns: minmax(0, 1fr) minmax(60px, 1fr) minmax(0, 1fr); gap: 8px; }
  .pole { font-size: .8rem; overflow-wrap: anywhere; }
  .card { padding: 18px; }
  .report-head { padding: 20px; }
  .result-actions { flex-direction: column; gap: 14px; }
  .shapes { gap: 10px; }
  .shape svg { width: 72px; height: 72px; }
  .title-container { padding-inline: 26px; gap: 10px; }
  .title-container .help-btn { display: none; }
  .rgb-orb { width: 38px; height: 38px; }
  .theme-btn { top: 14px; right: 14px; }
  .prompt-spoiler > summary { padding: 14px; gap: 10px; }
  .prompt-spoiler > summary .help-btn { display: none; }
  .prompt-body { padding: 0 10px 12px; }
  .prompt-text { padding: 12px; }
}

/* =================================================================== */
/* ======================  САЙТ: каркас и главная  =================== */
/* =================================================================== */

body.site { display: block; padding: 0; }
body.site .container { margin: clamp(20px, 4vw, 40px) auto clamp(40px, 6vw, 72px); padding-inline: 16px; box-sizing: content-box; }
body.site.wide .container { max-width: 1140px; }
.site-main { position: relative; z-index: 1; min-height: 60vh; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 32px); }

/* шапка */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  max-width: 1180px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 32px) 14px;
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.site-header::before { /* фон шапки на всю ширину окна */
  content: ''; position: absolute; inset: 0 calc(50% - 50vw);
  background: transparent; transition: background .3s, box-shadow .3s; z-index: -1;
}
.site-header.scrolled::before {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px var(--sh-d);
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo span { font: 700 1.45rem/1 var(--f-display); }
.logo .rgb-orb { width: 34px; height: 34px; }
.site-nav { display: flex; gap: 6px; margin-left: auto; }
.site-nav a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: color .2s, box-shadow .25s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: var(--press); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.site-header .theme-btn { position: static; }
.nav-toggle { display: none; font-size: 1rem; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 26px; border-radius: 16px;
  font: 700 1rem var(--f-body); text-decoration: none; cursor: pointer; border: none;
  transition: transform .15s, box-shadow .2s, filter .2s, color .2s;
  position: relative; overflow: hidden;
}
.btn-sm { height: 40px; padding: 0 18px; font-size: .9rem; border-radius: 12px; }
.btn-primary {
  background: linear-gradient(145deg, var(--cta), var(--cta-2)); color: #fff6ea;
  box-shadow: 6px 6px 16px var(--sh-d), -6px -6px 16px var(--sh-l), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary::before {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .3), transparent);
  transform: skewX(-18deg); transition: left .7s var(--ease);
}
.btn-primary:hover::before { left: 120%; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--card); color: var(--ink); box-shadow: var(--raise-sm); }
.btn-ghost:hover { color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-ghost:active { box-shadow: var(--press); }

/* подвал */
.site-footer { position: relative; z-index: 1; margin-top: 40px; padding: 40px 0 calc(28px + env(safe-area-inset-bottom, 0px)); }
.footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 32px) 0;
  border-top: 1.5px dashed var(--ink-faint);
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px 40px;
}
.footer-brand p { color: var(--ink-soft); margin-top: 10px; max-width: 40ch; font-size: .92rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: flex-end; align-content: start; }
.footer-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--accent); }
.site-footer .footnote { grid-column: 1 / -1; text-align: left; margin-top: 4px; }

/* появление при прокрутке */
.reveal { opacity: 0; transform: translateY(22px); filter: blur(6px); transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; filter: none; }
.features .reveal:nth-child(2), .steps .reveal:nth-child(2) { transition-delay: .1s; }
.features .reveal:nth-child(3), .steps .reveal:nth-child(3) { transition-delay: .2s; }
.features .reveal:nth-child(4) { transition-delay: .3s; }

/* секции */
.section { padding-block: clamp(48px, 8vw, 96px); position: relative; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto clamp(28px, 5vw, 52px); }
.kicker { font-family: var(--f-hand); font-size: 1.45rem; color: var(--accent); line-height: 1.1; margin-bottom: 6px; }
.section-title { font-family: var(--f-display); font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.05; font-weight: 700; }
.section-lead { color: var(--ink-soft); margin-top: 14px; font-size: 1.05rem; }

/* hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 64px);
  align-items: center; padding-block: clamp(28px, 6vw, 72px) clamp(40px, 6vw, 80px);
}
.hero-title {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.6rem); line-height: .98; letter-spacing: -.01em;
}
.hero-title em { font-style: italic; color: var(--accent); position: relative; white-space: nowrap; }
.hero-title em::after {
  content: ''; position: absolute; left: -2%; right: -2%; bottom: -.08em; height: .22em;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'><path d='M3 8 C 50 2, 120 11, 197 4' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/></svg>") no-repeat center / 100% 100%;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'><path d='M3 8 C 50 2, 120 11, 197 4' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/></svg>") no-repeat center / 100% 100%;
  clip-path: inset(0 100% 0 0); transition: clip-path 1.1s var(--ease) .5s;
}
.hero-text.in .hero-title em::after { clip-path: inset(0 0 0 0); }
.hero-lead { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--ink-soft); margin: 22px 0 30px; max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-proof { list-style: none; display: flex; gap: 12px; margin-top: 30px; max-width: 520px; }
.hero-proof li {
  display: grid; padding: 12px 18px; border-radius: 16px;
  background: var(--well); box-shadow: var(--press); flex: 1 1 0; min-width: 0;
}
.hero-proof b { font: 700 1.6rem/1.1 var(--f-display); }
.hero-proof span { font-size: .8rem; color: var(--ink-soft); }

/* живое демо */
.demo-card {
  background: var(--card); border-radius: 26px; padding: 24px;
  box-shadow: var(--raise); position: relative;
  transition: opacity .38s, filter .38s, transform .38s;
}
.demo-card::after { content: ''; position: absolute; inset: 9px; border: 1.5px solid var(--ink-faint); border-radius: var(--sketch); pointer-events: none; }
.demo-card.swap { opacity: 0; filter: blur(6px); transform: translateY(6px) scale(.99); }
.demo-q { font: 700 clamp(1.35rem, 2.4vw, 1.75rem)/1.2 var(--f-display); margin-bottom: 12px; }
.demo-q .hand { font: 500 1.2em var(--f-hand); color: var(--ink-soft); }
.demo-q b { color: var(--accent); }
.demo-q .sep { color: var(--ink-faint); padding: 0 .2em; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 6px; }
.demo-block { padding: 14px; border-radius: 18px; background: var(--well); box-shadow: var(--press); min-width: 0; }
.demo-label { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin: 12px 0 8px; }
.demo-block .demo-label { margin-top: 0; }
.demo-swatches { display: flex; gap: 10px; }
.demo-sw { flex: 1; height: 64px; border-radius: 12px; box-shadow: 3px 3px 8px var(--sh-d); clip-path: circle(0% at 30% 40%); }
.demo-card.play .demo-sw { animation: blot .9s var(--ease) forwards; }
.demo-card.play .demo-sw + .demo-sw { animation-delay: .15s; }
.demo-hex { font-size: .74rem; color: var(--ink-soft); margin-top: 8px; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-shapes { display: flex; gap: 10px; justify-content: space-around; height: 64px; }
.demo-shapes svg { width: 64px; height: 64px; overflow: visible; }
.demo-shapes path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.demo-card.play .demo-shapes path { animation: draw 1.2s var(--ease) forwards .2s; }
.demo-card.play .demo-shapes svg + svg path { animation-delay: .45s; }
.demo-card .stamps .stamp { font-size: 1.25rem; animation: none; }
.demo-card.play .stamps .stamp { animation: stamp .5s var(--ease) both; animation-delay: calc(var(--d, 0ms) + 300ms); }
.demo-drivers { list-style: none; counter-reset: dd; display: grid; gap: 6px; }
.demo-drivers li { counter-increment: dd; display: flex; gap: 10px; align-items: baseline; font-weight: 600; }
.demo-drivers li::before { content: counter(dd); font: 700 1.4rem/1 var(--f-hand); color: var(--accent); width: 1rem; }
.demo-card.play .demo-drivers li { animation: rise .6s var(--ease) both; }
.demo-card.play .demo-drivers li:nth-child(2) { animation-delay: .1s; }
.demo-card.play .demo-drivers li:nth-child(3) { animation-delay: .2s; }
.demo-dots { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.demo-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); transition: background .3s, width .3s; }
.demo-dots i.on { background: var(--accent); width: 20px; border-radius: 4px; }
.demo-note { text-align: center; font-family: var(--f-hand); font-size: 1.15rem; color: var(--ink-soft); margin-top: 14px; }

/* возможности */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 30px); }
.feature { background: var(--card); border-radius: var(--r); padding: 22px; box-shadow: var(--raise-sm); }
.feature h3 { font: 700 1.6rem/1.15 var(--f-display); margin: 18px 0 8px; }
.feature p { color: var(--ink-soft); }
.scene {
  height: 190px; border-radius: 18px; background: var(--well); box-shadow: var(--press);
  position: relative; overflow: hidden; display: grid; place-items: center;
}
.scene *, .scene *::before { animation-play-state: paused; }
.feature.in .scene *, .feature.in .scene *::before { animation-play-state: running; }

/* сцена 1: баннер собирается и по нему кликают */
.mock { position: relative; width: 78%; height: 140px; border-radius: 14px; background: var(--card); box-shadow: var(--raise-sm); overflow: hidden; }
.mock-bg { position: absolute; inset: 0; background: linear-gradient(120deg, #2c4d85, #3d6fb6); transform-origin: left; animation: mock-bg 6s var(--ease) infinite; }
.mock-shape { position: absolute; right: 9%; top: 18%; width: 74px; height: 74px; border-radius: 50%; background: #c92a3e; box-shadow: 4px 6px 12px rgba(0, 0, 0, .25); animation: mock-pop 6s var(--ease) infinite; }
.mock-line { position: absolute; left: 8%; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .85); transform-origin: left; animation: mock-line 6s var(--ease) infinite; }
.mock-line.l1 { top: 22%; width: 46%; }
.mock-line.l2 { top: 38%; width: 32%; opacity: .7; animation-delay: .15s; }
.mock-btn { position: absolute; left: 8%; bottom: 16%; padding: 7px 16px; border-radius: 10px; background: #fac549; color: #2a2017; font-weight: 700; font-size: .8rem; animation: mock-btn 6s var(--ease) infinite; }
.mock-cursor { position: absolute; width: 22px; height: 22px; fill: #fff; stroke: #2a2017; stroke-width: 1.5; left: 70%; top: 85%; animation: mock-cursor 6s var(--ease) infinite; }
@keyframes mock-bg { 0% { transform: scaleX(0); } 12%, 88% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes mock-pop { 0%, 14% { transform: scale(0); } 24%, 90% { transform: scale(1); } 100% { transform: scale(1); opacity: 0; } }
@keyframes mock-line { 0%, 22% { transform: scaleX(0); } 34%, 90% { transform: scaleX(1); } 100% { opacity: 0; } }
@keyframes mock-btn { 0%, 32% { transform: translateY(14px); opacity: 0; } 42%, 62% { transform: none; opacity: 1; } 66% { transform: scale(.92); } 70%, 90% { transform: none; box-shadow: 0 0 0 8px rgba(250, 197, 73, .35); } 100% { opacity: 0; } }
@keyframes mock-cursor { 0%, 40% { left: 80%; top: 95%; opacity: 0; } 46% { opacity: 1; } 62% { left: 22%; top: 72%; } 66% { transform: scale(.8); } 70%, 90% { left: 22%; top: 72%; transform: none; opacity: 1; } 100% { opacity: 0; left: 22%; top: 72%; } }

/* сцена 2: фигуры логотипа рисуются одна за другой */
.scene-logo svg { width: 130px; height: 130px; overflow: visible; }
.morph { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: morph 9s var(--ease) infinite; }
.morph.m2 { animation-delay: 3s; }
.morph.m3 { animation-delay: 6s; }
@keyframes morph { 0% { stroke-dashoffset: 1; } 12%, 26% { stroke-dashoffset: 0; } 33%, 100% { stroke-dashoffset: -1; } }
.logo-swatches { position: absolute; right: 18px; bottom: 16px; display: flex; gap: 6px; }
.logo-swatches i { width: 18px; height: 18px; border-radius: 50%; box-shadow: 2px 2px 5px var(--sh-d); animation: sw-cycle 9s steps(1) infinite; }
.logo-swatches i:nth-child(1) { --a: #3d6fb6; --b: #b91e32; --c: #e1243d; }
.logo-swatches i:nth-child(2) { --a: #c92a3e; --b: #141416; --c: #6e4c9c; }
.logo-swatches i:nth-child(3) { --a: #e6dcc5; --b: #d8cdb5; --c: #fac549; }
@keyframes sw-cycle { 0% { background: var(--a); } 33.3% { background: var(--b); } 66.6% { background: var(--c); } }

/* сцена 3: шкалы тона и штампы */
.scene-tone { padding: 18px 22px; display: grid; align-content: center; gap: 12px; place-items: stretch; }
.tone-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; align-items: center; font-size: .78rem; color: var(--ink-soft); }
.tone-row span:first-child { text-align: right; }
.tone-track { position: relative; height: 8px; border-radius: 999px; background: var(--card); box-shadow: inset 2px 2px 4px var(--sh-d), inset -2px -2px 4px var(--sh-l); }
.tone-track b { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--accent); left: 50%; animation: tone 5s var(--ease) infinite alternate; }
@keyframes tone { 0%, 15% { left: 50%; } 60%, 100% { left: var(--to); } }
.tone-stamps { display: flex; gap: 10px; justify-content: center; margin-top: 4px; }
.tone-stamps .stamp { font-size: 1.15rem; animation: stamp-loop 5s var(--ease) infinite; }
.tone-stamps .stamp + .stamp { animation-delay: .3s; }
@keyframes stamp-loop { 0%, 40% { opacity: 0; transform: scale(1.6) rotate(var(--tilt)); } 50%, 92% { opacity: 1; transform: rotate(var(--tilt)); } 100% { opacity: 0; transform: rotate(var(--tilt)); } }

/* сцена 4: промпт печатается, копируется и превращается в результат */
.scene-prompt { grid-template-columns: 1.1fr .9fr; gap: 14px; padding: 18px; place-items: stretch; }
.prompt-mock { position: relative; border-radius: 12px; padding: 14px; background: var(--card); box-shadow: var(--raise-sm); display: grid; gap: 9px; align-content: start; }
.pm-line { height: 8px; border-radius: 5px; width: var(--w); background: var(--ink-faint); transform-origin: left; animation: pm-type 6s steps(12) infinite; }
.pm-line:nth-child(2) { animation-delay: .25s; }
.pm-line:nth-child(3) { animation-delay: .5s; }
.pm-line:nth-child(4) { animation-delay: .75s; }
@keyframes pm-type { 0% { transform: scaleX(0); } 22%, 92% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }
.pm-copy { position: absolute; right: 10px; bottom: 10px; font-size: .72rem; font-weight: 700; color: var(--accent); padding: 4px 10px; border-radius: 999px; background: var(--card); box-shadow: var(--raise-sm); animation: pm-copy 6s var(--ease) infinite; }
@keyframes pm-copy { 0%, 36% { opacity: 0; } 40%, 46% { opacity: 1; box-shadow: var(--raise-sm); } 48%, 92% { opacity: 1; box-shadow: var(--press); } 100% { opacity: 0; } }
.pm-out { display: grid; gap: 8px; align-content: start; }
.pm-img { height: 82px; border-radius: 12px; background: linear-gradient(135deg, #e1243d, #6e4c9c); box-shadow: 3px 3px 8px var(--sh-d); clip-path: circle(0% at 50% 50%); animation: pm-img 6s var(--ease) infinite; }
@keyframes pm-img { 0%, 50% { clip-path: circle(0% at 50% 50%); } 66%, 92% { clip-path: circle(80% at 50% 50%); } 100% { clip-path: circle(80% at 50% 50%); opacity: 0; } }
.pm-text { display: grid; gap: 6px; }
.pm-text i { height: 7px; border-radius: 4px; background: var(--ink-faint); transform-origin: left; animation: pm-text 6s var(--ease) infinite; }
.pm-text i:nth-child(2) { width: 80%; animation-delay: .1s; }
.pm-text i:nth-child(3) { width: 60%; animation-delay: .2s; }
@keyframes pm-text { 0%, 60% { transform: scaleX(0); } 72%, 92% { transform: scaleX(1); } 100% { opacity: 0; } }

/* шаги */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 30px); position: relative; z-index: 1; }
.step { background: var(--card); border-radius: var(--r); padding: 26px 22px 22px; box-shadow: var(--raise-sm); }
.step-num { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--well); box-shadow: var(--press); font: 700 2rem/1 var(--f-hand); color: var(--accent); margin-bottom: 14px; }
.step h3 { font: 700 1.4rem/1.15 var(--f-display); margin-bottom: 8px; }
.step p { color: var(--ink-soft); }
.steps-ink { position: absolute; left: 6%; right: 6%; width: 88%; top: calc(50% + 40px); height: 40px; z-index: 0; overflow: visible; }
.steps-ink path { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .55; vector-effect: non-scaling-stroke; transition: stroke-dashoffset 2s var(--ease) .4s; }
.steps-ink.in path { stroke-dashoffset: 0; }

/* наука */
.science { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: center; background: var(--card); border-radius: 28px; padding: clamp(24px, 4vw, 44px); box-shadow: var(--raise); }
.science p { color: var(--ink-soft); margin: 14px 0 18px; }
.evidence { list-style: none; display: grid; gap: 8px; margin-bottom: 22px; }
.evidence li { display: flex; gap: 12px; align-items: center; color: var(--ink-soft); font-size: .92rem; }
.evidence b { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--well); box-shadow: var(--press); color: var(--accent); font-family: var(--f-display); font-size: 1.1rem; }
.sources { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sources li { padding: 9px 16px; border-radius: 999px; background: var(--well); box-shadow: var(--press); font: 600 1.05rem var(--f-display); font-style: italic; transition: transform .3s var(--ease); }
.science.in .sources li { animation: rise .6s var(--ease) both; }
.science.in .sources li:nth-child(odd) { animation-delay: .15s; }
.science.in .sources li:nth-child(3n) { animation-delay: .3s; }
.sources li:hover { transform: translateY(-3px) rotate(-1deg); }

/* для кого */
.audience { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.audience span { padding: 12px 22px; border-radius: 999px; background: var(--card); box-shadow: var(--raise-sm); font-weight: 600; }

/* призыв */
.cta-card { text-align: center; background: var(--card); border-radius: 28px; padding: clamp(32px, 6vw, 60px) 24px; box-shadow: var(--raise); position: relative; overflow: hidden; }
.cta-card::before { content: ''; position: absolute; inset: 10px; border: 1.5px solid var(--ink-faint); border-radius: var(--sketch); pointer-events: none; }
.cta-card h2 { font: 700 clamp(1.9rem, 4vw, 2.8rem)/1.1 var(--f-display); }
.cta-card p { color: var(--ink-soft); margin: 12px 0 26px; }

/* блог-заглушка */
.blog-ghosts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-bottom: 48px; }
.ghost-card { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--raise-sm); display: grid; gap: 10px; }
.ghost-img { height: 140px; border-radius: 14px; background: var(--well); box-shadow: var(--press); }
.ghost-card i { height: 10px; border-radius: 5px; background: var(--ink-faint); }
.ghost-card i:nth-child(3) { width: 80%; }
.ghost-card i:nth-child(4) { width: 55%; }
.ghost-card > * { animation: ghost 1.8s ease-in-out infinite alternate; }
@keyframes ghost { to { opacity: .45; } }

/* адаптив сайта */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-demo { max-width: 560px; width: 100%; margin: 0 auto; }
  .science { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .features, .steps, .blog-ghosts { grid-template-columns: minmax(0, 1fr); }
  .steps-ink { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 100%; left: 12px; right: 12px; margin: 0;
    flex-direction: column; padding: 10px; border-radius: 20px;
    background: var(--card); box-shadow: var(--raise);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s, transform .25s, visibility .25s;
  }
  .site-nav.open { opacity: 1; visibility: visible; transform: none; }
  .site-nav a { padding: 12px 16px; }
  .header-actions { margin-left: auto; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-nav { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .header-cta { display: none; }
  .logo span { font-size: 1.25rem; }
  .demo-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-proof li { flex: 1; min-width: 0; }
  .scene-prompt { grid-template-columns: minmax(0, 1fr); }
  .pm-out { display: none; }
  .tone-row { font-size: .7rem; }
}

/* --- Слой конверсии (по расчёту для ЦА сайта: красный + треугольник/зигзаг, только у призывов) --- */
.btn-primary::after { /* стрелка-треугольник: направление и движение */
  content: ''; width: 0; height: 0; margin-left: 2px;
  border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  transition: transform .3s var(--ease);
}
.btn-primary:hover::after { transform: translateX(4px); }
.btn-sm.btn-primary::after { border-left-width: 6px; border-top-width: 4px; border-bottom-width: 4px; }
.risk-free { margin-top: 14px; font-size: .86rem; color: var(--ink-soft); }
.risk-free::before { content: '✓ '; color: var(--accent); font-weight: 700; }

/* «Как посчитано» на главной — драйвер «Авторитет и доказательства» */
.science { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); }
.science .sources { grid-column: 1 / -1; order: 3; justify-content: flex-start; }
.receipt {
  order: 2; position: relative;
  background: var(--paper); border-radius: 18px; padding: 20px 22px 16px;
  box-shadow: var(--press);
  font-size: .9rem;
}
.receipt::before { /* перфорация, как у чека */
  content: ''; position: absolute; left: 14px; right: 14px; top: -1px; height: 8px;
  background: radial-gradient(circle at 6px 0, var(--card) 4px, transparent 4.5px) 0 0 / 14px 8px repeat-x;
}
.receipt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 1.5px dashed var(--ink-faint); padding-bottom: 8px; margin-bottom: 6px; }
.receipt-head .hand { font: 700 1.5rem/1 var(--f-hand); color: var(--accent); }
.receipt-case { font-size: .78rem; color: var(--ink-soft); }
.receipt-row { padding: 9px 0; border-bottom: 1px dashed var(--ink-faint); }
.receipt-name { font-weight: 700; }
.receipt-line { display: flex; align-items: center; gap: 10px; margin-top: 2px; color: var(--ink-soft); }
.receipt-line span { flex: 1; }
.receipt-line b { font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; }
.receipt-line b.up { color: var(--accent); }
.receipt-line b.down { color: var(--accent-2); }
.lvl { font-style: normal; font: 700 .78rem/1 var(--f-body); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--well); box-shadow: var(--raise-sm); color: var(--accent); }
.receipt-src { font-size: .76rem; color: var(--ink-soft); font-style: italic; margin-top: 2px; }
.receipt-note { font-size: .78rem; color: var(--ink-soft); margin: 10px 0 0 !important; }
.science.in .receipt-row { animation: rise .6s var(--ease) both; }
.science.in .receipt-row:nth-of-type(2) { animation-delay: .15s; }
.science.in .receipt-row:nth-of-type(3) { animation-delay: .3s; }

/* Две аудитории */
.audiences { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 30px); }
.aud-card { background: var(--card); border-radius: var(--r); padding: 26px; box-shadow: var(--raise-sm); position: relative; }
.aud-who { font: 700 .78rem var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.aud-card h3 { font: 700 1.7rem/1.15 var(--f-display); margin: 8px 0 14px; }
.ticks { list-style: none; display: grid; gap: 10px; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; color: var(--ink-soft); }
.ticks li::before {
  content: ''; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.ticks li { position: relative; }
.ticks li::after { content: ''; position: absolute; left: 5px; top: 8px; width: 7px; height: 4px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.aud-note { font: 600 1.25rem var(--f-hand); color: var(--accent-2); margin-top: 14px; }

/* Финальный призыв — тёмный блок конверсии */
.cta-dark { background: var(--ink); color: var(--paper); }
.cta-dark::before { border-color: color-mix(in srgb, var(--paper) 22%, transparent); }
.cta-dark p { color: color-mix(in srgb, var(--paper) 75%, transparent); max-width: 52ch; margin-inline: auto; }
.cta-dark .btn-primary { box-shadow: 0 10px 26px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.cta-zigzag { width: 120px; height: 30px; display: block; margin: 0 auto 10px; overflow: visible; }
.cta-zigzag path { fill: none; stroke: var(--cta); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease) .3s; }
.cta-dark.in .cta-zigzag path { stroke-dashoffset: 0; }
.guarantees { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; margin-top: 22px; font-size: .86rem; color: color-mix(in srgb, var(--paper) 70%, transparent); }
.guarantees li::before { content: '✓ '; color: var(--cta); font-weight: 700; }

@media (max-width: 960px) { .science .receipt { order: 2; } }
@media (max-width: 820px) { .audiences { grid-template-columns: minmax(0, 1fr); } }

/* =================================================================== */
/* ====  «Синяя витрина»: 60% синий (фон), 30% пергамент (карточки), ==== */
/* ====  красный — только призывы. Пропорции — по правилу нашего отчёта  */
/* =================================================================== */
html {
  background-color: var(--bg);
  background-image:
    radial-gradient(110% 80% at 12% 0%, var(--bg-glow), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, var(--bg-deep), transparent 65%);
}
body::before { opacity: var(--grain-bg); }

/* текст прямо на синем фоне */
.site-header .logo, .site-footer .logo, .hero-title, .section-title { color: var(--on-bg); }
/* заголовки внутри пергаментных карточек остаются чернильными */
.science .section-title, .cta-card:not(.cta-dark) h2 { color: var(--ink); }
.science .kicker { color: var(--accent); }
/* RGB-шар на синем: без multiply, иначе цвета грязнятся */
.site-header .rgb-orb circle, .site-footer .rgb-orb circle { mix-blend-mode: normal; opacity: .92; }
.hero-lead, .section-lead, .demo-note, .risk-free, .footer-brand p, .site-footer .footnote { color: var(--on-bg-soft); }
.site-footer .footnote a { color: var(--on-bg); }
.kicker, .hero-title em { color: var(--on-bg-accent); }
.hero-title em::after { background: var(--on-bg-accent); }
.risk-free::before { color: var(--on-bg-accent); }
.steps-ink path { stroke: var(--on-bg-accent); }
.footer-inner { border-top-color: var(--on-bg-faint); }
.footer-nav a { color: var(--on-bg-soft); }
.footer-nav a:hover { color: var(--on-bg); }

/* навигация на синем */
.site-nav a { color: var(--on-bg-soft); }
.site-nav a:hover { color: var(--on-bg); }
.site-nav a[aria-current="page"] { color: var(--on-bg); box-shadow: none; background: rgba(255, 255, 255, .12); }
.site-header.scrolled::before { background: color-mix(in srgb, var(--bg) 88%, transparent); box-shadow: 0 8px 22px var(--bg-sh-d); }

/* поверхности-пергамент, лежащие на синем: объём считается от синего фона */
.form-card, .feature, .step, .science, .aud-card, .demo-card, .cta-card, .ghost-card, .tooltip-content {
  box-shadow: var(--raise-bg);
}
.btn-ghost { box-shadow: var(--raise-bg-sm); }
.hero .btn-ghost:active { box-shadow: inset 3px 3px 8px var(--sh-d); }
.site-header .help-btn { box-shadow: var(--raise-bg-sm); }

/* цифры на первом экране — «стёклышки» на синем */
.hero-proof li { background: rgba(255, 255, 255, .08); box-shadow: inset 2px 2px 6px var(--bg-sh-d), inset -1px -1px 0 rgba(255, 255, 255, .08); }
.hero-proof b { color: var(--on-bg); }
.hero-proof span { color: var(--on-bg-soft); }

/* мобильное меню */
@media (max-width: 820px) {
  .site-nav { background: var(--card); box-shadow: var(--raise-bg); }
  .site-nav a { color: var(--ink-soft); }
  .site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
}

/* =================================================================== */
/* =============================  БЛОГ  ============================== */
/* =================================================================== */

/* рубрики и языки — на синем фоне */
.blog-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chips a {
  padding: 8px 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .9rem;
  color: var(--on-bg-soft); background: rgba(255, 255, 255, .07); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .08);
  transition: background .2s, color .2s;
}
.cat-chips a:hover { color: var(--on-bg); background: rgba(255, 255, 255, .14); }
.cat-chips a[aria-current="page"] { color: var(--ink); background: var(--card); box-shadow: var(--raise-bg-sm); }

.lang-switch { position: relative; }
.lang-switch > summary {
  list-style: none; cursor: pointer; padding: 8px 14px; border-radius: 999px; font-size: .88rem; font-weight: 600;
  color: var(--on-bg-soft); background: rgba(255, 255, 255, .07);
}
.lang-switch > summary::after { content: ' ▾'; }
.lang-switch > div {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px;
  display: grid; padding: 8px; border-radius: 16px; background: var(--card); box-shadow: var(--raise-bg);
}
.lang-switch > div a { padding: 7px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .9rem; }
.lang-switch > div a:hover, .lang-switch > div a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.lang-switch::details-content { block-size: auto; overflow: visible; }
.lang-inline > summary { color: var(--ink-soft); background: var(--well); box-shadow: var(--press); padding: 4px 12px; }

/* карточки статей */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.6vw, 28px); }
.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border-radius: var(--r); box-shadow: var(--raise-bg);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.post-card:hover { transform: translateY(-4px); }
.post-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--well); position: relative; }
.post-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.post-card:hover .post-img img { transform: scale(1.04); }
.noimg { display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, var(--card), var(--well)); }
.noimg-orb { position: relative; width: 84px; height: 84px; }
.noimg-orb i { position: absolute; width: 50px; height: 50px; border-radius: 50%; mix-blend-mode: var(--orb-blend); opacity: .85; }
.noimg-orb i:nth-child(1) { background: #d94a3d; left: 17px; top: 0; }
.noimg-orb i:nth-child(2) { background: #4e9a5b; left: 2px; top: 30px; }
.noimg-orb i:nth-child(3) { background: #3d6fb6; left: 32px; top: 30px; }
.post-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-cat {
  align-self: flex-start; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); text-decoration: none; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft);
}
.post-title { font: 700 1.35rem/1.2 var(--f-display); }
.post-title a { color: var(--ink); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat; transition: background-size .4s var(--ease); }
.post-card:hover .post-title a { background-size: 100% 1.5px; }
.post-excerpt { color: var(--ink-soft); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--ink-soft); }
.post-meta span + span::before { content: '·'; margin-right: 14px; color: var(--ink-faint); }

.post-card-big { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); margin-bottom: clamp(18px, 2.6vw, 28px); }
.post-card-big .post-img { aspect-ratio: auto; min-height: 320px; }
.post-card-big .post-body { padding: clamp(22px, 3vw, 36px); justify-content: center; }
.post-card-big .post-title { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.post-card-big .post-excerpt { -webkit-line-clamp: 5; font-size: 1rem; }

.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 36px; color: var(--on-bg-soft); font-weight: 600; }
.home-blog-all { text-align: center; margin-top: 26px; }
.home-blog-all a { color: var(--on-bg); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid var(--on-bg-faint); }
.home-blog-all a:hover { border-color: var(--on-bg); }

/* статья — пергаментный лист на синем столе */
.article {
  background: var(--card); border-radius: 28px; box-shadow: var(--raise-bg);
  padding: clamp(22px, 4.5vw, 56px); margin-top: clamp(16px, 3vw, 32px); position: relative;
  max-width: 1100px;
}
.article::after { content: ''; position: absolute; inset: 10px; border: 1.5px solid var(--ink-faint); border-radius: var(--sketch); pointer-events: none; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .84rem; color: var(--ink-soft); margin-bottom: 18px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--ink-faint); }
.article-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.article-title { font: 700 clamp(2rem, 4.6vw, 3.4rem)/1.05 var(--f-display); max-width: 22ch; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 18px 0 26px; color: var(--ink-soft); font-size: .9rem; }
.meta-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.meta-author img { border-radius: 50%; object-fit: cover; }
.article-cover { margin: 0 0 32px; border-radius: 20px; overflow: hidden; box-shadow: var(--raise-sm); }
.article-cover img { width: 100%; height: auto; display: block; max-height: 560px; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(24px, 4vw, 48px); align-items: start; }
.article-side { position: sticky; top: 90px; display: grid; gap: 12px; }
.side-card { padding: 20px; border-radius: 18px; background: var(--well); box-shadow: var(--press); }
.side-kicker { font: 700 1.2rem/1 var(--f-hand); color: var(--accent); }
.side-title { font: 700 1.3rem/1.15 var(--f-display); margin: 6px 0 8px; }
.side-text { font-size: .86rem; color: var(--ink-soft); margin-bottom: 14px; }

/* типографика текста статьи */
.prose { font-size: 1.08rem; line-height: 1.75; max-width: 70ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font: 700 clamp(1.6rem, 2.8vw, 2.1rem)/1.15 var(--f-display); margin-top: 1.8em; }
.prose h3 { font: 700 1.45rem/1.2 var(--f-display); margin-top: 1.5em; }
.prose h4 { font-size: 1.1rem; margin-top: 1.3em; }
.prose a { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { border-left: 3px solid var(--accent); padding: .3em 0 .3em 1.1em; font: italic 600 1.25rem/1.5 var(--f-display); color: var(--ink); }
.prose img { border-radius: 14px; height: auto; box-shadow: var(--raise-sm); }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: .5em; text-align: center; }
.prose table { width: 100%; border-collapse: collapse; font-size: .94rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: .6em .8em; border-bottom: 1px dashed var(--ink-faint); text-align: left; }
.prose th { color: var(--ink-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.prose code { background: var(--well); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
.prose pre { background: var(--well); box-shadow: var(--press); padding: 1em; border-radius: 12px; overflow-x: auto; }
.prose hr { border: none; border-top: 1.5px dashed var(--ink-faint); margin: 2em 0; }
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { padding-left: 0; padding-right: 1.4em; }
[dir="rtl"] .prose blockquote { border-left: none; border-right: 3px solid var(--accent); padding: .3em 1.1em .3em 0; }

.source-box { margin-top: 28px; padding: 14px 18px; border-radius: 14px; background: var(--well); box-shadow: var(--press); display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; max-width: 70ch; }
.source-box a { color: var(--accent); font-weight: 600; word-break: break-word; }
.author-box { display: flex; gap: 18px; align-items: center; margin-top: 40px; padding: 22px; border-radius: 20px; background: var(--well); box-shadow: var(--press); max-width: 760px; }
.author-box img { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-name { font: 700 1.4rem var(--f-display); }
.author-name a { color: var(--ink); }
.author-byline { color: var(--ink-soft); font-size: .92rem; }

@media (max-width: 960px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-side { position: static; }
}
@media (max-width: 640px) {
  .post-grid, .post-card-big { grid-template-columns: minmax(0, 1fr); }
  .post-card-big .post-img { min-height: 0; aspect-ratio: 16 / 10; }
  .article { border-radius: 22px; }
  .article::after { inset: 6px; }
  .blog-tools { flex-direction: column; align-items: stretch; }
  .lang-switch > div { left: 0; right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; }
  /* статичные кадры сцен вместо анимации */
  .logo-swatches i { background: var(--a); }
  .morph.m1 { stroke-dashoffset: 0; }
  .demo-sw, .pm-img, .swatch-fill { clip-path: none !important; }
  .orb-spin { animation: none !important; }
  .cta-zigzag path { stroke-dashoffset: 0; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
