/* ==========================================================================
   MERTVIY — СЦЕНЫ
   Полноэкранные сцены с переливом между ними.
   Движение: глубина и свет, а не терминальная печать — свой характер.
   ========================================================================== */

:root {
  --scene-pad: clamp(20px, 5vw, 72px);
  --veil-color: var(--accent);
}

/* ---------- Общая сцена ---------- */
.scene {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--scene-pad);
  padding-block: clamp(96px, 14vh, 160px);
  will-change: transform, opacity;
}

.scene > * {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

/* Перелив между сценами: мягкая волна акцента, а не резкая смена */
#veil {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(var(--accent-rgb), .10), transparent 70%),
    linear-gradient(180deg, transparent, rgba(7, 8, 12, .55));
  will-change: opacity;
}

/* ---------- СЦЕНА 1: ЛОГОТИП ---------- */
.scene-logo {
  min-height: 100svh;
  align-items: center;
  text-align: center;
  padding-block: clamp(80px, 10vh, 120px);
}

.logo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.4vh, 26px);
}

.logo-mark {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: clamp(5rem, 22vw, 15rem);
  line-height: .82;
  letter-spacing: -.04em;
  color: var(--text);
  will-change: transform, opacity;
}

.logo-mark .lm-part {
  display: inline-block;
  will-change: transform, opacity;
}

/* Точка у «m.» — единственный медный элемент на весь экран */
.logo-mark .lm-part:last-child {
  color: var(--accent);
  text-shadow: 0 0 40px rgba(var(--accent-rgb), .45);
}

/* Имя — одной строкой: «Mertviy iz nutri». Две части остаются отдельными
   span'ами только ради поочерёдного появления (маска overflow:hidden),
   но стоят в строке рядом, а не друг под другом. */
.logo-name {
  display: block;
  white-space: nowrap;
  font-family: "UnifrakturMaguntia", cursive;
  font-weight: 400;
  font-size: clamp(1.5rem, 4.2vw, 2.6rem);
  line-height: 1.15;
  color: var(--text);
}

.logo-line {
  display: inline-block;
  vertical-align: bottom;
  overflow: hidden;
  will-change: transform;
}

.logo-line-2 { color: var(--muted); }

.logo-sub {
  font-size: clamp(.72rem, 1.5vw, .86rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: clamp(18px, 4vh, 44px);
  font-size: .66rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-cue-line {
  display: block;
  width: 1px;
  height: 46px;
  background: linear-gradient(180deg, var(--accent), transparent);
  transform-origin: top center;
}

/* ---------- СЦЕНА 2: ОКНО БРАУЗЕРА ---------- */
.scene-about { align-items: center; }

.browser {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)),
    var(--bg-card);
  box-shadow: var(--elev-2);
  overflow: hidden;
  will-change: transform, opacity;
}

/* Панель как у настоящего браузера: три точки, адрес, пустота справа */
.browser-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
}

.browser-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.bdot {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  will-change: transform;
}

.bdot-y { background: #febc2e; box-shadow: 0 0 10px rgba(254, 188, 46, .45); }
.bdot-g { background: #28c840; box-shadow: 0 0 10px rgba(40, 200, 64, .45); }
.bdot-r { background: #ff5f57; box-shadow: 0 0 10px rgba(255, 95, 87, .45); }

.browser-url {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 8, 12, .55);
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-spacer { flex: 0 0 auto; width: 53px; }

.browser-body {
  padding: clamp(20px, 3.4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vw, 20px);
  align-items: flex-start;
}

.browser-body .profile-line { margin-bottom: 0; }

.about-title {
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  line-height: 1.18;
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
}

.about-title > span { display: block; }
.about-title > span:first-child { color: var(--text); }
.about-title > span:last-child { color: var(--muted); font-weight: 500; }

/* Слова, разбитые для появления по одному */
.about-title .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.about-title .w > i {
  display: inline-block;
  font-style: normal;
  will-change: transform;
}

.about-bio {
  font-size: clamp(.92rem, 1.7vw, 1rem);
  line-height: 1.7;
  color: var(--muted);
  max-width: 58ch;
  text-wrap: pretty;
}

/* ---------- Общие заголовки сцен ---------- */
.scene-head {
  margin-bottom: clamp(22px, 4vh, 44px);
}

.scene-kicker {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.scene-title {
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
}

.scene-title .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.scene-title .w > i { display: inline-block; font-style: normal; will-change: transform; }

.scene-lead {
  margin-top: 12px;
  font-size: clamp(.9rem, 1.6vw, 1rem);
  line-height: 1.65;
  color: var(--muted);
  max-width: 46ch;
  text-wrap: pretty;
}

/* ---------- СЦЕНА 3: МУЗЫКА ---------- */
.music-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.music-left { min-width: 0; }

/* ---------- СЦЕНЫ 4-5: СЕТКИ ---------- */
.devices-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ---------- СЦЕНА 6: КОНТАКТЫ + ФУТЕР ---------- */
.scene-contacts { justify-content: flex-start; }

.scene-contacts footer {
  margin-top: clamp(28px, 5vh, 56px);
  max-width: var(--container);
  width: 100%;
}

/* ---------- Прогресс и активный пункт ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), .35);
  will-change: transform;
}

.nav-link.active { color: var(--accent); }
.nav-link.active::after { width: 100%; background: var(--accent); }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .music-stage { grid-template-columns: minmax(0, 1fr); }
  .music-stage .player-card { max-width: 520px; margin-inline: auto; }
}

@media (max-width: 700px) {
  .scene { padding-block: calc(var(--nav-h, 132px) + 28px) 48px; }
  .scene-logo { padding-block: calc(var(--nav-h, 132px) + 40px) 40px; }
  .devices-grid { grid-template-columns: minmax(0, 1fr); }
  .browser-url { font-size: .68rem; }
  .browser-body { padding: 18px; }
  .logo-mark { font-size: clamp(4.5rem, 26vw, 8rem); }
}

/* ---------- Уменьшенное движение: всё сразу, без сцен-эффектов ---------- */
@media (prefers-reduced-motion: reduce) {
  .scene {
    min-height: auto;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  #veil { display: none; }
  .about-title .w > i,
  .scene-title .w > i { transform: none !important; }
  .scroll-cue-line { transform: none !important; }
}
