:root {
  color-scheme: dark;
  --bg: #050506;
  --card: rgba(16, 16, 19, 0.72);
  --card-border: rgba(255, 255, 255, 0.08);
  --cell: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #e8c36a;          /* yields */
  --accent-soft: rgba(232, 195, 106, 0.14);
  --up: #4ade80;
  --down: #f87171;
  --radius: 18px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}

/* ---------- background ---------- */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0.85;
}
.bg-shade {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(5, 5, 6, 0.2), rgba(5, 5, 6, 0.75) 70%),
    linear-gradient(to bottom, rgba(5, 5, 6, 0.35), rgba(5, 5, 6, 0.85));
}

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px max(16px, calc((100vw - 1480px) / 2));
  background: rgba(5, 5, 6, 0.6);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line);
}
.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-2);
}
.status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}
.pill.open .dot { background: var(--up); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); }
.refresh {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.refresh:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.refresh.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- groups ---------- */
main {
  padding: 8px max(16px, calc((100vw - 1480px) / 2)) 24px;
}
.group { margin-top: 28px; }
.group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px 2px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.group-title span { color: var(--text-3); font-weight: 500; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  align-items: start;
  gap: 14px;
}

/* ---------- card ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 18px 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.6);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.id { min-width: 0; }
.ticker {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
/* Names reserve two lines so every card header is the same height. */
.name {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.35;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* The yield area is the same height on every card, collapsed; it grows only when expanded. */
.yield {
  display: flex;
  flex-direction: column;
  min-height: 119px;
}
.yield .months-toggle { margin-top: auto; }
.quote { text-align: right; flex-shrink: 0; }
.price {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.change {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
}
.change.up { color: var(--up); }
.change.down { color: var(--down); }
.change.flat { color: var(--text-2); }

/* yield block */
.yield-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 4px;
}
.hero-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
}
.hero-sub {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}
.hero-sub b { color: var(--text); font-weight: 600; }
.chip {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.06);
}
.months-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.months-toggle:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); }
.months-toggle .chev { transition: transform 0.2s; }
.months-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.months {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.months[hidden] { display: none; }
.month {
  position: relative;
  overflow: hidden;
  padding: 7px 4px 9px;
  border-radius: 8px;
  background: var(--cell);
  text-align: center;
  cursor: default;
  transition: background 0.15s;
}
.month:hover { background: rgba(255, 255, 255, 0.09); }
.month .m {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.month .v {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.month .bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  opacity: 0.85;
}
.month.none .v, .month.before-launch .v { color: var(--text-3); font-weight: 500; }
.month.before-launch { background: transparent; border: 1px dashed rgba(255, 255, 255, 0.07); }

.no-yield {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  background: var(--cell);
  font-size: 13px;
  color: var(--text-2);
}

/* ranges */
.ranges { display: grid; gap: 14px; }
.range-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.range-label .since { text-transform: none; letter-spacing: 0; font-weight: 500; }
.track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}
.track .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.35));
}
.track .marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid #18181b;
  transform: translate(-50%, -50%);
}
.range-ends, .at-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--text-2);
}
.range-ends span { font-weight: 600; color: var(--text); }
.at-row b { color: var(--text); font-weight: 600; }
.at-row em { font-style: normal; color: var(--text-3); }
.alltime { padding-top: 12px; border-top: 1px solid var(--line); }
.alltime .at-row { margin-top: 0; }

.card-foot {
  font-size: 11.5px;
  color: var(--text-3);
  min-height: 14px;
}
.card-foot.warn { color: #fbbf24; }

/* loading + error */
.card.loading .price, .card.loading .ticker + .name, .card.loading .yield, .card.loading .ranges {
  color: transparent;
}
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.card.error .yield { color: var(--text-2); font-size: 13px; }

/* tooltip */
.tip {
  position: fixed;
  z-index: 20;
  max-width: 260px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
  pointer-events: none;
}
.tip strong { color: var(--text); font-weight: 600; }
.tip .tv { color: var(--accent); font-weight: 700; }

/* footer */
.notes {
  padding: 8px max(16px, calc((100vw - 1480px) / 2)) 40px;
  max-width: 1480px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
}
.notes strong { color: var(--text-2); font-weight: 600; }

@media (max-width: 560px) {
  .top { padding-top: 14px; padding-bottom: 14px; }
  .brand h1 { font-size: 19px; }
  .status { width: 100%; justify-content: space-between; }
  .hero-value { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton, .refresh.spinning svg { animation: none; }
}
