@font-face {
  font-family: "Crimson Pro";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/CrimsonPro-Variable.woff2) format("woff2");
}

@font-face {
  font-family: "Crimson Pro";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/CrimsonPro-VariableItalic.woff2) format("woff2");
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-text: #7C2D12;
  --color-text-secondary: #C2410C;
  --color-text-muted: #C2410C;
  --color-heading: #7C2D12;
  --color-bg: #FFF7ED;
  --color-rule: #D8BAAB;
  --color-highlight: #EA580C;
  --color-link: #1a1a1a;
  --color-link-hover: #C2410C;
  --color-mark: #C2410C;
  --color-imageBorder: #FFFFFF;
  --max-width: 640px;
  --font-serif: "Crimson Pro", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #FFF7ED;
    --color-text-secondary: #FED7AA;
    --color-text-muted: #777;
    --color-heading: #c0c0c0;
    --color-bg: #161616;
    --color-rule: #333333;
    --color-highlight: #FB923C;
    --color-link: #aaaaaa;
    --color-link-hover: #e0e0e0;
    --color-mark: #737373;
    --color-imageBorder: #333333;
  }
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-serif);
  font-weight: 300;
  font-optical-sizing: auto;
  line-height: 1.72;
  color: var(--color-text);
  background-color: var(--color-bg);
  padding: 0 1.33rem;
}

article {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0;
}

header {
  margin-bottom: 10rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-mark {
  display: block;
  width: 80px;
  height: 48px;
  margin-top: 6.67rem;
  margin-bottom: 6.67rem;
  color: #a81a1a;
  background-color: var(--color-mark);
  -webkit-mask-image: url(Union.svg);
  mask-image: url(Union.svg);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

h1 {
  font-size: 3rem;
  font-weight: 200;
  line-height: 3rem;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  text-box-trim: trim-both;
  width: 100%;
  text-align: center;
}

.highlight {
  color: var(--color-highlight);
}

.date {
  font-family: system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-weight: 300;
  width: 100%;
  text-align: center;
}

.note {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-weight: 300;
  max-width: 440px;
  padding: 12px 16px;
  border: 1px solid var(--color-rule);
}



h2 {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-heading);
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
  text-box-trim: trim-both;
}

h2 .muted {
  color: var(--color-text-muted);
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 300;
}

.block-note {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-weight: 300;
  padding: 12px 16px;
  border: 1px solid var(--color-rule);
  margin-bottom: 1.5rem;
}

.block-note p {
  font-size: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

img {
  width: 100%;
  border-radius: 8px;
  margin: 3rem 0 0.25rem 0;
  border: 2px solid var(--color-imageBorder);
}

.caption {
  font-size: 0.8rem;
  color: #777;
  line-height: 1.2;
  font-weight: 200;
  text-align: center;
  margin-bottom: 3rem;
  width:100%;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration: underline wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer li {
  margin-bottom: 0.5rem;
}

footer a, footer li {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 300;
  text-decoration: none;
}


em {
  font-style: italic;
}

strong {
  font-weight: 500;
}

.section-break {
  text-align: center;
  margin: 3rem 0;
  color: var(--color-rule);
  letter-spacing: 0.5em;
  font-size: 0.9rem;
  user-select: none;
}

blockquote, .formula, .pull-quote, .big-statement {
  margin: 2rem 0 2rem 2rem;
  font-size: 1.75rem;
  line-height: 2rem;
  font-weight: 300;
}

blockquote .attribution {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.25rem;
  color: var(--color-text-muted);
}

.closing-statement {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.55;
  margin: 3rem 0;
}

ol {
  margin: 1.5rem 0;
  list-style: none;
}

ol li {
  margin-bottom: 1.75rem;
}

ol li .list-title {
  display: block;
  font-weight: 400;
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

/* .formula {
  margin: 1.25rem 0 1.25rem 2rem;
  font-size: 1.75rem;
  font-weight: 400;
} */

hr {
  border: none;
  border-top: 1px solid var(--color-rule);
  margin: 3rem 0;
}

footer {
  margin-top: 4rem;
  padding-top: 4rem;
  padding-bottom: 8rem;
  border-top: 1px solid var(--color-rule);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: 4rem;
}

footer h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.data {
  font-size: 0.85rem;
  color: var(--color-link);
}

.data a {
  color: var(--color-link)
}

.data a:hover {
  color: var(--color-highlight);
  text-decoration: underline wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* Chapter Navigation */
.chapter-nav {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  width: 280px;
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  z-index: 100;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.chapter-nav-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.chapter-nav-progress {
  height: 100%;
  width: 0;
  background: var(--color-text-secondary);
  transition: width 0.15s linear;
}

.chapter-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.9rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-heading);
}

.chapter-nav-chevron {
  transition: transform 0.25s ease;
}

.chapter-nav.collapsed .chapter-nav-chevron {
  transform: rotate(180deg);
}

.chapter-nav-list {
  list-style: none;
  padding: 0.25rem 1.25rem 1.25rem;
  margin: 0;
  max-height: 600px;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease;
  opacity: 1;
}

.chapter-nav.collapsed .chapter-nav-list {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.chapter-nav-list li {
  margin-bottom: 0.15rem;
}

.chapter-nav-list li:last-child {
  margin-bottom: 0;
}

.chapter-nav-list a {
  display: block;
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 300;
  color: var(--color-text);
  line-height: 1.4;
  padding: 0.3rem 0;
  transition: color 0.2s ease;
}

.chapter-nav-list li.active a {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.chapter-nav-list a:hover {
  color: var(--color-text-secondary);
}

.chapter-nav-list li.chapter-nav-sources {
  margin-top: 0.75rem;
}

.chapter-nav-list li.chapter-nav-sources a {
  color: var(--color-text-muted);
  font-weight: 300;
}

.chapter-nav-list-icon {
  display: none;
}

@media (max-width: 1100px) {
  .chapter-nav {
    width: auto;
  }

  .chapter-nav-toggle span {
    display: none;
  }

  .chapter-nav-toggle {
    padding: 0.75rem;
    justify-content: center;
  }

  .chapter-nav-chevron {
    display: none;
  }

  .chapter-nav.collapsed .chapter-nav-list-icon {
    display: block;
  }

  .chapter-nav-list {
    display: none;
  }

  .chapter-nav:not(.collapsed) {
    width: 280px;
  }

  .chapter-nav:not(.collapsed) .chapter-nav-toggle span {
    display: inline;
  }

  .chapter-nav:not(.collapsed) .chapter-nav-chevron {
    display: block;
  }

  .chapter-nav:not(.collapsed) .chapter-nav-list-icon {
    display: none;
  }

  .chapter-nav:not(.collapsed) .chapter-nav-toggle {
    padding: 0.9rem 1.25rem;
    justify-content: space-between;
  }

  .chapter-nav:not(.collapsed) .chapter-nav-list {
    display: block;
    max-height: 600px;
    padding: 0.25rem 1.25rem 1.25rem;
    opacity: 1;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  cursor: zoom-out;
  padding: 2rem;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  border: none;
  margin: 0;
  cursor: default;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.img-zoom-wrapper {
  position: relative;
  display: block;
  cursor: pointer;
  margin: 3rem 0 0.25rem 0;
}

.img-zoom-wrapper img {
  display: block;
  margin: 0;
  transition: opacity 0.2s ease;
}

.img-zoom-tag {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.75rem;
  border-radius: 100px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.img-zoom-tag svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.img-zoom-wrapper:hover .img-zoom-tag {
  opacity: 1;
}

.img-zoom-wrapper:hover img {
  opacity: 0.8;
}

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }


  body {
    padding: 0 1.5rem 0 1.5rem;;
  }

  header {
    align-items: flex-start;
    margin-bottom: 4rem;
  }

  article {
    padding: 3.5rem 0 5rem;
  }

  h1 {
    font-size: 2.25rem;
    line-height: 2.25rem;
    text-align: left;
  }

  p {
    font-size: 1.25rem;
    line-height: 1.7rem;
    text-align: left;
    width: 90%;
  }

  .date {
    text-align: left;
  }

  .note {
    text-align: left;
  }

  .caption {
    width:100%;
  }

  blockquote,
  .pull-quote {
    margin-left: 0;
    font-size: 1.75rem;
    line-height: 2.25rem;
  }

  .formula {
    margin-left: 1rem;
  }
}
