/* =========================================================
   Progressive Cramming — project page
   Palette and type derived from the ICML poster.
   ========================================================= */
:root {
  --accent:         #1B4F72;
  --accent-deep:    #0E2F44;
  --accent-mid:     #2E86C1;
  --accent-light:   #EBF5FB;
  --gold:           #D4AC0D;
  --gold-light:     #FFF8DC;
  --red:            #C0392B;
  --green:          #1E8449;

  --text:           #1A1A1A;
  --text-2:         #555;
  --text-3:         #888;

  --bg:             #F4F6F7;
  --card:           #FFFFFF;
  --card-tint:      #F0F8FF;
  --border:         #D6DBDF;
  --border-strong:  #1B4F72;

  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: "Charter", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

  --maxw: 1000px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at top left, rgba(27,79,114,0.05), transparent 40%),
    radial-gradient(ellipse at bottom right, rgba(212,172,13,0.04), transparent 50%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* top accent bar */
.topbar {
  height: 6px;
  background: linear-gradient(90deg, var(--accent-deep) 0%, var(--accent) 40%, var(--accent-mid) 70%, var(--gold) 100%);
}

/* sticky nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.nav .brand { font-family: var(--sans); font-weight: 800; color: var(--accent-deep); font-size: 15px; letter-spacing: -0.2px; }
.nav .brand .dot { color: var(--gold); }
.nav .links { display: flex; gap: 18px; font-family: var(--sans); font-size: 13.5px; font-weight: 600; }
.nav .links a { color: var(--accent-deep); }
@media (max-width: 720px) { .nav .links { display: none; } }

/* ---- HERO ---- */
.hero { text-align: center; padding: 54px 0 30px; }
.kicker {
  font-family: var(--sans); font-weight: 800; letter-spacing: 2px;
  color: var(--accent); font-size: 13px; text-transform: uppercase;
}
.hero h1 {
  font-family: var(--sans); font-weight: 800; color: var(--accent-deep);
  font-size: clamp(30px, 5.4vw, 52px); line-height: 1.06; letter-spacing: -1px;
  margin: 12px 0 6px;
}
.hero h1 .accent { color: var(--gold); }
.hero .tagline {
  font-family: var(--serif); font-style: italic; color: var(--text-2);
  font-size: clamp(16px, 2.4vw, 20px); max-width: 760px; margin: 6px auto 0; text-wrap: balance;
}
.authors { font-family: var(--sans); font-size: 15px; color: var(--accent); font-weight: 600; margin-top: 18px; }
.authors sup { font-size: 0.7em; }
.affils { font-family: var(--sans); font-size: 13px; color: var(--text-2); margin-top: 4px; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.btn {
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 8px; border: 1.5px solid var(--accent);
  color: #fff; background: var(--accent); display: inline-flex; align-items: center; gap: 8px;
  transition: transform .08s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(27,79,114,0.25); }
.btn.ghost { background: #fff; color: var(--accent); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--accent-deep); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

/* headline stats strip */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 34px 0 8px;
}
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--card); border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: 8px; padding: 14px 10px; text-align: center;
  box-shadow: 0 2px 6px rgba(27,79,114,0.05);
}
.stat .num { font-family: var(--sans); font-weight: 800; color: var(--accent); font-size: 30px; line-height: 1; }
.stat .num .u { font-size: 16px; color: var(--text-2); font-weight: 700; }
.stat .lab { font-family: var(--sans); font-size: 12px; color: var(--text-2); margin-top: 7px; line-height: 1.25; }

/* ---- SECTIONS ---- */
section { padding: 30px 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.section-head .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff;
  font-family: var(--sans); font-weight: 800; font-size: 15px; flex: 0 0 auto;
}
h2 { font-family: var(--sans); font-weight: 800; color: var(--accent-deep); font-size: 26px; letter-spacing: -0.4px; }
.lead { font-size: 17px; color: var(--text); margin: 8px 0 16px; max-width: 820px; }
.muted { color: var(--text-2); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px 24px; box-shadow: 0 3px 12px rgba(27,79,114,0.06);
}
.card + .card { margin-top: 16px; }
.card.tint { background: var(--card-tint); }
.card.alert { border-left: 5px solid var(--red); }
.card.highlight { border-left: 5px solid var(--accent); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* method mini-cards */
.method { background: var(--card); border:1px solid var(--border); border-radius:10px; padding:16px 18px; }
.method h3 { font-family: var(--sans); font-size: 16px; color: var(--accent-deep); margin-bottom: 6px; }
.method .flag { font-family: var(--mono); font-size: 12px; color: var(--accent-mid); background: var(--accent-light); padding: 1px 7px; border-radius: 5px; }
.method p { font-size: 14.5px; color: var(--text-2); margin-top: 6px; }

/* tables: benchmarks in columns, methods/models in rows */
.tbl-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14.5px; }
table.data th, table.data td { padding: 9px 12px; text-align: center; border-bottom: 1px solid var(--border); }
table.data thead th { background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
table.data thead th.grp { background: var(--accent-deep); }
table.data tbody th, table.data td.row { text-align: left; font-weight: 700; color: var(--accent-deep); white-space: nowrap; }
table.data tbody tr:nth-child(even) { background: #FAFCFE; }
table.data tr.ours { background: var(--gold-light) !important; }
table.data .best { color: var(--accent); font-weight: 800; }
table.data .drop { color: var(--red); font-weight: 700; }
table.data .up { color: var(--green); font-weight: 700; }
.cap { font-family: var(--sans); font-size: 12.5px; color: var(--text-2); margin-top: 10px; line-height: 1.4; }

/* figure / video */
figure { margin: 0; }
.media { background: var(--card); border:1px solid var(--border); border-radius:12px; padding: 12px; box-shadow: 0 3px 12px rgba(27,79,114,0.06); }
.media video, .media img { width: 100%; display: block; border-radius: 8px; }
figcaption { font-family: var(--sans); font-size: 12.5px; color: var(--text-2); margin-top: 10px; line-height: 1.45; }

.pill { display:inline-block; font-family: var(--sans); font-weight:700; font-size:12px; padding:2px 9px; border-radius: 99px; }
.pill.red { background:#FDEDEC; color: var(--red); }
.pill.gold { background: var(--gold-light); color: #8A6D0B; }
.pill.blue { background: var(--accent-light); color: var(--accent); }

/* ---- EXPLORER ---- */
#explorer .panel { background: var(--card); border:1px solid var(--border); border-radius:12px; box-shadow: 0 3px 12px rgba(27,79,114,0.06); }
.exp-controls { display:flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.field { display:flex; flex-direction: column; gap: 5px; }
.field label { font-family: var(--sans); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); }
.field select {
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--accent-deep);
  padding: 7px 10px; border:1.5px solid var(--border); border-radius: 8px; background:#fff; cursor: pointer; min-width: 150px;
}
.field select:focus { outline: none; border-color: var(--accent-mid); }

.exp-readout { display:flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px 4px; }
.ro { background: var(--accent-light); border-radius: 8px; padding: 8px 14px; min-width: 120px; }
.ro .v { font-family: var(--sans); font-weight: 800; color: var(--accent); font-size: 20px; line-height: 1; }
.ro .v small { font-size: 12px; color: var(--text-2); font-weight: 700; }
.ro .k { font-family: var(--sans); font-size: 11px; color: var(--text-2); margin-top: 4px; }
.ro.gold { background: var(--gold-light); } .ro.gold .v { color: #8A6D0B; }
.ro.red { background:#FDEDEC; } .ro.red .v { color: var(--red); }

.slider-row { padding: 6px 18px 16px; }
.slider-row .lbl { font-family: var(--sans); font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; display:flex; justify-content: space-between; }
.slider-row input[type=range] { width: 100%; accent-color: var(--accent); }

#stepStrip { width: 100%; height: 70px; display:block; border-radius: 8px; background: #fff; border:1px solid var(--border); }
.strip-legend { font-family: var(--sans); font-size: 11.5px; color: var(--text-2); display:flex; gap:16px; align-items:center; margin: 8px 18px 0; flex-wrap: wrap; }
.strip-legend .sw { display:inline-block; width:11px; height:11px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; }

.tokens {
  font-family: var(--serif); font-size: 16px; line-height: 1.9;
  padding: 16px 18px 20px; max-height: 360px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}
.tok { border-radius: 3px; padding: 1px 0; transition: background .08s; cursor: default; }
.tok.crammed { background: rgba(30,132,73,0.14); box-shadow: inset 0 -2px 0 rgba(30,132,73,0.35); }
.tok.frontier { background: rgba(212,172,13,0.55); box-shadow: inset 0 -2px 0 var(--gold); }
.tok.pending  { color: #9AA4AB; }
.tok.wall { background: rgba(192,57,43,0.18); box-shadow: inset 0 -2px 0 var(--red); color: var(--red); }
.tok.hot { outline: 2px solid var(--accent-mid); }

.tooltip {
  position: fixed; z-index: 100; pointer-events: none; opacity: 0;
  background: var(--accent-deep); color: #fff; font-family: var(--sans); font-size: 12.5px;
  padding: 8px 11px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.3); transition: opacity .1s; max-width: 260px;
}
.tooltip .tt-tok { font-family: var(--mono); background: rgba(255,255,255,.14); padding: 1px 5px; border-radius: 4px; }
.tooltip .tt-row { margin-top: 5px; display:flex; justify-content: space-between; gap: 14px; }
.tooltip .tt-row b { color: var(--gold); }

.note { font-family: var(--sans); font-size: 13px; color: var(--text-2); background: var(--accent-light); border-radius: 8px; padding: 10px 14px; margin-top: 12px; }
.err { color: var(--red); }

/* code / citation */
pre.code {
  font-family: var(--mono); font-size: 13px; line-height: 1.5; color: #EAF2F8;
  background: var(--accent-deep); border-radius: 10px; padding: 16px 18px; overflow-x: auto;
}
pre.code .cmt { color: #8FB3C7; }
.copybar { display:flex; justify-content: space-between; align-items:center; margin-bottom: 8px; }
.copybtn { font-family: var(--sans); font-size: 12px; font-weight:700; cursor:pointer; border:1.5px solid var(--border); background:#fff; color: var(--accent); padding:5px 12px; border-radius: 7px; }
.copybtn:hover { border-color: var(--accent-mid); }

/* footer */
footer { border-top: 1px solid var(--border); margin-top: 24px; padding: 26px 0 50px; }
footer .wrap { display:flex; justify-content: space-between; align-items:center; flex-wrap: wrap; gap: 10px; font-family: var(--sans); font-size: 13px; color: var(--text-3); }
footer .repo { color: var(--accent); font-weight: 700; }

mjx-container { overflow-x: auto; overflow-y: hidden; }
