/* Mobile presentation overrides; desktop styling stays in style.css. */
.dataset-gallery-controls {
  display: none;
}

@media (max-width: 720px) {
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
  }

  .site-header {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
    background: var(--bg);
  }

  .series-hero {
    padding: 20px 0 28px;
  }

  .series-hero h1 {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
  }

  .series-description {
    margin-top: 14px;
  }

  .series-project-links {
    gap: 10px;
    margin-top: 20px;
  }

  .series-project-links a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    font-size: 0.95rem;
  }

  .series-project-links a span {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .dataset-section {
    padding-top: 0;
    margin-bottom: 36px;
  }

  .dataset-feature-copy,
  .dataset-overview {
    padding: 20px;
  }

  .dataset-feature-topline {
    gap: 8px;
    margin-bottom: 16px;
  }

  .dataset-feature h2 {
    font-size: 2.75rem;
  }

  .dataset-modalities-summary {
    margin-top: 18px;
  }

  .dataset-info-label,
  .dataset-status-badge,
  .dataset-reading-guide strong,
  .dataset-metrics dt {
    font-size: 0.75rem;
  }

  .dataset-modality-tags li,
  .dataset-origins > div > span,
  .dataset-origins-note,
  .dataset-gallery-heading p {
    font-size: 0.8125rem;
  }

  .dataset-metrics {
    gap: 10px;
    margin-bottom: 18px;
  }

  .dataset-origins {
    gap: 10px;
    padding-top: 16px;
  }

  .dataset-gallery-heading {
    gap: 6px;
    margin-top: 24px;
  }

  .dataset-reading-guide {
    gap: 10px 20px;
    margin-bottom: 16px;
  }

  .dataset-reading-guide > span {
    font-size: 0.8125rem;
  }

  .visuotactile-grid {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    padding-bottom: 10px;
  }

  .visuotactile-card {
    flex: 0 0 90%;
    scroll-snap-align: start;
    box-shadow: none;
  }

  .visuotactile-card-copy {
    padding: 14px;
  }

  .visuotactile-card h3 {
    font-size: 1.35rem;
  }

  .visuotactile-card p,
  .thumb-card p {
    font-size: 0.9375rem;
    line-height: 1.55;
  }

  .dataset-gallery-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
  }

  .dataset-gallery-controls .thumb-arrow {
    display: block;
    flex: 0 0 44px;
    box-shadow: none;
  }

  .dataset-gallery-controls p {
    margin: 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
  }

  [data-carousel-status] {
    display: block;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }

  .hero-media {
    border-radius: 10px;
  }

  .hero-media video,
  .task-panel video {
    display: block;
    height: auto;
    min-height: 0;
    object-fit: contain;
  }

  video:fullscreen,
  video:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    min-height: 0;
    object-fit: contain;
  }

  .meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
  }

  .meta-grid .resource-card {
    padding: 10px 8px;
  }

  .resource-card dt {
    font-size: 0.75rem;
    color: var(--muted);
  }

  .meta-grid .resource-card dd {
    font-size: 0.8125rem;
  }

  .meta-grid .resource-card a {
    padding: 8px 0;
    margin: 0;
    overflow-wrap: anywhere;
  }

  .meta-grid .authors {
    padding: 14px;
    font-size: 0.875rem;
  }

  .affiliation-list,
  .author-notes {
    font-size: 0.8125rem;
  }

  .thumb-row-block,
  .toolkit-card {
    padding: 12px;
  }

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

  .thumb-viewport {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    scrollbar-width: thin;
  }

  .thumb-arrow {
    display: block;
    grid-row: 2;
    box-shadow: none;
  }

  .thumb-arrow-next {
    justify-self: end;
  }

  .thumb-carousel::after {
    display: none;
  }

  .stage-card-wide {
    padding: 14px;
  }

  .stage-topline {
    gap: 10px;
  }

  .stage-topline h3 {
    font-size: 1.25rem;
    line-height: 1.25;
  }

  .robot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .robot-grid figure {
    min-height: 0;
    padding: 44px 8px 12px;
    box-shadow: none;
  }

  .robot-grid img {
    height: 100px;
  }

  .robot-grid figcaption {
    margin-top: 10px;
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
  }

  .device-count {
    top: 8px;
    right: 8px;
    min-width: 0;
    padding: 4px 6px;
  }

  .outputs-panel {
    padding: 14px;
  }

  .outputs-header {
    gap: 8px;
  }

  .output-column {
    padding: 14px;
  }

  .score-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
  }

  .score-name {
    font-size: 0.875rem;
  }

  .score-row strong {
    grid-column: 2;
    grid-row: 1;
  }

  .score-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .citation-head {
    flex-direction: row;
    align-items: center;
  }

  .bibtex-block {
    padding: 12px;
    font-size: 0.75rem;
  }

  .coming-soon-toast {
    bottom: max(20px, env(safe-area-inset-bottom));
    max-width: calc(100% - 28px);
  }
}

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