:root {
  /* UCLA palette: https://brand.ucla.edu/identity/colors */
  --ucla-blue: #2774ae;
  --ucla-gold: #ffd100;
  --link-blue: #005587;
  --ink: #243746;
  --muted: #5e6b75;
  --surface: #f5f7f9;
  --line: #dce3e9;
  --anchor-offset: 104px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--anchor-offset);
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link-blue);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--ucla-blue);
  outline-offset: 5px;
}

.container {
  width: min(1080px, calc(100% - 64px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 20;
  padding: 10px 18px;
  transform: translateY(-160%);
  background: #fff;
  color: var(--link-blue);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ucla-blue);
  border-bottom: 3px solid var(--ucla-gold);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 80px;
  gap: 32px;
}

.university-brand,
.lab-brand {
  display: flex;
  align-items: center;
  width: fit-content;
}

.university-brand img {
  display: block;
  width: 105px;
  height: auto;
}

.lab-brand {
  justify-self: end;
}

.lab-brand img {
  display: block;
  width: 144px;
  height: auto;
}

.course-nav ul {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-nav a {
  display: block;
  padding-block: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.course-nav li {
  margin: 0;
}

.course-nav a:hover {
  color: var(--ucla-gold);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.site-header :focus-visible {
  outline-color: var(--ucla-gold);
}

.course-heading {
  padding-block: 55px 42px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-weight: 500;
}

.course-number {
  display: block;
  margin-bottom: 14px;
  color: var(--link-blue);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.course-title {
  display: block;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.course-term {
  margin: 20px 0 0;
  font-size: 19px;
  font-weight: 500;
}

.course-term span {
  margin-inline: 9px;
  color: #80909b;
  font-weight: 400;
}

.course-status {
  margin: 8px 0 0;
  font-size: 18px;
}

.section {
  padding-block: 36px 40px;
}

.section-shaded {
  background: var(--surface);
}

h2 {
  margin: 0 0 22px;
  color: var(--ucla-blue);
  font-size: 25px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

h3 {
  margin: 24px 0 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

h2 + h3 {
  margin-top: 0;
}

p {
  margin: 0 0 14px;
}

ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

li + li {
  margin-top: 5px;
}

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

#staff {
  text-align: center;
}

.staff-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.staff-member {
  width: 158px;
  margin: 0;
  text-align: center;
}

.portrait-placeholder,
.staff-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 106px;
  height: 106px;
  margin: 0 auto 13px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  object-fit: cover;
}

.staff-name {
  margin: 0 0 3px;
  color: var(--link-blue);
  font-size: 18px;
  font-weight: 700;
}

.staff-role {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.logistics-list {
  margin: 0;
}

.logistics-list > div {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 16px;
  margin-top: 9px;
}

.logistics-list dt {
  font-weight: 600;
}

.logistics-list dd {
  margin: 0;
}

.policy-list li {
  margin-top: 8px;
}

strong {
  font-weight: 600;
}

.schedule-note {
  margin: 24px 0 0;
}

.schedule-section {
  padding-bottom: 64px;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
}

.section-note {
  font-size: 18px;
}

.table-scroll {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  background: #fff;
  text-align: left;
  font-size: 16px;
}

table time {
  white-space: nowrap;
}

thead {
  background: #edf2f6;
  color: var(--ink);
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-weight: 600;
}

#schedule col + col {
  border-left: 1px solid #e9edf1;
}

#schedule .date-column {
  width: 12%;
}

.lecture-date {
  font-weight: 400;
}

#schedule .topic-column {
  width: 32%;
}

#schedule .due-column {
  width: 7rem;
}

#schedule .due-cell {
  padding-inline: 12px;
}

.lecture-group {
  border-bottom: 1px solid var(--line);
}

.lecture-group th,
.lecture-group td {
  border-bottom: 0;
}

.lecture-group tr + tr > * {
  border-top: 1px solid #e9edf1;
}

.topic-cell {
  font-weight: 400;
}

.reading-cell p {
  margin: 0;
}

.reading-cell p + p {
  margin-top: 10px;
}

.reading-cell a {
  overflow-wrap: anywhere;
}

.session-part {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.lecture-group:nth-of-type(even) {
  background: #fafbfc;
}

.lecture-group:last-of-type {
  border-bottom: 0;
}

.scroll-hint {
  display: none;
  font-size: 13px;
}

.site-footer {
  padding-block: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer-inner p {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1024px) {
  :root {
    --anchor-offset: 145px;
  }

  .header-inner {
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
    padding-top: 6px;
  }

  .university-brand img {
    width: 92px;
  }

  .lab-brand {
    grid-column: 2;
    grid-row: 1;
  }

  .lab-brand img {
    width: 124px;
  }

  .course-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid rgb(255 255 255 / 25%);
  }

  .course-nav ul {
    justify-content: space-between;
    gap: 12px;
  }

  .course-nav a {
    padding-block: 10px;
  }
}

@media (max-width: 1026px) {
  .scroll-hint {
    display: block;
    margin-bottom: 0;
  }

  .table-scroll {
    margin-top: 12px;
  }
}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 40px);
  }

  .course-nav ul {
    gap: 8px;
  }

  .course-nav a {
    font-size: 15px;
  }

  .course-heading {
    padding-block: 36px 30px;
  }

  .course-number {
    max-width: 260px;
    margin-inline: auto;
    font-size: 15px;
    line-height: 1.5;
  }

  .course-title {
    font-size: clamp(27px, 6.7vw, 36px);
  }

  .title-break {
    display: none;
  }

  .course-term {
    font-size: 17px;
  }

  .section {
    padding-block: 28px 32px;
  }

  h2 {
    font-size: 23px;
  }

  .staff-list {
    gap: 28px 16px;
  }

  .staff-member {
    width: calc((100% - 16px) / 2);
    max-width: 158px;
  }

  .logistics-list > div {
    grid-template-columns: 1fr;
    gap: 1px;
    margin-top: 15px;
  }

  th,
  td {
    padding: 12px 14px;
  }
}

@media (max-width: 600px) {
  :root {
    --anchor-offset: 165px;
  }

  .course-nav ul {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0 16px;
  }
}

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

@media print {
  html {
    scroll-padding-top: 0;
  }

  .site-header,
  .skip-link,
  .scroll-hint,
  .site-footer {
    display: none;
  }

  .container {
    width: 100%;
  }

  .course-heading,
  .section {
    padding-block: 16px;
  }

  .section-shaded {
    background: transparent;
  }

  .table-scroll {
    overflow: visible;
  }

  table {
    min-width: 0;
  }

  tr,
  .staff-member {
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }
}
