:root {
  --penn-blue: #011f5b;
  --penn-blue-deep: #07132d;
  --penn-red: #990000;
  --penn-red-bright: #bd3030;
  --paper: #f7f4ee;
  --white: #ffffff;
  --ink: #121d35;
  --muted: #5a6478;
  --line: #ccd3df;
  --line-dark: rgb(255 255 255 / 0.2);
  --soft-blue: #edf2f9;
  --max-width: 76rem;
  --font: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
a { color: var(--penn-blue); text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; }
a:hover { color: var(--penn-red); }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.02; text-wrap: balance; }
h2 { font-size: clamp(2.1rem, 5vw, 4.5rem); letter-spacing: -0.055em; }
p { margin: 0 0 1.1rem; }
:focus-visible { outline: 3px solid var(--penn-red-bright); outline-offset: 4px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 1200;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-170%);
  border-radius: 999px;
  color: var(--white);
  background: var(--penn-red);
}
.skip-link:focus { transform: translateY(0); }
.container { width: min(var(--max-width), calc(100% - 2.5rem)); margin-inline: auto; }
section { scroll-margin-top: 4.4rem; }

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  color: var(--white);
  background: rgb(7 19 45 / 0.96);
  border-bottom: 1px solid var(--line-dark);
  backdrop-filter: blur(16px);
}
.site-header::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: var(--penn-red);
}
.header-inner {
  display: flex;
  width: min(var(--max-width), calc(100% - 2.5rem));
  min-height: 4.4rem;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: var(--white);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark:hover { color: var(--white); }
.penn-engineering-logo { display: block; width: 7.6rem; height: auto; }
.course-wordmark { padding-left: 0.75rem; border-left: 1px solid rgb(255 255 255 / 0.34); }
.term-nav { display: flex; align-items: center; gap: 0.5rem; }
.term-nav a {
  padding: 0.48rem 0.86rem;
  border: 1px solid rgb(255 255 255 / 0.66);
  border-radius: 999px;
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
}
.term-nav a:hover, .term-nav a[aria-current="page"] { color: var(--penn-blue-deep); background: var(--white); }

.hero {
  position: relative;
  display: grid;
  min-height: calc(100svh - 4.4rem);
  overflow: hidden;
  align-items: center;
  color: var(--white);
  background: linear-gradient(140deg, var(--penn-blue) 0%, var(--penn-blue-deep) 58%, #19090f 100%);
  isolation: isolate;
}
.hero-animation { position: absolute; z-index: -3; inset: 0; width: 100%; height: 100%; }
.hero-wash {
  position: absolute;
  z-index: -2;
  inset: 0;
  background: linear-gradient(90deg, rgb(1 31 91 / 0.38) 0%, rgb(7 19 45 / 0.08) 68%, rgb(153 0 0 / 0.12) 100%);
  pointer-events: none;
}
.hero-content { padding-block: clamp(3.8rem, 7vw, 6rem); }
.eyebrow {
  margin-bottom: 0.8rem;
  color: var(--penn-red);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #e47c7c; }
.hero h1 {
  max-width: 57rem;
  margin: 0;
  font-size: clamp(3.8rem, 9.2vw, 8.2rem);
  line-height: 0.86;
  letter-spacing: -0.072em;
}
.hero-lede {
  max-width: 47rem;
  margin: 1.8rem 0 1.7rem;
  color: #dbe4f5;
  font-size: clamp(1.02rem, 2.2vw, 1.35rem);
  line-height: 1.55;
}
.hero-facts {
  display: flex;
  max-width: 60rem;
  margin: 0 0 2rem;
  flex-wrap: wrap;
  gap: 0.9rem 2rem;
}
.hero-facts div { display: flex; gap: 0.42rem; }
.hero-facts dt { color: #9eb1d4; font-size: 0.82rem; }
.hero-facts dt::after { content: ":"; }
.hero-facts dd { margin: 0; font-size: 0.82rem; font-weight: 500; }
.button {
  display: inline-flex;
  min-height: 2.9rem;
  padding: 0.65rem 1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
}
.button-light { color: var(--penn-blue-deep); background: var(--white); }
.button-light:hover { color: var(--white); border-color: var(--penn-red-bright); background: var(--penn-red-bright); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; }
.hf-button {
  display: inline-flex;
  min-height: 2.9rem;
  padding: 0.55rem 0.9rem;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgb(255 255 255 / 0.72);
  border-radius: 999px;
  color: var(--penn-blue-deep);
  background: var(--white);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.hf-button:hover { transform: translateY(-2px); border-color: #ffcc4d; color: var(--penn-blue-deep); background: #ffecb5; }
.hf-logo { width: 1.55rem; height: 1.55rem; flex: 0 0 auto; }
.scroll-cue {
  position: absolute;
  right: 1.8rem;
  bottom: 1.5rem;
  color: #dbe4f5;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}
.scroll-cue:hover { color: var(--white); }

.section { padding: clamp(4.5rem, 8vw, 7.6rem) 0; }
.section-paper { background: var(--paper); }
.section-white { background: var(--white); }
.content-grid, .section-heading, .links-inner {
  display: grid;
  grid-template-columns: minmax(15rem, 0.78fr) minmax(20rem, 1.22fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: start;
}
.section-intro { position: sticky; top: 7rem; }
#overview .section-intro { position: static; align-self: center; }
.section-heading { margin-bottom: 2.8rem; }
.section-heading > div:last-child > p, .section-heading > p, .compact-heading > p { color: var(--muted); }
.section-heading .text-link { margin-top: 0.35rem; }
.syllabus-download { align-self: end; justify-self: end; }
.prose { max-width: 48rem; }
.prose p { color: var(--muted); }
.prose .lead { color: var(--ink); font-size: clamp(1.2rem, 2.5vw, 1.55rem); line-height: 1.55; }
.fact-list { margin: 2.3rem 0 0; border-top: 1px solid var(--line); }
.fact-list div {
  display: grid;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
}
.fact-list dt { color: var(--penn-red); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; }
.fact-list dd { margin: 0; }
.fact-list a { color: var(--penn-blue); font-weight: 500; overflow-wrap: anywhere; }
.text-link { display: inline-block; color: var(--penn-red); font-weight: 700; }

.table-shell { border-top: 3px solid var(--penn-blue); }
.schedule-table { width: 100%; border-collapse: collapse; text-align: left; }
.schedule-table th {
  padding: 0.85rem 0.8rem;
  border-bottom: 1px solid var(--penn-blue);
  color: var(--penn-blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.schedule-table td { padding: 1rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.schedule-table td:first-child { width: 8.6rem; font-size: 0.8rem; font-weight: 500; white-space: nowrap; }
.schedule-table td:nth-child(2) { width: 6.8rem; }
.schedule-table td:nth-child(3) strong, .schedule-table td:nth-child(3) span, .schedule-table td:nth-child(3) em { display: block; }
.schedule-table td:nth-child(3) strong { line-height: 1.35; }
.schedule-table td:nth-child(3) span { margin-top: 0.28rem; color: var(--muted); font-size: 0.88rem; line-height: 1.52; }
.schedule-table tr.is-next { background: linear-gradient(90deg, rgb(1 31 91 / 0.08), transparent 76%); }
.next-marker {
  display: inline-block;
  margin: 0 0.42rem 0.22rem 0;
  padding: 0.1rem 0.38rem;
  border-radius: 999px;
  color: var(--white);
  background: var(--penn-red);
  font-size: 0.55rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.type-pill {
  display: inline-block;
  padding: 0.16rem 0.44rem;
  border: 1px solid #aeb8c9;
  border-radius: 999px;
  color: var(--penn-blue);
  background: var(--soft-blue);
  font-size: 0.64rem;
  font-weight: 500;
  text-transform: capitalize;
}
.type-exam, .type-defense { color: var(--penn-red); border-color: #d5a7a7; background: #fbefef; }
.type-break { color: var(--muted); border-color: var(--line); background: var(--paper); }
.type-review { color: #365174; }
.schedule-milestone { margin-top: 0.5rem; color: var(--penn-red); font-size: 0.78rem; font-style: normal; font-weight: 500; }
.materials-cell { width: 9rem; }
.materials-cell > .muted { display: block; text-align: center; }
.material-note { display: block; margin-bottom: 0.35rem; color: var(--muted); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.35; }
.mini-link { display: block; margin-bottom: 0.25rem; color: var(--penn-red); font-size: 0.75rem; font-weight: 700; }
.muted { color: #8a93a5; }

.compact-heading { align-items: end; }
.project-list {
  border-top: 3px solid var(--penn-blue);
}
.project-item {
  display: grid;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(14rem, 0.8fr) minmax(0, 1.4fr);
  gap: 2rem;
}
.project-heading, .project-details { min-width: 0; }
.project-weight { margin: 0 0 0.35rem; color: var(--penn-red); font-size: 1.7rem; font-weight: 700; line-height: 1; }
.project-heading h3 { margin: 0; font-size: 1.18rem; }
.project-status { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.74rem; font-weight: 500; text-transform: uppercase; }
.project-details > p { margin: 0 0 1rem; color: var(--muted); }
.project-details dl { display: flex; margin: 0 0 0.9rem; flex-wrap: wrap; gap: 0.8rem 2rem; }
.project-details dt { color: var(--muted); font-size: 0.68rem; text-transform: uppercase; }
.project-details dd { margin: 0.1rem 0 0; font-size: 0.84rem; font-weight: 500; }
.project-details .text-link { color: var(--penn-red); font-size: 0.82rem; font-weight: 700; }

.staff-list { display: grid; border-top: 3px solid var(--penn-blue); grid-template-columns: repeat(2, minmax(0, 1fr)); }
#staff .section-heading { grid-template-columns: minmax(0, 1fr) auto; }
#staff-heading { white-space: nowrap; }
.lab-link {
  display: inline-flex;
  min-height: 3rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  align-items: center;
  justify-self: end;
  gap: 0.55rem;
  border: 1px solid var(--line);
  color: var(--penn-red);
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.lab-link:hover { transform: translateY(-2px); border-color: var(--penn-red); color: var(--penn-red); }
.lab-link img { width: 2.3rem; height: 2.3rem; object-fit: contain; }
.staff-person {
  display: grid;
  min-width: 0;
  padding: 1.35rem 1.35rem 1.35rem 0;
  grid-template-columns: clamp(7.5rem, 12vw, 10rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.15rem;
}
.staff-person:nth-child(even) { padding-right: 0; padding-left: 1.35rem; border-left: 1px solid var(--line); }
.staff-person:nth-child(n + 3) { border-top: 1px solid var(--line); }
.staff-photo { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--soft-blue); }
.staff-details { min-width: 0; }
.staff-person .role { margin: 0 0 0.45rem; color: var(--penn-red); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.staff-person h3 { margin: 0 0 0.4rem; font-size: 1.25rem; letter-spacing: -0.025em; }
.staff-person .affiliation { color: var(--muted); font-size: 0.86rem; white-space: pre-line; }
.staff-person dl { margin: 1rem 0 0; }
.staff-person dl div + div { margin-top: 0.75rem; }
.staff-person dt { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; }
.staff-person dd { margin: 0.08rem 0 0; overflow-wrap: anywhere; font-size: 0.84rem; font-weight: 500; }

.course-links { padding: 3.6rem 0; color: var(--white); background: var(--penn-blue); }
.course-links h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.course-links .eyebrow { color: #e47c7c; }
.course-links p { margin: 0; color: #dce5f6; }
.course-links a { color: var(--white); font-weight: 700; }
.course-links a:hover { color: #ffadad; }
.site-footer { padding: 2rem 0; color: #bac8e1; background: var(--penn-blue-deep); }
.footer-inner { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.site-footer p { margin: 0; font-size: 0.76rem; }
.site-footer strong { color: var(--white); font-size: 0.9rem; }

@media (max-width: 64rem) {
  .content-grid, .section-heading, .links-inner { grid-template-columns: 1fr; gap: 1.4rem; }
  .section-intro { position: static; }
  .syllabus-download { justify-self: start; }
  #staff .section-heading { grid-template-columns: 1fr; }
  #staff-heading { white-space: normal; }
  .lab-link { justify-self: start; }
  .staff-person { grid-template-columns: 7rem minmax(0, 1fr); }
}

@media (max-width: 48rem) {
  .container, .header-inner { width: min(100% - 1.5rem, var(--max-width)); }
  .hero { min-height: calc(100svh - 4.4rem); }
  .hero-content { padding-block: 4.2rem 5.6rem; }
  .hero h1 { font-size: clamp(3.65rem, 18vw, 6rem); }
  .hero-facts { display: grid; gap: 0.35rem; }
  .scroll-cue { display: none; }
  .section { padding: 4rem 0; }
  .project-item { grid-template-columns: 1fr; gap: 0.9rem; }
  .staff-list { grid-template-columns: 1fr; }
  .staff-person, .staff-person:nth-child(even) { padding: 1.2rem 0; border-top: 1px solid var(--line); border-left: 0; }
  .staff-person:first-child { border-top: 0; }
  .table-shell { border-top: 0; }
  .schedule-table, .schedule-table tbody, .schedule-table tr, .schedule-table td { display: block; width: 100%; }
  .schedule-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .schedule-table tr { margin-bottom: 0.85rem; padding: 1rem; border-top: 3px solid var(--penn-blue); background: var(--paper); }
  .schedule-table tr.is-next { border-top-color: var(--penn-red); background: var(--soft-blue); }
  .schedule-table td, .schedule-table td:first-child, .schedule-table td:nth-child(2), .materials-cell {
    width: 100%;
    padding: 0.28rem 0 0.28rem 5.8rem;
    border: 0;
    white-space: normal;
  }
  .schedule-table td::before {
    position: absolute;
    margin-left: -5.8rem;
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .mini-link { display: inline-block; margin-right: 0.8rem; }
  .materials-cell > .muted { text-align: left; }
  .footer-inner { align-items: start; flex-direction: column; gap: 1rem; }
}

@media (max-width: 23rem) {
  .wordmark { gap: 0.5rem; font-size: 0.9rem; }
  .penn-engineering-logo { width: 6.1rem; }
  .course-wordmark { display: none; }
  .term-nav a { padding-inline: 0.65rem; font-size: 0.76rem; }
  .hero h1 { font-size: 3.35rem; }
}

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

@media print {
  .site-header, .hero-animation, .hero-wash, .scroll-cue, .button, .course-links, .site-footer { display: none !important; }
  .hero { min-height: 0; color: #000; background: #fff; }
  .hero-content, .section { padding: 1rem 0; }
  .hero h1 { font-size: 40pt; }
  .hero .eyebrow, .hero-lede, .hero-facts dt, .hero-facts dd { color: #000; }
  .container { width: 100%; }
  .schedule-table td, .schedule-table th { padding: 0.4rem; color: #000; }
}
