@charset "UTF-8";

/* ============================================================
   MS&E 319 — variant A, "Reading room"
   Typography and palette follow anaymehrotra.com.
============================================================ */

:root {
  --paper: #fffbf5;
  --ink: #333;
  --ink-strong: #262624;
  --muted: #837f76;
  --link: #2255dd;
  --cardinal: #8C1515;
  --rule: #e2e2e2;
  --rule-soft: #efe9dd;
  --measure: 46em;
  --gutter: clamp(20px, 5vw, 40px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 16px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

a:hover {
  border-bottom-color: rgba(34, 85, 221, 0.4);
}

/* Holds the <symbol> definitions referenced by <use>; never rendered itself. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Navigation ---------- */

.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  border-bottom: 3px solid var(--rule);
  background-color: rgba(255, 251, 245, 0.95);
  backdrop-filter: blur(10px);
}

.navbar ul {
  display: flex;
  justify-content: center;
  gap: 1.6em;
  max-width: 52em;
  margin: 0 auto;
  padding: 0.7em var(--gutter);
  list-style: none;
}

.navbar a {
  border-bottom: 0;
  color: var(--ink);
  font-size: 0.88em;
}

.navbar a:hover {
  color: var(--cardinal);
}

/* Drawer controls. A checkbox drives the mobile menu so it works with no
   JavaScript; the script at the end of the page only closes it after a tap.
   Hidden entirely on desktop. */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.nav-button,
.nav-scrim {
  display: none;
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  scroll-margin-top: 4.5em;
  padding: 2.6em 0;
  border-top: 1px solid var(--rule-soft);
}

section:first-of-type {
  border-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink-strong);
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  margin: 0 0 0.7em;
  font-size: 1.32em;
}

h3 {
  margin: 1.6em 0 0.4em;
  font-size: 1.03em;
}

p {
  margin: 0 0 0.95em;
}

p:last-child {
  margin-bottom: 0;
}

.lede {
  color: #45433e;
}

.note {
  color: var(--muted);
  font-size: 0.88em;
}

/* ---------- Masthead ---------- */

.masthead {
  padding-top: 6.2em;
  border-top: 0;
}

.masthead-grid {
  display: flex;
  align-items: flex-start;
  gap: 2.4em;
}

.masthead-text {
  flex: 1 1 auto;
  min-width: 0;
}

.kicker {
  margin: 0 0 0.5em;
  color: var(--cardinal);
  font-size: 0.8em;
  letter-spacing: 0.05em;
}

.kicker .sep {
  padding: 0 0.35em;
  font-size: 0.72em;
  vertical-align: 0.15em;
}

h1 {
  margin: 0 0 0.35em;
  font-size: 2.15em;
  letter-spacing: -0.01em;
}

.masthead .lede {
  margin-bottom: 0;
  font-size: 1.04em;
}

.mask-figure {
  flex: 0 0 auto;
  width: 132px;
  margin: 0;
  text-align: center;
}

.mask-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.mask-caption {
  margin-top: 0.6em;
  color: var(--muted);
  font-size: 0.72em;
  line-height: 1.35;
}

/* ---------- Facts ---------- */

.facts {
  margin: 1.8em 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.facts li {
  display: flex;
  gap: 1em;
  padding: 0.5em 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.93em;
}

.facts dt,
.fact-label {
  flex: 0 0 8.5em;
  color: var(--muted);
}

.tbd {
  color: var(--cardinal);
  font-size: 0.85em;
  letter-spacing: 0.03em;
}

/* ---------- Lists ---------- */

.dash {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash li {
  position: relative;
  margin-bottom: 0.45em;
  padding-left: 1.15em;
}

.dash li::before {
  position: absolute;
  left: 0;
  color: var(--muted);
  content: "–";
}

.dash li:last-child {
  margin-bottom: 0;
}

/* ---------- Pipeline figure ---------- */

.pipeline {
  margin: 1.8em 0 0;
}

.stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stages > li {
  padding-top: 0.5em;
  border-top: 1.5px solid var(--cardinal);
}

.s-num {
  display: block;
  margin-bottom: 0.1em;
  color: var(--cardinal);
  font-size: 0.74em;
  letter-spacing: 0.08em;
}

.stages h4 {
  margin: 0 0 0.35em;
  color: var(--ink-strong);
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1.25;
}

.s-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.s-items li {
  color: var(--muted);
  font-size: 0.85em;
  line-height: 1.5;
}

figcaption {
  margin-top: 0.7em;
  color: var(--muted);
  font-size: 0.82em;
}

/* ---------- Figure band ---------- */

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 2em 2.4em;
  margin-top: 1.3em;
}

.figures figure {
  margin: 0;
}

.figures svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
}

.figures .f-small {
  fill: var(--muted);
  font-size: 10px;
}

.figures .f-label {
  fill: var(--ink-strong);
  font-size: 12px;
}

/* One entry in the band is set as an equation rather than drawn. The aspect
   ratio matches the SVGs so captions share a baseline across the row. */
.figures .eq {
  display: flex;
  flex-direction: column;
  justify-content: center;
  aspect-ratio: 300 / 140;
}

.eq-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78em;
  line-height: 1.4;
}

.eq-line {
  margin: 0.15em 0 0.7em;
  font-size: 1.05em;
}

.eq-hi {
  color: var(--cardinal);
  font-style: italic;
}

.eq-gap {
  display: inline-block;
  width: 1.5em;
}

.figures figcaption {
  margin-top: 0.6em;
  font-size: 0.8em;
  line-height: 1.5;
}

.fig-title {
  display: block;
  color: var(--ink-strong);
  font-weight: 700;
}

.figures figcaption a {
  color: var(--cardinal);
  white-space: nowrap;
}

/* ---------- Two-column blocks ---------- */

/* Left column carries the longer entries, so it gets the extra width. */
.cols {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.4em 2.8em;
}

.cols h3 {
  margin-top: 0;
}

/* Reference material, so it sits a step below the reading text. */
#resources .dash {
  font-size: 0.92em;
}

#resources h3 {
  font-size: 0.98em;
}

/* Secondary links — present, but not competing with the reading list. */
.quiet-links a {
  color: inherit;
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-color: #cdc6b8;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

.quiet-links a:hover {
  color: var(--cardinal);
  text-decoration-color: var(--cardinal);
}

/* ---------- Schedule ---------- */

.week {
  display: grid;
  grid-template-columns: 8em 1fr;
  gap: 0 1.4em;
  padding: 0.95em 0;
  border-bottom: 1px solid var(--rule-soft);
}

.week:first-of-type {
  border-top: 1px solid var(--rule);
}

.schedule-unit {
  margin: 2.2em 0 0;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--rule);
  color: var(--cardinal);
  font-size: 0.95em;
}

.schedule-unit + .week {
  border-top: 0;
}

.week-num {
  color: var(--cardinal);
  font-size: 0.85em;
}

.week-date {
  display: block;
  color: var(--muted);
  font-size: 0.92em;
}

.week-topic {
  margin: 0 0 0.15em;
  color: var(--ink-strong);
  font-size: 1.02em;
  font-weight: 700;
  line-height: 1.3;
}

.week-theme {
  margin: 0 0 0.4em;
  color: var(--muted);
  font-size: 0.83em;
  letter-spacing: 0.02em;
}

.lecture-topics {
  margin: 0.45em 0 0;
  padding-left: 1.35em;
  color: var(--muted);
  font-size: 0.9em;
}

.lecture-topics li {
  margin-bottom: 0.12em;
  padding-left: 0.15em;
}

.lecture-topics li::marker {
  color: var(--cardinal);
}

details.lecture-details {
  margin-top: 0.5em;
}

details.lecture-details > summary {
  width: fit-content;
  color: var(--cardinal);
  cursor: pointer;
  font-size: 0.85em;
  list-style: none;
}

details.lecture-details > summary::-webkit-details-marker {
  display: none;
}

details.lecture-details > summary::before {
  display: inline-block;
  width: 1em;
  content: "+";
}

details.lecture-details[open] > summary::before {
  content: "–";
}

details.lecture-details > summary:hover {
  text-decoration: underline;
}

details.lecture-details > summary:focus-visible {
  outline: 2px solid var(--cardinal);
  outline-offset: 3px;
}

.readings {
  margin: 0;
  padding: 0;
  font-size: 0.9em;
  list-style: none;
}

.readings li {
  margin-bottom: 0.2em;
}

.week--break {
  color: var(--muted);
  font-style: italic;
}

.week--break .week-topic {
  color: var(--muted);
  font-weight: 400;
}

details.extended {
  margin-top: 0.5em;
}

details.extended > summary {
  color: var(--cardinal);
  cursor: pointer;
  font-size: 0.85em;
  list-style: none;
}

details.extended > summary::-webkit-details-marker {
  display: none;
}

details.extended > summary::before {
  display: inline-block;
  width: 1em;
  content: "+";
}

details.extended[open] > summary::before {
  content: "–";
}

details.extended > summary:hover {
  text-decoration: underline;
}

details.extended > summary:focus-visible {
  outline: 2px solid var(--cardinal);
  outline-offset: 3px;
}

details.extended .readings {
  margin-top: 0.35em;
  padding-left: 1em;
  border-left: 1px solid var(--rule);
}

/* ---------- Grading ---------- */

.grading {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.grading li {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  padding: 0.5em 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.95em;
}

.grading .weight {
  flex: 0 0 auto;
  color: var(--cardinal);
}

/* ---------- Instructors ---------- */

.people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2em;
  margin-top: 0.5em;
}

.person img {
  display: block;
  width: 96px;
  height: 96px;
  margin-bottom: 0.7em;
  border-radius: 0.35em;
  object-fit: cover;
}

.person h3 {
  margin: 0 0 0.1em;
  font-size: 1.02em;
}

.person .role {
  margin-bottom: 0.4em;
  color: var(--muted);
  font-size: 0.88em;
}

.person p {
  font-size: 0.92em;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2em 0 3em;
  border-top: 3px solid var(--rule);
  color: var(--muted);
  font-size: 0.86em;
}

.site-footer p {
  margin-bottom: 0.3em;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  section {
    scroll-margin-top: 1em;
  }

  .nav-button {
    position: fixed;
    top: 13px;
    left: 15px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 30px;
    padding: 4px;
    cursor: pointer;
  }

  .nav-button span {
    display: block;
    height: 2px;
    background-color: var(--ink);
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .nav-toggle:checked ~ .nav-button span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle:checked ~ .nav-button span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked ~ .nav-button span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-toggle:focus-visible ~ .nav-button {
    outline: 2px solid var(--cardinal);
    outline-offset: 3px;
  }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: block;
    background-color: rgba(38, 38, 36, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .nav-toggle:checked ~ .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .navbar {
    right: auto;
    bottom: 0;
    z-index: 200;
    width: min(72vw, 248px);
    border-right: 3px solid var(--rule);
    border-bottom: 0;
    background-color: var(--paper);
    backdrop-filter: none;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .nav-toggle:checked ~ .navbar {
    transform: translateX(0);
  }

  .navbar ul {
    flex-direction: column;
    gap: 0.1em;
    padding: 4.4em 1.4em 1.4em;
  }

  .navbar a {
    display: block;
    padding: 0.42em 0;
    font-size: 1em;
  }

  .masthead {
    padding-top: 3.9em;
  }

  .masthead-grid {
    flex-direction: column;
    gap: 1.6em;
  }

  .mask-figure {
    width: 108px;
    text-align: left;
  }

  h1 {
    font-size: 1.8em;
  }

  .facts li {
    flex-direction: column;
    gap: 0.1em;
  }

  .facts .fact-label {
    flex-basis: auto;
    font-size: 0.86em;
  }

  .stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week {
    grid-template-columns: 1fr;
    gap: 0.35em;
  }

  .week-head {
    display: flex;
    align-items: baseline;
    gap: 0.7em;
  }

  .week-date {
    display: inline;
  }

  .people {
    grid-template-columns: 1fr;
    gap: 1.6em;
  }

  /* Explicit, since .cols no longer uses auto-fit to collapse itself. */
  .cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .stages {
    grid-template-columns: 1fr;
  }
}
