/* src/ui/style.css
 *
 * "After Hours" visual system. Signal palette (electric blue),
 * Marquee typography (Oswald + Besley + Space Mono), broadcast
 * atmosphere (scan lines, phosphor sub-pixels, grain breathing,
 * warm-to-cool vignette). Structure = --blue; the found/matched
 * thing = --plum. Mono for anything a machine produced.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

:root {
  --bg: #080A18;
  --panel: #0A0D20;
  --ink: #E2E8F8;
  --muted: #505878;
  --rule: #1A2048;
  --blue: #4A8FE5;
  --blue-soft: rgba(74, 143, 229, 0.12);
  --plum: #8FB8F0;
  --plum-soft: rgba(143, 184, 240, 0.12);

  --font-sans: 'Oswald', sans-serif;
  --font-serif: 'Besley', Georgia, serif;
  --font-mono: 'Space Mono', monospace;
  --font-display: var(--font-serif);

  --stage: 700px;
  --gutter: 0px;
  --measure: 700px;
  --gap: 0;
  --vr: 2.4rem;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

main {
  max-width: var(--stage);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  position: relative;
}

main > * {
  position: relative;
  z-index: 2;
}

/* ── Broadcast atmosphere ── */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.06) 0px,
      rgba(0, 0, 0, 0.06) 1px,
      transparent 1px,
      transparent 3px
    ),
    repeating-linear-gradient(
      to right,
      rgba(255, 80, 80, 0.03) 0px,
      rgba(255, 80, 80, 0.03) 1px,
      rgba(80, 255, 80, 0.03) 1px,
      rgba(80, 255, 80, 0.03) 2px,
      rgba(80, 80, 255, 0.03) 2px,
      rgba(80, 80, 255, 0.03) 3px
    );
}

body::before {
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.vs-searching::before {
  opacity: 1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background:
    radial-gradient(
      ellipse 70% 50% at 50% 65%,
      rgba(74, 143, 229, 0.025) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse at center,
      transparent 25%,
      rgba(4, 4, 14, 0.25) 65%,
      rgba(2, 2, 10, 0.5) 100%
    );
}

/* Grain — cold-tinted, on main */
main::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background:
    radial-gradient(
      ellipse at 50% 60%,
      rgba(70, 100, 180, 0.4) 0%,
      rgba(60, 70, 140, 0.3) 40%,
      rgba(30, 30, 80, 0.4) 100%
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: cover, 200px 200px;
  background-blend-mode: color, normal;
}

/* ── Folio ── */

.folio {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(26, 32, 72, 0.25);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.folio .brand {
  color: var(--blue);
}

/* ── Hero ── */

.hero {
  margin-bottom: 1.8rem;
}

.hero-heading {
  font-family: var(--font-sans);
  font-size: 2.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--plum);
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: #6878A0;
}

/* ── Two-column block (collapsed to single column) ── */

.block {
  display: block;
  margin: 0 auto var(--vr);
}

.block .gutter {
  display: none;
}

.lbl,
.eyebrow {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
}

.gutter .note,
.head-note {
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
}

/* ── Video-search (.vsearch) ── */

.vsearch {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.vs-search-wrap {
  position: relative;
}

.vs-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(74, 143, 229, 0.15);
  border-radius: 0;
  padding: 0.6rem 0.2rem;
  transition: border-color 0.3s ease;
}

.vs-bar::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='5' fill='none' stroke='%23505878' stroke-width='1.8'/%3E%3Cline x1='10' y1='10' x2='14.5' y2='14.5' stroke='%23505878' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.vs-bar:hover {
  border-color: rgba(74, 143, 229, 0.4);
}

/* ── Suggestions dropdown ── */

.vs-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.3rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 10;
  max-height: 280px;
  overflow-y: auto;
}

.vs-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.vs-suggestion:hover,
.vs-suggestion--active {
  background: rgba(74, 143, 229, 0.08);
}

.vs-suggestion-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-suggestion-source {
  flex-shrink: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.vs-input {
  flex: 1;
  border: 0;
  outline: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}

.vs-input::placeholder {
  color: rgba(80, 88, 120, 0.4);
}

.vs-bar {
  position: relative;
}

.vs-bar::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 10%;
  right: 10%;
  height: 12px;
  background: rgba(74, 143, 229, 0.6);
  filter: blur(18px);
  opacity: 0;
  pointer-events: none;
}

.vs-bar:focus-within {
  border-color: var(--blue);
  box-shadow: 0 1px 0 0 var(--blue);
}

.vs-bar:focus-within::after {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .vs-bar {
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
  }
  .vs-bar:focus-within {
    transition: border-color 3.2s ease-in 1.2s, box-shadow 3.2s ease-in 1.2s;
  }
  .vs-bar::after {
    transition: opacity 0.15s ease-out;
  }
  .vs-bar:focus-within::after {
    transition: opacity 3.2s ease-in 1.2s;
  }
}

.caret {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--blue);
  animation: blink 1.05s steps(1) infinite;
}

/* ── Filter chips ── */

.vs-chip-bar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.2rem 0;
}

.vs-chip-group-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.vs-chip-group-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  margin-right: 0.15rem;
  flex-shrink: 0;
}

.vs-chip--filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #8090B0;
  background: transparent;
  border: 1px solid rgba(26, 32, 72, 0.35);
  border-radius: 2px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vs-chip--filter:hover {
  border-color: rgba(74, 143, 229, 0.4);
  color: var(--blue);
}

.vs-chip--filter:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.vs-chip--active {
  background: var(--plum);
  color: var(--bg);
  border-color: var(--plum);
}

.vs-chip--active:hover {
  background: var(--plum);
  border-color: var(--plum);
  opacity: 0.85;
}

.vs-chip-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Results toolbar ── */

.vs-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.4rem 0 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(74, 143, 229, 0.07);
}

.vs-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--plum);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: baseline;
}

.vs-count-col {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  line-height: 1;
}

.vs-count-strip {
  display: flex;
  flex-direction: column;
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.vs-count-suffix {
  margin-left: 0.4ch;
}

.vs-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.vs-sort-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.vs-sort-dir {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  color: var(--blue);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}

.vs-sort-dir:hover:not(:disabled) {
  color: var(--plum);
  border-color: var(--plum);
}

.vs-sort-dir:disabled {
  color: var(--muted);
  border-color: var(--rule);
  opacity: 0.45;
  cursor: not-allowed;
}

.vs-sort-dir:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.vs-sort-select {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
}

.vs-sort-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

/* ── Results (.vs-item) ── */

.vs-results {
  list-style: none;
  min-height: 280px;
}

.vs-empty {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  padding: 2rem 0;
}

.vs-item {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  padding-left: 0.8rem;
  border-bottom: 1px solid rgba(26, 32, 72, 0.12);
  border-left: 3px solid rgba(74, 143, 229, 0.1);
  opacity: 0;
  transform: translateY(6px);
  animation: rise 0.4s ease forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
  transition: border-left-color 0.2s ease, background 0.2s ease;
}

.vs-item:hover {
  border-left-color: rgba(74, 143, 229, 0.35);
  background: linear-gradient(90deg, rgba(74, 143, 229, 0.04) 0%, transparent 60%);
}

.vs-item:last-child {
  border-bottom: 0;
}

.vs-title {
  font-size: 17px;
  font-weight: 700;
}

.vs-title-link {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

.vs-title-link:hover {
  color: var(--blue);
  text-shadow: 3px 0 1px rgba(74, 143, 229, 0.25),
               6px 0 2px rgba(74, 143, 229, 0.12);
}

.vs-title-link:focus-visible,
.vs-thumb-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

.vs-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ── Thumbnails ── */

.vs-thumb-link {
  display: block;
  width: 94px;
  flex-shrink: 0;
}

.vs-thumb {
  position: relative;
  width: 94px;
  height: 71px;
  border-radius: 10px / 12px;
  overflow: hidden;
  background: var(--panel);
  flex-shrink: 0;
}

.vs-thumb:not(.vs-thumb--placeholder)::before {
  content: "";
  position: absolute;
  inset: -2px;
  box-shadow: inset 0 0 20px 10px rgba(0, 0, 0, 0.64);
  z-index: 1;
  pointer-events: none;
}

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

.vs-thumb--placeholder {
  background: linear-gradient(135deg, var(--panel), var(--rule));
}

.vs-thumb--placeholder::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--blue);
  transform: translate(-40%, -50%);
  opacity: 0.6;
}

.vs-thumb--placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--rule);
  border-radius: 10px / 12px;
}

/* VHS tracking bands — cluster of lines sweeps on thumbnail hover */
.vs-thumb:not(.vs-thumb--placeholder)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--vhs-h, 8px) * -1);
  height: var(--vhs-h, 8px);
  background: var(--vhs-bg, rgba(255, 255, 255, 0.45));
  pointer-events: none;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .vs-thumb-link:hover .vs-thumb:not(.vs-thumb--placeholder)::after,
  .vs-thumb-link:focus-visible .vs-thumb:not(.vs-thumb--placeholder)::after {
    opacity: 1;
    animation: vhs-track 0.46s linear forwards;
  }

  @keyframes vhs-track {
    from { top: calc(var(--vhs-h, 8px) * -1); }
    to   { top: 100%; }
  }
}

.vs-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* ── Chips (.vs-chip) ── */

.vs-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 2px;
  padding: 0.15rem 0.5rem;
  text-decoration: none;
  transition: text-shadow 0.2s ease;
}

.vs-chip:hover {
  text-shadow: 0 0 10px rgba(74, 143, 229, 0.4);
}

.vs-chip--badge {
  color: var(--plum);
  background: var(--plum-soft);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: inherit;
  border: 1px solid rgba(143, 184, 240, 0.12);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.vs-chip--badge:hover {
  border-color: rgba(143, 184, 240, 0.4);
}

.vs-chip--badge:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 1px;
}

/* ── Highlight sweep ── */

mark {
  background: var(--plum-soft);
  color: #A0C8F8;
  background-size: 0% 100%;
  background-repeat: no-repeat;
  background-image: linear-gradient(var(--plum-soft), var(--plum-soft));
  animation: sweep 0.5s ease forwards;
  border-radius: 1px;
  padding: 0 2px;
}

.vs-snippet {
  font-size: 15px;
  color: var(--muted);
}

.vs-moment {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.vs-moment-count {
  color: var(--plum);
  font-size: 12px;
}

.vs-match-reason {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.vs-meta-row {
  font-size: 12px;
  color: rgba(80, 88, 120, 0.35);
}

.vs-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── Landing state ── */

.vs-landing-group {
  margin-bottom: 1.2rem;
}

.vs-landing-heading {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  margin: 0 0 0.5rem;
}

.vs-landing-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.vs-landing-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #8090B0;
  background: transparent;
  border: 1px solid rgba(26, 32, 72, 0.35);
  border-radius: 2px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.vs-landing-card:hover {
  border-color: rgba(74, 143, 229, 0.4);
  color: var(--blue);
}

.vs-landing-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.vs-landing-count {
  font-size: 12px;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .vs-landing-card:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 760px) {
  .vs-landing-cards {
    gap: 0.4rem;
  }

  .vs-landing-card {
    flex: 1 1 calc(50% - 0.4rem);
    justify-content: space-between;
  }
}

/* ── Off Air (zero results) ── */

.vs-off-air {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
}

.vs-off-air-bars {
  height: 36px;
  margin: 0 auto 2rem;
  max-width: 320px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    #0A0D20 0%, #0A0D20 14.28%,
    #1A2048 14.28%, #1A2048 28.57%,
    #505878 28.57%, #505878 42.85%,
    #4A8FE5 42.85%, #4A8FE5 57.14%,
    #8FB8F0 57.14%, #8FB8F0 71.42%,
    #1A2048 71.42%, #1A2048 85.71%,
    #0A0D20 85.71%, #0A0D20 100%
  );
}

.vs-off-air-heading {
  font-family: var(--font-sans);
  font-size: 3.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 1rem;
}

.vs-off-air-rule {
  width: 5rem;
  height: 2px;
  background: var(--rule);
  border: none;
  margin: 0 auto 1.2rem;
}

.vs-off-air-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
  max-width: 32ch;
  margin: 0 auto 1.5rem;
}

.vs-off-air-standby {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  opacity: 0.5;
}

@media (prefers-reduced-motion: no-preference) {
  .vs-off-air-heading {
    animation: signal-flicker 2.5s step-end infinite;
  }

  .vs-off-air-bars {
    animation: bars-drift 8s ease-in-out infinite;
  }

  @keyframes signal-flicker {
    0%, 100% { opacity: 1; }
    15% { opacity: 0.6; }
    16% { opacity: 1; }
    42% { opacity: 0.75; }
    43% { opacity: 0.95; }
    44% { opacity: 1; }
    71% { opacity: 0.65; }
    72% { opacity: 1; }
    88% { opacity: 0.8; }
    89% { opacity: 1; }
  }

  @keyframes bars-drift {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(1px); }
  }
}

@media (max-width: 760px) {
  .vs-off-air-heading {
    font-size: 2.4rem;
    letter-spacing: 0.15em;
  }

  .vs-off-air-bars {
    max-width: 240px;
    height: 28px;
  }
}

/* ── Footer ── */

footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 3rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(26, 32, 72, 0.25);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

footer .brand {
  color: var(--blue);
}

footer a {
  color: var(--blue);
  text-decoration: none;
}

footer a:hover {
  color: var(--plum);
}

/* ── Motion ── */

@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sweep {
  from { background-size: 0% 100%; }
  to { background-size: 100% 100%; }
}

/* Broadcast atmosphere animations */
@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: hold-drift 14s ease-in-out infinite;
  }

  main::before {
    animation: grain-breathe 16s infinite;
  }

  @keyframes hold-drift {
    0%, 100% { transform: translateX(0); }
    18% { transform: translateX(2px); }
    35% { transform: translateX(-1.5px); }
    52% { transform: translateX(3px); }
    70% { transform: translateX(-1px); }
    85% { transform: translateX(2.5px); }
  }

  @keyframes grain-breathe {
    0%   { opacity: 0.03; }
    14%  { opacity: 0.065; }
    30%  { opacity: 0.035; }
    48%  { opacity: 0.07; }
    64%  { opacity: 0.04; }
    80%  { opacity: 0.06; }
    92%  { opacity: 0.035; }
    100% { opacity: 0.03; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .caret,
  .vs-item,
  mark {
    animation: none !important;
  }

  .vs-item {
    opacity: 1;
    transform: none;
  }

  mark {
    background-size: 100% 100%;
  }

  .vs-chip,
  .vs-chip--badge,
  .vs-chip--filter {
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ── Autocomplete dropdown ── */

.vs-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.3rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 10;
  max-height: 280px;
  overflow-y: auto;
}

.vs-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.vs-autocomplete-item:hover,
.vs-autocomplete-item--active {
  background: rgba(74, 143, 229, 0.08);
}

.vs-autocomplete-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-autocomplete-scope {
  flex-shrink: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ── Responsive ── */

@media (max-width: 760px) {
  .hero-heading {
    font-size: 2rem;
  }

  .vs-thumb {
    width: 72px;
    height: 54px;
  }

  .vs-thumb-link {
    width: 72px;
  }

  .vs-item {
    grid-template-columns: 72px 1fr;
  }

  .vs-results {
    min-height: 0;
  }

  .vs-sort-label {
    font-size: 0;
  }
  .vs-sort-label::before {
    content: "\2195";
    font-size: 14px;
  }

  .vs-count {
    white-space: nowrap;
  }
}
