:root {
  --bg: #050813;
  --panel: rgba(9, 14, 29, 0.78);
  --panel-strong: rgba(12, 17, 34, 0.94);
  --line: rgba(101, 225, 255, 0.18);
  --text: #ecf8ff;
  --muted: #86a2c4;
  --cyan: #59f6ff;
  --pink: #ff38c7;
  --purple: #8f5cff;
  --lime: #b5ff6d;
  --warn: #ffba53;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 18px 72px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 56, 199, 0.18), transparent 20%),
    radial-gradient(circle at 100% 0%, rgba(89, 246, 255, 0.16), transparent 22%),
    radial-gradient(circle at 50% 20%, rgba(143, 92, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #03050b 0%, #070b16 50%, #03050b 100%);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

.grid,
.scanlines,
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.grid {
  background-image:
    linear-gradient(rgba(89, 246, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 246, 255, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 95%);
}

.scanlines {
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.025), transparent);
  background-size: 100% 5px;
  opacity: 0.34;
}

.noise {
  opacity: 0.04;
  background-image:
    radial-gradient(circle at 20% 20%, #fff 0.6px, transparent 0.7px),
    radial-gradient(circle at 80% 40%, #fff 0.6px, transparent 0.7px),
    radial-gradient(circle at 40% 70%, #fff 0.6px, transparent 0.7px);
  background-size: 24px 24px;
}

.shell {
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 22px 60px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.ticker-shell {
  margin-bottom: 18px;
  padding: 12px 18px 14px;
  border-color: rgba(89, 246, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(5, 10, 20, 0.96), rgba(8, 14, 26, 0.92)),
    linear-gradient(90deg, rgba(89, 246, 255, 0.09), rgba(255, 56, 199, 0.08));
  box-shadow: 0 0 0 1px rgba(89, 246, 255, 0.08), 0 0 28px rgba(89, 246, 255, 0.08), var(--shadow);
}

.ticker-head,
.ticker-stream,
.ticker-item,
.ticker-prompt,
.ticker-status {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ticker-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ticker-prompt {
  color: var(--lime);
  text-shadow: 0 0 12px rgba(181, 255, 109, 0.28);
}

.ticker-status {
  color: var(--cyan);
}

.ticker-window {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(2, 5, 12, 0.72);
  padding: 12px 0;
}

.ticker-track {
  display: flex;
  width: max-content;
  min-width: 100%;
  will-change: transform;
  animation: ticker-scroll 36s linear infinite;
}

.ticker-shell:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-stream {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  padding-right: 18px;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.92rem;
}

.ticker-item::after {
  content: "//";
  color: rgba(255,255,255,0.18);
  margin-left: 8px;
}

.ticker-item:last-child::after {
  content: "";
  margin: 0;
}

.ticker-key {
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.ticker-value {
  color: var(--cyan);
}

.ticker-value.muted {
  color: var(--muted);
}

.ticker-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 6px rgba(181, 255, 109, 0.08), 0 0 18px rgba(181, 255, 109, 0.4);
  animation: pulse 1.6s ease-in-out infinite;
}

.alert-strip {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 18px;
  background:
    linear-gradient(90deg, rgba(255, 56, 199, 0.16), rgba(12, 17, 34, 0.95) 26%, rgba(89, 246, 255, 0.12));
  border-color: rgba(255, 56, 199, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 56, 199, 0.12), 0 0 36px rgba(255, 56, 199, 0.12), var(--shadow);
}

.banner-track {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.banner-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  text-decoration: none;
}

.banner-chip:hover { border-color: rgba(89, 246, 255, 0.45); }
.banner-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink);
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 56, 199, 0.08), transparent 20%),
    linear-gradient(180deg, rgba(89, 246, 255, 0.06), rgba(12, 17, 34, 0.95));
  border-color: rgba(89, 246, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(89, 246, 255, 0.1), 0 0 52px rgba(89, 246, 255, 0.08), var(--shadow-strong);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.7;
}

.hero::before {
  top: -60px;
  right: 10%;
  width: 260px;
  height: 260px;
  background: rgba(255, 56, 199, 0.18);
}

.hero::after {
  bottom: -120px;
  right: -4%;
  width: 360px;
  height: 360px;
  background: rgba(89, 246, 255, 0.16);
}

.hero-copy { position: relative; z-index: 1; }

.eyebrow,
.section-kicker,
.legend,
.label,
.item-meta,
.muted {
  color: var(--muted);
}

.eyebrow,
.section-kicker,
.banner-label {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 18px rgba(89, 246, 255, 0.28),
    0 0 42px rgba(255, 56, 199, 0.2);
}

h2 { margin: 8px 0 0; font-size: 1.4rem; }
h3 { margin: 0; font-size: 1.04rem; }
.subhead { max-width: 70ch; font-size: 1rem; line-height: 1.65; }

.glitch {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.75;
}

.glitch::before {
  color: rgba(255, 56, 199, 0.92);
  transform: translate(1px, 0);
  text-shadow: -2px 0 rgba(255, 56, 199, 0.45);
  clip-path: inset(0 0 52% 0);
  animation: glitch-slice-top 2.8s steps(2, end) infinite;
}

.glitch::after {
  color: rgba(89, 246, 255, 0.95);
  transform: translate(-1px, 0);
  text-shadow: 2px 0 rgba(89, 246, 255, 0.5);
  clip-path: inset(54% 0 0 0);
  animation: glitch-slice-bottom 3.2s steps(2, end) infinite;
}

.hero-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 0.85rem;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-self: end;
  position: relative;
  z-index: 1;
}

.stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 15px 16px;
}

.stat strong { display: block; margin-top: 6px; font-size: 1rem; }

.top-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.main-column,
.right-rail {
  display: grid;
  gap: 22px;
}

.right-rail {
  position: sticky;
  top: 18px;
}

.rail-card {
  padding: 22px;
}

.status {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  padding: 22px 24px;
  border-color: rgba(255, 56, 199, 0.24);
}

.summary-row,
.split {
  display: grid;
  gap: 20px;
}

.summary-row { grid-template-columns: repeat(4, 1fr); }
.split { grid-template-columns: 1fr 1fr; }

.mini {
  padding: 22px;
  min-height: 164px;
  position: relative;
  overflow: hidden;
}

.mini::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(89, 246, 255, 0.16), transparent 64%);
}

.big-number {
  font-size: 3rem;
  line-height: 1;
  margin: 12px 0;
  color: var(--cyan);
  text-shadow: 0 0 22px rgba(89, 246, 255, 0.35);
}

section.card {
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head.compact { margin-bottom: 16px; }

.stack {
  display: grid;
  gap: 16px;
}

.item {
  background: var(--panel-strong);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.item-head,
.item-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.item-meta {
  margin: 6px 0 0;
  font-size: 0.88rem;
}

.item-body {
  margin: 16px 0;
  line-height: 1.65;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag,
.score,
.action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
}

.tag {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
}

.score {
  min-width: 62px;
  justify-content: center;
  color: #081019;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), #85ffe2);
  box-shadow: 0 0 22px rgba(89, 246, 255, 0.28);
}

.score.high {
  background: linear-gradient(135deg, var(--pink), #ff9ae1);
  box-shadow: 0 0 24px rgba(255, 56, 199, 0.28);
}

.score.mid {
  background: linear-gradient(135deg, var(--warn), #ffe08c);
}

.action {
  background: rgba(143, 92, 255, 0.16);
  border: 1px solid rgba(143, 92, 255, 0.34);
}

.source-link {
  color: var(--cyan);
  text-decoration: none;
  align-self: center;
}

.source-link:hover { text-decoration: underline; }

.legend-stack,
.heatmap,
.trend-rail {
  display: grid;
  gap: 12px;
}

.legend-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: center;
}

.legend-row p { margin: 0; color: var(--muted); }

.heatmap-row,
.trend-row {
  display: grid;
  gap: 8px;
}

.heatmap-head,
.trend-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.heatmap-bar,
.trend-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.heatmap-fill,
.trend-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  box-shadow: 0 0 18px rgba(89, 246, 255, 0.22);
}

.empty-state {
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.82); opacity: 0.68; }
}

@keyframes glitch-slice-top {
  0%, 88%, 100% { transform: translate(0, 0); opacity: 0; }
  89% { transform: translate(-2px, -1px); opacity: 0.7; }
  91% { transform: translate(3px, 1px); opacity: 0.9; }
  93% { transform: translate(-1px, 0); opacity: 0.5; }
}

@keyframes glitch-slice-bottom {
  0%, 86%, 100% { transform: translate(0, 0); opacity: 0; }
  87% { transform: translate(2px, 1px); opacity: 0.75; }
  90% { transform: translate(-3px, -1px); opacity: 0.95; }
  92% { transform: translate(1px, 0); opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track,
  .ticker-live-dot,
  .glitch::before,
  .glitch::after {
    animation: none;
  }
}

@media (max-width: 1240px) {
  .top-layout {
    grid-template-columns: 1fr;
  }

  .right-rail {
    position: static;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .hero,
  .status,
  .summary-row,
  .split,
  .alert-strip,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .hero-meta { grid-template-columns: repeat(3, 1fr); }
  .ticker-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .shell { padding: 18px 14px 40px; }
  .hero,
  section.card,
  .mini,
  .status,
  .rail-card,
  .alert-strip,
  .ticker-shell { padding: 18px; }
  .hero-meta { grid-template-columns: 1fr; }
  .section-head,
  .item-head,
  .item-footer,
  .heatmap-head,
  .trend-head { flex-direction: column; }
  .ticker-window { padding: 10px 0; }
}
