:root {
  color: #eef2ff;
  background: #0b1020;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; background: radial-gradient(circle at 78% 0%, #213266 0, transparent 32rem), #0b1020; }

button, input { font: inherit; }

button { cursor: pointer; }

.page-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 72px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #aab6d8; font-size: .9rem; }
.site-header p { margin: 0; }
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: -.04em; font-size: 1.15rem; }
.intro { max-width: 710px; padding: 88px 0 48px; }
.eyebrow { margin: 0 0 10px; color: #8cb2ff; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2 { margin: 0; color: #fff; letter-spacing: -.055em; }
h1 { font-size: clamp(2.75rem, 7vw, 5.75rem); line-height: .94; }
h2 { font-size: 1.65rem; }
.lede { margin: 20px 0 0; max-width: 570px; color: #b7c3e1; font-size: 1.1rem; line-height: 1.6; }
.workspace { display: grid; grid-template-columns: 1.18fr .82fr; overflow: hidden; border: 1px solid #2a3862; border-radius: 22px; background: rgba(17, 25, 48, .82); box-shadow: 0 24px 70px rgba(0, 0, 0, .25); }
.video-panel, .controls-panel { padding: 28px; }
.video-panel { min-height: 390px; border-right: 1px solid #2a3862; }
.drop-zone { display: grid; min-height: 285px; place-content: center; gap: 9px; border: 1px dashed #5875bd; border-radius: 14px; background: linear-gradient(145deg, rgba(65, 97, 170, .2), rgba(16, 25, 51, .35)); color: #aab6d8; text-align: center; transition: border-color .2s, background .2s; }
.drop-zone.is-dragging { border-color: #9ebaff; background: rgba(74, 110, 193, .3); }
.drop-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.drop-zone strong { color: #fff; font-size: 1.05rem; }
.upload-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 5px; border-radius: 50%; background: #8fb3ff; color: #0d1835; font-size: 1.5rem; font-weight: 800; }
.video-wrap video { display: block; width: 100%; max-height: 370px; border-radius: 14px; background: #02050e; }
.privacy-note { margin: 14px 0 0; color: #7f8cab; font-size: .8rem; text-align: center; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading span { padding-top: 2px; color: #9ca9ca; font-size: .78rem; }
.timeline { position: relative; display: grid; gap: 5px; margin: 36px 0 25px; }
.timeline input { width: 100%; accent-color: #8fb3ff; }
.time-fields { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.time-fields label { display: grid; gap: 7px; color: #aab6d8; font-size: .78rem; font-weight: 700; }
.time-fields input { width: 100%; padding: 10px; border: 1px solid #3a4a78; border-radius: 8px; background: #0d1630; color: #fff; }
.range-divider { padding-bottom: 10px; color: #6f7c9d; }
.range-summary { display: flex; justify-content: space-between; margin-top: 25px; padding-top: 16px; border-top: 1px solid #29375d; color: #aab6d8; font-size: .88rem; }
.range-summary strong { color: #fff; }
.helper-text, .status { min-height: 2.4em; margin: 12px 0 0; color: #8795b6; font-size: .82rem; line-height: 1.45; }
.status.is-error { color: #ffb0a6; }
.status.is-ready { color: #a7deb9; }
.primary-button { width: 100%; margin-top: 18px; padding: 13px 16px; border: 0; border-radius: 9px; background: #9abaff; color: #08112a; font-weight: 800; transition: transform .15s, opacity .15s; }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; }
.results { margin-top: 60px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.results-heading > p { margin: 0; color: #9ca9ca; font-size: .9rem; }
.frame-layout { display: grid; gap: 20px; }
.frame-slider { overflow-x: auto; padding: 4px 2px 14px; scrollbar-color: #607dbf #111a33; scroll-snap-type: x mandatory; }
.frame-grid { display: flex; width: max-content; gap: 12px; }
.frame-card { width: clamp(130px, 21vw, 190px); flex: 0 0 auto; overflow: hidden; padding: 0; border: 1px solid #2e3d68; border-radius: 10px; background: #121c37; color: #e8eeff; text-align: left; scroll-snap-align: center; }
.frame-card[aria-pressed="true"] { outline: 2px solid #9abaff; outline-offset: 2px; }
.frame-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #060a17; }
.frame-time { display: block; padding: 8px 9px; font-size: .75rem; font-variant-numeric: tabular-nums; }
.selected-frame { overflow: hidden; min-height: 180px; border: 1px solid #2e3d68; border-radius: 12px; background: #111a33; color: #aab6d8; }
.selected-frame > p { padding: 20px; margin: 0; }
.selected-frame img { display: block; width: 100%; max-height: min(58vh, 620px); object-fit: contain; background: #060a17; }
.selected-frame__details { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; }
.selected-frame__details strong { font-size: .86rem; font-variant-numeric: tabular-nums; }
.download-button { padding: 8px 10px; border: 1px solid #6686d5; border-radius: 7px; background: transparent; color: #bcd0ff; font-size: .78rem; font-weight: 700; text-decoration: none; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 28px, 620px); padding-top: 18px; }
  .site-header p { display: none; }
  .intro { padding: 58px 0 35px; }
  .workspace { grid-template-columns: 1fr; }
  .video-panel { min-height: auto; border-right: 0; border-bottom: 1px solid #2a3862; }
  .video-panel, .controls-panel { padding: 20px; }
  .drop-zone { min-height: 220px; }
  .selected-frame { position: sticky; top: 10px; z-index: 1; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
  .frame-slider { margin: 0 -2px; padding-bottom: 10px; }
  .frame-card { width: min(43vw, 170px); }
  .results-heading { align-items: start; flex-direction: column; }
}
