:root {
  /* Default theme: LIGHT */
  --bg: #f8f9ff;
  --bg2: #eef2ff;
  --card: rgba(0, 0, 0, 0.04);
  --card2: rgba(0, 0, 0, 0.06);
  --text: rgba(11, 15, 23, 0.92);
  --muted: rgba(11, 15, 23, 0.74);
  --muted2: rgba(11, 15, 23, 0.62);
  --line: rgba(11, 15, 23, 0.12);
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.14);
  --shadow2: 0 12px 30px rgba(0, 0, 0, 0.10);
  --radius: 18px;
  --radius2: 12px;
  --maxw: 1120px;

  --accent: #7c3aed; /* purple */
  --accent2: #0891b2; /* cyan */
  --accent3: #e11d48; /* rose */
  --good: #059669;
  --warn: #d97706;

  /* Surfaces (avoid hardcoded whites so light/dark both look correct) */
  --surface: rgba(0, 0, 0, 0.04);
  --surface2: rgba(0, 0, 0, 0.06);
  --surface3: rgba(0, 0, 0, 0.12);
  --topbarBg: rgba(255, 255, 255, 0.78);
  --topbarBorder: rgba(11, 15, 23, 0.10);
  --theadBg: rgba(255, 255, 255, 0.78);
  --codeBg: rgba(0, 0, 0, 0.05);
  --codeText: rgba(11, 15, 23, 0.86);
  --onDark: rgba(255, 255, 255, 0.92);
  --heroKeyBgTop: rgba(0, 0, 0, 0.04);
  --heroKeyBgBottom: rgba(0, 0, 0, 0.025);
  --lightboxFigureBg: rgba(255, 255, 255, 0.86);
  --lightboxFigureBorder: rgba(11, 15, 23, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(34, 211, 238, 0.16), transparent 50%),
    radial-gradient(1000px 600px at 90% 20%, rgba(167, 139, 250, 0.18), transparent 55%),
    radial-gradient(900px 550px at 65% 85%, rgba(251, 113, 133, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  line-height: 1.5;
  font-size: 19px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

code,
pre {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
}

.container {
  width: min(var(--maxw), calc(100% - 32px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  background: var(--text);
  color: var(--bg);
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 50;
}
.skip-link:focus {
  left: 10px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbarBg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--topbarBorder);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.3px;
}
.brand__logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow2);
}
.brand__text {
  font-size: 14px;
}
.brand--small .brand__logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.partnerLogos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.partnerLogos__img {
  height: 26px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.nav {
  display: none;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.nav__link {
  text-decoration: none;
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.nav__link:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}

.topbar__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: none;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--surface2);
  border-color: var(--surface3);
}
.btn:active {
  transform: translateY(0);
}
.btn--primary {
  border-color: rgba(167, 139, 250, 0.30);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.35), rgba(34, 211, 238, 0.24));
}
.btn--primary:hover {
  border-color: rgba(167, 139, 250, 0.45);
}
.btn--ghost {
  background: transparent;
}
.btn__icon {
  font-size: 14px;
  opacity: 0.9;
}

.hero {
  padding: 42px 0 18px;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}
.hero__keyFigure {
  margin-top: 14px;
}

.badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.badge {
  font-size: 15px;
  font-weight: 750;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 6px 10px;
  border-radius: 999px;
}

.hero__title {
  margin: 0 0 10px;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.8px;
}
.hero__subtitle {
  display: block;
  margin-top: 8px;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.35;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: -0.2px;
}

.hero__authors {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 17px;
}

.hero__lead {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 18px;
  max-width: 62ch;
}

.hook {
  margin: 6px 0 14px;
}
.hook__headline {
  font-weight: 950;
  letter-spacing: -0.3px;
  font-size: 18px;
  margin: 0 0 10px;
}
.hook__sub {
  margin: 0 0 12px;
  max-width: 78ch;
  color: var(--muted);
  font-size: 16.8px;
  line-height: 1.48;
}
.hook__sub strong {
  color: var(--text);
}
.hook__grid {
  gap: 10px;
}
.hook__card {
  padding: 12px;
  background: var(--surface);
}
.hook__title {
  font-weight: 900;
  letter-spacing: -0.2px;
  margin: 2px 0 8px;
}
.hook__body {
  margin: 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.45;
}
.hook__card--warn {
  border-color: rgba(251, 191, 36, 0.28);
}
.hook__card--bad {
  border-color: rgba(251, 113, 133, 0.26);
}
.hook__card--good {
  border-color: rgba(52, 211, 153, 0.26);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 14px;
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}
.meta {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius2);
  padding: 12px;
}
.meta__k {
  font-size: 14px;
  color: var(--muted2);
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.meta__v {
  margin-top: 6px;
  font-size: 16px;
  color: var(--text);
  font-weight: 650;
}

.section {
  padding: 26px 0;
}
.section h2 {
  margin: 0 0 14px;
  font-size: 26px;
  letter-spacing: -0.4px;
}

.grid {
  display: grid;
  gap: 14px;
}
.grid--2 {
  grid-template-columns: 1fr;
}
.grid--3 {
  grid-template-columns: 1fr;
}
.grid--4 {
  grid-template-columns: 1fr;
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow2);
}
.card--media {
  padding: 12px;
}
.card__title {
  font-weight: 900;
  letter-spacing: -0.2px;
  margin: 2px 0 10px;
}
.card__body {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.prose p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 17px;
}
.prose strong {
  color: var(--text);
}

.bullets {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.bullets li {
  margin: 10px 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.45;
}
.bullets li b,
.bullets li strong {
  color: var(--text);
}
.bullets--tight li {
  margin: 8px 0;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.pill {
  font-size: 15px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.media {
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  position: relative;
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  box-shadow: var(--shadow2);
}
.media img {
  width: 100%;
  height: auto;
}
.media__hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 15px;
  font-weight: 750;
  color: var(--onDark);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 10px;
  border-radius: 999px;
}
.media--tight {
  cursor: zoom-in;
  border-radius: 14px;
}
.media--link {
  cursor: pointer;
  text-decoration: none;
}
.media--full {
  cursor: zoom-in;
}

.caption {
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted2);
}
.caption code {
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 15px;
}

.gallery {
  display: grid;
  gap: 10px;
}
.gallery--3 {
  grid-template-columns: repeat(3, 1fr);
}

.embedGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}
.embed {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 10px;
}
.embed__k {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.2px;
  color: var(--text);
  margin: 0 0 8px;
}
.fig-embed {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.mosaicPreview {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.mosaicPreview__frame {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}
.mosaicPreview__frame--crop {
  height: 320px; /* crop tall preview while keeping full width */
}
.mosaicPreview__img {
  display: block;
  width: 100%;
  height: auto;
}
.mosaicPreview__frame--crop .mosaicPreview__img {
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.mosaic {
  position: relative;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: zoom-in;
}
.mosaic__hint {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 12px;
  font-weight: 850;
  color: var(--onDark);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 10px;
  border-radius: 999px;
  z-index: 2;
}
.mosaic--lightbox {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
}
.mosaic--lightbox {
  gap: 12px;
}

.table-wrap {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  background: var(--surface);
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.table th,
.table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 16px;
  color: var(--muted);
  white-space: nowrap;
}
.table th {
  position: sticky;
  top: 0;
  background: var(--theadBg);
  color: var(--text);
  font-weight: 900;
}
.table td strong {
  color: var(--text);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.18);
  color: var(--text);
  font-weight: 850;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 17px;
}

.code {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--codeBg);
  overflow: auto;
  color: var(--codeText);
}

.footer {
  padding: 24px 0 44px;
  border-top: 1px solid var(--line);
  margin-top: 22px;
}
.footer__inner {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 999px;
}
.link:hover {
  color: var(--text);
  background: var(--surface);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100;
}
.lightbox.is-open {
  display: grid;
  place-items: center;
}
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  cursor: zoom-out;
}
.lightbox__figure {
  position: relative;
  width: min(1180px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  background: var(--lightboxFigureBg);
  border: 1px solid var(--lightboxFigureBorder);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lightbox__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}
.lightbox__close:hover {
  background: var(--surface3);
}
.lightbox__img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.24);
}
.lightbox__caption {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.lightbox__custom {
  padding: 12px;
  max-height: calc(100vh - 140px);
  overflow: auto;
}

/* Responsive */
@media (min-width: 760px) {
  .grid--4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 980px) {
  .nav {
    display: flex;
  }
  .hero__grid {
    /* pipeline figure is below; keep hero focused on text */
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .grid--2 {
    grid-template-columns: 1fr 1fr;
  }
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .meta-row {
    grid-template-columns: 1fr 1fr;
  }

  .mosaicPreview__frame--crop {
    height: 380px;
  }

  .span-2 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .partnerLogos__img {
    height: 22px;
    max-width: 140px;
  }
  .mosaicPreview {
    flex-direction: column;
  }
  .mosaicPreview__frame--crop {
    height: 260px;
  }
}

/* Emphasize key figure (pipeline) */
.card--heroKey {
  border-color: rgba(34, 211, 238, 0.22);
  background: linear-gradient(180deg, var(--heroKeyBgTop), var(--heroKeyBgBottom));
  padding: 10px;
}

.heroKeyFull {
  /* make the pipeline figure feel "page-width" */
  padding: 10px;
}

/* De-emphasize minor figures (e.g., deep-fusion block diagram) */
.card--minor {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: none;
  background: var(--surface);
}
.media--minor {
  box-shadow: none;
}

/* Optional: force dark theme by setting <html data-theme="dark"> */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f17;
  --bg2: #0a1324;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.78);
  --muted2: rgba(255, 255, 255, 0.70);
  --line: rgba(255, 255, 255, 0.10);
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
  --shadow2: 0 12px 30px rgba(0, 0, 0, 0.35);

  --accent: #a78bfa; /* purple */
  --accent2: #22d3ee; /* cyan */
  --accent3: #fb7185; /* rose */
  --good: #34d399;
  --warn: #fbbf24;

  --surface: rgba(255, 255, 255, 0.04);
  --surface2: rgba(255, 255, 255, 0.06);
  --surface3: rgba(255, 255, 255, 0.16);
  --topbarBg: rgba(10, 15, 25, 0.55);
  --topbarBorder: rgba(255, 255, 255, 0.10);
  --theadBg: rgba(10, 15, 25, 0.65);
  --codeBg: rgba(0, 0, 0, 0.28);
  --codeText: rgba(255, 255, 255, 0.86);
  --onDark: rgba(255, 255, 255, 0.92);
  --heroKeyBgTop: rgba(255, 255, 255, 0.06);
  --heroKeyBgBottom: rgba(255, 255, 255, 0.04);
  --lightboxFigureBg: rgba(10, 15, 25, 0.82);
  --lightboxFigureBorder: rgba(255, 255, 255, 0.12);
}


