:root {
  --bg0: #101812;
  --bg1: #18241c;
  --mist: #d7e4d8;
  --text: #eef5ee;
  --muted: #9eb3a2;
  --live: #7dcf8a;
  --warn: #e0b35a;
  --danger: #e08a7a;
  --line: rgba(215, 228, 216, 0.16);
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg0);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(16, 24, 18, 0.55), rgba(16, 24, 18, 0.88) 55%, #0d1410),
    url("bg.jpg") center / cover no-repeat;
  transform: scale(1.04);
  animation: drift 28s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes drift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-1.2%, 1%, 0);
  }
}

.app {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 36px) clamp(16px, 3vw, 28px) calc(28px + env(safe-area-inset-bottom));
}

.hero-copy {
  margin-bottom: clamp(18px, 3vw, 28px);
  animation: rise 700ms ease both;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--live);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.lede {
  margin: 12px 0 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.45;
}

.stage {
  animation: rise 900ms 80ms ease both;
}

.stage-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(8, 12, 9, 0.72);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.stage-frame--youtube {
  background: #000;
}

.yt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

a.ghost {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.player,
.feed {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  /* contain = kogu kaader näha (k.a. kellaaeg all paremas nurgas) */
  object-fit: contain;
  object-position: center;
  background: #0a100c;
  /* Safari: väldi opacity:0 piltidel — kasuta visibility */
  visibility: hidden;
}

.player.is-visible,
.feed.is-visible,
.feed.is-live {
  visibility: visible;
}

.placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background:
    radial-gradient(500px 220px at 50% 40%, rgba(125, 207, 138, 0.12), transparent 70%);
  transition: opacity 280ms ease;
}

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

.placeholder p {
  margin: 0;
  font-size: 1rem;
}

.stage-veil {
  position: absolute;
  inset: auto 0 0;
  height: 28%;
  background: linear-gradient(transparent, rgba(8, 12, 9, 0.55));
  pointer-events: none;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(158, 179, 162, 0.45);
}

.status.is-live {
  color: var(--mist);
}

.status.is-live::before {
  background: var(--live);
  animation: pulse 1.8s ease-out infinite;
}

.status.is-warn {
  color: var(--warn);
}

.status.is-warn::before {
  background: var(--warn);
}

.status.is-error {
  color: var(--danger);
}

.status.is-error::before {
  background: var(--danger);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(125, 207, 138, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(125, 207, 138, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(125, 207, 138, 0);
  }
}

.ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(238, 245, 238, 0.04);
  color: var(--mist);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.ghost:hover,
.ghost:focus-visible {
  background: rgba(238, 245, 238, 0.1);
  border-color: rgba(215, 228, 216, 0.35);
  outline: none;
}

.ghost[aria-pressed="true"] {
  border-color: rgba(125, 207, 138, 0.55);
  background: rgba(125, 207, 138, 0.12);
  color: var(--live);
}

footer {
  margin-top: clamp(22px, 4vw, 36px);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  animation: rise 1000ms 140ms ease both;
}

footer p {
  margin: 0;
  max-width: 42rem;
}

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

@media (max-width: 640px) {
  .stage-frame {
    aspect-ratio: 16 / 9;
    margin-inline: -4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere,
  .hero-copy,
  .stage,
  footer,
  .status.is-live::before,
  .player,
  .feed {
    animation: none;
    transition: none;
  }
}
