/* ============================================================
   Ghosts I.G. — stylesheet
   Aesthetic: editorial newspaper × Bloomberg terminal,
   cream paper, ink, one sharp green.
   ============================================================ */

:root {
  --cream: #f4ecdc;
  --cream-soft: #ebe1cd;
  --paper: #fbfaf6;
  --ink: #1a1814;
  --ink-soft: #2d2a24;
  --muted: #6b665a;
  --muted-soft: #8a8576;
  --line: #1a18141a;
  --line-strong: #1a181433;
  --green: #3f7a4d;
  --green-deep: #2c5a37;
  --red: #9a3a2d;
  --red-deep: #762a20;
  --gold: #b6862c;

  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 4px;
  --shadow-card: 0 1px 0 var(--line), 0 12px 32px -16px rgba(26, 24, 20, 0.18);
}

/* ---------- reset-ish ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.5;
  /* subtle paper grain */
  background-image: radial-gradient(
    rgba(26, 24, 20, 0.045) 1px,
    transparent 1px
  );
  background-size: 14px 14px;
  background-position: 0 0;
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  cursor: pointer;
}

/* ---------- layout ---------- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

@media (max-width: 600px) {
  .container {
    padding: 0 18px;
  }
}

/* ============================================================
   NAV / MASTHEAD
   ============================================================ */
.masthead {
  border-bottom: 2px solid var(--ink);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(244, 236, 220, 0.92);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand__mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 3px;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.nav-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 122, 77, 0.18);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
.nav-status__text {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-status__time {
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 700px) {
  .nav-status__text {
    display: none;
  }
}

/* ============================================================
   HERO — the front page above the fold
   ============================================================ */
.hero {
  padding: 60px 0 32px;
  border-bottom: 1px solid var(--line-strong);
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero__eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: end;
}
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.hero__headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
}
.hero__headline em {
  font-style: italic;
  font-weight: 400;
  color: var(--green-deep);
}

.hero__deck {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  margin: 18px 0 0;
  max-width: 56ch;
  line-height: 1.4;
}

.hero__winner-card {
  background: var(--ink);
  color: var(--cream);
  padding: 26px 28px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.hero__winner-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top right,
    rgba(63, 122, 77, 0.35),
    transparent 60%
  );
  pointer-events: none;
}
.hero__winner-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(244, 236, 220, 0.6);
  margin-bottom: 12px;
}
.hero__winner-name {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 14px;
}
.hero__winner-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(244, 236, 220, 0.15);
}
.hero__winner-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 236, 220, 0.5);
  margin-bottom: 4px;
}
.hero__winner-stat-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
}
.hero__winner-stat-value--green {
  color: #6fc183;
}
.hero__winner-stat-value--red {
  color: #d97265;
}

/* ============================================================
   SECTION HEADERS — newspaper style
   ============================================================ */
.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line-strong);
}
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}
.section__title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.025em;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.section__title-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.section__deck {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--muted);
  font-size: 15px;
  max-width: 40ch;
}

/* ============================================================
   PORTFOLIO STATS BAR — three large numbers
   ============================================================ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: 0;
  background: var(--paper);
}
@media (max-width: 720px) {
  .stats-bar {
    grid-template-columns: 1fr;
  }
}
.stat {
  padding: 28px 28px;
  border-right: 1px solid var(--line);
  position: relative;
}
.stat:last-child {
  border-right: none;
}
@media (max-width: 720px) {
  .stat {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .stat:last-child {
    border-bottom: none;
  }
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.stat__value {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1;
}
.stat__sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.stat__value--green {
  color: var(--green-deep);
}
.stat__value--red {
  color: var(--red-deep);
}

/* ============================================================
   BEER COUNTER — the joke that's also the point
   ============================================================ */
.beer-card {
  background: var(--ink);
  color: var(--cream);
  padding: 36px 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.beer-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 240px;
  height: 240px;
  background: radial-gradient(
    circle,
    rgba(182, 134, 44, 0.25),
    transparent 60%
  );
  pointer-events: none;
}
.beer-card__text {
  flex: 1;
  min-width: 280px;
  position: relative;
  z-index: 1;
}
.beer-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.beer-card__headline {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.beer-card__headline em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}
.beer-card__sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: rgba(244, 236, 220, 0.7);
  margin: 0;
  max-width: 50ch;
}
.beer-card__number {
  font-family: var(--font-display);
  font-size: clamp(80px, 14vw, 140px);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--gold);
  position: relative;
  z-index: 1;
}
.beer-card__number small {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 236, 220, 0.5);
  margin-top: 6px;
}

/* ============================================================
   LEADERBOARD TABLE — the bloomberg moment
   ============================================================ */
.leaderboard {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.leaderboard__head {
  display: grid;
  grid-template-columns:
    44px minmax(120px, 1.4fr) minmax(90px, 1fr) repeat(4, minmax(80px, 1fr))
    44px;
  gap: 12px;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  align-items: center;
}
.leaderboard__head > div:nth-child(n + 4) {
  text-align: right;
}
.leaderboard__row {
  display: grid;
  grid-template-columns:
    44px minmax(120px, 1.4fr) minmax(90px, 1fr) repeat(4, minmax(80px, 1fr))
    44px;
  gap: 12px;
  padding: 18px 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  transition: background 0.18s ease;
  position: relative;
}
.leaderboard__row:last-child {
  border-bottom: none;
}
.leaderboard__row:hover {
  background: var(--cream-soft);
}
.leaderboard__row--leader {
  background: linear-gradient(
    to right,
    rgba(63, 122, 77, 0.07),
    transparent 60%
  );
}
.leaderboard__row--leader::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--green);
}

.lb-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
}
.lb-rank--leader {
  color: var(--green-deep);
}
.lb-manager {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.lb-ticker {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: inline-block;
  padding: 4px 8px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.lb-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.lb-num--big {
  font-weight: 700;
  font-size: 15px;
}
.lb-num--green {
  color: var(--green-deep);
}
.lb-num--red {
  color: var(--red-deep);
}
.lb-spark {
  width: 100%;
  height: 28px;
}

@media (max-width: 900px) {
  .leaderboard__head {
    display: none;
  }
  .leaderboard__row {
    grid-template-columns: 44px 1fr auto;
    grid-template-areas:
      "rank manager change"
      "rank ticker  value"
      "rank price   gain"
      ".    spark   spark";
    row-gap: 4px;
    column-gap: 14px;
    padding: 16px;
  }
  .lb-rank {
    grid-area: rank;
    font-size: 18px;
    align-self: start;
    margin-top: 2px;
  }
  .lb-manager {
    grid-area: manager;
  }
  .lb-ticker {
    grid-area: ticker;
    justify-self: start;
    margin-top: 2px;
  }
  .lb-cell--price {
    grid-area: price;
    text-align: right;
  }
  .lb-cell--change {
    grid-area: change;
    text-align: right;
  }
  .lb-cell--value {
    grid-area: value;
    text-align: right;
  }
  .lb-cell--gain {
    grid-area: gain;
    text-align: right;
  }
  .lb-cell--spark {
    grid-area: spark;
    margin-top: 6px;
  }
  .lb-cell--hide-mobile {
    display: none;
  }
}

/* ============================================================
   CHART CARD
   ============================================================ */
.chart-card {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.chart-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 22px;
}
.chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.chart-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.chart-legend__swatch {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}
.chart-legend__name {
  font-weight: 600;
}
.chart-legend__value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart-controls {
  display: flex;
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.chart-controls button {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--line);
  transition: all 0.15s;
}
.chart-controls button:last-child {
  border-right: none;
}
.chart-controls button:hover {
  background: var(--cream-soft);
}
.chart-controls button.is-active {
  background: var(--ink);
  color: var(--cream);
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 380px;
}
.chart-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}
.chart-tooltip {
  position: absolute;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%) translateY(-8px);
  transition: opacity 0.12s;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.3);
}
.chart-tooltip.is-visible {
  opacity: 1;
}
.chart-tooltip__date {
  color: rgba(244, 236, 220, 0.6);
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.chart-tooltip__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

/* ============================================================
   ARCHIVE / HALL OF FAME
   ============================================================ */
.hall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.hall__year {
  border: 1px solid var(--line-strong);
  padding: 22px;
  background: var(--paper);
  border-radius: var(--radius);
  position: relative;
  transition: transform 0.18s ease;
}
.hall__year--filled {
  background: var(--ink);
  color: var(--cream);
}
.hall__year--filled:hover {
  transform: translateY(-2px);
}
.hall__year-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 6px;
}
.hall__year--filled .hall__year-num {
  color: rgba(244, 236, 220, 0.5);
}
.hall__year-winner {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}
.hall__year-winner--empty {
  color: var(--line-strong);
  font-style: italic;
  font-weight: 400;
}
.hall__year-detail {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 10px;
  color: rgba(244, 236, 220, 0.6);
  display: flex;
  justify-content: space-between;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--ink);
  color: var(--cream);
  padding: 56px 0 32px;
  margin-top: 0;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 700px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
.footer__col h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}
.footer__col p,
.footer__col li {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: rgba(244, 236, 220, 0.7);
  margin: 0 0 10px;
}
.footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer__rule {
  border-top: 1px solid rgba(244, 236, 220, 0.15);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(244, 236, 220, 0.4);
  letter-spacing: 0.1em;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================================
   UTILITIES & ANIMATIONS
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(26, 24, 20, 0.06) 0%,
    rgba(26, 24, 20, 0.12) 50%,
    rgba(26, 24, 20, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 3px;
  display: inline-block;
  height: 1em;
  width: 4em;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.12s; }
.reveal-3 { animation-delay: 0.2s; }
.reveal-4 { animation-delay: 0.3s; }
@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ticker tape running at top of leaderboard section */
.tape {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper);
  overflow: hidden;
  position: relative;
  height: 36px;
  margin-bottom: 22px;
}
.tape__track {
  position: absolute;
  white-space: nowrap;
  display: flex;
  align-items: center;
  height: 100%;
  animation: tape 60s linear infinite;
  font-family: var(--font-mono);
  font-size: 12px;
  gap: 28px;
  padding-left: 28px;
}
.tape__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tape__sym {
  font-weight: 700;
  letter-spacing: 0.04em;
}
.tape__price {
  color: var(--muted);
}
.tape__chg-pos {
  color: var(--green-deep);
  font-weight: 600;
}
.tape__chg-neg {
  color: var(--red-deep);
  font-weight: 600;
}
@keyframes tape {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
