/* Ru-Guard — сайт и формы входа. Тёмная тема; шрифты локальные. */
@import url("fonts/fonts-local.css");

:root {
  --bg: #0f1114;
  --bg-2: #13161a;
  --surface: #171a1f;
  --surface-2: #1d2127;
  --rule: #272c34;
  --rule-2: #343a44;
  --text: #e8ebf0;
  --muted: #9aa2ae;
  --faint: #6c7480;
  --steel: #8fb0e8;
  --steel-ink: #b9cdf2;
  /* статусы решения — проверены валидатором палитры на тёмной поверхности */
  --allow: #2f9a6c;
  --monitor: #4a88d0;
  --throttle: #b98420;
  --challenge: #9468d0;
  --block: #d8464c;
  --sans: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --wrap: 1240px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, svg { display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 3px; border-radius: 6px; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 12px; font: 600 16px/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; white-space: nowrap; }
.btn-primary { background: var(--text); color: #0f1114; }
.btn-primary:hover { background: #ffffff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--rule-2); }
.btn-ghost:hover { border-color: var(--steel); }
.btn-small { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }

/* ---------- верхняя панель ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(15,17,20,.86); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.nav.scrolled { border-bottom-color: var(--rule); }
.nav .wrap { display: flex; align-items: center; height: 72px; gap: 36px; }
.logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 650; font-size: 19px; text-decoration: none; letter-spacing: .01em; }
.nav-links { display: flex; gap: 28px; font-size: 15px; color: var(--muted); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; gap: 10px; }

/* ---------- первый экран ---------- */
.hero { padding: 96px 0 72px; position: relative; }
.badge { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border: 1px solid var(--rule-2); border-radius: 999px; font-size: 14px; color: var(--muted); }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--allow); display: inline-block; }
.hero h1 { font-size: clamp(44px, 6.4vw, 86px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 650; margin: 28px 0 0; max-width: 1050px; }
.kinetic { display: inline-block; color: var(--steel-ink); min-width: 4ch; }
.kinetic span { display: inline-block; transition: opacity .35s ease, transform .35s ease; }
.kinetic span.out { opacity: 0; transform: translateY(-14px); }
.kinetic span.in { opacity: 0; transform: translateY(14px); }
.hero .sub { font-size: 21px; line-height: 1.5; color: var(--muted); max-width: 720px; margin: 28px 0 40px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* живая лента решений на первом экране */
.stream { margin-top: 72px; border: 1px solid var(--rule); border-radius: 18px; background: var(--bg-2); overflow: hidden; }
.stream-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.stream-head .live { display: inline-flex; gap: 8px; align-items: center; }
.stream-head .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--allow); }
.stream-row { display: grid; grid-template-columns: 110px 1fr 220px 140px; gap: 18px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--rule); font-size: 15px; }
.stream-row:last-child { border-bottom: 0; }
.stream-row .t { color: var(--faint); font-family: var(--mono); font-size: 13px; }
.stream-row .who { color: var(--muted); font-size: 14px; }
.stream-row.enter { animation: rowIn .5s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); background: #1a1f27; } to { opacity: 1; transform: none; background: transparent; } }

/* метка решения: знак + подпись, цвет — только у знака */
.st { display: inline-flex; align-items: center; gap: 9px; font: 600 13px/1 var(--sans); letter-spacing: .04em; color: var(--text); }
.st i { font-style: normal; width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 6px; font-size: 13px; color: #fff; }
.st.allow i { background: var(--allow); } .st.monitor i { background: var(--monitor); }
.st.throttle i { background: var(--throttle); } .st.challenge i { background: var(--challenge); }
.st.block i { background: var(--block); }

/* ---------- полоса доказательств ---------- */
.proof { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.proof .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.proof .cell { padding: 34px 28px 34px 0; border-right: 1px solid var(--rule); }
.proof .cell + .cell { padding-left: 28px; }
.proof .cell:last-child { border-right: 0; }
.proof .n { font-size: 40px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.05; }
.proof .d { color: var(--muted); font-size: 15px; margin-top: 8px; line-height: 1.45; }
.proof-note { font-size: 13px; color: var(--faint); padding: 14px 0 0; }

/* ---------- секции ---------- */
section.block { padding: 120px 0; border-bottom: 1px solid var(--rule); }
.eyebrow { font-size: 15px; color: var(--steel); margin-bottom: 18px; font-weight: 500; }
h2 { font-size: clamp(34px, 4vw, 54px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 640; margin: 0; max-width: 900px; }
.lede { font-size: 19px; color: var(--muted); max-width: 720px; margin-top: 22px; line-height: 1.6; }

/* кто / что / право — типографские строки */
.triad { margin-top: 64px; border-top: 1px solid var(--rule); }
.triad-row { display: grid; grid-template-columns: 300px 1fr 1fr; gap: 48px; padding: 36px 0; border-bottom: 1px solid var(--rule); }
.triad-row h3 { font-size: 40px; font-weight: 640; letter-spacing: -0.02em; margin: 0; }
.triad-row p { margin: 0; color: var(--muted); font-size: 17px; }
.triad-row b { color: var(--text); font-weight: 600; }

/* путь запроса — следует за прокруткой */
.path { display: grid; grid-template-columns: 360px 1fr; gap: 72px; margin-top: 64px; }
.path-rail { position: sticky; top: 120px; align-self: start; }
.path-rail ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.path-rail li { padding: 10px 0 10px 22px; color: var(--faint); font-size: 17px; position: relative; transition: color .2s ease; }
.path-rail li::before { content: ""; position: absolute; left: -4px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--rule-2); transition: background .2s ease; }
.path-rail li.on { color: var(--text); }
.path-rail li.on::before { background: var(--steel); }
.path-steps { display: grid; gap: 22px; }
.path-step { border: 1px solid var(--rule); border-radius: var(--radius); padding: 30px 32px; background: var(--bg-2); }
.path-step h3 { margin: 0 0 10px; font-size: 24px; font-weight: 620; }
.path-step p { margin: 0; color: var(--muted); }
.path-step .why { margin-top: 14px; font-size: 15px; color: var(--faint); }

/* пять реакций — лестница */
.ladder { margin-top: 64px; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.rung { display: grid; grid-template-columns: 200px 1fr 1fr 280px; gap: 32px; padding: 26px 0; border-bottom: 1px solid var(--rule); align-items: start; font-size: 16px; }
.rung .eff { color: var(--muted); }
.rung .code { font-family: var(--mono); font-size: 13px; color: var(--faint); margin-top: 6px; }
.rung .ex { color: var(--muted); font-size: 15px; }
.rung .meter { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 10px; position: relative; overflow: hidden; }
.rung .meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }

/* агенты: политика и решения */
.split { display: grid; grid-template-columns: 440px 1fr; gap: 56px; margin-top: 64px; align-items: start; }
.code-card { border: 1px solid var(--rule); border-radius: var(--radius); background: #0c0e11; padding: 24px 26px; font-family: var(--mono); font-size: 14px; line-height: 1.7; color: #c7cdd7; white-space: pre; overflow-x: auto; }
.code-card .k { color: var(--steel-ink); }
.calls { width: 100%; border-collapse: collapse; font-size: 16px; }
.calls th { text-align: left; color: var(--faint); font-weight: 500; font-size: 13px; padding: 0 16px 12px 0; border-bottom: 1px solid var(--rule); }
.calls td { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.calls td .mono { font-size: 13px; color: var(--faint); display: block; margin-top: 4px; }

/* журнал: цепочка */
.chain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 64px; }
.link { border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; background: var(--bg-2); position: relative; }
.link:not(:last-child)::after { content: "→"; position: absolute; right: -22px; top: 44%; color: var(--steel); }
.link .n { font-size: 13px; color: var(--faint); }
.link .ty { font-size: 16px; margin: 6px 0 12px; }
.link .h { font-family: var(--mono); font-size: 12px; color: var(--steel-ink); word-break: break-all; }
.link .p { font-family: var(--mono); font-size: 12px; color: var(--faint); word-break: break-all; margin-top: 6px; }
.tamper { margin-top: 28px; display: grid; gap: 10px; }
.tamper div { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 14px 18px; border-radius: 10px; background: var(--surface); font-size: 15px; }
.tamper div span:last-child { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* превью консоли */
.preview { margin-top: 64px; border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; background: var(--bg-2); }
.preview-bar { display: flex; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.preview-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--rule-2); }
.preview-body { display: grid; grid-template-columns: 220px 1fr; min-height: 420px; }
.preview-side { border-right: 1px solid var(--rule); padding: 22px 18px; display: grid; gap: 6px; align-content: start; font-size: 14px; color: var(--muted); }
.preview-side span { padding: 8px 12px; border-radius: 8px; }
.preview-side span.on { background: var(--surface-2); color: var(--text); }
.preview-main { padding: 26px 28px; display: grid; gap: 22px; align-content: start; }
.preview-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.preview-tiles div { border: 1px solid var(--rule); border-radius: 12px; padding: 16px; }
.preview-tiles b { display: block; font-size: 26px; font-weight: 650; }
.preview-tiles span { font-size: 13px; color: var(--muted); }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 0 2px; border-bottom: 1px solid var(--rule); }
.mini-bars i { flex: 1; max-width: 14px; border-radius: 3px 3px 0 0; }

/* подключение */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 64px; border-top: 1px solid var(--rule); }
.mode { padding: 34px 32px 0 0; }
.mode + .mode { padding-left: 32px; border-left: 1px solid var(--rule); }
.mode h3 { font-size: 22px; margin: 0 0 10px; font-weight: 620; }
.mode p { margin: 0; color: var(--muted); font-size: 16px; }
.mode .mono { font-size: 13px; color: var(--faint); margin-top: 14px; display: block; }

/* пилот */
.pilot { counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 48px; margin-top: 64px; }
.pilot div { counter-increment: s; border-top: 1px solid var(--rule); padding-top: 20px; }
.pilot div::before { content: counter(s, decimal-leading-zero); color: var(--steel); font-weight: 650; font-size: 15px; display: block; margin-bottom: 10px; }
.pilot h3 { margin: 0 0 8px; font-size: 19px; font-weight: 620; }
.pilot p { margin: 0; color: var(--muted); font-size: 15px; }

/* финал */
.closing { padding: 140px 0; }
.closing blockquote { margin: 0; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.18; letter-spacing: -0.015em; font-weight: 600; max-width: 1050px; }
.closing .ctas { margin-top: 44px; display: flex; gap: 12px; }

footer { padding: 36px 0 48px; color: var(--faint); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* ---------- формы входа и регистрации ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { border-right: 1px solid var(--rule); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; background: var(--bg-2); }
.auth-side h2 { font-size: 40px; margin-top: 40px; }
.auth-side ul { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 14px; color: var(--muted); font-size: 16px; }
.auth-side li { padding-left: 20px; position: relative; }
.auth-side li::before { content: ""; position: absolute; left: 0; top: 11px; width: 8px; height: 2px; background: var(--steel); }
.auth-main { display: grid; place-items: center; padding: 48px 32px; }
.form { width: 100%; max-width: 420px; }
.form h1 { font-size: 34px; letter-spacing: -0.02em; margin: 0 0 8px; font-weight: 640; }
.form .hint { color: var(--muted); margin: 0 0 32px; font-size: 16px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 14px; color: var(--muted); }
.field input { height: 50px; border-radius: 11px; border: 1px solid var(--rule-2); background: var(--surface); color: var(--text); padding: 0 16px; font: 16px var(--sans); transition: border-color .15s ease; }
.field input:focus { border-color: var(--steel); outline: none; }
.field .help { font-size: 13px; color: var(--faint); }
.form .btn { width: 100%; justify-content: center; margin-top: 8px; height: 52px; }
.form .alt { margin-top: 22px; font-size: 15px; color: var(--muted); text-align: center; }
.form .alt a { color: var(--steel-ink); }
.msg { padding: 13px 15px; border-radius: 10px; font-size: 15px; margin-bottom: 18px; display: none; line-height: 1.45; }
.msg.err { display: block; background: #2a1719; border: 1px solid #4a2326; color: #f2c4c6; }
.msg.ok { display: block; background: #15261e; border: 1px solid #22432f; color: #bfe3cd; }
.strength { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; transition: width .2s ease, background .2s ease; }

/* ---------- адаптивность ---------- */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .stream-row { grid-template-columns: 80px 1fr 130px; }
  .stream-row .who { display: none; }
  .proof .wrap { grid-template-columns: 1fr 1fr; }
  .proof .cell { border-right: 0; border-bottom: 1px solid var(--rule); padding-left: 0 !important; }
  .triad-row, .path, .split, .rung { grid-template-columns: 1fr; gap: 14px; }
  .path-rail { position: static; }
  .chain, .modes, .pilot, .preview-tiles { grid-template-columns: 1fr 1fr; }
  .mode + .mode { border-left: 0; padding-left: 0; }
  .preview-body { grid-template-columns: 1fr; }
  .preview-side { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .chain, .modes, .pilot, .proof .wrap, .preview-tiles { grid-template-columns: 1fr; }
  .link:not(:last-child)::after { display: none; }
  .nav-actions .btn-ghost { display: none; }
  .tamper div { grid-template-columns: 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
