:root {
  --ink: #11243d;
  --ink-soft: #42526a;
  --paper: #f7f8f5;
  --white: #ffffff;
  --line: #d9ded8;
  --line-dark: #b8c1bb;
  --navy: #16396c;
  --blue: #245dad;
  --teal: #167f78;
  --gold: #b27b24;
  --red: #a8493e;
  --shadow: 0 18px 50px rgba(17, 36, 61, 0.08);
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 2px solid var(--blue);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem clamp(1rem, 4vw, 4.5rem);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  width: 190px;
  max-height: 48px;
  object-fit: contain;
  object-position: left center;
}

.brand span {
  display: grid;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
  line-height: 1.25;
}

.brand strong {
  font-family: var(--serif);
  font-size: 1.05rem;
}

.brand small {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-actions a {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.header-actions .primary-link {
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--white);
}

.mobile-index-button {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--line-dark);
  color: var(--ink);
  cursor: pointer;
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(270px, 0.6fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: end;
  min-height: 520px;
  padding: clamp(4rem, 8vw, 8rem) clamp(1.25rem, 7vw, 8rem) 4rem;
  background:
    linear-gradient(90deg, rgba(8, 25, 48, 0.97), rgba(17, 48, 80, 0.91)),
    url("./assets/CI_Learning_Hub_2026.png") center / cover;
  color: var(--white);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.library-hero .eyebrow,
.hero-register small {
  color: #9edbd6;
}

.library-hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.7rem, 6vw, 6.2rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 0.98;
}

.hero-summary {
  max-width: 720px;
  margin: 1.5rem 0 0;
  color: #dce5ef;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--white);
  color: var(--ink);
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--white);
}

.button-dark {
  background: var(--ink);
  color: var(--white);
}

.hero-register {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.hero-register div {
  min-height: 112px;
  padding: 1.25rem;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.hero-register span {
  display: block;
  font-family: var(--serif);
  font-size: 2.5rem;
  line-height: 1;
}

.hero-register small {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.progress-band {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem clamp(1.25rem, 7vw, 8rem);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.progress-band .eyebrow {
  margin: 0;
}

.progress-band strong,
.progress-band p {
  margin: 0;
  font-size: 0.8rem;
}

.progress-band > p {
  color: var(--ink-soft);
}

.progress-track {
  height: 6px;
  overflow: hidden;
  background: #e5e9e7;
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.library-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 3rem clamp(1.25rem, 5vw, 5rem) 6rem;
}

.course-index {
  position: sticky;
  top: 104px;
  align-self: start;
}

.index-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.index-heading button {
  display: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.8rem;
  cursor: pointer;
}

.search-box,
.project-toolbar label {
  display: grid;
  gap: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input,
.project-toolbar input,
.week-jump select {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  color: var(--ink);
  outline: none;
}

.search-box input:focus,
.project-toolbar input:focus,
.week-jump select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 93, 173, 0.12);
}

.course-index nav {
  display: grid;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.course-index nav a {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.course-index nav span {
  color: var(--blue);
  font-family: var(--serif);
}

.index-note {
  margin-top: 1.75rem;
  padding-left: 1rem;
  border-left: 3px solid var(--teal);
}

.index-note strong {
  font-family: var(--serif);
  font-size: 1rem;
}

.index-note p {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.library-main {
  min-width: 0;
}

.library-section {
  scroll-margin-top: 100px;
  padding: 0 0 5rem;
}

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

.section-heading h2,
.faculty-access h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 600;
  line-height: 1.05;
}

.section-heading p:not(.eyebrow),
.faculty-access p:not(.eyebrow) {
  max-width: 720px;
  margin: 0.65rem 0 0;
  color: var(--ink-soft);
}

.week-jump {
  display: grid;
  min-width: 180px;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stage-tabs {
  display: flex;
  overflow-x: auto;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line-dark);
  scrollbar-width: thin;
}

.stage-tab {
  flex: 0 0 auto;
  padding: 0.8rem 1rem;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.stage-tab[aria-selected="true"] {
  border-color: var(--blue);
  color: var(--ink);
}

.week-list,
.project-list {
  border-top: 1px solid var(--line-dark);
}

.week-item,
.project-item {
  border-bottom: 1px solid var(--line-dark);
}

.week-item > summary,
.project-item > summary,
.day-item > summary {
  list-style: none;
  cursor: pointer;
}

.week-item > summary::-webkit-details-marker,
.project-item > summary::-webkit-details-marker,
.day-item > summary::-webkit-details-marker {
  display: none;
}

.week-summary {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto 32px;
  gap: 1rem;
  align-items: center;
  min-height: 92px;
  padding: 1rem 0.5rem;
}

.week-number {
  color: var(--blue);
  font-family: var(--serif);
  font-size: 2rem;
}

.week-title {
  display: grid;
  gap: 0.2rem;
}

.week-title strong,
.project-summary strong {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.week-title small,
.project-summary small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.status {
  padding: 0.25rem 0.55rem;
  border: 1px solid currentColor;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-delivered {
  color: var(--teal);
}

.status-progress {
  color: var(--gold);
}

.status-planned {
  color: var(--ink-soft);
}

.expand-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-dark);
  color: var(--blue);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 160ms ease;
}

details[open] > summary .expand-mark {
  transform: rotate(45deg);
}

.week-body {
  padding: 0.5rem 0.5rem 2rem 86px;
}

.week-introduction {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(230px, 0.6fr);
  gap: 2rem;
  padding: 1.5rem;
  background: var(--white);
  border-left: 4px solid var(--blue);
}

.week-introduction p {
  margin: 0;
  color: var(--ink-soft);
}

.week-outcomes h3,
.week-project h3,
.day-content h4 {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-size: 1rem;
}

.week-outcomes ul,
.project-grid ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.week-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.resource-link,
.text-link {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.resource-link {
  padding: 0.48rem 0.65rem;
  background: #f2f6fb;
  border: 1px solid #cbd9ea;
}

.day-list {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.day-item {
  border-bottom: 1px solid var(--line);
}

.day-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 0.75rem;
  align-items: center;
  min-height: 62px;
  padding: 0.65rem 0;
}

.day-summary span:first-child {
  color: var(--teal);
  font-family: var(--serif);
}

.day-summary strong {
  font-size: 0.86rem;
}

.day-content {
  padding: 0.25rem 0 1.5rem 42px;
}

.concept-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.concept-list span {
  padding: 0.25rem 0.5rem;
  background: #edf4f2;
  color: #17665f;
  font-size: 0.65rem;
  font-weight: 700;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.day-grid div {
  padding: 1rem;
  background: var(--white);
  border-top: 3px solid var(--line-dark);
}

.day-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.week-project {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: #122c4d;
  color: var(--white);
}

.week-project p {
  margin: 0;
  color: #d8e4f1;
  font-size: 0.82rem;
}

.volume-list {
  display: grid;
  border-top: 1px solid var(--line-dark);
}

.volume-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  min-height: 112px;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line-dark);
}

.volume-code {
  color: var(--blue);
  font-family: var(--serif);
  font-size: 1.05rem;
}

.volume-row h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.volume-row p {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.volume-actions {
  display: flex;
  gap: 0.5rem;
}

.project-toolbar {
  width: min(420px, 100%);
  margin-bottom: 1rem;
}

.project-summary {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 32px;
  gap: 1rem;
  align-items: center;
  min-height: 76px;
  padding: 0.75rem 0.5rem;
}

.project-id {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
}

.project-body {
  padding: 0 0.5rem 1.5rem 134px;
}

.project-mvp {
  margin: 0 0 1.25rem;
  padding: 1rem 1.2rem;
  background: var(--white);
  border-left: 4px solid var(--teal);
  color: var(--ink-soft);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-grid > div {
  padding: 1rem;
  border: 1px solid var(--line);
}

.project-grid h4 {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
}

.template-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
}

.template-link {
  display: flex;
  min-height: 100px;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  font-family: var(--serif);
  font-size: 1rem;
  text-decoration: none;
}

.template-link span:last-child {
  color: var(--blue);
  font-family: var(--sans);
}

.faculty-access {
  display: flex;
  scroll-margin-top: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: #e9ece8;
  border-top: 5px solid var(--ink);
}

.loading-message,
.empty-message {
  padding: 2rem 0;
  color: var(--ink-soft);
}

.site-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem clamp(1.25rem, 7vw, 8rem);
  background: #0d2038;
  color: #dce5ef;
}

.site-footer img {
  width: 190px;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

.site-footer p {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
}

@media (max-width: 1100px) {
  .header-actions a:not(.primary-link) {
    display: none;
  }

  .library-hero {
    grid-template-columns: 1fr;
  }

  .hero-register {
    max-width: 600px;
  }

  .library-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .week-body {
    padding-left: 0.5rem;
  }

  .project-body {
    padding-left: 0.5rem;
  }
}

@media (max-width: 820px) {
  .site-header {
    min-height: 68px;
  }

  .brand img {
    width: 150px;
  }

  .brand span,
  .header-actions {
    display: none;
  }

  .mobile-index-button {
    display: inline-flex;
  }

  .library-hero {
    min-height: 0;
    padding-top: 4.5rem;
  }

  .progress-band {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .library-shell {
    display: block;
    padding-top: 2rem;
  }

  .course-index {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(340px, 88vw);
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--white);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .course-index.is-open {
    transform: translateX(0);
  }

  .index-heading button {
    display: block;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .week-jump {
    width: 100%;
  }

  .week-summary {
    grid-template-columns: 48px minmax(0, 1fr) 28px;
  }

  .week-summary .status {
    grid-column: 2;
    justify-self: start;
  }

  .week-summary .expand-mark {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .week-introduction,
  .day-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .volume-row {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .volume-actions {
    grid-column: 2;
  }

  .template-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faculty-access,
  .site-footer {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding-inline: 0.85rem;
  }

  .brand img {
    width: 118px;
  }

  .mobile-index-button {
    padding: 0.55rem 0.65rem;
    font-size: 0.7rem;
  }

  .library-hero {
    padding-inline: 1.1rem;
  }

  .library-hero h1 {
    max-width: 100%;
    font-size: 2.25rem;
    overflow-wrap: break-word;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-register {
    grid-template-columns: 1fr 1fr;
  }

  .hero-register div {
    min-height: 92px;
    padding: 1rem;
  }

  .hero-register span {
    font-size: 2rem;
  }

  .week-summary {
    gap: 0.65rem;
  }

  .week-number {
    font-size: 1.5rem;
  }

  .week-title strong,
  .project-summary strong {
    font-size: 1rem;
  }

  .day-content {
    padding-left: 0;
  }

  .project-summary {
    grid-template-columns: 1fr 28px;
  }

  .project-id {
    grid-column: 1;
  }

  .project-summary strong {
    grid-column: 1;
  }

  .project-summary .expand-mark {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .volume-row {
    grid-template-columns: 1fr;
  }

  .volume-actions {
    grid-column: 1;
    flex-wrap: wrap;
  }

  .template-list {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
