:root {
  --bg: #f7f5ef;
  --surface: #fffdf8;
  --surface-alt: #f1ede2;
  --ink: #132333;
  --muted: #4f5d66;
  --line: #d2c9b8;
  --primary: #005f73;
  --primary-soft: #d5edf1;
  --accent: #bb3e03;
  --accent-soft: #fde6d8;
  --shadow: 0 14px 32px rgba(19, 35, 51, 0.12);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 400px at 90% -5%, #d6ecef 0%, transparent 70%),
    radial-gradient(1000px 380px at 15% 0%, #fbe7d8 0%, transparent 72%),
    var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.65;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1.5px;
}

a:hover {
  color: var(--accent);
}

h1,
h2,
h3 {
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.2;
  margin-top: 0;
}

h2 {
  font-size: clamp(1.75rem, 2.2vw, 2.4rem);
  margin-bottom: 0.7rem;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

p {
  margin: 0.5rem 0 0.9rem;
}

ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.4rem;
}

.mono {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95em;
}

.container {
  width: min(1120px, calc(100% - 2.4rem));
  margin: 0 auto;
}

.ambient {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(55px);
  opacity: 0.45;
}

.ambient-one {
  width: 320px;
  height: 320px;
  background: #a6dbe2;
  top: 18vh;
  right: -100px;
}

.ambient-two {
  width: 280px;
  height: 280px;
  background: #f9c9a3;
  bottom: 10vh;
  left: -100px;
}

.hero {
  padding: 3.8rem 0 2.8rem;
}

.hero-inner {
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.95), rgba(245, 239, 226, 0.86));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(1.2rem, 2vw, 2rem);
  box-shadow: var(--shadow);
}

.venue {
  margin: 0 0 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  margin-bottom: 0.8rem;
  max-width: none;
}

.title-line {
  display: block;
}

.title-line-main {
  white-space: nowrap;
}

.authors {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.affiliation {
  margin-top: 0;
  color: var(--muted);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.72rem;
  margin: 1.1rem 0 1.4rem;
}

.link-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-width: 100px;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, white);
  background: white;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.link-row a:hover,
.link-row a:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(0, 95, 115, 0.2);
  color: var(--primary);
}

.link-row a svg {
  width: 0.92rem;
  height: 0.92rem;
  flex: 0 0 auto;
}

.link-row a .link-logo {
  width: 0.92rem;
  height: 0.92rem;
  display: block;
  flex: 0 0 auto;
}

.link-row a .link-logo-aaai {
  width: 0.92rem;
  height: 0.92rem;
  object-fit: contain;
  border-radius: 0;
}

.hero-summary {
  margin: 0.45rem 0 0;
  max-width: none;
  color: var(--muted);
  font-size: 1rem;
}

.quick-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 239, 0.85);
  backdrop-filter: blur(12px);
}

.quick-nav-inner {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: flex-start;
  padding: 0.5rem 0;
}

.nav-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.nav-links a {
  --nav-color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.32rem 0.14rem;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.25s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.22rem;
  height: 2px;
  background: var(--nav-color);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--nav-color);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.section {
  padding: 3rem 0;
}

.section.alt {
  background: linear-gradient(180deg, rgba(241, 237, 226, 0.75), rgba(247, 245, 239, 0.3));
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, white);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, white);
}

.lead {
  font-size: clamp(1.04rem, 1.5vw, 1.16rem);
  max-width: none;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
}

.method-lead {
  font-size: clamp(1.04rem, 1.5vw, 1.16rem);
}

.cards {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.cards.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#abstract .cards {
  margin-top: 0.82rem;
}

#abstract .card {
  padding: 0.78rem 0.88rem 0.82rem;
}

#abstract .card h3 {
  margin-bottom: 0.34rem;
}

#abstract .card p {
  margin: 0.26rem 0 0.48rem;
  line-height: 1.55;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.05rem;
  box-shadow: 0 6px 18px rgba(19, 35, 51, 0.06);
}

.card.full-width {
  margin-top: 1.1rem;
}

.split {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.25fr 1fr;
  align-items: start;
}

.math-block {
  background: #fffdf8;
  color: #132333;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin: 0.8rem 0;
  overflow-x: auto;
}

.math-block .katex-display {
  margin: 0.7rem 0;
}

.math-block .katex {
  font-size: 1.08em;
}

#method .math-block .katex {
  font-size: 1.16em;
}

.equation-flow {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}

.equation-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.eq-step {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.78rem 0.85rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 250px;
}

.eq-step h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-weight: 700;
}

.eq-step p {
  margin: 0.35rem 0 0.55rem;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
}

.eq-step .math-block {
  margin: 0.45rem 0 0.35rem;
}

.eq-step-wide {
  min-height: 300px;
}

.method-panel {
  min-height: 250px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.method-panel img {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: contain;
  background: #ffffff;
}

.method-triple-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 0.8rem;
}

.method-abc-figure {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1rem;
}

.method-abc-figure .panel-with-label {
  background: #ffffff;
}

.method-abc-figure .method-panel {
  min-height: 260px;
}

.method-abc-figure .method-panel img {
  min-height: 260px;
  max-height: 300px;
  background: #ffffff;
}

.exp-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-top: 0.6rem;
}

.exp-arch-card-inner,
.exp-task-card-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  align-items: start;
}

.exp-arch-card,
.exp-task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
  padding-top: 1.05rem;
}

.exp-arch-card h3,
.exp-task-card h3 {
  margin-top: 0.25rem;
  margin-bottom: 0.72rem;
}

.exp-arch-card {
  padding: 0.72rem 0.85rem 0.78rem;
}

.exp-arch-card h3 {
  margin-top: 0.1rem;
  margin-bottom: 0.55rem;
}

.exp-arch-card .exp-arch-card-inner {
  gap: 0.72rem;
}

.exp-arch-card ol {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.exp-arch-card li {
  margin-bottom: 0.45rem;
}

.exp-inline-figure {
  margin: -0.18rem 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.exp-inline-figure img {
  width: 100%;
  display: block;
}

.exp-inline-figure figcaption {
  padding: 0.5rem 0.7rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  background: var(--surface);
}

.exp-arch-card .exp-inline-figure img {
  min-height: 175px;
  max-height: 225px;
  height: 205px;
  object-fit: contain;
  object-position: center center;
  transform: none;
  background: #fbf8f0;
}

.exp-arch-card .exp-inline-figure {
  margin-top: 0;
  align-self: start;
  transform: translateY(-12px);
}

.exp-gif-figure img {
  width: 100%;
  min-height: 0;
  max-height: 340px;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: transparent;
  image-rendering: auto;
}

.exp-gif-figure {
  width: 78%;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  position: relative;
  top: -22px;
  align-self: start;
  justify-self: end;
}

.exp-static-figure {
  width: 122%;
  margin-top: 0.35rem;
  margin-left: auto;
  margin-right: auto;
  background: transparent;
}

.exp-inline-figure.exp-static-figure img {
  min-height: 0;
  max-height: 185px;
  height: auto;
  object-fit: contain;
  object-position: center center;
  background: transparent;
}

.inline-figure-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.inline-figure-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-figure-grid.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.figure-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.figure-card.tall img {
  min-height: 250px;
  object-fit: contain;
  background: #f3f0e8;
}

.figure-card img {
  width: 100%;
  height: auto;
  display: block;
}

.figure-card figcaption {
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.figure-composite {
  margin-top: 1rem;
}

.fig1-composite {
  margin-top: 1rem;
}

.fig1-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 2.35fr);
  padding: 0.8rem;
}

.panel-with-label {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f5f1e6;
}

.panel-with-label img {
  width: 100%;
  display: block;
  height: auto;
}

.panel-tag {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #07283a;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(7, 40, 58, 0.2);
  border-radius: 8px;
  padding: 0.1rem 0.35rem;
}

.panel-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.panel-grid.four-col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel-grid.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.no-caption-grid {
  margin: 0;
  padding: 0.8rem;
}

.no-caption-grid img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f5f1e6;
}

.result-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 1rem;
  margin-top: 1rem;
  box-shadow: 0 8px 20px rgba(19, 35, 51, 0.06);
}

.legend-strip {
  width: min(820px, calc(100% - 1.4rem));
  margin: 0.9rem auto 0.35rem;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f4f0e4;
}

.stable-grid-wrap {
  padding-top: 0.35rem;
}

.model-row-rotated {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 0.45rem;
}

.model-label-vertical {
  margin: 0;
  transform: rotate(-90deg);
  transform-origin: center;
  text-transform: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  justify-self: center;
  align-self: center;
}

.stable-panels {
  padding-left: 0.3rem;
}

.panel-column-labels-top {
  width: calc(100% - 34px - 0.45rem - 0.3rem);
  margin-left: calc(34px + 0.45rem + 0.3rem);
  margin-top: 0.36rem !important;
  margin-bottom: 0.28rem !important;
  transform: translate(-2px, 14px) !important;
  font-size: 0.74rem;
  line-height: 1.18;
  font-weight: 600;
}

.panel-column-labels-top span:nth-child(-n+3) {
  position: relative;
  left: 34px;
}

.panel-column-labels-top span:nth-child(3) {
  left: 22px;
}

.lstm-panel-d-offset {
  transform: scale(1.04) translateY(1px);
  transform-origin: center top;
}

.legend-strip-bottom {
  width: min(420px, 62%) !important;
  max-width: 420px !important;
  margin-top: 0.3rem !important;
  margin-right: auto !important;
  margin-bottom: 0.1rem !important;
  margin-left: auto !important;
  display: block;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.bottom-result-figure {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.bottom-result-figure .no-caption-grid {
  padding: 0.28rem;
}

.bottom-result-figure .no-caption-grid img {
  max-height: 285px;
  object-fit: contain;
}

.scale-cov-figure {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.scale-cov-figure .no-caption-grid {
  padding: 0.45rem;
}

.scale-cov-figure .panel-grid.two-col {
  align-items: start;
}

.scale-cov-figure .no-caption-grid img {
  max-height: 255px;
  object-fit: contain;
}

.scale-cov-a-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  gap: 0.2rem;
  transform: translateY(30px);
}

.scale-cov-panel-a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.46rem 0.28rem 0.08rem;
  width: 100%;
}

.scale-cov-a-stack .scale-cov-legend-a {
  width: min(286px, 98%);
  margin: 0;
  transform: translateY(8px);
  border: 0;
  border-radius: 0;
  background: transparent;
}

.scale-cov-panel-a .scale-cov-main-a {
  width: auto;
  max-width: 100%;
  height: 160px;
  max-height: none;
  object-fit: contain;
}

.panel-column-labels {
  width: calc(100% - 1.6rem);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
}

.model-row {
  margin-top: 0.55rem;
}

.model-label {
  margin: 0 0 0.15rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gif-card.small-gif {
  max-width: 620px;
  margin: 1rem auto 0;
}

.gif-card.small-gif img {
  width: 100%;
  display: block;
  max-height: 260px;
  object-fit: cover;
}

.inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.48rem 0.88rem;
  font-weight: 600;
}

.pdf-frame-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  min-height: 520px;
}

.pdf-frame-wrap iframe {
  width: 100%;
  height: 70vh;
  min-height: 520px;
  border: 0;
}

pre {
  margin: 0.9rem 0;
  background: #10212f;
  color: #eaf1f6;
  border-radius: 12px;
  border: 1px solid #1f3f56;
  padding: 0.95rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

#copy-bibtex {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: white;
  border-radius: 10px;
  padding: 0.48rem 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

#copy-bibtex:hover {
  background: #034f60;
}

.site-footer {
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0.35rem 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(9, 18, 27, 0.92);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.6rem;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 60;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox button {
  justify-self: end;
  border: 1px solid #7f95a8;
  background: transparent;
  color: white;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.lightbox img {
  max-width: min(1200px, 95vw);
  max-height: 78vh;
  border-radius: 10px;
  background: white;
}

.lightbox p {
  margin: 0;
  color: #e7edf2;
  text-align: center;
  max-width: 90ch;
}

.zoomable {
  cursor: zoom-in;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

  .cards.three-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .equation-grid-two,
  .method-triple-grid {
    grid-template-columns: 1fr;
  }

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

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

  .panel-grid.four-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-figure-grid.three-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-column-labels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .container {
    width: min(1120px, calc(100% - 1.2rem));
  }

  .hero {
    padding-top: 1.2rem;
  }

  .hero-inner {
    border-radius: 18px;
  }

  .title-line-main {
    white-space: normal;
  }

  .nav-links {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: 0.2rem;
  }

  .cards.two-col,
  .cards.three-col,
  .inline-figure-grid.two-col,
  .inline-figure-grid.three-col,
  .panel-grid.two-col,
  .panel-grid.three-col,
  .panel-grid.four-col {
    grid-template-columns: 1fr;
  }

  .exp-arch-card-inner,
  .exp-task-card-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .pdf-frame-wrap {
    min-height: 360px;
  }

  .pdf-frame-wrap iframe {
    min-height: 360px;
    height: 58vh;
  }
}

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