/* ============ Anar — styles ============ */
:root {
  --bg: #0B0A0D;
  --bg-2: #121016;
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #F3EFF2;
  --muted: #9A929B;
  --accent: #E0384F;      /* анар — гранат */
  --accent-2: #FF7A59;    /* тёплый переход */
  --accent-deep: #C62842;
  --green: #3DD68C;
  --radius: 20px;
  --container: 1200px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.03em; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

#bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
}
body::before { /* glow behind the hero */
  content: ""; position: absolute; z-index: -2;
  top: -300px; left: 50%; transform: translateX(-50%);
  width: 1200px; height: 900px;
  background: radial-gradient(closest-side, rgba(224, 56, 79, 0.22), transparent 70%);
  pointer-events: none;
}

.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  font-weight: 600; font-size: 16px;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.btn--primary {
  background: linear-gradient(100deg, var(--accent-deep), var(--accent) 55%, var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 30px -8px rgba(224, 56, 79, .6), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px rgba(224, 56, 79, .75), inset 0 1px 0 rgba(255,255,255,.2); }
.btn--ghost { border-color: var(--line-strong); background: rgba(255,255,255,.03); }
.btn--ghost:hover { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.07); }
.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--lg { padding: 18px 30px; font-size: 17px; }
.btn:focus-visible, .tab:focus-visible, .nav__links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ============ Nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(11, 10, 13, .72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 32px; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -0.03em; }
.logo__mark { width: 28px; height: 28px; color: var(--accent); }
.logo__dot { color: var(--accent); }
.logo--sm { font-size: 18px; gap: 0; }
.nav__links { display: flex; gap: 28px; margin-left: auto; font-size: 15px; color: var(--muted); }
.nav__links a { transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__burger { display: none; }

/* ============ Hero ============ */
.hero { padding: 150px 0 90px; }
.hero__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.03);
  font-size: 13px; font-family: var(--mono); color: var(--muted);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--green); animation: pulse 2s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.hero h1 { font-size: clamp(40px, 5.6vw, 68px); font-weight: 800; margin: 22px 0 22px; }
.lead { font-size: 19px; color: var(--muted); max-width: 540px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 52px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.stats dt { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stats dd { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Terminal / chat demo */
.hero__demo { position: relative; }
.term {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(28, 24, 31, .92), rgba(16, 14, 19, .92));
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 120px -30px rgba(224, 56, 79, .35), 0 0 0 1px rgba(255,255,255,.02) inset;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.term::before { /* animated border shine */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--a, 0deg), transparent 0 70%, var(--accent) 80%, var(--accent-2) 85%, transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite;
  pointer-events: none;
}
@property --a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --a: 360deg; } }
.term__bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.term__bar .dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.12); }
.term__title { margin-left: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.term__live { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--green); }
.term__body { padding: 22px 20px 26px; height: 380px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; justify-content: flex-end; }

.msg { max-width: 82%; padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; animation: msgIn .35s ease both; }
.msg--user { align-self: flex-end; background: rgba(255,255,255,.08); border-bottom-right-radius: 5px; }
.msg--ai { align-self: flex-start; background: linear-gradient(135deg, rgba(198, 40, 66, .32), rgba(255, 122, 89, .18)); border: 1px solid rgba(224, 56, 79, .35); border-bottom-left-radius: 5px; }
.msg--sys { align-self: center; font-family: var(--mono); font-size: 12px; color: var(--green); padding: 6px 12px; border: 1px dashed rgba(61, 214, 140, .35); border-radius: 8px; background: rgba(61, 214, 140, .06); }
.msg__who { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text); opacity: .4; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.float {
  position: absolute; padding: 10px 16px; border-radius: 14px; font-size: 13.5px;
  background: rgba(20, 18, 24, .88); border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px); box-shadow: 0 20px 50px -20px rgba(0,0,0,.8);
  animation: floaty 6s ease-in-out infinite;
}
.float .mono { color: var(--accent-2); margin-right: 4px; }
.float--a { top: -20px; right: -26px; }
.float--b { bottom: -22px; left: -28px; animation-delay: -3s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ============ Marquee ============ */
.marquee { border-block: 1px solid var(--line); padding: 22px 0; overflow: hidden; 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; }
.marquee__track span { font-family: var(--mono); font-size: 15px; color: var(--muted); white-space: nowrap; }
.marquee__track span::before { content: "◆"; color: var(--accent); margin-right: 14px; font-size: 10px; vertical-align: 2px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ Sections ============ */
.section { padding: 120px 0 0; }
.section__head { max-width: 720px; margin-bottom: 56px; }
.eyebrow { display: inline-block; font-size: 13px; color: var(--accent); margin-bottom: 18px; letter-spacing: .02em; }
.section h2 { font-size: clamp(32px, 4vw, 50px); }
.section__head p { margin-top: 18px; color: var(--muted); font-size: 18px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  position: relative; padding: 32px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  transition: background .3s, border-color .3s, transform .3s;
  overflow: hidden;
}
.card::after { /* cursor spotlight */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(224, 56, 79, .14), transparent 45%);
}
.card:hover { background: var(--card-hover); border-color: var(--line-strong); transform: translateY(-3px); }
.card:hover::after { opacity: 1; }
.card--wide { grid-column: span 2; background: linear-gradient(135deg, rgba(198, 40, 66, .14), rgba(255,255,255,.02) 60%); border-color: rgba(224, 56, 79, .28); }
.card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(224, 56, 79, .12); border: 1px solid rgba(224, 56, 79, .3); margin-bottom: 24px;
}
.card__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--accent-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 22px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15.5px; }
.card--wide h3 { font-size: 28px; }
.card--wide p { font-size: 17px; max-width: 560px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips li { font-family: var(--mono); font-size: 12px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }

/* Tabs / flows */
.tabs { display: inline-flex; gap: 6px; padding: 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); margin-bottom: 28px; flex-wrap: wrap; }
.tab {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--muted); cursor: pointer;
  padding: 10px 20px; border-radius: 999px; border: 0; background: transparent; transition: color .2s, background .2s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--text); color: var(--bg); }
.panel.is-active { animation: msgIn .4s ease both; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 16px; align-items: stretch; }
.flow__step {
  padding: 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  font-size: 17px; font-weight: 500; line-height: 1.45;
}
.flow__step .mono { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; font-weight: 400; text-transform: uppercase; letter-spacing: .08em; }
.flow__step--ai { background: linear-gradient(135deg, rgba(198, 40, 66, .25), rgba(255, 122, 89, .1)); border-color: rgba(224, 56, 79, .45); box-shadow: 0 20px 60px -30px rgba(224, 56, 79, .6); }
.flow__step--ai .mono { color: var(--accent-2); }
.flow__arrow { width: 40px; align-self: center; height: 2px; position: relative; background: linear-gradient(90deg, var(--line-strong), var(--accent)); overflow: hidden; }
.flow__arrow::after { content: ""; position: absolute; top: 0; left: -20px; width: 20px; height: 2px; background: #fff; animation: dash 1.6s linear infinite; }
@keyframes dash { to { left: 100%; } }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; }
.step { padding: 30px 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); position: relative; }
.step__n { display: inline-block; font-size: 13px; color: var(--accent); margin-bottom: 40px; padding: 4px 10px; border: 1px solid rgba(224, 56, 79, .35); border-radius: 8px; }
.step h3 { font-size: 21px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 15px; }

/* CTA */
#contact { padding-bottom: 120px; }
.cta {
  position: relative; overflow: hidden; text-align: center;
  padding: 90px 32px; border-radius: 32px;
  border: 1px solid rgba(224, 56, 79, .3);
  background: linear-gradient(180deg, rgba(198, 40, 66, .16), rgba(18, 16, 22, .6));
}
.cta__glow { position: absolute; inset: auto 0 -60% 0; height: 120%; background: radial-gradient(closest-side, rgba(224, 56, 79, .35), transparent 70%); pointer-events: none; }
.cta h2 { position: relative; font-size: clamp(30px, 4vw, 48px); }
.cta p { position: relative; color: var(--muted); margin-top: 18px; font-size: 18px; }
.cta__actions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 38px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 30px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.footer .logo { color: var(--text); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }

/* ============ Responsive ============ */
@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; gap: 64px; }
  .hero { padding-top: 130px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .float--a { right: 10px; }
  .float--b { left: 10px; }
}
@media (max-width: 820px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger {
    display: grid; gap: 6px; margin-left: auto; width: 44px; height: 44px; place-content: center;
    background: rgba(255,255,255,.05); border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer;
  }
  .nav__burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s; }
  .nav.is-open .nav__burger span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.is-open .nav__burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav.is-open { background: rgba(11, 10, 13, .96); backdrop-filter: blur(16px); }
  .nav.is-open .nav__links {
    display: flex; flex-direction: column; gap: 4px;
    position: absolute; top: 72px; left: 0; right: 0; padding: 12px 24px 24px;
    background: rgba(11, 10, 13, .96); border-bottom: 1px solid var(--line); font-size: 18px;
  }
  .nav.is-open .nav__links a { padding: 12px 0; color: var(--text); }
  .flow { grid-template-columns: 1fr; }
  .flow__arrow { width: 2px; height: 28px; justify-self: center; background: linear-gradient(180deg, var(--line-strong), var(--accent)); }
  .flow__arrow::after { width: 2px; height: 14px; left: 0; top: -14px; animation-name: dashV; }
  @keyframes dashV { to { top: 100%; } }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 116px 0 70px; }
  .lead { font-size: 17px; }
  .stats { grid-template-columns: 1fr; gap: 18px; }
  .cards, .steps { grid-template-columns: 1fr; }
  .card--wide { grid-column: auto; }
  .card { padding: 26px; }
  .section { padding-top: 88px; }
  .term__body { height: 340px; }
  .float { display: none; }
  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 9px 14px; font-size: 14px; white-space: nowrap; }
  .cta { padding: 64px 20px; border-radius: 24px; }
  .btn--lg { width: 100%; justify-content: center; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
