:root {
  color-scheme: dark;
  --bg: #050505;
  --text: #f4f4f4;
  --soft: #a8a8a8;
  --muted: #6d6d6d;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #d82018;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app {
  position: relative;
  min-height: 100vh;
  background: #050505;
}

.wallTitle {
  position: fixed;
  top: 22px;
  left: 26px;
  z-index: 12;
  display: grid;
  gap: 6px;
  max-width: min(420px, calc(100vw - 52px));
  pointer-events: none;
  transition: opacity 120ms linear;
}

.wallTitle p,
.wallTitle span {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.wallTitle h1 {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(24px, 2.4vw, 44px);
  line-height: 0.98;
  font-weight: 680;
  letter-spacing: 0;
}

.app[data-state="open"] .wallTitle {
  opacity: 0;
}

.wall {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #050505;
}

.wallFrame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100vw, calc(100vh * 8 / 3));
  height: min(100vh, calc(100vw * 3 / 8));
  overflow: hidden;
  background: #050505;
  transform: translate(-50%, -50%);
}

.wallVideo,
.openWarp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #050505;
}

.openWarp {
  opacity: 0;
  object-fit: cover;
  pointer-events: none;
}

.openWarp.isVisible {
  opacity: 1;
}

.wallVideo {
  z-index: 0;
  filter: grayscale(1) saturate(0) brightness(0.72) contrast(1.1);
  object-fit: contain;
}

.app[data-state="open"] .wall {
  opacity: 0;
  pointer-events: none;
}

.tile {
  position: absolute;
  z-index: 3;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background 120ms linear;
}

.wall:has(.tile:hover) .tile:not(:hover),
.wall:has(.tile:focus-visible) .tile:not(:focus-visible) {
  background: rgba(0, 0, 0, 0.14);
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.02) 50%, rgba(0, 0, 0, 0.1));
  transition: background 120ms linear;
}

.tile:hover::before,
.tile:focus-visible::before {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.04) 52%, rgba(0, 0, 0, 0.08));
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.58);
  pointer-events: none;
}

.tile:hover::after,
.tile:focus-visible::after {
  border-color: rgba(255, 255, 255, 0.45);
}

.tile:hover,
.tile:focus-visible {
  background: rgba(255, 255, 255, 0.02);
  outline: 0;
}

.warpCanvas {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tileContext,
.openDeck,
.textButton,
.feedButton {
  font-size: 12px;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tileFoot {
  position: absolute;
  z-index: 6;
  right: 20px;
  bottom: 24px;
  left: 20px;
  display: grid;
  gap: 8px;
  opacity: 0;
  transition: opacity 120ms linear;
}

.tile:hover .tileFoot,
.tile:focus-visible .tileFoot {
  opacity: 1;
}

.tileTitle {
  max-width: min(22ch, 88%);
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(20px, 1.75vw, 34px);
  line-height: 1.02;
  font-weight: 680;
  text-transform: none;
}

.tileContext {
  color: rgba(255, 255, 255, 0.62);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.openMoment {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: #050505;
  opacity: 0;
  pointer-events: none;
}

.openMoment[hidden] {
  display: none;
}

.app[data-state="open"] .openMoment {
  opacity: 1;
  pointer-events: auto;
}

.openMedia {
  position: absolute;
  inset: 0;
  background: #050505;
}

.openMedia::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.04) 52%, rgba(0, 0, 0, 0.22));
}

.openBar {
  position: absolute;
  z-index: 30;
  inset: 0;
  pointer-events: none;
}

.openBar button,
.feedRail {
  pointer-events: auto;
}

.textButton,
.feedButton {
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.textButton:hover,
.feedButton:hover,
.feedButton.isActive {
  color: #fff;
}

.backButton {
  position: absolute;
  top: 24px;
  left: 28px;
  padding: 0;
}

.audioButton {
  position: absolute;
  top: 24px;
  right: 28px;
  padding: 0;
}

.navRail {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: flex;
  gap: 22px;
}

.openCaption {
  position: absolute;
  right: 28px;
  bottom: 28px;
  left: 28px;
  display: grid;
  max-width: min(820px, calc(100vw - 56px));
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
  will-change: opacity, transform;
}

.openBar.isCaptioning .openCaption {
  animation: openCaptionPacket 5600ms linear both;
}

.openDeck {
  color: rgba(255, 255, 255, 0.66);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.openCaption h1 {
  max-width: none;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 600;
  text-transform: uppercase;
}

.openDeck {
  max-width: 34ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-family: inherit;
  font-size: clamp(26px, 3.1vw, 54px);
  line-height: 1.05;
  font-weight: 620;
  text-transform: none;
}

@keyframes openCaptionPacket {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  5%,
  58% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.feedRail {
  display: none;
}

@media (max-width: 760px) {
  .tileFoot {
    right: 14px;
    bottom: 16px;
    left: 14px;
  }

  .tileTitle {
    font-size: clamp(18px, 6.4vw, 32px);
  }

  .openCaption h1 {
    font-size: 11px;
  }

  .openDeck {
    font-size: clamp(24px, 8vw, 42px);
  }
}
