/* =========================================================
   Info-Gain Sampler — Project Page
   Aesthetic: warm cream + ink + burnt amber + deep teal.
   Type stack: Fraunces (display) / Inter (body) / JetBrains Mono.
   ========================================================= */

:root {
  /* Palette */
  --bg:        #faf6ef;          /* warm cream */
  --bg-tint:   #f1ebde;          /* card / tinted band */
  --bg-dark:   #15171c;          /* dark band */
  --ink:       #15151a;
  --ink-soft:  #2a2a31;
  --muted:     #6b6961;
  --hairline:  #ddd5c2;
  --hairline-strong: #c9bfa6;

  --amber:     #c2410c;          /* primary accent — burnt amber */
  --amber-soft:#f5d6b5;
  --teal:      #0f5d6e;          /* secondary accent — deep teal */
  --teal-soft: #cfe5ea;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 0 rgba(20,15,5,0.04), 0 1px 3px rgba(20,15,5,0.05);
  --shadow-md: 0 6px 28px -10px rgba(20,15,5,0.18);

  --maxw: 1180px;

  --font-display: "Fraunces", "New York", "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

em { font-style: italic; font-family: var(--font-display); font-variation-settings: "opsz" 14, "SOFT" 0, "WONK" 1; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.container {
  width: min(var(--maxw), 92vw);
  margin: 0 auto;
}

.container.narrow {
  max-width: 820px;
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 9vw, 110px) 0 clamp(36px, 5vw, 60px);
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, #fff8eb 0%, transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--hairline);
}

.hero-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  color: rgba(194, 65, 12, 0.08);
}

.hero-grid {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.6;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 80%);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}
.hero-glow.g1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #f5b078 0%, transparent 70%);
  top: -160px; left: -100px;
  animation: float 18s ease-in-out infinite;
}
.hero-glow.g2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #8fc4cf 0%, transparent 70%);
  bottom: -180px; right: -120px;
  animation: float 22s ease-in-out -6s infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(30px, -20px) scale(1.08); }
}

.hero-inner {
  position: relative; z-index: 1;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 28px;
  text-transform: uppercase;
  font-weight: 500;
}

.news-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7ed 0%, #fde8cc 100%);
  border: 1.5px solid var(--amber-soft);
  color: var(--amber);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px -4px rgba(194,65,12,0.18);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #faf6ef;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.badge-icml {
  background: var(--amber);
}

.dot { color: var(--hairline-strong); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" 96, "SOFT" 30, "WONK" 0;
  font-size: clamp(2.2rem, 5.6vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 0 0 28px;
  color: var(--ink);
}

.title-mark {
  position: relative;
  display: inline-block;
  background: linear-gradient(180deg, transparent 62%, var(--amber-soft) 62%, var(--amber-soft) 92%, transparent 92%);
  background-repeat: no-repeat;
  padding: 0 4px;
}

.hero-title em {
  color: var(--amber);
  font-style: italic;
  font-variation-settings: "opsz" 96, "SOFT" 50, "WONK" 1;
}

.authors {
  font-size: 1.05rem;
  margin: 0 0 6px;
  color: var(--ink);
  font-weight: 500;
}
.authors a { color: var(--ink); border-bottom: 1px solid transparent; }
.authors a:hover { color: var(--amber); text-decoration: none; border-bottom-color: var(--amber); }
.authors sup { color: var(--muted); font-weight: 400; }

.affiliations {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 28px;
}

.links {
  display: inline-flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.btn-primary {
  background: var(--ink);
  color: #faf6ef;
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--amber); border-color: var(--amber); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  color: inherit;
  border: 1px solid currentColor;
  border-color: rgba(255,255,255,0.18);
}
.btn:not(.btn-primary) .btn-icon {
  background: var(--bg-tint);
  border-color: var(--hairline);
  color: var(--ink-soft);
}

/* TL;DR */
.hero-tldr {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 22px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  text-align: left;
  font-size: 0.97rem;
  color: var(--ink-soft);
}
.tldr-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-right: 10px;
  text-transform: uppercase;
  vertical-align: middle;
}
.tldr-body em { color: var(--ink); }

/* Marquee */
.marquee {
  margin-top: clamp(40px, 5vw, 64px);
  overflow: hidden;
  border-top: 1px dashed var(--hairline-strong);
  border-bottom: 1px dashed var(--hairline-strong);
  padding: 14px 0;
  background: rgba(255,255,255,0.4);
}
.marquee-track {
  display: inline-flex; gap: 24px; white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  animation: marquee 38s linear infinite;
}
.marquee-track span:nth-child(2n) { color: var(--amber); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =========================================================
   STICKY NAV
   ========================================================= */

.toc {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 239, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.toc-inner {
  display: flex; gap: 26px; flex-wrap: wrap;
  padding: 14px 0;
  font-size: 14px;
}
.toc a {
  color: var(--muted);
  font-weight: 500;
  position: relative;
}
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.active {
  color: var(--ink);
}
.toc a.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -16px;
  height: 2px; background: var(--amber);
}

/* =========================================================
   SECTIONS
   ========================================================= */

.section {
  padding: clamp(64px, 9vw, 110px) 0;
  border-bottom: 1px solid var(--hairline);
}
.section-tinted { background: var(--bg-tint); }
.section-dark {
  background: var(--bg-dark);
  color: #ebe6da;
  border-color: #2a2a31;
}
.section-dark .section-title { color: #fff; }
.section-dark .section-sub { color: #b9b3a3; }
.section-dark a { color: #f5b078; }

.section-head {
  display: flex; align-items: baseline; gap: 18px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  letter-spacing: 0.14em;
  font-weight: 600;
}
.section-num.light { color: #f5b078; }
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" 60, "SOFT" 30;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.section-sub {
  flex-basis: 100%;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.prose {
  font-size: 1.07rem;
  color: var(--ink-soft);
  margin: 0 0 1.1em;
}
.prose strong { color: var(--ink); }

/* =========================================================
   KEY FINDINGS
   ========================================================= */

.findings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 980px) {
  .findings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .findings-grid { grid-template-columns: 1fr; }
}

.finding {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.finding:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.finding::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  opacity: 0.85;
}

.finding-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.finding-stat {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "SOFT" 0, "WONK" 0;
  font-weight: 400;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1;
  color: var(--amber);
  letter-spacing: -0.025em;
}
.finding-stat .unit {
  font-size: 0.55em;
  color: var(--muted);
  margin-left: 4px;
  font-variation-settings: "opsz" 14;
}

.finding-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.18rem;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}

.finding-body {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}
.finding-body code {
  background: var(--bg-tint);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

.finding-quote {
  background: var(--ink);
  color: #ebe6da;
  border: none;
}
.finding-quote::before { background: var(--amber); }
.finding-quote .finding-eyebrow { color: var(--amber-soft); }
.finding-quote blockquote {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.18rem;
  line-height: 1.4;
  margin: 0;
  font-style: italic;
  color: #f3eee0;
  font-variation-settings: "opsz" 36, "SOFT" 50, "WONK" 1;
}
.finding-quote blockquote em { color: #f5b078; font-style: italic; }
.finding-quote blockquote strong { color: #fff; font-style: normal; font-weight: 500; }

/* =========================================================
   METHOD
   ========================================================= */

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

.method-figure figure {
  margin: 0;
  background: #fff;
  padding: 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.method-figure img {
  width: 100%; display: block;
  border-radius: 10px;
}
.method-figure figcaption {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}
.method-figure figcaption strong { color: var(--ink); }

.method-text h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.32rem;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.method-text h3 + p { margin-top: 0; }
.method-text p {
  margin: 0 0 24px;
  color: var(--ink-soft);
}
.method-text code {
  background: var(--bg-tint);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--teal);
}

.check-list {
  list-style: none; padding: 0; margin: 0;
}
.check-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.97rem;
}
.check-list li::before {
  content: '→';
  position: absolute; left: 0; top: 0;
  color: var(--amber);
  font-weight: 700;
  font-family: var(--font-mono);
}

/* =========================================================
   RESULTS TABLES
   ========================================================= */

.table-block {
  background: #1c1f26;
  border: 1px solid #2c2f37;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
}
.table-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.table-cap {
  margin: 0 0 18px;
  color: #b9b3a3;
  font-size: 0.9rem;
}

.table-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 980px) { .table-grid { grid-template-columns: 1fr; } }

.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid #2c2f37;
  white-space: nowrap;
}
.data-table th:first-child,
.data-table td:first-child { text-align: left; }
.data-table th:nth-child(2),
.data-table td:nth-child(2) { text-align: left; }
.data-table thead th {
  font-weight: 600;
  color: #f5b078;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid #4a3b28;
}
.data-table tbody tr { color: #d6d2c5; transition: background 0.15s ease; }
.data-table tbody tr:hover { background: rgba(245,176,120,0.04); }
.data-table .row-best {
  background: rgba(194,65,12,0.13);
  color: #fff;
}
.data-table .row-best td { border-bottom-color: rgba(245,176,120,0.4); }
.data-table.compact th, .data-table.compact td { padding: 8px 10px; font-size: 0.88rem; }

/* =========================================================
   ANALYSIS FIGURES
   ========================================================= */

.figures-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
@media (max-width: 800px) { .figures-grid { grid-template-columns: 1fr; } }

.figure-card {
  margin: 0;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.figure-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.figure-card img {
  width: 100%; display: block;
  border-radius: 10px;
  background: var(--bg-tint);
}
.figure-card figcaption {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}
.figure-card figcaption strong { color: var(--ink); }
.figure-card.wide { grid-column: 1 / -1; }
.figure-card.wide img { max-height: 460px; object-fit: contain; }

/* =========================================================
   BIBTEX
   ========================================================= */

.bibtex-block {
  position: relative;
  background: #15171c;
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  border: 1px solid #2c2f37;
}
.bibtex-block pre {
  margin: 0;
  color: #ebe6da;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-x: auto;
}
.bibtex-block code { color: inherit; }

.copy-btn {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(245,176,120,0.12);
  color: #f5b078;
  border: 1px solid rgba(245,176,120,0.3);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.copy-btn:hover { background: var(--amber); color: #fff; border-color: var(--amber); }

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
  background: var(--bg-tint);
  padding: 36px 0;
  border-top: 1px solid var(--hairline);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
}
.footer-meta { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }
.footer-right { display: flex; gap: 22px; }
.footer-right a { color: var(--ink-soft); font-weight: 500; font-size: 0.92rem; }
.footer-right a:hover { color: var(--amber); }

/* =========================================================
   REVEAL ANIMATIONS
   ========================================================= */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.findings-grid .finding.reveal { transition-delay: var(--d, 0ms); }
.findings-grid .finding:nth-child(1) { --d: 0ms; }
.findings-grid .finding:nth-child(2) { --d: 80ms; }
.findings-grid .finding:nth-child(3) { --d: 160ms; }
.findings-grid .finding:nth-child(4) { --d: 0ms; }
.findings-grid .finding:nth-child(5) { --d: 80ms; }
.findings-grid .finding:nth-child(6) { --d: 160ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  .hero-glow { animation: none; }
}

/* =========================================================
   MOBILE TWEAKS
   ========================================================= */

@media (max-width: 640px) {
  .hero-eyebrow { flex-wrap: wrap; gap: 6px; }
  .hero-title { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .links { gap: 8px; }
  .btn { padding: 9px 14px; font-size: 13px; }
  .toc-inner { gap: 16px; font-size: 13px; }
  .section { padding: 56px 0; }
  .table-block { padding: 18px; }
}
