@import url("https://fonts.googleapis.com/css2?family=Bungee&family=IBM+Plex+Mono:wght@400;500;700&display=swap");

:root {
  --ink: #17130f;
  --panel: #211b16;
  --paper: #f4ead4;
  --amber: #ffbd4a;
  --green: #56f28f;
  --red: #ff5b58;
  --teal: #5cc7c1;
  --blue: #4864d8;
  --line: rgba(244, 234, 212, 0.2);
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #0e0d0b;
  color: var(--paper);
  font-family: "IBM Plex Mono", monospace;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(circle at 18% 12%, rgba(255, 189, 74, 0.14), transparent 32%),
    radial-gradient(circle at 86% 30%, rgba(92, 199, 193, 0.12), transparent 34%),
    #0e0d0b;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
}

.topline {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(320px, 1.25fr);
  gap: 18px;
  align-items: center;
  padding: 14px clamp(14px, 4vw, 42px);
  border-bottom: 2px solid rgba(244, 234, 212, 0.16);
  background: rgba(14, 13, 11, 0.9);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--paper);
  text-decoration: none;
}

.brand-mark {
  display: block;
  color: var(--amber);
  font-family: "Bungee", cursive;
  font-size: clamp(20px, 3vw, 34px);
  line-height: 1;
}

.brand-sub {
  display: block;
  margin-top: 4px;
  color: rgba(244, 234, 212, 0.68);
  font-size: 12px;
  text-transform: uppercase;
}

.decade-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(64px, 1fr));
  gap: 8px;
}

.decade-tab,
.category-toggle,
.year-key,
.control {
  min-height: 44px;
  border: 1px solid rgba(244, 234, 212, 0.26);
  border-radius: 6px;
  color: var(--paper);
  background: #17130f;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.decade-tab:hover,
.category-toggle:hover,
.year-key:hover,
.control:hover {
  transform: translateY(-1px);
  border-color: var(--amber);
}

.decade-tab[aria-pressed="true"],
.year-key[aria-pressed="true"],
.category-toggle[aria-pressed="true"],
.control[aria-pressed="true"] {
  border-color: var(--green);
  color: var(--ink);
  background: var(--green);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: clamp(16px, 3vw, 34px);
  min-height: calc(100vh - 84px);
  padding: clamp(16px, 4vw, 42px);
}

.stage {
  display: grid;
  align-content: start;
  gap: 18px;
}

.monitor {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(244, 234, 212, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 189, 74, 0.2), transparent 40%),
    #100f0d;
  box-shadow: 0 30px 70px var(--shadow);
}

.monitor::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(244, 234, 212, 0.16);
  pointer-events: none;
}

.screen {
  position: relative;
  width: min(100%, 1180px);
  aspect-ratio: 16 / 9;
  margin: clamp(14px, 3vw, 34px);
  overflow: hidden;
  border: 8px solid #0a0908;
  border-radius: 8px;
  background: #030303;
}

.screen iframe,
.player-frame,
.poster,
.play-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screen iframe,
.player-frame {
  border: 0;
  z-index: 1;
}

.poster {
  z-index: 2;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(255, 91, 88, 0.24) 0 16%, rgba(255, 189, 74, 0.24) 16% 32%, rgba(86, 242, 143, 0.2) 32% 48%, rgba(92, 199, 193, 0.22) 48% 64%, rgba(72, 100, 216, 0.22) 64% 80%, rgba(244, 234, 212, 0.18) 80%),
    #050505;
  transition: opacity 180ms ease;
}

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

.poster img {
  width: 42%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 2px solid rgba(244, 234, 212, 0.55);
  filter: saturate(0.85) contrast(1.1);
  opacity: 0.9;
}

.play-overlay {
  z-index: 5;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255, 189, 74, 0.22), transparent 32%),
    linear-gradient(90deg, rgba(255, 91, 88, 0.22) 0 16%, rgba(255, 189, 74, 0.2) 16% 32%, rgba(86, 242, 143, 0.16) 32% 48%, rgba(92, 199, 193, 0.18) 48% 64%, rgba(72, 100, 216, 0.18) 64% 80%, rgba(244, 234, 212, 0.14) 80%),
    rgba(3, 3, 3, 0.9);
}

.play-overlay[hidden] {
  display: none;
}

.play-overlay-panel {
  position: relative;
  width: 100%;
  height: 100%;
}

.screen-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(72px, 10vw, 98px);
  aspect-ratio: 1;
  border: 3px solid rgba(244, 234, 212, 0.86);
  border-radius: 999px;
  background: var(--red);
  box-shadow:
    0 0 0 8px rgba(255, 91, 88, 0.18),
    0 16px 36px rgba(0, 0, 0, 0.45),
    inset 0 -6px 0 rgba(0, 0, 0, 0.24);
  cursor: pointer;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.screen-play-button::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 7%;
  border-block: clamp(14px, 2vw, 20px) solid transparent;
  border-left: clamp(22px, 3vw, 32px) solid #fff7e5;
}

.screen-play-button:hover {
  transform: translate(-50%, -50%) scale(1.04);
  box-shadow:
    0 0 0 10px rgba(255, 91, 88, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.48),
    inset 0 -6px 0 rgba(0, 0, 0, 0.24);
}

.play-message {
  position: absolute;
  top: calc(50% + clamp(52px, 7vw, 74px));
  left: 50%;
  width: min(540px, 82%);
  max-width: 100%;
  color: rgba(244, 234, 212, 0.92);
  font-size: clamp(12px, 1.5vw, 15px);
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  transform: translateX(-50%);
}

.play-overlay.is-searching .play-message {
  top: 50%;
  transform: translate(-50%, -50%);
}

.play-overlay.is-searching .play-message::before {
  content: "";
  display: block;
  width: 48px;
  height: 8px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--green) 0 8px, transparent 8px 14px);
  box-shadow: 0 0 16px rgba(86, 242, 143, 0.5);
  animation: pulse-signal 700ms steps(2, end) infinite;
}

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  opacity: 0.26;
}

@keyframes pulse-signal {
  50% {
    opacity: 0.35;
  }
}

.readout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 14px clamp(14px, 3vw, 28px) 20px;
  border-top: 1px solid rgba(244, 234, 212, 0.16);
}

.readout strong {
  color: var(--green);
  font-family: "Bungee", cursive;
  font-size: clamp(20px, 3vw, 32px);
}

.readout span {
  color: rgba(244, 234, 212, 0.76);
  word-break: break-word;
}

.signal-meter {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: min(260px, 100%);
}

.signal-bar {
  height: 34px;
  border: 1px solid rgba(244, 234, 212, 0.24);
  background: rgba(244, 234, 212, 0.08);
}

.signal-bar.is-lit {
  background: var(--amber);
  box-shadow: 0 0 16px rgba(255, 189, 74, 0.5);
}

.console {
  display: grid;
  align-content: start;
  gap: 18px;
}

.console-band {
  border-block: 2px solid rgba(244, 234, 212, 0.18);
  padding-block: 14px;
}

.console-title {
  margin: 0 0 10px;
  color: var(--amber);
  font-family: "Bungee", cursive;
  font-size: 18px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(62px, 1fr));
  gap: 8px;
}

.control {
  min-width: 0;
  padding: 0 8px;
  text-transform: uppercase;
}

.external-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.control.power {
  color: var(--red);
}

.year-keys {
  display: grid;
  grid-template-columns: repeat(5, minmax(58px, 1fr));
  gap: 8px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.category-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 10px;
  text-align: left;
}

.category-toggle span,
.category-toggle b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-toggle b {
  font-size: 11px;
  opacity: 0.76;
}

.status-strip {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(244, 234, 212, 0.18);
  border-radius: 8px;
  background: rgba(23, 19, 15, 0.8);
}

.status-strip span {
  color: rgba(244, 234, 212, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.archive-index {
  padding: 30px clamp(16px, 4vw, 42px) 54px;
  border-top: 1px solid rgba(244, 234, 212, 0.18);
  background: #12100d;
}

.archive-index h1,
.archive-index h2 {
  margin: 0 0 12px;
  color: var(--paper);
  font-family: "Bungee", cursive;
  font-size: clamp(24px, 3vw, 40px);
}

.archive-index p {
  max-width: 920px;
  color: rgba(244, 234, 212, 0.76);
  line-height: 1.7;
}

.archive-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.archive-links a {
  border: 1px solid rgba(244, 234, 212, 0.22);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--green);
  text-decoration: none;
}

.archive-links a:hover {
  border-color: var(--green);
}

@media (max-width: 980px) {
  .topline,
  .workbench {
    grid-template-columns: 1fr;
  }

  .topline {
    position: static;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .decade-tabs,
  .year-keys,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .readout {
    grid-template-columns: 1fr;
  }

  .screen {
    margin: 10px;
    border-width: 4px;
  }
}
