* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a14;
  --surface: rgba(255, 255, 255, 0.03);
  --line: rgba(179, 157, 255, 0.22);
  --line-strong: rgba(179, 157, 255, 0.45);
  --text: #ecebf5;
  --muted: #8b8aa3;
  --lav: #b39dff;
  --lav-soft: #c4b0ff;
  --pink: #f0a3e0;
  --glow: rgba(179, 157, 255, 0.35);
  --user-bubble: #45356e;
  --bot-bubble: #1c1a2c;
  --display: "Unbounded", "Golos Text", sans-serif;
  --body: "Golos Text", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--bg); color: var(--text);
  line-height: 1.6; font-size: 1rem;
  overflow-x: hidden;
}

a { color: var(--lav-soft); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--lav); outline-offset: 2px; border-radius: 4px; }

h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  margin-bottom: 1.5rem; letter-spacing: 0.01em;
}
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--lav-soft); }
b { color: #fff; font-weight: 600; }

/* ---------- атмосфера: звёзды и скан-линии ---------- */

.stars {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #cfc6f7 50%, transparent 51%),
    radial-gradient(1px 1px at 130px 90px, #9d8fd6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 260px 40px, #f0a3e0 50%, transparent 51%),
    radial-gradient(1px 1px at 340px 150px, #cfc6f7 50%, transparent 51%),
    radial-gradient(1px 1px at 470px 70px, #8b8aa3 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 560px 190px, #b39dff 50%, transparent 51%);
  background-size: 620px 240px;
  animation: twinkle 5s ease-in-out infinite alternate;
}

.scanlines {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 3px);
  animation: flick 6s steps(60) infinite;
}

@keyframes twinkle { from { opacity: 0.5; } to { opacity: 1; } }
@keyframes flick { 0%, 96% { opacity: 1; } 97% { opacity: 0.55; } 98% { opacity: 0.9; } 100% { opacity: 1; } }

/* ---------- топбар ---------- */

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  max-width: 1060px; margin: 0 auto; padding: 1.1rem 1.25rem;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.05em; }
.topbar-meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--muted); text-align: right; }

/* ---------- хиро ---------- */

.hero {
  position: relative; text-align: center;
  max-width: 1060px; margin: 0 auto;
  padding: 4.5rem 1.25rem 0; overflow: visible;
}

.sys-chip {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em;
  color: var(--lav-soft);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 0.45rem 1.1rem; margin-bottom: 2rem;
  background: rgba(179, 157, 255, 0.06);
}
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--lav); margin-right: 0.6rem;
  box-shadow: 0 0 8px var(--lav);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.chrome {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.1rem, 7.5vw, 4.6rem); line-height: 1.08; letter-spacing: 0.02em;
  display: flex; flex-direction: column;
}
.chrome span {
  background: linear-gradient(100deg,
    #f6f4ff 0%, #cbc0f5 22%, #8f7ad6 40%, #f3eeff 52%, #b39dff 68%, #e9e2ff 85%, #a08ae0 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(179, 157, 255, 0.35));
  animation: chromeShift 7s ease-in-out infinite alternate;
}
@keyframes chromeShift { from { background-position: 0% 0; } to { background-position: 100% 0; } }

.hero-sub { color: var(--muted); max-width: 560px; margin: 1.5rem auto 0; }

.hero-cta {
  display: flex; justify-content: center; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin-top: 2rem; position: relative; z-index: 2;
}
.btn-start {
  font-family: var(--display); font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.08em; text-decoration: none; color: #14101f;
  background: linear-gradient(135deg, var(--lav-soft), var(--pink));
  border-radius: 12px; padding: 0.95rem 1.8rem; min-height: 48px;
  display: inline-flex; align-items: center;
  box-shadow: 0 0 24px var(--glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 0 36px var(--glow); }
.score {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  color: var(--pink); border: 1px solid rgba(240, 163, 224, 0.35);
  border-radius: 99px; padding: 0.55rem 1.1rem;
}

/* горизонт: солнце + сетка */

.horizon { position: relative; height: 370px; margin-top: 2.5rem; overflow: hidden; }
.sun {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 60px;
  width: 260px; height: 260px; border-radius: 50%;
  background:
    repeating-linear-gradient(180deg, transparent 0 18px, var(--bg) 18px 26px),
    linear-gradient(180deg, #d9ccff 0%, var(--lav) 45%, var(--pink) 100%);
  box-shadow: 0 0 80px rgba(179, 157, 255, 0.4);
  animation: sunfloat 7s ease-in-out infinite alternate;
}
@keyframes sunfloat { from { transform: translateX(-50%) translateY(0); } to { transform: translateX(-50%) translateY(-16px); } }

.grid-floor {
  position: absolute; left: -20%; right: -20%; bottom: -40px; height: 190px;
  background-image:
    linear-gradient(rgba(179, 157, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(179, 157, 255, 0.35) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(340px) rotateX(62deg);
  transform-origin: center top;
  animation: gridmove 1.6s linear infinite;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30%);
  mask-image: linear-gradient(180deg, transparent 0, #000 30%);
}
@keyframes gridmove { from { background-position: 0 0; } to { background-position: 0 44px; } }

/* ---------- бегущая строка ---------- */

.ticker {
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(179, 157, 255, 0.04);
  padding: 0.65rem 0; margin-top: -1px;
}
.track {
  display: inline-flex; gap: 2.5rem; width: max-content; white-space: nowrap;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; color: var(--lav-soft);
  animation: mq 32s linear infinite;
}
@keyframes mq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- секции ---------- */

main section {
  max-width: 860px; margin: 0 auto;
  padding: 3.5rem 1.25rem 0;
}
main section:last-child { padding-bottom: 3rem; }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

.eyebrow {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--pink); margin-bottom: 0.8rem;
}

/* таймлайн */
.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 1.1rem 2.4rem; }
.timeline li::before {
  content: ""; position: absolute; left: 0.55rem; top: 0.55rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--lav); box-shadow: 0 0 8px var(--glow);
}
.timeline li:not(:last-child)::after {
  content: ""; position: absolute; left: calc(0.55rem + 4px); top: 1.3rem; bottom: -0.2rem;
  width: 1px; background: var(--line);
}

/* карточки */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.15rem 1.25rem;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  border-color: var(--line-strong); transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(179, 157, 255, 0.12);
}
.card p { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.fineprint { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; max-width: 640px; }

/* каналы */
.channels { list-style: none; display: grid; gap: 0.5rem; }
.channels li {
  display: grid; grid-template-columns: 9.5rem 11rem 1fr; gap: 1rem; align-items: baseline;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.75rem 1rem;
  transition: border-color 0.25s ease;
}
.channels li:hover { border-color: var(--line-strong); }
.channels li > span:last-child { color: var(--muted); font-size: 0.92rem; }
.tag {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.18rem 0.55rem; border-radius: 99px;
  justify-self: start; white-space: nowrap;
}
.tag.now { background: rgba(179, 157, 255, 0.16); color: var(--lav-soft); border: 1px solid var(--line-strong); }
.tag.next { background: rgba(240, 163, 224, 0.14); color: var(--pink); border: 1px solid rgba(240, 163, 224, 0.35); }
.tag.plan { background: rgba(255, 255, 255, 0.04); color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.08); }
@media (max-width: 720px) {
  .channels li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* экономика */
.econ { width: 100%; border-collapse: collapse; }
.econ td { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.econ td:last-child {
  font-family: var(--mono); font-size: 0.95rem; color: var(--pink);
  text-align: right; white-space: nowrap; text-shadow: 0 0 12px rgba(240, 163, 224, 0.4);
}

/* ---------- чат ---------- */

.demo .disclaimer { color: var(--muted); margin-bottom: 1rem; max-width: 640px; }
.chat {
  background: rgba(16, 14, 26, 0.9); border: 1px solid var(--line-strong); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column; height: 480px;
  box-shadow: 0 0 40px rgba(179, 157, 255, 0.12);
}
.chat-header {
  padding: 0.85rem 1.15rem; background: rgba(179, 157, 255, 0.08);
  font-weight: 600; border-bottom: 1px solid var(--line);
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.msg {
  max-width: 85%; padding: 0.6rem 0.9rem; border-radius: 14px;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.msg.bot { background: var(--bot-bubble); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--user-bubble); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.note { background: none; color: var(--muted); font-size: 0.85rem; align-self: center; }
.msg.typing { color: var(--muted); }
.chat-input-row {
  display: flex; gap: 0.5rem; padding: 0.75rem;
  background: rgba(179, 157, 255, 0.06); border-top: 1px solid var(--line);
}
#chat-input {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 9px;
  padding: 0.65rem 0.85rem; font: inherit; background: var(--bg); color: var(--text);
  min-height: 46px;
}
#chat-input:focus { outline: 2px solid var(--lav); outline-offset: -1px; }
#chat-send {
  border: none; border-radius: 9px;
  background: linear-gradient(135deg, var(--lav-soft), var(--pink));
  color: #14101f; padding: 0 1.1rem; min-width: 48px; font-size: 1.05rem; cursor: pointer;
  transition: box-shadow 0.2s ease;
}
#chat-send:hover { box-shadow: 0 0 18px var(--glow); }
#chat-send:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

/* ---------- футер ---------- */

footer { max-width: 860px; margin: 0 auto; padding: 2rem 1.25rem 2.5rem; }
footer p {
  color: var(--muted); font-size: 0.85rem;
  border-top: 1px solid var(--line); padding-top: 1.25rem;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .stars, .scanlines, .dot, .chrome span, .sun, .grid-floor, .track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
