@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #f3e600;
}

:root {
  --bg: #07080d;
  --raised: #1a1e28;
  --text: #eef0f5;
  --text-2: #a3a9b8;
  --muted: #7a8296;
  --hairline: rgba(238, 240, 245, 0.08);
  --accent: #f3e600;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: 32px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

body { transition: --accent 700ms var(--ease); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

/* Stage: full screen media */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  touch-action: none;
}

.layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.layer.on { opacity: 1; }

.layer .backdrop {
  position: absolute;
  inset: -64px;
  width: calc(100% + 128px);
  height: calc(100% + 128px);
  object-fit: cover;
  filter: blur(40px) brightness(0.55) saturate(1.2);
  display: none;
}
.layer.contain .backdrop { display: block; }

.layer video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.layer.contain video { object-fit: contain; }

.wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Bottom shade: one neutral tone fading out, only behind the text */
.shade {
  position: fixed;
  inset: auto 0 0 0;
  height: max(360px, 46vh);
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(7, 8, 13, 0.94) 0%,
    rgba(7, 8, 13, 0.8) 28%,
    rgba(7, 8, 13, 0.42) 62%,
    rgba(7, 8, 13, 0) 100%);
}

/* Text block */
.info {
  position: fixed;
  left: var(--pad);
  right: var(--pad);
  bottom: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.title {
  position: relative;
  margin: 0;
  min-height: 1.06em;
  font-size: clamp(36px, 5.6vw, 72px);
  line-height: 1.06;
  font-weight: 500;
  letter-spacing: -0.03em;
  max-width: 16em;
  text-wrap: balance;
}
.title .t {
  display: block;
}
.title .t.old {
  position: absolute;
  inset: auto 0 0 0;
  transition: opacity 240ms var(--ease), filter 240ms var(--ease), transform 240ms var(--ease);
}
.title .t.old.gone {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(-4px);
}
.title .ch {
  display: inline-block;
  white-space: pre;
}
.title .t.new .ch {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(4px);
  animation: roll 420ms var(--ease) forwards;
  animation-delay: calc(var(--i) * 18ms + 120ms);
}
@keyframes roll {
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* Actions in the top right corner (Edgerunners only) */
.actions {
  position: fixed;
  top: var(--pad);
  right: var(--pad);
  display: flex;
  gap: 8px;
  height: 36px;
  transition: opacity 300ms var(--ease);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px 0 12px;
  border-radius: 8px;
  background: rgba(26, 30, 40, 0.88);
  box-shadow: inset 0 0 0 1px var(--hairline), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 14px;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease);
}
.btn[hidden] { display: none; }
.btn:hover { background: rgba(36, 41, 54, 0.95); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; flex: none; color: var(--text-2); }
.btn[aria-pressed="true"] svg { color: var(--accent); }
.btn[aria-pressed="true"] svg .off,
.btn[aria-pressed="false"] svg .on { display: none; }

/* Channel switcher */
.switch {
  position: relative;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0 0 8px;
  list-style: none;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.switch::-webkit-scrollbar { display: none; }
.switch button {
  white-space: nowrap;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  transition: color 180ms var(--ease);
}
.switch button:hover { color: var(--text-2); }
.switch button[aria-current="true"] { color: var(--text); }
.switch .bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 1px;
  background: var(--accent);
  border-radius: 1px;
  transform-origin: 0 0;
  transition: transform 700ms var(--ease);
}

@media (max-width: 640px) {
  :root { --pad: 16px; }
  .info { gap: 16px; }
  .switch { gap: 20px; }
  .shade { height: max(300px, 44vh); }
}

@media (prefers-reduced-motion: reduce) {
  .title .t.new .ch { animation-duration: 1ms; animation-delay: 0ms; }
  .switch .bar { transition-duration: 1ms; }
}
