@font-face {
  font-family: 'Departure Mono';
  src: url('./DepartureMono-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Theme Variables ── */
:root {
  --bg: #D0D0D0;
  --text-primary: #000;
  --text-body: #000;
  --text-secondary: rgba(0, 0, 0, 0.55);
  --text-muted: rgba(0, 0, 0, 0.30);
  --accent: #373FE5;
  --border-color: #000;
  --border-light: rgba(0, 0, 0, 0.24);
  --card-bg: #D9D9D9;
  --btn-bg: #E2E2E2;
  --code-bg: rgba(0, 120, 64, 0.12);
  --code-border: rgba(0, 120, 64, 0.26);
  --scroll-color: rgb(0, 0, 255);
  --scroll-bg: var(--bg);
  --menu-backdrop: rgba(0, 0, 0, 0.42);
  --spark-color: #373FE5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0A09;
    --text-primary: #F4F6FF;
    --text-body: rgba(255, 255, 255, 0.72);
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.30);
    --accent: #7B83FF;
    --border-color: rgba(255, 255, 255, 0.2);
    --border-light: rgba(255, 255, 255, 0.12);
    --card-bg: rgba(255, 255, 255, 0.06);
    --btn-bg: #1E1C1B;
    --code-bg: rgba(0, 180, 90, 0.12);
    --code-border: rgba(0, 180, 90, 0.2);
    --scroll-color: rgb(117, 243, 72);
    --scroll-bg: var(--bg);
    --menu-backdrop: rgba(0, 0, 0, 0.6);
    --spark-color: #7B83FF;
  }
}

::selection {
  background: #EB5B23;
  color: #fff;
}

::-moz-selection {
  background: #EB5B23;
  color: #fff;
}

html {
  background: var(--bg);
  overscroll-behavior: none;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-color) var(--bg);
}

@media (max-width: 750px) {
  html {
    scrollbar-width: none;
  }
  html::-webkit-scrollbar {
    display: none;
  }
}

html::-webkit-scrollbar {
  width: 8px;
  background: var(--bg);
}

html::-webkit-scrollbar-track {
  background: var(--bg);
}

html::-webkit-scrollbar-thumb {
  background: var(--scroll-color);
  border-radius: 0;
}


body {
  display: flex;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  max-width: 720px;
  width: 100vw;
  flex-direction: column;
  align-items: flex-start;
  background: var(--bg);
  color: var(--text-primary);
  margin: 0 auto;
  padding: 0;
  height: auto;
  min-height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  text-align: left;
}


.site-header {
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background: transparent;
  padding-top: env(safe-area-inset-top, 0px);
}

.site-header--simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  box-sizing: border-box;
}

.header {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  padding: 16px 20px;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
}

/* ── Logo typewriter ── */
.site-logo {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: var(--text-primary);
  line-height: 1;
  font-size: 18px;
  font-family: Notable, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
  height: 18px;
  position: relative;
}

.site-logo::after {
  content: '';
  position: absolute;
  inset: -4px -4px -4px -4px;
  min-width: 160px;
}

.logo-type {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: baseline;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-logo:hover .logo-type,
.site-logo.is-decrypting .logo-type {
  max-width: 120px;
}

.header-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
}

.h1 {
  color: var(--text-primary);
  font-family: Notable;
  font-size: 30px;
  font-style: normal;
  font-weight: 400;
  line-height: 148%;
  margin: 0;
  align-self: stretch;
}

.location {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 0px;
}

.header-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
}

.menu-trigger,
.menu-btn {
  font-family: Newsreader, serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--btn-bg, var(--card-bg));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 12px;
  line-height: 1;
  transition: color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.menu-trigger:hover,
.menu-btn:hover {
  color: var(--text-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.bottom-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px 48px;
  width: 100%;
  box-sizing: border-box;
}

.bottom-cta a {
  display: inline-flex;
  padding: 12px 20px;
  align-items: center;
  justify-content: center;
  font-family: Newsreader, serif;
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;
  color: var(--text-secondary);
  border: none;
  border-radius: 8px;
  background: var(--btn-bg, var(--card-bg));
  cursor: pointer;
  transition: color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.bottom-cta a:hover {
  color: var(--text-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.section-divider {
  width: 72px;
  height: 1px;
  background: var(--border-light);
  margin: 40px auto;
  align-self: center;
}

.departure {
  color: var(--text-primary);
  font-family: "Departure Mono";
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  margin: 0;
}
.departure.size-12 {
  font-size: 12px;
  line-height: 140%; /* 16.8px */
  letter-spacing: -0.48px;
}
.departure.size-14 {
  font-size: 14px;
  line-height: 140%; /* 16.8px */
  letter-spacing: -0.48px;
}
.departure.size-16 {
  font-size: 16px;
  letter-spacing: -0.32px;
}
.departure.color-blue {
  color: var(--accent);
  cursor: pointer;
}

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

.scroll-progress {
  display: block;
  position: fixed;
  bottom: 0;
  left: 0;
  height: 8px;
  width: 100%;
  background: transparent;
  z-index: 99;
}

.scroll-progress-fill {
  width: 0;
  height: 100%;
  background: var(--scroll-color);
  transition: width 120ms linear;
}

.staggered-menu {
  position: fixed;
  inset: 0;
  z-index: 14000;
  pointer-events: none;
}

.staggered-menu-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: var(--menu-backdrop);
  opacity: 0;
  transition: opacity 220ms ease;
}

.staggered-menu-panel {
  position: absolute;
  inset: 0;
  background: rgb(0, 0, 255);
  color: #d7ddff;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateY(-16px);
  opacity: 0;
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 220ms ease;
}

.staggered-menu-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 26px;
}


.staggered-menu-panel .menu-btn {
  color: #d7ddff;
  background: rgba(255, 255, 255, 0.12);
}

.staggered-menu-panel .menu-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.staggered-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.staggered-menu-list li {
  opacity: 0;
  transform: translateY(14px);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 220ms ease;
}

.staggered-menu-list a {
  color: #f4f6ff;
  text-decoration: none;
  font-family: Notable, sans-serif;
  font-size: clamp(24px, 6vw, 48px);
  line-height: 1.1;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}

.menu-arrow {
  display: inline-block;
  flex-shrink: 0;
  max-width: 0;
  margin-right: 0;
  overflow: hidden;
  font-family: Notable, sans-serif;
  transition: max-width 0.2s linear, margin-right 0.2s linear;
}

.staggered-menu-list a:hover .menu-arrow {
  max-width: 1em;
  margin-right: 0.2em;
}

@media (max-width: 710px) {
  .menu-arrow {
    max-width: 1em;
    margin-right: 0.2em;
  }
}

.menu-item--disabled {
  pointer-events: none;
  display: flex;
  align-items: center;
  font-size: clamp(24px, 6vw, 48px);
}

.staggered-menu.is-open .staggered-menu-list .menu-item--disabled {
  opacity: 0.5;
}

.menu-item--disabled .menu-label {
  font-family: Notable, sans-serif;
  font-size: clamp(24px, 6vw, 48px);
  line-height: 1.1;
  font-weight: 400;
  color: #f4f6ff;
}

.menu-label {
  display: inline-block;
}

.staggered-menu-list a:hover {
  color: #ffffff;
}

.menu-heading {
  pointer-events: none;
}

.menu-heading span {
  font-family: 'Departure Mono', monospace;
  font-size: 14px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.05em;
}

.menu-divider {
  pointer-events: none;
  height: 40px;
  list-style: none;
}

.staggered-menu.is-open {
  pointer-events: auto;
}

.staggered-menu.is-open .staggered-menu-backdrop {
  opacity: 1;
}

.staggered-menu.is-open .staggered-menu-panel {
  transform: translateY(0);
  opacity: 1;
}

.staggered-menu.is-open .staggered-menu-list li {
  opacity: 1;
  transform: translateY(0);
}

.staggered-menu.is-open .staggered-menu-list li:nth-child(1) { transition-delay: 80ms; }
.staggered-menu.is-open .staggered-menu-list li:nth-child(2) { transition-delay: 130ms; }
.staggered-menu.is-open .staggered-menu-list li:nth-child(3) { transition-delay: 180ms; }
.staggered-menu.is-open .staggered-menu-list li:nth-child(4) { transition-delay: 230ms; }
.staggered-menu.is-open .staggered-menu-list li:nth-child(5) { transition-delay: 280ms; }
.staggered-menu.is-open .staggered-menu-list li:nth-child(6) { transition-delay: 330ms; }
.staggered-menu.is-open .staggered-menu-list li:nth-child(7) { transition-delay: 380ms; }
.staggered-menu.is-open .staggered-menu-list li:nth-child(8) { transition-delay: 430ms; }

.staggered-menu-footer {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  gap: 40px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.staggered-menu.is-open .staggered-menu-footer {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 480ms;
}

.menu-footer-link {
  font-family: 'Departure Mono', monospace;
  font-size: 14px;
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.15s ease;
  padding: 12px 16px;
  margin: -12px -16px;
}

.menu-footer-link:hover {
  opacity: 0.7;
}

body.menu-open {
  overflow: hidden;
}

.page-content {
  display: flex;
  padding: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  align-self: stretch;
}

/* 1. Restore your original spacing */
.toc {
  padding: 0 20px;
  align-self: stretch;
}

.toc-links {
  list-style-type: disc;
  padding-left: 16px; /* Adjust this to match your original bullet indent */
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.toc-links li {
  margin-bottom: 4px; /* Spacing between items */
  width: 100%;
  box-sizing: border-box;
}

.toc-links li a {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 8px;
  margin: 12px;
  text-decoration: none;
  color: var(--text-primary);
  max-width: 100%;
  box-sizing: border-box;
}

.toc-links li a::after {
  content: "";
  border-bottom: 1px dotted var(--text-primary);
  height: 1px;
  width: 100%;
  display: inline-block;
}
.toc-links li::marker {
  font-size: 12px;
  color: var(--text-primary);
}

.line-divider {
  border: none;
  margin: 0px;
  height: 1px;
  width: 100vw;
  display: block;
  background-color: var(--border-color);
  position: relative;
  left: 50%;
  margin-left: -50vw;
}

.page-title {
  display: flex;
  padding: 0 20px;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 580px;
  width: 100%;
  box-sizing: border-box;
  align-self: center;
}


.padding_top {
  padding-top: 20px;
  gap: 20px;
  margin: 0px;
}

.padding_top_40 {
  padding-top: 0;
}

.no_padding{
  padding: 0px;
}

.gap20 {
  gap: 20px;
}


.text-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  align-self: stretch;
}

.page-content > .blue_bg + .page-title {
  margin-top: 20px;
}

.blue_bg + .text-section-body:has(> .h1) {
  margin-top: 20px;
}

.newsreader-16 {
  flex: 1 0 0;
  color: var(--text-body);
  text-align: left;
  font-family: Newsreader;
  font-size: 16px;
  font-style: normal;
  font-weight: 300;
  line-height: 160%; /* 25.6px */
}

.newsreader-16 strong,
.newsreader-16 b {
  font-weight: 700;
  color: var(--text-primary);
}


.listening-link {
  color: var(--text-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.listening-link:hover {
  color: var(--text-primary);
}


.code-pill {
  display: inline-block;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 0 6px;
  color: var(--text-primary);
}

.code-inline-flow {
  display: inline;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 0 6px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  color: var(--text-primary);
}

.intro-text::first-letter {
  float: left;
  font-size: 3.2rem;    
  line-height: 0.9;     
  padding-right: 8px; 
  margin-top: 4px;     
  font-weight: 400;
  font-family: inherit;
}

ul {
  padding-left: 20px;
}

ul li + li {
  margin-top: 4px;
}


.hypothesis-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.hypothesis-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-family: Newsreader;
  font-size: 16px;
  font-weight: 300;
  line-height: 160%;
  color: var(--text-primary);
}

.hypothesis-table th:last-child,
.hypothesis-table td:last-child {
  padding-left: 16px;
}

.hypothesis-table tbody tr:last-child td {
  border-bottom: none;
}

.text-section-body {
  gap: 18px;
  padding: 0 20px;
  max-width: 580px;
  width: 100%;
  box-sizing: border-box;
  align-self: center;
}

.blue_bg {
  background-color: #373FE5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 12px 12px, 12px 12px, 48px 48px, 48px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  padding: 0px;
  gap: 20px;
  width: min(100vw, 540px);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  max-height: 500px;
  overflow: hidden;
  border-radius: 16px;
}

.page-content > .blue_bg:first-child {
  width: 100vw;
  border-radius: 0;
  padding-top: 68px;
}

@media (max-width: 710px) {
  .blue_bg {
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
    left: 0;
    transform: none;
  }

  .page-content > .blue_bg:first-child {
    width: 100vw;
    margin-left: 0;
    margin-right: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0;
  }

}

@media (min-width: 711px) {
  .blue_bg {
    width: 540px;
  }

  .page-content > .blue_bg:first-child {
    width: 100vw;
  }

}

.grey_bg {
  background-color: #55866C;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 12px 12px, 12px 12px, 48px 48px, 48px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  padding: 0px;
  gap: 20px;
  width: min(100vw, 540px);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  max-height: 500px;
  overflow: hidden;
  border-radius: 16px;
}

.page-content > .grey_bg:first-child {
  width: 100vw;
  border-radius: 0;
  padding-top: 68px;
}

.grey_bg > picture {
  width: 100%;
  display: flex;
  justify-content: center;
}

@media (max-width: 710px) {
  .grey_bg {
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
    left: 0;
    transform: none;
  }

  .page-content > .grey_bg:first-child {
    width: 100vw;
    margin-left: 0;
    margin-right: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0;
  }
}

@media (min-width: 711px) {
  .grey_bg {
    width: 540px;
  }

  .page-content > .grey_bg:first-child {
    width: 100vw;
  }
}

@media (min-width: 980px) {
  .page-title {
    position: relative;
  }

  .toc-links.desktop-side {
    position: absolute;
    top: 12px;
    left: calc(100% + 40px);
    width: 220px;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 10;
  }

  .toc-links.desktop-side.is-sticky {
    position: fixed;
    top: 40px;
    left: var(--toc-left, 16px);
    z-index: 9999;
  }

  .toc-links.desktop-side li {
    margin: 0 0 8px;
    width: auto;
  }

  .toc-links.desktop-side li a {
    display: inline;
    margin: 0;
    color: var(--text-secondary);
    font-family: Newsreader;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 140%;
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
    opacity: 0.6;
  }

  .toc-links.desktop-side li a::after {
    content: none;
    display: none;
  }

  .toc-links.desktop-side li::marker {
    content: none;
    color: transparent;
  }

  .toc-links.desktop-side li a:hover {
    color: var(--text-primary);
    opacity: 1;
  }

  .toc-links.desktop-side li a.is-active {
    color: var(--text-primary);
    font-weight: 700;
    opacity: 1;
  }
}

.centered-image {
  width: auto;
  max-width: 100%;
  max-height: 500px;
  height: auto;
  display: block;
  align-self: center;
  object-position: center;
  border-radius: 16px;
}


.blue_bg > picture {
  width: 100%;
  display: flex;
  justify-content: center;
}


.click-spark-container {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 15000;
}

.click-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.8px;
  height: 8.4px;
  border-radius: 999px;
  background: var(--spark-color);
  transform-origin: 50% 100%;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0) scaleY(1);
  opacity: 1;
  animation: click-spark-burst 420ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes click-spark-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-14.4px) scaleY(0.55);
  }
}

/* ── Image Lightbox ── */
.blue_bg.lightbox-target {
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  cursor: pointer;
}

.image-lightbox.is-active {
  background: rgba(0, 0, 0, 0.85);
}

.image-lightbox .lightbox-clone {
  position: fixed;
  cursor: default;
  border-radius: 16px;
  transform-origin: center center;
  /* Reset .blue_bg / .grey_bg inherited constraints */
  margin: 0;
  max-height: none;
  overflow: visible;
}

body.lightbox-open {
  overflow: hidden;
}

/* ── Preloader ── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: clip-path 0.4s cubic-bezier(0.76, 0, 0.24, 1);
  clip-path: inset(0 0 0 0);
}

.preloader.is-done {
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
}
