* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --bg: #111;
  --surface: #1b1b1b;
  --text: #fff;
  --muted: #c8c8c8;
  --border: #666;
  --focus: #ffd400;
  --button: #f4f4f4;
  --button-text: #111;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fff;
    --surface: #f5f5f5;
    --text: #111;
    --muted: #444;
    --border: #777;
    --focus: #005fcc;
    --button: #111;
    --button-text: #fff;
  }
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100%;
}

button,
select {
  font: inherit;
  min-height: 48px;
}

button {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--button);
  color: var(--button-text);
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  padding: 0.75rem 1rem;
  background: var(--button);
  color: var(--button-text);
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.shell {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.header {
  margin-bottom: 2rem;
}

.eyebrow,
.tagline,
.station-description,
footer {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.25rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 10vw, 6rem);
  letter-spacing: 0.08em;
}

.tagline {
  margin-top: 0.5rem;
  font-size: 1.2rem;
}

.now,
.presets,
.shuffle,
.help {
  border-top: 2px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.now h2,
.presets h2,
.shuffle h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.station-name {
  margin: 0.25rem 0;
  font-size: clamp(2rem, 7vw, 3.75rem);
  font-weight: 800;
}

.station-description {
  font-size: 1.1rem;
  line-height: 1.5;
}

.state {
  font-weight: 800;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.controls button {
  flex: 1 1 150px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.preset-grid button {
  min-height: 64px;
  text-align: left;
}

.save-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.save-form label {
  font-weight: 700;
}

.save-form select {
  width: 100%;
  padding: 0.6rem;
}

.help summary {
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.help dl {
  margin-bottom: 0;
}

.help dl div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.help dt {
  font-weight: 800;
}

.help dd {
  margin: 0;
}

footer {
  margin-top: 2rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 1rem, 760px);
  }

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

  .help dl div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}
