:root {
  --bg: #020617;
  --panel: rgba(8, 13, 24, 0.76);
  --line: rgba(226, 232, 240, 0.18);
  --text: #f8fafc;
  --muted: rgba(226, 232, 240, 0.74);
  --teal: #2dd4bf;
  --gold: #fbbf24;
  --coral: #fb7185;
  --violet: #a78bfa;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(2,6,23,0.88), rgba(2,6,23,0.42), rgba(2,6,23,0.76)),
    url("/assets/feral-circuit-bg.png") center center / cover fixed no-repeat;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 18%, rgba(251,191,36,0.18), transparent 25%),
    radial-gradient(circle at 82% 24%, rgba(45,212,191,0.18), transparent 28%),
    linear-gradient(180deg, rgba(2,6,23,0.04), rgba(2,6,23,0.86));
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.hero {
  position: relative;
  min-height: 230px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  padding: 34px 38px;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(2,6,23,0.74), rgba(2,6,23,0.28) 58%, rgba(2,6,23,0.60)),
    url("/assets/feral-circuit-bg.png") center 42% / cover no-repeat;
  box-shadow: 0 34px 110px rgba(0,0,0,0.58), inset 0 1px 0 rgba(255,255,255,0.14);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral), var(--violet));
  box-shadow: 0 0 34px rgba(45,212,191,0.55);
}

.hero__copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 10px;
  color: rgba(204,251,241,0.88);
  font-family: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(45,212,191,0.52), 0 4px 14px rgba(0,0,0,0.78);
}

h1 {
  margin: 0;
  line-height: 0.96;
}

h1 span {
  display: inline-flex;
  align-items: center;
  gap: 0.34em;
  padding: 0.15em 0.48em 0.18em;
  border: 1px solid rgba(251,191,36,0.50);
  border-radius: 8px;
  color: #fff7ed;
  background:
    linear-gradient(90deg, rgba(251,191,36,0.18), rgba(236,72,153,0.14), rgba(45,212,191,0.14)),
    rgba(2,6,23,0.56);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10) inset, 0 0 30px rgba(251,191,36,0.24), 0 14px 34px rgba(0,0,0,0.50);
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(38px, 3.7vw, 52px);
  font-weight: 900;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(251,191,36,0.58), 0 0 22px rgba(236,72,153,0.30), 0 7px 20px rgba(0,0,0,0.88);
  white-space: nowrap;
}

h1 span::before,
h1 span::after {
  content: "";
  width: 0.55em;
  height: 0.55em;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #fbbf24, #fb7185);
  clip-path: polygon(18% 8%, 88% 50%, 18% 92%);
  box-shadow: 0 0 14px rgba(251,191,36,0.78);
}

h1 span::after {
  background: linear-gradient(135deg, #2dd4bf, #a78bfa);
}

.summary {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(248,250,252,0.90);
  font-size: 17px;
  line-height: 1.45;
  text-shadow: 0 8px 22px rgba(0,0,0,0.70);
}

.live-panel {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 180px;
  padding: 10px 13px;
  border: 1px solid rgba(52,211,153,0.35);
  border-radius: 999px;
  background: rgba(5,46,22,0.48);
  color: #dcfce7;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 0 28px rgba(34,197,94,0.18), inset 0 1px 0 rgba(255,255,255,0.12);
}

.live-panel__pulse,
.status-glyph {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.16), 0 0 18px rgba(34,197,94,0.82);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 26px;
  padding: 12px 14px;
  border: 1px solid rgba(226,232,240,0.18);
  border-radius: 8px;
  background: rgba(8,13,24,0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.status-strip > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.strip-label {
  color: rgba(153,246,228,0.78);
  font-family: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-strip strong {
  font-size: 15px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.media-card {
  min-width: 0;
}

.media-card__link {
  --accent: var(--teal);
  position: relative;
  min-height: 176px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(226,232,240,0.18);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(15,23,42,0.84), rgba(2,6,23,0.66));
  box-shadow: 0 22px 70px rgba(0,0,0,0.40), inset 0 1px 0 rgba(255,255,255,0.10);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.media-card__link:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 60%, white 10%);
  box-shadow: 0 28px 90px rgba(0,0,0,0.48), 0 0 28px color-mix(in srgb, var(--accent) 24%, transparent);
}

.media-card__shine {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.10), transparent 32%),
    radial-gradient(circle at 88% 78%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 26%);
  pointer-events: none;
}

.media-card__status {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(248,250,252,0.86);
  font-size: 12px;
  font-weight: 800;
}

.media-card__mark {
  position: relative;
  z-index: 1;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  color: var(--accent);
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.48));
}

.media-card__mark::before {
  content: "";
  width: 54px;
  height: 54px;
  border: 6px solid currentColor;
  border-radius: 18px;
  transform: rotate(12deg);
  opacity: 0.92;
}

.media-card[data-service="audiobookshelf"] .media-card__mark::before {
  border-radius: 999px 999px 12px 12px;
}

.media-card[data-service="kavita"] .media-card__mark::before {
  border-radius: 7px;
  transform: rotate(0deg);
}

.media-card[data-service="requests"] .media-card__mark::before {
  border-radius: 999px;
  border-width: 5px;
}

.media-card__body {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-right: 42px;
}

.media-card__name {
  display: block;
  color: #f8fafc;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 10px 24px rgba(0,0,0,0.50);
}

.media-card__description {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.media-card__action {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 1;
  color: color-mix(in srgb, var(--accent) 68%, white 20%);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.media-card.is-offline .status-glyph,
.media-card.is-unknown .status-glyph {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,0.15), 0 0 18px rgba(239,68,68,0.70);
}

.media-card.is-starting .status-glyph {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.15), 0 0 18px rgba(245,158,11,0.70);
}

@media (max-width: 900px) {
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .shell {
    width: calc(100% - 24px);
    padding-top: 12px;
  }

  .hero {
    min-height: 220px;
    display: block;
    padding: 18px;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  h1 span {
    max-width: calc(100vw - 88px);
    gap: 0.22em;
    padding: 0.22em 0.34em 0.24em;
    font-size: clamp(22px, 6.8vw, 27px);
    letter-spacing: 0.012em;
  }

  h1 span::before,
  h1 span::after {
    width: 0.46em;
    height: 0.46em;
  }

  .summary {
    max-width: 330px;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.35;
  }

  .live-panel {
    margin-top: 22px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .status-strip {
    margin: 14px 0 20px;
    padding: 9px 10px;
  }

  .strip-label {
    display: none;
  }

  .status-strip strong {
    font-size: 12px;
  }

  .media-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .media-card__link {
    min-height: 104px;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 13px;
    padding: 8px 13px;
  }

  .media-card__mark {
    width: 52px;
    height: 52px;
  }

  .media-card__mark::before {
    width: 43px;
    height: 43px;
    border-width: 5px;
  }

  .media-card__name {
    font-size: 20px;
    line-height: 1.08;
  }

  .media-card__description {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.2;
  }

  .media-card__status {
    top: 18px;
    right: 16px;
  }

  .status-text {
    display: none;
  }

  .media-card__action {
    display: none;
  }
}
