/* Geist — variable weight UI sans */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist/geist-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist/geist-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EC2, U+1EF2-1EF9, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #15110e;
  --panel: #221c18;
  --panel-hover: #2c2520;
  --border: #3a2f28;
  --text: #ebe1cf;
  --text-dim: #9a8d7d;
  --text-faint: #5e5246;
  --accent: #c9622e;
  --rule: #2a221d;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 1.75rem 5rem;
}

/* Masthead */

header.masthead {
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2rem;
}

header.masthead .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 1rem;
  font-weight: 500;
}

header.masthead h1 {
  margin: 0 0 0.7rem;
  font-size: 2.2rem;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
}

header.masthead h1 .amp { color: var(--accent); font-weight: 400; }

header.masthead .lede {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
  max-width: 38em;
  font-weight: 400;
}

/* Section */

section.part { margin-top: 3rem; }

section.part > .label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 0.55rem;
  font-weight: 500;
}

section.part > h2 {
  margin: 0 0 1.4rem;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Card grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.card {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: background 100ms;
  min-height: 3.4rem;
}

.card:hover {
  background: var(--panel-hover);
  text-decoration: none;
}

.card .num {
  font-feature-settings: "tnum" 1, "ss01" 1;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-faint);
  flex: 0 0 1.5rem;
}

.card .title {
  flex: 1;
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.35;
}

.card.quiz .num { color: var(--accent); }
.card.quiz .title { color: var(--text-dim); }

/* Footer */

footer.colophon {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.55;
}
footer.colophon p { margin: 0 0 0.35rem; }
footer.colophon p:last-child { margin: 0; color: var(--text-faint); }
footer.colophon a { color: var(--text-dim); text-decoration: underline; text-decoration-color: var(--text-faint); text-underline-offset: 2px; }
footer.colophon a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Player page */

body.player-page { display: flex; flex-direction: column; min-height: 100vh; }

.player-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.1rem 1.75rem;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.player-header .back {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
}
.player-header .back:hover { color: var(--accent); }

.player-header h1 {
  margin: 0;
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.player-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #000;
}

#ruffle-mount {
  width: min(100%, 1024px);
  aspect-ratio: 4 / 3;
  background: #000;
  display: flex;
  border: 1px solid var(--border);
}

#ruffle-mount > ruffle-player {
  flex: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.player-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 1.75rem;
  background: var(--bg);
  border-top: 1px solid var(--rule);
}
.player-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--text-dim);
  max-width: 45%;
  min-width: 0;
}
.player-nav .nav-label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}
.player-nav .nav-title {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-nav a:hover .nav-title { color: var(--accent); }
.player-nav .next { text-align: right; align-items: flex-end; }

.notice {
  text-align: center;
  color: var(--text-dim);
  padding: 3rem;
}

@media (max-width: 600px) {
  .container { padding: 2.5rem 1rem 3.5rem; }
  header.masthead h1 { font-size: 1.7rem; }
  .grid { grid-template-columns: 1fr; }
  .player-header { padding: 1rem; gap: 1rem; }
  .player-stage { padding: 0.5rem; }
}
