/* ==========================================================================
   CS 6758 — Deep Learning for Robotics
   Styles follow the design system of https://kuanfang.github.io/
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
div,
span,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
img,
ul,
ol,
li,
table,
caption,
thead,
tbody,
tfoot,
tr,
th,
td,
section,
header,
footer,
nav,
main,
figure,
figcaption {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  font-size: 100%;
  vertical-align: baseline;
}

section,
header,
footer,
nav,
main,
figure {
  display: block;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 12px;
}

/* --- Design tokens -------------------------------------------------------- */

:root {
  --transition-time: 0.1s;

  --page-background-color: #fafafa;
  --surface-color: #ffffff;
  --main-text-color: #131920;
  --heading-color: #131920;
  --secondary-text-color: #5c6670;
  --hint-text-color: #858d95;
  --callout-background-color: #f0f2f4;
  --code-background-color: #f5f5f5;

  --link-color: #1a63b3;
  --link-hover-color: #124a86;
  --link-border-color: #1a63b3;
  --rule-color: #dde0e3;

  --accent-color: #b31b1b; /* Cornell carnelian */
  --accent-soft-color: #f3e3e3;

  --button-icon-background-color: #f8f9fa;
  --button-icon-border-color: var(--rule-color);
  --button-hover-border-color: #dde0e3;
  --button-hover-background-color: #eceef0;
  --button-hover-color: #131920;

  --div-border-radius: 6px;
  --button-border-radius: 10px;

  --list-row-gap: 12px;
  --rule-gap: 28px;
  --content-width: 1080px;

  /* Schedule row accents */
  --tag-lecture: #1a63b3;
  --tag-discussion: #1c6914;
  --tag-guest: #8026c0;
  --tag-project: #c07800;
  --tag-break: #98a0a8;
}

/* --- Base ----------------------------------------------------------------- */

body {
  background: var(--page-background-color);
  max-width: var(--content-width);
  width: 100%;
  padding: 20px 20px 0;
  margin: 0 auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--main-text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover-color);
  transition: var(--transition-time);
}

b,
strong {
  font-weight: 600;
}

em,
i {
  font-style: italic;
}

p {
  margin: 0 0 14px;
}

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

ul,
ol {
  list-style-type: disc;
  margin: 0 0 14px 20px;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: 4px;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--rule-color);
  margin: var(--rule-gap) 0;
}

mark {
  background: none;
  color: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-background-color);
  border-radius: 4px;
  padding: 1px 5px;
}

/* --- Page header ---------------------------------------------------------- */

.masthead {
  padding-top: 16px;
  text-align: center;
}

.masthead h1 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--heading-color);
  margin-bottom: 10px;
}

.masthead-meta {
  color: var(--secondary-text-color);
  line-height: 1.5;
}

/* --- Sections ------------------------------------------------------------- */

.section {
  margin-top: 44px;
  scroll-margin-top: 12px;
}

.section > h2,
.section-head h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 14px;
}

.section h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--heading-color);
  margin: 22px 0 6px;
}

.section h3:first-of-type {
  margin-top: 0;
}

.subtle {
  color: var(--secondary-text-color);
}

.callout {
  background-color: var(--callout-background-color);
  border-radius: var(--div-border-radius);
  padding: 14px 18px;
  margin-top: 14px;
}

/* --- Prerequisites -------------------------------------------------------- */

.prereq-list {
  list-style: none;
  margin: 0;
  display: grid;
  row-gap: var(--list-row-gap);
}

.prereq-list li {
  margin: 0;
}

.prereq-label {
  font-weight: 600;
  color: var(--heading-color);
}

/* --- Staff ---------------------------------------------------------------- */

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* The whole card is the link to that person's site. */
.staff-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface-color);
  border: 1px solid var(--rule-color);
  border-radius: var(--div-border-radius);
  padding: 16px;
  color: var(--main-text-color);
  text-decoration: none;
  transition: background-color var(--transition-time) ease,
    border-color var(--transition-time) ease,
    box-shadow var(--transition-time) ease;
}

.staff-card:hover {
  background: #f7f8fa;
  border-color: var(--button-hover-border-color);
  box-shadow: rgba(0, 0, 0, 0.08) 0 2px 6px;
  color: var(--main-text-color);
}

.staff-card:hover .staff-name {
  color: var(--link-color);
}

.staff-card:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

.staff-photo {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: var(--div-border-radius);
  object-fit: cover;
  display: block;
  border: 1px solid var(--rule-color);
}

.staff-body {
  min-width: 0;
}

.staff-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--heading-color);
  line-height: 1.35;
  transition: color var(--transition-time) ease;
}

.staff-role {
  color: var(--accent-color);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.staff-detail {
  color: var(--secondary-text-color);
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}

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

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 0;
}

/* Segmented list / calendar switch */
.view-toggle {
  display: inline-flex;
  background: var(--callout-background-color);
  border: 1px solid var(--rule-color);
  border-radius: var(--button-border-radius);
  padding: 2px;
}

.view-toggle button {
  font: inherit;
  font-size: 14px;
  color: var(--secondary-text-color);
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 4px 14px;
  cursor: pointer;
  transition: background-color var(--transition-time) ease,
    color var(--transition-time) ease;
}

.view-toggle button:hover {
  color: var(--heading-color);
}

.view-toggle button.is-active {
  background: var(--surface-color);
  color: var(--heading-color);
  font-weight: 500;
  box-shadow: rgba(0, 0, 0, 0.06) 0 1px 2px;
}

.view-toggle button:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 1px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--secondary-text-color);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.swatch-lecture { background: var(--tag-lecture); }
.swatch-discussion { background: var(--tag-discussion); }
.swatch-guest { background: var(--tag-guest); }
.swatch-project { background: var(--tag-project); }
.swatch-break { background: var(--tag-break); }

.schedule-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule-color);
  border-radius: var(--div-border-radius);
  background: var(--surface-color);
}

table.schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.schedule th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--hint-text-color);
  background: var(--callout-background-color);
  padding: 10px 16px;
  white-space: nowrap;
}

table.schedule td {
  padding: 14px 16px;
  border-top: 1px solid var(--rule-color);
  vertical-align: top;
}

table.schedule tbody tr:first-child td {
  border-top: 0;
}

table.schedule .col-date { width: 16%; min-width: 130px; }
table.schedule .col-topic { width: 84%; min-width: 380px; }

/* Date cell: week + date stacked, with a colored rail marking the session type */
.cell-date {
  position: relative;
  padding-left: 22px !important;
  white-space: nowrap;
}

.cell-date::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 2px;
  background: var(--tag-lecture);
}

.week {
  font-size: 12px;
  font-weight: 600;
  color: var(--hint-text-color);
  display: block;
}

.date {
  color: var(--heading-color);
  font-weight: 400;
}

tr.is-lecture .cell-date::before { background: var(--tag-lecture); }
tr.is-discussion .cell-date::before { background: var(--tag-discussion); }
tr.is-guest .cell-date::before { background: var(--tag-guest); }
tr.is-project .cell-date::before { background: var(--tag-project); }
tr.is-break .cell-date::before { background: var(--tag-break); }

tr.is-break td {
  color: var(--hint-text-color);
  background: #fbfbfc;
}

.topic {
  font-weight: 600;
  color: var(--heading-color);
}

tr.is-break .topic {
  font-weight: 400;
  color: var(--hint-text-color);
}

.papers {
  list-style: none;
  margin: 8px 0 0;
  display: grid;
  row-gap: 8px;
  font-size: 14px;
}

.papers li {
  margin: 0;
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.papers li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rule-color);
}

.paper-authors {
  color: var(--secondary-text-color);
}

/* Guest speaker headshot beside a session title. Same size and framing as the
   staff photos, but square rather than round. */
.session-media {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.session-photo {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--rule-color);
  border-radius: var(--div-border-radius);
}

.session-body {
  min-width: 0;
}

@media (max-width: 600px) {
  .session-photo {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
  }
}

/* Slide / resource chips */
.res {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid var(--rule-color);
  background: var(--button-icon-background-color);
  color: var(--secondary-text-color);
  vertical-align: 1px;
  white-space: nowrap;
}

a.res {
  color: var(--link-color);
  border-color: #cfdcea;
  background: #f2f7fc;
}

a.res:hover {
  background: #e6effa;
  border-color: #b8cee6;
  color: var(--link-hover-color);
  transition: var(--transition-time);
}

.res-pending {
  color: var(--hint-text-color);
}

/* Part divider rows */
tr.part td {
  background: var(--callout-background-color);
  padding: 10px 16px;
  border-top: 1px solid var(--rule-color);
}

.part-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--heading-color);
}

/* Deadlines */
.deadline {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-color);
  background: var(--accent-soft-color);
  border-radius: 4px;
  padding: 1px 8px;
}

/* Row highlight when arriving from the calendar or a deep link */
tr.is-flash td {
  animation: flash-row 1.6s ease-out;
}

@keyframes flash-row {
  0%, 45% { background-color: #fdf3d6; }
  100% { background-color: transparent; }
}

/* --- Calendar view -------------------------------------------------------- */

.cal-month {
  margin-bottom: 28px;
}

.cal-month:last-child {
  margin-bottom: 0;
}

.cal-month-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary-text-color);
  margin: 0 0 8px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule-color);
  border: 1px solid var(--rule-color);
  border-radius: var(--div-border-radius);
  overflow: hidden;
}

.cal-head {
  background: var(--callout-background-color);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hint-text-color);
}

.cal-day {
  background: var(--surface-color);
  min-height: 104px;
  padding: 8px 10px 10px;
}

.cal-day.is-empty {
  background: #f6f7f8;
}

.cal-date {
  font-size: 13px;
  color: var(--hint-text-color);
  margin-bottom: 6px;
}

.cal-day.has-session .cal-date {
  color: var(--secondary-text-color);
  font-weight: 500;
}

/* One class block inside a day cell. The left rail carries the session type,
   matching the rails in the list view and the legend above. */
.cal-item {
  display: block;
  border-left: 3px solid var(--tag-lecture);
  border-radius: 3px;
  background: var(--callout-background-color);
  padding: 6px 8px;
  color: var(--main-text-color);
  transition: background-color var(--transition-time) ease;
}

.cal-item:hover {
  background: #e4e7ea;
  color: var(--main-text-color);
}

.cal-item.is-lecture { border-left-color: var(--tag-lecture); }
.cal-item.is-discussion { border-left-color: var(--tag-discussion); }
.cal-item.is-guest { border-left-color: var(--tag-guest); }
.cal-item.is-project { border-left-color: var(--tag-project); }
.cal-item.is-break {
  border-left-color: var(--tag-break);
  background: #f4f5f6;
  color: var(--hint-text-color);
}

.cal-week {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--hint-text-color);
}

.cal-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.cal-meta {
  display: block;
  font-size: 12px;
  color: var(--hint-text-color);
  margin-top: 2px;
}

.cal-deadline {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--accent-color);
  background: var(--accent-soft-color);
  border-radius: 4px;
  padding: 3px 6px;
}

.cal-hint {
  margin-top: 12px;
  font-size: 14px;
}

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

.grade-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 24px 0 6px;
}

.grade-head:first-of-type {
  margin-top: 14px;
}

.grade-head h3 {
  margin: 0;
}


/* Scope / due-date line beside a deliverable heading */
.due {
  font-size: 14px;
  color: var(--hint-text-color);
}


/* Weights table */
table.weights {
  width: 100%;
  /* Below this the breakdown column wraps to one or two words per line, so the
     table scrolls inside its box instead, as the schedule does. */
  min-width: 640px;
  border-collapse: collapse;
  font-size: 15px;
}

table.weights th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--hint-text-color);
  background: var(--callout-background-color);
  padding: 10px 16px;
  white-space: nowrap;
}

table.weights td {
  padding: 12px 16px;
  border-top: 1px solid var(--rule-color);
  vertical-align: top;
  color: var(--secondary-text-color);
}

table.weights td:first-child {
  color: var(--heading-color);
  font-weight: 500;
  white-space: nowrap;
}

table.weights td.w {
  color: var(--heading-color);
  font-weight: 600;
  white-space: nowrap;
}

table.weights tr.total td {
  background: var(--callout-background-color);
  color: var(--heading-color);
  font-weight: 600;
}

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

.site-footer {
  text-align: center;
  margin-top: 56px;
  padding: 20px 0 40px;
  border-top: 1px solid var(--rule-color);
  color: var(--secondary-text-color);
  font-size: 14px;
}

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

@media (max-width: 900px) {
  .masthead h1 {
    font-size: 26px;
  }

  .masthead-meta {
    flex-direction: column;
    gap: 2px;
  }

  .masthead-meta .sep {
    display: none;
  }
}

@media (max-width: 768px) {
  .masthead {
    padding-top: 20px;
  }

  .schedule-wrap {
    /* The table keeps its columns and scrolls sideways inside its own box. */
    -webkit-overflow-scrolling: touch;
  }

  .section-head {
    justify-content: flex-start;
  }

  /* Five day columns will not fit a phone, so the grid keeps its shape and
     scrolls sideways inside its own box rather than squeezing the cells. */
  .cal-root {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cal-grid {
    min-width: 620px;
  }

  .staff-card {
    padding: 14px;
  }
}

@media print {
  .view-toggle {
    display: none;
  }

  body {
    max-width: none;
  }

  .schedule-wrap {
    overflow: visible;
  }
}
