/* ==========================================================================
   SITE.CSS — shared design system for the research publication platform
   Tokens + base styles are lifted directly from the original raisin dossier
   (raisin-exports) so every page — homepage, listings, and articles — shares
   one visual identity. Article-specific chart styling stays local to each
   article page; this file holds only what's reused across pages.
   ========================================================================== */

:root{
  --ink: #EDE3D3;
  --ink-dim: #B9AC97;
  --bg: #1B1416;
  --bg-raised: #241B1E;
  --line: #3A2E30;
  --gold: #C9962E;
  --gold-bright: #E3B04E;
  --wine: #7A2E2E;
  --teal: #3E7C7C;
  --teal-bright: #56A0A0;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
  background: var(--bg);
  color: var(--ink);
  font-family: 'Source Serif 4', serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap{ max-width: 980px; margin: 0 auto; padding: 0 28px; }

/* subtle grain / vignette, site-wide */
body::before{
  content:"";
  position: fixed; inset:0;
  background:
    radial-gradient(ellipse at top, rgba(201,150,46,0.06), transparent 55%),
    radial-gradient(ellipse at bottom, rgba(62,124,124,0.05), transparent 55%);
  pointer-events:none; z-index:0;
}

a{ color: inherit; }

/* --------------------------------------------------------------------------
   SITE NAV — appears on every page
   -------------------------------------------------------------------------- */
.site-nav{
  position: relative; z-index: 2;
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap{
  display:flex; align-items:center; justify-content:space-between;
  padding: 20px 28px;
  gap: 20px;
  flex-wrap: wrap;
}
.brand{
  font-family:'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration:none;
  color: var(--ink);
  display:flex; align-items:center; gap:9px;
}
.brand .dot{ width:6px; height:6px; border-radius:50%; background: var(--gold); flex-shrink:0; }
.brand em{ font-style: italic; font-weight:500; color: var(--gold-bright); }
.brand img{ height: 34px; width: auto; display:block; flex-shrink:0; }

.nav-links{
  display:flex; align-items:center; gap: 28px; list-style:none;
  font-family:'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-links a{
  text-decoration:none; color: var(--ink-dim);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover{ color: var(--ink); }
.nav-links a.active{ color: var(--gold-bright); border-bottom-color: var(--gold-bright); }

/* --------------------------------------------------------------------------
   HERO — used on homepage and on article pages
   -------------------------------------------------------------------------- */
header.hero{
  position:relative; z-index:1;
  padding: 84px 0 56px;
  border-bottom: 1px solid var(--line);
}
.eyebrow{
  font-family:'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-bright);
  display:flex; align-items:center; gap:10px;
  margin-bottom: 26px;
}
.eyebrow .dot{ width:6px; height:6px; border-radius:50%; background: var(--gold); }

h1{
  font-family:'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.03;
  letter-spacing: -0.01em;
  max-width: 17ch;
  margin-bottom: 22px;
}
h1 em{ font-style: italic; font-weight: 500; color: var(--gold-bright); }

.dek{
  font-size: 19px;
  color: var(--ink-dim);
  max-width: 56ch;
  margin-bottom: 40px;
}

.stat-row{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.stat{ background: var(--bg); padding: 20px 18px; }
.stat .num{
  font-family:'IBM Plex Mono', monospace;
  font-size: 26px;
  font-weight: 600;
  color: var(--gold-bright);
  display:block;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.stat .num.teal{ color: var(--teal-bright); }
.stat .label{
  font-family:'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* --------------------------------------------------------------------------
   SECTIONS — shared section header pattern
   -------------------------------------------------------------------------- */
section{ position:relative; z-index:1; padding: 64px 0; border-bottom: 1px solid var(--line); }
section:last-of-type{ border-bottom:none; }
.sec-head{ margin-bottom: 30px; }
.sec-num{
  font-family:'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.1em;
  display:block;
  margin-bottom: 10px;
}
h2{
  font-family:'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 34px);
  max-width: 26ch;
}
.sec-note{
  color: var(--ink-dim);
  font-size: 16px;
  max-width: 60ch;
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   CHART / DATA COMPONENTS — reused by article pages
   -------------------------------------------------------------------------- */
.chart-card{
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 28px 24px 18px;
}
.chart-card canvas{ max-height: 340px; }
.chart-legend-note{
  font-family:'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--ink-dim);
  margin-top: 14px;
  letter-spacing: 0.02em;
}
.two-col{ display:grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.year-toggle{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom: 18px; }
.year-btn{
  font-family:'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.year-btn:hover{ border-color: var(--gold); color: var(--ink); }
.year-btn.active{ background: var(--gold); border-color: var(--gold); color: #1B1416; font-weight:600; }

table{ width: 100%; border-collapse: collapse; font-family:'IBM Plex Mono', monospace; font-size: 13.5px; }
thead th{
  text-align: left; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-dim); padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight:500;
}
thead th:not(:first-child){ text-align: right; }
tbody td{ padding: 12px 12px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
tbody td:first-child{ text-align: left; font-family: 'Source Serif 4', serif; font-size: 15px; color: var(--ink); }
tbody tr:hover{ background: rgba(201,150,46,0.04); }
.rank{ display:inline-block; width: 20px; color: var(--gold); }

.callout{
  border-left: 2px solid var(--wine);
  padding: 4px 0 4px 22px;
  margin: 34px 0;
  font-family: 'Fraunces', serif;
  font-size: 21px;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  max-width: 52ch;
}

/* --------------------------------------------------------------------------
   BUTTONS / LINKS
   -------------------------------------------------------------------------- */
.btn{
  display:inline-flex; align-items:center; gap:9px;
  font-family:'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration:none;
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  padding: 12px 20px;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover{ background: var(--gold); color: #1B1416; }
.btn-arrow{ transition: transform 0.15s ease; }
.btn:hover .btn-arrow{ transform: translateX(3px); }

.text-link{
  font-family:'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--teal-bright);
  text-decoration:none;
  border-bottom: 1px dotted var(--teal-bright);
}
.text-link:hover{ color: var(--ink); border-bottom-color: var(--ink); }

/* --------------------------------------------------------------------------
   ARTICLE CARDS — used on homepage "Latest Research" and /research listing
   -------------------------------------------------------------------------- */
.article-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.article-card{
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 24px 22px;
  display:flex; flex-direction:column; gap: 14px;
  text-decoration:none; color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.article-card.is-live:hover{ border-color: var(--gold); transform: translateY(-2px); }
.article-card.is-pending{ opacity: 0.72; }
.card-top{ display:flex; align-items:center; justify-content:space-between; gap: 12px; }
.card-eyebrow{
  font-family:'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-bright);
}
.status-pill{
  font-family:'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid var(--line); color: var(--ink-dim);
  white-space: nowrap;
}
.status-pill.live{ color: var(--gold-bright); border-color: var(--gold); }
.article-card h3{
  font-family:'Fraunces', serif; font-weight: 600; font-size: 21px; line-height:1.2;
}
.article-card p{ color: var(--ink-dim); font-size: 14.5px; line-height:1.55; flex:1; }
.card-meta{
  font-family:'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-dim);
  letter-spacing: 0.02em; padding-top: 10px; border-top: 1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
}
.card-meta .go{ color: var(--gold-bright); }

/* --------------------------------------------------------------------------
   FEATURED PANEL — larger callout card for the homepage's Featured Research
   -------------------------------------------------------------------------- */
.featured-panel{
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 32px;
}
.featured-panel .card-top{ margin-bottom: 16px; }
.featured-panel h3{ font-family:'Fraunces', serif; font-weight: 600; font-size: clamp(22px, 3vw, 28px); margin-bottom: 12px; }
.featured-panel p{ color: var(--ink-dim); font-size: 16px; max-width: 62ch; margin-bottom: 22px; }
.featured-panel .stat-row{ margin-bottom: 24px; }

/* --------------------------------------------------------------------------
   PROSE — for About page and other plain-text sections
   -------------------------------------------------------------------------- */
.prose p{ color: var(--ink-dim); font-size: 17px; max-width: 62ch; margin-bottom: 18px; }
.prose p:last-child{ margin-bottom: 0; }
.prose strong{ color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------------------
   FOOTER — shared
   -------------------------------------------------------------------------- */
footer{ padding: 48px 0 80px; position:relative; z-index:1; }
footer p{ font-family:'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-dim); letter-spacing: 0.02em; }
footer a{ color: var(--teal-bright); text-decoration: none; border-bottom: 1px dotted var(--teal-bright); }
footer .footer-links{ display:flex; gap:18px; margin-bottom: 14px; flex-wrap:wrap; }

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 720px){
  .stat-row{ grid-template-columns: repeat(2, 1fr); }
  .two-col{ grid-template-columns: 1fr; }
  header.hero{ padding: 56px 0 40px; }
  section{ padding: 44px 0; }
  .site-nav .wrap{ padding: 16px 20px; }
  .nav-links{ gap: 16px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  .year-btn, .article-card, .btn{ transition:none; }
}
