:root {
  --accent: #003366;
  --light: #f8f9fa;
  --dark: #111;
  --banner-height: 4.5rem;
}

/* Reset & typography */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

/* Banner & Navigation */
.banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.banner h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
}
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
nav li { margin-right: 1rem; }
nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}
nav a:hover { text-decoration: underline; }

/* Main content */
main {
  max-width: 960px;
  margin: 1rem auto;
  padding: 0 1rem;
}
section {
  padding-top: 4rem; /* offset for sticky nav */
  margin-top: -4rem; /* negative top margin to balance anchor offset */
  margin-bottom: 2.5rem;
}
h2 { border-bottom: 2px solid var(--accent); padding-bottom: 0.25rem; }

/* Schedule table */
table.schedule {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
table.schedule th,
table.schedule td {
  border: 1px solid #ddd;
  padding: 0.5rem;
  text-align: left;
}
table.schedule th { background: #e9ecef; }

/* Footer */
footer {
  text-align: center;
  padding: 1rem 0 3rem;
  font-size: 0.9rem;
  background: #eee;
  position: relative;
}
.back-to-top {
  display: inline-block;
  margin-left: 0.5rem;
  text-decoration: none;
  font-weight: bold;
  color: var(--accent);
}
.back-to-top:hover { text-decoration: underline; }

/* Overview: body text with a figure alongside */
.overview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  align-items: flex-start;
}
.overview-text {
  flex: 1 1 20rem;
  min-width: 0;
}
.overview-text p:first-child { margin-top: 0; }
.overview-figure {
  flex: 0 1 8rem;
  margin: 0;
}
.overview-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.overview-figure figcaption,
.formula-figure figcaption,
.syllabus-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #555;
  text-align: center;
}
@media (max-width: 640px) {
  .overview-figure { flex-basis: 100%; }
  .overview-figure img { max-width: 20rem; margin: 0 auto; }
}

/* Floated figure inside the syllabus */
.syllabus-block { overflow: hidden; }
.syllabus-figure {
  float: right;
  width: 13rem;
  max-width: 40%;
  margin: 0.25rem 0 1rem 1.75rem;
}
.syllabus-figure img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 640px) {
  .syllabus-figure {
    float: none;
    width: 100%;
    max-width: 17rem;
    margin: 1rem auto;
  }
}

/* Instructor headshot */
.headshot {
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 51, 102, 0.18);
}

/* Wide formula band */
.formula-figure {
  margin: 1.5rem auto;
  max-width: 32rem;
}
.formula-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Schedule footnote */
.footnote {
  margin: 1rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid #ddd;
  font-size: 0.85rem;
  color: #555;
}
