:root {
  --bg: #f5efe6;
  --bg-accent: #eadfce;
  --card: rgba(255, 252, 247, 0.82);
  --card-strong: #fffaf3;
  --text: #1d1a16;
  --muted: #62584d;
  --line: rgba(60, 46, 33, 0.12);
  --shadow: 0 22px 50px rgba(53, 35, 19, 0.12);
  --accent: #8f4e2e;
  --accent-strong: #6d391f;
  --accent-soft: #dcb08a;
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 34%),
    radial-gradient(circle at top right, rgba(222, 189, 154, 0.4), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, #f8f4ee 42%, #f2e8db 100%);
}

.site-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  padding: 24px 0 20px;
}

.hero-copy,
.hero-media,
.content-card {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 34px;
  padding: 38px;
}

.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", "Georgia", serif;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.9rem);
  max-width: 10ch;
}

.subtitle {
  margin: 18px 0 0;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--accent-strong);
}

.affiliation {
  margin: 6px 0 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.lede {
  margin: 18px 0 0;
  max-width: 62ch;
  font-size: 1.03rem;
  line-height: 1.7;
  color: var(--muted);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

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

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 28px rgba(109, 57, 31, 0.24);
}

.secondary {
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(109, 57, 31, 0.15);
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(29, 26, 22, 0.1);
}

.hero-media {
  border-radius: 34px;
  padding: 20px;
  display: grid;
  gap: 16px;
}

.media-card {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 242, 233, 0.9));
  border: 1px solid rgba(83, 54, 36, 0.12);
  padding: 18px;
}

.media-label {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(143, 78, 46, 0.12);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.media-card p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.teaser-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.teaser-item {
  margin: 0;
  cursor: zoom-in;
  display: grid;
  gap: 8px;
}

.teaser-item figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.lightbox-trigger {
  cursor: zoom-in;
  position: relative;
}

.lightbox-trigger:focus-visible {
  outline: 3px solid rgba(109, 57, 31, 0.35);
  outline-offset: 4px;
}

.teaser-preview {
  width: 100%;
  height: 210px;
  display: block;
  border-radius: 20px;
  border: 0;
  pointer-events: none;
  background: #fff;
  object-fit: contain;
}

.teaser-live-card {
  display: grid;
  gap: 12px;
}

.teaser-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.teaser-card-link:focus-visible {
  outline: 3px solid rgba(109, 57, 31, 0.35);
  outline-offset: 3px;
  border-radius: 20px;
}
.teaser-live-frame-wrap {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(109, 57, 31, 0.14);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
}

.teaser-live-frame {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1040 / 1704;
  border: 0;
  background: #fff;
  pointer-events: none;
  object-fit: contain;
  object-position: center;
}

.teaser-jump {
  width: fit-content;
}


.stats-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stats-card div {
  padding: 14px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.stat-value {
  display: block;
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent-strong);
}

.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.section {
  margin-top: 30px;
}

.section-heading {
  margin: 0 0 14px;
  padding: 0 4px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.content-card {
  border-radius: var(--radius);
  padding: 24px;
}

.prose p {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.8;
  color: var(--muted);
}

.prose p + p {
  margin-top: 14px;
}

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

.figure-card {
  padding: 18px;
}

.figure-slot {
  min-height: 210px;
  border-radius: 20px;
  border: 1px dashed rgba(109, 57, 31, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(248, 239, 226, 0.95));
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pdf-frame,
.raster-frame {
  width: 100%;
  display: block;
  pointer-events: none;
}

.pdf-frame {
  min-height: 280px;
  border: 0;
  background: #fff;
}

.raster-frame {
  min-height: 280px;
  object-fit: contain;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(248, 239, 226, 0.95));
  border: 0;
  padding: 12px;
}

.figure-open {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.figure-card figcaption {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.media-embed video {
  width: 100%;
  display: block;
  border-radius: 20px;
  background: #000;
}

.media-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 0;
  border-radius: 20px;
  background: #000;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 12, 8, 0.74);
  backdrop-filter: blur(8px);
}

.lightbox-panel {
  position: relative;
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 28px;
  padding: 22px;
  background: #fcf7f0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.lightbox-panel h3 {
  margin: 4px 0 16px;
  font-size: 1.9rem;
}

.lightbox-body {
  width: 100%;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
}

.lightbox-body img,
.lightbox-body iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

.lightbox-body img {
  height: auto;
}

.lightbox-body iframe {
  min-height: min(78vh, 980px);
}

.lightbox-caption {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(29, 26, 22, 0.08);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.citation-card {
  display: grid;
  gap: 16px;
}

.citation-card pre {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(109, 57, 31, 0.12);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.copy-button {
  width: fit-content;
}

.interactive-shell {
  padding: 20px;
  overflow: hidden;
}

.interactive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, 1fr);
  gap: 16px;
  min-width: 0;
}

.interactive-panel {
  border-radius: 22px;
  padding: 16px;
  border: 1px solid rgba(109, 57, 31, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 236, 224, 0.82));
  min-width: 0;
}

.interactive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.interactive-toolbar h3 {
  font-size: clamp(1.4rem, 2.1vw, 1.8rem);
}

.focus-button {
  padding: 9px 14px;
}

.interactive-shell .controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
  color: var(--muted);
  min-width: 0;
}

.interactive-shell .controls > * {
  min-width: 0;
}

.interactive-shell #robot-select {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 100%;
}

.interactive-shell .controls label.checkbox {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.interactive-shell select,
.interactive-shell button,
.interactive-shell input[type='range'] {
  font: inherit;
}

.interactive-shell .track-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.25rem 0 0.5rem;
}

.interactive-shell .track-toggle-btn {
  border: 1px solid rgba(109, 57, 31, 0.2);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.interactive-shell .track-toggle-btn.active {
  background: #1f77b4;
  color: white;
  border-color: #1f77b4;
}

.interactive-shell .hover-info {
  min-height: 1.25rem;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.interactive-shell #viewer-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  border: 1px solid rgba(109, 57, 31, 0.16);
  background: linear-gradient(180deg, #edf5fb 0%, #e1edf7 100%);
}

.interactive-shell #scrubber {
  flex: 1;
}

.interactive-shell #frame-label,
.interactive-shell #fitness-label {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
}

.interactive-shell #frame-label {
  margin-left: auto;
}

.interactive-shell .status-row {
  justify-content: space-between;
  gap: 0.6rem;
}

.interactive-shell .status-row #status-message {
  margin: 0;
  text-align: left;
}

.interactive-shell .status-row #frame-label {
  margin-left: 0;
}

.interactive-status {
  color: #a00;
  min-height: 1.2em;
  margin: 0.35rem 0 0;
}

.plot-panel .hint {
  margin: 0 0 8px;
  color: var(--muted);
}

#depth-plot {
  width: 100%;
  min-height: 420px;
  min-width: 0;
}

.plot-panel .js-plotly-plot,
.plot-panel .plotly,
.plot-panel .plot-container {
  max-width: 100%;
}

.interactive-focus {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.interactive-focus[hidden] {
  display: none;
}

.interactive-focus-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 12, 8, 0.74);
  backdrop-filter: blur(8px);
}

.interactive-focus-panel {
  position: relative;
  width: min(1220px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 28px;
  padding: 22px;
  background: #fcf7f0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.interactive-focus-panel h3 {
  margin: 4px 0 16px;
  font-size: 1.9rem;
}

.interactive-focus-body {
  width: 100%;
}

.interactive-panel.is-focused {
  border-color: rgba(109, 57, 31, 0.25);
  box-shadow: 0 20px 46px rgba(41, 27, 16, 0.14);
}

.reveal {
  animation: floatIn 700ms ease both;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  h1 {
    max-width: none;
  }

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

  .interactive-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .interactive-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 18px, 1160px);
    padding-top: 16px;
  }

  .hero-copy,
  .hero-media,
  .content-card {
    border-radius: 24px;
    padding: 20px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .stats-card {
    grid-template-columns: 1fr;
  }

  .interactive-shell {
    padding: 14px;
  }

  .interactive-panel {
    padding: 14px;
  }

  .interactive-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .interactive-toolbar .button {
    width: auto;
  }

  .scrubber-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 4px;
  }

  .interactive-shell #frame-label,
  .interactive-shell #fitness-label {
    white-space: normal;
  }

  #depth-plot {
    min-height: 300px;
  }

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

  .teaser-live-frame {
    height: 300px;
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox-panel {
    padding: 16px;
  }

  .interactive-focus {
    padding: 12px;
  }

  .interactive-focus-panel {
    padding: 16px;
  }

  .lightbox-body iframe {
    min-height: 60vh;
  }
}