:root {
  --page-bg: #f4f0fa;
  --page-bg-strong: #eae2f4;
  --panel: rgba(253, 251, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.93);
  --border: rgba(105, 38, 170, 0.16);
  --ink: #1d1230;
  --ink-soft: #574b6b;
  --accent: #6926aa;
  --accent-deep: #4d1a80;
  --accent-alt: #9d2c86;
  --shadow: 0 30px 80px rgba(58, 22, 92, 0.16);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --max-width: 1880px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(105, 38, 170, 0.14), transparent 34%),
    radial-gradient(circle at 85% 5%, rgba(157, 44, 134, 0.10), transparent 24%),
    linear-gradient(180deg, #faf8fd 0%, var(--page-bg) 46%, var(--page-bg-strong) 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 72%);
  pointer-events: none;
  z-index: -1;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.ambient {
  position: fixed;
  z-index: -2;
  filter: blur(24px);
  opacity: 0.45;
}

.ambient-a {
  width: 360px;
  height: 360px;
  top: 8%;
  right: -120px;
  background: radial-gradient(circle, rgba(105, 38, 170, 0.32), transparent 68%);
}

.ambient-b {
  width: 420px;
  height: 420px;
  bottom: 8%;
  left: -140px;
  background: radial-gradient(circle, rgba(157, 44, 134, 0.20), transparent 68%);
}

.hero,
.section,
.site-footer {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.hero {
  width: min(calc(100% - 32px), var(--max-width));
  padding: 14px 0 18px;
}

.hero .topbar,
.hero .hero-grid {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(254, 249, 242, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(76, 54, 35, 0.08);
}

.brand {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.hero-copy,
.hero-showcase,
.legend-card,
.copy-panel,
.triplet-card,
.focus-card,
.hero-mini {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-showcase {
  border-radius: var(--radius-xl);
}

.hero-copy {
  padding: 22px 26px;
  text-align: center;
}

.eyebrow,
.panel-kicker,
.showcase-header p,
.lightbox-label {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-deep);
}

.eyebrow,
.panel-kicker {
  text-transform: none;
}

.hero-copy h1,
.section-head h2,
.copy-panel h3,
.lightbox-copy h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  line-height: 0.95;
}

.hero-copy h1 {
  font-size: clamp(1.9rem, 2.8vw, 2.8rem);
}

.hero-tagline {
  margin: 18px 0 12px;
  font-size: clamp(1.2rem, 2vw, 1.68rem);
  line-height: 1.35;
  color: var(--ink);
  max-width: none;
}

.hero-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 12px;
}

.hero-title h1 {
  margin: 0;
}

.hero-title .paper-title {
  margin: 0;
}

.paper-title {
  margin: 10px 0 16px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.5rem, 2.3vw, 2.3rem);
  line-height: 1.25;
  color: var(--ink);
}

.author-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 0 0 14px;
  padding: 0;
  font-size: 1.04rem;
  font-weight: 500;
  color: var(--ink);
}

.author-list li {
  white-space: nowrap;
}

.author-link {
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(105, 38, 170, 0.3);
  transition: color 160ms ease, border-color 160ms ease;
}

.author-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.author-list sup,
.affiliation-list sup {
  color: var(--accent-deep);
  font-weight: 600;
}

.affiliation-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin: 0 0 10px;
  padding: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

.author-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin: 0 0 4px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.hero-abstract {
  margin: 14px auto 4px;
  max-width: 1180px;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.hero-abstract strong {
  color: var(--ink);
}

.section-head code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(105, 38, 170, 0.12);
  color: var(--accent-deep);
}

.hl {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 1.28em;
  letter-spacing: 0.01em;
  color: var(--accent-deep);
  white-space: nowrap;
}

.hl-alt {
  color: var(--accent-alt);
}

.hero-description,
.section-head p,
.copy-panel p,
.site-footer p,
.triplet-copy p,
.focus-meta p,
.legend-card p,
.lightbox-copy p {
  color: var(--ink-soft);
  line-height: 1.68;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-actions.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hero-links .button {
  width: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(135deg, #6926aa 0%, #9a4fd0 100%);
  color: white;
}

.button-secondary {
  border-color: rgba(105, 38, 170, 0.20);
  background: rgba(255, 255, 255, 0.62);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.stat-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(28, 23, 20, 0.08);
}

.stat-value {
  display: block;
  margin-bottom: 6px;
  font-family: "Fraunces", serif;
  font-size: 1.7rem;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.hero-showcase {
  padding: 20px;
}

.showcase-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 16px;
}

.showcase-header p {
  margin-bottom: 0;
}

.showcase-header span {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.hero-strip {
  display: grid;
  gap: 16px;
}

.hero-mini {
  padding: 12px;
  border-radius: 22px;
  background: var(--panel-strong);
}

.hero-mini-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.hero-mini-head h3,
.triplet-copy h3,
.focus-meta h3 {
  margin: 0;
  font-size: 1rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid rgba(82, 60, 43, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.tag-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(215, 109, 46, 0.32);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.mini-panel-grid,
.triptych {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mini-panel,
.triptych-panel,
.focus-panel {
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
}

.mini-panel img,
.triptych-panel img,
.focus-panel img {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
}

.mini-panel-label,
.triptych-label,
.focus-label {
  display: block;
  padding: 10px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  text-transform: uppercase;
  background: rgba(244, 240, 250, 0.92);
}

.section {
  padding: 30px 0;
  scroll-margin-top: 24px;
}

.section-head {
  width: 100%;
  max-width: none;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  margin-bottom: 12px;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.legend-card {
  padding: 22px;
  border-radius: var(--radius-lg);
}

.legend-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(105, 38, 170, 0.18), rgba(157, 44, 134, 0.16));
  font-weight: 700;
}

.legend-card h3 {
  margin: 18px 0 8px;
  font-size: 1.25rem;
}

.dataset-block {
  margin-top: 28px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  scroll-margin-top: 110px;
}

.dataset-block + .dataset-block {
  margin-top: 32px;
}

.dataset-block-head {
  margin-bottom: 18px;
}

.dataset-block-head h3 {
  margin: 8px 0 12px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.3rem, 1.8vw, 1.7rem);
  line-height: 1.1;
}

.dataset-block-head p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

:root {
  --card-h: 300px;
  --box-gap: 18px;
  --box-pad-y: 12px;
  --marquee-img-h: 220px;
}

.scroll-box {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px var(--box-pad-y) 4px;
  border-radius: 18px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(82, 60, 43, 0.28) transparent;
}

.scroll-track {
  display: grid;
  gap: var(--box-gap);
}

.scroll-box-list .scroll-track {
  grid-template-columns: 1fr;
  width: 100%;
  max-width: none;
  margin: 0;
}

.scroll-box-grid .scroll-track {
  grid-template-columns: 1fr;
  width: 100%;
  max-width: none;
  margin: 0;
}

.scroll-box-list {
  height: calc(var(--card-h) * 3 + var(--box-gap) * 2 + var(--box-pad-y) + 8px);
}

.scroll-box-grid {
  height: calc(var(--card-h) * 3 + var(--box-gap) * 2 + var(--box-pad-y) + 8px);
}

.scroll-track .triplet-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: visible;
  margin: 0;
}

.scroll-track .triplet-card:not(:has(.triplet-copy)) {
  justify-content: flex-start;
}

.scroll-track .triptych {
  flex: 0 0 auto;
  gap: 8px;
  align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scroll-track .triptych-panel img {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scroll-track .triptych-panel .media-button {
  display: block;
  width: 100%;
  aspect-ratio: var(--triplet-ratio, 1 / 1);
  overflow: hidden;
  background: #fff;
}

.scroll-track .triptych-panel {
  overflow: visible;
}

.scroll-track .triplet-copy {
  flex: 0 0 auto;
  padding-top: 10px;
  display: flex;
  align-items: flex-start;
}

.scroll-track .prompt-chip {
  margin: 0;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scroll-box::-webkit-scrollbar {
  width: 8px;
}

.scroll-box::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(82, 60, 43, 0.22);
}

.scroll-box::-webkit-scrollbar-thumb:hover {
  background: rgba(82, 60, 43, 0.4);
}

.scroll-box::-webkit-scrollbar-track {
  background: transparent;
}

.triplet-card {
  padding: 16px;
  border-radius: 24px;
  height: auto;
}

.triptych-panel {
  display: flex;
  flex-direction: column;
}

.triptych-panel .media-button {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
}

.triptych-panel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.triplet-copy {
  padding-top: 14px;
}

.triplet-copy h3,
.focus-meta h3 {
  font-size: 1.08rem;
}

.prompt-chip {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(28, 23, 20, 0.05);
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.media-button {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.media-button img {
  transition: transform 180ms ease;
}

.media-button:hover img {
  transform: scale(1.03);
}

/* Prompt overlay revealed when hovering an Output image */
.prompt-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  font-family: "Outfit", sans-serif;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.42;
  letter-spacing: 0;
  text-align: center;
  color: #fff;
  background: rgba(24, 14, 42, 0.9);
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.media-button:hover .prompt-tip {
  opacity: 1;
  visibility: visible;
}

.site-footer {
  padding: 20px 0 48px;
  color: var(--ink-soft);
}

.site-footer p {
  margin: 4px 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 24px;
  background: rgba(18, 10, 30, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
  z-index: 40;
}

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

.lightbox-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  touch-action: none;
}

.lightbox-frame {
  position: relative;
  flex: 0 0 auto;
  display: block;
  line-height: 0;
  transform: translate(0px, 0px) scale(1);
  transform-origin: center center;
  will-change: transform, width, height;
}

.lightbox-stage.is-zoomed {
  cursor: grab;
}

.lightbox-stage.is-panning {
  cursor: grabbing;
}

.lightbox-stage img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 420ms ease,
    transform 420ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .hero-grid,
  .lightbox-card {
    grid-template-columns: 1fr;
  }

  .topbar {
    border-radius: 24px;
    padding: 16px 18px;
  }

  .scroll-box-grid .scroll-track {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .section,
  .site-footer {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .hero-copy,
  .dataset-block,
  .triplet-card {
    padding-left: 18px;
    padding-right: 18px;
  }

  .lightbox {
    padding: 12px;
  }
}

/* ===== Marquee: horizontal auto-scrolling showcase rows ===== */
.marquee-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 2px 0;
  /* soft fade at both edges */
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 5%,
    #000 95%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 5%,
    #000 95%,
    transparent 100%
  );
}

.marquee-track {
  display: flex;
  gap: 16px;
  width: max-content;
  will-change: transform;
}

@keyframes marquee-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes marquee-right {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}

.marquee-track.to-left {
  animation: marquee-left var(--marquee-dur, 60s) linear infinite;
}

.marquee-track.to-right {
  animation: marquee-right var(--marquee-dur, 60s) linear infinite;
}

/* Pause when the visitor wants to look / click */
.marquee:hover .marquee-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
  }
  .marquee {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Triptych cards inside a marquee row */
.marquee .triplet-card {
  flex: 0 0 auto;
  width: auto;
  padding: 14px;
  margin: 2px 0;
  border-radius: var(--radius-lg);
}

/* Fixed image height, natural width: every image lines up in height while
   the triplet card grows as wide as its three images need. */
.marquee .triptych {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  grid-template-columns: none;
}

.marquee .triptych-panel {
  flex: 0 0 auto;
  width: fit-content;
  display: flex;
  flex-direction: column;
}

.marquee .triptych-panel .media-button {
  display: block;
  width: fit-content;
  height: var(--marquee-img-h);
  aspect-ratio: auto;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.marquee .triptych-panel img {
  display: block;
  height: var(--marquee-img-h);
  width: auto;
  object-fit: cover;
}

.marquee .triptych-label {
  padding: 8px 4px 0;
  background: transparent;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

/* Make the generated result obvious: highlight the Output panel */
.marquee .triptych-panel:last-child .media-button {
  box-shadow: 0 0 0 2px var(--accent);
}

.marquee .triptych-panel:last-child .triptych-label {
  color: var(--accent-deep);
}

@media (max-width: 760px) {
  :root {
    --marquee-img-h: 150px;
  }
}
