: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;
}

.wall {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #141414;
}

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

.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: #111;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.tileWarp,
.openWarp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.tileWarp {
  filter: grayscale(1) brightness(0.55) contrast(1.05);
  opacity: 0.86;
  transform: scale(1.01);
  transition: filter 180ms linear, opacity 180ms linear, transform 180ms linear;
}

.tileWarpFull,
.tileWarpMax {
  opacity: 0;
}

.tile.isFullQuality .tileWarpFast,
.tile.isMaxQuality .tileWarpFast,
.tile.isMaxQuality .tileWarpFull {
  opacity: 0;
}

.tile.isFullQuality .tileWarpFull {
  opacity: 0.86;
}

.tile.isMaxQuality .tileWarpMax {
  opacity: 0.86;
}

.tile.isFullQuality:hover .tileWarp,
.tile.isFullQuality:focus-visible .tileWarp {
  filter: grayscale(0.1) brightness(0.92) contrast(1.03);
  opacity: 1;
  transform: scale(1.018);
}

.tile.isFullQuality:hover .tileWarpFast,
.tile.isFullQuality:focus-visible .tileWarpFast,
.tile.isMaxQuality:hover .tileWarpFast,
.tile.isMaxQuality:focus-visible .tileWarpFast,
.tile.isMaxQuality:hover .tileWarpFull,
.tile.isMaxQuality:focus-visible .tileWarpFull {
  opacity: 0;
}

.wall:has(.tile:hover) .tile:not(:hover) {
  opacity: 0.68;
}

.prewarmWarp {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

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

.tile::before,
.openMedia::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.08) 48%, rgba(0, 0, 0, 0.2));
}

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

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

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

.tileTop {
  position: absolute;
  z-index: 6;
  top: 18px;
  left: 20px;
  color: rgba(255, 255, 255, 0.62);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.tileFoot {
  position: absolute;
  z-index: 6;
  right: 20px;
  bottom: 22px;
  left: 20px;
  display: grid;
  gap: 8px;
}

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

.tileTitle {
  max-width: 14ch;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(26px, 2.3vw, 44px);
  line-height: 0.96;
  font-weight: 720;
  text-transform: uppercase;
}

.tileMeta {
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.52);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.openMoment {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: transparent;
}

.openMoment[hidden] {
  display: none;
}

.openMedia {
  position: absolute;
  inset: 0;
  background: transparent;
}

.openWarp {
  opacity: 0;
  transition: opacity 60ms linear;
}

.openWarp.isVisible {
  opacity: 1;
}

.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(620px, calc(100vw - 56px));
  gap: 8px;
}

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

h1 {
  max-width: 24ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(30px, 3.4vw, 54px);
  line-height: 0.98;
  font-weight: 740;
  text-transform: uppercase;
  text-wrap: balance;
}

.openDeck {
  margin: 0;
}

.feedRail {
  position: absolute;
  top: 24px;
  left: 50%;
  display: flex;
  gap: 24px;
  transform: translateX(-50%);
}

.feedButton {
  padding: 0 0 7px;
  border-bottom: 1px solid transparent;
}

.feedButton.isActive {
  border-bottom-color: var(--accent);
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .wall {
    position: relative;
    min-height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .tile {
    min-height: 46vh;
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  .feedRail {
    top: 70px;
    right: 18px;
    left: 18px;
    justify-content: space-between;
    transform: none;
  }

  .backButton {
    left: 18px;
  }

  .audioButton {
    right: 18px;
  }

  .openCaption {
    right: 18px;
    bottom: 82px;
    left: 18px;
  }

  .navRail {
    right: 18px;
    bottom: 24px;
  }

  h1 {
    font-size: clamp(28px, 8vw, 46px);
  }
}
