@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap');

:root {
  --bg: #ffffff;
  --ink: #101010;
  --muted: #4b5563;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --soft: #f7f7f7;
  --card: #ffffff;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #c9c9c9;
  text-underline-offset: 2px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

a:hover,
a:focus-visible {
  text-decoration-color: var(--ink);
}

img {
  max-width: 100%;
  height: auto;
}

.btn,
.site-nav__link,
.site-return,
.course-links a,
.faq summary,
.resource-list .btn,
.utility-links .btn,
.detail-links .btn {
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, text-decoration-color 0.18s ease;
}

.pdf-link::before {
  content: "📄";
  display: inline-block;
  margin-right: 0.34rem;
  line-height: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.72rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  text-decoration: none;
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-brand:hover,
.site-brand:focus-visible {
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: 0.8rem;
  flex-wrap: wrap;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.15rem 0;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #4b5563;
  white-space: nowrap;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  border-bottom-color: #111;
  color: #111;
  text-decoration: none;
}

.site-nav__link.is-active {
  background: transparent;
  border-bottom-color: #111;
  color: #111;
}

.site-return {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #111;
  border-radius: 8px;
  padding: 0.42rem 0.68rem;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-return:hover,
.site-return:focus-visible {
  background: #111;
  color: #fff;
  text-decoration: none;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.15rem 1rem 4rem;
}

.hero {
  border: 0;
  border-bottom: 1px solid #111;
  border-radius: 0;
  padding: 0 0 1.5rem;
  margin-bottom: 1.7rem;
  background: #fff;
}

.hero__eyebrow {
  display: inline-flex;
  border: 0;
  border-radius: 0;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #374151;
  padding: 0;
  margin-bottom: 0.55rem;
  font-weight: 600;
}

h1,
h2,
h3 {
  margin: 0;
  color: #000;
  line-height: 1.22;
}

h1 {
  font-size: clamp(1.7rem, 2.9vw, 2.3rem);
  letter-spacing: -0.01em;
}

.hero__subtitle {
  margin-top: 0.6rem;
  color: #374151;
  max-width: 76ch;
  font-size: 1rem;
}

.hero__meta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.meta-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.26rem 0.58rem;
  font-size: 0.76rem;
  color: #374151;
}

.section {
  margin-top: 2rem;
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.32rem;
}

.section__title {
  font-size: 1.24rem;
}

.section__note {
  font-size: 0.78rem;
  color: #4b5563;
}

.grid {
  display: grid;
  gap: 0.8rem;
}

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

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1rem;
}

.card:hover {
  border-color: var(--line-strong);
}

.card h3 {
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
}

.card p {
  margin: 0.35rem 0 0;
  color: #374151;
  font-size: 0.92rem;
}

.card ul {
  margin: 0.55rem 0 0;
  padding-left: 1.15rem;
  color: #1f2937;
}

.card li + li {
  margin-top: 0.3rem;
}

.card__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #111;
}

.btn:hover,
.btn:focus-visible {
  text-decoration: underline;
  text-decoration-color: #111;
}

.btn::after {
  content: "↗";
  font-size: 0.72rem;
  margin-left: 0.25rem;
  color: #6b7280;
}

.btn--solid {
  background: #111;
  border: 1px solid #111;
  border-radius: 8px;
  padding: 0.43rem 0.68rem;
  color: #fff;
  text-decoration: none;
}

.btn--solid::after {
  content: "";
  margin: 0;
}

.btn--solid:hover,
.btn--solid:focus-visible {
  color: #fff;
  background: #222;
  text-decoration: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.95rem;
}

.hero-actions .btn {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.43rem 0.68rem;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.hero-actions .btn::after {
  content: "";
  margin: 0;
}

.hero-actions .btn:hover,
.hero-actions .btn:focus-visible {
  border-color: #111;
  background: #f8fafc;
  text-decoration: none;
}

.hero-actions .btn--solid {
  background: #111;
  border-color: #111;
  color: #fff;
}

.hero-actions .btn--solid:hover,
.hero-actions .btn--solid:focus-visible {
  background: #222;
  color: #fff;
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-top: 0.8rem;
}

.resource-list .btn {
  display: flex;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.43rem 0.58rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}

.resource-list .btn::after {
  content: "→";
  font-size: 0.75rem;
  margin-left: 0.45rem;
  color: #6b7280;
}

.resource-list .btn:hover,
.resource-list .btn:focus-visible {
  border-color: #111;
  background: #fafafa;
  text-decoration: none;
}

.resource-list .btn--solid {
  background: #111;
  border-color: #111;
  color: #fff;
  font-weight: 600;
}

.resource-list .btn--solid::after {
  content: "↗";
  color: #fff;
}

.resource-list .btn--solid:hover,
.resource-list .btn--solid:focus-visible {
  background: #222;
  border-color: #111;
  color: #fff;
}

.utility-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.72rem;
}

.utility-links .btn {
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 0.27rem 0.58rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
}

.utility-links .btn::after {
  content: "";
  margin: 0;
}

.utility-links .btn:hover,
.utility-links .btn:focus-visible {
  border-style: solid;
  border-color: #111;
  background: #f8fafc;
  color: #111;
  text-decoration: none;
}

.detail-links {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-links .btn {
  border: 0;
  border-bottom: 1px solid #111;
  padding-bottom: 0.06rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.detail-links .btn::after {
  content: "→";
  margin-left: 0.26rem;
  color: #111;
}

.detail-links .btn:hover,
.detail-links .btn:focus-visible {
  opacity: 1;
  border-bottom-color: #6b7280;
  text-decoration: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline {
  border-left: 2px solid var(--line);
  margin-left: 0.45rem;
  padding-left: 1.05rem;
}

.timeline__item {
  position: relative;
  padding-bottom: 1rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -1.18rem;
  top: 0.38rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #111;
}

.timeline__kicker {
  margin: 0;
  font-size: 0.74rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.timeline__title {
  margin: 0.1rem 0 0;
  font-size: 1.02rem;
}

.timeline__desc {
  margin: 0.35rem 0 0;
  color: #374151;
  font-size: 0.91rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.66rem 0.72rem;
  vertical-align: top;
}

th {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #374151;
  background: var(--soft);
}

td {
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: 0;
}

.faq {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.faq + .faq {
  margin-top: 0.6rem;
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 0.78rem 0.88rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary:hover,
.faq summary:focus-visible {
  background: #f8fafc;
}

.faq[open] summary {
  border-bottom: 1px solid var(--line);
}

.faq__content {
  padding: 0.8rem 0.88rem 0.9rem;
  color: #374151;
  font-size: 0.9rem;
}

.footer {
  max-width: 1120px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: #4b5563;
  font-size: 0.76rem;
}

.text-serif {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

.muted {
  color: #4b5563;
}

body.nav-sidebar.floating {
  padding-top: 62px !important;
  background: #fff;
}

#quarto-search-results,
#quarto-sidebar,
#quarto-sidebar-glass,
#quarto-margin-sidebar,
.sidebar,
.margin-sidebar,
.quarto-btn-toggle,
.quarto-search-button,
.quarto-page-breadcrumbs {
  display: none !important;
}

#quarto-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

#quarto-header .quarto-secondary-nav {
  background: transparent;
  border-bottom: 0;
}

#quarto-header .container-fluid {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.58rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.home-chip {
  display: inline-flex;
  align-items: center;
  position: static;
  z-index: auto;
  border: 1px solid #111;
  border-radius: 8px;
  padding: 0.42rem 0.68rem;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #fff;
  color: #111 !important;
  white-space: nowrap;
  margin-left: auto;
  order: 2;
}

.home-chip:hover,
.home-chip:focus-visible {
  border-color: #111;
  background: #111;
  color: #fff !important;
}

.course-links {
  order: 1;
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.course-links a {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.15rem 0;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #4b5563;
  white-space: nowrap;
}

.course-links a:hover,
.course-links a:focus-visible {
  border-bottom-color: #9ca3af;
  color: #111;
}

#quarto-content {
  max-width: 1120px;
  margin: 0 auto;
  display: block !important;
  padding: 1.6rem 1rem 3rem;
}

main.content {
  max-width: 860px;
  margin: 0 auto;
  color: #111;
  font-size: 1rem;
  line-height: 1.72;
}

main.content > *:first-child {
  margin-top: 0;
}

main.content p {
  margin: 0 0 0.95rem;
  color: #111827;
}

main.content ul,
main.content ol {
  margin: 0.48rem 0 1rem;
  padding-left: 1.24rem;
}

main.content li + li {
  margin-top: 0.3rem;
}

main.content li > p {
  margin: 0.22rem 0 0.62rem;
}

#title-block-header {
  border-bottom: 1px solid #111;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
}

#title-block-header .quarto-title-breadcrumbs {
  display: none !important;
}

#title-block-header .quarto-title-meta {
  display: none;
}

#title-block-header .title {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.65rem, 2.8vw, 2.2rem);
  letter-spacing: -0.01em;
  line-height: 1.22;
}

main.content section.level1 {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 1.05rem 1.12rem 1.15rem;
  margin: 0 0 0.98rem;
}

main.content section.level1 > h1 {
  margin: 0 0 0.72rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.15rem;
  line-height: 1.38;
  letter-spacing: -0.01em;
}

main.content > section.level2 {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 1rem 1.08rem 1.08rem;
  margin: 0 0 0.98rem;
}

main.content > section.level2 > h2.anchored {
  margin: 0 0 0.7rem;
  padding-bottom: 0.44rem;
  border-bottom: 1px solid var(--line);
}

main.content h2.anchored {
  margin: 1.22rem 0 0.6rem;
  font-size: 1.1rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

main.content h3.anchored {
  margin: 1rem 0 0.48rem;
  font-size: 0.98rem;
  line-height: 1.42;
}

main.content .math.display {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
}

main.content .katex-display {
  margin: 0.85rem 0 1rem;
  padding: 0.58rem 0.7rem;
  border: 1px solid #ececec;
  border-radius: 10px;
  background: #fafafa;
  overflow-x: auto;
  overflow-y: hidden;
}

main.content .katex-display > .katex {
  min-width: max-content;
}

main.content blockquote {
  margin: 0.9rem 0 1rem;
  padding: 0.68rem 0.86rem;
  border-left: 3px solid #111;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
}

main.content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.12rem 0;
}

main.content table {
  margin: 0.95rem 0 1.2rem;
  font-size: 0.9rem;
}

main.content .quarto-figure {
  margin: 1rem 0 1.12rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.56rem;
}

main.content .quarto-figure img,
main.content img.figure-img {
  border-radius: 8px;
}

main.content figcaption,
main.content .figure-caption {
  margin-top: 0.45rem;
  color: #4b5563;
  font-size: 0.81rem;
}

main.content .footnotes {
  margin-top: 1.45rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

body.nav-sidebar.floating .grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

body.nav-sidebar.floating .grid > .g-col-1 {
  grid-column: auto / span 1;
}

body.nav-sidebar.floating .grid > .g-col-2 {
  grid-column: auto / span 2;
}

body.nav-sidebar.floating .grid > .g-col-3 {
  grid-column: auto / span 3;
}

body.nav-sidebar.floating .grid > .g-col-4 {
  grid-column: auto / span 4;
}

body.nav-sidebar.floating .grid > .g-col-5 {
  grid-column: auto / span 5;
}

body.nav-sidebar.floating .grid > .g-col-6 {
  grid-column: auto / span 6;
}

body.nav-sidebar.floating .grid > .g-col-7 {
  grid-column: auto / span 7;
}

body.nav-sidebar.floating .grid > .g-col-8 {
  grid-column: auto / span 8;
}

body.nav-sidebar.floating .grid > .g-col-9 {
  grid-column: auto / span 9;
}

body.nav-sidebar.floating .grid > .g-col-10 {
  grid-column: auto / span 10;
}

body.nav-sidebar.floating .grid > .g-col-11 {
  grid-column: auto / span 11;
}

body.nav-sidebar.floating .grid > .g-col-12 {
  grid-column: auto / span 12;
}

@media (max-width: 900px) {
  .course-links {
    gap: 0.62rem;
  }

  .course-links a {
    font-size: 0.63rem;
    letter-spacing: 0.07em;
  }

  .home-chip {
    font-size: 0.63rem;
    padding: 0.4rem 0.6rem;
  }

  main.content {
    max-width: 100%;
    line-height: 1.68;
  }

  main.content section.level1 {
    padding: 0.9rem 0.86rem 0.95rem;
  }

  main.content > section.level2 {
    padding: 0.9rem 0.86rem 0.95rem;
  }

  body.nav-sidebar.floating .grid > [class^="g-col-"],
  body.nav-sidebar.floating .grid > [class*=" g-col-"] {
    grid-column: auto / span 12;
  }
}

@media (max-width: 980px) {
  .grid--3 {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .site-nav {
    margin-left: 0;
    gap: 0.6rem 0.82rem;
  }

  .site-nav__link {
    font-size: 0.63rem;
  }

  .site-return {
    margin-left: 0;
  }

  .page {
    padding-top: 1.35rem;
  }

  .hero {
    padding: 0 0 1.15rem;
  }

  .hero-actions .btn {
    font-size: 0.74rem;
    padding: 0.38rem 0.58rem;
  }

  .resource-list .btn {
    font-size: 0.77rem;
  }

  th,
  td {
    padding: 0.54rem;
  }

  body.nav-sidebar.floating {
    padding-top: 90px !important;
  }

  #quarto-header .container-fluid {
    gap: 0.42rem 0.7rem;
    align-items: flex-start;
  }

  .course-links {
    order: 2;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    padding-bottom: 0.1rem;
  }

  .course-links::-webkit-scrollbar {
    display: none;
  }

  .home-chip {
    order: 1;
    margin-left: 0;
  }

  #quarto-content {
    padding-top: 1.12rem;
  }

  #title-block-header .title {
    font-size: 1.48rem;
  }
}
