/* =====================================================
   main.css — фундамент v3: переменные, типографика, mesh, курсор
   ===================================================== */

:root {
  /* Палитра */
  --bg-0: #000000;
  --bg-1: #050505;
  --bg-2: #0c0c0c;
  --bg-3: #131313;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);

  --text-0: #ffffff;
  --text-1: #e8e8e8;
  --text-2: #888888;
  --text-3: #555555;

  --accent: #ff5a1f;
  --accent-2: #ffaa3d;
  --accent-soft: rgba(255, 90, 31, 0.12);
  --accent-line: rgba(255, 90, 31, 0.4);

  --success: #22c55e;
  --error: #ef4444;

  /* Радиусы */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-2xl: 48px;

  /* Тени */
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 80px rgba(255, 90, 31, 0.3);

  /* Типографика */
  --font-display: 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --font-accent: 'Instrument Serif', 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Сетка */
  --container: 1320px;
  --gutter: 28px;

  /* Анимации */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 180ms;
  --t-base: 320ms;
  --t-slow: 700ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-0);
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }
body.is-loaded { }

@media (hover: none) and (pointer: coarse) {
  body, body * { cursor: auto !important; }
}

img, svg, video { display: block; max-width: 100%; }
img { user-select: none; -webkit-user-drag: none; }

button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

a:hover { color: var(--accent); }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-0);
  font-feature-settings: 'ss01' on, 'ss02' on;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--bg-0); }

::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }

html, body { scrollbar-width: none; }

/* =====================================================
   Mesh-градиент фон (для hero)
   ===================================================== */
.mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.mesh::before,
.mesh::after {
  content: '';
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  will-change: transform;
}

.mesh::before {
  top: -20%;
  right: -10%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  animation: meshFloat 18s ease-in-out infinite;
}

.mesh::after {
  bottom: -30%;
  left: -20%;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 60%);
  animation: meshFloat 22s ease-in-out infinite reverse;
  opacity: 0.35;
}

@keyframes meshFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(5%, -5%) scale(1.1); }
  66% { transform: translate(-5%, 5%) scale(0.95); }
}

.mesh__noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.mesh__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 0%, transparent 80%);
  pointer-events: none;
}

/* =====================================================
   Утилиты
   ===================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  font-family: var(--font-body);
}

.eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(40px, 6.5vw, 96px);
  margin-bottom: 28px;
  max-width: 1000px;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-2);
  max-width: 620px;
  margin-bottom: 72px;
  line-height: 1.5;
}

.section-head {
  margin-bottom: 80px;
  position: relative;
}

.section-head--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-head--center .section-title,
.section-head--center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.section {
  padding: 140px 0;
  position: relative;
}

@media (max-width: 768px) {
  .section { padding: 80px 0; }
  .section-head { margin-bottom: 48px; }
  .section-subtitle { margin-bottom: 48px; }
}

/* =====================================================
   Прелоадер — кинематографичный
   ===================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: var(--bg-0);
  transition: opacity 800ms var(--ease), visibility 800ms var(--ease);
  overflow: hidden;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.preloader__logo {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 64px;
  color: var(--text-0);
  letter-spacing: -0.04em;
  animation: preloaderFade 1.2s var(--ease) both;
}

.preloader__mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--accent);
  color: var(--bg-0);
  font-size: 32px;
  border-radius: var(--r-sm);
  animation: preloaderPulse 1.6s var(--ease) infinite;
}

.preloader__bar {
  width: 240px;
  height: 2px;
  background: var(--bg-2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.preloader__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: preloaderBar 1.4s var(--ease) infinite;
}

.preloader__caption {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-3);
}

@keyframes preloaderFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes preloaderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes preloaderBar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* =====================================================
   Кнопка наверх
   ===================================================== */
.to-top {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 100;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--bg-0);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--t-base) var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--accent-2);
  transform: translateY(-6px);
}

/* =====================================================
   Анимации появления
   ===================================================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="100"] { transition-delay: 80ms; }
.reveal[data-delay="200"] { transition-delay: 160ms; }
.reveal[data-delay="300"] { transition-delay: 240ms; }
.reveal[data-delay="400"] { transition-delay: 320ms; }
.reveal[data-delay="500"] { transition-delay: 400ms; }
.reveal[data-delay="600"] { transition-delay: 480ms; }

/* Mask reveal для картинок */
.reveal-img {
  position: relative;
  overflow: hidden;
}

.reveal-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-0);
  transform-origin: right;
  transition: transform 1.2s var(--ease-out);
  z-index: 2;
}

.reveal-img.is-visible::after {
  transform: scaleX(0);
}

.reveal-img img {
  transform: scale(1.15);
  transition: transform 1.4s var(--ease-out);
}

.reveal-img.is-visible img {
  transform: scale(1);
}

/* Split text */
.split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.split-word__inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-out);
}

.reveal.is-visible .split-word__inner {
  transform: translateY(0);
}

/* Утилитарные */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-2); }
.text-display {
  font-size: clamp(64px, 12vw, 200px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* =================================================
   TOPBAR — бегущая строка с городами
   Sticky под хедером (76px высота хедера)
   ================================================= */
.topbar {
  position: sticky;
  top: 76px;
  z-index: 30;
  height: 36px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
}

.topbar__live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text-1);
  white-space: nowrap;
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  padding-right: 14px;
}

.topbar__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.6);
  animation: topbar-pulse 1.8s var(--ease) infinite;
}

@keyframes topbar-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 90, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0); }
}

.topbar__viewport {
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
}

.topbar__track {
  display: flex;
  align-items: center;
  gap: 36px;
  white-space: nowrap;
  animation: topbar-marquee 50s linear infinite;
  will-change: transform;
}

.topbar__item {
  position: relative;
  color: var(--text-1);
}

.topbar__item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
}

.topbar__item:first-child::before { display: none; }

@keyframes topbar-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-25%); }
}

.topbar__time {
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text-1);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  padding-left: 14px;
}

@media (max-width: 900px) {
  .topbar { padding: 0 18px; }
  .topbar__time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar__pulse,
  .topbar__track { animation: none; }
}
