:root {
  --void: #020205;
  --bone: #e8e1cf;
  --static: #2a2f33;
  --signal-red: #ff2e3a;

  /* Cool-steel / muted signal-blue accent — starting value, expect tuning. */
  --accent: #7eb8d4;

  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- CRT overlays: scanlines + vignette/flicker -------------------------- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(232, 225, 207, 0.035) 2px,
    rgba(232, 225, 207, 0.035) 3px
  );
  animation: scanlines-drift 6s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  background:
    radial-gradient(
      ellipse at center,
      transparent 45%,
      rgba(2, 2, 5, 0.55) 100%
    );
  animation: crt-flicker 7s ease-in-out infinite;
}

@keyframes scanlines-drift {
  from { background-position-y: 0; }
  to   { background-position-y: 3px; }
}

@keyframes crt-flicker {
  0%, 90%, 100% { opacity: 1; }
  91%           { opacity: 0.86; }
  92%           { opacity: 1; }
  93%           { opacity: 0.93; }
  94%           { opacity: 1; }
}

/* --- Page shell ---------------------------------------------------------- */

main {
  position: relative;
  z-index: 1;
}

.screen {
  padding: 2rem;
}

.screen--ident {
  min-height: 88vh;
  display: grid;
  place-items: center;
}

.screen--channels {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4.5rem;
}

/* --- IDENT block --------------------------------------------------------- */

.ident {
  display: grid;
  gap: 1.75rem;
  justify-items: center;
  text-align: center;
}

.ident__mark {
  width: clamp(280px, 52vw, 620px);
  height: auto;
  display: block;
  filter:
    drop-shadow(0 0 28px var(--accent))
    drop-shadow(0 0 70px rgba(126, 184, 212, 0.28));
  animation: ident-power-on 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes ident-power-on {
  0% {
    opacity: 0;
    filter: blur(18px) drop-shadow(0 0 0 transparent);
    clip-path: inset(48% 0 48% 0);
  }
  45% {
    opacity: 0.55;
    filter: blur(8px) drop-shadow(0 0 14px var(--accent));
    clip-path: inset(0 0 0 0);
  }
  100% {
    opacity: 1;
    filter:
      drop-shadow(0 0 28px var(--accent))
      drop-shadow(0 0 70px rgba(126, 184, 212, 0.28));
    clip-path: inset(0 0 0 0);
  }
}

.ident__tag {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.32em;
  color: var(--bone);
  text-transform: uppercase;
  margin: 0;
  opacity: 0.7;
}

.ident__live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  color: var(--bone);
  text-transform: uppercase;
  opacity: 0.85;
}

.ident__live::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--signal-red);
  box-shadow: 0 0 8px var(--signal-red);
  animation: live-pulse 2.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px var(--signal-red);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 14px var(--signal-red);
  }
}

/* --- Section heading ----------------------------------------------------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--static);
}

.section-head__title {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.875rem;
  letter-spacing: 0.32em;
  color: var(--bone);
  text-transform: uppercase;
  margin: 0;
  opacity: 0.7;
}

.section-head__count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  color: var(--bone);
  opacity: 0.45;
}

/* --- CHANNELS block ------------------------------------------------------ */

.channels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 720px) {
  .channels {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  .screen--channels {
    padding: 2rem 1.25rem 3.5rem;
  }
}

.channel {
  position: relative;
}

.channel__link {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  padding: 1.5rem 1.5rem;
  min-height: 170px;
  border: 1px solid var(--static);
  background: rgba(232, 225, 207, 0.012);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 220ms ease-out,
    transform 220ms ease-out,
    background 220ms ease-out;
  height: 100%;
}

.channel__link--inert {
  cursor: default;
  opacity: 0.55;
}

.channel__link:not(.channel__link--inert):hover,
.channel__link:not(.channel__link--inert):focus-visible {
  border-color: var(--accent);
  transform: translateY(-3px);
  background: rgba(126, 184, 212, 0.025);
  outline: none;
}

.channel__link:not(.channel__link--inert):hover .channel__name,
.channel__link:not(.channel__link--inert):focus-visible .channel__name {
  text-shadow: 0 0 14px rgba(126, 184, 212, 0.45);
}

.channel__link:not(.channel__link--inert):hover .channel__status-dot,
.channel__link:not(.channel__link--inert):focus-visible .channel__status-dot {
  animation: channel-tune 0.55s steps(5, end) 1;
}

@keyframes channel-tune {
  0%, 100% { opacity: 1; }
  20% { opacity: 0.2; }
  40% { opacity: 1; }
  60% { opacity: 0.4; }
  80% { opacity: 1; }
}

.channel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.channel__number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  color: var(--bone);
  text-transform: uppercase;
  opacity: 0.55;
}

.channel__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bone);
  opacity: 0.75;
}

.channel__status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--static);
}

.channel__status--on-air .channel__status-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(126, 184, 212, 0.7);
}

.channel__status--standby .channel__status-dot {
  background: var(--static);
  box-shadow: none;
}

.channel__name {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--bone);
  margin: 0;
  transition: text-shadow 220ms ease-out;
}

.channel__tag {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--bone);
  opacity: 0.6;
  margin: 0;
}

/* --- JS-orchestrated reveal states -------------------------------------- */
/* When JS is on, tag/live start hidden and are revealed on schedule.       */

.js-enabled .ident__tag,
.js-enabled .ident__live {
  opacity: 0;
}

.js-enabled .ident__live::before {
  animation: none;
}

.js-enabled .ident__tag.is-revealed {
  opacity: 0.7;
  transition: opacity 0.5s ease-out;
}

.js-enabled .ident__live.is-revealed {
  opacity: 0.85;
  transition: opacity 0.6s ease-out;
}

.js-enabled .ident__live.is-revealed::before {
  animation: live-pulse 2.2s ease-in-out infinite;
}

/* --- Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .ident__mark,
  .ident__live::before {
    animation: none !important;
  }
  .js-enabled .ident__tag {
    opacity: 0.7 !important;
    transition: none !important;
  }
  .js-enabled .ident__live {
    opacity: 0.85 !important;
    transition: none !important;
  }
  .channel__link {
    transition: none !important;
  }
  .channel__link:hover,
  .channel__link:focus-visible {
    transform: none !important;
  }
  .channel__status-dot {
    animation: none !important;
  }
}
