:root {
  --os-ink: #102a43;
  --os-ink-soft: #334e68;
  --os-blue: #003262;
  --os-blue-bright: #1c5d99;
  --os-gold: #fdb515;
  --os-paper: #f4f1e9;
  --os-white: #ffffff;
  --os-line: #d8dee6;
  --os-muted: #6b7c93;
  --os-green: #158467;
  --os-red: #bd4b4b;
  --os-shadow: 0 18px 50px rgba(16, 42, 67, 0.1);
}

.formal-site:has(.os-course) {
  background:
    radial-gradient(circle at 88% 8%, rgba(253, 181, 21, 0.13), transparent 24rem),
    linear-gradient(180deg, #edf3f8 0, #f7f8fa 24rem, var(--os-paper) 100%);
}

.formal-site:has(.os-course) > .container-fluid {
  max-width: 1620px;
  padding-inline: clamp(1rem, 3vw, 3.5rem);
}

.os-course {
  color: var(--os-ink);
  padding: 1.25rem 0 5rem;
}

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

.os-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .65fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  min-height: 420px;
  margin-top: 1.5rem;
  padding: clamp(2rem, 5vw, 5rem);
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(112deg, rgba(0, 50, 98, .99), rgba(8, 36, 65, .94)),
    repeating-linear-gradient(135deg, transparent 0 26px, rgba(255, 255, 255, .05) 26px 27px);
  border-radius: 4px;
  box-shadow: var(--os-shadow);
}

.os-hero::after {
  content: "162";
  position: absolute;
  right: -2rem;
  top: -5rem;
  color: rgba(255, 255, 255, .035);
  font: 900 clamp(10rem, 24vw, 25rem)/1 "Fira Sans", sans-serif;
  letter-spacing: -.09em;
  pointer-events: none;
}

.os-hero-copy,
.os-progress-card {
  position: relative;
  z-index: 1;
}

.os-kicker,
.os-section-heading p,
.os-policy-note > div p {
  margin: 0 0 .85rem;
  color: var(--os-gold);
  font: 700 .76rem/1.2 "Source Code Pro", monospace;
  letter-spacing: .18em;
}

.os-hero h1 {
  max-width: 850px;
  margin: 0;
  color: #fff;
  font: 800 clamp(3.4rem, 6.5vw, 7rem)/.9 "Fira Sans", sans-serif;
  letter-spacing: -.06em;
}

.os-hero h1 span {
  display: block;
  margin-top: 1.35rem;
  color: rgba(255, 255, 255, .8);
  font-size: clamp(1rem, 1.7vw, 1.5rem);
  font-weight: 400;
  letter-spacing: .03em;
}

.os-intro {
  max-width: 760px;
  margin: 2rem 0 0;
  color: rgba(255, 255, 255, .8);
  font-size: 1.04rem;
  line-height: 1.85;
}

.os-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 2rem;
}

.os-quick-links a {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .72rem 1rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 3px;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  transition: .2s ease;
}

.os-quick-links a:hover {
  color: var(--os-blue);
  background: var(--os-gold);
  border-color: var(--os-gold);
  transform: translateY(-2px);
}

.os-progress-card {
  padding: 1.5rem;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(12px);
}

.os-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-family: "Source Code Pro", monospace;
}

.os-progress-label span {
  color: rgba(255, 255, 255, .65);
  font-size: .66rem;
  letter-spacing: .12em;
}

.os-progress-label strong {
  color: #fff;
  font-size: 1rem;
}

.os-progress-track {
  height: 7px;
  margin: 1rem 0 1.4rem;
  overflow: hidden;
  background: rgba(255, 255, 255, .15);
}

.os-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--os-gold);
  transition: width .35s ease;
}

.os-progress-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
}

.os-progress-card dl div {
  padding: .2rem .8rem;
  border-left: 1px solid rgba(255, 255, 255, .16);
}

.os-progress-card dl div:first-child {
  padding-left: 0;
  border-left: 0;
}

.os-progress-card dt {
  color: rgba(255, 255, 255, .55);
  font-size: .69rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.os-progress-card dd {
  margin: .18rem 0 0;
  color: #fff;
  font-weight: 700;
}

#os-reset-progress {
  margin-top: 1.25rem;
  padding: 0;
  color: rgba(255, 255, 255, .62);
  background: none;
  border: 0;
  font-size: .78rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.os-status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--os-white);
  border: 1px solid var(--os-line);
  border-top: 0;
}

.os-status-strip > div {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 72px;
  padding: 1rem 1.25rem;
  border-left: 1px solid var(--os-line);
}

.os-status-strip > div:first-child { border-left: 0; }
.os-status-strip span:last-child { color: var(--os-muted); font-size: .82rem; }

.os-status-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(0, 0, 0, .04);
}

.os-status-dot.is-lecture { background: var(--os-blue-bright); }
.os-status-dot.is-reading { background: var(--os-gold); }
.os-status-dot.is-discussion { background: var(--os-green); }
.os-status-dot.is-project { background: var(--os-red); }

.os-resources,
.os-calendar,
.os-projects {
  margin-top: clamp(3.5rem, 7vw, 7rem);
}

.os-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.35rem;
}

.os-section-heading p { color: var(--os-blue-bright); }

.os-section-heading h2,
.os-policy-note h2 {
  margin: 0;
  color: var(--os-ink);
  font: 800 clamp(2rem, 3.6vw, 3.6rem)/1 "Fira Sans", sans-serif;
  letter-spacing: -.04em;
}

.os-section-heading > span {
  color: var(--os-muted);
  font-family: "Source Code Pro", monospace;
}

.os-resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 3px solid var(--os-blue);
  border-left: 1px solid var(--os-line);
}

.os-resource-grid a {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 150px;
  padding: 1.2rem;
  color: var(--os-ink);
  background: rgba(255, 255, 255, .8);
  border-right: 1px solid var(--os-line);
  border-bottom: 1px solid var(--os-line);
  text-decoration: none;
  transition: .2s ease;
}

.os-resource-grid a:hover {
  z-index: 1;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 42, 67, .12);
  transform: translateY(-4px);
}

.os-resource-grid a > span {
  color: var(--os-blue-bright);
  font: 700 .72rem/1 "Source Code Pro", monospace;
}

.os-resource-grid strong { margin-top: 1.5rem; }
.os-resource-grid small { margin-top: .45rem; color: var(--os-muted); line-height: 1.55; }
.os-resource-grid i { position: absolute; right: 1.1rem; top: 1.1rem; color: var(--os-gold); }

.os-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--os-muted);
  font-size: .78rem;
}

.os-legend span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.os-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.os-legend .is-today { background: var(--os-gold); }
.os-legend .is-done { background: var(--os-green); }
.os-legend .is-reading { background: var(--os-blue-bright); }

.os-reading-note {
  padding: 1rem 1.2rem;
  color: var(--os-ink-soft);
  background: #fff7e5;
  border-left: 4px solid var(--os-gold);
  line-height: 1.7;
}

.os-reading-note strong { color: var(--os-ink); }

.os-week-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 1rem;
  border: 1px solid var(--os-line);
  border-bottom: 0;
}

.os-week-nav a {
  display: grid;
  gap: .2rem;
  padding: .9rem 1rem;
  color: var(--os-blue);
  background: rgba(255, 255, 255, .82);
  border-left: 1px solid var(--os-line);
  font: 700 .78rem/1.3 "Source Code Pro", monospace;
  text-decoration: none;
}

.os-week-nav a:first-child { border-left: 0; }
.os-week-nav a:hover { background: #fff5d6; }
.os-week-nav span { color: var(--os-muted); font-size: .65rem; font-weight: 400; }

.os-table-wrap {
  overflow-x: auto;
  background: var(--os-white);
  border: 1px solid var(--os-line);
  box-shadow: var(--os-shadow);
}

.os-schedule-table {
  width: 100%;
  min-width: 1480px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.os-schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: .95rem .85rem;
  color: #fff;
  background: var(--os-blue);
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .12);
  font: 700 .69rem/1 "Source Code Pro", monospace;
  letter-spacing: .06em;
  text-align: left;
}

.os-schedule-table thead th:nth-child(1) { width: 8%; }
.os-schedule-table thead th:nth-child(2) { width: 6%; }
.os-schedule-table thead th:nth-child(3) { width: 23%; }
.os-schedule-table thead th:nth-child(4) { width: 13%; }
.os-schedule-table thead th:nth-child(5) { width: 14%; }
.os-schedule-table thead th:nth-child(6) { width: 11%; }
.os-schedule-table thead th:nth-child(7) { width: 21%; }
.os-schedule-table thead th:nth-child(8) { width: 4%; }

.os-schedule-table td,
.os-schedule-table tbody > tr > th {
  padding: 1rem .85rem;
  vertical-align: top;
  background: rgba(255, 255, 255, .97);
  border: 0;
  border-left: 1px solid var(--os-line);
  border-bottom: 1px solid var(--os-line);
  font-size: .82rem;
  line-height: 1.55;
}

.os-schedule-table tbody + tbody > tr:first-child > * {
  border-top: 4px solid var(--os-paper);
}

.os-week-cell {
  background: #eef4f8 !important;
  border-left: 0 !important;
}

.os-week-cell span,
.os-date-cell span,
.os-lecture-number {
  display: block;
  color: var(--os-blue-bright);
  font: 700 .68rem/1.2 "Source Code Pro", monospace;
  letter-spacing: .06em;
}

.os-week-cell strong {
  display: block;
  margin: .65rem 0;
  font-size: .92rem;
  line-height: 1.4;
}

.os-week-cell small,
.os-date-cell span { color: var(--os-muted); }

.os-date-cell strong {
  display: block;
  margin-top: .32rem;
  font: 700 .93rem/1 "Source Code Pro", monospace;
}

.os-material + .os-material {
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px dashed var(--os-line);
}

.os-material > strong {
  display: block;
  margin: .3rem 0 .45rem;
  color: var(--os-blue);
  font-size: .92rem;
  line-height: 1.4;
}

.os-material-links,
.os-discussion-block > span {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.os-material-links a,
.os-discussion-block a {
  padding: .18rem .38rem;
  color: var(--os-blue-bright);
  background: #edf5fb;
  border: 1px solid #c9dbe9;
  border-radius: 2px;
  font: 700 .65rem/1.2 "Source Code Pro", monospace;
  text-decoration: none;
}

.os-material-links a:hover,
.os-discussion-block a:hover { background: #fff1c7; border-color: var(--os-gold); }

.os-list-cell > * + * { margin-top: .45rem; }

.os-reading-chip,
.os-project-chip,
.os-task-link {
  display: block;
  padding: .34rem .48rem;
  color: var(--os-blue);
  background: #edf5fb;
  border: 1px solid #c9dbe9;
  border-radius: 3px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.os-project-chip {
  color: #7f3131;
  background: #fff1ef;
  border-color: #e7c4bf;
}

.os-task-link {
  color: #306855;
  background: #eef8f4;
  border-color: #bfded2;
}

.os-reading-chip:hover,
.os-project-chip:hover,
.os-task-link:hover { filter: brightness(.96); }

.os-work-note {
  margin: -.1rem 0 1rem;
  padding: .72rem 1rem;
  color: #40566b;
  background: #edf5fb;
  border-left: 3px solid var(--os-blue-bright);
  font-size: .78rem;
}

.os-track-cell {
  position: relative;
  padding: 0 .35rem !important;
  vertical-align: stretch !important;
}

.os-track-stack {
  position: absolute;
  inset: 0 .35rem;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}

.os-track-stack > .os-empty {
  margin: auto 0;
  padding: .8rem .2rem;
}

.os-work-block {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  display: flex;
  min-height: 3.7rem;
  flex-direction: column;
  justify-content: center;
  padding: .48rem .55rem;
  border: 1px solid transparent;
  border-top-width: 0;
  border-bottom-width: 0;
  border-radius: 0;
  text-decoration: none;
}

.os-work-block.is-start {
  margin-top: .55rem;
  border-top-width: 1px;
  border-radius: 5px 5px 0 0;
}

.os-work-block.is-end {
  margin-bottom: .55rem;
  border-bottom-width: 1px;
  border-radius: 0 0 5px 5px;
}

.os-work-block.is-start.is-end {
  border-radius: 5px;
}

.os-work-block strong {
  display: block;
  font-size: .72rem;
  line-height: 1.35;
}

.os-work-block small {
  display: block;
  margin-top: .26rem;
  font: 600 .61rem/1.35 "Source Code Pro", monospace;
  opacity: .78;
}

.os-work-block.is-homework {
  color: #245b49;
  background: #dff2ea;
  border-color: #9dcfbc;
}

.os-work-block.is-project {
  color: #783232;
  background: #f8e1de;
  border-color: #dca9a3;
}

.os-work-block:hover {
  color: var(--os-blue);
  filter: brightness(.97);
}

.os-discussion-block {
  padding: .55rem .6rem;
  color: #244f73;
  background: #e7f1f8;
  border: 1px solid #bdd4e4;
  border-radius: 4px;
}

.os-discussion-block strong {
  display: block;
  line-height: 1.35;
}

.os-discussion-block small {
  display: block;
  margin: .24rem 0 .42rem;
  color: #607d94;
  font: 600 .6rem/1.3 "Source Code Pro", monospace;
}

.os-discussion-block + .os-discussion-block {
  margin-top: .45rem;
}

.os-empty { color: #a5afba; }
.os-studio-badge {
  display: inline-block;
  padding: .25rem .45rem;
  color: #fff;
  background: var(--os-blue-bright);
  font: 700 .66rem/1 "Source Code Pro", monospace;
  letter-spacing: .06em;
}

.os-studio-title {
  display: block;
  margin-top: .6rem;
  color: var(--os-blue);
  font-size: .95rem;
}

.os-check-cell { text-align: center; }

.os-check-cell label {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.os-check-cell input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.os-check-cell label > span[aria-hidden] {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: transparent;
  background: #fff;
  border: 2px solid #b9c4d0;
  border-radius: 50%;
  transition: .2s ease;
}

.os-check-cell input:focus-visible + span {
  outline: 3px solid rgba(28, 93, 153, .25);
  outline-offset: 3px;
}

.os-check-cell input:checked + span {
  color: #fff;
  background: var(--os-green);
  border-color: var(--os-green);
}

.os-schedule-table tr.is-complete td { background: #f0f8f5; }
.os-schedule-table tr.is-complete .os-material > strong { color: var(--os-green); }
.os-schedule-table tr.is-studio-row td { background: #fbfcfd; }

.os-schedule-table tr.is-today-row td,
.os-schedule-table tr.is-today-row th {
  box-shadow: inset 0 3px 0 var(--os-gold), inset 0 -3px 0 var(--os-gold);
}

.os-checkpoint-row td {
  position: relative;
  z-index: 3;
  padding: .85rem 1rem .95rem 9% !important;
  color: #fff;
  background: var(--os-ink) !important;
  border-left: 0 !important;
  font-size: .82rem;
}

.os-checkpoint-row strong {
  margin-right: .9rem;
  color: var(--os-gold);
  font-family: "Source Code Pro", monospace;
  text-transform: uppercase;
}

.os-project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.os-project-grid a {
  display: grid;
  min-height: 175px;
  padding: 1.25rem;
  color: var(--os-ink);
  background: var(--os-white);
  border-top: 4px solid var(--os-blue);
  box-shadow: 0 10px 30px rgba(16, 42, 67, .08);
  text-decoration: none;
  transition: .2s ease;
}

.os-project-grid a:hover { transform: translateY(-4px); box-shadow: var(--os-shadow); }
.os-project-grid a > div { display: flex; justify-content: space-between; align-items: start; }
.os-project-grid a > div span { color: var(--os-blue-bright); font: 800 .82rem/1 "Source Code Pro", monospace; }
.os-project-grid em { padding: .28rem .45rem; color: #7f3131; background: #fff1ef; font-size: .65rem; font-style: normal; font-weight: 800; text-transform: uppercase; }
.os-project-grid strong { align-self: end; margin-top: 2.2rem; font-size: 1.15rem; }
.os-project-grid small { margin-top: .45rem; color: var(--os-muted); font-family: "Source Code Pro", monospace; }

.os-policy-note {
  display: grid;
  grid-template-columns: minmax(240px, .65fr) 1.35fr;
  gap: 3rem;
  align-items: center;
  margin-top: 3rem;
  padding: 2.2rem;
  background: #fff7e5;
  border-left: 5px solid var(--os-gold);
}

.os-policy-note > div p { color: #9d6b00; }
.os-policy-note h2 { font-size: 1.65rem; }
.os-policy-note > p { margin: 0; color: var(--os-ink-soft); line-height: 1.8; }

.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;
}

html[data-theme="dark"] .formal-site:has(.os-course) {
  background:
    radial-gradient(circle at 88% 8%, rgba(253, 181, 21, .08), transparent 24rem),
    #101820;
}

html[data-theme="dark"] .os-course {
  --os-ink: #e8edf2;
  --os-ink-soft: #bac7d3;
  --os-white: #18232d;
  --os-line: #33414e;
  --os-paper: #101820;
  --os-muted: #91a0ad;
}

html[data-theme="dark"] .os-status-strip,
html[data-theme="dark"] .os-resource-grid a,
html[data-theme="dark"] .os-week-nav a,
html[data-theme="dark"] .os-table-wrap {
  background: #18232d;
}

html[data-theme="dark"] .os-week-cell,
html[data-theme="dark"] .os-schedule-table td,
html[data-theme="dark"] .os-schedule-table tbody > tr > th,
html[data-theme="dark"] .os-project-grid a {
  background: #18232d !important;
}

html[data-theme="dark"] .os-work-note {
  color: #c9d8e5;
  background: #203344;
}

html[data-theme="dark"] .os-work-block.is-homework {
  color: #d9f2e8;
  background: #23483c;
  border-color: #3f745f;
}

html[data-theme="dark"] .os-work-block.is-project {
  color: #f4d9d5;
  background: #573234;
  border-color: #8a5152;
}

html[data-theme="dark"] .os-discussion-block {
  color: #dcecf7;
  background: #243f53;
  border-color: #40657e;
}

html[data-theme="dark"] .os-discussion-block small {
  color: #acc7da;
}

html[data-theme="dark"] .os-schedule-table tr.is-complete td { background: #17312c !important; }
html[data-theme="dark"] .os-reading-note,
html[data-theme="dark"] .os-policy-note { background: #302817; }
html[data-theme="dark"] .os-check-cell label > span[aria-hidden] { background: #101820; }

@media (max-width: 1150px) {
  .os-hero { grid-template-columns: 1fr; }
  .os-progress-card { max-width: 640px; }
  .os-status-strip,
  .os-resource-grid,
  .os-project-grid { grid-template-columns: repeat(2, 1fr); }
  .os-status-strip > div:nth-child(3),
  .os-resource-grid a:nth-child(3) { border-left: 0; }
  .os-week-nav { grid-template-columns: repeat(3, 1fr); }
  .os-week-nav a:nth-child(4) { border-left: 0; border-top: 1px solid var(--os-line); }
  .os-week-nav a:nth-child(n+5) { border-top: 1px solid var(--os-line); }
}

@media (max-width: 720px) {
  .formal-site:has(.os-course) > .container-fluid { padding-inline: .75rem; }
  .os-hero { min-height: 0; margin-top: .75rem; padding: 2rem 1.25rem; }
  .os-hero h1 { font-size: 3.2rem; }
  .os-intro { font-size: .95rem; }
  .os-progress-card dl { grid-template-columns: 1fr; gap: .7rem; }
  .os-progress-card dl div { padding: 0; border: 0; }
  .os-status-strip,
  .os-resource-grid,
  .os-project-grid { grid-template-columns: 1fr; }
  .os-status-strip > div { border-left: 0; border-top: 1px solid var(--os-line); }
  .os-status-strip > div:first-child { border-top: 0; }
  .os-resource-grid a { border-left: 0; }
  .os-section-heading { display: grid; align-items: start; }
  .os-week-nav { grid-template-columns: repeat(2, 1fr); }
  .os-week-nav a:nth-child(odd) { border-left: 0; }
  .os-week-nav a:nth-child(n+3) { border-top: 1px solid var(--os-line); }
  .os-policy-note { grid-template-columns: 1fr; gap: 1.2rem; }
}
