/* Scoped to the gallery and dialog; scientific sections retain their existing styles. */
#video .section-heading { max-width: 850px; }
#video .section-lead { font-size: 1rem; margin-top: 1rem; }
#video .demo-card { box-shadow: 0 5px 20px rgba(56, 68, 96, 0.05); transition: border-color 160ms ease, box-shadow 160ms ease; }
#video .demo-card:hover { border-color: #b5c2d7; box-shadow: 0 8px 25px rgba(56, 68, 96, 0.1); }
#video .demo-cover { background: var(--blue-soft); }
#video .demo-cover__content { max-width: 90%; font-size: 0.82rem; }
#video .demo-card[hidden] { display: none; }
#demo-scene-grid { scroll-margin-top: 7rem; }
.demo-pagination { align-items: center; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--line); border-radius: 1rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin-top: 1.75rem; padding: 1rem 1.25rem; }
.demo-pagination__summary { display: flex; flex-direction: column; gap: 0.25rem; }
.demo-pagination__eyebrow { color: var(--blue-deep); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.demo-pagination__announcement { clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.demo-pagination__controls, .demo-pagination__numbers { align-items: center; display: flex; gap: 0.35rem; }
.demo-pagination button { align-items: center; background: transparent; border: 1px solid transparent; border-radius: 0.65rem; color: var(--muted); cursor: pointer; display: inline-flex; font-family: inherit; font-size: 0.78rem; gap: 0.55rem; justify-content: center; min-height: 2.6rem; min-width: 2.6rem; padding: 0.5rem 0.7rem; transition: background 150ms ease, color 150ms ease; }
.demo-pagination button:hover:not(:disabled) { background: var(--blue-soft); color: var(--blue-deep); }
.demo-pagination .demo-page-number[aria-current="page"] { background: var(--blue-deep); box-shadow: 0 3px 8px rgba(56, 68, 96, 0.12); color: white; font-weight: 600; }
.demo-pagination button:disabled { cursor: default; opacity: 0.3; }
.demo-pagination button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 600px) {
  .demo-pagination { align-items: center; flex-direction: column; gap: 0.8rem; padding: 1rem; }
  .demo-pagination__summary { align-items: center; }
  .demo-page-arrow__text { display: none; }
}
.mv-dialog, .mv-dialog * { box-sizing: border-box; }
.mv-dialog {
  background: var(--paper); border: 1px solid var(--line); border-radius: 1rem;
  color: var(--ink); font-family: "Noto Sans", sans-serif; line-height: 1.5;
  margin: auto; max-height: 94dvh; max-width: 1240px; overflow: auto;
  padding: 1.5rem; width: calc(100% - 2rem);
}
.mv-dialog::backdrop { background: rgba(16, 23, 38, 0.78); }
.mv-dialog [hidden] { display: none !important; }
.mv-buffer { background: var(--wash); color: var(--blue-deep); padding: 0.6rem 0.75rem; }
.mv-buffer-copy { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; font-size: 0.82rem; }
.mv-surface:fullscreen .mv-buffer { flex-shrink: 0; margin: 0.5rem; }
.mv-controls > [data-mv="play"] { flex: 0 0 4.8rem; width: 4.8rem; }
.mv-header { align-items: flex-start; display: flex; gap: 1rem; justify-content: space-between; }
.mv-header h2 { color: var(--ink); font-family: "Source Serif 4", Georgia, serif; font-size: clamp(1.3rem, 2.5vw, 1.9rem); font-weight: 600; line-height: 1.3; margin: 0; }
.mv-eyebrow { color: var(--blue-deep); font-size: 0.67rem; font-weight: 700; letter-spacing: 0.08em; margin: 0 0 0.4rem; text-transform: uppercase; }
.mv-description { color: var(--muted); font-size: 0.9rem; margin: 0.8rem 0 1.2rem; }
.mv-dialog button, .mv-dialog input, .mv-dialog select { font: inherit; }
.mv-button { background: var(--paper); border: 1px solid #b5c0d3; border-radius: 0.4rem; color: var(--blue-deep); cursor: pointer; font-size: 0.8rem !important; line-height: 1.3; min-height: 2.4rem; padding: 0.5rem 0.7rem; }
.mv-button:hover:not(:disabled), .mv-button[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); }
.mv-button:disabled { color: var(--muted); cursor: default; opacity: 0.5; }
.mv-dialog :focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.mv-close { flex-shrink: 0; }
.mv-surface { background: #141c2a; border: 1px solid var(--line); border-radius: 0.65rem; overflow: hidden; }
.mv-stage { aspect-ratio: 16 / 9; background: #141c2a; isolation: isolate; position: relative; width: 100%; }
.mv-main { height: 100%; min-width: 0; position: relative; width: 100%; }
.mv-main-video { display: block; height: 100%; object-fit: contain; width: 100%; }
.mv-main-poster { height: 100%; inset: 0; object-fit: contain; pointer-events: none; position: absolute; width: 100%; }
.mv-main-poster[hidden] { display: none; }
.mv-main:has(.mv-main-video:not([hidden])[src]), .mv-panel-body:has(video) { cursor: pointer; }
.mv-overlay-play { align-items: center; background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 0; border-radius: 0.75rem; box-shadow: none; color: white; cursor: pointer; display: flex; height: clamp(2.75rem, 5vw, 3.5rem); justify-content: center; left: 50%; padding: 0; position: absolute; top: 50%; transform: translate(-50%, -50%); transition: background 150ms ease; width: clamp(4rem, 7vw, 5rem); z-index: 1; }
.mv-overlay-play svg { height: 50%; width: auto; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3)); }
.mv-overlay-play:hover { background: rgba(255, 255, 255, 0.14); }
.mv-overlay-play[hidden] { display: none; }
.mv-loading-spinner { animation: mv-loading-spin 0.85s linear infinite; border: 3px solid rgba(255, 255, 255, 0.28); border-top-color: white; border-radius: 50%; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65)); height: clamp(2rem, 4vw, 2.7rem); left: 50%; pointer-events: none; position: absolute; top: 50%; translate: -50% -50%; width: clamp(2rem, 4vw, 2.7rem); z-index: 3; }
.mv-panel .mv-loading-spinner { border-width: 2px; height: 1.6rem; width: 1.6rem; }
@keyframes mv-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mv-loading-spinner { animation: none; } }
.mv-video-viewport { align-items: center; background: #141c2a; display: flex; height: 100%; justify-content: center; overflow: hidden; width: 100%; }
.mv-video-frame { flex-shrink: 0; overflow: hidden; position: relative; }
.mv-video-frame video.is-framed { max-width: none; object-fit: fill; position: absolute; }
.mv-view-label { background: rgba(10, 18, 32, 0.7); border-radius: 0.25rem; color: white; font-size: 0.65rem; font-weight: 600; left: 0.7rem; letter-spacing: 0.08em; padding: 0.3rem 0.5rem; position: absolute; top: 0.7rem; z-index: 1; }
.mv-empty { align-items: center; background: #edf1f7; color: var(--ink); display: flex; flex-direction: column; height: 100%; inset: 0; justify-content: center; padding: 2rem; position: absolute; text-align: center; }
.mv-empty strong { font-family: "Source Serif 4", Georgia, serif; font-size: clamp(1rem, 2.5vw, 1.5rem); }
.mv-empty p { color: var(--muted); font-size: 0.85rem; margin: 0.65rem 0 0; max-width: 28rem; }
.mv-aux-layer { inset: 0; pointer-events: none; position: absolute; }
.mv-panel { background: #111927; border: 1px solid #92a2be; border-radius: 0.5rem; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); color: white; display: flex; flex-direction: column; height: auto; margin: 0; overflow: hidden; pointer-events: auto; position: absolute; right: 1%; width: 28%; }
.mv-panel-header { align-items: center; background: #253047; cursor: grab; display: flex; gap: 0.35rem; justify-content: space-between; min-height: 1.65rem; padding: 0.15rem 0.5rem; touch-action: none; user-select: none; }
.mv-panel-header h3 { color: #f8f9fc; font-size: clamp(0.5rem, 0.85vw, 0.72rem); font-weight: 600; letter-spacing: 0.06em; line-height: 1.2; margin: 0; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.mv-panel-close { align-items: center; background: transparent; border: 0; color: white; cursor: pointer; display: flex; flex-shrink: 0; font-size: 1.1rem; height: 1.4rem; justify-content: center; padding: 0; width: 1.4rem; }
.mv-panel-body { aspect-ratio: 16 / 9; background: #111927; flex: none; min-height: 0; overflow: hidden; position: relative; }
.mv-aux-video { display: block; height: 100%; object-fit: contain; width: 100%; }
.mv-view-notice { align-items: center; background: rgba(17, 25, 39, 0.8); border-radius: 0.25rem; color: #dce3ef; display: flex; font-size: 0.7rem; bottom: 0.35rem; left: 0.35rem; right: 0.35rem; justify-content: center; margin: 0; padding: 0.35rem; position: absolute; text-align: center; pointer-events: none; }
.mv-resume { bottom: 0.25rem; left: 50%; position: absolute; transform: translateX(-50%); }
.mv-state { color: #dce3ef; font-size: 0.75rem; overflow: auto; padding: 0.8rem; }
.mv-state-title { color: white; display: block; font-size: 0.85rem; }
.mv-state-body { margin-top: 0.5rem; white-space: pre-line; }
.mv-stage.is-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mv-stage.is-split .mv-main { align-self: center; aspect-ratio: 16 / 9; height: auto; }
.mv-stage.is-split .mv-aux-layer { align-self: center; position: relative; }
.mv-stage.is-split .mv-panel { border-radius: 0; box-shadow: none; height: auto; max-height: none; position: static; width: 100%; }
.mv-stage.is-split .mv-panel-body { aspect-ratio: 16 / 9; flex: none; }
.mv-stage.is-split .mv-panel-header { cursor: default; }
.mv-controls { align-items: center; background: #f5f7fb; color: var(--ink); display: flex; flex-wrap: wrap; font-size: 0.72rem; gap: 0.65rem; padding: 0.75rem; }
.mv-controls label { align-items: center; display: flex; gap: 0.4rem; margin: 0; }
.mv-controls [data-mv="play"] { min-width: 4.5rem; }
.mv-seek-label { flex: 1 1 12rem; }
.mv-controls input { accent-color: var(--blue-deep); min-width: 0; }
.mv-seek-label input { cursor: pointer; flex: 1; min-height: 1.5rem; touch-action: none; user-select: none; width: 100%; }
.mv-speed-label select { background: white; border: 1px solid #b5c0d3; border-radius: 0.3rem; color: var(--ink); min-height: 2rem; }
.mv-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv-viewbar, .mv-view-buttons { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mv-viewbar { background: var(--paper); border-top: 1px solid var(--line); padding: 0.75rem; }
.mv-main-chip { background: var(--blue-soft); border-radius: 0.35rem; color: var(--blue-deep); font-size: 0.8rem; font-weight: 600; padding: 0.55rem 0.7rem; }
.mv-hint { color: var(--muted); font-size: 0.75rem; margin: 0.75rem 0; }
.mv-status { color: var(--blue-deep); font-size: 0.8rem; margin: 0.75rem 0 0; min-height: 2.5em; }
.mv-timeline { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.mv-timeline h3 { font-size: 0.85rem; font-weight: 600; margin: 0 0 0.6rem; }
.mv-event-track { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mv-event-rail { background: var(--line); height: 2px; margin: 1.2rem 0.65rem 1.4rem; position: relative; }
.mv-event-marker { background: var(--paper); border: 2px solid var(--blue); border-radius: 50%; cursor: pointer; height: 0.85rem; padding: 0; position: absolute; top: 50%; transform: translate(-50%, -50%); width: 0.85rem; }
.mv-event-marker.is-current { background: var(--blue-deep); }
.mv-event { background: var(--wash); border: 1px solid var(--line); border-radius: 0.4rem; color: var(--muted); cursor: pointer; font-size: 0.72rem !important; min-height: 2.2rem; padding: 0.4rem 0.6rem; }
.mv-event::before { background: #a9b6cb; border-radius: 50%; content: ""; display: inline-block; height: 0.4rem; margin-right: 0.45rem; width: 0.4rem; }
.mv-event.is-current { border-color: var(--blue); color: var(--blue-deep); }
.mv-event.is-current::before { background: var(--blue-deep); }
.mv-surface:fullscreen { border: 0; border-radius: 0; display: flex; flex-direction: column; height: 100%; justify-content: center; overflow: auto; width: 100%; }
.mv-surface:fullscreen .mv-stage { flex: 1; min-height: 0; }
.mv-surface:fullscreen .mv-controls { flex-shrink: 0; }
.mv-surface:fullscreen .mv-viewbar { flex-shrink: 0; }
@media (max-width: 640px) {
  .mv-dialog { border-radius: 0.6rem; max-height: 96dvh; padding: 0.75rem; width: calc(100% - 1rem); }
  .mv-header { gap: 0.5rem; }
  .mv-eyebrow { font-size: 0.55rem; }
  .mv-close { font-size: 0.7rem !important; padding: 0.4rem; }
  .mv-description { font-size: 0.8rem; }
  .mv-empty { padding: 1rem; }
  .mv-empty p { font-size: 0.7rem; }
  .mv-controls { gap: 0.4rem; padding: 0.5rem; }
  .mv-seek-label { flex-basis: calc(100% - 4rem); }
  .mv-clock { margin-left: auto; }
  .mv-panel { height: auto; width: 44%; }
  .mv-panel-header { cursor: default; }
  .mv-panel-header h3 { font-size: 0.5rem; }
  .mv-view-label { font-size: 0.5rem; left: 0.3rem; top: 0.3rem; }
  .mv-state { font-size: 0.6rem; padding: 0.4rem; }
  .mv-state-title { font-size: 0.65rem; }
  .mv-view-notice { font-size: 0.55rem; }
  .mv-stage.is-split { aspect-ratio: auto; grid-template-columns: minmax(0, 1fr); }
  .mv-stage.is-split .mv-main { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
  #video .demo-card { transition: none; }
}
