:root {
  --bg: #f5f4ef;
  --text: #1e2a2f;
  --muted: #5b6468;
  --card: #fffcf7;
  --stroke: rgba(30, 42, 47, 0.12);
  --brand: #0f7a6c;
  --brand-2: #d68b2f;
  --shadow: 0 14px 42px rgba(20, 32, 40, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, #fff8dc 0%, rgba(255, 248, 220, 0) 38%),
    radial-gradient(circle at 85% 5%, #dff4ef 0%, rgba(223, 244, 239, 0) 42%),
    var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.bg-orb {
  position: fixed;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}

.orb-a {
  background: #7cc7bc;
  top: -180px;
  left: -120px;
}

.orb-b {
  background: #f0b86c;
  right: -140px;
  bottom: -180px;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: rgba(245, 244, 239, 0.86);
  border-bottom: 1px solid var(--stroke);
  z-index: 20;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.top-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

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

.hero {
  padding: 4.8rem 0 2.8rem;
  animation: rise 0.7s ease both;
}

.eyebrow {
  display: inline-block;
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.2;
}

h1 {
  margin: 0.6rem 0 0;
  font-size: clamp(2rem, 3.9vw, 3.25rem);
}

h1 span {
  color: var(--brand);
}

.subtitle {
  margin-top: 1rem;
  max-width: 68ch;
  color: var(--muted);
}

.author-list,
.affiliations {
  margin: 0.9rem 0 0;
  color: #25343a;
}

.author-list {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.affiliations {
  font-size: 0.95rem;
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  padding: 0.58rem 0.95rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease;
}

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

.btn.ghost {
  color: var(--brand);
  background: transparent;
}

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0;
}

.card p {
  margin: 0.45rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.media-placeholder {
  border: 1px dashed rgba(15, 122, 108, 0.45);
  background: linear-gradient(135deg, rgba(15, 122, 108, 0.09), rgba(214, 139, 47, 0.09));
  border-radius: 12px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #3f565c;
  font-size: 0.92rem;
  padding: 0.7rem;
}

.text-block {
  margin: 2.4rem auto;
}

.text-block p {
  color: #2c3d43;
}

.method-panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(250px, 42%) 1fr;
  gap: 1rem;
  padding: 1rem;
}

.method-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
}

.method-panel ul {
  margin: 0.8rem 0 0;
  padding-left: 1.15rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.resource {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--card);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

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

.resource h3 {
  margin: 0;
}

.resource p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

pre {
  margin: 0;
  padding: 1rem;
  background: #162329;
  color: #d8f3ef;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

code {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
}

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.35);
}

.footer-wrap {
  padding: 1rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

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

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

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

@media (max-width: 980px) {
  .teaser-grid,
  .resource-grid {
    grid-template-columns: 1fr 1fr;
  }

  .method-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .top-nav {
    display: none;
  }

  .hero {
    padding-top: 3.4rem;
  }

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

.demo-gif {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  display: block;
  background: #fff;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gif-caption {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.gif-caption code {
  background: rgba(15, 122, 108, 0.1);
  color: #20534c;
  border-radius: 6px;
  padding: 0.08rem 0.34rem;
}

.results-carousel {
  margin-bottom: 2.5rem;
}

.results-intro {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
}

.carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.carousel-track {
  position: relative;
  min-height: 430px;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(14px);
  transition: opacity 0.32s ease, transform 0.32s ease;

  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.carousel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.carousel-slide h3 {
  margin: 0 0 0.65rem;
}

.carousel-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: var(--text);
  font-size: 1.08rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.carousel-btn:hover {
  background: #f4fffc;
  color: var(--brand);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.95rem;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  background: #b9c3c7;
  cursor: pointer;
}

.carousel-dot.is-active {
  width: 26px;
  background: var(--brand);
}

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

  .carousel-btn {
    display: none;
  }

  .carousel-track {
    min-height: 360px;
  }
}

.paired-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.example-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: var(--shadow);
}

.example-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
}

.results-carousel .carousel-track {
  min-height: 430px;
}

.results-carousel .carousel-slide {
  padding: 0;
}

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

  .results-carousel .carousel-track {
    min-height: 680px;
  }
}

@media (max-width: 700px) {
  .results-carousel .carousel-track {
    min-height: 620px;
  }
}

/* Paired slide layout: show image+video blocks at the same time */
.paired-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.example-card {
  display: flex;
  flex-direction: column;
}

.example-card h3 {
  min-height: 2.5rem;
}

.demo-media {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}

/* PNG image examples: preserve full frame */
.demo-image {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #ffffff;
}

/* GIF video examples: fill panel like video */
.demo-video {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #ffffff;
}

.results-carousel .carousel-track {
  min-height: 430px;
}

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

  .results-carousel .carousel-track {
    min-height: 760px;
  }
}

/* Final overrides: keep 2 blocks visible together on tablet/desktop */
@media (max-width: 900px) and (min-width: 641px) {
  .paired-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-carousel .carousel-track {
    min-height: 430px;
  }
}

@media (max-width: 700px) and (min-width: 641px) {
  .results-carousel .carousel-track {
    min-height: 430px;
  }
}

.method-figure {
  margin: 0;
}

.method-caption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.dataflow-figure {
  margin: 0 auto;
  max-width: 560px;
}

.dataflow-figure img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #ffffff;
}

.dataflow-caption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Force smaller Data Flow figure size (matches Method visual scale) */
#dataflow .dataflow-figure {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

#dataflow .dataflow-figure img {
  width: 100%;
  max-width: 1280px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

#dataflow .dataflow-caption {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

/* Data Flow card style aligned with Method Overview */
#dataflow .dataflow-figure {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

#dataflow .dataflow-figure img {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #ffffff;
}
