/* ==========================================================================
   Stash: Thumbnails Split-Slider Studio Stylesheet
   Faithfully matched to creative.html / Stash Design System
   Space Mono + Inter, Dark Luxury (#090514 & #c084fc), Hard Edges, Light/Dark Modes
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* Inherit / fallback tokens if loaded standalone */
:root {
  --u: clamp(1px, calc(0.212px + 0.0769vw), 1.4px);
  --hh: calc(44 * var(--u));
  --pad: clamp(16px, 2.5vw, 40px);
  
  /* Dark Luxury Default */
  --bg: #090514;
  --fg: #f5f3ff;
  --muted: #a78bfa;
  --muted-soft: rgba(216, 180, 254, 0.65);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(192, 132, 252, 0.4);
  --accent: #c084fc;
  --gold: #f2b134;
  --wash: #130a24;
  --wash-card: #190f30;
  --ease: cubic-bezier(.7, 0, .2, 1);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Space Mono", monospace;
  --t: calc(12 * var(--u));
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b7280;
  --muted-soft: rgba(107, 114, 128, 0.8);
  --line: #e5e7eb;
  --line-strong: #0a0a0a;
  --accent: #7c3aed;
  --gold: #d97706;
  --wash: #f3f4f6;
  --wash-card: #f9fafb;
  color-scheme: light;
}

/* Page Base */
body.thumb-page {
  background: var(--bg);
  color: var(--fg);
  font: 400 calc(15 * var(--u)) / 1.35 var(--sans);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Toolbar adjustments for thumbnails */
.thumb-toolbar {
  padding: 0 var(--pad) 28px;
}

.thumb-toolbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.thumb-grid-section {
  padding: 0 var(--pad) 80px;
}

/* 1. Grid of Interactive Cards */
.thumb-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: clamp(20px, 2.5vw, 36px);
}

@media (max-width: 560px) {
  .thumb-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Container */
.thumb-card {
  background: var(--wash-card);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.thumb-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* 2. Interactive Split Slider Box (16:9 Aspect Ratio) */
.thumb-split-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  border-bottom: 1px solid var(--line);
}

.thumb-split-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Remake Layer (Top) */
.thumb-remake-layer {
  position: absolute;
  inset: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  will-change: width;
}

.thumb-remake-img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  max-width: none;
}

/* Split Divider Line & Monospace Handle */
.thumb-split-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.6);
  pointer-events: none;
  touch-action: none;
  z-index: 15;
  transform: translateX(-50%);
}

.thumb-split-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
  user-select: none;
  touch-action: none;
}

/* Monospace Floating Status Badges on Cards */
.thumb-pill {
  position: absolute;
  top: 10px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: calc(9.5 * var(--u));
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 20;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.thumb-pill.after {
  left: 10px;
  background: rgba(9, 5, 20, 0.9);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.thumb-pill.before {
  right: 10px;
  background: rgba(9, 5, 20, 0.9);
  color: var(--gold);
  border: 1px solid var(--gold);
}

.thumb-drag-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 5, 20, 0.85);
  border: 1px solid var(--line);
  color: var(--muted-soft);
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: calc(9 * var(--u));
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 20;
  opacity: 0.9;
  transition: opacity 0.25s ease;
}

.thumb-split-box:hover .thumb-drag-hint {
  opacity: 0;
}

/* 3. Card Body */
.thumb-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--wash-card);
}

.thumb-card-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.thumb-card-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.25;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.thumb-niche-tag {
  font-family: var(--mono);
  font-size: calc(10 * var(--u));
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.thumb-card-strategy-compact {
  font-family: var(--sans);
  font-size: calc(12.5 * var(--u));
  line-height: 1.45;
  color: var(--muted-soft);
}

.thumb-card-strategy-compact .strategy-label {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  font-size: calc(10.5 * var(--u));
  margin-right: 4px;
}

.thumb-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dotted var(--line);
}

.thumb-toggle-quick-btn,
.thumb-zoom-btn {
  font-family: var(--mono);
  font-size: calc(10.5 * var(--u));
  padding: 4px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--wash);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.thumb-toggle-quick-btn:hover,
.thumb-zoom-btn:hover {
  border-color: var(--accent);
  color: var(--fg);
  background: rgba(192, 132, 252, 0.12);
  transform: translateY(-1px);
}

/* 4. Side by Side Mode */
.thumb-cards-grid.mode-sidebyside {
  grid-template-columns: 1fr;
}

.thumb-sidebyside-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--line);
  aspect-ratio: 32 / 9;
}

.thumb-side-pane {
  position: relative;
  overflow: hidden;
  background: #000;
}

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

@media (max-width: 768px) {
  .thumb-sidebyside-container {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
  }
  .thumb-side-pane {
    aspect-ratio: 16 / 9;
  }
}

/* 5. YouTube Dark Feed Mode */
.thumb-cards-grid.mode-youtube {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.mode-youtube .thumb-card {
  background: transparent;
  border: none;
}

.mode-youtube .thumb-card-body {
  flex-direction: row;
  gap: 12px;
  padding: 12px 4px 0;
  background: transparent;
}

.thumb-yt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wash-card);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex: none;
}

.thumb-yt-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.thumb-yt-meta .thumb-card-title {
  font-family: var(--sans);
  font-size: calc(14 * var(--u));
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thumb-yt-channel, .thumb-yt-stats {
  font-size: calc(12 * var(--u));
  color: var(--muted);
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 6. Lightbox Modal - Styled as Stash Retro Mac OS Window (.d-win) */
.thumb-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(4, 2, 8, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.thumb-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.thumb-modal-inner {
  width: min(960px, 100%);
  max-height: 90vh;
  background: var(--bg);
  border: 2px solid var(--fg);
  box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.3s var(--ease);
}

.thumb-modal.active .thumb-modal-inner {
  transform: scale(1);
}

.thumb-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 10px;
  border-bottom: 2px solid var(--fg);
  background: repeating-linear-gradient(to bottom, var(--fg) 0 1px, transparent 1px 3px) center/100% 16px no-repeat;
  user-select: none;
}

.thumb-modal-bar-title {
  background: var(--bg);
  padding: 0 12px;
  font-family: var(--mono);
  font-size: calc(11 * var(--u));
  color: var(--fg);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.thumb-modal-close {
  width: 14px;
  height: 14px;
  border: 1px solid var(--fg);
  background: var(--bg);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 10px;
  line-height: 1;
  color: var(--fg);
  transition: background 0.2s, color 0.2s;
}

.thumb-modal-close:hover {
  background: var(--accent);
  color: #000;
}

.thumb-modal-content {
  overflow-y: auto;
  padding: clamp(16px, 2.5vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.thumb-modal-viewer {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.thumb-modal-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thumb-modal-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(18px, 1.8vw, 24px);
  color: var(--fg);
}

.thumb-modal-strategy {
  font-family: var(--sans);
  font-size: calc(13.5 * var(--u));
  line-height: 1.55;
  color: var(--muted-soft);
  border-top: 1px dotted var(--line);
  padding-top: 12px;
}

.thumb-modal-strategy p {
  margin-bottom: 8px;
}

.thumb-modal-strategy strong {
  font-family: var(--mono);
  color: var(--accent);
}

/* ==========================================================================
   Mobile & Tablet Responsive Overrides (thumbnails.html)
   ========================================================================== */
@media (max-width: 900px) {
  .thumb-cards-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .site-head {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .site-head .nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    gap: 14px;
    padding: 4px 0;
  }

  .site-head .nav::-webkit-scrollbar {
    display: none;
  }

  .thumb-toolbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .filter-pills {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 6px;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .thumb-chip {
    flex: none;
    font-size: 11px;
    padding: 6px 12px;
    min-height: 38px;
  }

  .view-toggle {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .thumb-view-btn {
    flex: 1;
    text-align: center;
    font-size: 11px;
    padding: 6px 8px;
    min-height: 38px;
  }

  .hero-wordmark {
    font-size: clamp(26px, 7vw, 42px);
  }

  .hero-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 11px;
  }

  .mag-wide {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .site-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .foot-links {
    flex-wrap: wrap;
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .site-head {
    padding: 0 12px;
  }

  .site-subtitle, .h-status {
    display: none;
  }

  .thumb-card-body {
    padding: 12px;
  }

  .thumb-card-title {
    font-size: 14px;
  }

  .thumb-modal-inner {
    width: 95vw;
    max-height: 90vh;
  }

  .thumb-modal-content {
    padding: 14px;
  }
}

