/* Gradbook: varsity-yearbook design system. Ink navy, chalk paper, varsity gold. */
:root {
  --ink: #0e1322; --ink-2: #141a2d; --card: #182039; --card-2: #1e2744; --line: #2a3456; --line-2: #36416a;
  --chalk: #f3eee3; --muted: #9aa3bf; --dim: #6c7596;
  --gold: #f2c14e; --gold-2: #ffd978; --gold-ink: #2a1f05;
  --st-top: #4fe0b0; --st-stand: #8fd694; --st-slip: #f2a14c; --st-drop: #e8644f; --st-paper: #b9a1ff; --st-off: #7c86a8; --st-pend: #59c3f0;
  --speed: #59c3f0;
  --r: 14px; --r-sm: 9px;
  --serif: 'Fraunces', Georgia, serif; --sans: 'DM Sans', system-ui, sans-serif; --mono: 'DM Mono', ui-monospace, monospace;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 30px -18px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--chalk); font: 15px/1.5 var(--sans); min-height: 100vh;
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(242,193,78,.08), transparent 60%), radial-gradient(900px 400px at -10% 10%, rgba(89,195,240,.05), transparent 60%); }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--gold-ink); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .dim { color: var(--dim); }

/* ---- header ---- */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(14,19,34,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--chalk); font: 800 22px/1 var(--serif); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { display: block; }
nav { display: flex; gap: 4px; }
nav a { color: var(--muted); padding: 8px 12px; border-radius: 999px; font-weight: 500; }
nav a:hover { color: var(--chalk); text-decoration: none; background: var(--ink-2); }
nav a.on { color: var(--gold-ink); background: var(--gold); }
.count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 999px; background: var(--card-2); color: var(--chalk); font: 500 11px/18px var(--mono); text-align: center; }
nav a.on .count { background: rgba(0,0,0,.18); color: var(--gold-ink); }
.lookup { margin-left: auto; display: flex; background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lookup input { background: none; border: 0; padding: 8px 14px; width: 230px; outline: none; font-size: 14px; }
.lookup button { background: none; border: 0; padding: 0 14px; color: var(--gold); cursor: pointer; font-weight: 700; }
.lookup:focus-within { border-color: var(--gold); }

/* ---- page scaffolding ---- */
main { padding: 28px 0 56px; min-height: 70vh; outline: none; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.02; font-weight: 900; }
h2 { font-size: 26px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
.lede { color: var(--muted); font-size: 16px; max-width: 680px; margin: 12px 0 0; }
.section { margin-top: 34px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }

/* ---- hero ---- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 26px; align-items: end; }
.hero h1 em { font-style: italic; color: var(--gold); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st-top); margin-right: 8px; box-shadow: 0 0 0 0 rgba(79,224,176,.6); animation: pulse 2s infinite; vertical-align: 1px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(79,224,176,.55); } 70% { box-shadow: 0 0 0 9px rgba(79,224,176,0); } 100% { box-shadow: 0 0 0 0 rgba(79,224,176,0); } }
.since { margin-top: 14px; font-size: 14px; color: var(--chalk); background: var(--ink-2); border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; }
.since b { color: var(--gold); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { padding: 14px 14px 12px; }
.kpi .v { font: 500 28px/1.05 var(--mono); letter-spacing: -.02em; }
.kpi .l { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.3; }
.kpi.gold .v { color: var(--gold); }

/* status distribution bar */
.dist { margin-top: 22px; }
.dist-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--ink-2); border: 1px solid var(--line); }
.dist-bar span { display: block; height: 100%; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.dist-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.dist-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dist-legend b { color: var(--chalk); font-family: var(--mono); font-weight: 500; }

/* checkpoint survival strip */
.cps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.cp { padding: 14px; }
.cp .t { font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.cp .v { font: 500 26px/1.1 var(--mono); margin-top: 8px; }
.cp .s { font-size: 12px; color: var(--dim); margin-top: 4px; }
.meter { height: 6px; border-radius: 99px; background: var(--ink-2); margin-top: 10px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--st-stand); border-radius: 99px; transition: width .6s; }

/* superlatives */
.sups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sup { display: flex; gap: 14px; padding: 14px; align-items: center; color: var(--chalk); transition: transform .15s, border-color .15s; }
.sup:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--gold); }
.sup .ph { width: 64px; height: 64px; flex: none; }
.sup .tt { font: italic 700 15px/1.2 var(--serif); color: var(--gold); }
.sup .nm { font-weight: 700; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup .why { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.sup > div { min-width: 0; }

/* photo frame for coin art */
.ph { position: relative; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, var(--card-2), var(--ink-2)); border: 1px solid var(--line-2); }
.ph img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .ini { position: absolute; inset: 0; display: grid; place-items: center; font: 800 20px var(--serif); color: var(--dim); }

/* filters */
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--ink-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 500; }
.chip:hover { color: var(--chalk); border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }
.chip .n { font-family: var(--mono); font-size: 11.5px; opacity: .75; margin-left: 4px; }
select.sel { background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--chalk); }

/* the yearbook grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-top: 16px; }
.yb { display: block; color: var(--chalk); padding: 10px 10px 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); transition: transform .16s, border-color .16s, box-shadow .16s; animation: rise .45s both; }
.yb:hover { text-decoration: none; transform: translateY(-3px) rotate(-.4deg); border-color: var(--line-2); box-shadow: 0 18px 30px -20px rgba(0,0,0,.8); }
.yb .ph { aspect-ratio: 1; width: 100%; }
.yb .nm { font: 700 15px/1.2 var(--serif); margin-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yb .sub { display: flex; justify-content: space-between; gap: 6px; font: 400 12px/1.3 var(--mono); color: var(--muted); margin-top: 4px; }
.yb .stamp { position: absolute; left: 8px; bottom: 8px; z-index: 2; }
.yb .flags { position: absolute; z-index: 2; right: 6px; top: 6px; display: flex; gap: 4px; flex-direction: column; align-items: flex-end; }
.yb.fresh { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,193,78,.18); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* stamps + badges */
.stamp { display: inline-block; font: 700 10.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; padding: 5px 7px 4px; border-radius: 5px; border: 1.5px solid currentColor; background: rgba(14,19,34,.82); transform: rotate(-3deg); }
.st-topclass { color: var(--st-top); } .st-standing { color: var(--st-stand); } .st-slipping { color: var(--st-slip); }
.st-dropout { color: var(--st-drop); } .st-paper { color: var(--st-paper); } .st-ungraded { color: var(--st-off); } .st-pending { color: var(--st-pend); }
.bg-topclass { background: var(--st-top); } .bg-standing { background: var(--st-stand); } .bg-slipping { background: var(--st-slip); }
.bg-dropout { background: var(--st-drop); } .bg-paper { background: var(--st-paper); } .bg-ungraded { background: var(--st-off); } .bg-pending { background: var(--st-pend); }
.badge { display: inline-flex; align-items: center; gap: 4px; font: 500 10.5px/1 var(--mono); padding: 4px 6px; border-radius: 5px; background: rgba(14,19,34,.86); border: 1px solid var(--line-2); color: var(--chalk); white-space: nowrap; }
.badge.speedrun { color: var(--speed); border-color: rgba(89,195,240,.5); }
.badge.honor { color: var(--gold); border-color: rgba(242,193,78,.55); }
.badge.painted, .badge.paper { color: var(--st-paper); border-color: rgba(185,161,255,.5); }
.badge.ghosted { color: var(--muted); }
.stamp.big { font-size: 15px; padding: 8px 12px 7px; border-width: 2px; }
.stamp.in { animation: stamp .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stamp { from { opacity: 0; transform: scale(1.8) rotate(-12deg); } to { opacity: 1; transform: scale(1) rotate(-3deg); } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 9px 16px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--chalk); cursor: pointer; font-weight: 600; font-size: 14px; }
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.gold:hover { background: var(--gold-2); }
.btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.more { display: flex; justify-content: center; margin-top: 18px; }

/* coin (yearbook page) */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.page { display: grid; grid-template-columns: 300px 1fr; gap: 26px; }
.portrait { padding: 14px; position: relative; }
.portrait .ph { aspect-ratio: 1; width: 100%; }
.portrait .stamp { position: absolute; left: 24px; top: 250px; z-index: 2; }
.portrait h1 { font-size: 30px; margin-top: 16px; overflow-wrap: anywhere; }
.portrait .tick { color: var(--muted); font: 500 14px var(--mono); margin-top: 4px; }
.portrait .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.portrait .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.portrait .links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; margin-top: 14px; }
.quote { font: italic 500 19px/1.35 var(--serif); color: var(--chalk); margin: 0 0 6px; }
.report { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); }
.report > div { padding: 14px 14px 12px; border-right: 1px solid var(--line); }
.report > div:last-child { border-right: 0; }
.report .t { font: 500 11px/1 var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.report .v { font: 500 19px/1.2 var(--mono); margin-top: 8px; }
.report .x { font: 500 12px/1 var(--mono); margin-top: 5px; }
.up { color: var(--st-top); } .down { color: var(--st-drop); } .flat { color: var(--muted); }
.chart { position: relative; padding: 14px 16px 8px; }
.chart svg { display: block; width: 100%; height: 260px; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart .legend i { display: inline-block; width: 14px; height: 2px; vertical-align: 3px; margin-right: 6px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-family: var(--mono); text-align: right; overflow-wrap: anywhere; }
.dev-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.dev-list li { display: flex; justify-content: space-between; gap: 8px; }
.odds-note { font-size: 14px; line-height: 1.55; }
.odds-note b { color: var(--gold); font-family: var(--mono); font-weight: 500; }

/* classes archive */
.ctable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ctable th { text-align: left; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ctable td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ctable tr:last-child td { border-bottom: 0; }
.ctable tbody tr { cursor: pointer; transition: background .12s; }
.ctable tbody tr:hover { background: var(--card-2); }
.ctable .day { font: 700 16px var(--serif); white-space: nowrap; }
.ctable td.n { font-family: var(--mono); text-align: right; white-space: nowrap; }
.ctable th.n { text-align: right; }
.mini { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mini .ph { width: 28px; height: 28px; flex: none; border-radius: 7px; }
.mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { display: inline-block; width: 90px; height: 8px; border-radius: 99px; background: var(--ink-2); overflow: hidden; vertical-align: middle; margin-left: 8px; }
.spark > span { display: block; height: 100%; background: var(--st-stand); }

/* odds desk */
.odds-ctrl { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.odds-ctrl label { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.otable { width: 100%; border-collapse: collapse; }
.otable th, .otable td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.otable th { font: 500 11px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.otable tr.hl td { background: rgba(242,193,78,.08); }
.otable tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.cell { display: flex; align-items: center; gap: 10px; }
.cell .bar { flex: 1; max-width: 120px; height: 8px; border-radius: 99px; background: var(--ink-2); overflow: hidden; }
.cell .bar span { display: block; height: 100%; }
.cell .p { font: 500 15px var(--mono); min-width: 48px; }
.cell .n { font: 400 11.5px var(--mono); color: var(--dim); }
.rule { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* locker */
.lk { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; }
.lk + .lk { border-top: 1px solid var(--line); }
.lk .ph { width: 56px; height: 56px; }
.lk .nm { font: 700 16px var(--serif); }
.lk .meta { font: 400 12.5px var(--mono); color: var(--muted); margin-top: 3px; }
.lk .chg { font-size: 13px; margin-top: 4px; }
.lk .chg b { color: var(--gold); font-weight: 600; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.icon-btn:hover { color: var(--st-drop); border-color: var(--st-drop); }

/* states */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--chalk); margin-bottom: 6px; }
.err { border-color: rgba(232,100,79,.5); color: var(--chalk); }
.skel { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r); border: 1px solid var(--line); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel.tile { aspect-ratio: .78; }
.skel.line { height: 120px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--chalk); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.note { font-size: 12.5px; color: var(--dim); margin-top: 10px; line-height: 1.5; }
.tag { font: 500 11px/1 var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: 13.5px; background: var(--ink-2); }
.foot-in p { margin: 0 0 10px; max-width: 900px; line-height: 1.6; }
.foot b { color: var(--chalk); }
.foot .fine { color: var(--dim); font-size: 12.5px; }

/* ---- responsive ---- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .sups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page { grid-template-columns: 1fr; }
  .portrait { display: grid; grid-template-columns: 140px 1fr; gap: 0 16px; align-items: start; }
  .portrait .ph { grid-row: span 4; }
  .portrait h1 { margin-top: 0; font-size: 26px; }
  .portrait .stamp { left: 22px; top: 118px; }
  .report { grid-template-columns: repeat(3, 1fr); }
  .report > div:nth-child(3) { border-right: 0; }
  .report > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .bar-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px 12px; }
  .brand { font-size: 20px; }
  nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  nav a { padding: 7px 11px; font-size: 14px; white-space: nowrap; }
  .lookup { margin-left: auto; }
  .lookup input { width: 150px; }
  .wrap { padding: 0 14px; }
  main { padding-top: 20px; }
  .kpi .v { font-size: 22px; }
  .cps { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .cp { padding: 11px; } .cp .v { font-size: 20px; }
  .sups { grid-template-columns: minmax(0, 1fr); }
  .ctable th, .ctable td { padding: 10px 6px; }
  .ctable .day { font-size: 14px; }
  .spark { width: 40px; margin-left: 6px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .facts { grid-template-columns: 1fr; }
  .portrait { grid-template-columns: 104px 1fr; }
  .portrait .stamp { top: 84px; left: 18px; }
  .portrait .acts, .portrait .links { grid-column: 1 / -1; }
  .portrait .acts .btn { flex: 1 1 auto; justify-content: center; padding: 9px 12px; }
  .portrait .stamp.big { font-size: 11px; padding: 5px 7px 4px; }
  .report .v { font-size: 16px; }
  .chart svg { height: 200px; }
  .hide-sm { display: none; }
  .otable th, .otable td { padding: 10px 8px; font-size: 13px; }
  .cell .bar { display: none; }
  .cell { flex-direction: column; align-items: flex-start; gap: 2px; }
  .cell .p { min-width: 0; }
  .otable th { font-size: 10px; letter-spacing: .05em; }
  .otable td:first-child { font-size: 12.5px; }
  .scroll-x { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
