:root {
  --maize: #ffcb05;
  --blue: #00274c;
  --darkgreen: #003300;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg-soft: #f7f8fa;
  --blue-soft: #eef4fa;
  --maize-soft: #fff8d8;
}

* { box-sizing: border-box; }

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

a { color: var(--blue); }

/* ---- Top bar ---- */
#top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.9rem 5%;
  background: var(--blue);
  border-bottom: 4px solid var(--maize);
}

#top-bar a { color: #fff; text-decoration: none; }
#top-bar-name { font-size: 1.05rem; }
#top-bar-name strong { color: var(--maize); }

#top-bar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
#top-bar-links a:hover { color: var(--maize); }

/* ---- Layout ---- */
#content-root {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 5% 4rem;
}

.section { margin-top: 2.5rem; }
.section h2 {
  border-bottom: 2px solid var(--maize);
  padding-bottom: 0.3rem;
}

/* ---- Hero ---- */
.hero {
  padding: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--line);
}
.hero h1 { margin: 0; font-size: 2rem; color: var(--blue); }
.hero .subtitle { margin: 0.4rem 0 0; color: var(--muted); font-size: 1.1rem; }

/* ---- Logistics ---- */
.logistics-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.logistics-list li {
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--line);
}

/* ---- Staff ---- */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.staff-card {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem;
  background: linear-gradient(135deg, #fff 0%, var(--bg-soft) 100%);
  box-shadow: 0 5px 18px rgba(0, 39, 76, 0.07);
}
.staff-photo {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #fff;
  outline: 3px solid var(--maize);
  box-shadow: 0 3px 12px rgba(0, 39, 76, 0.18);
}
.staff-role {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.staff-name { font-size: 1.15rem; font-weight: 600; margin-top: 0.2rem; }
.staff-details a { font-size: 0.92rem; }
.staff-office-hours { margin-top: 0.55rem; font-size: 0.88rem; line-height: 1.45; }

/* ---- Resources and policies ---- */
.resource-grid,
.policy-grid {
  display: grid;
  gap: 1rem;
}
.resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.policy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.resource-card,
.policy-card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}
.resource-card { border-top: 4px solid var(--blue); }
.policy-card { border-left: 4px solid var(--maize); }
.resource-card h3,
.policy-card h3 { margin: 0 0 0.35rem; color: var(--blue); }
.resource-card p,
.policy-card p { margin: 0.35rem 0 0; }
.resource-card a { display: inline-block; margin-top: 0.65rem; font-weight: 600; }
.resource-access { color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.syllabus-note {
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--maize);
  border-radius: 0 8px 8px 0;
  background: var(--maize-soft);
}

/* ---- Schedule ---- */
.schedule-intro { max-width: 760px; }
.course-schedule {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(0, 39, 76, 0.06);
}
.course-schedule th {
  padding: 0.7rem 1rem;
  color: #fff;
  background: var(--blue);
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.course-schedule td {
  padding: 0.78rem 1rem;
  border-top: 1px solid var(--line);
}
.course-schedule tbody tr:first-child td { border-top: 0; }
.course-schedule tbody tr:nth-child(even) { background: var(--bg-soft); }
.course-schedule tbody tr:hover { background: var(--blue-soft); }
.schedule-status-heading,
.schedule-status-cell {
  position: relative;
  width: 48px;
  min-width: 48px;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
}
.schedule-status-heading-dot,
.schedule-status-dot {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 2px solid #c7d0da;
  border-radius: 50%;
  background: #fff;
  vertical-align: middle;
}
.schedule-status-heading-dot {
  width: 8px;
  height: 8px;
  border: 0;
  background: var(--maize);
  box-shadow: 0 0 0 4px rgba(255, 203, 5, 0.18);
}
.schedule-status-cell::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  background: #dce2e8;
}
.course-schedule tbody tr:first-child .schedule-status-cell::before { top: 50%; }
.course-schedule tbody tr:last-child .schedule-status-cell::before { bottom: 50%; }
.schedule-row.is-complete .schedule-status-cell::before { background: #7188a0; }
.schedule-row.is-complete .schedule-status-dot {
  border-color: var(--blue);
  background: var(--blue);
}
.schedule-row.is-complete .schedule-status-dot::after {
  content: "\2713";
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.schedule-row.is-complete .schedule-date,
.schedule-row.is-complete .schedule-topic { color: #66717d; }
.schedule-row.is-next {
  background: linear-gradient(90deg, var(--maize-soft), #fff 72%) !important;
  box-shadow: inset 4px 0 0 var(--maize);
}
.schedule-row.is-next .schedule-status-dot {
  width: 18px;
  height: 18px;
  border: 4px solid var(--maize);
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(255, 203, 5, 0.22);
  animation: schedule-pulse 2.4s ease-out infinite;
}
.schedule-row.is-next .schedule-date,
.schedule-row.is-next .schedule-topic { color: var(--blue); font-weight: 700; }
.schedule-row.is-next .schedule-topic::after {
  content: "Next";
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  color: var(--blue);
  background: var(--maize);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0.1em;
}
.schedule-row.is-today .schedule-topic::after { content: "Today"; }
@keyframes schedule-pulse {
  0%, 45% { box-shadow: 0 0 0 4px rgba(255, 203, 5, 0.26); }
  75%, 100% { box-shadow: 0 0 0 10px rgba(255, 203, 5, 0); }
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.schedule-date { width: 165px; white-space: nowrap; color: #374151; font-weight: 600; }
.schedule-kind { width: 135px; }
.schedule-topic { font-weight: 500; }
.schedule-topic-link {
  color: inherit;
  text-decoration-color: rgba(0, 39, 76, 0.35);
  text-underline-offset: 0.18em;
}
.schedule-topic-link:hover { color: var(--blue); text-decoration-color: var(--blue); }
.schedule-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.schedule-badge-lecture { color: var(--blue); background: #dce8f5; }
.schedule-badge-discussion { color: #115e59; background: #ccfbf1; }
.schedule-badge-other { color: #5b3b00; background: var(--maize-soft); }
.schedule-badge-event { color: #654d00; background: #ffe899; }
.schedule-badge-exam { color: #8b1a1a; background: #fde2e2; }
.schedule-badge-break { color: #166534; background: #dcfce7; }
.schedule-row-break .schedule-topic { color: var(--muted); font-style: italic; }
.calendar-heading { margin-top: 2.25rem; color: var(--blue); }

/* ---- Calendar ---- */
.calendar-scroll { overflow-x: auto; }

.calendar {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 640px;
  font-size: 0.85rem;
}
.calendar th {
  background: var(--blue);
  color: #fff;
  padding: 0.4rem;
  text-align: left;
  font-weight: 600;
}
.calendar td {
  border: 1px solid var(--line);
  vertical-align: top;
  height: 84px;
  padding: 0.3rem;
}
.calendar td.out-of-range { background: var(--bg-soft); color: var(--muted); }

.day-head { display: flex; justify-content: space-between; align-items: baseline; }
.day-num { font-weight: 600; }
.month-label {
  display: inline-block;
  padding: 0.25em;
  font-size: 1em;
  text-transform: uppercase;
  background-color: var(--blue);
  color: white;
  font-weight: bold;
}

.event {
  margin-top: 0.25rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.78rem;
  background: var(--bg-soft);
  border-left: 3px solid var(--muted);
}
.event-lecture { border-left-color: var(--blue); background: #eef3f9; }
.event-discussion { border-left-color: #0f766e; background: #e6fffb; }
.event-assignment { border-left-color: #b45309; background: #fef6e7; }
.event-exam { border-left-color: #b91c1c; background: #fdecec; }
.event-event { border-left-color: #c59600; background: #fff4bf; }
.event-other { border-left-color: #7c3aed; background: #f1eafe; }
.event-break { border-left-color: #15803d; background: #dcfce7; }
.event-hw-due { border-left-color: #7f1d1d; color: #fff; background: #991b1b; }
.event-hw-release { border-left-color: #9a3412; color: #fff; background: #c2410c; }
.event-project-due { border-left-color: #4c1d95; color: #fff; background: #6d28d9; }
.event-project-release { border-left-color: #6d28d9; background: #ede9fe; }

/* ---- Lecture log ---- */
.lecture-log { padding-top: 2.5rem; }
.lecture-log-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.lecture-log-kicker {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.lecture-log-header h1 { margin: 0; color: var(--blue); font-size: 2rem; }
.lecture-log-header p:last-child { margin: 0.35rem 0 0; color: var(--muted); }
.lecture-block {
  scroll-margin-top: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.lecture-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.lecture-heading h2 { margin: 0; color: var(--blue); font-size: 1.5rem; }
.lecture-slides {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  border: 1px solid #ccd8e4;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.lecture-slides span { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.04em; }
.lecture-slides:hover { border-color: var(--blue); background: #dce8f5; }
.lecture-note {
  margin-top: 1.25rem;
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--maize);
  border-radius: 0 8px 8px 0;
  background: var(--maize-soft);
  font-size: 0.92rem;
}

/* ---- Footer ---- */
.footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---- Small screens ---- */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  #content-root { padding-bottom: 2.5rem; }
  .staff-grid,
  .resource-grid,
  .policy-grid { grid-template-columns: 1fr; }
  .staff-card { align-items: flex-start; }
  .staff-photo { width: 92px; height: 92px; flex-basis: 92px; }
  .course-schedule th:nth-child(3),
  .course-schedule td:nth-child(3) { display: none; }
  .course-schedule th,
  .course-schedule td { padding: 0.65rem 0.75rem; }
  .schedule-status-heading,
  .schedule-status-cell { width: 38px; min-width: 38px; }
  .schedule-date { width: 125px; }
  .lecture-heading { align-items: flex-start; }
  .lecture-heading h2 { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .schedule-row.is-next .schedule-status-dot { animation: none; }
}
