/* ============================================================
   YOUNG BULL, Ticker Card Component System
   12-cluster visual identity. Pure HTML/CSS, driven by
   data-cluster + data-layer attributes. No per-ticker hardcoding.

   Variants:
     .tc, standard 320×180 (grid / map drill / research)
     .tc-compact, 200×80  (feeds, room, agent pages)
     .tc-hero, 1200×630 (NotebookLM-grade, /research/:ticker)
   ============================================================ */

/* Base, every variant shares the schematic grid + crosshair frame */
.tc {
  position: relative;
  display: block;
  width: 320px;
  height: 180px;
  background: var(--tc-bg, var(--bg-elev));
  color: var(--ink);
  border: 1px solid var(--tc-line, var(--line));
  border-radius: 2px;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  box-sizing: border-box;
  font-family: var(--sans);
  transition: transform var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
  background-image:
    linear-gradient(var(--tc-grid, var(--grid)) 1px, transparent 1px),
    linear-gradient(90deg, var(--tc-grid, var(--grid)) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0;
}
.tc:hover {
  transform: translateY(-2px);
  border-color: var(--tc-accent, var(--gold));
}

/* Corner crosshair (NotebookLM signature), only on standard/hero */
.tc::before, .tc::after {
  content: ""; position: absolute;
  width: 12px; height: 12px;
  pointer-events: none;
}
.tc::before {
  top: 0; left: 0;
  border-top: 1px solid var(--tc-accent, var(--gold));
  border-left: 1px solid var(--tc-accent, var(--gold));
}
.tc::after {
  bottom: 0; right: 0;
  border-bottom: 1px solid var(--tc-accent, var(--gold));
  border-right: 1px solid var(--tc-accent, var(--gold));
}

/* Ticker + name */
.tc-ticker {
  position: absolute;
  top: 14px; left: 16px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--tc-accent, var(--gold));
  line-height: 1;
}
.tc-name {
  position: absolute;
  top: 18px; left: 78px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-eyebrow {
  position: absolute;
  top: 38px; left: 78px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tc-accent, var(--gold));
}

/* Cluster ribbon (top-right) */
.tc-cluster {
  position: absolute;
  top: 14px; right: 16px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tc-accent, var(--gold));
  text-align: right;
}

/* Thesis line (bottom-left, above metric) */
.tc-thesis {
  position: absolute;
  bottom: 38px; left: 16px; right: 16px;
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-body);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

/* Metric block (bottom-right) */
.tc-metric {
  position: absolute;
  bottom: 14px; right: 16px;
  text-align: right;
  font-family: var(--mono);
}
.tc-metric .v {
  font-size: 16px;
  font-weight: 600;
  color: var(--tc-accent, var(--gold));
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.tc-metric .v.gain { color: var(--gain); }
.tc-metric .v.loss { color: var(--loss); }
.tc-metric .k {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* Layer chip (bottom-left) */
.tc-layer {
  position: absolute;
  bottom: 14px; left: 16px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tc-accent, var(--gold));
  padding: 2px 6px;
  border: 1px solid var(--tc-accent-dim, var(--line));
  background: var(--tc-tint, transparent);
  border-radius: 2px;
}

/* Anchor flag (top-right corner pip) */
.tc-anchor-pip {
  position: absolute;
  top: 14px; right: 14px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  z-index: 2;
}

/* SVG prop (decorative motif center) */
.tc-prop {
  position: absolute;
  top: 60px; right: 14px;
  width: 110px; height: 70px;
  opacity: 0.42;
  color: var(--tc-accent, var(--gold));
  pointer-events: none;
}

/* ── Compact variant, 200×80, for feeds ── */
.tc-compact {
  width: 200px; height: 80px;
  padding: 0;
}
.tc-compact::before, .tc-compact::after { display: none; }
.tc-compact .tc-ticker { top: 10px; left: 12px; font-size: 20px; }
.tc-compact .tc-name { top: 12px; left: 56px; font-size: 11px; max-width: 130px; }
.tc-compact .tc-eyebrow { display: none; }
.tc-compact .tc-cluster { display: none; }
.tc-compact .tc-thesis { display: none; }
.tc-compact .tc-prop { display: none; }
.tc-compact .tc-layer {
  top: auto; left: 12px; bottom: 8px;
  font-size: 8px;
}
.tc-compact .tc-metric { bottom: 8px; right: 12px; }
.tc-compact .tc-metric .v { font-size: 12px; }
.tc-compact .tc-metric .k { display: none; }

/* ── Hero variant, 1200×630, NotebookLM-grade ── */
.tc-hero {
  width: 1200px; height: 630px;
  padding: 0;
  background-size: 60px 60px;
}
.tc-hero::before, .tc-hero::after {
  width: 28px; height: 28px;
}
.tc-hero .tc-ticker { top: 46px; left: 56px; font-size: 72px; }
.tc-hero .tc-name   { top: 60px; left: 200px; font-size: 18px; max-width: 460px; }
.tc-hero .tc-eyebrow{ top: 88px; left: 200px; font-size: 12px; letter-spacing: 0.22em; }
.tc-hero .tc-cluster{ top: 46px; right: 56px; font-size: 12px; letter-spacing: 0.22em; }
.tc-hero .tc-thesis {
  bottom: 80px; left: 56px; right: 56px;
  font-size: 22px;
  line-height: 1.4;
  border-top: 1px solid var(--tc-accent-dim, var(--line));
  padding-top: 16px;
  -webkit-line-clamp: 3;
  max-width: 78ch;
}
.tc-hero .tc-prop {
  top: 160px; right: 56px;
  width: 480px; height: 280px;
  opacity: 1;
}
.tc-hero .tc-layer {
  bottom: 32px; left: 56px;
  font-size: 11px;
  padding: 4px 10px;
}
.tc-hero .tc-metric {
  bottom: 32px; right: 56px;
}
.tc-hero .tc-metric .v { font-size: 32px; }
.tc-hero .tc-metric .k { font-size: 11px; margin-top: 4px; }

/* ─── CLUSTER PALETTES ─────────────────────────────────────────
   Each [data-cluster="N"] resolves a palette that overrides the
   defaults. Hue + texture + tint are encapsulated here so the
   rest of the card markup is identical across all 12 clusters.
   ────────────────────────────────────────────────────────────── */

/* 1, ANCHORS (5 anchor tickers, hero treatment) */
.tc[data-cluster="anchor"] {
  --tc-bg: #1a1410;
  --tc-grid: #2a2218;
  --tc-accent: #f3d27a;
  --tc-accent-dim: rgba(243,210,122,0.35);
  --tc-tint: rgba(243,210,122,0.06);
  --tc-line: rgba(243,210,122,0.35);
}

/* 2, WFE / Semicap (clean room, sterile, silver-grey + cyan) */
.tc[data-cluster="wfe"] {
  --tc-bg: #0c1119;
  --tc-grid: #1a2030;
  --tc-accent: #94a3b8;
  --tc-accent-dim: rgba(148,163,184,0.35);
  --tc-tint: rgba(103,232,249,0.05);
  --tc-line: rgba(148,163,184,0.30);
}

/* 3, Compute / GPU / IP (electric green, die-shot) */
.tc[data-cluster="compute"] {
  --tc-bg: #08090b;
  --tc-grid: #131618;
  --tc-accent: #22c55e;
  --tc-accent-dim: rgba(34,197,94,0.35);
  --tc-tint: rgba(34,197,94,0.06);
  --tc-line: rgba(34,197,94,0.30);
}

/* 4, Networking / Photonics (iridescent gold-cyan, only place gradient lives) */
.tc[data-cluster="photonics"] {
  --tc-bg: #0a0f1a;
  --tc-grid: #131c2b;
  --tc-accent: #d4a843;
  --tc-accent-dim: rgba(212,168,67,0.45);
  --tc-tint: rgba(103,232,249,0.06);
  --tc-line: rgba(212,168,67,0.30);
}
.tc[data-cluster="photonics"] .tc-ticker {
  background: linear-gradient(90deg, #d4a843 0%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 5, Power generation (industrial amber on charcoal) */
.tc[data-cluster="power"] {
  --tc-bg: #1a1d24;
  --tc-grid: #232830;
  --tc-accent: #e6b84a;
  --tc-accent-dim: rgba(230,184,74,0.35);
  --tc-tint: rgba(230,184,74,0.06);
  --tc-line: rgba(230,184,74,0.30);
}
.tc[data-cluster="power-nuclear"] {
  --tc-bg: #0e1816;
  --tc-grid: #18241f;
  --tc-accent: #4a9b8e;
  --tc-accent-dim: rgba(74,155,142,0.40);
  --tc-tint: rgba(74,155,142,0.06);
  --tc-line: rgba(74,155,142,0.30);
}

/* 6, Datacenter physical (rack cool blue with cooling-hot accent) */
.tc[data-cluster="datacenter"] {
  --tc-bg: #08090b;
  --tc-grid: #141822;
  --tc-accent: #5b6db8;
  --tc-accent-dim: rgba(91,109,184,0.40);
  --tc-tint: rgba(244,114,182,0.05);
  --tc-line: rgba(91,109,184,0.30);
}

/* 7, Hyperscalers (clean corporate, restrained) */
.tc[data-cluster="hyperscaler"] {
  --tc-bg: #11131a;
  --tc-grid: #1c2030;
  --tc-accent: #c8ccd1;
  --tc-accent-dim: rgba(200,204,209,0.35);
  --tc-tint: rgba(200,204,209,0.04);
  --tc-line: rgba(200,204,209,0.25);
}

/* 8, Defense (desert/coyote, radar grid) */
.tc[data-cluster="defense"] {
  --tc-bg: #0a0c10;
  --tc-grid: #161a1f;
  --tc-accent: #b8902a;
  --tc-accent-dim: rgba(184,144,42,0.40);
  --tc-tint: rgba(184,144,42,0.05);
  --tc-line: rgba(184,144,42,0.30);
}

/* 9, Quantum (frontier indigo + magenta) */
.tc[data-cluster="quantum"] {
  --tc-bg: #0a0a18;
  --tc-grid: #141430;
  --tc-accent: #818cf8;
  --tc-accent-dim: rgba(129,140,248,0.40);
  --tc-tint: rgba(244,114,182,0.06);
  --tc-line: rgba(129,140,248,0.30);
}

/* 10, Storage / OEM (slate, workmanlike) */
.tc[data-cluster="storage"] {
  --tc-bg: #0c0d10;
  --tc-grid: #18191c;
  --tc-accent: #64748b;
  --tc-accent-dim: rgba(100,116,139,0.40);
  --tc-tint: rgba(100,116,139,0.04);
  --tc-line: rgba(100,116,139,0.30);
}

/* 11, Watchlist outliers (neutral grey, deliberately off-thesis) */
.tc[data-cluster="outlier"] {
  --tc-bg: #14141a;
  --tc-grid: #1e1e26;
  --tc-accent: #aaa4a0;
  --tc-accent-dim: rgba(170,164,160,0.30);
  --tc-tint: transparent;
  --tc-line: rgba(170,164,160,0.20);
}
.tc[data-cluster="outlier"] .tc-anchor-pip { display: none; }
.tc[data-cluster="outlier"].is-exiting .tc-ticker { text-decoration: line-through; opacity: 0.7; }
.tc[data-cluster="outlier"].is-exiting::after {
  content: "EXITING";
  position: absolute; right: 14px; bottom: 14px;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.2em; color: var(--loss);
  border: 1px solid var(--loss); padding: 2px 6px;
  border-radius: 2px;
  width: auto; height: auto;
  background: var(--loss-soft, rgba(196,66,63,0.10));
}

/* 12, Mining / specialty materials (copper, geological) */
.tc[data-cluster="materials"] {
  --tc-bg: #1a1410;
  --tc-grid: #261c14;
  --tc-accent: #d4925e;
  --tc-accent-dim: rgba(212,146,94,0.40);
  --tc-tint: rgba(212,146,94,0.05);
  --tc-line: rgba(212,146,94,0.30);
}
