
/* =========================================================
   VIDEOMOMENT
   Editorial Dashboard — Approved Design
   ========================================================= */

/* 01. DESIGN TOKENS */

:root {
  --paper: #ece8df;
  --paper-light: #f5f2eb;
  --ink: #141311;
  --ink-soft: #2c2a26;
  --muted: #777268;
  --muted-light: #a7a094;
  --accent: #d9441f;
  --accent-dark: #b93417;
  --border: #d1cbbf;
  --border-dark: #aaa397;
  --white: #fffdf8;

  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --font-body: Arial, Helvetica, sans-serif;

  --sidebar-width: 342px;
  --header-height: 74px;
  --banner-height: 194px;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* 02. GLOBAL RESET */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: white;
}

/* 03. HEADER */

.site-header {
  height: var(--header-height);
  padding: 0 38px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: var(--paper-light);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 45px;
  line-height: 1;
  letter-spacing: -1.5px;
  white-space: nowrap;
}

.wordmark i {
  color: var(--accent);
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.header-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .17em;
}

.header-rule {
  display: block;
  width: 104px;
  height: 1px;
  background: var(--muted);
}

/* 04. ANIMATED MOMENT BANNER */

.moment-banner {
  position: relative;
  height: var(--banner-height);

  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);

  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

.timecode-panel {
  position: relative;
  z-index: 3;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 0 48px;
  border-right: 1px solid #45413b;
  background: var(--ink);
}

.timecode-panel::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: #45413b;
}

.timecode {
  font-family: var(--font-mono);
  font-size: clamp(22px, 2.5vw, 33px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.06em;
  white-space: nowrap;
  transition: color .35s ease;
}

.timecode-panel.hit .timecode {
  color: var(--accent);
}

.scan-status {
  min-height: 17px;
  margin-top: 14px;

  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: #c2bdb4;
  text-transform: uppercase;
  white-space: nowrap;
}

.scan-status span {
  display: inline-block;
  animation: status-rise .5s var(--ease) both;
}

@keyframes status-rise {
  from {
    opacity: 0;
    transform: translateY(110%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.banner-timeline {
  position: relative;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: pan-y;
}

.timeline-ruler {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  height: 16px;

  background:
    linear-gradient(
      90deg,
      #8d887c 1px,
      transparent 1px
    ) var(--ox, 0px) 100% / 148px 15px repeat-x,

    linear-gradient(
      90deg,
      #4f4b43 1px,
      transparent 1px
    ) var(--ox, 0px) 100% / 14.8px 7px repeat-x;
}

.timeline-frames {
  position: absolute;
  left: 0;
  top: 53px;
  width: 100%;
  height: 107px;
}

.timeline-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 148px;
  height: 96px;

  will-change: transform;
}

.timeline-frame-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;

  outline: 1px solid transparent;
  outline-offset: 3px;

  transition:
    transform .55s var(--ease),
    outline-color .35s ease;
}

.timeline-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timeline-frame .frame-grayscale {
  filter: grayscale(1) contrast(1.1) brightness(.72);
}

.timeline-frame .frame-color {
  clip-path: inset(0 100% 0 0);
  transition: clip-path .6s var(--ease);
}

.timeline-frame.active {
  z-index: 2;
}

.timeline-frame.active .timeline-frame-inner {
  transform: scale(1.09);
  outline-color: var(--accent);
}

.timeline-frame.active .frame-color {
  clip-path: inset(0 0 0 0);
}

.timeline-frame-number {
  position: absolute;
  left: 0;
  top: 102px;

  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: #8d887c;
}

.timeline-frame.active .timeline-frame-number {
  color: var(--accent);
}

.timeline-playhead {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;

  background: var(--accent);
  pointer-events: none;
}

.timeline-playhead::before,
.timeline-playhead::after {
  content: "";
  position: absolute;
  left: -5px;

  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.timeline-playhead::before {
  top: 0;
  border-top: 8px solid var(--accent);
}

.timeline-playhead::after {
  bottom: 0;
  border-bottom: 8px solid var(--accent);
}

.banner-timeline::after {
  content: "";
  position: absolute;
  z-index: 5;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48px;

  background: linear-gradient(
    90deg,
    transparent,
    var(--ink)
  );

  pointer-events: none;
}

.banner-pause {
  position: absolute;
  z-index: 8;
  right: 28px;
  bottom: 16px;

  display: flex;
  align-items: center;
  gap: 14px;

  padding: 9px 17px;

  border: 1px solid #6d675d;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);

  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;

  transition:
    border-color .2s ease,
    background .2s ease;
}

.banner-pause:hover {
  border-color: var(--paper);
  background: #292622;
}

/* 05. DASHBOARD GRID */

.app-layout {
  display: grid;
  grid-template-columns:
    var(--sidebar-width)
    minmax(0, 1fr);

  min-height: calc(
    100vh - var(--header-height) - var(--banner-height)
  );
}

/* 06. SAMPLE VIDEO SIDEBAR */

.library-sidebar {
  position: relative;

  display: flex;
  flex-direction: column;

  min-width: 0;
  padding: 29px 13px 24px 27px;

  border-right: 1px solid var(--border);
}

.sidebar-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0 12px 0 11px;
}

.sidebar-heading h2 {
  margin: 0;

  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
}

.sidebar-heading > span {
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.sidebar-divider {
  width: 145px;
  height: 1px;
  margin: 10px 0 10px 11px;
  background: var(--border-dark);
}

.sample-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.library-message {
  padding: 20px 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.8;
}

.sample-video-card {
  width: 100%;
  min-height: 96px;
  padding: 9px;

  display: flex;
  align-items: center;
  gap: 16px;

  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);

  transition:
    border-color .2s ease,
    background .2s ease,
    transform .2s var(--ease);
}

.sample-video-card:hover {
  background: var(--paper-light);
  transform: translateX(3px);
}

.sample-video-card.active,
.sample-video-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(255, 253, 248, .3);
}

.sample-thumbnail {
  position: relative;
  flex: 0 0 132px;
  width: 132px;
  height: 78px;

  overflow: hidden;
  border-radius: 6px;
  background: #d0c9bc;
}

.sample-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .4s var(--ease);
}

.sample-video-card:hover .sample-thumbnail img {
  transform: scale(1.06);
}

.sample-thumbnail::after {
  content: "▶";
  position: absolute;
  left: 11px;
  bottom: 9px;

  color: white;
  font-size: 12px;
  text-shadow: 0 1px 6px #000;
}

.sample-details {
  flex: 1;
  min-width: 0;
}

.sample-title {
  display: block;
  margin-bottom: 7px;

  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.sample-duration {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
}

.sidebar-footer {
  margin-top: auto;
  padding: 30px 11px 0;

  display: flex;
  align-items: center;
  gap: 9px;

  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.sidebar-footer-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}

/* 07. MAIN WORKSPACE */

.workspace {
  min-width: 0;
  padding: 30px 29px 24px 42px;
}

/* 08. INTRO */

.intro-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36%;
  align-items: start;
  gap: 28px;
  margin-bottom: 24px;
}

.intro-title h1 {
  margin: 0;

  font-family: var(--font-serif);
  font-size: clamp(43px, 4.2vw, 69px);
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.035em;
}

.intro-title h1 em {
  color: var(--accent);
  font-weight: 400;
}

.intro-description {
  min-height: 106px;
  padding: 15px 0 0 49px;
  border-left: 1px solid var(--border-dark);
}

.intro-description p {
  max-width: 350px;
  margin: 0;

  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: .01em;
}

/* 09. VIDEO SOURCE BUTTONS */

.source-section {
  margin-bottom: 17px;
}

.source-actions {
  display: flex;
  gap: 5px;
}

.source-button {
  min-height: 44px;
  min-width: 220px;
  padding: 0 22px;

  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 23px;

  border: 1px solid var(--border-dark);
  border-radius: 6px;

  font-family: var(--font-mono);
  font-size: 13px;

  transition:
    background .2s ease,
    color .2s ease,
    transform .2s var(--ease);
}

.source-button svg {
  width: 23px;
  height: 23px;
  flex-shrink: 0;
}

.source-button:hover {
  transform: translateY(-2px);
}

.source-button-primary {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.source-button-primary:hover {
  background: #38342f;
}

.source-button-secondary {
  background: transparent;
  color: var(--ink);
}

.source-button-secondary:hover {
  background: var(--paper-light);
}

.youtube-input-wrapper {
  max-width: 670px;
  margin-top: 15px;
  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper-light);
}

.youtube-input-wrapper label {
  display: block;
  margin-bottom: 9px;

  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
}

.youtube-input-row {
  display: flex;
  gap: 8px;
}

.youtube-input-row input {
  flex: 1;
  min-width: 0;
  padding: 12px;

  border: 1px solid var(--border-dark);
  border-radius: 4px;
  background: var(--white);

  font-family: var(--font-mono);
  font-size: 12px;
}

.youtube-input-row button {
  padding: 0 19px;
  border: none;
  border-radius: 4px;
  background: var(--ink);
  color: white;

  font-family: var(--font-mono);
  font-size: 11px;
}

#youtubeNotice {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.source-status,
.search-status {
  margin: 10px 0 0;
  color: var(--muted);

  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
}

.source-status:empty,
.search-status:empty {
  display: none;
}

/* 10. SEARCH */

.search-section {
  margin-bottom: 19px;
}

.search-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 10px;
}

.search-topline label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .13em;
}

.example-queries-button {
  border: none;
  background: transparent;
  color: var(--ink-soft);

  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
}

.example-queries-button span {
  margin-left: 8px;
  font-size: 16px;
}

.example-queries-button:hover {
  color: var(--accent);
}

.search-form {
  display: flex;
  gap: 7px;
  min-height: 63px;
}

.search-input-wrapper {
  flex: 1;
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 18px;

  padding: 0 17px;

  border: 1px solid #777168;
  border-radius: 6px;
  background: rgba(255, 253, 248, .13);

  transition:
    border-color .2s ease,
    background .2s ease;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent);
  background: var(--paper-light);
}

.search-input-wrapper svg {
  width: 27px;
  height: 27px;
  flex-shrink: 0;
}

.search-input-wrapper input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;

  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);

  font-family: var(--font-mono);
  font-size: 13px;
}

.search-input-wrapper input::placeholder {
  color: #938d83;
}

.search-input-wrapper input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-submit {
  width: 196px;
  padding: 0 25px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;

  border: none;
  border-radius: 6px;

  background: var(--accent);
  color: white;

  font-family: var(--font-mono);
  font-size: 13px;

  transition:
    background .2s ease,
    gap .2s var(--ease);
}

.search-submit:hover {
  background: var(--accent-dark);
  gap: 33px;
}

.search-arrow {
  font-size: 22px;
  font-weight: 400;
}

.example-queries {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.example-queries button {
  padding: 8px 12px;

  border: 1px solid var(--border-dark);
  border-radius: 3px;
  background: transparent;

  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;

  transition:
    background .2s ease,
    border-color .2s ease;
}

.example-queries button:hover {
  border-color: var(--accent);
  background: var(--paper-light);
}

/* 11. PLAYER AND RESULTS GRID */

.content-section {
  display: grid;
  grid-template-columns:
    minmax(0, 1.5fr)
    minmax(310px, 1fr);

  gap: 18px;
  align-items: start;
}

/* 12. VIDEO PLAYER */

.player-column {
  min-width: 0;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;

  overflow: hidden;
  border-radius: 8px;
  background: #171717;
}

.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #111;
}

.player-empty-state {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;

  background: #1b1a18;
  color: #c4bdb1;
  pointer-events: none;
}

.empty-state-symbol {
  width: 65px;
  height: 65px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #5e574d;
  border-radius: 50%;

  font-size: 22px;
  padding-left: 4px;
}

.player-empty-state p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
}

.player-information {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;

  padding: 16px 2px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
}

.player-title-group h2 {
  margin: 5px 0 0;

  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.15;
}

.player-metadata {
  display: flex;
  gap: 9px;
  flex-shrink: 0;

  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.metadata-separator {
  color: var(--border-dark);
}

/* 13. MATCHING MOMENTS */

.results-panel {
  min-width: 0;
  padding: 14px 15px 9px;

  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 253, 248, .14);
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.results-heading h2 {
  margin: 0;

  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
}

.results-heading > span {
  white-space: nowrap;

  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.results-list {
  display: flex;
  flex-direction: column;
}

.results-empty-state {
  min-height: 220px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;

  padding: 25px;
  text-align: center;
}

.results-empty-number {
  font-family: var(--font-serif);
  font-size: 55px;
  color: var(--muted-light);
}

.results-empty-state p {
  max-width: 250px;
  margin: 0;

  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
}

.result-card {
  position: relative;
  width: 100%;
  min-height: 73px;
  padding: 10px 0;

  display: flex;
  align-items: center;
  gap: 12px;

  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  text-align: left;

  transition:
    background .2s ease,
    padding .2s var(--ease);
}

.result-card:last-child {
  border-bottom: none;
}

.result-card:hover {
  background: rgba(217, 68, 31, .045);
  padding-left: 5px;
}

.result-card.active {
  background: rgba(217, 68, 31, .075);
}

.result-index {
  flex: 0 0 25px;

  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.result-thumbnail {
  flex: 0 0 100px;
  width: 100px;
  height: 57px;

  overflow: hidden;
  border-radius: 5px;
  background: #d2cabc;
}

.result-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.result-details {
  flex: 1;
  min-width: 0;
}

.result-time {
  display: block;
  margin-bottom: 5px;

  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.result-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.result-play {
  flex: 0 0 29px;
  width: 29px;
  height: 29px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--ink);
  border-radius: 50%;

  font-size: 12px;
  padding-left: 2px;

  transition:
    background .2s ease,
    color .2s ease,
    transform .2s var(--ease);
}

.result-card:hover .result-play,
.result-card.active .result-play {
  background: var(--ink);
  color: var(--paper);
  transform: scale(1.07);
}

.results-footer {
  display: flex;
  justify-content: space-between;

  padding: 13px 0 4px;

  border-top: 1px solid var(--border);

  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--muted);
}

/* 14. WORKSPACE FOOTER */

.workspace-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;

  margin-top: 36px;
  padding-top: 16px;

  border-top: 1px solid var(--border);

  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--muted);
}

/* 15. LOADING STATES */

.is-loading {
  opacity: .65;
  pointer-events: none;
}

@keyframes subtle-pulse {
  0%, 100% {
    opacity: .5;
  }

  50% {
    opacity: 1;
  }
}

.loading-text {
  animation: subtle-pulse 1.4s ease-in-out infinite;
}

/* 16. RESPONSIVE — LAPTOP */

@media (max-width: 1350px) {
  :root {
    --sidebar-width: 300px;
    --banner-height: 166px;
  }

  .moment-banner {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .timecode-panel {
    padding: 0 35px;
  }

  .workspace {
    padding: 27px 23px 24px 30px;
  }

  .intro-title h1 {
    font-size: clamp(40px, 4vw, 59px);
  }

  .intro-description {
    padding-left: 25px;
  }

  .sample-thumbnail {
    flex-basis: 110px;
    width: 110px;
    height: 72px;
  }

  .sample-title {
    font-size: 19px;
  }

  .content-section {
    grid-template-columns:
      minmax(0, 1.3fr)
      minmax(280px, 1fr);
    gap: 14px;
  }

  .result-thumbnail {
    flex-basis: 75px;
    width: 75px;
    height: 49px;
  }

  .result-card {
    gap: 8px;
  }
}

/* 17. RESPONSIVE — TABLET */

@media (max-width: 1050px) {
  :root {
    --sidebar-width: 240px;
    --banner-height: 146px;
  }

  .site-header {
    padding: 0 24px;
  }

  .moment-banner {
    grid-template-columns: 225px minmax(0, 1fr);
  }

  .timecode-panel {
    padding: 0 20px 0 29px;
  }

  .timecode-panel::before {
    left: 12px;
  }

  .timecode {
    font-size: 23px;
  }

  .scan-status {
    font-size: 9px;
  }

  .library-sidebar {
    padding: 23px 8px 20px 12px;
  }

  .sample-video-card {
    gap: 9px;
    padding: 7px;
  }

  .sample-thumbnail {
    flex-basis: 84px;
    width: 84px;
    height: 62px;
  }

  .sample-title {
    font-size: 17px;
  }

  .workspace {
    padding: 25px 18px;
  }

  .intro-section {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .intro-description {
    min-height: 0;
    padding: 0;
    border: none;
  }

  .intro-description p {
    max-width: 500px;
  }

  .source-button {
    min-width: 0;
    flex: 1;
  }

  .content-section {
    grid-template-columns: 1fr;
  }

  .results-panel {
    width: 100%;
  }

  .result-thumbnail {
    flex-basis: 100px;
    width: 100px;
    height: 57px;
  }
}

/* 18. RESPONSIVE — MOBILE */

@media (max-width: 700px) {
  :root {
    --header-height: 65px;
    --banner-height: 124px;
  }

  .site-header {
    padding: 0 16px;
  }

  .wordmark {
    font-size: 34px;
  }

  .header-tagline {
    font-size: 8px;
    letter-spacing: .08em;
  }

  .header-rule {
    display: none;
  }

  .moment-banner {
    grid-template-columns: 145px minmax(0, 1fr);
  }

  .timecode-panel {
    padding: 0 10px 0 15px;
  }

  .timecode-panel::before {
    display: none;
  }

  .timecode {
    font-size: 15px;
  }

  .scan-status {
    font-size: 8px;
    letter-spacing: .03em;
    white-space: normal;
  }

  .timeline-frames {
    top: 34px;
  }

  .timeline-ruler {
    top: 8px;
  }

  .banner-pause {
    right: 10px;
    bottom: 8px;
    padding: 5px 8px;
    font-size: 9px;
  }

  .app-layout {
    display: flex;
    flex-direction: column;
  }

  .library-sidebar {
    padding: 20px 16px 14px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sample-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x proximity;
  }

  .sample-video-card {
    flex: 0 0 185px;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    scroll-snap-align: start;
  }

  .sample-thumbnail {
    width: 100%;
    height: 95px;
    flex-basis: auto;
  }

  .sample-details {
    padding: 5px 2px;
  }

  .sample-title {
    font-size: 19px;
  }

  .sidebar-footer {
    padding: 8px 10px 0;
  }

  .workspace {
    padding: 24px 16px;
  }

  .intro-title h1 {
    font-size: clamp(43px, 9vw, 64px);
  }

  .intro-description p {
    font-size: 11px;
  }

  .source-actions {
    flex-wrap: wrap;
  }

  .source-button {
    min-width: 145px;
    padding: 0 13px;
    gap: 10px;
    font-size: 11px;
  }

  .search-form {
    flex-direction: column;
  }

  .search-input-wrapper {
    min-height: 58px;
  }

  .search-submit {
    width: 100%;
    min-height: 49px;
  }

  .search-topline label {
    font-size: 9px;
  }

  .example-queries-button {
    font-size: 9px;
  }

  .content-section {
    gap: 16px;
  }

  .workspace-footer {
    font-size: 8px;
  }
}

/* 19. SMALL MOBILE */

@media (max-width: 390px) {
  .header-tagline {
    display: none;
  }

  .source-button {
    width: 100%;
    flex: 1 1 100%;
  }

  .results-panel {
    padding: 12px 9px;
  }

  .result-thumbnail {
    flex-basis: 70px;
    width: 70px;
    height: 48px;
  }

  .result-index {
    flex-basis: 20px;
  }

  .result-card {
    gap: 7px;
  }
}

/* 20. ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Show the full transcript for the selected moment */

.result-card.active {
  align-items: flex-start;
}

.result-card.active .result-description {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

/* =========================================================
   21. COMPACT DESKTOP DASHBOARD
   Preserves the animated banner and its controls.
   ========================================================= */

@media (min-width: 1051px) {

  :root {
    --header-height: 58px;
    --sidebar-width: 250px;
  }

  /* Preserve the banner; do not change its animation. */
  .moment-banner {
    /* Existing filmstrip, timecode and pause control stay. */
  }

  /* Compact header */
  .site-header {
    padding-inline: 26px;
  }

  .wordmark {
    font-size: 36px;
  }

  /* Main layout */
  .app-layout {
    min-height: 0;
  }

  .library-sidebar {
    padding: 16px 10px 12px;
    min-height: 0;
  }

  .sidebar-heading h2 {
    font-size: 11px;
  }

  .sample-list {
    max-height: 320px;
    overflow-y: auto;
  }

  .sample-video-card {
    min-height: 70px;
    padding: 6px;
    gap: 9px;
  }

  .sample-thumbnail {
    flex: 0 0 86px;
    width: 86px;
    height: 54px;
  }

  .sample-title {
    font-size: 17px;
  }

  .sidebar-footer {
    padding-top: 12px;
  }

  /* Workspace */
  .workspace {
    padding: 15px 22px 12px;
  }

  /* Smaller introduction */
  .intro-section {
    grid-template-columns: minmax(0, 1fr) 34%;
    gap: 15px;
    margin-bottom: 12px;
  }

  .intro-title h1 {
    font-size: clamp(34px, 3vw, 48px);
    line-height: .95;
  }

  .intro-description {
    min-height: 0;
    padding: 5px 0 0 17px;
  }

  .intro-description p {
    font-size: 10px;
    line-height: 1.45;
  }

  /* Source buttons */
  .source-section {
    margin-bottom: 10px;
  }

  .source-button {
    min-height: 36px;
    min-width: 160px;
    padding-inline: 13px;
    gap: 12px;
    font-size: 11px;
  }

  .source-button svg {
    width: 18px;
    height: 18px;
  }

  /* Search */
  .search-section {
    margin-bottom: 12px;
  }

  .search-topline {
    margin-bottom: 6px;
  }

  .search-form {
    min-height: 44px;
  }

  .search-input-wrapper {
    gap: 10px;
    padding-inline: 12px;
  }

  .search-input-wrapper svg {
    width: 19px;
    height: 19px;
  }

  .search-submit {
    width: 125px;
    padding-inline: 12px;
    gap: 12px;
  }

  /* Player and results */
  .content-section {
    grid-template-columns:
      minmax(0, 1.4fr)
      minmax(280px, 1fr);
    gap: 12px;
    align-items: start;
  }

  .player-shell {
    aspect-ratio: 16 / 9;
    max-height: min(35vh, 340px);
  }

  .player-information {
    padding: 8px 2px;
  }

  .player-title-group h2 {
    font-size: 20px;
  }

  /* Results scroll independently */
  .results-panel {
    padding: 10px 11px 7px;
    max-height: min(40vh, 390px);
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .results-heading {
    flex-shrink: 0;
    padding-bottom: 8px;
  }

  .results-heading h2 {
    font-size: 11px;
  }

  .results-list {
    overflow-y: auto;
    min-height: 0;
    flex: 1;
  }

  .result-card {
    min-height: 61px;
    padding: 7px 0;
    gap: 8px;
  }

  .result-thumbnail {
    flex: 0 0 72px;
    width: 72px;
    height: 44px;
  }

  .result-description {
    font-size: 9px;
  }

  .result-play {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
  }

  .results-empty-state {
    min-height: 130px;
  }

  .workspace-footer {
    margin-top: 10px;
    padding-top: 8px;
    font-size: 9px;
  }
}

/* Short laptop screens */
@media (min-width: 1051px) and (max-height: 800px) {
  :root {
    --banner-height: 120px;
  }

  .timeline-frames {
    top: 35px;
  }

  .timeline-ruler {
    top: 8px;
  }

  .banner-pause {
    bottom: 8px;
  }

  .workspace {
    padding-top: 10px;
  }

  .intro-section {
    margin-bottom: 8px;
  }

  .intro-title h1 {
    font-size: 36px;
  }

  .player-shell {
    max-height: 30vh;
  }
}

/* ==========================================
   ASK VIDEO — AI QUESTION & ANSWER
   ========================================== */

.ask-video-section {
  padding: 18px 20px;
  margin: 12px 0;
  background: #f8f6f1;
  border: 1px solid #dedbd3;
  border-radius: 10px;
}

.ask-video-heading,
.ask-video-answer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ask-video-eyebrow,
.ask-video-label,
.ask-video-examples > span,
.ask-video-answer-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.ask-video-eyebrow {
  color: #88857e;
}

.ask-video-heading h2 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #252522;
}

.ask-video-label {
  padding: 5px 9px;
  border: 1px solid #d6d2c9;
  border-radius: 5px;
  color: #77736c;
}

.ask-video-form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.ask-video-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #d6d2c9;
  border-radius: 6px;
  background: #fff;
  color: #252522;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.ask-video-form input:focus {
  border-color: #77736c;
}

.ask-video-form button {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: #292925;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ask-video-form button:hover {
  background: #44443e;
}

.ask-video-form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ask-video-examples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.ask-video-examples > span {
  margin-right: 4px;
  color: #88857e;
}

.ask-video-examples button {
  padding: 6px 10px;
  border: 1px solid #ddd9d0;
  border-radius: 5px;
  background: transparent;
  color: #57544e;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.ask-video-examples button:hover {
  background: #eae7df;
}

.ask-video-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: #77736c;
}

.ask-video-status:empty {
  display: none;
}

.ask-video-answer {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dedbd3;
  border-radius: 7px;
  background: #fff;
}

.ask-video-answer-heading {
  padding-bottom: 10px;
}

/* Moment Retrieval 60% | Ask Video 40% */

.query-panels {
  display: grid !important;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) !important;
  align-items: start;
  gap: 18px;
  margin-bottom: 16px;
}

.query-panels > .search-section,
.query-panels > .ask-video-section {
  min-width: 0;
  width: 100%;
  margin: 0;
}

.query-panels .search-form {
  display: flex;
  flex-direction: row;
  width: 100%;
}

.query-panels .search-input-wrapper {
  flex: 1;
  min-width: 0;
}

.query-panels .search-submit {
  width: auto;
  min-width: 82px;
}

@media (max-width: 900px) {
  .query-panels {
    grid-template-columns: 1fr !important;
  }
}

/* Ask Video — match the Moment Retrieval styling */

.query-panels > .ask-video-section {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Keep both search panels aligned */
.query-panels {
  align-items: start;
}

.query-panels .ask-video-section .search-topline {
  margin-bottom: 8px;
}

/* ==========================================
   COMPACT, CENTERED VIDEOMOMENT WORKSPACE
   ========================================== */

@media (min-width: 1051px) {

  /* Keep the sidebar, constrain main content */
  .workspace {
    width: 100%;
    max-width: 1480px;
    margin-left: auto;
    margin-right: auto;
    padding: 22px 30px 24px;
  }

  /* More natural introduction proportions */
  .intro-section {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    margin-bottom: 18px;
  }

  /* Prevent an excessively wide search area */
  .unified-search {
    max-width: 1200px;
    margin-bottom: 20px;
  }

  .unified-search .search-form {
    min-height: 50px;
  }

  .unified-search .search-input-wrapper {
    min-height: 50px;
  }

  .unified-search .search-submit {
    width: 125px;
    min-height: 50px;
  }

  /* Compact player and results layout */
  .content-section {
    max-width: 1200px;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 16px;
  }

  .player-shell {
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .results-panel {
    max-height: 365px;
  }

  .workspace-footer {
    max-width: 1200px;
  }
}


/* SAMPLE VIDEOS — CLEAN VERTICAL CARDS */

@media (min-width: 701px) {
  .library-sidebar {
    padding: 22px 18px;
  }

  .sample-list {
    gap: 14px;
  }

  .sample-video-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 0;
    padding: 10px;
    gap: 10px;
  }

  .sample-thumbnail {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
  }

  .sample-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .sample-details {
    width: 100%;
    min-width: 0;
  }

  .sample-title {
    font-size: 20px;
    line-height: 1.15;
  }

  .sample-duration {
    margin-top: 5px;
    font-size: 10px;
  }
}

/* Relaxed sample video thumbnails */

@media (min-width: 701px) {
  .sample-video-card {
    align-items: flex-start;
    padding: 10px 8px;
    gap: 10px;
  }

  .sample-thumbnail {
    width: 90%;
    max-width: 215px;
    height: auto;
    aspect-ratio: 16 / 9;
    flex: none;
    overflow: hidden;
    border-radius: 6px;
  }

  .sample-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .sample-details {
    width: 90%;
  }

  .sample-title {
    font-size: 19px;
    line-height: 1.2;
  }
}

/* =========================================================
   VIDEOMOMENT — BANNER AND SAMPLE LIBRARY REPAIR
   Restore original filmstrip proportions and readable cards.
   ========================================================= */

/* 1. Restore the full animated banner on desktop */

@media (min-width: 1051px) {
  :root {
    --banner-height: 194px;
    --sidebar-width: 320px;
  }

  .moment-banner {
    height: 194px;
    min-height: 194px;
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .timeline-ruler {
    top: 18px;
  }

  .timeline-frames {
    top: 53px;
    height: 107px;
  }

  .timeline-frame {
    width: 148px;
    height: 96px;
  }

  .timeline-frame-number {
    top: 102px;
  }

  .banner-pause {
    right: 28px;
    bottom: 16px;
  }

  .timecode-panel {
    padding: 0 48px;
  }

  /* 2. Restore a comfortable sidebar width */

  .app-layout {
    grid-template-columns:
      var(--sidebar-width)
      minmax(0, 1fr);
  }

  .library-sidebar {
    padding: 22px 14px 20px;
  }

  /* 3. Keep all three samples accessible */

  .sample-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
  }

  /* 4. Horizontal video cards */

  .sample-video-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    min-height: 94px;
    padding: 10px;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-align: left;
  }

  .sample-video-card:hover {
    background: var(--paper-light);
    transform: none;
  }

  .sample-video-card.active,
  .sample-video-card[aria-pressed="true"] {
    background: var(--paper-light);
    border-color: var(--accent);
  }

  /* 5. Consistent thumbnails */

  .sample-thumbnail {
    position: relative;
    display: block;
    flex: 0 0 116px;
    width: 116px;
    max-width: none;
    height: 72px;
    aspect-ratio: auto;
    overflow: hidden;
    border-radius: 6px;
  }

  .sample-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  /* 6. Make titles fully readable */

  .sample-details {
    display: block;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  .sample-title {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-serif);
    font-size: 20px;
    line-height: 1.12;
    overflow-wrap: break-word;
    white-space: normal;
  }

  .sample-duration {
    display: block;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .04em;
  }

  .sidebar-footer {
    margin-top: 18px;
    padding: 12px 10px 0;
  }
}

/* 7. Tablet layout: prevent banner clipping */

@media (min-width: 701px) and (max-width: 1050px) {
  :root {
    --banner-height: 194px;
    --sidebar-width: 280px;
  }

  .moment-banner {
    height: 194px;
    min-height: 194px;
  }

  .timeline-ruler {
    top: 18px;
  }

  .timeline-frames {
    top: 53px;
  }

  .sample-video-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    padding: 8px;
  }

  .sample-thumbnail {
    flex: 0 0 96px;
    width: 96px;
    max-width: none;
    height: 62px;
    aspect-ratio: auto;
  }

  .sample-details {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .sample-title {
    font-size: 17px;
    overflow-wrap: break-word;
  }
}
