@import url("brand/colors_and_type.css");

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding: 32px clamp(16px, 5vw, 64px) 80px;
}

.wrap { max-width: 1120px; margin: 0 auto; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-bottom: 24px; margin-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}
.top .brand { display: flex; align-items: center; gap: 16px; }
.top img { height: 26px; }
.top h1 {
  font-size: 15px; font-weight: 500; letter-spacing: .01em;
  padding-left: 16px; border-left: 1px solid var(--color-border); color: var(--color-fg);
}
.top .meta {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--color-fg-muted); text-align: right;
}

/* ---------- section scaffolding ---------- */
section { margin-bottom: 48px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--color-fg-secondary); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }

/* ---------- section header with nav ---------- */
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.sec-head .eyebrow { flex: 1; margin: 0; }
.hero-counter {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  color: var(--color-fg-secondary); flex-shrink: 0;
}

/* flanking circular arrows on either side of the hero row */
.hero-row { display: flex; align-items: center; gap: 18px; }
.hero-row .recent { flex: 1; }
.hero-arrow {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-fg); font-size: 24px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.hero-arrow:hover:not(:disabled) { border-color: var(--pg-red); color: var(--pg-red); transform: scale(1.06); }
.hero-arrow:active:not(:disabled) { transform: scale(.96); }
.hero-arrow:disabled { opacity: .25; cursor: default; box-shadow: none; }

/* ---------- recent video ---------- */
/* Stacked: [16:9 thumbnail | KPI cards] on top, full-width Read below.
   Thumbnail stays true 16:9 (uncropped). The Read box is fixed-height so the
   spotlight stays uniform as you navigate — long reads scroll internally. */
.recent { display: flex; flex-direction: column; gap: 22px; }
.spot-top { display: grid; grid-template-columns: 380px 1fr; gap: 28px; align-items: start; }
.thumb-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
}
.thumb-media { position: relative; }
.thumb-card img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; background: var(--pg-stone-200); }
.thumb-media .dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, .82); color: #fff; font-family: var(--font-mono);
  font-size: 12px; font-weight: 500; letter-spacing: .02em;
  padding: 2px 6px; border-radius: 5px; line-height: 1.3;
}
.thumb-card .cap { padding: 16px 18px 18px; }
.thumb-card .cap .t { font-weight: 500; font-size: 15px; line-height: 1.3; margin-bottom: 8px; }
.thumb-card .cap .d {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  color: var(--color-fg-muted); text-transform: uppercase;
}

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kpi {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; min-height: 156px;
}
.kpi .title { font-weight: 600; font-size: 15px; }
.kpi .sub {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--color-fg-muted); margin-top: -5px;
  line-height: 1.35; min-height: 2.7em; /* reserve 2 lines so values/tiers align across cards */
}
.kpi .val {
  font-family: var(--font-mono); font-weight: 500; font-size: 40px; line-height: 1;
  letter-spacing: -.02em;
}
.kpi .val .unit { display: block; font-size: 12.5px; color: var(--color-fg-secondary); margin-top: 4px; letter-spacing: 0; }
.kpi .base { font-size: 12px; color: var(--color-fg-secondary); }
.kpi .base.muted { color: var(--color-fg-muted); font-style: italic; }

.tier {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .07em; font-weight: 500;
  padding: 2px 6px; border-radius: 5px; margin-right: 6px; vertical-align: middle;
}
.t-breakout { background: var(--pg-acid);        color: var(--pg-ink); }
.t-top      { background: var(--pg-mint);        color: var(--pg-forest); }
.t-strong   { background: var(--pg-sky);         color: #2b3a63; }
.t-typical  { background: var(--pg-stone-200);   color: var(--pg-stone-600); }
.t-soft     { background: #F4E1DA;               color: var(--pg-red-deep); }
.t-weak     { background: var(--pg-red-deep);    color: var(--pg-white); }

.delta { font-family: var(--font-mono); font-weight: 500; }
.delta.up { color: var(--color-success); }
.delta.down { color: var(--pg-red-deep); }
.delta.flat { color: var(--color-fg-muted); }

/* right column of the spotlight: KPI cards, then info cards in the negative space below */
.spot-right { display: flex; flex-direction: column; gap: 16px; }

/* reusable contextual info card — blue by default; use for any relevant note */
.infobox {
  font-size: 12.5px; color: var(--color-fg-secondary); line-height: 1.45;
  background: var(--color-info-soft); border-radius: 10px; padding: 12px 16px;
}
.infobox b { font-weight: 600; color: var(--color-fg); }

/* still-maturing state — shown in the KPI area for very new videos */
.maturing {
  background: var(--color-surface); border: 1px dashed var(--color-border-strong);
  border-radius: 14px; padding: 26px 24px; display: flex; flex-direction: column;
  justify-content: center; gap: 10px; min-height: 156px;
}
.mat-label {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--pg-red);
}
.mat-body { font-family: var(--font-serif); font-size: 15px; line-height: 1.5; color: var(--color-fg-secondary); }

.insight {
  height: 118px; overflow-y: auto;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-left: 3px solid var(--pg-red); border-radius: 12px; padding: 16px 22px;
}
.insight-label {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--pg-red); margin-bottom: 8px;
}
.insight p {
  font-family: var(--font-serif); font-size: 15.5px; line-height: 1.55; color: var(--color-fg);
}

/* ---------- channel ---------- */
.controls { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--color-surface-alt); border-radius: 10px; padding: 3px; }
.seg button {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  border: 0; background: transparent; color: var(--color-fg-secondary);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: all .12s;
}
.seg button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-fg); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.chan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; padding: 22px 22px 20px;
}
.stat .lab {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--color-fg-secondary);
}
.stat .num {
  font-family: var(--font-mono); font-weight: 500; font-size: 44px; line-height: 1.05;
  margin: 12px 0 6px; letter-spacing: -.02em;
}
.stat .cmp { font-size: 12.5px; color: var(--color-fg-secondary); }
.stat .cmp .delta { margin-right: 6px; }

.chart-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; padding: 22px 24px;
}
.chart-card .lab {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--color-fg-secondary); margin-bottom: 16px;
}

/* trend bars — each column: [tag] [bar area] [label]. Current period accented. */
.barchart { display: flex; align-items: flex-end; gap: 7px; }
.col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.col .tag {
  height: 15px; font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--pg-red); text-align: center; font-weight: 500;
}
.col .barh { height: 150px; display: flex; align-items: flex-end; }
.col .bar {
  width: 100%; background: var(--pg-stone-300); border-radius: 4px 4px 0 0;
  min-height: 2px; transition: background .12s, opacity .12s; position: relative;
}
.col.cur .bar { background: var(--pg-red); }
.col .bar:hover { opacity: .78; z-index: 5; } /* lift above sibling bars so the tooltip isn't clipped */
.col .bar:hover::after {
  content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 6px; background: var(--pg-ink); color: var(--pg-white);
  font-family: var(--font-mono); font-size: 11px; white-space: nowrap;
  padding: 4px 8px; border-radius: 5px; z-index: 10; pointer-events: none;
}
.col .lab {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--color-fg-muted);
  text-align: center; margin-top: 8px; text-transform: none; letter-spacing: .02em;
}
.col.cur .lab { color: var(--pg-red); font-weight: 600; }

/* ---------- library signals ---------- */
.signals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sig {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-border); border-radius: 12px; padding: 16px 18px 18px;
}
.sig-win  { border-top-color: var(--pg-forest); }
.sig-gem  { border-top-color: var(--pg-indigo); }
.sig-miss { border-top-color: var(--pg-red); }
.sig-head { font-weight: 600; font-size: 15px; }
.sig-desc {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--color-fg-muted); margin: 3px 0 12px;
}
.sig-list { display: flex; flex-direction: column; gap: 6px; }
.sig-item {
  text-align: left; font-family: var(--font-sans); font-size: 13px; line-height: 1.3;
  color: var(--color-fg); background: var(--color-surface-alt); border: 0; border-radius: 7px;
  padding: 8px 10px; cursor: pointer; transition: all .12s;
}
.sig-item:hover { background: var(--pg-stone-300); }
.sig-flat { grid-column: 1 / -1; }

@media (max-width: 780px) { .signals { grid-template-columns: 1fr; } }

/* ---------- leaderboard ---------- */
table { width: 100%; border-collapse: collapse; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; }
thead th {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--color-fg-secondary); text-align: right; padding: 13px 16px; border-bottom: 1px solid var(--color-border); font-weight: 500;
}
thead th:first-child, tbody td:first-child { text-align: left; }
tbody td { padding: 12px 16px; text-align: right; font-family: var(--font-mono); font-size: 13px; border-bottom: 1px solid var(--color-border); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.brow { cursor: pointer; }
tbody tr:hover { background: var(--color-surface-alt); }
.vtitle { display: flex; align-items: center; gap: 12px; font-family: var(--font-sans); text-align: left; max-width: 380px; }
.vtitle img { width: 64px; height: 36px; border-radius: 5px; object-fit: cover; background: var(--pg-stone-200); flex-shrink: 0; }
.vtitle span { font-size: 13px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.foot { font-size: 12px; color: var(--color-fg-muted); margin-top: 24px; line-height: 1.6; }
.foot b { color: var(--color-fg-secondary); font-weight: 500; }

@media (max-width: 780px) {
  .spot-top { grid-template-columns: 1fr; }
  .kpis, .chan-grid { grid-template-columns: 1fr; }
  .insight { height: auto; overflow-y: visible; }
}
