/* trivium · chalkboard green, chalk white, amber highlights.
 *
 * Surface is real-classroom slate green (#1d3329). Body text is warm
 * chalk white (#ece6d4) — never pure #fff so it reads like a mark on
 * slate. Highlights, brand, links, primary buttons, and roles use PHAROS
 * amber (#c8a84b). Top and bottom strips share the same chalkboard
 * green; the amber lives in the foreground.
 *
 * Type system follows the t34ch.tech presentation deck: Bebas Neue for
 * the trivium brand, page titles, h3 section labels, and badges. Libre
 * Baskerville for body prose (anything markdown-rendered — feedback,
 * assignment description). IBM Plex Sans for the dense form/table
 * chrome. IBM Plex Mono for sha-256s, JWS, code, signal names, table
 * data, form inputs.
 *
 * @font-face declarations point at /static/fonts/. Run
 * scripts/fetch-fonts.sh after a fresh checkout to populate them; if any
 * file is missing, the stack falls back to system serif/sans/mono. */

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/IBMPlexMono-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Bebas Neue";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/BebasNeue-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Baskerville";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/LibreBaskerville-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Baskerville";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("/static/fonts/LibreBaskerville-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Baskerville";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/LibreBaskerville-Bold.woff2") format("woff2");
}

:root {
  /* Chalkboard green slate, chalk-white body, amber highlights. The t34ch
   * deck's near-black background is a different surface; trivium is the
   * classroom, not the slides — so green is the wall and amber is the
   * frame around it. Typography stays t34ch (Bebas Neue display, Libre
   * Baskerville prose, IBM Plex Mono technical).
   *
   * color-scheme: only dark — overrides the user agent's automatic
   * prefers-color-scheme handling so a light-mode OS doesn't render form
   * controls and scrollbars in light style on top of the chalkboard. */
  color-scheme: only dark;
  --bg:        #1d3329;
  --bg-soft:   #243d33;
  --bg-card:   #2a4438;
  --line:      rgba(236, 230, 212, 0.08);
  --line-2:    rgba(236, 230, 212, 0.16);
  --text:      #ece6d4;
  --text-dim:  #a39d8c;
  --text-mute: #6b7569;
  --amber:     #c8a84b;
  --amber-2:   #e8c465;
  --blue:      #6fb3d9;
  --orange:    #d49a3c;
  --good:      #a8d090;
  --warn:      #d49a3c;
  --err:       #c25b5b;
  --link:      #c8a84b;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --sans:    "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif:   "Libre Baskerville", Georgia, "Times New Roman", serif;
  --display: "Bebas Neue", "IBM Plex Sans Condensed", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--amber-2); text-decoration: underline; }

code, pre, .sha, .jws { font-family: var(--mono); }
pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 12px;
}
.sha { font-size: 11px; color: var(--text-dim); }
.sha.tiny { font-size: 10px; }
.jws { font-size: 11px; word-break: break-all; }

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.brand {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  font-size: 18px;
}
.brand:hover { color: var(--amber-2); text-decoration: none; }
.topnav { display: flex; gap: 14px; align-items: center; }
.topnav a { font-size: 12px; color: var(--amber); }
.topnav a:hover { color: var(--amber-2); }
.topnav .inline { margin: 0; padding: 0; }
.topnav .link {
  background: none; border: 0; padding: 0;
  color: var(--link); font: inherit; cursor: pointer;
  font-size: 12px;
}
.topnav .link:hover { color: var(--amber-2); text-decoration: underline; }

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 22px 80px;
}
h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--amber);
}
h2 { font-size: 16px; font-weight: 600; margin: 18px 0 10px; }
h3 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 400;
  margin: 14px 0 6px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.dim, .muted { color: var(--text-dim); }
.empty { color: var(--text-mute); font-style: italic; }

.crumbs { font-size: 11px; color: var(--text-mute); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--text-dim); margin: 4px 0 18px; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 16px 18px;
  margin: 18px 0;
}
.card h2:first-child { margin-top: 0; }
.flash {
  padding: 8px 12px;
  background: rgba(200, 168, 75, 0.08);
  border-left: 2px solid var(--amber);
  font-size: 13px;
}
.dev-banner {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(212, 154, 60, 0.08);
  border-left: 2px solid var(--warn);
  font-size: 12px;
}
.dev-banner a { word-break: break-all; }
.alt { font-size: 12px; margin-top: 14px; color: var(--text-dim); }

/* ── Forms ── */
form { margin: 0; }
form.inline { display: inline; }
label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 12px 0 4px;
}
input[type=text], input[type=email], input[type=url], input[type=number], select, textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 10px;
}
textarea { font-family: var(--mono); font-size: 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--amber); outline-offset: -1px; }

button, .btn {
  display: inline-block;
  background: var(--amber);
  color: #1d3329;
  border: 0;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 14px;
}
button:hover { background: var(--amber-2); }
button.link {
  background: none;
  color: var(--link);
  font: inherit;
  padding: 0;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
button.link:hover { color: var(--amber-2); text-decoration: underline; }

/* ── Tables / Grids ── */
table.grid {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  margin: 14px 0;
  font-size: 13px;
}
table.grid th, table.grid td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
table.grid th {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: var(--bg-soft);
}
table.grid tbody tr:hover { background: rgba(200, 168, 75, 0.04); }

/* ── Badges / status ── */
.role, .status {
  display: inline-block;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 2px 7px 1px;
  border: 1px solid var(--line-2);
  color: var(--text-dim);
}
.role-instructor { color: var(--amber); border-color: var(--amber); }
.role-grader     { color: var(--blue);  border-color: var(--blue); }
.role-student    { color: var(--text);  border-color: var(--line-2); }

.status-graded     { color: var(--amber);  border-color: var(--amber); }
.status-submitted  { color: var(--blue);   border-color: var(--blue); }
.status-missing    { color: var(--orange); border-color: var(--orange); }
.status-open       { color: var(--text-dim); }
.status-ungraded   { color: var(--text-mute); }

/* ── Course header ── */
.course-header { margin-bottom: 18px; }
.subnav {
  display: flex;
  gap: 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  margin-bottom: 18px;
}
.subnav a { color: var(--text); }
.subnav a:hover { color: var(--amber); }

/* ── Video player ── */
.video-player {
  width: 100%;
  max-width: 1080px;
  background: #000;
  display: block;
  margin: 16px 0;
}

/* ── Files ── */
ul.files {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
}
ul.files li {
  padding: 6px 0;
  border-bottom: 1px dotted var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── Grader layout ── */
.grader-grid {
  display: grid;
  grid-template-columns: 1fr 360px 200px;
  gap: 18px;
}
.grader-grid section, .grader-grid aside { min-width: 0; }
.grader-grid .files-pane { background: var(--bg-card); border: 1px solid var(--line); padding: 14px 16px; }
.grader-grid .grade-pane { background: var(--bg-card); border: 1px solid var(--line); padding: 14px 16px; }
.grader-grid .queue-pane { background: var(--bg-soft); border: 1px solid var(--line); padding: 12px 14px; font-size: 12px; }
ul.queue { list-style: none; padding: 0; margin: 0; }
ul.queue li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
ul.queue li.active { background: rgba(200, 168, 75, 0.06); padding-left: 6px; margin-left: -6px; }

ul.annotations { list-style: none; padding: 0; margin: 8px 0 14px; }
.annotation {
  border-left: 2px solid var(--amber);
  padding: 6px 10px;
  margin: 8px 0;
  background: rgba(200, 168, 75, 0.04);
  font-size: 12px;
}
.ann-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.annotation-form { background: var(--bg-soft); border: 1px solid var(--line); padding: 10px 12px; }

/* ── Markdown body prose ── feedback, rendered assignment descriptions,
 * anything that's actually paragraphs of writing rather than UI chrome.
 * Libre Baskerville reads at body sizes the way the slide deck reads
 * Baskerville on screen — generous, slightly old-fashioned, classroom. */
.feedback, .prose {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.feedback p:first-child, .prose p:first-child { margin-top: 0; }
.feedback code, .prose code {
  font-family: var(--mono);
  background: var(--bg-soft);
  padding: 1px 5px;
  font-size: 12px;
}
.feedback pre code, .prose pre code { background: none; padding: 0; }

/* ── Course list ── */
ul.course-list { list-style: none; padding: 0; margin: 0; }
ul.course-list li { padding: 6px 0; border-bottom: 1px dotted var(--line); font-size: 13px; }

/* ── Footer ── */
.footbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  text-align: center;
  padding: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  letter-spacing: 0.06em;
}

/* ── Error page ── */
main.err { max-width: 720px; margin: 60px auto; padding: 30px; background: var(--bg-card); border: 1px solid var(--err); }
main.err h1 { color: var(--err); margin: 0 0 12px; font-family: var(--mono); font-size: 18px; letter-spacing: 0.04em; }
main.err pre { color: var(--text-dim); font-size: 12px; }

/* The chalkboard palette applies regardless of prefers-color-scheme.
 * An earlier light-mode variant lived here (whiteboard with green
 * marker); removed because users on light-mode OSes were getting that
 * by default and reading it as "the theme didn't change". Chalkboard
 * everywhere is the right call — the surface IS dark by design. */
