/* ============================================
   OnlyQuizbowl — Visual System
   Signal red, true black, warm cream.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --cream: #FAF6EA;
  --paper: #FFFFFE;
  --ink: #14120F;
  --ink-soft: #3A362E;
  --muted: #837A69;
  --line: rgba(20, 18, 15, 0.14);
  --signal: #E0342A;   /* reserved: brand + calls-to-action only */
  --signal-deep: #B32A21;

  /* category accents — color-coded scheme:
     green=science, purple=mythology/religion, pink=literature,
     blue=social science/philosophy, orange=fine arts, yellow=history.
     (brown=geography, reserved for when that category launches) */
  --cat-literature: #DB2777;
  --cat-history: #CA8A04;
  --cat-science: #15803D;
  --cat-fine-arts: #EA580C;
  --cat-mythology-religion: #7C3AED;
  --cat-social-science-philosophy: #2563EB;
  --cat-geography: #78350F;

  /* OnlyNegs-only meme category — quiz bowl culture memes aren't tied
     to an archive category, so they get their own color. */
  --meme-culture: #0891B2;

  --radius: 4px;
  --shadow: 0 1px 0 rgba(20,18,15,0.06), 0 10px 24px rgba(20,18,15,0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Source Serif 4', Georgia, serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: 0.03em;
}

.display {
  font-family: 'Space Grotesk', ui-sans-serif, sans-serif;
}

/* ---------- Skip link / focus ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--cream);
  padding: 0.6em 1em; z-index: 100;
}
.skip-link:focus { left: 0.5em; top: 0.5em; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Header ---------- */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(1.1);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: inherit; flex: none; }
.brand-mark { width: 30px; height: 30px; display: block; flex: none; object-fit: contain; }

.page-logo {
  display: flex; justify-content: center;
  padding: 2.2rem 1.5rem 0;
}
.page-logo img { width: 150px; height: auto; max-width: 100%; }
@media (max-width: 600px) { .page-logo img { width: 110px; } .page-logo { padding-top: 1.2rem; } }
.brand-name {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 1.2rem; letter-spacing: -0.01em;
}
.brand-name .sub { color: var(--signal); }

.site-nav {
  display: flex; align-items: center; gap: 1.6rem;
  font-family: 'IBM Plex Mono'; font-size: 0.78rem; letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.site-nav a { text-decoration: none; color: var(--ink-soft); padding-bottom: 3px; border-bottom: 1px solid transparent; flex: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }
.site-nav a.nav-cta { color: var(--signal); }
.site-nav summary[aria-current="page"] { color: var(--ink); }

.nav-dropdown { position: relative; flex: none; }
.nav-dropdown summary {
  list-style: none; cursor: pointer;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 0;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 0.5rem; display: flex; flex-direction: column;
  min-width: 190px; z-index: 30;
}
.nav-dropdown-menu.align-right { left: auto; right: 0; }
.nav-dropdown-menu a {
  padding: 0.45em 0.6em; text-transform: none; letter-spacing: 0.01em;
  font-size: 0.8rem; color: var(--ink-soft); border-bottom: none;
}
.nav-dropdown-menu a:hover { color: var(--signal); }
.nav-dropdown-menu a[aria-current="page"] { color: var(--signal); }

/* ---------- Hero ---------- */
.hero {
  max-width: 720px; margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}
@media (max-width: 820px) { .hero { padding-top: 1rem; } }

.eyebrow {
  font-family: 'IBM Plex Mono'; font-size: 0.76rem; color: var(--signal);
  letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 1rem;
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(2.4rem, 4.6vw, 3.8rem); line-height: 1.02;
  letter-spacing: -0.01em; margin: 0 0 1.1rem; color: var(--ink);
}
.hero h1 .accent { color: var(--signal); }

.hero p.lede { font-size: 1.14rem; max-width: 46ch; color: var(--ink-soft); margin: 0 0 1.9rem; }

.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: 'IBM Plex Mono'; font-size: 0.84rem; letter-spacing: 0.03em;
  padding: 0.8em 1.35em; border-radius: var(--radius);
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--signal); color: var(--paper); }
.btn-primary:hover { background: var(--signal-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: rgba(20,18,15,0.06); }
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-dark:hover { background: #262420; }

/* ---------- Two-path section (Powers / Negs) ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 3rem 1.5rem; }
.section-head { max-width: 62ch; margin-bottom: 2.2rem; }
.section-head .eyebrow { margin-bottom: 0.6rem; }
.section h2 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0 0 0.6rem; color: var(--ink);
  letter-spacing: -0.01em;
}
.section p.dek { color: var(--ink-soft); font-size: 1.02rem; margin: 0; }

.path-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem;
}
@media (max-width: 760px) { .path-grid { grid-template-columns: 1fr; } }

.path-card {
  border-radius: var(--radius);
  padding: 2rem 2rem 2.2rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 1rem;
  transition: transform 0.15s ease;
}
.path-card:hover { transform: translateY(-3px); }

.path-card.light { background: var(--paper); border: 1px solid var(--line); border-top: 5px solid var(--signal); }
.path-card.dark { background: var(--ink); color: var(--cream); border-top: 5px solid var(--signal); }

.path-tag {
  font-family: 'IBM Plex Mono'; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--signal);
}
.path-card h3 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 1.5rem; margin: 0; letter-spacing: -0.01em;
}
.path-card p { margin: 0; font-size: 0.98rem; }
.path-card.light p { color: var(--ink-soft); }
.path-card.dark p { color: #D8D3C6; }
.path-card .path-cta { font-family: 'IBM Plex Mono'; font-size: 0.8rem; margin-top: auto; }
.path-card.light .path-cta { color: var(--ink); }
.path-card.dark .path-cta { color: var(--cream); }

/* ---------- How it works ---------- */
.stripe { background: var(--ink); color: var(--cream); }
.stripe .section h2 { color: var(--cream); }
.stripe .section p.dek { color: #C9C4B6; }
.stripe .eyebrow { color: var(--signal); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 1.6rem; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step { border-top: 2px solid var(--signal); padding-top: 0.8rem; }
.step .step-num { font-family: 'IBM Plex Mono'; color: var(--signal); font-size: 0.8rem; }
.step h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; margin: 0.35rem 0 0.4rem; }
.step p { margin: 0; color: #C9C4B6; font-size: 0.95rem; }

/* ---------- Category tiles (index page) ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.cat-tile {
  background: var(--paper); border: 1px solid var(--line);
  border-left: 6px solid var(--tile-color, var(--ink));
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  text-decoration: none; color: inherit; display: block;
  box-shadow: var(--shadow); transition: transform 0.15s ease;
}
.cat-tile:hover { transform: translateY(-2px); }
.cat-tile .cat-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.05rem; display: block; margin-bottom: 0.3rem; }
.cat-tile .cat-count { font-family: 'IBM Plex Mono'; font-size: 0.76rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 2.2rem 1.5rem; text-align: center;
  font-family: 'IBM Plex Mono'; font-size: 0.78rem; color: var(--muted);
}
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--signal); }
.footer-links { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.6rem; }

/* ============================================
   Archive page (OnlyPowers)
   ============================================ */

.archive-toolbar { max-width: 1120px; margin: 0 auto; padding: 2.2rem 1.5rem 0; }
.search-drawer {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
}
.search-drawer label {
  font-family: 'IBM Plex Mono'; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); display: block; margin-bottom: 0.3rem;
}
.search-field { flex: 1 1 240px; }
.search-field input {
  width: 100%; font-family: 'Source Serif 4', serif; font-size: 1rem;
  padding: 0.55em 0.7em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream);
}
.filter-field select {
  font-family: 'IBM Plex Mono'; font-size: 0.85rem; padding: 0.55em 0.6em;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream);
}

.result-count { font-family: 'IBM Plex Mono'; font-size: 0.8rem; color: var(--muted); max-width: 1120px; margin: 1.1rem auto 0; padding: 0 1.5rem; }

.card-grid {
  max-width: 1120px; margin: 0 auto; padding: 1.4rem 1.5rem 4rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem;
}
.clue-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1rem; border-left: 5px solid var(--card-color, var(--ink));
}
.clue-meta {
  font-family: 'IBM Plex Mono'; font-size: 0.68rem; color: var(--card-color, var(--ink-soft));
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem;
}
.clue-text { font-size: 0.95rem; color: var(--ink); margin: 0; line-height: 1.45; }
.clue-text strong { color: var(--signal); font-weight: 700; }

.no-results { max-width: 1120px; margin: 0 auto; padding: 3rem 1.5rem; text-align: center; color: var(--muted); font-family: 'IBM Plex Mono'; font-size: 0.9rem; }

/* ============================================
   Sub-page intro (Archive, Q&A, Negs)
   ============================================ */
.sub-hero {
  background: var(--ink); color: var(--cream);
}
.sub-hero .section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.sub-hero .eyebrow { color: var(--signal); }
.sub-hero h1 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(1.9rem, 7vw, 3.2rem); margin: 0 0 1rem; letter-spacing: -0.01em;
  line-height: 1.05;
}
.sub-hero p.lede { font-size: 1.1rem; max-width: 52ch; color: #D8D3C6; margin: 0 0 1.6rem; }
@media (max-width: 600px) {
  .sub-hero .section { padding-top: 2rem; padding-bottom: 2rem; }
  .sub-hero p.lede { font-size: 1rem; }
}

.tile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem;
}
.meme-tile {
  aspect-ratio: 1; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 1rem; font-family: 'IBM Plex Mono'; font-size: 0.78rem; letter-spacing: 0.03em;
  color: var(--cream);
  text-decoration: none; transition: transform 0.15s ease;
}
.meme-tile:hover { transform: translateY(-2px); }

/* ---------- Interview archive placeholder (Q&A page) ---------- */
.interview-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; margin-top: 1.6rem;
}
.interview-slot {
  aspect-ratio: 4 / 3; border-radius: var(--radius);
  border: 1.5px dashed var(--line); background: var(--paper);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 1rem; font-family: 'IBM Plex Mono'; font-size: 0.8rem;
  color: var(--muted); letter-spacing: 0.02em;
}

/* ============================================
   Submit page
   ============================================ */
.submit-form {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.8rem; max-width: 640px;
  display: flex; flex-direction: column; gap: 1.3rem;
}
.form-field label {
  font-family: 'IBM Plex Mono'; font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); display: block; margin-bottom: 0.4rem;
}
.form-field select,
.form-field textarea,
.form-field input {
  width: 100%; font-family: 'Source Serif 4', serif; font-size: 1rem;
  padding: 0.6em 0.7em; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--cream); color: var(--ink);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-note { font-family: 'IBM Plex Mono'; font-size: 0.78rem; color: var(--muted); margin: 0; }

/* ============================================
   Stats bar (homepage)
   ============================================ */
.stats-bar { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-bar-inner {
  padding: 1.8rem 1.5rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  text-align: center;
}
@media (max-width: 560px) { .stats-bar-inner { grid-template-columns: 1fr; } }
.stat { display: flex; flex-direction: column; gap: 0.3rem; }
.stat-num {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.1rem); color: var(--signal); letter-spacing: -0.01em;
}
.stat-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}

/* ============================================
   Featured clue/meme of the day (homepage)
   ============================================ */
.featured-card {
  background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--signal);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.6rem 1.8rem; max-width: 720px;
}
.featured-kicker { display: block; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.7rem; }
.featured-text { font-size: 1.05rem; color: var(--ink); margin: 0 0 0.9rem; }
.featured-answer { font-size: 0.86rem; border-top: 1px dotted var(--line); padding-top: 0.7rem; margin: 0 0 0.9rem; }
.featured-answer strong { color: var(--signal); }
.featured-link { font-size: 0.82rem; text-decoration: none; color: var(--ink); }
.featured-link:hover { color: var(--signal); }
.featured-empty { color: var(--muted); font-size: 0.9rem; margin: 0; }
.featured-shuffle { margin-top: 1rem; }
.featured-shuffle:disabled { opacity: 0.5; cursor: default; }
.featured-shuffle:disabled:hover { transform: none; background: transparent; }

/* ============================================
   Player Q&A photo grid (qa.html)
   ============================================ */
.player-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem; margin-top: 1.6rem;
}
.player-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  text-decoration: none; color: inherit;
}
.player-photo {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, var(--line), var(--line) 8px, transparent 8px, transparent 16px);
  border: 1.5px dashed var(--line);
}
img.player-photo {
  object-fit: cover;
  object-position: center top;
  display: block;
  border: 1px solid var(--line);
}
.player-card[href] .player-photo { border-style: solid; cursor: pointer; }
.player-name { font-size: 0.8rem; color: var(--muted); text-align: center; }

/* ============================================
   Meme post spotlight grid (negs.html)
   ============================================ */
.meme-post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem; margin-top: 1.6rem;
}
.meme-post-card {
  display: flex; flex-direction: column; gap: 0.6rem;
  text-decoration: none; color: inherit;
}
img.meme-post-cover {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
}
.meme-post-card[href] .meme-post-cover { border-style: solid; cursor: pointer; }
.meme-post-label { font-size: 0.8rem; color: var(--muted); }

/* ============================================
   About page — mission quote + team grid
   ============================================ */
.about-mission { background: var(--paper); border-bottom: 1px solid var(--line); }
.about-mission .section { padding: 3rem 1.5rem; max-width: 860px; }
.mission-quote {
  margin: 0; border-left: 6px solid var(--signal); padding-left: 1.4rem;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.4;
  color: var(--ink); letter-spacing: -0.01em;
}

.team-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.6rem; margin-top: 1.6rem;
}
.team-card { display: flex; flex-direction: column; gap: 0.5rem; }
.team-photo {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius);
  object-fit: cover; object-position: center top; display: block;
  border: 1px solid var(--line);
}
.team-name {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 1.05rem; margin: 0.3rem 0 0; color: var(--ink);
}
.team-school { font-size: 0.76rem; color: var(--muted); margin: 0; }
.team-achievements {
  list-style: none; margin: 0.4rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.team-achievements li {
  font-size: 0.82rem; color: var(--ink-soft); line-height: 1.4;
  padding-left: 0.9rem; position: relative;
}
.team-achievements li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--signal);
}
