:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #0071e3;
  --accent-2: #7b61ff;
  --danger: #e3002b;
  --success: #1f9d55;
  --warn: #c76a00;
  --code-bg: #0f1117;
  --code-text: #d4d7de;
  --seg-active: #ffffff;
  --glow: rgba(0, 113, 227, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-soft: #141416;
  --card: #1c1c1e;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #86868b;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #2997ff;
  --accent-2: #9d8cff;
  --danger: #ff453a;
  --success: #30d158;
  --warn: #ff9f0a;
  --seg-active: #3a3a3c;
  --glow: rgba(41, 151, 255, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.47;
  overflow-x: clip;   /* свечение первого экрана не должно давать горизонтальную прокрутку */
  transition: background .4s, color .4s;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
a { color: inherit; }

/* ── Навигация ── */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(20px, calc((100vw - 1080px) / 2));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.3px; text-decoration: none; }
.brand-mark { width: 18px; height: 18px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.nav nav { display: flex; align-items: center; gap: 26px; }
.nav nav a { font-size: 13px; color: var(--text-2); text-decoration: none; transition: color .2s; }
.nav nav a:hover { color: var(--text); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--text-2); cursor: pointer;
  transition: color .2s, transform .1s;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

main { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── Первый экран ── */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1fr 1.08fr; gap: 48px; align-items: center;
  min-height: calc(100vh - 61px); padding: 64px 0;
}
.hero-glow {
  position: absolute; inset: 10% -10% auto auto; width: 620px; height: 620px; z-index: -1;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  filter: blur(10px);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.12) translate(-20px, 10px); opacity: .7; } }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); margin: 0 0 14px; letter-spacing: .02em; }
h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; margin: 0 0 20px; }
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--text-2); margin: 0 0 32px; max-width: 520px; }
.hero-cta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

/* появление первого экрана */
.hero-text > * { opacity: 0; transform: translateY(16px); animation: rise .8s var(--ease) forwards; }
.hero-text > :nth-child(2) { animation-delay: .08s; }
.hero-text > :nth-child(3) { animation-delay: .16s; }
.hero-text > :nth-child(4) { animation-delay: .24s; }
.demo { opacity: 0; transform: translateY(24px) scale(.98); animation: rise 1s var(--ease) .3s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* демо-окно */
.demo {
  background: var(--code-bg); border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45), 0 0 0 0.5px rgba(255, 255, 255, .08);
  color: var(--code-text);
}
.demo-bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #3a3d46; }
.dot:nth-child(1) { background: #ff5f57; } .dot:nth-child(2) { background: #febc2e; } .dot:nth-child(3) { background: #28c840; }
.demo-file { margin-left: 10px; font: 12px var(--mono); color: #8b90a0; }
.demo-state { margin-left: auto; font-size: 12px; color: #8b90a0; transition: color .3s; }
.demo-state.done { color: #ff6b6b; }
.demo-body { position: relative; padding: 16px 0; min-height: 296px; overflow: hidden; }  /* линия сканирования не выходит за код */
.demo-code { margin: 0; font: 12px/1.75 var(--mono); overflow: hidden; }
.demo-code .ln {
  display: block; padding: 0 22px; white-space: pre;
  opacity: 0; transform: translateX(-6px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), background-color .5s;
}
.demo-code .ln.in { opacity: 1; transform: none; }
.demo-code .ln.hot { background: rgba(255, 69, 58, .14); box-shadow: inset 2px 0 0 #ff453a; }
.demo-code .ln.warm { background: rgba(255, 159, 10, .10); box-shadow: inset 2px 0 0 #ff9f0a; }
.tk-k { color: #ff7ab2; } .tk-t { color: #6bdfff; } .tk-s { color: #fc6a5d; } .tk-c { color: #6c7986; } .tk-n { color: #d9c97c; } .tk-p { color: #a167e6; }

.scanline {
  position: absolute; left: 0; right: 0; top: 0; height: 56px; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, transparent, rgba(41, 151, 255, .18) 70%, rgba(41, 151, 255, .55));
  border-bottom: 1px solid rgba(41, 151, 255, .9);
}
.scanline.run { animation: scan var(--scan-time, 1.6s) var(--ease) forwards; }
@keyframes scan {
  0% { opacity: 0; transform: translateY(-56px); }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--scan-to, 300px)); }
}

.demo-foot { display: flex; align-items: center; gap: 18px; padding: 16px 22px 20px; border-top: 1px solid rgba(255, 255, 255, .06); }
.ring { width: 64px; height: 64px; transform: rotate(-90deg); flex: none; }
.ring-track { fill: none; stroke: rgba(127, 127, 127, .22); stroke-width: 10; }
.ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.2s var(--ease), stroke .4s;
}
.demo-score { display: flex; flex-direction: column; }
.demo-num { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.demo-verdict { font-size: 13px; color: #8b90a0; }

/* ── Кнопки ── */
.primary {
  display: inline-block; border: 0; background: var(--text); color: var(--bg); font: inherit; font-size: 17px; font-weight: 500;
  padding: 13px 30px; border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: transform .15s, opacity .2s, box-shadow .3s;
}
.primary:hover { box-shadow: 0 8px 24px -8px var(--glow), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.primary:active { transform: scale(.97); }
.primary:disabled { opacity: .55; cursor: default; }
.ghost { border: 0; background: var(--bg-soft); color: var(--text); font: inherit; font-size: 15px; padding: 11px 22px; border-radius: 999px; cursor: pointer; transition: background .2s; }
.ghost:hover { background: color-mix(in srgb, var(--bg-soft) 70%, var(--line)); }
.link { color: var(--accent); text-decoration: none; font-size: 17px; }
.link:hover { text-decoration: underline; }

/* ── Блоки ── */
.block { padding: 120px 0 0; text-align: center; }
.block h2 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.03em; font-weight: 700; margin: 0 0 12px; }
.block-lead { font-size: 19px; color: var(--text-2); margin: 0 0 48px; }

/* появление при прокрутке */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ── Проверка ── */
.checker-card {
  max-width: 820px; margin: 0 auto; text-align: left;
  background: var(--card); border-radius: 26px; padding: 22px;
  box-shadow: 0 0 0 0.5px var(--line), 0 24px 60px -30px rgba(0, 0, 0, .3);
}
.checker-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lang-badge { font: 600 13px var(--mono); padding: 6px 14px; border-radius: 999px; background: var(--bg-soft); color: var(--accent); }
.counter { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.segmented { position: relative; display: inline-flex; background: var(--bg-soft); border-radius: 999px; padding: 3px; }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 999px; background: var(--seg-active);
  box-shadow: 0 0 0 0.5px var(--line), 0 1px 3px rgba(0, 0, 0, .1);
  transition: transform .35s var(--ease), width .35s var(--ease);
}
.seg { position: relative; z-index: 1; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; padding: 7px 26px; border-radius: 999px; cursor: pointer; transition: color .25s; }
.seg.active { color: var(--text); font-weight: 500; }

.editor-wrap { position: relative; border-radius: 16px; overflow: hidden; }
.editor {
  display: block; width: 100%; height: 280px; resize: vertical;
  background: var(--code-bg); color: var(--code-text); border: 0;
  padding: 20px 22px; font: 13px/1.7 var(--mono); outline: none; transition: box-shadow .2s;
}
.editor::placeholder { color: #5d6270; }
.editor:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); }
.editor-wrap.scanning .editor { filter: saturate(.7); }
.error { color: var(--danger); font-size: 14px; margin: 12px 4px 0; }
.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* результат */
.result { max-width: 820px; margin: 48px auto 0; }
.result.enter { animation: rise .7s var(--ease); }
.result-main { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.ring-big { width: 220px; height: 220px; }
.ring-big .ring-track, .ring-big .ring-fill { stroke-width: 8; }
.result-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.result-num { font-size: 64px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.result-num small { font-size: .45em; font-weight: 600; }
.result-cap { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.verdict { font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em; margin: 22px 0 0; }
.tone-danger { color: var(--danger); } .tone-warn { color: var(--warn); } .tone-ok { color: var(--success); }
.stroke-danger { stroke: var(--danger) !important; } .stroke-warn { stroke: var(--warn) !important; } .stroke-ok { stroke: var(--success) !important; }

.fragments { max-width: 560px; margin: 28px auto 0; text-align: left; }
.fragments-title { font-size: 13px; color: var(--text-3); margin: 0 0 10px; }
.frag { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; opacity: 0; transform: translateY(6px); animation: rise .5s var(--ease) forwards; }
.frag-lines { color: var(--text-2); font-variant-numeric: tabular-nums; }
.frag-bar { height: 6px; background: var(--bg-soft); border-radius: 3px; overflow: hidden; }
.frag-bar i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .9s var(--ease); }
.frag-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.meta { font-size: 12px; color: var(--text-3); margin: 22px 0 0; }
.disclaimer { font-size: 13px; color: var(--text-3); margin: 44px auto 0; max-width: 480px; }

/* ── Как работает ── */
.pipeline { position: relative; max-width: 720px; margin: 0 auto; text-align: left; }
.pipe-line { position: absolute; left: 17px; top: 18px; bottom: 18px; width: 4px; height: calc(100% - 36px); }
.pipe-track { stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pipe-progress {
  stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke;
  stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .15s linear;
}
.step { position: relative; display: flex; gap: 22px; padding: 0 0 44px; }
.step:last-child { padding-bottom: 0; }
.num {
  flex: none; position: relative; z-index: 1;
  display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--line);
  font-size: 15px; font-weight: 600; color: var(--text-2);
  transition: background .4s, color .4s, box-shadow .4s;
}
.step.lit .num { background: var(--accent); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent); }
.step h3 { font-size: 21px; margin: 6px 0 6px; letter-spacing: -0.01em; font-weight: 600; }
.step p { margin: 0; color: var(--text-2); font-size: 16px; }

.tokens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; min-height: 30px; font: 13px var(--mono); }
.tok {
  padding: 4px 9px; border-radius: 8px; background: var(--bg-soft); box-shadow: inset 0 0 0 0.5px var(--line);
  opacity: 0; transform: translateY(8px) scale(.9);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.tok.in { opacity: 1; transform: none; }
.tok.kw { color: #d63384; } .tok.ty { color: var(--accent); } .tok.id { color: var(--text); } .tok.op { color: var(--text-3); }
:root[data-theme="dark"] .tok.kw { color: #ff7ab2; }

/* ── Качество ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--bg-soft); border-radius: 24px; padding: 34px 24px 28px; }
.stat-num { font-size: 56px; font-weight: 700; letter-spacing: -0.05em; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-unit { font-size: 28px; font-weight: 700; color: var(--accent-2); }
.stat p { margin: 10px 0 0; color: var(--text); font-size: 15px; }
.stat p span { color: var(--text-3); font-size: 13px; }
.footnote { font-size: 13px; color: var(--text-3); margin: 26px auto 0; max-width: 560px; }

/* ── Команда ── */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 300px)); justify-content: center; gap: 16px; }
.person, .member { background: var(--bg-soft); border-radius: 22px; padding: 30px 22px; transition: transform .3s var(--ease); }
.person:hover { transform: translateY(-4px); }
.avatar { display: inline-flex; width: 60px; height: 60px; border-radius: 50%; align-items: center; justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, var(--bg)), color-mix(in srgb, var(--accent-2) 20%, var(--bg)));
  font-size: 19px; font-weight: 600; color: var(--text); }
.role { font-size: 13px; color: var(--text-3); margin: 16px 0 2px; }
.name { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.members-title { margin-top: 56px; font-size: 15px; }

.marquee {
  overflow: hidden; margin-top: 20px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: 16px; padding-right: 16px; }
@keyframes marquee { to { transform: translateX(-50%); } }
.member { width: 210px; flex: none; padding: 26px 18px; }
.member .avatar { width: 52px; height: 52px; font-size: 17px; }
.member .name { font-size: 16px; }

.about { margin: 88px auto 0; max-width: 640px; padding: 40px 28px; background: var(--bg-soft); border-radius: 24px; }
.about p { margin: 0; }
.about-main { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.about-dir { color: var(--text-2); font-size: 15px; margin-top: 10px !important; }
.about-year { color: var(--text-3); font-size: 13px; margin-top: 14px !important; }

.footer {
  max-width: 1080px; margin: 120px auto 0; padding: 22px 20px 36px; border-top: 0.5px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 12px; color: var(--text-3);
}

/* ── Адаптив ── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 56px 0 24px; gap: 40px; }
  .hero-glow { inset: 0 auto auto 50%; transform: translateX(-50%); width: 420px; height: 420px; }
}
@media (max-width: 600px) {
  .nav nav a { display: none; }
  .block { padding-top: 88px; }
  .frag { grid-template-columns: 92px 1fr 44px; }
  .demo-code { font-size: 11.5px; }
}

/* ── Уменьшенное движение ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal, .hero-text > *, .demo { opacity: 1; transform: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
  .marquee-track { animation: none; }
  .marquee-group[aria-hidden="true"] { display: none; }
}
