/* ============================================================
   THE REAL BASEBALL HALL OF FAME — design tokens
   Palette: dugout green / scorecard cream / plaque brass / brick-wall red
   ============================================================ */
:root {
  --ink:        #1b1a17;
  --bg:         #10241c;
  --bg-deep:    #0b1a15;
  --paper:      #efe6d0;
  --paper-dim:  #e4d9bd;
  --brass:      #b8873b;
  --brass-lt:   #d8a85c;
  --brass-dk:   #8c6423;
  --flag:       #9b3a2e;
  --flag-lt:    #c65240;
  --green-line: #3f5b4c;
  --ok:         #4b7a5c;

  --font-display: 'Oswald', sans-serif;
  --font-body:    'Source Serif 4', serif;
  --font-mono:    'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(184,135,59,0.06), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(184,135,59,0.05), transparent 40%);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.5;
}

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

a { color: var(--brass-lt); }

:focus-visible {
  outline: 2px solid var(--brass-lt);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------- Header ---------------- */
.site-head {
  border-bottom: 1px solid var(--green-line);
  padding: 28px 0 24px;
}
.site-head__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.mark,
.mark:hover,
.mark:focus,
.mark:visited { text-decoration: none; }

/* ---------------- Menu bar ---------------- */
.site-menu {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--green-line);
}
.site-menu__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  padding-top: 13px;
  padding-bottom: 13px;
}
.site-menu__link {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 3px 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.site-menu__link:hover,
.site-menu__link:focus-visible,
.site-menu__link.is-active {
  color: var(--brass-lt);
  border-color: var(--brass-lt);
}
.site-menu__link--right {
  margin-left: auto;
}
.site-menu__soon {
  font-size: 9px;
  color: var(--brass);
  opacity: 0.75;
  letter-spacing: 0.06em;
  margin-left: 2px;
}
.mark__stitch {
  font-size: clamp(32px, 5.5vw, 46px);
  filter: sepia(1) saturate(2) hue-rotate(-10deg) brightness(0.9);
}
.mark__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 5vw, 40px);
  letter-spacing: 0.14em;
  line-height: 1.1;
  white-space: nowrap;
  text-align: center;
  color: var(--brass-lt);
}
/* "REAL" set brighter than the surrounding brass so it stands out */
.mark__real { color: var(--paper); }
.site-head__tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper-dim);
  text-align: center;
  white-space: nowrap;
  margin: 0;
  opacity: 0.75;
  line-height: 1.6;
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 36px 0 56px;
  border-bottom: 1px solid var(--green-line);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11,26,21,0.35) 0%, rgba(11,26,21,0.72) 55%, var(--bg) 96%),
    linear-gradient(90deg, rgba(11,26,21,0.75) 0%, rgba(11,26,21,0.15) 55%);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 18px;
}
.hero__headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(15px, 4.75vw, 53px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  max-width: none;
  white-space: nowrap;
  color: #000;
}
/* same accent as the SAA table's "Stat Above Average" (--saa-accent) */
.hero__headline-em { color: #a8660a; }

/* dotted eyebrow, matching the SAA table's .eyebrow */
.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a8660a;
}
.hero__eyebrow::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a8660a;
}

/* Welcome panel — the same light "ledger" box as the embedded SAA table:
   pale ground, brass-dark rule, cream-dark ink (mirrors .saa-embed). */
.hero__copy {
  background: #ffffff;
  color: #16211d;
  border: 1px solid var(--brass-dk);
  border-radius: 4px;
  padding: 2rem 2.25rem 1.75rem;
  font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  max-width: none;
}
.hero__copy p {
  max-width: none;
  margin: 0 0 1.1rem;
}
.hero__copy p:last-child { margin-bottom: 0; }
.hero__copy strong { color: #a8660a; font-weight: 600; }

/* ---------------- Controls ---------------- */
.ledger-controls {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--green-line);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.ledger-controls__row {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
}
.field select {
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--brass-dk);
  border-radius: 2px;
  padding: 8px 10px;
  min-width: 220px;
}

/* ---------------- Plaque grid ---------------- */
.plaque-grid {
  padding: 48px 24px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.plaque {
  background: var(--paper);
  color: var(--ink);
  border-radius: 3px;
  position: relative;
  padding: 22px 22px 20px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
  border-top: 5px solid var(--brass);
}
.plaque[data-role="pitcher"] { border-top-color: var(--ok); }

.plaque__flag {
  position: absolute;
  top: -12px;
  right: 18px;
  background: var(--brass-dk);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 2px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
}
.plaque[data-role="pitcher"] .plaque__flag {
  background: var(--ok);
}

.plaque__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  margin: 6px 0 2px;
}
.plaque__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #5a5346;
  margin: 0 0 14px;
}

.plaque__jaws {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.plaque__jaws-num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 34px;
  line-height: 1;
}
.plaque__jaws-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a5346;
}

.plaque__bar-track {
  height: 8px;
  background: #d9cba6;
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0 4px;
}
.plaque__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brass-dk), var(--brass-lt));
}
.plaque__bar-fill.above { background: linear-gradient(90deg, #33513d, var(--ok)); }
.plaque__bar-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #5a5346;
  margin: 0 0 14px;
}

.plaque__statline {
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  border-top: 1px dashed #c6b78e;
  border-bottom: 1px dashed #c6b78e;
  padding: 10px 0;
  margin-bottom: 12px;
}
.plaque__statline span { display: block; }
.plaque__statline b { display: block; font-size: 15px; }

.plaque__note {
  font-size: 13.5px;
  color: #3a362c;
  margin: 0 0 8px;
  line-height: 1.5;
}
.plaque__ballot {
  font-size: 12.5px;
  color: #6b6350;
  font-style: italic;
  margin: 0;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  font-family: var(--font-mono);
  color: var(--paper-dim);
  border: 1px dashed var(--green-line);
  border-radius: 4px;
}

/* ---------------- Pitchers placeholder view ---------------- */
.view-soon {
  min-height: 50vh;
  display: flex;
  align-items: center;
  padding: 56px 0;
}
.view-soon[hidden] { display: none; }
.view-soon__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 18px;
}
.view-soon__headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.1;
  margin: 0 0 20px;
  max-width: 16ch;
  color: var(--paper);
}
.view-soon__body {
  font-size: 16px;
  max-width: 58ch;
  color: var(--paper-dim);
  margin: 0;
}

/* ---------------- Standards section ---------------- */
.standards { padding: 56px 0; border-top: 1px solid var(--green-line); }
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 8px;
  color: var(--paper);
}
.section-lede { color: var(--paper-dim); max-width: none; margin: 0 0 28px; }

.standards__table {
  display: grid;
  gap: 12px;
}
.formula-box {
  background: rgba(239,230,208,0.06);
  border: 1px solid var(--green-line);
  border-radius: 4px;
  padding: 22px 24px;
}
.formula-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 14px;
}
.formula-term {
  background: rgba(184,135,59,0.14);
  color: var(--brass-lt);
  padding: 5px 10px;
  border-radius: 3px;
  border: 1px solid rgba(184,135,59,0.4);
}
.formula-eq, .formula-plus {
  color: var(--paper-dim);
  opacity: 0.7;
}
.formula-desc {
  color: var(--paper-dim);
  font-size: 15px;
  max-width: none;
  margin: 0;
}
.formula-desc--lede {
  margin-bottom: 14px;
}
.formula-divider {
  border: 0;
  border-top: 1px solid var(--green-line);
  margin: 22px 0;
}
.formula-row--last {
  margin-bottom: 0;
}
.standards__row {
  display: grid;
  grid-template-columns: 140px 1fr 90px 90px 90px;
  gap: 16px;
  align-items: center;
  background: rgba(239,230,208,0.06);
  border: 1px solid var(--green-line);
  border-radius: 3px;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.standards__row .label { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.02em; }
.standards__row .col-h {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass);
  display: block;
  margin-bottom: 2px;
}

/* ---------------- Dossier ---------------- */
.dossier {
  padding: 56px 0 72px;
  border-top: 1px solid var(--green-line);
  background: var(--bg-deep);
}
/* same bounds as .standards > .wrap, so the copy lines up edge-for-edge
   with the "How Stat Above Average works" formula box below it */
.dossier__inner { text-align: left; }
.dossier p { color: var(--paper-dim); font-size: 17px; max-width: none; }
.dossier__punch {
  color: var(--flag-lt) !important;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  border-left: 3px solid var(--flag);
  padding-left: 16px;
}

/* ---------------- Methodology page ---------------- */
.standards__note {
  color: var(--paper-dim);
  font-size: 15px;
  line-height: 1.6;
  max-width: none;
  margin: 22px 0 0;
}
.glossary {
  padding: 56px 0 64px;
  border-top: 1px solid var(--green-line);
}
.glossary h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--brass-lt);
  margin: 40px 0 6px;
}
.glossary h3:first-of-type { margin-top: 8px; }
.glossary dl { margin: 0; }
.glossary dt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--paper);
  margin-top: 18px;
}
.glossary dl > dt:first-of-type { margin-top: 8px; }
.glossary dd {
  margin: 4px 0 0;
  color: var(--paper-dim);
  font-size: 16px;
  line-height: 1.55;
  max-width: none;
}

/* ---------------- Footer ---------------- */
.site-foot { padding: 28px 0 40px; }
.site-foot__inner p {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper-dim);
  opacity: 0.7;
  max-width: 70ch;
}
.site-foot code {
  background: rgba(239,230,208,0.08);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ---------------- About dialog ---------------- */
.about-modal {
  border: 1px solid var(--brass-dk);
  border-radius: 4px;
  background: var(--bg-deep);
  color: var(--paper);
  padding: 0;
  max-width: 340px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.about-modal::backdrop {
  background: rgba(7,16,13,0.66);
}
.about-modal__inner {
  position: relative;
  /* tight top padding so the "THE TRUE HALL OF FAME" eyebrow lines up
     with the close button in the corner */
  padding: 12px 30px 26px;
}
.about-modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--paper-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.about-modal__close:hover { color: var(--brass-lt); }
.about-modal__eyebrow {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 10px;
}
.about-modal__title {
  font-family: var(--font-display);
  font-weight: 700;
  /* same size as the "THE TRUE HALL OF FAME" eyebrow line above it,
     just bold so "About" still reads as the heading */
  font-size: 15px;
  color: var(--brass-lt);
  /* blank row above "About"; "About" and the version/date lines centered */
  margin: 1.6em 0 14px;
  text-align: center;
}
.about-modal__line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--paper-dim);
  margin: 0 0 4px;
  text-align: center;
}
.about-modal__line span { color: var(--paper); }

/* ---------------- Responsive ---------------- */
@media (max-width: 640px) {
  .site-head__tag { white-space: normal; }
  .mark__text { white-space: normal; }
  .hero__copy { padding: 1.5rem 1.25rem; }
  .standards__row {
    grid-template-columns: 1fr 1fr;
    row-gap: 8px;
  }
  .standards__row .label { grid-column: 1 / -1; }
}
