:root {
  --c-white: #ffffff;
  --c-light-blue: #abc6fc;
  --c-dark-blue: #3c66ba;
  --c-green: #50c3ae;
  --c-yellow: #f0b847;
}

.font-display {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  letter-spacing: 0.02em;
}

/* Profile headline: higher-contrast display serif */
.font-identity {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  letter-spacing: 0.01em;
}

.profile-bio mark.profile-keyword {
  background: color-mix(in srgb, var(--c-light-blue) 65%, transparent);
  color: var(--c-dark-blue);
  font-weight: 600;
  padding: 0.06em 0.28em;
  border-radius: 0.25em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.note-card {
  border-color: var(--c-dark-blue);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Desktop nav: floating icon (collapsed) uses transforms in JS; expanded menu is a separate block. */
.desktop-nav-collapsed-icon {
  transform-origin: center center;
}

/* FA house glyph: cancel <i> semantics + line box so the icon sits on the visual center of the pill. */
.collapsed-nav-home-icon {
  font-style: normal;
  line-height: 1;
  display: block;
}

.desktop-nav-panel.is-expanded .desktop-nav-collapsed-icon {
  pointer-events: none;
}

/* Expanded menu above the collapsed home layer so links stay clickable. */
.desktop-nav-panel.is-expanded #desktop-nav-more {
  z-index: 2;
}

/* Zoom emerges from the collapsed pill’s icon (center x, vertical middle of 56px row). */
#desktop-nav-expanded-inner {
  transform-origin: 50% 28px;
}

/* Each row scales from the icon column (matches w-8 + px-2 inset ≈ 1.5rem). */
.desktop-nav-expand-item {
  transform-origin: 1.5rem 50%;
}

.desktop-nav-expand-social {
  transform-origin: 50% 50%;
}

/* Markdown project posts (+ KaTeX) */
.project-paper-header h1 {
  letter-spacing: 0.02em;
}

.project-post {
  font-size: 1rem;
  line-height: 1.7;
  color: #1a1a1a;
}

.project-body h2 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--c-dark-blue);
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.02em;
}

.project-body h2:first-child {
  margin-top: 0;
}

.project-body figure.project-figure + h2 {
  margin-top: 1.5rem;
}

.project-body p {
  margin: 0.85rem 0;
}

.project-body ul {
  margin: 0.75rem 0;
  padding-left: 1.35rem;
  list-style-type: disc;
  list-style-position: outside;
}

.project-body ul > li {
  display: list-item;
  list-style-type: disc;
  margin: 0.35rem 0;
  padding-left: 0.25rem;
}

.project-body p:has(+ ol) {
  margin-bottom: 0.25rem;
}

.project-body ol {
  margin: 0.15rem 0 0.65rem;
  padding-left: 1.35rem;
  list-style-type: decimal;
  list-style-position: outside;
}

.project-body ol > li {
  display: list-item;
  list-style-type: decimal;
  margin: 0.1rem 0;
  padding-left: 0.25rem;
}

.project-body strong {
  font-weight: 600;
  color: var(--c-dark-blue);
}

.project-body img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--c-dark-blue) 18%, transparent);
  margin: 1.25rem 0;
}

.project-body figure.project-figure {
  margin: 1.25rem 0;
}

.project-body figure.project-figure img {
  display: block;
  margin: 0;
  cursor: zoom-in;
}

@media (max-width: 47.99rem) {
  .project-body figure#fig-problem-solution img {
    width: 70%;
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 48rem) {
  .project-body figure#fig-problem-solution img {
    width: 33.333%;
    max-width: 33.333%;
    margin-left: auto;
    margin-right: auto;
  }
}

.project-body figure.project-figure figcaption {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #5a6570;
  margin-top: 0.55rem;
  padding: 0 0.15rem;
  letter-spacing: 0.015em;
}

.project-body figure.project-figure .fig-caption-num {
  font-style: normal;
  font-weight: 600;
  color: #4a5a6e;
}

.project-body .katex-display {
  margin: 1.15rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Shared “paper-preprint” control (project cards + markdown posts) */
.paper-preprint-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  border-radius: 9999px;
  border: 1px solid color-mix(in srgb, var(--c-dark-blue) 42%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--c-light-blue) 38%, #fff) 0%,
    color-mix(in srgb, var(--c-light-blue) 14%, #fff) 100%
  );
  color: var(--c-dark-blue);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  line-height: 1.2;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--c-dark-blue) 10%, transparent);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.paper-preprint-pill:hover {
  background: color-mix(in srgb, var(--c-green) 24%, #fff);
  border-color: color-mix(in srgb, var(--c-green) 50%, var(--c-dark-blue));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--c-dark-blue) 14%, transparent);
  transform: translateY(-1px);
}

.paper-preprint-pill:focus-visible {
  outline: 2px solid var(--c-dark-blue);
  outline-offset: 2px;
}

.project-post-cta .paper-preprint-pill {
  flex-shrink: 0;
}

/* Project post: click-to-expand figure images */
body.project-img-lightbox-open {
  overflow: hidden;
}

.project-img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: min(6vw, 2.5rem);
  background: color-mix(in srgb, #0a1628 78%, transparent);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.project-img-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.project-img-lightbox-frame {
  max-width: min(96vw, 72rem);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-img-lightbox-frame img {
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #fff 12%, transparent),
    0 12px 48px color-mix(in srgb, #000 55%, transparent);
}

.project-img-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 9999px;
  background: color-mix(in srgb, #fff 92%, transparent);
  color: #1a1a1a;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px color-mix(in srgb, #000 25%, transparent);
}

.project-img-lightbox-close:hover {
  background: #fff;
}

.project-img-lightbox-close:focus-visible {
  outline: 2px solid var(--c-light-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .project-img-lightbox {
    transition: none;
  }
}
