:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #f8fafc;
  --line: #e5e7eb;
  --line-strong: #cbd5e1;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #17855c;
  --gold: #64748b;
  --charcoal: #334155;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  width: min(980px, calc(100% - 32px));
  height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.top-nav a {
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--ink);
}

main {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto 64px;
}

.project-intro {
  padding: 8px 0 26px;
}

.project-intro h1 {
  max-width: none;
  margin-bottom: 4px;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 750;
}

.project-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: justify;
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 28px;
  align-items: start;
  margin-bottom: 34px;
}

.video-panel h2 {
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.lead {
  max-width: none;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: justify;
}

.material-list {
  display: grid;
  gap: 7px;
}

.button,
.pill-link {
  min-height: 31px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.button {
  padding: 0 16px;
}

.button.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 24px rgba(36, 88, 230, 0.18);
}

.button.primary:hover {
  background: var(--blue-dark);
}

.button.secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line-strong);
}

.button.secondary:hover {
  border-color: #9aa3b2;
}

.detail-stack {
  display: grid;
  gap: 14px;
}

.detail-card,
.paper-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.detail-card {
  padding: 14px;
}

.detail-card h2,
.paper-section h2 {
  font-size: 1rem;
}

.materials-note {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

dl {
  margin: 0;
  display: grid;
  gap: 15px;
}

dt {
  color: var(--muted);
  font-size: 0.8rem;
}

dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 680;
  line-height: 1.45;
}

.pill-link {
  width: 100%;
  padding: 0 13px;
  font-size: 0.84rem;
}

.pill-link.blue {
  background: var(--blue);
  color: #fff;
}

.pill-link.dark {
  background: var(--charcoal);
  color: #fff;
}

.pill-link.green {
  background: var(--green);
  color: #fff;
}

.pill-link.light {
  background: var(--soft);
  border-color: var(--line);
  color: var(--ink);
}

.figure-section {
  margin: 32px 0 0;
  padding: 0;
}

.figure-carousel {
  --figure-stage-aspect: 2.18 / 1;
  --carousel-control-top: 50%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.carousel-slide {
  display: none;
  margin: 0;
}

.carousel-slide.is-active {
  display: block;
  backface-visibility: hidden;
}

.carousel-slide.is-active img {
  animation: carouselSlideIn 240ms ease-out both;
  will-change: transform;
  backface-visibility: hidden;
}

.carousel-slide.is-active.is-reverse img {
  animation-name: carouselSlideInReverse;
}

.figure-image-scroll {
  aspect-ratio: var(--figure-stage-aspect);
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior-x: contain;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.figure-image-scroll::-webkit-scrollbar {
  display: none;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  background: #fff;
  object-fit: contain;
  object-position: center;
}

figcaption {
  min-height: 112px;
  margin: 0;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-style: italic;
  text-align: justify;
}

figcaption strong {
  color: var(--ink);
  font-style: normal;
}

.carousel-side {
  width: 34px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  display: grid;
  place-items: center;
  position: absolute;
  top: var(--carousel-control-top);
  z-index: 2;
  transform: translateY(-50%);
  transform-origin: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  pointer-events: auto;
}

.carousel-side:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.carousel-arrow {
  width: 16px;
  height: 18px;
  display: block;
  font-size: 0;
  line-height: 0;
  position: relative;
}

.carousel-arrow::before,
.carousel-arrow::after {
  content: "";
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  position: absolute;
  top: calc(50% - 1px);
}

.carousel-side.previous {
  left: 12px;
}

.carousel-side.next {
  right: 12px;
}

.carousel-side.previous .carousel-arrow::before,
.carousel-side.previous .carousel-arrow::after {
  left: 5px;
  transform-origin: left center;
}

.carousel-side.previous .carousel-arrow::before {
  transform: rotate(-45deg);
}

.carousel-side.previous .carousel-arrow::after {
  transform: rotate(45deg);
}

.carousel-side.next .carousel-arrow::before,
.carousel-side.next .carousel-arrow::after {
  right: 5px;
  transform-origin: right center;
}

.carousel-side.next .carousel-arrow::before {
  transform: rotate(45deg);
}

.carousel-side.next .carousel-arrow::after {
  transform: rotate(-45deg);
}

@keyframes carouselSlideIn {
  from {
    transform: translateX(14px);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes carouselSlideInReverse {
  from {
    transform: translateX(-14px);
  }
  to {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-slide.is-active img,
  .carousel-slide.is-active.is-reverse img {
    animation: none;
  }
}

.paper-section {
  padding: 22px 24px;
}

.paper-section p {
  margin-bottom: 16px;
  text-align: justify;
}

.paper-section p:last-child {
  margin-bottom: 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 1.15rem;
}

.video-shell {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  box-shadow: var(--shadow);
}

.video-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 920px) {
  .site-header {
    height: auto;
    padding: 18px 0 4px;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px 16px;
  }

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

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

@media (max-width: 640px) {
  main,
  .site-header {
    width: min(100% - 22px, 1180px);
  }

  h1 {
    font-size: 1.32rem;
  }

  .lead {
    font-size: 0.93rem;
  }

  .material-list .pill-link {
    width: 100%;
  }

  .detail-stack {
    grid-template-columns: 1fr;
  }

  .paper-section,
  .detail-card {
    padding: 18px;
  }

  .figure-carousel {
    --figure-stage-aspect: auto;
  }

  .figure-image-scroll {
    height: 300px;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
  }

  .carousel-side {
    width: 32px;
    height: 42px;
  }

  .carousel-side.previous {
    left: 8px;
  }

  .carousel-side.next {
    right: 8px;
  }

  .carousel-slide img {
    width: 760px;
    max-width: none;
    height: 100%;
  }

  figcaption {
    min-height: 0;
    padding: 14px;
    font-size: 0.86rem;
  }

}
