:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f4f2ea;
  --line: rgba(20, 20, 25, 0.10);
  --line-2: rgba(20, 20, 25, 0.16);
  --text: #16161a;
  --muted: #5c5c63;
  --muted-2: #8a8a90;
  --accent: #9e2b2f;
  --accent-strong: #872529;
  --accent-deep: #6e1e22;
  --accent-tint: #f7e6e6;
  --accent-ink: #ffffff;
  --crit: #e24b4a;
  --major: #e08a16;
  --minor: #9a9a9f;
  --good: #0e9f6e;
  --r: 14px;
  --r-sm: 10px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

/* первый экран — жёстко без прокрутки; отчёт включает скролл классом is-report */
body { overflow: hidden; }
body.is-report { overflow-y: auto; height: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(rgba(20, 20, 30, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 30, 0.035) 1px, transparent 1px),
    radial-gradient(820px 460px at 80% -6%, rgba(158, 43, 47, 0.09), transparent 62%),
    radial-gradient(640px 380px at 2% 2%, rgba(158, 43, 47, 0.05), transparent 58%);
  background-size: 30px 30px, 30px 30px, 100% 100%, 100% 100%;
  background-attachment: fixed;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

/* шапка */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(251, 250, 246, 0.78); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; }
.brand__logo { height: 30px; width: auto; display: block; }
.topbar__badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--accent-deep); background: var(--accent-tint); border: 1px solid rgba(158, 43, 47, 0.22); padding: 6px 14px; border-radius: 999px; white-space: nowrap; text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.topbar__badge:hover { background: #f3dcdc; border-color: rgba(158, 43, 47, 0.4); }
.topbar__badge-ico { font-size: 13px; }
.topbar__badge-sep { color: rgba(158, 43, 47, 0.4); }
.topbar__badge-link { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* первый экран — ровно один блок без прокрутки */
#screen-intro { min-height: calc(100svh - 60px); display: flex; flex-direction: column; }

/* герой */
.hero { flex: 1 1 auto; padding: 12px 22px 4px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--accent-deep); background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 16px; box-shadow: 0 1px 2px rgba(20, 20, 30, 0.04); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(14, 159, 110, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(14, 159, 110, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(14, 159, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(14, 159, 110, 0); } }

.hero__title { font-size: clamp(27px, 4.9vw, 54px); line-height: 1.18; letter-spacing: -0.03em; font-weight: 800; margin: 10px 0 0; max-width: 100%; }
.hl { display: inline-block; line-height: 0.8; padding: 0.08em 0.13em; border-radius: 6px; background: var(--accent); color: #fff; vertical-align: baseline; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero__sub { font-size: clamp(15px, 1.9vw, 18px); color: var(--muted); max-width: 620px; margin: 12px 0 0; line-height: 1.45; }

/* сканер */
.scanner { display: flex; gap: 6px; margin-top: 18px; width: 100%; max-width: 680px; background: var(--surface); border: 2px solid var(--accent); border-radius: 999px; padding: 6px; box-shadow: 0 12px 30px -14px rgba(158, 43, 47, 0.4); transition: box-shadow 0.15s; }
.scanner:focus-within { box-shadow: 0 0 0 4px rgba(158, 43, 47, 0.15), 0 12px 30px -14px rgba(158, 43, 47, 0.4); }
.scanner__field { flex: 1; display: flex; align-items: center; padding-left: 18px; min-width: 0; }
.scanner__input { flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 15px; padding: 16px 6px; min-width: 0; }
.scanner__input::placeholder { color: var(--muted-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r); font-family: inherit; font-weight: 700; font-size: 15.5px; cursor: pointer; padding: 16px 26px; white-space: nowrap; transition: transform 0.08s, background 0.15s, opacity 0.15s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-radius: 999px; }
.btn--primary:hover { background: var(--accent-strong); }
.btn--primary:disabled { opacity: 0.6; cursor: progress; }
.btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); font-size: 14px; padding: 11px 16px; border-radius: var(--r); }
.btn--ghost:hover { border-color: var(--muted-2); }
.btn__arrow { transition: transform 0.15s; }
.btn--primary:hover .btn__arrow { transform: translateX(3px); }

.scanner__note { margin-top: 11px; font-size: 13px; color: var(--muted-2); max-width: 540px; }
.scanner__note[data-err='1'] { color: var(--crit); }

/* основатель */
.founder { display: inline-flex; align-items: center; gap: 12px; margin-top: 16px; padding: 7px 18px 7px 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 1px 2px rgba(20, 20, 30, 0.04); }
.founder__photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.founder__text { margin: 0; font-size: 14px; color: var(--muted); text-align: left; }
.founder__text strong { color: var(--text); font-weight: 700; }
.founder__sep { color: var(--line-2); margin: 0 4px; }
.founder__quote { color: var(--accent-deep); font-style: italic; }

/* бегущие ошибки */
.chips { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-bottom: 16px; }
.chips__viewport { min-width: 0; overflow-x: clip; overflow-y: visible; padding: 7px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.chips__row { display: flex; gap: 12px; width: max-content; }
.chips__row--move { animation: marquee 96s linear infinite; }
.chips__viewport--move:hover .chips__row--move { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; white-space: nowrap; box-shadow: 0 1px 2px rgba(20, 20, 30, 0.03); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--crit); flex-shrink: 0; }
.chips__row--move .chip { transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; cursor: default; }
.chips__row--move .chip:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 20px -10px rgba(158, 43, 47, 0.5); }

/* лоадер */
.loader { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(251, 250, 246, 0.82); backdrop-filter: blur(6px); padding: 22px; }
.loader__panel { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 26px; box-shadow: 0 24px 60px -24px rgba(20, 20, 30, 0.25); }
.loader__head { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.loader__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.loader__bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 20px; }
.loader__fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.loader__pct { text-align: right; font-size: 12px; color: var(--muted); margin-top: 8px; }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.step { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted-2); transition: color 0.2s; }
.step__ico { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex-shrink: 0; transition: all 0.2s; }
.step.is-active { color: var(--text); }
.step.is-active .step__ico { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(158, 43, 47, 0.16); }
.step.is-done { color: var(--muted); }
.step.is-done .step__ico { background: var(--good); border-color: var(--good); position: relative; }
.step.is-done .step__ico::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }

/* отчёт */
.report { padding: 52px 0 30px; }
.report__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.report__eyebrow { font-size: 12px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.08em; }
.report__host { font-size: clamp(22px, 4vw, 32px); margin: 6px 0 0; letter-spacing: -0.01em; color: var(--accent-deep); }

.report__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-top: 26px; }

.shot__frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: 0 10px 30px -18px rgba(20, 20, 30, 0.3); }
.shot__bar { display: flex; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.shot__bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.shot img { display: block; width: 100%; height: auto; min-height: 200px; background: var(--surface-2); }
.shot__cap { margin: 10px 2px 0; font-size: 12px; color: var(--muted-2); }
.shot__frame.is-empty { display: grid; place-items: center; min-height: 260px; color: var(--muted-2); font-family: 'JetBrains Mono', monospace; font-size: 13px; padding: 20px; text-align: center; }

.score { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: 0 10px 30px -22px rgba(20, 20, 30, 0.25); }
.gauge { transform: rotate(-90deg); }
.gauge__track { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.gauge__fill { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 1.1s ease, stroke 0.4s; }
.score__num { margin-top: -118px; font-size: 42px; font-weight: 800; letter-spacing: -0.02em; }
.score__num i { font-size: 16px; color: var(--muted-2); font-style: normal; font-weight: 500; }
.score__sum { margin: 76px 0 0; font-size: 14px; color: var(--muted); max-width: 240px; }

/* находки */
.findings { margin-top: 30px; display: grid; gap: 24px; }
.fgroup__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fgroup__dot { width: 9px; height: 9px; border-radius: 50%; }
.fgroup__title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.fgroup__count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted-2); }

.fcards { display: grid; gap: 10px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r-sm); padding: 16px 18px; box-shadow: 0 1px 2px rgba(20, 20, 30, 0.03); }
.fcard--critical { border-left-color: var(--crit); }
.fcard--major { border-left-color: var(--major); }
.fcard--minor { border-left-color: var(--minor); }
.fcard--advisory { border-left-color: var(--line-2); }
.fcard__title { font-size: 15.5px; font-weight: 700; margin: 0; }
.fcard__why { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.fcard__fix { margin: 10px 0 0; font-size: 13.5px; color: var(--text); display: flex; gap: 8px; }
.fcard__fix b { color: var(--accent-deep); font-weight: 700; flex-shrink: 0; }

/* заявка */
.cta { margin-top: 36px; background: var(--text); color: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 24px 60px -28px rgba(20, 20, 30, 0.5); }
.cta__title { font-size: 23px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.cta__sub { margin: 10px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 15px; max-width: 560px; }
.lead-form { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.inp { flex: 1; min-width: 180px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--r-sm); color: #fff; font-family: inherit; font-size: 15px; padding: 15px 16px; outline: none; transition: border-color 0.15s; }
.inp:focus { border-color: var(--accent); }
.inp::placeholder { color: rgba(255, 255, 255, 0.5); }
.cta .btn--primary { padding: 15px 26px; }
.lead-done { margin: 18px 0 0; color: #6ee7b7; font-weight: 600; }

@media (max-width: 760px) {
  .topbar__badge { font-size: 11px; padding: 5px 11px; }
  .topbar__badge-sep, .topbar__badge-link { display: none; }
  .hero { padding: 18px 18px 6px; }
  .hero__sub { font-size: 15px; }
  .scanner { flex-direction: column; border-radius: 22px; padding: 8px; gap: 8px; margin-top: 20px; }
  .scanner__field { padding-left: 14px; justify-content: center; }
  .scanner__input { text-align: center; }
  .btn--primary { justify-content: center; width: 100%; padding: 14px 22px; }
  .founder { margin-top: 18px; padding: 7px 14px 7px 7px; }
  .founder__text { font-size: 13px; }
  .chips { gap: 10px; padding-bottom: 16px; }
  .chip { font-size: 12.5px; padding: 9px 13px; }
  .report__grid { grid-template-columns: 1fr; }
  .score__num { margin-top: -116px; }
}

@media (max-width: 760px) and (min-width: 421px) {
  .topbar__badge { font-size: 12px; }
  .topbar__badge-sep, .topbar__badge-link { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .chips__row--move, .pulse, .loader__dot { animation: none; }
  .gauge__fill { transition: none; }
}
