/* Шрифты лежат локально: Google Fonts из РФ может быть недоступен */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/onest-cyrillic-400.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/onest-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/onest-cyrillic-600.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/onest-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/onest-cyrillic-700.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/onest-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/unbounded-cyrillic-700.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/unbounded-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #eef1f6;
  --sheet: #ffffff;
  --ink: #1b2147;
  --muted: #565d7e;
  --line: #cbd2e3;
  --grid: rgba(47, 75, 255, .07);
  --blue: #2f4bff;
  --on-blue: #ffffff;
  --sticky: #ffd84d;
  --on-sticky: #2a2300;
  --display: "Unbounded", "Arial Black", sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121630;
    --sheet: #1a1f40;
    --ink: #e8ebf7;
    --muted: #a3aacb;
    --line: #2e355f;
    --grid: rgba(124, 140, 255, .08);
    --blue: #7c8cff;
    --on-blue: #0d1030;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  font: 18px/1.6 var(--text);
}
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--blue); outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .55em; font-weight: 700; }
h1 { font-size: clamp(34px, 5.6vw, 64px); letter-spacing: -0.03em; }
h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.02em; }
h3 { font-size: 19px; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.narrow { max-width: 640px; }

/* Шапка */
.header { background: var(--paper); border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 10; }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; position: relative; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 17px var(--display); letter-spacing: -0.02em; }
.logo-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  background: var(--blue); color: var(--on-blue); border-radius: 50%;
  font: 700 14px var(--display);
}
.nav { display: flex; gap: 2px; align-items: center; }
.nav a { text-decoration: none; font-size: 16px; padding: 8px 12px; border-radius: 6px; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--blue); }
.nav a.nav-invite { margin-left: 8px; background: var(--sticky); color: var(--on-sticky); font-weight: 600; }
.menu-btn {
  display: none; border: 2px solid var(--ink); background: transparent; color: var(--ink);
  font: 600 15px var(--text); padding: 7px 14px; border-radius: 6px; cursor: pointer;
}
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: calc(100% + 2px);
    flex-direction: column; align-items: stretch; padding: 8px 16px 18px;
    background: var(--paper); border-bottom: 2px solid var(--ink);
  }
  .nav.open { display: flex; }
  .nav a.nav-invite { margin: 8px 0 0; text-align: center; }
}

/* Кнопки */
.btn {
  display: inline-block; padding: 14px 24px; border-radius: 8px; border: 2px solid var(--ink);
  font: 600 17px var(--text); text-decoration: none; cursor: pointer; background: transparent; color: var(--ink);
}
.btn-primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn:hover { box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Первый экран главной */
.hero { padding: 72px 0 80px; }
.hero .wrap { display: grid; grid-template-columns: 1fr minmax(0, 1fr); gap: 48px; align-items: center; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 580px; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 48px; } .hero { padding: 48px 0 64px; } }

/* Заголовок внутренних страниц */
.page-head { padding: 64px 0 40px; border-bottom: 2px solid var(--ink); }
.page-head p { font-size: 20px; color: var(--muted); max-width: 640px; margin: 0; }

/* Секции */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); }

/* Три колонки без карточек */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.cols > div { border-top: 3px solid var(--ink); padding-top: 18px; }
.cols p { color: var(--muted); margin: 0; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; gap: 28px; } }

/* Последовательность шагов */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.steps li { counter-increment: s; padding: 0 24px 0 0; position: relative; }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px;
  border-radius: 50%; background: var(--sheet); border: 2px solid var(--ink); font: 700 16px var(--display);
  position: relative; z-index: 1;
}
.steps li::after { content: ""; position: absolute; top: 22px; left: 44px; right: 0; border-top: 2px dashed var(--line); }
.steps li:last-child::after { display: none; }
.steps p { color: var(--muted); font-size: 16px; margin: 0; }
@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps li { padding: 0 0 0 64px; }
  .steps li::before { position: absolute; left: 0; top: 0; margin: 0; }
  .steps li::after { display: none; }
}

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.facts div { background: var(--sheet); border: 2px solid var(--ink); border-radius: 10px; padding: 20px; }
.facts strong { display: block; font: 700 26px var(--display); margin-bottom: 4px; }
.facts span { color: var(--muted); font-size: 15px; }
@media (max-width: 800px) { .facts { grid-template-columns: 1fr 1fr; gap: 12px; } }

/* Подвал */
.footer { border-top: 2px solid var(--ink); padding: 36px 0 48px; color: var(--muted); font-size: 15px; background: var(--paper); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.footer a { color: var(--muted); }

/* Шаги в узкой колонке — всегда вертикально */
.steps.steps-vertical { grid-template-columns: 1fr; gap: 28px; margin-top: 28px; }
.steps.steps-vertical li { padding: 0 0 0 64px; }
.steps.steps-vertical li::before { position: absolute; left: 0; top: 0; margin: 0; }
.steps.steps-vertical li::after { display: none; }

/* Кнопки в шапке */
.nav a.nav-login { margin-left: 10px; border: 2px solid var(--ink); color: var(--ink); font-weight: 600; padding: 6px 14px; }
.nav a.nav-signup { background: var(--sticky); color: var(--on-sticky); font-weight: 600; padding: 8px 16px; margin-left: 6px; }
.nav a.nav-login[aria-current="page"], .nav a.nav-signup[aria-current="page"] { text-decoration: none; box-shadow: 3px 3px 0 var(--blue); }
@media (max-width: 900px) {
  .nav a.nav-login, .nav a.nav-signup { margin: 8px 0 0; text-align: center; }
}

/* Общий редактор — главный акцент первого экрана */
.editor {
  background: #161b3d; color: #dfe4ff; border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 10px 10px 0 var(--blue); overflow: hidden;
  font: 15px/1.75 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #0f1330; border-bottom: 1px solid #2a3166; font-family: var(--text); font-size: 14px; color: #a9b1e6; }
.editor-bar .who { display: flex; }
.editor-bar .who span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--text); border: 2px solid #0f1330; margin-left: -6px; }
.editor pre { margin: 0; padding: 18px 0; overflow-x: auto; }
.editor code { display: block; padding: 0 20px; white-space: pre; }
.editor .ln { color: #4f5794; display: inline-block; width: 28px; user-select: none; }
.k { color: #8fa2ff; } .s { color: #ffd84d; } .c { color: #7d86b8; } .f { color: #9cf0c6; }
.line-hl { background: rgba(124, 140, 255, .12); }
.caret { position: relative; display: inline-block; width: 2px; height: 1.2em; vertical-align: -0.2em; animation: blink 1.1s steps(1) infinite; }
.caret i { position: absolute; bottom: 100%; left: 0; font: 600 11px/1 var(--text); font-style: normal; padding: 3px 6px; border-radius: 4px 4px 4px 0; white-space: nowrap; }
.caret-a { background: var(--sticky); } .caret-a i { background: var(--sticky); color: var(--on-sticky); }
.caret-b { background: #9cf0c6; animation-delay: .5s; } .caret-b i { background: #9cf0c6; color: #0b2a1d; }
.who .a { background: var(--sticky); color: var(--on-sticky); }
.who .b { background: #9cf0c6; color: #0b2a1d; }
.who .c3 { background: var(--blue); color: #fff; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
@media (max-width: 480px) { .editor { font-size: 13px; } }

/* Формы входа и регистрации */
.auth > * { max-width: 560px; }
.auth-card { background: var(--sheet); border: 2px solid var(--ink); border-radius: 14px; padding: 32px; box-shadow: 8px 8px 0 var(--blue); }
.auth-card h2 { font-size: 26px; }
.form { display: grid; gap: 6px; }
.form label { font-weight: 600; font-size: 16px; margin-top: 12px; }
.form label:first-of-type { margin-top: 0; }
.form input {
  width: 100%; padding: 13px 14px; border-radius: 8px; border: 2px solid var(--ink);
  background: var(--paper); color: var(--ink); font: 17px var(--text);
}
.form input.code { font: 600 20px var(--display); letter-spacing: .12em; text-transform: uppercase; }
.form input::placeholder { color: var(--muted); opacity: .7; }
.form .hint { font-size: 14px; color: var(--muted); margin: 0; }
.form .btn { margin-top: 18px; justify-self: start; }
.form-msg { font-size: 16px; min-height: 1.6em; margin: 8px 0 0; }
.form-msg.err { color: #c62828; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-msg.err { color: #ff8a80; } }
.auth-alt { margin: 20px 0 0; font-size: 16px; color: var(--muted); }
.code-field { background: var(--sticky); color: var(--on-sticky); margin: 0 -32px 8px; padding: 18px 32px 20px; }
.code-field label, .code-field .hint { color: var(--on-sticky); }
.code-field input { background: #fff; color: #1b2147; border-color: #1b2147; }
.code-field .hint { margin-top: 6px; }

/* Возможности */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.feature { background: var(--sheet); border: 2px solid var(--ink); border-radius: 12px; padding: 28px; }
.feature p { color: var(--muted); margin: 0; }
.feature ul { color: var(--muted); margin: 14px 0 0; padding-left: 20px; font-size: 16px; }
.feature li + li { margin-top: 4px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

/* Пример прогона CI */
.ci { margin-top: 20px; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; font: 14px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: #161b3d; color: #dfe4ff; }
.ci div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-top: 1px solid #2a3166; }
.ci div:first-child { border-top: 0; background: #0f1330; color: #a9b1e6; font-family: var(--text); }
.ci .ok { color: #9cf0c6; }
.ci .run { color: var(--sticky); }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } }
