/* =============================================================
   yp_bot — лендинг (ypbot.ypkey.ru)
   Палитра и типографика взяты из docs/ROADMAP.html репозитория
   Twitch_bot — тот же визуальный язык, что и у защищённого
   роадмапа. Никаких внешних шрифтов, CDN и картинок.
   ============================================================= */

:root {
  /* --- базовые поверхности (из ROADMAP.html) --- */
  --bg:          #0D1117;
  --surface:     #161B22;
  --surface-2:   #1C2129;
  --border:      #30363D;
  --hairline:    #232932;

  /* --- текст --- */
  --text:        #F0F1F5;
  --ink:         #F7F8FA;
  --muted:       #B4B9C6;

  /* --- янтарь: ник yp_bot и акценты интерфейса --- */
  --brand:       #E9B44C;
  --brand-tint:  rgba(233, 180, 76, 0.13);
  --brand-line:  rgba(233, 180, 76, 0.45);

  /* --- пастельно-зелёный: «выполнено» --- */
  --ok:          #7FB98A;
  --ok-text:     #A8D9B2;
  --ok-tint:     rgba(127, 185, 138, 0.13);
  --ok-line:     rgba(127, 185, 138, 0.45);

  /* --- оранжевая: «осталось» / запланировано --- */
  --plan:        #C97B4F;
  --plan-text:   #E8A87C;
  --plan-tint:   rgba(201, 123, 79, 0.15);
  --plan-line:   rgba(201, 123, 79, 0.50);
  --plan-soft:   rgba(201, 123, 79, 0.45);

  /* --- насыщенный красный: только alpha-метка --- */
  --alpha:       #E5534B;
  --alpha-text:  #FFA198;
  --alpha-tint:  rgba(229, 83, 75, 0.18);
  --alpha-line:  rgba(229, 83, 75, 0.65);

  /* --- кольцо прогресса --- */
  --ring-track:  #30363D;

  /* --- метрики вёрстки --- */
  --content-width: 1280px;
  /* ещё шире — для самых просторных секций */
  --content-width-wide: 1360px;
  --section-space: 30vh;
  --gutter: 1.5rem;

  /* задержка появления блока (JS/ nth-child переопределяют) */
  --reveal-delay: 0ms;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  /* плавная прокрутка включается скриптом с учётом prefers-reduced-motion */
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  /* мягкий тёмный градиент: от #0D1117 к #161B22 */
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(233, 180, 76, 0.05), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 45%, var(--surface) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

svg { display: block; }
svg text { font-family: inherit; }

/* ---------- базовые элементы ---------- */

h1, h2, h3 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

h2 {
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--brand);
  text-decoration-color: var(--brand-line);
  text-underline-offset: 0.25em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover { color: var(--ink); text-decoration-color: var(--brand); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  color: var(--brand);
  text-decoration: none;
}

.skip-link:focus { top: 0.75rem; }

/* ---------- раскладка ---------- */

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--content-width));
  margin-inline: auto;
}

/* Расширенная полоса контента — для широких секций «Обзор» и «Готовность». */
.wrap--wide {
  width: min(100% - (var(--gutter) * 2), var(--content-width-wide));
}

/* Секция с центрированным содержимым: текст внутри блоков остаётся
   слева, но сами блоки центрированы. Ширина колонки общая для
   заголовка и текста — чтобы левые края совпадали.
   680px при кегле 19px — около 65ch: строка читаема,
   на широких мониторах не превращается в бесконечную полосу. */
.section--center {
  --content-column: 680px;
}

.section--center .section-head {
  max-width: var(--content-column);
  margin-inline: auto;
}

.section--center .prose {
  max-width: var(--content-column);
  margin-inline: auto;
}

/* Крупные «воздушные» секции. Разделителей между секциями нет:
   разделение делает воздух (padding-block), а не hairline-линии.
   Основной контент лежит прямо на фоне — без карточек-блоков. */
.section {
  padding-block: var(--section-space);
}

.eyebrow {
  margin: 0 0 1.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  max-width: 62ch;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  color: var(--text);
}

/* Базовый текст ограничен по ширине строки (75ch): на широких
   мониторах длинная строка нечитаема. */
.prose { max-width: 75ch; color: var(--text); }

.section-head { margin-bottom: clamp(2rem, 6vh, 3.5rem); }

/* Текст секций «Обзор» и «Готовность» — крупнее базового
   (основной текст 19px вместо 16px, лид 25px вместо 21px). */
.section--center .lede {
  font-size: clamp(1.28rem, 2.3vw, 1.56rem);
}

.section--center .prose {
  font-size: 1.19rem;
  line-height: 1.7;
}

.section--center .readiness-text {
  font-size: 1.19rem;
  line-height: 1.7;
}

.section--center .readiness-value {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

/* ---------- шапка ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: rgba(13, 17, 23, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* состояние после небольшой прокрутки — класс ставит assets/main.js */
.site-header.is-scrolled {
  background: rgba(13, 17, 23, 0.94);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.8rem;
}

/* Акцентное имя проекта: янтарный цвет в любом контексте.
   Кегль наследуется от окружающего текста, чтобы одинаково
   работать и в шапке, и внутри заголовка, и в абзаце. */
.brand {
  color: var(--brand);
  font-weight: 800;
  font-size: inherit;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* логотип в шапке — собственная величина */
.header-inner .brand {
  font-size: 1.05rem;
}

/* Блок кнопки «Roadmap →» и подписи под ней: колонка, прижатая
   к правому краю шапки. Подпись центрируется точно под кнопкой
   на любой ширине. */
.header-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  text-align: center;
}

/* подпись-тултип под кнопкой; на мобильных скрыта */
.header-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 560px) {
  .header-hint { display: none; }
}

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.85rem 1.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease,
              color 0.25s ease, transform 0.25s ease;
}

.btn:active { transform: translateY(1px); }

/* янтарная обводка — основной акцент лендинга */
.btn-outline {
  border-color: var(--brand-line);
  color: var(--brand);
}

.btn-outline:hover {
  background: var(--brand-tint);
  border-color: var(--brand);
  color: var(--brand);
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.92rem;
}

.btn-ghost {
  border-color: var(--border);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--muted);
  color: var(--ink);
}

/* ---------- hero ---------- */

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 7rem 0 4rem;
}

.hero-inner {
  display: grid;
  justify-items: center;
  gap: 1.6rem;
}

.hero-title {
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--brand);
}

.hero-tagline {
  max-width: 34ch;
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.5;
  color: var(--text);
}

/* чипы версии — как .chip / .chip-alpha в ROADMAP.html */
.chip {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  white-space: nowrap;
}

.chip-alpha {
  background: var(--alpha-tint);
  color: var(--alpha-text);
  border-color: var(--alpha-line);
  font-weight: 700;
}

/* ---------- прогресс: кольцо ---------- */

.readiness {
  display: grid;
  gap: clamp(2rem, 6vh, 3.5rem);
  grid-template-columns: auto 1fr;
  align-items: center;
}

/* «Готовность»: кольцо и текст — единым блоком по центру секции */
.section--center .readiness {
  justify-content: center;
  grid-template-columns: auto minmax(0, 46ch);
  text-align: left;
}

@media (max-width: 720px) {
  .readiness { grid-template-columns: 1fr; justify-items: start; }

  /* на узких экранах центрированный блок «Готовность» становится
     одноколоночным и выравнивается по центру */
  .section--center .readiness {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .section--center .readiness-text,
  .section--center .legend {
    text-align: left;
  }
}

/* очень узкие экраны: крупный текст не должен разъезжаться */
@media (max-width: 480px) {
  .section--center .prose,
  .section--center .readiness-text {
    font-size: 1.08rem;
  }

  .section--center .lede {
    font-size: 1.16rem;
  }
}

.donut {
  width: clamp(160px, 26vw, 230px);
  height: auto;
}

.donut-ring {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 11;
}

/* длину дуги и смещение считает assets/main.js — в разметке нет dasharray */
.donut-arc {
  fill: none;
  stroke: var(--ok);
  stroke-width: 11;
  stroke-linecap: round;
  opacity: 0;
  /* стартовое смещение = полная длина окружности (2·π·54 ≈ 339.29) */
  stroke-dashoffset: 339.29;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 0.8, 0.28, 1),
              opacity 0.5s ease;
}

.donut.is-ready .donut-arc { opacity: 1; }

.donut-num {
  font-size: 28px;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
}

.donut-cap {
  font-size: 10.5px;
  fill: var(--muted);
  text-anchor: middle;
}

.readiness-text { max-width: 46ch; }

.readiness-value {
  display: block;
  margin-bottom: 0.35rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ---------- легенда ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  color: var(--muted);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

/* цветовой образец — тот же приём, что .sw-* в ROADMAP.html */
.sw {
  display: inline-block;
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: var(--ok);
}

.sw-plan {
  background: var(--plan-soft);
}

.sw-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
}

.sw-dot-plan { background: var(--plan-soft); }

/* ---------- этапы пути к релизу ---------- */

.stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hairline);
}

/* лёгкий каскад появления строк — задержка задаётся через nth-child */
.stage-list .stage:nth-child(1)  { transition-delay:   0ms; }
.stage-list .stage:nth-child(2)  { transition-delay:  60ms; }
.stage-list .stage:nth-child(3)  { transition-delay: 120ms; }
.stage-list .stage:nth-child(4)  { transition-delay: 180ms; }
.stage-list .stage:nth-child(5)  { transition-delay: 240ms; }
.stage-list .stage:nth-child(6)  { transition-delay: 300ms; }
.stage-list .stage:nth-child(7)  { transition-delay: 360ms; }
.stage-list .stage:nth-child(8)  { transition-delay: 420ms; }
.stage-list .stage:nth-child(9)  { transition-delay: 480ms; }
.stage-list .stage:nth-child(10) { transition-delay: 540ms; }
.stage-list .stage:nth-child(11) { transition-delay: 600ms; }
.stage-list .stage:nth-child(12) { transition-delay: 660ms; }
.stage-list .stage:nth-child(13) { transition-delay: 720ms; }

/* каскад появления в hero */
.hero-inner .reveal:nth-child(1) { transition-delay:   0ms; }
.hero-inner .reveal:nth-child(2) { transition-delay:  90ms; }
.hero-inner .reveal:nth-child(3) { transition-delay: 180ms; }
.hero-inner .reveal:nth-child(4) { transition-delay: 270ms; }

.stage {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--hairline);
}

@media (max-width: 640px) {
  .stage { grid-template-columns: 12px minmax(0, 1fr); }
  .stage-bar { grid-column: 2; }
}

/* цветовой индикатор состояния — точка, а не символ */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
}

.dot-plan { background: var(--plan-soft); }

.stage-name {
  color: var(--ink);
  font-weight: 600;
}

.stage-index {
  color: var(--muted);
  font-weight: 500;
  margin-right: 0.6rem;
}

/* мини-индикатор этапа: трек + заливка состоянием */
.bar-track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--ok);
}

.bar-fill-plan { background: var(--plan-soft); }

.footnote {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- подвал ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: 2.5rem 3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer-inner p { margin: 0; }

/* ---------- модальное окно пароля ---------- */

.gate {
  width: min(92vw, 420px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.gate::backdrop {
  background: rgba(13, 17, 23, 0.74);
  backdrop-filter: blur(3px);
}

.gate-inner {
  display: grid;
  gap: 1rem;
  padding: 1.8rem;
}

.gate-title {
  font-size: 1.3rem;
  color: var(--ink);
}

.gate-note {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.gate-field {
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.gate-input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}

.gate-input::placeholder { color: var(--muted); }

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

/* ---------- тост ---------- */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  z-index: 90;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-ok {
  background: var(--ok-tint);
  border-color: var(--ok-line);
  color: var(--ok-text);
}

.toast-err {
  background: var(--alpha-tint);
  border-color: var(--alpha-line);
  color: var(--alpha-text);
}

/* ---------- появление блоков ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* якоря не должны заезжать под фиксированную шапку */
html {
  scroll-padding-top: 5rem;
}

/* ---------- отключение анимаций по запросу системы ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .donut-arc { transition: none; }
}
