:root {
  --bg: #0a0a0d;
  --surface: #14141b;
  --surface-2: #1c1c26;
  --line: #262632;
  --text: #ededf3;
  --muted: #8f8fa0;
  --accent: #ff4d6d;
  --accent-2: #ff8aa0;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; background: transparent; color: var(--text);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }

/* ---------- Progress & nav ---------- */
.progress {
  position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 50;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: 0 50%; transform: scaleX(0);
}
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 32px; background: rgba(10, 10, 13, 0.55);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.nav nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color 0.2s; }
.nav nav a:hover { color: var(--text); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; text-decoration: none; letter-spacing: -0.02em; }
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent-2), var(--accent));
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.55); animation: pulse 3.2s var(--ease) infinite;
}
@keyframes pulse { 50% { transform: scale(0.8); opacity: 0.8; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 140px 8vw 80px; overflow: hidden; isolation: isolate;
}
.glow {
  position: absolute; width: 70vw; height: 70vw; left: 15vw; top: -20vw; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 77, 109, 0.35), rgba(110, 140, 255, 0.12), transparent);
  filter: blur(40px); animation: float 14s ease-in-out infinite alternate;
}
@keyframes float { to { transform: translate3d(4vw, 3vw, 0) scale(1.08); } }
.eyebrow { color: var(--accent); font-size: 14px; text-transform: uppercase; letter-spacing: 0.14em; }
.hero h1 { font-size: clamp(42px, 7vw, 92px); max-width: 14ch; font-weight: 750; }
.hero h1 span { color: var(--accent); }
.split .w {
  display: inline-block; opacity: 0; transform: translateY(0.4em) rotateX(40deg);
  animation: word 0.9s var(--ease) forwards;
}
@keyframes word { to { opacity: 1; transform: none; } }
.lead { max-width: 52ch; color: var(--muted); font-size: clamp(18px, 2vw, 21px); margin-top: 22px; }
.scroll-cue { margin-top: 48px; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 12px; }
.scroll-cue span {
  width: 1px; height: 46px; background: linear-gradient(var(--accent), transparent);
  animation: cue 2s var(--ease) infinite;
}
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Chapters ---------- */
.chapter { position: relative; padding: 140px 8vw; }
.chapter-head { max-width: 900px; margin-bottom: 48px; }
.chapter-head h2 { font-size: clamp(32px, 4.6vw, 58px); font-weight: 720; }
.num { display: block; color: var(--accent); font-weight: 600; font-size: 15px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; max-width: 1100px; font-size: 19px; color: #d3d3dd; }
.cols p { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 72px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.stat b { display: block; font-size: clamp(44px, 6vw, 72px); font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 12px; }
.stat span { color: var(--muted); font-size: 15px; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; counter-reset: s; max-width: 1100px; }
.steps li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px;
  counter-increment: s; position: relative; overflow: hidden;
}
.steps li::before { content: "0" counter(s); position: absolute; right: 22px; top: 14px; font-size: 64px; font-weight: 800; color: rgba(255, 255, 255, 0.04); }
.steps h3 { font-size: 24px; }
.steps p { color: var(--muted); margin: 0; }

/* ---------- Companies ---------- */
.marquee { overflow: hidden; margin: 0 -8vw 48px; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: marquee 40s linear infinite; padding: 8px 0; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.mq-item { display: flex; align-items: center; gap: 14px; color: var(--muted); white-space: nowrap; }
.mq-item em { font-style: normal; font-size: 15px; }
.mq-item img, .mq-item .monogram { width: 34px; height: 34px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: rgba(255, 77, 109, 0.45); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.card h3 { font-size: 21px; margin-bottom: 6px; }
.card p { font-size: 15px; margin-bottom: 10px; }
.logo {
  width: 58px; height: 58px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; margin-bottom: 18px;
}
.logo img, .mini-logo img { width: 30px; height: 30px; filter: invert(1); opacity: 0.92; }
.monogram {
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--accent-2);
  width: 100%; height: 100%; letter-spacing: -0.02em;
}
.models { color: var(--text); opacity: 0.85; font-size: 15px; }

/* ---------- Pinned horizontal models ---------- */
.pin { height: 320vh; padding: 0; }
.pin-inner { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 90px 0 40px; }
.pin-inner .chapter-head { padding: 0 8vw; margin-bottom: 36px; }
.track-wrap { overflow: visible; }
.track { display: flex; gap: 22px; padding: 0 8vw; will-change: transform; }
.model { width: 360px; flex: none; min-height: 300px; }
.model-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.model-head h3 { font-size: 20px; margin: 0; }
.model-head p { margin: 0; font-size: 14px; }
.mini-logo { width: 46px; height: 46px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.mini-logo .monogram { font-size: 11px; }
.model .good { color: var(--text); font-size: 15px; }
.model ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.model li { margin-bottom: 4px; }

/* ---------- CTA ---------- */
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 999px; background: var(--accent); color: #fff;
  text-decoration: none; font-weight: 600; transition: transform 0.2s var(--ease), box-shadow 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 77, 109, 0.35); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); box-shadow: none; }

/* ---------- Footer ---------- */
.footer { padding: 48px 8vw 60px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer p { margin: 0 0 6px; }
.footer b { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav { padding: 14px 18px; }
  .nav nav a:not(:last-child):not(:nth-child(3)):not(:nth-child(4)) { display: none; }
  .cols, .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .chapter { padding: 100px 6vw; }
  .model { width: 300px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .split .w { opacity: 1; transform: none; }
  .pin { height: auto; }
  .pin-inner { position: static; height: auto; padding: 100px 0; }
  .track { flex-wrap: wrap; }
}

/* ---------- Living background ---------- */
#field { position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0.7; }
.aurora { position: fixed; inset: -10%; z-index: -3; pointer-events: none; filter: blur(70px); opacity: 0.75; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.aurora i:nth-child(1) { width: 60vw; height: 60vw; left: -8vw; top: -6vw; background: radial-gradient(closest-side, rgba(255, 77, 109, 0.55), transparent 70%); animation: a1 18s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 55vw; height: 55vw; right: -6vw; top: 12vh; background: radial-gradient(closest-side, rgba(110, 140, 255, 0.45), transparent 70%); animation: a2 22s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 50vw; height: 50vw; left: 30vw; bottom: -12vh; background: radial-gradient(closest-side, rgba(255, 170, 120, 0.3), transparent 70%); animation: a3 26s ease-in-out infinite alternate; }
@keyframes a1 { to { transform: translate3d(14vw, 10vh, 0) scale(1.15); } }
@keyframes a2 { to { transform: translate3d(-12vw, 16vh, 0) scale(1.08); } }
@keyframes a3 { to { transform: translate3d(8vw, -12vh, 0) scale(1.2); } }

/* ---------- Gradient headings ---------- */
.grad {
  background: linear-gradient(100deg, #fff 10%, var(--accent-2) 30%, #b6c1ff 50%, #fff 70%, var(--accent) 90%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sweep 9s linear infinite;
}
@keyframes sweep { to { background-position: -300% 0; } }

/* ---------- Tilt cards ---------- */
.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s var(--ease), border-color 0.3s, box-shadow 0.4s var(--ease), opacity 0.8s var(--ease);
  position: relative; overflow: hidden;
}
.tilt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.1), transparent 60%);
}
.tilt:hover::after { opacity: 1; }
.card, .stat { background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* ---------- Words marquee ---------- */
.marquee-words { overflow: hidden; margin: 0 -8vw 48px; }
.mw-track { display: flex; gap: 40px; width: max-content; animation: marquee 26s linear infinite; }
.mw-track span {
  font-size: clamp(28px, 4vw, 52px); font-weight: 800; letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.25);
}
.mw-track span:nth-child(3n) { -webkit-text-stroke-color: var(--accent); }

/* ---------- Glossary ---------- */
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; max-width: 1100px; }
.glossary > div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.glossary dt { font-weight: 700; color: var(--accent-2); margin-bottom: 6px; }
.glossary dd { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- FAQ ---------- */
.faq { max-width: 860px; display: flex; flex-direction: column; gap: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px;
  transition: border-color 0.3s, background 0.3s;
}
.faq details[open] { border-color: rgba(255, 77, 109, 0.4); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 26px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: -2px; font-size: 24px; color: var(--accent);
  transition: transform 0.3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 12px 0 0; }
.footer .credits { font-size: 12px; color: var(--muted); max-width: 70ch; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .grad { color: var(--text); background: none; } }

/* ---------- Hero orbit ---------- */
.orbit {
  position: absolute; right: -6vw; top: 50%; width: 1em; height: 1em;
  margin-top: -0.5em; font-size: clamp(300px, 42vw, 620px);
  pointer-events: none; z-index: -1; opacity: 0.55;
}
.orbit .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.orbit .ring::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: rgba(255, 77, 109, 0.75);
  border-right-color: rgba(182, 193, 255, 0.35);
  animation: spin 16s linear infinite;
}
.orbit .r2 { inset: 14%; border-color: rgba(255, 255, 255, 0.08); }
.orbit .r2::after { animation-duration: 24s; animation-direction: reverse; inset: -1px; }
.orbit .core {
  position: absolute; left: 50%; top: 50%; width: 16%; height: 16%; margin: -8% 0 0 -8%;
  border-radius: 50%; filter: blur(14px);
  background: radial-gradient(circle at 40% 35%, rgba(255, 77, 109, 0.95), rgba(140, 150, 255, 0.5) 55%, transparent 75%);
  animation: breathe 6s ease-in-out infinite;
}
.orbit .o {
  position: absolute; left: 50%; top: 50%; width: 0.018em; height: 0.018em; margin: -0.009em 0 0 -0.009em;
  border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0.02em rgba(255, 77, 109, 0.9);
  animation: orbit 12s linear infinite;
}
.orbit .o2 { background: #b6c1ff; animation-duration: 18s; animation-delay: -6s; box-shadow: 0 0 0.02em rgba(140, 150, 255, 0.9); }
.orbit .o3 { background: #ffb27a; animation-duration: 26s; animation-delay: -13s; box-shadow: 0 0 0.02em rgba(255, 178, 122, 0.9); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orbit { from { transform: rotate(0deg) translateX(0.47em); } to { transform: rotate(360deg) translateX(0.47em); } }
@keyframes breathe { 50% { transform: scale(1.18); opacity: 0.85; } }

@media (max-width: 900px) { .orbit { display: none; } }

/* ---------- Cursor spotlight ---------- */
.spotlight {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--px, 50%) var(--py, 30%), rgba(255, 130, 160, 0.07), transparent 65%);
  transition: opacity 0.4s;
}
@media (hover: none) { .spotlight { display: none; } }

/* ---------- Staggered model cards ---------- */
.model { transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.4s var(--ease); }
.model:hover { border-color: rgba(255, 77, 109, 0.5); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45); }

/* ---------- Section heading motion ---------- */
.chapter-head h2 { transition: letter-spacing 0.6s var(--ease); }
.chapter-head:hover h2 { letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce) {
  .orbit, .spotlight { display: none; }
}

/* Цветной логотип Z.ai нельзя инвертировать */
.logo img.no-invert, .mini-logo img.no-invert { filter: none; opacity: 1; }

/* Разбивка на слова не должна красить весь заголовок */
.hero h1 .w { color: var(--text); }
.hero h1 .w span { color: var(--accent); }

/* Края горизонтальной ленты моделей мягко затухают */
.track-wrap {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
@media (max-width: 700px) {
  .aurora { filter: blur(48px); opacity: 0.6; }
  #field { opacity: 0.5; }
  .chapter { padding: 84px 6vw; }
  /* На телефоне — обычная вертикальная лента вместо закреплённой горизонтальной */
  .pin { height: auto; }
  .pin-inner { position: static; height: auto; overflow: visible; padding: 84px 0 20px; }
  .pin-inner .chapter-head { padding: 0 6vw; }
  .track-wrap { -webkit-mask-image: none; mask-image: none; }
  .track { flex-wrap: wrap; gap: 16px; padding: 0 6vw; transform: none !important; }
  .model { width: 100%; min-height: 0; }
}
