:root {
  --paper: #ffffff;
  --mist: #faf9ff;
  --purple-950: #24123f;
  --purple-800: #56329e;
  --purple-700: #6d3cc5;
  --purple-600: #8056d7;
  --purple-300: #d9caf7;
  --purple-150: #eee9fb;
  --purple-100: #f5f1fd;
  --ink: #201c27;
  --muted: #716a7e;
  --line: #e7e2ed;
  --line-strong: #d7cde6;
  --shadow: 0 12px 32px rgba(60, 34, 109, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body { margin: 0; background: var(--paper); }

button, input { font: inherit; }

button { color: inherit; }

a { color: inherit; text-decoration: none; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(128, 86, 215, 0.35);
  outline-offset: 3px;
}

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

.site-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 72px;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1320px) / 2));
}

.brand { align-items: center; display: inline-flex; font-size: 18px; font-weight: 750; gap: 10px; letter-spacing: 0; }

.brand-mark { align-items: center; background: var(--purple-700); color: white; display: inline-flex; height: 30px; justify-content: center; width: 30px; }

.brand-mark svg { height: 17px; width: 17px; }

.site-header nav { align-items: center; display: flex; gap: 8px; }

.nav-link { align-items: center; color: var(--muted); display: inline-flex; font-size: 14px; font-weight: 600; gap: 5px; padding: 9px 10px; }

.nav-link.active { color: var(--purple-800); }

.nav-link svg { height: 14px; width: 14px; }

.page-shell { margin: 0 auto; max-width: 1320px; padding: 48px 24px 72px; }

.home-intro { align-items: end; border-bottom: 1px solid var(--line); display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 30px; }

.eyebrow { color: var(--purple-700); font-size: 12px; font-weight: 750; letter-spacing: 0; margin: 0 0 9px; text-transform: uppercase; }

h1, h2, h3, p { margin-top: 0; }

h1 { font-size: clamp(34px, 4vw, 54px); font-weight: 750; letter-spacing: 0; line-height: 1.05; margin-bottom: 14px; }

.lede { color: var(--muted); font-size: 16px; line-height: 1.55; margin-bottom: 0; max-width: 610px; }

.dataset-total { color: var(--purple-800); font-size: 14px; font-weight: 650; margin-bottom: 5px; text-align: right; }

.dataset-total strong { display: block; font-size: 30px; font-weight: 760; line-height: 1.1; }

.section-heading { align-items: baseline; display: flex; justify-content: space-between; margin: 42px 0 18px; }

.section-heading h2 { font-size: 20px; font-weight: 720; margin: 0; }

.section-heading span { color: var(--muted); font-size: 13px; }

.scene-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.scene-card { background: var(--paper); border: 1px solid var(--line); cursor: pointer; min-height: 270px; overflow: hidden; padding: 0; position: relative; text-align: left; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }

.scene-card:hover { border-color: var(--purple-300); box-shadow: var(--shadow); transform: translateY(-2px); }

.scene-card:focus-visible { outline-offset: 4px; }

.scene-mosaic { display: grid; gap: 3px; grid-template-columns: 1.2fr 0.8fr; height: 184px; overflow: hidden; }

.scene-mosaic img { background: var(--purple-100); height: 100%; object-fit: cover; width: 100%; }

.scene-mosaic img:first-child { grid-row: span 2; }

.scene-card-copy { align-items: end; display: flex; justify-content: space-between; padding: 17px 18px 18px; }

.scene-card h3 { font-size: 23px; font-weight: 720; margin: 0; }

.scene-card p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

.scene-arrow { align-items: center; background: var(--purple-100); color: var(--purple-800); display: inline-flex; height: 34px; justify-content: center; width: 34px; }

.scene-arrow svg { height: 17px; width: 17px; }

.footnote { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.55; margin: 52px 0 0; padding-top: 18px; }

.detail-top { border-bottom: 1px solid var(--line); padding-bottom: 24px; }

.breadcrumb { align-items: center; color: var(--muted); display: inline-flex; font-size: 13px; gap: 6px; margin-bottom: 24px; }

.breadcrumb:hover { color: var(--purple-800); }

.breadcrumb svg { height: 15px; width: 15px; }

.detail-heading { align-items: end; display: flex; gap: 24px; justify-content: space-between; }

.detail-heading h1 { font-size: clamp(32px, 4vw, 48px); margin: 0; }

.detail-summary { color: var(--muted); font-size: 14px; margin: 0 0 6px; text-align: right; }

.detail-toolbar { align-items: center; display: flex; gap: 14px; justify-content: space-between; margin: 24px 0; }

.search-box { align-items: center; border: 1px solid var(--line-strong); display: flex; gap: 8px; max-width: 360px; padding: 0 11px; width: 100%; }

.search-box svg { color: var(--purple-700); height: 16px; width: 16px; }

.search-box input { border: 0; color: var(--ink); height: 39px; min-width: 0; outline: 0; width: 100%; }

.search-box input::placeholder { color: #9a94a5; }

.model-filter { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }

.filter-button { background: white; border: 1px solid var(--line-strong); color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 650; min-height: 38px; padding: 8px 11px; }

.filter-button.active { background: var(--purple-800); border-color: var(--purple-800); color: white; }

.comparison-list { display: grid; gap: 20px; }

.comparison-card { border: 1px solid var(--line); display: grid; grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr); min-height: 300px; }

.input-panel { background: var(--mist); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }

.frame-holder { aspect-ratio: 16 / 10; background: var(--purple-100); overflow: hidden; }

.frame-holder img { display: block; height: 100%; object-fit: cover; width: 100%; }

.input-copy { padding: 18px; }

.sample-id { color: var(--purple-700); font-size: 11px; font-weight: 750; letter-spacing: 0; margin-bottom: 8px; text-transform: uppercase; }

.caption { font-size: 16px; line-height: 1.45; margin: 0 0 16px; }

.metadata { display: flex; flex-wrap: wrap; gap: 6px; }

.metadata span { border: 1px solid var(--purple-300); color: var(--purple-800); font-size: 11px; font-weight: 650; padding: 4px 7px; }

.source-link { align-items: center; color: var(--purple-800); display: inline-flex; font-size: 12px; font-weight: 650; gap: 5px; margin-top: auto; padding: 0 18px 18px; }

.source-link svg { height: 14px; width: 14px; }

.outputs-panel { min-width: 0; padding: 18px; }

.outputs-header { align-items: center; display: flex; justify-content: space-between; margin-bottom: 14px; }

.outputs-header h3 { font-size: 14px; font-weight: 720; margin: 0; }

.outputs-header span { color: var(--muted); font-size: 12px; }

.video-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.video-slot { background: #fbfaff; border: 1px solid var(--line); min-height: 0; overflow: hidden; position: relative; }

.video-slot-head { align-items: center; display: flex; gap: 8px; justify-content: space-between; min-height: 42px; padding: 10px 11px; }

.video-slot-head strong { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.output-status { color: var(--muted); font-size: 11px; }

.video-stage { aspect-ratio: var(--video-aspect-ratio, 16 / 9); background: #271c3e; display: grid; min-height: 0; place-items: center; position: relative; }

.video-stage video { background: #171020; display: block; height: 100%; max-height: 100%; object-fit: contain; width: 100%; }

.generated-video-frame { background: #171020; border: 0; display: block; height: 100%; min-height: 0; min-width: 0; width: 100%; }

.video-loading { color: #f7f2ff; font-size: 13px; margin: 0; }

.video-error { background: rgba(39, 28, 62, 0.94); bottom: 0; color: white; font-size: 12px; left: 0; margin: 0; padding: 8px 10px; position: absolute; right: 0; }

.video-error a { color: white; font-weight: 700; }

.load-video { align-items: center; background: var(--purple-700); border: 0; color: white; cursor: pointer; display: inline-flex; font-size: 13px; font-weight: 680; gap: 7px; min-height: 38px; padding: 8px 11px; }

.load-video svg, .unload-video svg { height: 15px; width: 15px; }

.unload-video { align-items: center; background: transparent; border: 0; color: white; cursor: pointer; display: inline-flex; height: 30px; justify-content: center; position: absolute; right: 6px; top: 6px; width: 30px; }

.empty-outputs { align-items: center; background: var(--purple-100); color: var(--purple-800); display: flex; font-size: 13px; min-height: 188px; padding: 18px; }

.pagination { align-items: center; display: flex; gap: 12px; justify-content: center; margin-top: 28px; }

.pagination button { align-items: center; background: white; border: 1px solid var(--line-strong); color: var(--purple-800); cursor: pointer; display: inline-flex; height: 38px; justify-content: center; width: 38px; }

.pagination button:disabled { color: #c6bdcf; cursor: not-allowed; }

.pagination span { color: var(--muted); font-size: 13px; min-width: 80px; text-align: center; }

.loading-view, .error-view { align-items: center; display: flex; justify-content: center; min-height: calc(100vh - 72px); padding: 30px; }

.loading-mark { color: var(--purple-700); }

.loading-mark svg { animation: spin 900ms linear infinite; height: 28px; width: 28px; }

.error-panel { border: 1px solid var(--purple-300); max-width: 560px; padding: 26px; }

.error-panel h1 { font-size: 24px; margin-bottom: 10px; }

.error-panel p { color: var(--muted); line-height: 1.5; margin-bottom: 0; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
  .scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-card { grid-template-columns: 330px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .site-header { height: 64px; padding: 0 16px; }
  .nav-link { font-size: 13px; padding-right: 0; }
  .site-header nav .nav-link:not(.active) { display: none; }
  .page-shell { padding: 32px 16px 52px; }
  .home-intro, .detail-heading, .detail-toolbar { align-items: start; display: flex; flex-direction: column; }
  .dataset-total, .detail-summary { text-align: left; }
  .scene-grid { grid-template-columns: 1fr; }
  .scene-card h3 { font-size: 21px; }
  .comparison-card { grid-template-columns: 1fr; }
  .input-panel { border-bottom: 1px solid var(--line); border-right: 0; }
  .detail-toolbar { gap: 12px; }
  .search-box { max-width: none; }
  .model-filter { justify-content: flex-start; }
  .video-grid { grid-template-columns: 1fr; }
}
