/* ---------- themes ---------- */
:root,
[data-theme="varsity"] {
  --bg: #ffffff;
  --surface: #f3f5f9;
  --ink: #16213e;
  --muted: #5c6782;
  --line: #dfe3ec;
  --accent: #c8102e;
  --accent-ink: #ffffff;
  --band: #16213e;
  --band-ink: #ffffff;
  --band-muted: #b7c0d8;
  --head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --head-weight: 800;
  --head-case: none;
  --radius: 6px;
}
[data-theme="scrapbook"] {
  --bg: #fffdf7;
  --surface: #f6f1e4;
  --ink: #23201b;
  --muted: #6e675b;
  --line: #e6dfcf;
  --accent: #1f7a7a;
  --accent-ink: #ffffff;
  --band: #f2c14e;
  --band-ink: #23201b;
  --band-muted: #5b4a1c;
  --head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --head-weight: 800;
  --head-case: none;
  --radius: 14px;
}
[data-theme="night"] {
  --bg: #14161b;
  --surface: #1e2129;
  --ink: #f1ede4;
  --muted: #9ea3b0;
  --line: #2c303a;
  --accent: #f2b84b;
  --accent-ink: #14161b;
  --band: #1e2129;
  --band-ink: #f1ede4;
  --band-muted: #9ea3b0;
  --head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --head-weight: 700;
  --head-case: none;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
[data-theme="night"] { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Work Sans", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
h1, h2, h3 { font-family: var(--head); font-weight: var(--head-weight); letter-spacing: -.01em; line-height: 1.1; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font: 800 14px/1 "Archivo", sans-serif; letter-spacing: .04em;
}
.brand-name { font-family: var(--head); font-weight: var(--head-weight); font-size: 20px; }
.topnav { display: flex; gap: 18px; font-weight: 500; }
.topnav a { text-decoration: none; color: var(--muted); }
.topnav a:hover, .topnav a.on { color: var(--ink); }
.search { margin-left: auto; flex: 1 1 240px; max-width: 340px; }
.search input, .hero-search input {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px;
}
.search input:focus, .hero-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.crumbs { padding-top: 16px; font-size: 14px; color: var(--muted); }
.crumbs:empty { display: none; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs .sep { margin: 0 8px; }

main { padding-bottom: 72px; outline: none; }
.page-head { padding: 20px 0 8px; }
.page-head h1 { font-size: clamp(30px, 5vw, 46px); margin: 6px 0; text-transform: var(--head-case); }
.eyebrow { font: 600 13px/1 "Work Sans", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0; }
.sub { color: var(--muted); margin: 0 0 24px; }

.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 24px; margin: 0; }
.section-head a { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }

/* ---------- hero ---------- */
.hero { background: var(--band); color: var(--band-ink); }
.hero .wrap { padding-top: 48px; padding-bottom: 48px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); margin: 0 0 10px; max-width: 14ch; }
.hero p { color: var(--band-muted); margin: 0 0 22px; font-size: 18px; }
.hero-search { display: flex; gap: 8px; max-width: 520px; }
.hero-search input { background: var(--bg); border-color: transparent; padding: 14px 18px; font-size: 17px; }
.btn {
  font: 600 16px "Work Sans", sans-serif; border: 0; border-radius: 999px; padding: 0 22px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-grid; place-items: center;
}
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.stats strong { display: block; font-family: var(--head); font-weight: var(--head-weight); font-size: 30px; line-height: 1; }
.stats span { color: var(--band-muted); font-size: 14px; }

/* ---------- video cards ---------- */
.cards { display: grid; gap: 22px 18px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 200px); gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.strip > * { scroll-snap-align: start; }
.card { text-decoration: none; display: block; }
.thumb {
  position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius);
  background: var(--tile, var(--surface));
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.card:hover .thumb img { transform: scale(1.04); }
.thumb .initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 54px/1 var(--head); color: rgba(0, 0, 0, .35);
}
.thumb .badge {
  position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; font-weight: 600;
}
.card-name { font-weight: 600; margin: 10px 0 0; line-height: 1.25; }
.card-meta { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.card:hover .card-name { color: var(--accent); }

/* ---------- tiles (states, schools, years) ---------- */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; height: 100%;
  padding: 14px 16px; border-radius: var(--radius); background: var(--surface); text-decoration: none;
  border: 1px solid transparent; transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile-name { font-weight: 600; line-height: 1.25; }
.tile-town { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
.count { flex: none; min-width: 34px; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 13px; text-align: center; }
.tiles.big .tile { padding: 18px; }
.tiles.big .tile-name { font-family: var(--head); font-weight: var(--head-weight); font-size: 20px; }
.tiles.years { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.tiles.years .tile { flex-direction: column; align-items: flex-start; }
.tiles.years .tile-name { font-family: var(--head); font-weight: var(--head-weight); font-size: 28px; }
.letter { font-size: 22px; margin: 28px 0 10px; color: var(--accent); }

/* ---------- class page / famous page portraits ---------- */
.class { display: grid; gap: 34px 22px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.portrait { margin: 0; scroll-margin-top: 90px; }
.frame {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0;
  border-radius: var(--radius); overflow: hidden; cursor: pointer; background: var(--tile, var(--surface)); color: inherit;
}
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame .initials { position: absolute; inset: 0; display: grid; place-items: center; font: 700 72px/1 var(--head); color: rgba(0, 0, 0, .35); }
.frame .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .6);
  display: grid; place-items: center; transition: background .15s;
}
.frame .play::after { content: ""; margin-left: 5px; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.frame:hover .play { background: var(--accent); }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.frame.playing { cursor: default; aspect-ratio: 9 / 16; }
.frame.playing.ig { aspect-ratio: 4 / 7; background: #fff; }
.frame.empty { cursor: default; }
.frame .soon { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: rgba(0, 0, 0, .5); font-size: 14px; }
.portrait figcaption { padding-top: 12px; }
.portrait-name { font-size: 21px; margin: 0; }
.portrait-note { color: var(--accent); font-weight: 500; margin: 4px 0 0; }
.portrait-meta { color: var(--muted); font-size: 14px; margin: 3px 0 0; }
.portrait-meta a { color: inherit; }
.portrait-links { margin: 8px 0 0; font-size: 14px; display: flex; gap: 14px; }
.portrait-links a { color: var(--muted); }
.portrait-links a:hover { color: var(--accent); }

/* ---------- search ---------- */
.result-group { margin-top: 30px; }
.result-group h2 { font: 600 13px/1 "Work Sans", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 0 0 14px; }
.none { color: var(--muted); margin: 0; }

/* ---------- footer ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner { padding-top: 32px; padding-bottom: 40px; display: grid; gap: 14px; }
.footer p { margin: 0; }
.footer-title { font-family: var(--head); font-weight: var(--head-weight); font-size: 20px; }

@media (max-width: 640px) {
  .topnav { order: 3; width: 100%; }
  .search { order: 4; max-width: none; margin-left: 0; }
  .hero .wrap { padding-top: 32px; padding-bottom: 32px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .thumb .initials { font-size: 40px; }
}

/* ---------- social bar ---------- */
.socialbar { background: var(--band); color: var(--band-ink); font-size: 14px; }
[data-theme="night"] .socialbar { background: #0d0f13; }
.socialbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; flex-wrap: wrap; padding-top: 4px; padding-bottom: 4px; }
.socials { display: flex; align-items: center; gap: 4px; }
.socials span { color: var(--band-muted); margin-right: 6px; }
.socials a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--band-ink); transition: background .15s; }
.socials a:hover { background: rgba(255, 255, 255, .15); }
[data-theme="scrapbook"] .socials a:hover { background: rgba(0, 0, 0, .08); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.bar-actions { display: flex; gap: 8px; align-items: center; }
.bar-actions a { text-decoration: none; font-weight: 600; padding: 5px 14px; border-radius: 999px; }
.bar-actions .tip { background: var(--accent); color: var(--accent-ink); }
[data-theme="scrapbook"] .bar-actions .tip { background: var(--ink); color: var(--band); }
.bar-actions .donate { color: var(--band-ink); border: 1px solid currentColor; opacity: .85; }
.bar-actions .donate:hover { opacity: 1; }
.donate-box { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; margin-top: 44px; display: flex; gap: 14px 30px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.donate-box h2 { font-size: 20px; margin: 0 0 4px; }
.donate-box p { margin: 0; color: var(--muted); }
.donate-box address { font-style: normal; font-weight: 600; }
[data-theme="night"] .thumb, [data-theme="night"] .frame { background: color-mix(in srgb, var(--tile) 22%, #1e2129); }
[data-theme="night"] .thumb .initials, [data-theme="night"] .frame .initials { color: rgba(255, 255, 255, .35); }
[data-theme="night"] .frame .soon { color: rgba(255, 255, 255, .5); }
