/* ==========================================================
   АЙТИ web — дизайн-система (токены из ДНК kurs-online.kz)
   ========================================================== */
:root {
  --bg: #0E0E0F;
  --bg-2: #141416;
  --card: #18181A;
  --line: #2A2A2D;
  --text: #F2F0EC;
  --muted: #9A9893;
  --gold: #C9A470;
  --gold-hi: #E3C593;
  --live: #9CD13A;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r: 22px;
  --f-display: "Lexend", system-ui, sans-serif;
  --f-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* Зерно поверх всего */
.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 26px; border-radius: 999px;
  font: 500 16px/1 var(--f-display); letter-spacing: -.01em;
  transition: transform .5s var(--ease), background .3s, border-color .3s, box-shadow .5s var(--ease);
  white-space: nowrap;
}
.btn svg { transition: transform .5s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #151208;
  box-shadow: 0 0 0 1px rgba(227,197,147,.4) inset, 0 10px 40px -10px rgba(201,164,112,.55);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,230,180,.6) inset, 0 18px 50px -12px rgba(201,164,112,.75); }
.btn--ghost { border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--gold); background: rgba(201,164,112,.06); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: 14px; }

/* ---------- Шапка ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(14,14,15,.72); backdrop-filter: blur(14px) saturate(140%); border-color: var(--line); }
.nav__inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  height: 76px; display: flex; align-items: center; gap: 32px;
}
.logo { display: flex; align-items: center; gap: 10px; font: 600 19px/1 var(--f-display); letter-spacing: -.02em; }
.logo__mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--gold); font-size: 14px; background: var(--card);
}
.logo__text em { font-style: normal; font-weight: 300; color: var(--gold); margin-left: 2px; }
.nav__links { display: flex; gap: 28px; margin-left: auto; }
.nav__links a { font-size: 15px; color: var(--muted); transition: color .3s; }
.nav__links a:hover { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: 18px; }
.nav__phone { font: 500 15px/1 var(--f-display); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  padding: 130px 0 0; display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
}
.hero__glow {
  position: absolute; z-index: -1; width: 900px; height: 900px; right: -200px; top: -250px;
  background: radial-gradient(closest-side, rgba(201,164,112,.20), rgba(201,164,112,.06) 45%, transparent 70%);
  filter: blur(10px); animation: breathe 9s ease-in-out infinite;
}
.hero__grid {
  position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px; opacity: .28;
  mask-image: radial-gradient(ellipse 70% 60% at 60% 35%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 35%, #000 20%, transparent 75%);
}
@keyframes breathe { 50% { transform: scale(1.08) translate(-20px, 20px); opacity: .8; } }

.hero__inner {
  flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 4vw, 64px); align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px;
  padding: 8px 16px 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.02); color: var(--muted); font-size: 14px;
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live); animation: ping 2s var(--ease) infinite; }
@keyframes ping { to { transform: scale(3); opacity: 0; } }

.hero__title {
  margin: 0; font: 600 clamp(40px, 5vw, 80px)/.98 var(--f-display); letter-spacing: -.045em;
}
.hero__title .line { display: block; }
.hero__title .line--muted { color: var(--muted); font-weight: 300; font-size: .62em; letter-spacing: -.03em; line-height: 1.15; margin-top: .25em; }
.gold {
  background: linear-gradient(100deg, var(--gold) 0%, #F4DDB2 45%, var(--gold) 70%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer { 50% { background-position: 100% 0; } }

.hero__lead { max-width: 540px; margin: 28px 0 36px; font-size: clamp(17px, 1.35vw, 20px); color: var(--muted); }
.hero__lead strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.facts {
  list-style: none; margin: 44px 0 0; padding: 26px 0 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, auto); gap: 12px clamp(20px, 3vw, 44px); justify-content: start;
}
.facts li { display: flex; flex-direction: column; gap: 4px; }
.facts b { font: 600 clamp(20px, 1.8vw, 26px)/1 var(--f-display); letter-spacing: -.02em; color: var(--gold); }
.facts span { font-size: 14px; color: var(--muted); }

/* ---------- Сцена с сайтами ---------- */
.stage { position: relative; height: clamp(440px, 46vw, 620px); perspective: 1600px; }
.stage__tilt {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, -14deg));
  transition: transform 1.2s var(--ease);
}
.frame {
  position: absolute; border-radius: 16px; overflow: hidden;
  background: var(--bg-2); border: 1px solid #333338;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.03) inset;
  animation: rise 1.4s var(--ease) both;
}
.frame__bar {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  background: #1D1D20; border-bottom: 1px solid var(--line); font: 400 11px/1 var(--f-body); color: var(--muted);
}
.frame__bar i { width: 9px; height: 9px; border-radius: 50%; background: #3A3A3E; }
.frame__bar span { margin-left: 10px; padding: 5px 12px; border-radius: 6px; background: #151517; }
.frame__bar .live { margin-left: auto; font-style: normal; color: var(--live); }
.frame__screen { height: calc(100% - 34px); }

.frame--back  { width: 62%; height: 58%; left: 36%; top: 2%;  transform: translateZ(-120px); animation-delay: .5s; opacity: .7; }
.frame--mid   { width: 52%; height: 50%; left: 0;   top: 12%; transform: translateZ(-50px);  animation-delay: .65s; }
.frame--front { width: 76%; height: 62%; left: 18%; top: 34%; transform: translateZ(40px);   animation-delay: .8s; }
@keyframes rise { from { opacity: 0; translate: 0 60px; } }

/* Мокапы интерфейсов */
.mock { padding: 16px; }
.mock--mge { background: radial-gradient(120% 90% at 100% 0, #1f2a3b, #121418); }
.mk-hero { display: grid; gap: 10px; padding: 18px 8px; }
.mk-h { height: 16px; width: 70%; border-radius: 6px; background: #D9E2EE; opacity: .85; }
.mk-h--s { width: 45%; height: 10px; opacity: .35; }
.mk-btn { width: 90px; height: 24px; border-radius: 99px; background: #4cccff; margin-top: 6px; }
.mk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mk-cards i { height: 60px; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.06); }

.mock--lombard { background: linear-gradient(160deg, #1c1813, #121110); display: grid; place-items: center; }
.mk-calc { width: 82%; padding: 16px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(201,164,112,.25); display: grid; gap: 10px; font-size: 12px; }
.mk-row { display: flex; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px dashed rgba(255,255,255,.1); color: var(--muted); }
.mk-row b { color: var(--text); font-family: var(--f-display); font-weight: 500; }
.mk-sum { font-size: 12px; color: var(--muted); }
.mk-sum b { display: block; margin-top: 4px; font: 600 20px/1 var(--f-display); color: var(--gold); }

.mock--kurs { padding: 0; background: #1a1a1a; font-size: 12px; overflow: hidden; }
.mk-thead, .mk-tr { display: grid; grid-template-columns: 1.3fr 1fr 1fr; padding: 11px 16px; }
.mk-thead { color: var(--muted); border-bottom: 1px solid #343434; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: #202020; position: relative; z-index: 1; }
.mk-scroll { animation: scrollY 16s linear infinite; }
.mk-tr { border-bottom: 1px solid #262626; }
.mk-tr b { font: 500 13px/1 var(--f-display); }
.mk-tr.is-best { box-shadow: 3px 0 0 var(--gold) inset; background: rgba(201,164,112,.06); }
.mk-tr.is-best b { color: var(--live); }
@keyframes scrollY { to { transform: translateY(-50%); } }

/* Уведомление и чип */
.toast {
  position: absolute; left: 4%; bottom: 8%; transform: translateZ(120px);
  display: flex; align-items: center; gap: 12px; padding: 14px 20px 14px 14px;
  border-radius: 16px; background: rgba(28,28,31,.82); backdrop-filter: blur(12px);
  border: 1px solid rgba(201,164,112,.35);
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.9), 0 0 40px -10px rgba(201,164,112,.35);
  animation: pop 1s var(--ease) 1.6s both, float 6s ease-in-out 2.6s infinite;
}
.toast__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--gold); color: #151208; }
.toast__body { display: flex; flex-direction: column; gap: 3px; }
.toast__body b { font: 500 14px/1.1 var(--f-display); }
.toast__body small { font-size: 12px; color: var(--muted); }

.chip {
  position: absolute; right: 0; top: 22%; transform: translateZ(90px);
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px;
  background: rgba(28,28,31,.85); backdrop-filter: blur(10px); border: 1px solid var(--line);
  animation: pop 1s var(--ease) 1.9s both, float 7s ease-in-out 3s infinite reverse;
}
.chip b { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--live); font: 600 15px/1 var(--f-display); color: var(--live); }
.chip small { font-size: 11px; line-height: 1.25; color: var(--muted); }
@keyframes pop { from { opacity: 0; scale: .85; } }
@keyframes float { 50% { translate: 0 -10px; } }

/* ---------- Бегущая строка ---------- */
.marquee {
  margin-top: clamp(40px, 6vh, 72px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 22px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; align-items: center; gap: 36px; width: max-content; animation: marquee 40s linear infinite; }
.marquee__track span { font: 300 clamp(18px, 1.8vw, 24px)/1 var(--f-display); color: var(--muted); letter-spacing: -.01em; white-space: nowrap; }
.marquee__track i { font-style: normal; color: var(--gold); font-size: 12px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Появление ---------- */
.reveal { animation: up 1.1s var(--ease) both; animation-delay: calc(var(--d) * 90ms + 100ms); }
@keyframes up { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } }

/* ---------- Мобильная панель ---------- */
.mbar { display: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .nav__links { display: none; }
  .nav__actions { margin-left: auto; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero { padding-top: 116px; }
  .stage { height: clamp(360px, 70vw, 520px); max-width: 720px; width: 100%; margin: 12px auto 0; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav__inner { height: 64px; }
  .nav__phone, .nav__actions .btn { display: none; }
  .hero { padding-top: 96px; min-height: auto; }
  .eyebrow { font-size: 12px; margin-bottom: 20px; }
  .hero__title { font-size: clamp(36px, 10.5vw, 52px); }
  .hero__title .line--muted { font-size: .56em; }
  .hero__lead { margin: 20px 0 28px; }
  .hero__cta .btn { width: 100%; white-space: normal; text-align: center; padding: 14px 22px; line-height: 1.25; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
  .facts b { font-size: 18px; }
  .facts span { font-size: 12px; line-height: 1.3; }
  .stage { height: 340px; }
  .stage__tilt { --rx: 6deg; --ry: -8deg; }
  .frame--back { display: none; }
  .frame--mid { width: 62%; height: 46%; top: 0; }
  .frame--front { width: 88%; left: 12%; top: 26%; height: 64%; }
  .toast { left: 0; bottom: 2%; padding: 10px 14px 10px 10px; }
  .chip { top: 4%; }
  .mbar {
    display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(14,14,15,.85); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    transform: translateY(110%); transition: transform .6s var(--ease);
  }
  .mbar.is-visible { transform: none; }
  .mbar .btn { min-height: 50px; }
}

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