:root {
  color-scheme: dark;
  --bg: #060606;
  --panel: rgba(20, 7, 9, 0.88);
  --panel-strong: rgba(10, 3, 4, 0.96);
  --text: #fff4f5;
  --muted: #c5a4aa;
  --line: rgba(255, 124, 140, 0.16);
  --accent: #ff425f;
  --accent-soft: #ff7f91;
  --green: #7affbd;
  --red: #ff5d78;
  --amber: #ffbb6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 66, 95, 0.24), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 127, 145, 0.18), transparent 24%),
    radial-gradient(circle at bottom center, rgba(133, 12, 32, 0.22), transparent 36%),
    linear-gradient(160deg, #020202 0%, #060606 45%, #120406 100%);
  color: var(--text);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 88, 110, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 88, 110, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 75%);
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.hero,
.toolbar,
.section-card,
.table-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 66, 95, 0.04) inset;
}

.hero {
  border-radius: 28px;
  padding: 32px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1.4fr 0.9fr;
  align-items: end;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 66, 95, 0.18), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  color: var(--accent-soft);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: clamp(3.2rem, 6.5vw, 6rem);
  line-height: 0.95;
  max-width: 11ch;
  letter-spacing: -0.04em;
  text-shadow: 0 0 24px rgba(255, 66, 95, 0.18);
}

.hero-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.22em;
}

.hero-title-noise,
.hero-title-tracker {
  display: block;
}

.hero-title-noise {
  font-size: clamp(3.8rem, 7vw, 6.8rem);
  letter-spacing: -0.07em;
  font-weight: 800;
  color: #fff8f8;
  text-shadow:
    0 0 28px rgba(255, 255, 255, 0.08),
    0 0 34px rgba(255, 66, 95, 0.18);
}

.hero-title-tracker {
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent-soft);
  text-shadow:
    0 0 18px rgba(255, 127, 145, 0.16),
    0 0 26px rgba(255, 66, 95, 0.14);
  animation: tracker-glow 2.6s ease-in-out infinite;
}

.hero-signature {
  position: absolute;
  top: 18px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(9, 4, 5, 0.62);
  border: 1px solid rgba(255, 127, 145, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  z-index: 1;
}

.hero-copy {
  padding-top: 42px;
}

.hero-signature-text {
  margin: 0;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  color: #ffd3d9;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 66, 95, 0.12);
  border: 1px solid rgba(255, 127, 145, 0.18);
  box-shadow: 0 0 24px rgba(255, 66, 95, 0.12);
}

.brand-mark span {
  width: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff93a2, #ff425f);
  animation: pulse-bars 1.4s ease-in-out infinite;
}

.brand-mark span:nth-child(1) {
  height: 10px;
}

.brand-mark span:nth-child(2) {
  height: 18px;
  animation-delay: 0.15s;
}

.brand-mark span:nth-child(3) {
  height: 26px;
  animation-delay: 0.3s;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.8;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.8rem;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar {
  margin-top: 22px;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.toolbar-copy {
  display: grid;
  gap: 6px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-text {
  color: var(--muted);
  font-size: 0.96rem;
}

.timeframe-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.timeframe-chip {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.timeframe-chip.active {
  background: linear-gradient(135deg, rgba(255, 66, 95, 0.34), rgba(128, 12, 30, 0.56));
  color: var(--text);
  box-shadow: 0 0 24px rgba(255, 66, 95, 0.18);
}

.timeframe-chip:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.grid-sections {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.section-card {
  border-radius: 22px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

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

.section-head h3 {
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.section-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.mini-market {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 16px;
  min-height: 72px;
  padding: 11px 12px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.mini-market:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 127, 145, 0.22);
  background: rgba(255, 66, 95, 0.05);
}

.mini-market-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mini-market-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mini-market-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff6f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-market-subline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-ticker {
  color: var(--accent-soft);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.mini-market .meta {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-market-side {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 132px;
}

.mini-price,
.mini-relevance {
  color: var(--text);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.86;
}

.mini-mark-change {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-height: 24px;
}

.mini-attention {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mini-label {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-relevance {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.positive {
  color: var(--green);
  background: rgba(74, 247, 167, 0.1);
}

.negative {
  color: var(--red);
  background: rgba(255, 126, 148, 0.12);
}

.neutral {
  color: var(--amber);
  background: rgba(255, 207, 105, 0.1);
}

.table-card {
  margin-top: 24px;
  border-radius: 28px;
  padding: 20px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.last-updated {
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  color: var(--muted);
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tbody tr:hover {
  background: rgba(255, 66, 95, 0.06);
}

.market-cell {
  min-width: 250px;
}

.market-entry {
  display: flex;
  align-items: center;
  gap: 12px;
}

.market-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 91, 120, 0.16), rgba(80, 12, 22, 0.5));
  border: 1px solid rgba(255, 127, 145, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.market-icon.small {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 10px;
}

.market-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.market-icon span {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.market-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.market-name .ticker {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

.market-name .categories {
  color: var(--muted);
  font-size: 0.82rem;
}

.numeric {
  font-variant-numeric: tabular-nums;
}

.empty-state {
  text-align: center;
  padding: 28px 0;
  color: var(--muted);
}

@keyframes pulse-bars {
  0%,
  100% {
    transform: scaleY(0.88);
    opacity: 0.7;
  }
  50% {
    transform: scaleY(1.14);
    opacity: 1;
  }
}

@keyframes tracker-glow {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.92;
    letter-spacing: -0.04em;
    text-shadow:
      0 0 18px rgba(255, 127, 145, 0.16),
      0 0 26px rgba(255, 66, 95, 0.14);
  }
  50% {
    transform: translateX(2px);
    opacity: 1;
    letter-spacing: -0.02em;
    text-shadow:
      0 0 24px rgba(255, 164, 176, 0.2),
      0 0 34px rgba(255, 66, 95, 0.22);
  }
}

@media (max-width: 980px) {
  .hero,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .section-body {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1280px);
    padding-top: 20px;
  }

  .hero,
  .toolbar,
  .table-card,
  .section-card {
    border-radius: 20px;
  }

  .hero {
    padding: 22px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-title {
    gap: 0.14em;
  }

  .hero-signature {
    top: 14px;
    left: 14px;
    right: 14px;
    width: auto;
    justify-content: center;
  }

  .hero-copy {
    padding-top: 58px;
  }

  .timeframe-switch {
    width: 100%;
    justify-content: space-between;
  }

  .timeframe-chip {
    flex: 1 1 0;
  }

  .section-body {
    grid-template-columns: 1fr;
  }
}
