@font-face {
  font-family: Alegreya;
  src: url("assets/Alegreya-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Alegreya;
  src: url("assets/Alegreya-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
:root {
  color-scheme: light;
  --body-font-size: 12pt;
  --materials-font-size: 10pt;
  --ink: #000;
  --muted: #000;
  --link: #000;
  --line: rgb(0 0 0 / .18);
  --line-strong: rgb(0 0 0 / .45);
}
* { box-sizing: border-box; }
html, body { background: #fff; }
body { margin: 0; color: var(--ink); font: var(--body-font-size)/1.5 Alegreya, Georgia, serif; }
main { max-width: 850px; margin: 0 auto; padding: 48px 30px 32px; }
h1, h2, h3, p { margin-top: 0; }
h1 { white-space: nowrap; font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 2.2rem); line-height: 1.15; margin-bottom: 22px; }
h1 br { display: none; }
h2 { font-weight: 600; font-size: 15pt; line-height: 1.3; margin-bottom: 12px; overflow-wrap: anywhere; }
h3 { font-weight: 600; font-size: 11pt; margin: 18px 0 7px; }
p { margin-bottom: 14px; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.text-button { border: 0; padding: 2px 0; min-height: 22px; background: none; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { text-decoration-thickness: 2px; }
button:disabled { cursor: default; opacity: .45; }
.text-button:disabled { text-decoration: none; }
.page-header {
  position: sticky; top: 0; z-index: 10; background: #fff;
  padding: 12px 0 14px; margin-bottom: 28px;
  transform: translateY(0); transition: transform 160ms ease;
}
.page-header.header-hidden:not(:has(:focus-visible)) { transform: translateY(-100%); pointer-events: none; }
.course-heading { font-size: 10pt; margin-bottom: 9px; }
.course-heading a { text-decoration: none; }
.course-heading a:hover { text-decoration: underline; }
.collection-nav { display: flex; flex-wrap: wrap; gap: 12px 26px; font-size: 12pt; }
.collection-nav a[aria-current="page"] { font-weight: 700; text-decoration: none; }
#selected-topics { text-decoration: none; }
#selected-topics .nav-label { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
#selected-topics:hover .nav-label { text-decoration-thickness: 2px; }
#selected-count { font-size: 10pt; margin-left: 3px; font-variant-numeric: tabular-nums; text-decoration: none; }
#filters { display: block; margin-bottom: 26px; }
.text-field { min-width: 0; }
.text-field label { display: block; font-size: 10pt; margin-bottom: 3px; }
.text-field input, .text-field select, textarea {
  display: block; width: 100%; min-width: 0; padding: 5px 0 7px;
  border: 0; border-bottom: 1px solid var(--line-strong); background: #fff;
  font-size: 12pt; line-height: 1.4; box-shadow: none; appearance: none;
}
.text-field input, .text-field select { min-height: 36px; }
.text-field input:focus, .text-field select:focus, textarea:focus {
  border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); outline: none;
}
.text-field input::placeholder, textarea::placeholder { color: var(--ink); opacity: 1; }
#search::placeholder { color: #737373; }
.subtle { font-size: 10pt; line-height: 1.4; }
#rating-help { margin-bottom: 12px; }
#result-count { margin-bottom: 15px; }
.topic {
  border: 1px solid var(--line); padding: 22px 25px 24px; margin-bottom: 36px;
  scroll-margin-top: calc(var(--header-height, 140px) + 24px); min-width: 0;
}
.topic-tags { margin-bottom: 7px; font-size: 9pt; line-height: 1.35; }
.topic-description, .paper-copy { white-space: pre-line; overflow-wrap: anywhere; }
.topic-description { margin-bottom: 14px; }
.paper-copy { font-size: var(--materials-font-size); line-height: 1.4; }
.materials { margin-top: 14px; font-size: var(--materials-font-size); line-height: 1.4; }
.materials > summary {
  width: fit-content; max-width: 100%; padding: 4px 0; cursor: pointer;
  font-size: var(--materials-font-size); font-weight: 500;
}
.materials > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.materials ul, .materials .paper-list { margin: 7px 0 0; padding-left: 18px; list-style: disc; }
.materials li { margin: 0 0 7px; padding-left: 2px; overflow-wrap: anywhere; }
.materials li:last-child { margin-bottom: 0; }
.materials li p { margin: 3px 0 0; }
.materials .paper-copy { margin: 0 0 7px; }
.material-note { margin: 8px 0; }
.paper-comment { display: block; margin-top: 2px; font-size: inherit; font-style: italic; }
.rating-controls { display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 18px; }
.rating-button {
  font-size: 10px; line-height: 1.2; padding: 2px 5px; min-height: 22px; white-space: nowrap;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
}
.rating-button:hover { border-color: var(--ink); }
.rating-button[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
#submission { margin: 0 0 32px; font-size: 11pt; }
#submission > p { margin-bottom: 10px; }
.submission-panel { border: 1px solid var(--line); padding: 18px 22px; }
.submission-panel h2 { font-size: 14pt; margin-bottom: 10px; }
.identity-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 16px 0; }
.identity-fields .text-field { margin: 0; }
#student-form { margin: 0; }
#student-form .identity-fields { margin-top: 0; margin-bottom: 18px; }
#student-form .text-field [aria-invalid="true"] { border-bottom-width: 2px; border-bottom-color: var(--ink); }
#student-form .form-status, #student-form .form-error, #student-form .form-success,
#submission-status, #submit-status { margin: 12px 0 0; color: var(--ink); font-size: 10pt; line-height: 1.4; }
#student-form .form-error, #student-form .form-success,
#student-form [role="alert"] { font-weight: 600; }
#student-form .form-status:empty, #student-form .form-error:empty, #student-form .form-success:empty,
#submission-status:empty, #submit-status:empty { display: none; }
.submission-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; font-size: 10pt; }
.primary-button {
  border: 1px solid var(--ink); padding: 2px 8px; min-height: 24px;
  background: var(--ink); color: #fff; font-size: 10pt; line-height: 1.3;
}
.primary-button:hover:not(:disabled) { background: #fff; color: var(--ink); }
.form-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 12px; font-size: 10pt; }
.form-toolbar p { flex-basis: 100%; margin: 0; }
.form-embed { margin-top: 14px; }
.form-embed[hidden] { display: none; }
.google-form-frame { display: block; width: 100%; height: 980px; border: 0; background: #fff; }
.form-loading { margin: 12px 0; font-size: 10pt; line-height: 1.4; }
#form-note { margin-top: 12px; }
.copy-fallback, #manual-copy { margin-top: 16px; font-size: 10pt; }
.copy-fallback summary { width: fit-content; max-width: 100%; padding: 4px 0; cursor: pointer; }
.copy-fallback[open] > summary, .copy-fallback details[open] > summary { margin-bottom: 10px; }
#manual-copy label { display: block; font-size: 10pt; margin-bottom: 3px; }
#copy-text { resize: vertical; font-size: 10pt; }
.selected-topic { padding: 18px 22px; margin-bottom: 24px; }
.selected-topic h2 { font-size: 13pt; margin-bottom: 0; }
.selected-topic .rating-controls { margin-top: 13px; }
.selected-topic h2 a { text-decoration-color: var(--line-strong); }
.selected-topic h2 a:hover { text-decoration-color: var(--ink); }
.empty { border-top: 1px solid var(--line); padding: 24px 0 36px; }
#action-status:empty, #export-status:empty { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 10px; font-size: 10pt; }
.home { padding-top: 92px; }
.year-links { display: flex; flex-wrap: wrap; gap: 18px 38px; margin-top: 28px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 15px; top: -100px; background: #fff; padding: 8px; }
.skip-link:focus { top: 10px; }
@media (max-width: 600px) {
  main { padding: 30px 18px 24px; }
  h1 { font-size: clamp(.9rem, 4.4vw, 1.9rem); }
  .page-header { margin-bottom: 24px; }
  .topic { padding: 19px 12px 21px; margin-bottom: 28px; }
  .selected-topic { padding: 17px 12px; margin-bottom: 22px; }
  .rating-controls { gap: 3px; }
  .rating-button { padding-left: 2px; padding-right: 2px; }
  .submission-panel { padding: 17px; }
  .google-form-frame { height: 1100px; }
  .identity-fields { grid-template-columns: 1fr; gap: 13px; }
  .home { padding-top: 58px; }
}
@media (max-width: 379px) {
  .rating-button { flex: 1 1 0; min-width: 0; white-space: normal; }
}
@media (any-pointer: coarse) {
  .rating-button { min-height: 26px; padding-top: 2px; padding-bottom: 2px; }
  .primary-button { min-height: 26px; }
  .text-button { min-height: 24px; }
  .materials > summary, .copy-fallback summary { min-height: 36px; padding-top: 8px; padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .page-header { transition: none; }
}
@media print {
  body { font-size: 12pt; }
  main { max-width: none; padding: 0; }
  .page-header, .page-header.header-hidden:not(:has(:focus-visible)) { position: static; transform: none; pointer-events: auto; padding: 0; }
  #filters, .collection-nav, #submission, .submission-panel, #rating-help, footer, .course-heading { display: none; }
  .topic { break-inside: avoid; margin-bottom: 16pt; padding: 12pt; }
  .rating-button { display: none; }
  .rating-button[aria-pressed="true"] { display: block; color: #000; background: #fff; }
}
