:root {
  color-scheme: dark;
  --ink: #f4f7ec;
  --muted: #a9b7bd;
  --cyan: #6ee8f5;
  --amber: #ffd166;
  --green: #9be15d;
  --panel: rgba(4, 10, 15, 0.74);
  --line: rgba(110, 232, 245, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #02060a;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  overflow: hidden;
}

.cinematic-shell,
.cinematic-stage {
  min-height: 100svh;
}

.cinematic-stage {
  position: relative;
  overflow: hidden;
  background: #02060a;
}

.video-stage {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-viewport {
  position: relative;
  width: min(100vw, calc(100svh * 9 / 16));
  height: 100svh;
  overflow: hidden;
  background: #02060a;
  box-shadow: 0 0 0 1px rgba(110, 232, 245, 0.08), 0 0 120px rgba(0, 0, 0, 0.24);
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.08);
  clip-path: inset(3.2% 2.2% 3.2% 2.2% round 0);
  filter: saturate(1.04) contrast(1.02);
}

.video-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 68%, rgba(2, 6, 10, 0.4) 100%),
    linear-gradient(180deg, rgba(2, 6, 10, 0.18), transparent 18%, transparent 82%, rgba(2, 6, 10, 0.22));
}

.blackout,
.film-grain,
.scanline-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.blackout {
  z-index: 30;
  background: #02060a;
  animation: blackoutLift 3.1s ease forwards;
}

.film-grain {
  z-index: 40;
  opacity: 0.12;
  background:
    repeating-radial-gradient(circle at 18% 24%, rgba(255,255,255,0.14) 0 1px, transparent 1px 5px),
    repeating-radial-gradient(circle at 72% 62%, rgba(0,0,0,0.2) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}

.scanline-wash {
  z-index: 39;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 5px);
  opacity: 0.16;
}

.hud-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 50;
  display: flex;
  gap: 8px;
}

.cinematic-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(110, 232, 245, 0.5);
  padding: 0 11px;
  color: var(--ink);
  background: rgba(4, 10, 15, 0.64);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  font-weight: 900;
  text-decoration: none;
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.subtitle span {
  display: block;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.subtitle {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 45;
  width: min(760px, calc(100% - 28px));
  min-height: 90px;
  transform: translateX(-50%);
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  opacity: 1;
}

.subtitle p {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 4vw, 1.7rem);
  font-weight: 900;
  line-height: 1.15;
}

@keyframes blackoutLift {
  0%, 48% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 760px) {
  .cinematic-stage {
    min-height: 100svh;
  }

  .hud-controls {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    align-items: stretch;
  }

  .cinematic-control {
    height: 34px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.74rem;
    line-height: 1;
  }

  .subtitle {
    bottom: max(54px, calc(env(safe-area-inset-bottom) + 22px));
    width: calc(100% - 24px);
    min-height: 0;
    max-height: 24svh;
    padding: 10px 14px;
    overflow: hidden;
  }

  .subtitle p {
    font-size: clamp(0.94rem, 4.4vw, 1.14rem);
    line-height: 1.12;
  }
}
