@font-face {
  font-family: "ET Book";
  src: url("../fonts/et-book/et-book-roman.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "ET Book";
  src: url("../fonts/et-book/et-book-italic.woff2") format("woff2");
  font-display: swap;
  font-style: italic;
  font-weight: 400;
}

@font-face {
  font-family: "ET Book";
  src: url("../fonts/et-book/et-book-bold.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

@font-face {
  font-family: "Roman Antique";
  src: url("../fonts/roman-antique/roman-antique.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Routed Gothic";
  src: url("../fonts/routed-gothic/routed-gothic.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "JuliaMono";
  src: url("../fonts/juliamono/JuliaMono-Regular.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "JuliaMono";
  src: url("../fonts/juliamono/JuliaMono-Bold.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

:root {
  color-scheme: light dark;
  --background: #faf9f6;
  --surface: #ffffff;
  --text: #25241f;
  --muted: var(--text);
  --line: #dedbd1;
  --accent: #9b3d20;
  --accent-soft: #f2e5df;
  --content-width: 46rem;
  --text-stroke: 0.26px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #171714;
    --surface: #201f1b;
    --text: #eeeae0;
    --muted: var(--text);
    --line: #3d3a32;
    --accent: #ef9a7b;
    --accent-soft: #3a2923;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: "ET Book", Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.6;
  -webkit-text-stroke: var(--text-stroke) currentColor;
  text-rendering: optimizeLegibility;
}

code,
kbd,
pre,
samp {
  font-family: "JuliaMono", monospace;
}

pre {
  max-width: 100%;
  overflow-x: auto;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.shell {
  width: min(calc(100% - 2.5rem), var(--content-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.45rem 0.7rem;
  background: var(--text);
  color: var(--background);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.site-name {
  color: var(--text);
  font-family: "Roman Antique", "ET Book", Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.site-nav a {
  font-size: 0.9rem;
  text-decoration: none;
}

main {
  flex: 1;
  padding-block: clamp(1.75rem, 2.75vw, 2.5rem);
}

h1,
h2,
h3 {
  font-family: "Routed Gothic", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h1 {
  max-width: 18ch;
  margin: 0 0 1rem;
  font-size: clamp(1.65rem, 4vw, 1.9rem);
}

h2 {
  margin-top: 2.75rem;
  font-size: clamp(1.25rem, 3vw, 1.4rem);
}

h3 {
  font-size: 1.1rem;
}

p,
ul {
  max-width: 65ch;
}

li + li {
  margin-top: 0.45rem;
}

.page-header {
  margin-bottom: 2rem;
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.lede {
  max-width: 38rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2.5vw, 1.2rem);
  line-height: 1.45;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.86rem;
}

.year-list,
.course-list {
  display: grid;
  gap: 1rem;
  margin-top: 0;
}

.year-card,
.course-card {
  padding: 1.4rem 1.5rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--surface);
}

.year-card h2,
.course-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.year-card p,
.course-card p {
  margin: 0.65rem 0 0;
}

.course-title {
  color: var(--text);
  font-weight: 700;
}

.button {
  display: inline-block;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 0.25rem;
  background: var(--accent-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.material-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.syllabus-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  max-width: 38rem;
}

.pdf-icon-link {
  display: inline-flex;
  flex: none;
  margin-top: 0.1rem;
  text-decoration: none;
}

.pdf-icon {
  width: 1.7rem;
  height: auto;
  overflow: visible;
}

.pdf-icon .pdf-page,
.pdf-icon .pdf-fold {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

.pdf-icon .pdf-badge {
  fill: currentColor;
}

.pdf-icon text {
  fill: var(--background);
  font-family: "JuliaMono", monospace;
  font-size: 7px;
  font-weight: 700;
  text-anchor: middle;
  -webkit-text-stroke: 0;
}

.syllabus blockquote {
  margin-inline: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

#markdown-toc {
  columns: 2 15rem;
  margin: 0 0 2rem;
  padding-left: 1.25rem;
}

#markdown-toc > li {
  break-inside: avoid;
  margin-bottom: 0.45rem;
}

#markdown-toc ul {
  margin-top: 0.35rem;
  padding-left: 1rem;
}

#markdown-toc li + li {
  margin-top: 0.25rem;
}

.syllabus-body h2[id],
.syllabus-body h3[id] {
  scroll-margin-top: 1rem;
}

.back-to-contents {
  display: inline-block;
  margin-left: 0.4rem;
  font-family: "Routed Gothic", Arial, sans-serif;
  font-size: 0.72em;
  line-height: 1;
  text-decoration: none;
  vertical-align: 0.15em;
}

.syllabus table {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
}

.syllabus th,
.syllabus td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.syllabus th {
  font-family: "Routed Gothic", Arial, sans-serif;
  font-weight: 400;
}

.syllabus mjx-container[display="true"] {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.site-footer {
  padding-block: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 34rem) {
  html {
    font-size: 16px;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
    padding-block: 0.75rem;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 0.2rem 0.55rem;
  }

  .site-nav a {
    font-size: 0.8rem;
  }

  #markdown-toc {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
