@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,500;6..72,600&display=swap');

:root {
  --ink: #18231f;
  --muted: #52615a;
  --forest: #0d5b46;
  --forest-dark: #093d31;
  --water: #087c91;
  --coral: #db684b;
  --sun: #f1b24a;
  --mist: #eef4f0;
  --line: #cbd8d1;
  --paper: #fbfcf9;
}

html { scroll-padding-top: 5rem; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 1.02rem;
  line-height: 1.72;
}

.navbar {
  background: rgba(7, 28, 27, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 4rem;
}

.navbar-brand, .navbar-nav .nav-link { color: #fff; font-weight: 600; }
.navbar-brand:hover, .navbar-nav .nav-link:hover { color: #8ed7cb; }
#quarto-content, #quarto-document-content { padding: 0; }

.course-hero {
  align-items: center;
  background-image: linear-gradient(90deg, rgba(2, 15, 21, 0.94) 0%, rgba(3, 20, 25, 0.76) 34%, rgba(3, 18, 23, 0.08) 67%), url("assets/planetary-futures-hero.jpg");
  background-position: center;
  background-size: cover;
  display: flex;
  min-height: min(72vh, 720px);
  margin-left: calc(50% - 50vw);
  padding: 5rem max(1.5rem, calc((100vw - 1180px) / 2));
  width: 100vw;
}

.hero-content { color: #fff; max-width: 710px; }

.course-kicker, .section-label {
  color: #9de3d5;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  margin: 0 0 1.25rem;
  text-transform: uppercase;
}

.hero-content h1 {
  color: #fff;
  font-family: "Newsreader", serif;
  font-size: clamp(3rem, 6.7vw, 6rem);
  font-weight: 500;
  line-height: 0.98;
  margin: 0 0 1.5rem;
  max-width: 700px;
}

.hero-content > p:not(.course-kicker) {
  font-size: 1.22rem;
  line-height: 1.55;
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-link {
  border-bottom: 2px solid var(--sun);
  color: #fff;
  display: inline-block;
  font-weight: 700;
  padding: 0.35rem 0;
  text-decoration: none;
}

.hero-link:hover { color: #b7f0e5; }

.course-facts {
  background: var(--forest-dark);
  color: #fff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-left: calc(50% - 50vw);
  padding: 1.55rem max(1.5rem, calc((100vw - 1180px) / 2));
  width: 100vw;
}

.fact {
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 600;
  min-width: 0;
  padding: 0 1.25rem;
}

.fact:first-child { border-left: 0; padding-left: 0; }

.fact span {
  color: #9de3d5;
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.page-shell { margin: 0 auto; max-width: 1180px; padding: 4rem 2rem 6rem; }

.page-shell > h2 {
  color: var(--forest-dark);
  font-family: "Newsreader", serif;
  font-size: 2.55rem;
  font-weight: 600;
  line-height: 1.08;
  margin-top: 4.75rem;
}

.page-shell > h2:first-child { margin-top: 0; }
.page-shell > p, .page-shell > ol, .page-shell > .table-responsive { max-width: 820px; }

.question-grid {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 3.5rem 0;
}

.question-item { min-width: 0; padding: 2rem 2.5rem 2rem 0; }
.question-item:nth-child(even) { border-left: 1px solid var(--line); padding-left: 2.5rem; }
.question-item h3 { color: var(--water); font-size: 1.15rem; margin-top: 0; }
.question-item p { color: var(--muted); margin-bottom: 0; }

.project-feature {
  background: var(--forest-dark);
  border-left: 6px solid var(--coral);
  color: #f3f7f4;
  margin: 4rem 0;
  padding: 2.4rem 3rem;
}

.project-feature h3 {
  color: #fff;
  font-family: "Newsreader", serif;
  font-size: 2rem;
  margin-top: 0;
}

.project-feature p:last-child { margin-bottom: 0; max-width: 880px; }
.section-label { margin-bottom: 0.5rem; }
table { border-color: var(--line); font-size: 0.94rem; }
thead { background: var(--mist); color: var(--forest-dark); }
th, td { padding: 0.85rem 1rem !important; vertical-align: top; }
tbody tr:hover { background: rgba(238, 244, 240, 0.58); }

.closing-note {
  border-top: 3px solid var(--sun);
  color: var(--muted);
  font-size: 0.93rem;
  margin-top: 4rem;
  max-width: 820px;
  padding-top: 1.25rem;
}

#TOC { border-left: 1px solid var(--line); font-size: 0.82rem; padding-left: 1rem; }
#TOC .active { border-left: 2px solid var(--coral); color: var(--forest); font-weight: 700; }
.nav-footer { background: #071c1b; color: #dfe9e4; }
.nav-footer a { color: #9de3d5; }

@media (max-width: 900px) {
  .course-hero {
    background-image: linear-gradient(90deg, rgba(2, 15, 21, 0.92) 0%, rgba(3, 20, 25, 0.66) 60%, rgba(3, 18, 23, 0.2) 100%), url("assets/planetary-futures-hero.jpg");
    min-height: 650px;
  }
  .course-facts { grid-template-columns: repeat(2, 1fr); row-gap: 1.5rem; }
  .fact:nth-child(3) { border-left: 0; padding-left: 0; }
}

@media (max-width: 600px) {
  .course-hero { align-items: flex-end; background-position: 62% center; min-height: calc(100svh - 4rem); padding-bottom: 4rem; }
  .hero-content h1 { font-size: 3.25rem; }
  .course-facts { grid-template-columns: 1fr; }
  .fact, .fact:first-child, .fact:nth-child(3) { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.18); padding: 0.85rem 0 0; }
  .fact:first-child { border-top: 0; padding-top: 0; }
  .page-shell { padding: 3rem 1.25rem 5rem; }
  .page-shell > h2 { font-size: 2.15rem; }
  .question-grid { grid-template-columns: 1fr; }
  .question-item, .question-item:nth-child(even) { border-left: 0; border-top: 1px solid var(--line); padding: 1.5rem 0; }
  .question-item:first-child { border-top: 0; }
  .project-feature { padding: 1.75rem 1.5rem; }
  th, td { padding: 0.7rem !important; }
}

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