/* =================================================
   BASE LAYOUT
================================================= */

body {
  font-size: 16.5px;
  line-height: 1.7;
  color: #1f2937;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.main-container {
  max-width: 860px;
}

.contents {
  padding-top: 2.6rem;
}

.page-header {
  margin-bottom: 2.2rem;
  border-bottom: none !important;
}


/* =================================================
   TYPOGRAPHY (KEY DIFFERENCE)
================================================= */

h1, h2, h3, h4 {
  font-family: "Inter", sans-serif;
  letter-spacing: -0.028em;
  color: #111827;
}

/* HERO */
h1 {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.02;
  margin-top: 0.2rem;
  margin-bottom: 1.8rem;
}

/* SECTION TITLES (more authority) */
h2 {
  font-size: 2.05rem;
  font-weight: 650;
  line-height: 1.12;
  margin-top: 3.6rem;
  margin-bottom: 1rem;
}

/* first section tighter */
.section.level2:first-of-type h2,
h1 + h2 {
  margin-top: 2.5rem;
}

/* SUBSECTIONS */
h3 {
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2.4rem;
  margin-bottom: 0.7rem;
}

h4 {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.8rem;
  margin-bottom: 0.6rem;
}

/* BODY TEXT */
p {
  font-size: 1.05rem;
  line-height: 1.72;
  color: #374151;
  margin-bottom: 1.1rem;
}

/* LISTS */
ul, ol {
  margin-top: 0.7rem;
  margin-bottom: 1.3rem;
  padding-left: 1.5rem;
}

li {
  font-size: 1.03rem;
  line-height: 1.65;
  margin-bottom: 0.12rem;
  color: #374151;
}


/* =================================================
   SECTION FLOW (IMPORTANT)
================================================= */

.section.level2 {
  margin-bottom: 0.5rem;
}

.section.level3 {
  margin-bottom: 0.25rem;
}


/* =================================================
   CODE (more refined)
================================================= */

code {
  font-size: 0.92em;
  padding: 0.14em 0.34em;
  border-radius: 6px;
  background: #f3f4f6;
  color: #111827;
}

pre {
  background: #fafafa;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin-top: 1.3rem;
  margin-bottom: 1.7rem;
  line-height: 1.32;
}

pre code {
  background: transparent;
  padding: 0;
}


/* =================================================
   BLOCKQUOTE (clean callout)
================================================= */

blockquote {
  border-left: 3px solid #e5e7eb;
  padding-left: 0.9rem;
  margin: 1.9rem 0;
  color: #374151;
}

blockquote p {
  margin-bottom: 0.3rem;
}


/* =================================================
   NAVBAR
================================================= */

.navbar {
  border-bottom: 1px solid #f3f4f6;
  box-shadow: none;
  min-height: 64px;
}

.navbar-brand {
  font-weight: 650;
  letter-spacing: -0.015em;
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: #6b7280 !important;
}

.navbar-nav .nav-link:hover {
  color: #111827 !important;
}


/* =================================================
   SIDEBAR (much cleaner)
================================================= */

.pkgdown-sidebar {
  padding-top: 2.6rem;
}

.pkgdown-sidebar h2,
.pkgdown-sidebar h3,
.pkgdown-sidebar h4 {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.pkgdown-sidebar p,
.pkgdown-sidebar li {
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 0.3rem;
}

.pkgdown-sidebar section {
  margin-bottom: 1.6rem;
}


/* =================================================
   TOC (Stripe style)
================================================= */

#toc {
  font-size: 0.84rem;
  line-height: 1.2;
}

#toc .nav-link {
  color: #9ca3af;
  padding: 0.05rem 0;
}

#toc .nav-link.active {
  color: #111827;
  font-weight: 500;
}

#toc .nav-link:hover {
  color: #111827;
}


/* =================================================
   TABLES & FIGURES
================================================= */

table {
  margin-top: 1.5rem;
  margin-bottom: 1.9rem;
}

img,
.figure {
  margin-top: 1.2rem;
  margin-bottom: 1.5rem;
}


/* =================================================
   CLEANUP
================================================= */

hr {
  display: none;
}


/* =================================================
   RESPONSIVE
================================================= */

@media (max-width: 768px) {
  .contents {
    padding-top: 1.6rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.75rem;
    margin-top: 2.6rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  p, li {
    font-size: 1rem;
  }
}

.navbar + .container,
.navbar + .container-fluid {
  padding-top: 1.4rem;
}
