:root {
  color-scheme: dark;
  --bg: #080808;
  --surface: rgba(12, 12, 12, 0.94);
  --surface-raised: rgba(18, 18, 18, 0.98);
  --line: rgba(231, 231, 229, 0.2);
  --line-soft: rgba(231, 231, 229, 0.09);
  --text: #e7e7e5;
  --muted: rgba(231, 231, 229, 0.72);
  --soft: rgba(231, 231, 229, 0.52);
  --orange: #ff6b00;
  --cyan: #19d3ff;
  --signal: var(--cyan);
  --ink: #080808;
  --radius: 0;
  --max: 1240px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Arial Narrow", "Aptos Display", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(231, 231, 229, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 231, 229, 0.026) 1px, transparent 1px);
  background-size: 64px 64px;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
}

img,
iframe {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 30;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  color: var(--ink);
  background: var(--orange);
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(10px);
}

.site-nav,
main,
.site-footer {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
}

.site-nav {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 42px;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: block;
  flex: 0 0 32px;
}

.brand-text {
  font-family: var(--display);
  font-size: 1.22rem;
  letter-spacing: 0;
  text-transform: lowercase;
}

.nav-menu {
  height: 66px;
  display: flex;
  align-items: stretch;
}

.nav-menu a {
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  border-left-color: var(--line-soft);
  border-right-color: var(--line-soft);
  border-bottom-color: var(--orange);
  color: var(--text);
  background: var(--surface);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  margin: 5px auto;
  background: currentColor;
}

.hero,
.directory-hero,
.article-hero {
  min-height: 460px;
  display: grid;
  align-items: center;
  padding: 4.75rem 0 3.5rem;
}

.directory-hero,
.article-hero {
  min-height: 370px;
  max-width: 980px;
}

.hero-home {
  grid-template-columns: minmax(0, 1.14fr) minmax(310px, 0.64fr);
  gap: 4rem;
}

.hero-copy,
.article-hero,
.directory-hero {
  position: relative;
}

.eyebrow,
.section-kicker,
.status {
  margin: 0 0 0.85rem;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0;
  line-height: 1;
}

h1 {
  max-width: 980px;
  font-size: clamp(3rem, 5.6vw, 5.25rem);
  font-weight: 900;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  font-weight: 900;
  text-transform: uppercase;
}

h3 {
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lede {
  max-width: 720px;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 2rem;
}

.button,
.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 850;
  text-decoration: none;
}

.button {
  justify-content: center;
  padding: 0.72rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.button-primary {
  border-color: var(--orange);
  color: var(--ink);
  background: var(--orange);
}

.button-primary:hover {
  filter: brightness(1.08);
}

.button-ghost {
  color: var(--text);
  background: transparent;
}

.button-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--surface);
}

.text-link {
  justify-content: flex-start;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.text-link::after {
  content: " ->";
  color: var(--orange);
}

.text-link:hover {
  color: var(--orange);
}

.signal-panel,
.feature-card,
.route-card,
.filters,
.source-panel,
.mini-list,
.directory-card,
.timeline,
.empty-state,
.noscript-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.signal-panel {
  min-height: 360px;
  display: grid;
  align-content: space-between;
  padding: 1rem;
  border-top: 2px solid var(--cyan);
  overflow: hidden;
}

.signal-panel::before {
  content: "SIGNAL / 164-174 BPM";
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.signal-panel p {
  margin: 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.equaliser {
  height: 216px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 0.35rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.equaliser span {
  height: 22%;
  background: var(--signal);
  animation: rise 1.8s steps(3, end) infinite;
}

.equaliser span:nth-child(2n) {
  height: 42%;
  animation-delay: 0.18s;
}

.equaliser span:nth-child(3n) {
  height: 78%;
  background: var(--orange);
  animation-delay: 0.33s;
}

.equaliser span:nth-child(4n) {
  height: 55%;
  animation-delay: 0.52s;
}

@keyframes rise {
  0%, 100% { transform: scaleY(0.72); }
  50% { transform: scaleY(1); }
}

.section {
  padding: 4.5rem 0;
}

.compact-section {
  padding-top: 2rem;
}

.section-kicker {
  color: var(--orange);
}

.hero-copy .eyebrow,
.article-hero .eyebrow,
.directory-hero .eyebrow,
.status {
  color: var(--orange);
}

.directory-card .eyebrow {
  color: var(--cyan);
}

.listen-title {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(280px, 0.5fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.section-head p,
.stream-copy p,
.route-card p,
.mini-list p,
.directory-card p,
.source-panel p,
.site-footer p,
.split-section p {
  color: var(--muted);
}

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

.stream-card {
  overflow: hidden;
}

.stream-copy {
  min-height: 220px;
  padding: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.stream-copy h3 {
  margin-bottom: 0.65rem;
}

.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(231, 231, 229, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 231, 229, 0.06) 1px, transparent 1px);
  background-size: 18px 18px;
}

.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-fallback {
  padding: 0.78rem 1.25rem 0.92rem;
  border-top: 1px solid var(--line-soft);
  background: var(--bg);
}

.live-dot {
  display: inline-block;
  width: 0.68em;
  height: 0.68em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgb(255 107 0 / 0.55);
  animation: livePulse 1.8s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgb(255 107 0 / 0.55); }
  70% { box-shadow: 0 0 0 8px rgb(255 107 0 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(255 107 0 / 0); }
}

.tag-row,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-row {
  margin: 0.9rem 0;
}

.tag-row span,
.meta-pill {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

.route-card {
  min-height: 230px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 0.75rem;
  padding: 1.15rem;
  color: var(--text);
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease;
}

.route-card:hover,
.directory-card:hover {
  border-color: var(--orange);
  background: var(--surface-raised);
}

.route-card span {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.route-card h3,
.route-card p {
  margin: 0;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(310px, 0.55fr);
  gap: 3rem;
  align-items: start;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.split-section > div:first-child {
  padding: 2.75rem 0;
}

.mini-list {
  margin: 2.75rem 0;
  padding: 0 1rem;
  border-top: 2px solid var(--cyan);
}

.mini-list p {
  margin: 0;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.mini-list p:last-child {
  border-bottom: 0;
}

.mini-list span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.article-shell {
  padding-bottom: 5rem;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3rem;
  align-items: start;
}

.article-body {
  max-width: 760px;
}

.article-body section {
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
}

.article-body h2 {
  max-width: 660px;
  font-size: 1.9rem;
  line-height: 1.08;
}

.article-body p {
  color: var(--muted);
  font-size: 1.04rem;
}

.timeline {
  margin-bottom: 3rem;
  padding: 1.25rem;
}

.timeline h2,
.source-panel h2 {
  font-size: 1.45rem;
}

.timeline ol {
  display: grid;
  gap: 0;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.timeline span {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.source-panel {
  position: sticky;
  top: 92px;
  padding: 1rem;
  border-top: 2px solid var(--cyan);
}

.source-panel ul {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.source-panel li + li {
  margin-top: 0.65rem;
}

.source-panel a {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: end;
  padding: 1.2rem;
  border-top: 2px solid var(--orange);
}

.filters h2 {
  font-size: 1.5rem;
}

.search-box {
  grid-column: 2;
}

.search-box {
  display: grid;
  gap: 0.45rem;
}

.search-box span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: var(--bg);
  padding: 0.75rem 0.9rem;
}

.filter-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.filter-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: var(--orange);
  color: var(--ink);
  background: var(--orange);
}

.directory-section {
  padding-top: 1.5rem;
}

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

.directory-card {
  position: relative;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem;
  overflow: hidden;
  transition: background 160ms ease, border-color 160ms ease;
}

.directory-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--cyan);
}

.directory-card > * {
  position: relative;
}

.directory-card h3 {
  margin: 0.75rem 0 0.55rem;
}

.directory-card p {
  margin: 0.5rem 0;
}

.card-meta {
  margin-top: 0.8rem;
}

.feature-list {
  margin: 0.9rem 0;
  padding-left: 1rem;
  color: var(--muted);
}

.feature-list li + li {
  margin-top: 0.25rem;
}

.empty-state,
.noscript-note {
  margin: 1rem 0;
  padding: 1rem;
  color: var(--muted);
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  border-top: 1px solid var(--line);
}

.footer-brand {
  margin-bottom: 0.7rem;
}

.site-footer p {
  max-width: 620px;
  margin: 0.4rem 0 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 0;
}

.site-footer nav a {
  position: relative;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  margin-left: -1px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.site-footer nav a:first-child {
  margin-left: 0;
}

.site-footer nav a:hover,
.site-footer nav a[aria-current="page"] {
  z-index: 1;
  border-color: var(--orange);
  color: var(--text);
  background: var(--surface);
}

.footer-meta {
  grid-column: 1 / -1;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.78rem;
}

@media (max-width: 980px) {
  .hero,
  .directory-hero,
  .article-hero {
    min-height: auto;
    padding: 4rem 0 3rem;
  }

  .hero-home,
  .section-head,
  .split-section,
  .article-grid {
    grid-template-columns: 1fr;
  }

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

  .split-section > div:first-child {
    padding-bottom: 0;
  }

  .mini-list {
    margin-top: 0;
  }

  .source-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-nav,
  main,
  .site-footer {
    width: min(calc(100% - 28px), var(--max));
  }

  .site-nav {
    min-height: 60px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    inset: calc(env(safe-area-inset-top) + 60px) 14px auto;
    display: none;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--bg);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a {
    min-width: 0;
    min-height: 48px;
    justify-content: flex-start;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-menu a:last-child {
    border-bottom: 0;
  }

  .nav-menu a:hover,
  .nav-menu a[aria-current="page"] {
    border-left: 3px solid var(--orange);
    border-bottom: 1px solid var(--line);
  }

  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 2rem;
  }

  .lede {
    font-size: 1.03rem;
  }

  .stream-grid,
  .link-grid,
  .card-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

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

  .filters h2,
  .search-box,
  .filter-row {
    grid-column: 1;
  }

  .signal-panel {
    min-height: 270px;
  }

  .equaliser {
    height: 148px;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .directory-card {
    min-height: 320px;
  }

  .site-footer nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer nav a {
    justify-content: center;
    margin: -1px 0 0 -1px;
  }

  .site-footer nav a:nth-child(odd) {
    margin-left: 0;
  }

  .site-footer nav a:nth-child(-n + 2) {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
