/* Цвета и размеры: дизайн-система «Просудись Mini App». Сначала телефон, с 900px компьютер. */
@font-face {
  font-family: "Golos Text";
  src: url("fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  src: url("fonts/golos-text-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-display: swap;
  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+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --canvas: #e7eced;
  --paper: #fcfbf7;
  --raised: #ffffff;
  --ink: #173342;
  --ink-muted: #5d727c;
  --line: #ccd9dc;
  --line-strong: #7b949d;
  --primary: #2864e7;
  --primary-ink: #1d4fc0;
  --primary-soft: #e2ebfd;
  --brand-ink: #9c3a24;
  --marker: #ffd3c7;
  --marker-free: #bfe3cc;
  --success-ink: #1f6e4d;
  --success-soft: #dff0e5;
  --on-dark: #e9eff1;
  --on-dark-muted: #9fb3bc;
  --on-dark-focus: #8ab4ff;
  --shadow-card: 0 1px 2px rgba(23, 51, 66, 0.06);
  --on-dark-link: #9dbcff;
  --on-dark-todo: #ffb49f;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --section: 72px;
  --h2: clamp(34px, 9.6vw, 44px);
  --h2-track: -0.025em;
  --lead: 18px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 17px/1.5 "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-kerning: normal;
  font-synthesis: none;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
p { text-wrap: pretty; }
.on-dark { -webkit-font-smoothing: antialiased; }
a { color: var(--primary-ink); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.on-dark :focus-visible { outline-color: var(--on-dark-focus); }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter) max(20px, env(safe-area-inset-right, 0px));
}

.marker {
  padding: 0 2px;
  background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.marker-free { background: linear-gradient(transparent 58%, var(--marker-free) 58%, var(--marker-free) 92%, transparent 92%); }

.todo { color: var(--brand-ink); }
.on-dark .todo { color: var(--on-dark-todo); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 180ms ease;
}
.btn:hover { background: var(--primary-ink); color: #ffffff; }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 15px; }

/* Шапка */
.site-header { background: var(--paper); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.logo img { width: auto; height: 44px; }
.logo b { color: var(--primary-ink); font-weight: 700; }
.site-nav { display: none; }

/* Разделы */
.section { padding-block: var(--section); }
.section-paper { background: var(--paper); }
.section-dark { background: var(--ink); color: var(--on-dark); }

h2 {
  font-size: var(--h2);
  line-height: 1.06;
  letter-spacing: var(--h2-track);
  font-weight: 700;
  text-wrap: balance;
}
.lead { font-size: var(--lead); line-height: 1.4; max-width: 28em; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 32px; }

/* Первый экран */
.hero { padding-block: 24px 64px; background: var(--paper); }
.hero .wrap { display: flex; flex-direction: column; gap: 20px; }
.hero h1 {
  font-size: clamp(34px, 9.8vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; min-width: 0; }
.hero-art { display: none; }
.proof { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.proof svg { flex: none; margin-top: 1px; }

/* Плитки ситуаций */
.tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease;
}
.tile:hover { color: var(--ink); }
.tile-head { display: flex; align-items: center; gap: 12px; }
.tile-head svg { flex: none; }
.tile-title { font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -0.01em; }
.tile-list { display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 21px; }

.acc-sun { --acc: #f5b83d; --acc-soft: #fff4db; --acc-strong: #ffe2a0; --acc-ink: #7d5200; }
.acc-primary { --acc: #2864e7; --acc-soft: #e2ebfd; --acc-strong: #c6d7fb; --acc-ink: #1d4fc0; }
.acc-success { --acc: #2f8f66; --acc-soft: #dff0e5; --acc-strong: #bfe3cc; --acc-ink: #1f6e4d; }
.acc-brand { --acc: #ff795c; --acc-soft: #fff0eb; --acc-strong: #ffd3c7; --acc-ink: #9c3a24; }
.illus .k-bg { fill: var(--acc-soft); }
.illus .k-ink { fill: var(--ink); }
.illus .k-paper { fill: #ffffff; }
.illus .k-line { fill: var(--line); }
.illus .k-acc { fill: var(--acc); }
.illus .k-acc-mid, .illus .k-acc-soft { fill: var(--acc-strong); }
.illus .k-stroke { stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.illus .k-ink-stroke, .illus .k-paper-stroke, .illus .k-acc-ink-stroke { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.illus .k-ink-stroke { stroke: var(--ink); }
.illus .k-paper-stroke { stroke: #ffffff; }
.illus .k-acc-ink-stroke { stroke: var(--acc-ink); }

/* Три шага */
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px 24px; }
.step { display: flex; flex-direction: column; gap: 16px; }
.step-title { font-size: 24px; line-height: 29px; font-weight: 700; letter-spacing: -0.015em; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 17px; background: var(--canvas); }
.screen-done { gap: 12px; background: var(--success-soft); }
.option { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--raised); font-size: 15px; }
.option-on { border: 2px solid var(--primary); font-weight: 600; }
.option-picked { background: var(--primary-soft); }
.progress { height: 6px; border-radius: 999px; background: var(--line); }
.progress span { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--primary); }
.screen-q { padding-top: 4px; font-size: 17px; line-height: 24px; font-weight: 600; }
.done-title { font-size: 20px; line-height: 26px; font-weight: 700; color: var(--success-ink); }
.file { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 10px; background: var(--raised); font-size: 15px; line-height: 20px; }
.file svg { flex: none; }

/* Экраны: одна мысль и одна картинка */
.scene { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 64px; align-items: center; }

.calc { display: flex; flex-direction: column; padding: 24px; border-radius: 17px; background: var(--paper); box-shadow: var(--shadow-card); }
.calc-row { display: flex; justify-content: space-between; gap: 16px; padding-block: 12px; font-size: 15px; font-variant-numeric: lining-nums tabular-nums; }
.calc-row span:first-child, .calc-big > span:first-child { color: var(--ink-muted); }
.calc-row span:last-child { font-weight: 600; }
.calc-big { display: flex; flex-direction: column; gap: 2px; padding-block: 16px; border-top: 1px solid var(--line); font-size: 15px; }
.calc-num { font-size: clamp(38px, 11vw, 48px); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; color: var(--primary-ink); }
.calc-note { font-size: 13px; line-height: 18px; color: var(--ink-muted); }

.court { display: flex; flex-direction: column; gap: 12px; }
.court-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line-strong); }
.court-card small { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.court-card.is-result { border: 0; background: var(--primary-soft); }
.court-card.is-result small { color: var(--primary-ink); }
.court-card strong { font-size: 20px; line-height: 26px; }
.court svg { align-self: center; }

.photo { display: flex; align-items: stretch; gap: 20px; padding: 24px; border-radius: 17px; background: var(--paper); box-shadow: var(--shadow-card); }
.photo-sheet { flex: 0 0 38%; display: flex; flex-direction: column; gap: 10px; min-height: 200px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--raised); transform: rotate(-3deg); }
.photo-sheet i { display: block; height: 6px; border-radius: 3px; background: var(--line); }
.photo-sheet i:first-child { width: 60%; background: var(--line-strong); }
.photo-sheet i:last-child { width: 80%; }
.photo-fields { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.photo-fields span { display: flex; flex-direction: column; }
.photo-fields small { font-size: 13px; color: var(--ink-muted); }

.section-dark .lead { color: var(--on-dark-muted); }
.narrow { max-width: 14em; }

/* Цены */
.prices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.price { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 14px; background: var(--paper); font-size: 15px; line-height: 22px; }
.price-free { background: var(--success-soft); }
.price b { font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; }
.price-free b { color: var(--success-ink); }

/* О людях */
.stats { display: flex; flex-wrap: wrap; gap: 24px 64px; padding-top: 16px; }
.stat { display: flex; flex-direction: column; font-size: 15px; }
.stat b { font-size: clamp(38px, 11vw, 56px); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }

/* Вопросы */
.faq { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px 48px; }
.faq-list { min-width: 0; padding-inline: 20px; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-card); }
details { padding-block: 16px; }
details + details { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
details p { margin-top: 8px; }

/* Подвал */
.site-footer { padding-block: 48px; background: var(--ink); color: var(--on-dark); font-size: 13px; line-height: 18px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 48px; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-name { font-size: 22px; line-height: 26px; font-weight: 700; }
.footer-name b { color: var(--on-dark-link); font-weight: 700; }
.footer-tag { font-size: 15px; line-height: 22px; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-col a { color: var(--on-dark-link); }
.footer-col a:hover { color: #ffffff; }

/* Кнопка внизу экрана на телефоне */
.phone-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--raised);
  box-shadow: 0 -2px 12px rgba(23, 51, 66, 0.08);
}
.phone-bar .btn { display: flex; min-height: 52px; }

/* Юридические страницы и 404 */
.doc { padding-block: 32px 72px; background: var(--paper); }
.doc-body { max-width: 46em; display: flex; flex-direction: column; gap: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.doc-body h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; }
.doc-body h2 { margin-top: 20px; font-size: 24px; line-height: 1.2; letter-spacing: -0.015em; }
.doc-body ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.not-found { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding-block: 72px 120px; }
.not-found h1 { font-size: clamp(42px, 12vw, 72px); line-height: 1; letter-spacing: -0.03em; font-weight: 700; }

/* Планшет */
@media (min-width: 600px) {
  .tiles, .prices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

/* Компьютер */
@media (min-width: 900px) {
  :root {
    --gutter: 40px;
    --section: clamp(96px, 9vw, 136px);
    --h2: clamp(44px, 4.8vw, 68px);
    --h2-track: -0.03em;
    --lead: clamp(19px, 1.7vw, 22px);
  }
  body { font-size: 18px; }

  .site-header { position: sticky; top: 0; z-index: 20; background: rgba(252, 251, 247, 0.94); backdrop-filter: blur(10px); }
  .site-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
  .site-nav a:not(.btn) { color: var(--ink); text-decoration: none; }
  .site-nav a:not(.btn):hover { color: var(--primary-ink); }

  .hero { padding-block: 56px 120px; }
  .hero .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 48px; align-items: start; }
  .hero h1 { grid-column: 1 / -1; font-size: clamp(64px, 7.4vw, 100px); line-height: 1; letter-spacing: -0.04em; }
  .hero-copy .lead { font-size: clamp(20px, 1.8vw, 24px); }
  .hero-art { display: flex; justify-content: center; }
  .hero-art img { width: 100%; max-width: 420px; height: auto; }

  .tiles { gap: 16px; }
  .tile:hover { transform: translateY(-2px); background: var(--raised); }

  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scene { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .scene-flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .scene-flip > :first-child { order: 2; }
  .faq { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; }
  .footer-brand { grid-column: auto; }
  .phone-bar { display: none; }
}

@media (min-width: 1160px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .tile { transition: none; }
  .tile:hover { transform: none; }
}

/* Первый экран и каталог ситуаций */
.landing { --section: clamp(44px, 5.5vw, 84px); }
.landing h2 { font-size: clamp(32px, 4.3vw, 58px); }
.landing .site-header { position: sticky; top: 0; z-index: 20; }
.landing .hero { padding-block: clamp(28px, 4.8vw, 64px); }
.landing .hero-copy { gap: 16px; }
.landing .hero h1 { max-width: 15ch; font-size: clamp(35px, 6.35vw, 82px); }
.hero-actions, .situation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.hero-actions a:not(.btn), .situation-actions a:not(.btn), .catalog-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.catalog-grid { display: grid; gap: 16px; }
.category-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
.category-buttons .tile { min-height: 102px; padding: 10px; text-align: left; font: inherit; cursor: pointer; }
.category-buttons .tile-head { gap: 5px; align-items: flex-start; flex-direction: column; }
.category-buttons .illus { width: 38px; height: 38px; }
.category-buttons .tile-title { font-size: 15px; line-height: 1.2; }
.category-buttons .tile[aria-pressed="true"] { background: var(--raised); box-shadow: inset 0 0 0 2px var(--primary-ink); }
.situation-list-panel, .situation-details { min-width: 0; padding: clamp(16px, 3vw, 32px); background: var(--raised); border: 1px solid var(--line); border-radius: 16px; }
.situation-list-panel h3, .situation-details h3 { margin: 0 0 10px; line-height: 1.16; }
.situation-list { display: grid; gap: 6px; list-style: none; padding: 0; margin: 0; }
.situation-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 12px; border-radius: 8px; background: var(--paper); color: var(--ink); text-decoration: none; }
.situation-list a::after { content: "→"; color: var(--primary-ink); }
.situation-list a:hover, .situation-list a[aria-current] { background: var(--primary-soft); color: var(--primary-ink); }
.situation-details h3 { font-size: clamp(24px, 3vw, 40px); }
.situation-details h3:focus:not(:focus-visible) { outline: none; }
.situation-details dl { display: grid; gap: 16px; margin: 20px 0; }
.situation-details dt { font-weight: 650; margin-bottom: 4px; }
.situation-details dd { margin: 0; }
.situation-price { border-block-start: 1px solid var(--line); padding-block: 14px; }
.situation-price strong { display: block; font-size: 24px; }
.situation-actions [hidden] { display: none; }
.feature-grid { display: grid; gap: 12px; }
.feature-grid article { padding: 20px; border-radius: 14px; background: var(--raised); }
.feature-grid h3 { margin: 0 0 6px; font-size: 18px; }
.feature-grid p { color: var(--ink-muted); }
.landing .price { min-height: auto; }
.landing .price b { font-size: clamp(28px, 4vw, 50px); }
.landing .phone-bar { padding-block-start: 8px; padding-block-end: calc(8px + env(safe-area-inset-bottom, 0px)); }
html:has(.landing) { scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 680px) {
  .catalog-grid { grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); align-items: start; }
  .category-buttons { grid-template-columns: 1fr; }
  .category-buttons .tile { min-height: 54px; padding-inline: 14px; }
  .category-buttons .tile-head { flex-direction: row; align-items: center; gap: 10px; }
  .situation-details dl, .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .landing .hero .wrap { align-items: center; }
  .landing .hero-art img { max-width: 290px; }
  html:has(.landing) { scroll-padding-bottom: 0; }
}

.landing .on-dark .situation-actions a { color: var(--on-dark-link); }
