/* =====================================================
   EUPHORIA CRAFT — сновидческая эйфория
   ===================================================== */

:root {
  /* Палитра */
  --bg: #0a0616;            /* тёмный индиго-ночной */
  --bg-2: #120a24;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(168, 85, 247, 0.22);
  --violet: #a855f7;
  --magenta: #e050e8;
  --cyan: #22d3ee;
  --text: #ece6fa;
  --text-dim: #a99ec7;

  /* Типографика */
  --font-display: 'Unbounded', sans-serif;
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'Onest', sans-serif;

  /* Свечения */
  --glow-violet: 0 0 24px rgba(168, 85, 247, 0.45), 0 0 64px rgba(168, 85, 247, 0.18);
  --glow-cyan: 0 0 18px rgba(34, 211, 238, 0.5);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ===================== Шум-оверлей ===================== */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 999;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 8s steps(10) infinite;
}
@keyframes grain-shift {
  0%,100% { transform: translate(0,0); } 10% { transform: translate(-2%,-3%); }
  30% { transform: translate(3%,-1%); } 50% { transform: translate(-1%,3%); }
  70% { transform: translate(2%,1%); } 90% { transform: translate(-3%,2%); }
}

/* ===================== Header ===================== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 56px);
  background: rgba(10, 6, 22, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}
.logo { display: flex; align-items: center; gap: 10px; position: relative; z-index: 105; }
.logo-text {
  font-family: var(--font-display);
  font-weight: 800; font-size: 15px; letter-spacing: 0.12em;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.5));
}
.logo-img { display: block; height: 54px; width: auto; filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.45)); }
/* Логотип в шапке появляется, когда hero-логотип ушёл за экран */
.header .logo { opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .35s ease, transform .35s ease; }
.header.show-logo .logo { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .header .logo { transition: none; } }
.nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav a {
  font-size: 14px; font-weight: 500; color: var(--text-dim);
  transition: color .25s, text-shadow .25s;
}
.nav a:hover { color: var(--text); text-shadow: var(--glow-cyan); }

.burger { display: none; background: none; border: 0; padding: 8px; }
.burger span {
  display: block; width: 22px; height: 2px; margin: 5px auto;
  background: var(--text); border-radius: 2px; transition: .3s;
}

/* ===================== Hero ===================== */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,6,22,.55) 0%, rgba(10,6,22,.35) 40%, rgba(10,6,22,.85) 100%),
    radial-gradient(ellipse 80% 60% at 50% 45%, rgba(168,85,247,.12), transparent 70%);
}
.hero-content {
  position: relative; z-index: 2;
  padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 26px;
}
.badge {
  font-family: var(--font-pixel); font-size: 11px;
  color: var(--cyan);
  padding: 10px 16px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.07);
  text-shadow: var(--glow-cyan);
  letter-spacing: 0.08em;
}
.hero-logo img {
  width: clamp(300px, 44vw, 640px); height: auto;
  filter: drop-shadow(0 0 26px rgba(168, 85, 247, 0.55)) drop-shadow(0 0 70px rgba(224, 80, 232, 0.25));
}
.hero-tagline {
  font-size: clamp(17px, 2.4vw, 24px); font-weight: 500;
  color: var(--text-dim); letter-spacing: 0.22em; text-transform: uppercase;
}

/* IP-чип */
.ip-chip {
  display: flex; align-items: center; gap: 4px;
  background: rgba(18, 10, 36, 0.75);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--glow-violet);
}
.ip-chip code {
  font-family: var(--font-pixel); font-size: 12px;
  color: var(--text); letter-spacing: 0.04em;
}
.btn-copy {
  font-family: var(--font-pixel); font-size: 10px;
  color: #0a0616; background: linear-gradient(90deg, var(--violet), var(--cyan));
  border: 0; border-radius: 7px; padding: 11px 14px;
  transition: transform .15s, box-shadow .25s;
  min-width: 118px;
}
.btn-copy:hover { transform: translateY(-1px); box-shadow: var(--glow-cyan); }
.btn-copy:active { transform: translateY(0) scale(.97); }
.btn-copy.copied { background: linear-gradient(90deg, #34d399, var(--cyan)); }

/* CTA */
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-block;
  font-weight: 600; font-size: 15px;
  padding: 15px 34px; border-radius: 12px;
  transition: transform .2s, box-shadow .3s, background .3s, color .3s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #0a0616;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  box-shadow: var(--glow-violet);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(168,85,247,.65), 0 0 80px rgba(224,80,232,.3); }
.btn-ghost {
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: var(--cyan); background: rgba(34, 211, 238, 0.06);
}
.btn-ghost:hover { background: rgba(34, 211, 238, 0.14); box-shadow: var(--glow-cyan); transform: translateY(-2px); }

/* Индикатор скролла */
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--text-dim); z-index: 2;
  animation: scroll-bounce 2.2s ease-in-out infinite;
}
@keyframes scroll-bounce {
  0%, 100% { transform: translate(-50%, 0); opacity: .6; }
  50% { transform: translate(-50%, 10px); opacity: 1; }
}

/* ===================== Общие секции ===================== */
.section {
  padding: clamp(70px, 11vw, 140px) clamp(20px, 6vw, 72px);
  max-width: 1240px; margin: 0 auto;
}
.kicker {
  font-family: var(--font-pixel); font-size: 11px;
  color: var(--violet); letter-spacing: 0.18em; margin-bottom: 22px;
  text-shadow: 0 0 14px rgba(168, 85, 247, 0.6);
}
.section-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(28px, 5vw, 52px); line-height: 1.12;
  margin-bottom: 26px;
  background: linear-gradient(90deg, #f0e8ff, var(--violet) 70%, var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-lead { max-width: 620px; color: var(--text-dim); font-size: 18px; }

/* Асимметрия: чередующийся отступ */
#start { padding-left: clamp(20px, 10vw, 130px); }
#gallery { padding-right: clamp(20px, 10vw, 130px); }

/* ===================== Шаги ===================== */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 22px; margin-top: 44px;
}
.step-card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 18px; padding: 34px 28px 28px;
  transition: transform .3s, box-shadow .35s, border-color .35s;
}
.step-card:hover {
  transform: translateY(-5px);
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: var(--glow-violet);
}
.step-num {
  position: absolute; top: -14px; right: 10px;
  font-family: var(--font-display); font-weight: 900; font-size: 92px;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(168, 85, 247, 0.3);
  line-height: 1; pointer-events: none;
}
.step-icon { width: 38px; height: 38px; color: var(--cyan); margin-bottom: 20px; filter: drop-shadow(var(--glow-cyan)); }
.step-card h3 { font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.step-card p { color: var(--text-dim); font-size: 15px; }

/* ===================== Миры ===================== */
.worlds {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; margin-top: 44px;
}
.world-card {
  position: relative; border-radius: 20px; overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--surface-border);
  transition: transform .35s, box-shadow .4s, border-color .4s;
}
/* Асимметрия — margin, а не transform: иначе схлопывается с reveal и hover */
.world-card:nth-child(even) { margin-top: 34px; }
.world-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.35);
}
.world-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.world-card:hover img { transform: scale(1.05); }
.world-label {
  position: absolute; inset: auto 0 0 0; padding: 44px 22px 18px;
  background: linear-gradient(180deg, transparent, rgba(10, 6, 22, 0.92));
}
.world-label h3 { font-family: var(--font-display); font-weight: 700; font-size: 21px; margin-bottom: 6px; }
.world-label p { color: var(--text-dim); font-size: 14.5px; max-width: 400px; }

/* ===================== Кино-блок с видеофоном ===================== */
.cinema {
  position: relative; min-height: 82svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
}
.cinema-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.cinema-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,6,22,.85) 0%, rgba(10,6,22,.30) 30%, rgba(10,6,22,.30) 70%, rgba(10,6,22,.85) 100%),
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(168,85,247,.10), transparent 70%);
}
.cinema-content {
  position: relative; z-index: 2;
  max-width: 760px; padding: 20px;
  display: flex; flex-direction: column; align-items: center;
}
/* Тень под текстом поверх видео — иначе теряется на светлых кадрах */
.cinema-content .kicker,
.hero-tagline, .hero .badge, .ip-chip {
  text-shadow: 0 2px 14px rgba(5, 2, 12, 0.9), 0 0 40px rgba(5, 2, 12, 0.55);
}
.cinema-content .section-title,
.cinema-content .section-lead {
  text-shadow: 0 3px 24px rgba(5, 2, 12, 0.85), 0 0 60px rgba(5, 2, 12, 0.5);
}
.cinema-content .section-lead { max-width: 560px; color: #d9d2ee; }

/* Варианты кино-блоков */
.cinema--left { justify-content: flex-start; text-align: left; }
.cinema--left .cinema-content { align-items: flex-start; padding-left: clamp(20px, 9vw, 120px); }
.cinema--left .cinema-overlay {
  background:
    linear-gradient(90deg, rgba(10,6,22,.88) 0%, rgba(10,6,22,.45) 45%, rgba(10,6,22,.15) 100%),
    linear-gradient(180deg, rgba(10,6,22,.55) 0%, transparent 30%, transparent 70%, rgba(10,6,22,.8) 100%);
}
.cinema--right { justify-content: flex-end; text-align: right; }
.cinema--right .cinema-content { align-items: flex-end; padding-right: clamp(20px, 9vw, 120px); }
.cinema--right .cinema-overlay {
  background:
    linear-gradient(270deg, rgba(10,6,22,.88) 0%, rgba(10,6,22,.45) 45%, rgba(10,6,22,.15) 100%),
    linear-gradient(180deg, rgba(10,6,22,.55) 0%, transparent 30%, transparent 70%, rgba(10,6,22,.8) 100%);
}

/* ===================== Галерея ===================== */
.gallery {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 20px; margin-top: 44px;
}
.gallery-item {
  padding: 0; border: 1px solid var(--surface-border); border-radius: 16px;
  overflow: hidden; background: var(--bg-2);
  aspect-ratio: 16 / 10;
  transition: transform .3s, box-shadow .35s, border-color .35s;
}
.gallery-item:hover {
  transform: scale(1.02);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: var(--glow-violet);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .55s cubic-bezier(.2,.7,.2,1);
}
.gallery-item:hover img { transform: scale(1.06); }

/* ===================== Лайтбокс ===================== */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 3, 12, 0.93);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  animation: lb-in .25s ease;
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.35);
}
.lightbox[hidden] { display: none; }
.lightbox-close {
  position: absolute; top: 18px; right: 24px;
  background: none; border: 0; color: var(--text);
  font-size: 42px; line-height: 1; padding: 8px;
  transition: color .2s, text-shadow .2s;
}
.lightbox-close:hover { color: var(--cyan); text-shadow: var(--glow-cyan); }

/* ===================== Сообщество ===================== */
.community { text-align: center; }
.community .section-lead { margin: 0 auto; }
.community-links {
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: center;
  margin-top: 48px;
}
.community-btn {
  display: flex; align-items: center; gap: 12px;
  font-weight: 600; font-size: 16px;
  padding: 17px 30px; border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  transition: transform .2s, box-shadow .3s, border-color .3s, background .3s;
}
.community-btn svg { width: 24px; height: 24px; }
.community-btn:hover {
  transform: translateY(-3px);
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: var(--glow-violet);
}
.community-btn:active { transform: scale(.97); }

/* ===================== Футер ===================== */
.footer {
  border-top: 1px solid rgba(168, 85, 247, 0.15);
  padding: 40px clamp(20px, 6vw, 72px);
  max-width: 1240px; margin: 0 auto;
  color: var(--text-dim); font-size: 14px;
}
.footer-legal { max-width: 520px; margin-bottom: 18px; }
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-nav { display: flex; gap: 24px; }
.footer-nav a { color: var(--text-dim); transition: color .25s; }
.footer-nav a:hover { color: var(--cyan); }

/* ===================== Reveal-анимации ===================== */
.reveal { opacity: 0; transform: translateY(28px); }
.reveal.visible {
  opacity: 1; transform: none;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1);
}
/* Staggered reveal в hero */
.hero .reveal:nth-child(1) { transition-delay: .10s; }
.hero .reveal:nth-child(2) { transition-delay: .22s; }
.hero .reveal:nth-child(3) { transition-delay: .34s; }
.hero .reveal:nth-child(4) { transition-delay: .46s; }
.hero .reveal:nth-child(5) { transition-delay: .58s; }

/* ===================== Адаптив ===================== */
@media (max-width: 900px) {
  .worlds { grid-template-columns: 1fr; }
  .world-card:nth-child(even),
  .world-card:nth-child(even):hover { transform: none; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .burger { display: block; z-index: 110; }
  /* backdrop-filter на .header делал бы его containing block для fixed .nav — убираем на мобиле */
  .header { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav {
    position: fixed; inset: 0;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 34px;
    background: rgba(10, 6, 22, 0.96);
    backdrop-filter: blur(16px);
    opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  .nav.open { opacity: 1; pointer-events: auto; }
  .nav a { font-size: 20px; }
  .burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger.open span:nth-child(2) { opacity: 0; }
  .burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .gallery { grid-template-columns: 1fr; }
  .ip-chip { flex-wrap: wrap; justify-content: center; padding: 10px 14px; }
  .footer-row { flex-direction: column; align-items: flex-start; }
  #start, #gallery { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 480px) {
  .badge { font-size: 9px; padding: 9px 12px; }
  .hero-logo img { width: min(78vw, 340px); }
  .hero-tagline { letter-spacing: 0.14em; font-size: 16px; }
  .ip-chip code { font-size: 10px; }
  .step-num { font-size: 68px; }
}

/* ===================== Reduced motion ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .scroll-hint { animation: none; }
  .reveal { opacity: 1; transform: none; }
  * { transition-duration: .01ms !important; }
}
