@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

:root {
  --bg: #0a0a0a;
  --panel: #111;
  --border: #333;
  --card: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e0e0e0;
  --muted: #888;
  --accent: #666;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 96px 0 64px;
}

/* Mobile/Touch optimizations */
@media (max-width: 768px) {
  body {
    padding: 120px 0 64px;
  }

  .page {
    padding: 0 16px !important;
  }

  .card-grid {
    grid-template-columns: 1fr !important;
  }

  .split {
    grid-template-columns: 1fr !important;
  }

  .grid-2 {
    grid-template-columns: 1fr !important;
  }

  h1 {
    font-size: 24px !important;
  }

  .video-js {
    font-size: 14px !important;
  }

  .projection-controls {
    justify-content: center;
  }

  .btn {
    flex: 1;
    min-width: 70px;
  }
}

.hidden {
  display: none !important;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.85rem;
}

h1 {
  margin: 16px 0 8px;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.02em;
}

p.lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  padding: 20px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 160px;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(125, 211, 252, 0.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.card__icon {
  font-size: 28px;
}

.card__title {
  font-weight: 700;
  margin: 0;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.card__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
  color: #c3eafa;
  font-size: 0.8rem;
}

.section {
  margin-top: 48px;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.section p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  gap: 12px;
}

.list-item strong {
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.85rem;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.remote-shell {
  display: none !important;
}

.remote {
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  padding: 14px;
}

.remote__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.remote__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.remote__btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-decoration: none;
  min-height: 92px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  text-align: center;
}

.remote__btn:hover {
  border-color: rgba(125, 211, 252, 0.6);
  background: rgba(125, 211, 252, 0.08);
  transform: translateY(-2px);
}

.remote__btn.active {
  border-color: rgba(125, 211, 252, 0.9);
  background: rgba(125, 211, 252, 0.15);
  color: #c3eafa;
}

.remote__btn small {
  color: var(--muted);
  font-size: 0.8rem;
}

.remote__hotkey {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.table td {
  color: var(--text);
  font-size: 0.95rem;
}

.tab-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  margin: 8px 0 20px;
}

.tab {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tab.active {
  color: var(--text);
  border-color: rgba(125, 211, 252, 0.7);
  background: rgba(125, 211, 252, 0.08);
}

.panel {
  display: none;
}

.panel.active {
  display: grid;
  gap: 16px;
}

.test-tile {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.canvas-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.wide-media {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: black;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.player-shell {
  position: relative;
}

.overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
}

.overlay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.floating-input {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: min(420px, 90vw);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  padding: 12px;
  z-index: 9999;
}

.floating-input header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
}

.floating-input input[type=\"file\"] {
  width: 100%;
  color: var(--text);
}

.projection-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  border-color: rgba(125, 211, 252, 0.7);
  background: rgba(125, 211, 252, 0.08);
}

.btn.active {
  border-color: rgba(125, 211, 252, 0.9);
  background: rgba(125, 211, 252, 0.12);
}

.btn.danger {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.speaker-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.speaker {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
}

.speaker small {
  color: var(--muted);
  font-size: 0.8rem;
}

.status {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.status.good {
  color: #bef264;
  border-color: rgba(190, 242, 100, 0.5);
}

.status.bad {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.5);
}

.embed {
  width: 100%;
  height: 260px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
}

.telemetry-panel {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 12, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  min-width: 220px;
  display: grid;
  gap: 6px;
}

.telemetry-panel strong {
  display: inline-block;
  min-width: 120px;
  color: var(--muted);
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.telemetry-value.alert {
  color: var(--danger);
  font-weight: 700;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background-image:
    linear-gradient(to right, rgba(0, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 255, 255, 0.7) 1px, transparent 1px);
  background-size: calc(100% / 10) calc(100% / 10);
  box-shadow: 0 0 0 2px #ff00ff inset;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.grid-overlay.active {
  opacity: 0.9;
}

.yt-player {
  width: 100%;
  min-height: 260px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: black;
}

.control-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 10px;
}

.control-row select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.pill.note {
  border-color: rgba(125, 211, 252, 0.4);
  background: rgba(125, 211, 252, 0.08);
  color: #c3eafa;
}

.drop-zone {
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone.active {
  border-color: rgba(190, 242, 100, 0.6);
  background: rgba(190, 242, 100, 0.08);
}

.kb-dynamic {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.kb-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.kb-body {
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-line;
}

@media (max-width: 640px) {
  .remote-shell {
    right: 12px;
    left: 12px;
    width: auto;
  }

  .floating-input {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* Pixel Lab */
.lab-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.lab-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
}

.control-group h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.control-row label {
  color: var(--muted);
  flex: 1;
}

.control-row input[type="range"],
.control-row select,
.control-row input[type="file"] {
  flex: 1.2;
  background: #0f0f0f;
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 6px 8px;
}

.control-row input[type="checkbox"] {
  transform: scale(1.1);
}

.lab-canvas {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
}

.lab-canvas__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.lab-output {
  background: #050505;
  border-radius: 16px;
  overflow: hidden;
}

.lab-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(125, 211, 252, 0.08);
  color: #b6e6fb;
  font-size: 0.8rem;
}

.note {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 0 8px;
}

@media (max-width: 900px) {
  .lab-layout {
    grid-template-columns: 1fr;
  }
}
