:root {
  --bg: #030510;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #7dd3fc;
  --border: rgba(255, 255, 255, 0.08);
  --panel: rgba(13, 17, 32, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 800px at 20% 10%, #0d1230 0%, #070a18 45%, #030510 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

canvas.starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 clamp(16px, 4vw, 32px);
  background: rgba(7, 10, 24, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: linear-gradient(90deg, #f8fafc, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: none;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 120px 24px 64px;
}

.page h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page .sub {
  margin: 0 0 40px;
  color: var(--muted);
  max-width: 46rem;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.card {
  position: relative;
  display: block;
  padding: 24px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 40px -16px var(--accent);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}

.play svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.card:hover .play {
  color: var(--accent);
}

.card:hover .play svg {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .play svg {
    transition: none;
  }
}

/* ---------------------------------------------------------------- CRT player */

.play-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 16px 48px;
}

.monitor {
  background: linear-gradient(160deg, #3a3d45 0%, #23252b 55%, #1a1b20 100%);
  border-radius: 28px;
  padding: clamp(14px, 2.5vw, 30px);
  box-shadow:
    0 30px 60px -30px rgba(0, 0, 0, 0.85),
    0 8px 24px -12px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 6px rgba(0, 0, 0, 0.5);
  max-width: 100%;
}

.screen-wrap {
  border-radius: 18px;
  padding: 10px;
  background: #0c0d10;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.8),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.screen {
  position: relative;
  overflow: hidden;
  width: min(92vw - 90px, 860px, calc(74vh * var(--gw) / var(--gh)));
  aspect-ratio: var(--gw) / var(--gh);
  background: #000;
  border-radius: 14px / 20px;
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, 0.55),
    inset 0 0 60px rgba(120, 180, 255, 0.06);
}

.screen iframe {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 0;
  background: #000;
  transform: translate(-50%, -50%);
  filter: contrast(1.06) saturate(1.12);
}

.crt {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      to right,
      rgba(255, 0, 0, 0.05) 0 1px,
      rgba(0, 255, 0, 0.04) 1px 2px,
      rgba(0, 0, 255, 0.05) 2px 3px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.22) 0 1px,
      transparent 1px 3px
    );
}

.crt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 56%, rgba(0, 0, 0, 0.42) 100%);
  animation: crt-flicker 4s ease-in-out infinite;
}

.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.02) 22%,
    transparent 40%
  );
}

@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.955; }
}

.bezel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 0 8px;
}

.bezel-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9aa3b2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  margin-left: 16px;
  background: #22c55e;
  box-shadow: 0 0 8px 2px rgba(34, 197, 94, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .crt::before {
    animation: none;
  }
}
