:root {
  color-scheme: light;
  --dex-bg-primary: #ffffff;
  --dex-bg-secondary: #f7f8fa;
  --dex-bg-card: #f0f2f5;
  --dex-bg-surface: #ffffff;
  --dex-accent: #76b900;
  --dex-accent-dim: rgba(118, 185, 0, 0.12);
  --dex-accent-text: #4d7900;
  --dex-accent-hover: #3f6500;
  --dex-accent-border: #6f9700;
  --dex-text-primary: #1a1a1a;
  --dex-text-secondary: #4a4a4a;
  --dex-text-muted: #6b6b6b;
  --dex-border: #dde0e4;
  --dex-nav-bg: rgba(255, 255, 255, 0.85);
  --dex-card-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --dex-bg-primary: #0e0f17;
  --dex-bg-secondary: #151723;
  --dex-bg-card: #1b1e2e;
  --dex-bg-surface: #1b1e2e;
  --dex-accent: #76b900;
  --dex-accent-dim: rgba(118, 185, 0, 0.16);
  --dex-accent-text: #a3d65c;
  --dex-accent-hover: #bce47e;
  --dex-accent-border: rgba(118, 185, 0, 0.55);
  --dex-text-primary: #f6f7fa;
  --dex-text-secondary: #b9bcc8;
  --dex-text-muted: #b6bac7;
  --dex-border: #2c2f42;
  --dex-nav-bg: rgba(15, 16, 23, 0.85);
  --dex-card-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  --color-surface-default: var(--dex-bg-primary);
  --color-surface-white: var(--dex-bg-primary);
  --color-surface-alt-1: var(--dex-bg-card);
  --color-surface-alt-2: var(--dex-bg-secondary);
  --color-display-heading: var(--dex-text-primary);
  --color-display-text: var(--dex-text-secondary);
  --color-display-text-active: var(--dex-text-primary);
  --color-display-text-inactive: var(--dex-text-muted);
  --color-display-text-muted: var(--dex-text-muted);
  --color-display-text-caption: var(--dex-text-muted);
  --color-display-border: var(--dex-border);
  --color-display-border-alt-1: var(--dex-border);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

body {
  margin: 0;
  background: var(--dex-bg-primary);
  color: var(--dex-text-primary);
  font-family: "NVIDIA Sans", "Noto Sans", sans-serif;
  line-height: 1.6;
}

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

img,
video {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.dex-skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1200;
  padding: 0.65rem 1rem;
  color: #111111;
  background: var(--dex-accent);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
}

.dex-skip-link:focus {
  transform: translateY(0);
}

.dex-brand-bar {
  height: 44px;
  display: flex;
  align-items: center;
  background: var(--dex-bg-primary);
  border-bottom: 1px solid var(--dex-border);
}

.dex-brand-inner {
  display: flex;
  align-items: center;
}

.dex-nvidia-link {
  display: inline-flex;
  align-items: center;
}

.dex-nvidia-logo {
  display: block;
  width: auto;
  height: 24px;
}

:root[data-theme="dark"] .dex-nvidia-logo path:not([fill]) {
  fill: #ececec;
}

.dex-project-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 52px;
  display: flex;
  align-items: center;
  background: var(--dex-nav-bg);
  border-bottom: 1px solid var(--dex-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dex-js .dex-project-nav {
  position: fixed;
  right: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  visibility: hidden;
  transition: opacity 300ms ease, transform 300ms ease, visibility 300ms ease, box-shadow 300ms ease;
}

.dex-js .dex-project-nav.is-visible,
.dex-js .dex-project-nav:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.dex-project-nav-inner {
  width: 100%;
  max-width: 1100px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.dex-project-brand {
  flex: 0 0 auto;
  color: var(--dex-text-primary);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.dex-project-brand:hover {
  color: var(--dex-accent-text);
}

.dex-project-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-color: var(--dex-accent) transparent;
  scrollbar-width: thin;
}

.dex-project-links a {
  flex: 0 0 auto;
  padding: 0.35rem 0.75rem;
  color: var(--dex-text-muted);
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease;
}

.dex-project-links a:hover {
  color: var(--dex-text-primary);
  background: var(--dex-bg-card);
}

.dex-project-links a[aria-current="true"] {
  color: var(--dex-accent-text);
  background: var(--dex-accent-dim);
}

.dex-section {
  padding: 4rem 0;
  scroll-margin-top: 64px;
  background: var(--dex-bg-primary);
}

.dex-section-alt {
  background: var(--dex-bg-secondary);
}

.dex-hero {
  padding-top: 5rem;
  background: var(--dex-bg-primary);
}

.dex-hero h1 {
  max-width: 1050px;
  margin: 0 0 1.25rem;
  color: var(--dex-text-primary);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.dex-small-caps {
  font-variant: small-caps;
  letter-spacing: 0.015em;
}

.dex-venue {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.8rem;
  color: var(--dex-accent-text);
  background: #eef5dd;
  border: 1px solid var(--dex-accent-border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

:root[data-theme="dark"] .dex-venue {
  color: var(--dex-accent-text);
  background: rgba(118, 185, 0, 0.16);
  border-color: rgba(118, 185, 0, 0.45);
}

.dex-authors {
  max-width: 1050px;
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.dex-authors a,
.dex-copy a,
.dex-references a {
  color: var(--dex-accent-text);
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.dex-authors a:hover,
.dex-copy a:hover,
.dex-references a:hover {
  color: var(--dex-accent-hover);
  text-decoration-color: currentColor;
}

.dex-authors sup,
.dex-affiliations sup {
  margin-left: 0.12em;
  color: var(--dex-text-muted);
  font-size: 0.7em;
}

.dex-affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  margin: 0 0 1.6rem;
  color: var(--dex-text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.dex-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.dex-cta-row a {
  min-height: 0;
  padding: 0.55rem 1.35rem;
  color: var(--dex-accent-text);
  background: #eef5dd;
  border: 1.5px solid var(--dex-accent-border);
  border-radius: 10px;
  box-shadow: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.dex-cta-row a:hover {
  color: var(--dex-accent-hover);
  background: #e5f0cd;
  border-color: var(--dex-accent-hover);
  box-shadow: 0 3px 9px rgba(118, 185, 0, 0.15);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .dex-cta-row a {
  color: var(--dex-accent-text);
  background: rgba(118, 185, 0, 0.16);
  border-color: rgba(118, 185, 0, 0.45);
}

:root[data-theme="dark"] .dex-cta-row a:hover {
  color: var(--dex-accent-hover);
  background: rgba(118, 185, 0, 0.24);
  border-color: rgba(118, 185, 0, 0.7);
}

.dex-cta-row a:focus-visible,
.dex-carousel button:focus-visible,
.dex-copy-button:focus-visible,
.dex-project-nav a:focus-visible,
.dex-nvidia-link:focus-visible {
  outline: 3px solid var(--dex-accent-text);
  outline-offset: 3px;
}

.dex-teaser {
  margin: 0;
}

.dex-teaser-viewport {
  overflow: hidden;
  background: var(--dex-bg-surface);
  border: 1px solid var(--dex-border);
  border-radius: 10px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.dex-teaser-viewport:hover {
  border-color: var(--dex-accent);
  box-shadow: var(--dex-card-shadow);
}

.dex-teaser-viewport:focus-visible {
  outline: 3px solid var(--dex-accent-text);
  outline-offset: 3px;
}

.dex-teaser img {
  display: block;
  width: 100%;
  height: auto;
}

.dex-mobile-media-hint {
  display: none;
}

.dex-teaser figcaption {
  max-width: 970px;
  margin: 1rem auto 0;
  color: var(--dex-text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
}

.dex-copy {
  max-width: 900px;
}

.dex-copy h2,
.dex-section-heading h2 {
  margin: 0 0 1.5rem;
  color: var(--dex-text-primary);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.dex-copy h2::after,
.dex-section-heading h2::after {
  display: block;
  width: 50px;
  height: 3px;
  margin: 0.7rem auto 0;
  background: var(--dex-accent);
  border-radius: 2px;
  content: "";
}

.dex-copy p,
.dex-section-heading > p {
  margin: 0;
  color: var(--dex-text-secondary);
  font-size: 1.05rem;
  line-height: 1.65;
}

.dex-section-heading {
  max-width: 1000px;
  margin: 0 auto 2rem;
  text-align: center;
}

.dex-main-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #000000;
  border: 1px solid var(--dex-border);
  border-radius: 10px;
  box-shadow: var(--dex-card-shadow);
}

.dex-media-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.dex-media-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 820px;
  margin: 0 auto;
}

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

.dex-media-card {
  min-width: 0;
  margin: 0;
  padding: 0.75rem;
  background: var(--dex-bg-surface);
  border: 1px solid var(--dex-border);
  border-radius: 10px;
  box-shadow: none;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.dex-media-card:hover {
  border-color: var(--dex-accent);
  box-shadow: var(--dex-card-shadow);
  transform: translateY(-3px);
}

.dex-media-card figcaption:not(.dex-sr-only) {
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  color: var(--dex-text-secondary);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.dex-media-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: 8px;
  object-fit: contain;
}

.dex-references {
  margin-top: 1rem !important;
  color: var(--dex-text-muted) !important;
  font-size: 0.92rem !important;
  line-height: 1.55 !important;
  text-align: left;
}

.dex-carousel {
  padding: clamp(1rem, 2vw, 1.5rem);
  background: var(--dex-bg-surface);
  border: 1px solid var(--dex-border);
  border-radius: 12px;
}

.dex-section-alt .dex-carousel {
  background: var(--dex-bg-surface);
}

.dex-carousel:focus-visible {
  outline: 3px solid var(--dex-accent-text);
  outline-offset: 4px;
}

.dex-carousel-slide {
  animation: dex-slide-in 180ms ease-out;
}

.dex-carousel-controls {
  display: none;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.dex-js .dex-carousel-controls {
  display: grid;
}

.dex-carousel-controls button,
.dex-copy-button {
  min-height: 42px;
  padding: 0.65rem 1rem;
  color: var(--dex-accent-text);
  background: #eef5dd;
  border: 1.5px solid var(--dex-accent-border);
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.dex-carousel-controls button:first-child {
  justify-self: start;
}

.dex-carousel-controls button:last-child {
  justify-self: end;
}

.dex-carousel-controls button:hover,
.dex-copy-button:hover {
  color: var(--dex-accent-hover);
  background: #e5f0cd;
  border-color: var(--dex-accent-hover);
  box-shadow: 0 3px 9px rgba(118, 185, 0, 0.15);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .dex-carousel-controls button,
:root[data-theme="dark"] .dex-copy-button {
  color: var(--dex-accent-text);
  background: rgba(118, 185, 0, 0.16);
  border-color: rgba(118, 185, 0, 0.45);
}

:root[data-theme="dark"] .dex-carousel-controls button:hover,
:root[data-theme="dark"] .dex-copy-button:hover {
  color: var(--dex-accent-hover);
  background: rgba(118, 185, 0, 0.24);
  border-color: rgba(118, 185, 0, 0.7);
}

.dex-carousel-controls p {
  min-width: 9.5rem;
  margin: 0;
  color: var(--dex-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.dex-code-container {
  position: relative;
  overflow: hidden;
  background: var(--dex-bg-card);
  border: 1px solid var(--dex-border);
  border-radius: 10px;
}

.dex-code-container pre {
  margin: 0;
  padding: 4.5rem 1.5rem 1.5rem;
  overflow-x: auto;
  color: var(--dex-text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.65;
  tab-size: 2;
}

.dex-code-container code {
  font: inherit;
}

.dex-copy-button {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
}

.dex-js .dex-copy-button {
  display: block;
}

.dex-copy-button:focus-visible {
  outline-color: var(--dex-accent-text);
  box-shadow: 0 0 0 2px var(--dex-bg-primary);
}

.dex-copy-status {
  min-height: 1.5rem;
  margin: 0.65rem 0 0;
  color: var(--dex-text-muted);
  font-size: 0.9rem;
  text-align: right;
}

.dex-theme-toggle {
  display: none;
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1100;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--dex-text-primary);
  background: var(--dex-bg-surface);
  border: 1px solid var(--dex-border);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.dex-js .dex-theme-toggle {
  display: flex;
}

.dex-theme-toggle:hover {
  color: var(--dex-accent-text);
  border-color: var(--dex-accent-text);
  transform: translateY(-2px);
}

.dex-theme-toggle:focus-visible {
  outline: 2px solid var(--dex-accent-text);
  outline-offset: 3px;
}

.dex-theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .dex-theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .dex-theme-icon-sun {
  display: inline;
}

.dex-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes dex-slide-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1000px) {
  .dex-project-nav-inner {
    gap: 1rem;
  }

  .dex-project-links a {
    padding-right: 0.55rem;
    padding-left: 0.55rem;
    font-size: 0.84rem;
  }

  .dex-hero h1 {
    font-size: 2.4rem;
  }
}

@media (max-width: 820px) {
  .dex-media-grid-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dex-project-nav-inner {
    padding-right: 0;
  }

  .dex-section {
    padding: 3rem 0;
  }

  .dex-hero {
    padding-top: 3.5rem;
  }

  .dex-hero h1 {
    font-size: 1.8rem;
  }

  .dex-copy h2,
  .dex-section-heading h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 600px) {
  .dex-project-nav {
    min-height: 52px;
  }

  .dex-project-nav-inner {
    gap: 0.75rem;
  }

  .dex-project-brand {
    font-size: 1rem;
  }

  .dex-project-links a {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }

  .dex-section {
    scroll-margin-top: 62px;
  }

  .dex-affiliations {
    display: grid;
    gap: 0.25rem;
  }

  .dex-cta-row {
    margin-bottom: 2.5rem;
  }

  .dex-teaser-viewport {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-color: var(--dex-accent) var(--dex-border);
  }

  .dex-teaser img {
    width: 760px;
    max-width: none;
  }

  .dex-mobile-media-hint {
    display: block;
    margin: 0.55rem 0 0;
    color: var(--dex-text-muted);
    font-size: 0.8rem;
    text-align: center;
  }

  .dex-carousel-controls {
    grid-template-columns: 1fr 1fr;
  }

  .dex-carousel-controls p {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .dex-code-container pre {
    padding-right: 1rem;
    padding-left: 1rem;
    font-size: 0.78rem;
  }

  .dex-theme-toggle {
    right: 1rem;
    bottom: 1rem;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .dex-hero h1 {
    font-size: 1.5rem;
  }

  .dex-media-grid-two,
  .dex-media-grid-three {
    grid-template-columns: 1fr;
  }

  .dex-carousel {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .dex-cta-row a:hover,
  .dex-media-card:hover,
  .dex-carousel-controls button:hover,
  .dex-copy-button:hover,
  .dex-theme-toggle:hover {
    transform: none;
  }
}
