:root {
  --bg: #171512;
  --surface: #211E1A;
  --ink: #EDE7DD;
  --ink-soft: #A79E8E;
  --gold: #D4A24C;
  --line: #34302A;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

a { color: inherit; }

/* Topbar */

.topbar {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 0;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--gold);
  letter-spacing: 0.01em;
}

/* Hero */

.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  line-height: 1.15;
  margin: 0 0 2.25rem;
}

.search-form {
  display: flex;
  gap: 0.6rem;
  max-width: 560px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
}

.search-input::placeholder {
  color: var(--ink-soft);
}

.search-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.search-btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 4px;
  background: var(--gold);
  color: #1a1712;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
}

.search-btn:hover { background: #e3b562; }
.search-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Screen */

.screen-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
}

.screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.screen-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.screen-placeholder p {
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 30ch;
  margin: 0;
}

.player-wrap {
  position: absolute;
  inset: 0;
  display: none;
}

.player-wrap.active { display: block; }

.player-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.now-playing {
  margin: 0.9rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-align: center;
  min-height: 1.4em;
}

/* Results */

.results-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.status {
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: center;
  margin: 0 0 1rem;
}

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.result {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--ink);
}

.result-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.6rem;
  border: 1px solid var(--line);
}

.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
}

.result-channel {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.result:focus-visible .result-thumb {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Footer */

.footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-align: center;
  border-top: 1px solid var(--line);
}

/* Responsive */

@media (max-width: 480px) {
  .search-form { flex-direction: column; }
}
