:root {
  --bg: #fdfaf4;
  --text-main: #333;
  --text-secondary: #444;
  --text-muted: #555;
  --text-soft: #606060;
  --surface: var(--bg);
  --border: #ddd;

  --accent: #2196f3;
  --accent-hover: #0b7dda;
  --accent-red: #e74c3c;
  --accent-red-dark: #c0392b;

  --ui-neutral-1: #f0e8e7;
  --ui-neutral-2: #f5f5f5;
  --ui-neutral-3: #e8e8e8;
  --ui-neutral-4: #e0e0e0;
  --ui-neutral-5: #ccc;

  --container-max-width: 960px;
  --section-spacing: 60px;
  --focus-hint-font-size: 1.11rem;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Work Sans", "Open Sans", sans-serif;
  color: var(--text-main);
  line-height: 1.65;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 0%, rgba(232, 232, 232, 0.26) 0, rgba(232, 232, 232, 0) 36%),
    radial-gradient(circle at 90% 15%, rgba(240, 232, 231, 0.34) 0, rgba(240, 232, 231, 0) 38%);
}

a {
  color: var(--accent);
  transition: color 0.25s ease;
}

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

.hidden {
  display: none !important;
}

.page {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 18px 20px 72px;
}

.section {
  margin-top: var(--section-spacing);
}

.hero {
  margin-top: 10px;
  text-align: center;
}

.hero-title {
  margin: 0 auto 12px;
  max-width: 90%;
  color: #222;
  font-family: "Varela Round", sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.24;
}

.authors {
  margin: 0;
  color: var(--text-main);
  font-size: 1.05rem;
}

.placeholder-text {
  color: var(--text-soft);
}

.hero-links {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 34px;
  margin-top: 14px;
}

.hero-tldr {
  width: min(70%, 900px);
  margin: 30px auto 0;
  color: var(--text-main);
  text-align: center;
  font-size: 1.08rem;
  line-height: 1.45;
}

.hero-tldr-label {
  margin-right: 3px;
  font-weight: 800;
}

.icon-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  text-decoration: none;
  transition: transform 0.2s ease, color 0.2s ease;
}

.icon-link:hover {
  transform: translateY(-2px);
  color: #222;
}

.icon-link span:last-child {
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon {
  width: 56px;
  height: 56px;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.video-link:hover .play-triangle {
  animation: nudge 0.6s ease;
}

.section-title {
  margin: 0 0 16px;
  color: #222;
  text-align: left;
  font-family: "Varela Round", sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
}

.subsection-title {
  margin: 0 0 10px;
  color: #222;
  text-align: left;
  font-family: "Varela Round", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
}

.section-caption,
figcaption {
  max-width: 900px;
  margin: 14px auto 0;
  color: var(--text-secondary);
  text-align: left;
  font-size: 1rem;
  line-height: 1.65;
}

.section-caption {
  text-align: center;
}

.section-focus-hint {
  max-width: none;
  margin: -16px 0 8px;
  color: var(--accent-red);
  text-align: left;
  font-size: var(--focus-hint-font-size);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-copy {
  max-width: 900px;
  margin: 0 auto;
  color: var(--text-secondary);
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.7;
}

.abstract-content {
  width: min(70%, 900px);
  margin: 0 auto;
}

#abstract {
  margin-top: 34px;
}

.abstract-dropdown {
  width: 100%;
  margin: 0;
}

.abstract-summary {
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: var(--accent);
  font-family: "Work Sans", "Open Sans", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.abstract-summary:hover {
  color: var(--accent-hover);
}

.abstract-summary::marker,
.abstract-summary::-webkit-details-marker {
  display: none;
}

.abstract-summary-open {
  display: none;
}

.abstract-dropdown[open] .abstract-summary-closed {
  display: none;
}

.abstract-dropdown[open] .abstract-summary-open {
  display: inline;
}

.abstract-dropdown .section-copy {
  max-width: none;
  margin: 14px 0 0;
}

.media-block {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.media-block img,
.media-block video,
.media-block iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius-xl);
}

.media-block iframe {
  aspect-ratio: 16 / 9;
}

#framework .media-block img.framework-hardware-image {
  width: 90% !important;
  margin: 0 auto;
}

.pipeline-video-crop {
  overflow: hidden;
  border-radius: var(--radius-xl);
  aspect-ratio: 24 / 9;
}

.pipeline-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
}

.pipeline-demo-rollout-crop {
  overflow: hidden;
  border-radius: var(--radius-xl);
  aspect-ratio: 26 / 9;
  width: 85%;
  margin: 14px auto 0;
  background: #000;
}

.pipeline-demo-rollout-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.pipeline-pp-caption {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

.results-stack {
  display: grid;
  gap: 20px;
}

.video-wrap {
  padding: 0;
}

.teaser-section {
  margin-top: 20px;
}

.teaser-media-block {
  width: 90%;
  margin: 0 auto;
}

.model-viewer-section {
  margin-top: 18px;
}

.model-viewer-shell {
  width: 90%;
  margin: 0 auto;
}

.model-viewer-frame {
  width: 100%;
  aspect-ratio: 16 / 8;
}

.dexexo-model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px dashed var(--ui-neutral-5);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(240, 232, 231, 0.7)),
    radial-gradient(circle at 15% 15%, rgba(33, 150, 243, 0.09), rgba(33, 150, 243, 0) 40%);
}

.model-viewer-note {
  margin: 8px 4px 0;
  color: var(--text-soft);
  text-align: center;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
}

.model-viewer-note code {
  font-family: "Fira Code", monospace;
  font-size: 0.95em;
}

.video-gallery {
  margin-top: 2px;
}

.gallery-toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 0;
  margin-bottom: 0;
}

.gallery-grid {
  display: grid;
  gap: 12px;
}

.video-gallery-hardware .gallery-grid,
.video-gallery-policy .gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-item {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  outline: 0;
  transform: translateY(-2px);
}

.gallery-item.is-selected {
  background: transparent;
}

.video-gallery.is-focused.video-gallery-hardware .gallery-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.video-gallery.is-focused.video-gallery-policy .gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-gallery.is-focused .gallery-item.is-selected {
  display: none;
}

.gallery-focus {
  margin: 0 0 10px;
}

.gallery-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 0;
  border-radius: var(--radius-lg);
  background: #000;
}

.gallery-label {
  margin: 8px 2px 0;
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
}

.video-gallery.is-focused .gallery-item:not(.is-selected) .gallery-label {
  font-size: 0.84rem;
}

.reveal-media-wrapper {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-xl);
  background: transparent;
}

#results .reveal-media-wrapper {
  width: min(75%, 900px);
  margin: 0 auto;
}

.reveal-base-img,
.reveal-overlay-img {
  display: block;
  width: 100%;
  height: auto;
  border: 0 !important;
  border-radius: 0 !important;
}

.reveal-overlay-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 2.4s cubic-bezier(0.4, 0.05, 0.2, 0.98);
}

.reveal-down-up {
  clip-path: inset(100% 0 0 0);
}

.reveal-down-up.revealed {
  clip-path: inset(0 0 0 0);
}

.reveal-left-right {
  clip-path: inset(0 100% 0 0);
}

.reveal-left-right.revealed {
  clip-path: inset(0 0 0 0);
}

.citation-card {
  max-width: 780px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.citation-card .section-title {
  margin-bottom: 8px;
  text-align: left;
}

.citation-card .section-caption {
  margin: 0 0 14px;
  text-align: left;
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #1e1e1e;
}

code {
  font-family: "Fira Code", "Monaco", "Menlo", "Courier New", monospace;
  font-size: 0.97rem;
}

pre code {
  color: #d4d4d4;
}

:not(pre) > code {
  color: #222;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--ui-neutral-2);
  padding: 0 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-main);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.25s ease, color 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--ui-neutral-2);
  color: #222;
}

.btn.active {
  background: #222;
  color: #fff;
}

.accordion-block {
  max-width: 900px;
  margin: 0 auto;
}

.accordion-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font-family: "Varela Round", sans-serif;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.accordion-row:hover {
  background: var(--ui-neutral-2);
}

.accordion-arrow {
  transition: transform 0.25s ease;
}

.accordion-row.active .accordion-arrow {
  transform: rotate(90deg);
}

.accordion-panel {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.pulse-highlight {
  color: var(--accent-red);
  font-weight: 600;
  animation: pulse-glow 2.2s ease-in-out infinite;
}

.callout {
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: #f8f9fa;
}

.toc {
  position: fixed;
  top: 50px;
  left: 22px;
  z-index: 40;
}

.toc nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.toc-link {
  color: var(--text-soft);
  text-decoration: none;
  font-family: "Varela Round", sans-serif;
  font-size: 0.95rem;
  transition: color 0.25s ease;
}

.toc-link:hover,
.toc-link.active {
  color: #000;
}

@keyframes nudge {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(3px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    color: var(--accent-red);
    text-shadow: 0 0 0 rgba(192, 57, 43, 0);
  }
  50% {
    color: var(--accent-red-dark);
    text-shadow: 0 0 8px rgba(192, 57, 43, 0.2);
  }
}

@media (max-width: 980px) {
  .video-gallery-hardware .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-gallery-policy .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-gallery.is-focused.video-gallery-hardware .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1300px) {
  .toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .page {
    max-width: 100%;
    padding: 14px 16px 34px;
  }

  .section {
    margin-top: 42px;
  }

  .hero-title {
    max-width: 100%;
    font-size: 1.58rem;
  }

  .authors {
    font-size: 0.98rem;
  }

  .hero-links {
    gap: 22px;
    margin-top: 10px;
  }

  .hero-tldr {
    width: 100%;
    margin-top: 22px;
    font-size: 0.98rem;
    line-height: 1.4;
  }

  .icon {
    width: 44px;
    height: 44px;
  }

  .section-title {
    margin-bottom: 12px;
    font-size: 1.48rem;
  }

  .subsection-title {
    font-size: 1.06rem;
  }

  .section-caption,
  figcaption {
    font-size: 0.95rem;
  }

  .section-copy {
    font-size: 0.9rem;
  }

  .abstract-dropdown {
    width: 100%;
  }

  .abstract-content {
    width: 100%;
  }

  #abstract {
    margin-top: 26px;
  }

  .teaser-section {
    margin-top: 14px;
  }

  .teaser-media-block {
    width: 100%;
  }

  .model-viewer-shell {
    width: 100%;
  }

  #results .reveal-media-wrapper {
    width: 100%;
  }

  .pipeline-pp-caption {
    font-size: 0.9rem;
  }

  .pipeline-demo-rollout-crop {
    width: 100%;
  }

  .gallery-grid,
  .video-gallery-hardware .gallery-grid,
  .video-gallery-policy .gallery-grid {
    grid-template-columns: 1fr;
  }

  .video-gallery.is-focused.video-gallery-hardware .gallery-grid,
  .video-gallery.is-focused.video-gallery-policy .gallery-grid {
    grid-template-columns: 1fr;
  }

  .video-gallery.is-focused .gallery-item.is-selected,
  .video-gallery.is-focused .gallery-item:not(.is-selected) {
    grid-column: 1 / -1;
  }

  .gallery-item {
    padding: 0;
  }

  .media-block {
    padding: 0;
  }

  .citation-card {
    padding: 0;
    border-radius: 0;
  }

  code {
    font-size: 0.87rem;
  }
}
