/* zayablo — shell around the board: topbar, later screens, light payoff.
   The board layer itself lives in board.css. */
:root {
  --red: #d52b1e;
  --green: #3a9e3f;
  --ink: #0c0c0d;
  --ink-2: #151517;
  --text: #f2efe8;
  --muted: #8f8c86;
  --paper: #f7f4ee;
  --paper-ink: #14130f;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --pad: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body[data-screen="final"] { background: var(--paper); }

/* topbar ---------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px var(--pad);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: background .4s ease, border-color .4s ease;
}
body[data-screen="final"] .topbar {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom-color: rgba(0,0,0,.09);
}
.brand {
  text-decoration: none; color: var(--text);
  font-weight: 800; font-size: 19px; letter-spacing: -.02em;
}
.brand .tld { color: var(--red); }
body[data-screen="final"] .brand { color: var(--paper-ink); }
.about-link {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,.2);
}
body[data-screen="final"] .about-link { color: #6d6a63; border-bottom-color: rgba(0,0,0,.2); }

/* screens --------------------------------------------------------------- */
.screen { display: none; }
.screen.on { display: block; animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wrap { max-width: 640px; margin: 0 auto; padding: 28px var(--pad) 64px; }

/* buttons --------------------------------------------------------------- */
.cta {
  display: block; width: 100%; margin: 26px 0 0;
  padding: 17px 20px; border: 0; border-radius: 2px;
  background: var(--text); color: var(--ink);
  font-family: inherit; font-size: 18px; font-weight: 800; letter-spacing: -.01em;
  cursor: pointer;
}
.cta:active { transform: translateY(1px); }
.cta.red { background: var(--red); color: #fff; }
body[data-screen="final"] .cta:not(.red) { background: var(--paper-ink); color: var(--paper); }

/* section headers ------------------------------------------------------- */
.sect {
  margin: 4px 0 4px;
  font-size: clamp(30px, 9vw, 46px); line-height: 1; letter-spacing: -.03em;
  font-weight: 800; text-transform: uppercase;
}
.sub { margin: 0 0 22px; color: var(--muted); font-size: 15px; }

/* root viz -------------------------------------------------------------- */
.rootviz { margin: 10px 0 0; }
.rootviz svg { width: 100%; height: auto; display: block; }
.rv-line { fill: none; stroke: rgba(255,255,255,.28); stroke-width: 1.2; }
.rv-line.hot { stroke: var(--red); stroke-width: 2; }
.rv-label { fill: #b8b4ac; font-size: 11px; font-family: var(--sans); }
.rv-label.hot { fill: var(--text); font-weight: 700; }
.rv-core { fill: var(--red); }
.rv-core-text { fill: #fff; font-weight: 800; font-family: var(--sans); letter-spacing: -.02em; }
.warlink {
  margin: 18px 0 0; font-size: 20px; font-weight: 700; line-height: 1.35; letter-spacing: -.02em;
}
.warlink span { color: var(--muted); font-weight: 600; display: block; font-size: 14px; margin-bottom: 4px; }

/* final ----------------------------------------------------------------- */
.screen.light { color: var(--paper-ink); }

.pledge { margin: 34px 0 0; }
.pledge.first { margin-top: 6px; }
.pledge-h { margin: 0 0 10px; font-size: clamp(26px, 7.5vw, 38px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; }
.pledge-p { margin: 0 0 20px; color: #4a473f; font-size: 16px; }
.bar { height: 14px; background: rgba(0,0,0,.09); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--green); transition: width .8s cubic-bezier(.2,.7,.2,1); }
.bar-nums { margin: 8px 0 0; font-size: 15px; color: #4a473f; font-variant-numeric: tabular-nums; }
.bar-nums strong { color: var(--paper-ink); font-size: 19px; }
.pledge-msg { margin: 12px 0 0; font-size: 15px; font-weight: 700; color: var(--green); min-height: 1.2em; }
.pledge-msg.err { color: var(--red); }
.tg {
  display: block; margin: 18px 0 0; padding: 15px 18px; border-radius: 2px;
  border: 2px solid var(--paper-ink); color: var(--paper-ink);
  text-align: center; text-decoration: none; font-weight: 800; font-size: 17px;
}
.foot { margin: 42px 0 0; padding-top: 20px; border-top: 1px solid rgba(0,0,0,.1); }
.foot p { margin: 0 0 6px; font-size: 13px; color: #6d6a63; }

/* turnstile host — managed widget, only visible when it needs a human.
   Идле-виджет ничего не занимает; когда проверка нужна, она встаёт по центру
   экрана, а не поверх кнопок внизу — иначе перекрывает главную кнопку */
.ts-host { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; }
.ts-host:not(.needed) { pointer-events: none; }
.ts-host.needed {
  top: 50%; bottom: auto; transform: translate(-50%, -50%);
  padding: 8px; border-radius: 4px;
  background: var(--ink-2); box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
body[data-screen="final"] .ts-host.needed { background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.ts-hint {
  position: fixed; left: 50%; top: calc(50% - 62px); transform: translateX(-50%); z-index: 60;
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
  background: var(--red); color: #fff; font-size: 14px; font-weight: 700;
}

@media (min-width: 700px) {
  body { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
