:root {
  /* ─── Clip Engine PRO theme — neon green ─── */
  --bg-color: #05080a;
  --card-bg: rgba(22, 30, 27, 0.4);
  --card-hover-bg: rgba(28, 40, 34, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(61, 255, 153, 0.35);
  --accent-color: #3dff99;
  --accent-color-2: #14e07a;
  /* deeper green, for gradients */
  --accent-glow: rgba(61, 255, 153, 0.22);
  --accent-ink: #04160d;
  /* dark text for use ON the neon accent */
  --text-main: #f0fcf6;
  --text-dim: #8ba395;
  --text-dark: #4a5851;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Lexend', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-color);
  background-image:
    radial-gradient(circle at 50% -20%, rgba(61, 255, 153, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 0% 0%, rgba(61, 255, 153, 0.02) 0%, transparent 40%);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Ensure form elements inherit the global font */
input,
button,
textarea,
select {
  font-family: inherit;
}

/* Utilities */
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.glass-hover:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* ─── Top loading bar (YouTube-style) ─── */
#top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  z-index: 99999;
  transform: scaleX(0);
  transform-origin: left center;
  background: #1cc972; /* a notch darker than --accent-color (#3dff99) */
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  /* Width (scaleX) is eased per-frame in JS; CSS only fades opacity. */
  transition: opacity 0.3s ease;
}

#top-progress-bar.active {
  opacity: 1;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }

  100% {
    opacity: 1;
  }
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg,
      rgba(22, 27, 34, 0.4) 25%,
      rgba(40, 48, 60, 0.6) 50%,
      rgba(22, 27, 34, 0.4) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 2s infinite linear;
  pointer-events: none;
  /* Disable interaction while loading */
}

/* For small text tags while waiting for images */
.loading-shine {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Global Header */
.global-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(5, 6, 8, 0.85);
  transition: var(--transition-smooth);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.75rem 2rem;
}

.logo {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  cursor: pointer;
  letter-spacing: -1px;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.logo-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  display: none;
  /* Hidden on Desktop */
}

.accent-text {
  color: var(--accent-color);
}

.main-search-form {
  flex: 1;
  min-width: 200px; /* Maintain a usable size */
}

.search-input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border-radius: 12px;
  background: rgba(22, 27, 34, 0.85);
}

.search-input-group input {
  width: 100%;
  padding: 0.75rem 0;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 0.95rem;
  font-family: 'Lexend', sans-serif;
  min-width: 0; /* Important for flex shrinking */
}

.search-input-group input::placeholder {
  font-family: 'Lexend', sans-serif;
}

.icon-dim {
  color: var(--text-dark);
}

.source-search-container {
  position: relative;
  flex: 1;
  max-width: 300px;
  min-width: 100px;
}

.source-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1001;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(13, 17, 23, 0.98);
  border: 1px solid var(--glass-border);
}

.dropdown-item {
  padding: 12px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.dropdown-item:hover,
.dropdown-item.active {
  background: rgba(61, 255, 153, 0.2);
  color: var(--accent-color);
}

.dropdown-item.loading-shine-bg {
  background: linear-gradient(90deg,
      transparent 25%,
      rgba(255, 255, 255, 0.05) 50%,
      transparent 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
  color: var(--text-dim);
  font-style: italic;
  cursor: default;
}

.dropdown-item.empty-hint {
  color: var(--text-dark);
  font-style: italic;
  cursor: default;
}

.clear-source-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.clear-source-btn:hover {
  color: white;
}

/* Video Grid and Cards */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* Capped at 4 for desktop */
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1600px;
  /* Optional: keeps the grid from getting too wide */
  margin: 0 auto;
}

/* Tablets / Medium Screens: 3 columns */
@media (max-width: 1100px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile View: Force 2 columns (never drops to 1) */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
  }

  /* Shrink download button on mobile */
  .download-btn-small {
    width: 24px !important;
    height: 24px !important;
    border-radius: 6px !important;
  }

  .download-btn-small svg,
  .download-btn-small i {
    width: 12px !important;
    height: 12px !important;
  }
}

.video-card.glass {
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.4);
}

.video-card {
  position: relative;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.video-preview-container {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
}

.sprite-player {
  width: 100%;
  height: 100%;
  background-size: cover;
  /* Fallback */
  background-repeat: no-repeat;
  transition: background-position 0s;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, transparent 40%);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.video-card:hover .card-overlay {
  opacity: 1;
  pointer-events: auto;
}

.source-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  color: var(--text-dim);
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s;
  /* Single line truncation */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75%;
}

.source-tag:hover {
  background: var(--accent-color);
  color: var(--accent-ink);
}

/* Keep overlay persistent if explicitly told to (for skeleton loading) */
.card-overlay.persistent {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.download-btn-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-color);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 14px var(--accent-glow);
}

.download-btn-small:hover {
  transform: scale(1.1);
}

/* Progress Bar */
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background-color: #ffffff;
  z-index: 10;
}

/* Status / Loading */
.status-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50vh;
  color: var(--text-dim);
  font-style: italic;
}

.loader {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Home / Hero */
.app-main {
  padding-top: 5rem;
  flex: 1;
}

.home-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem 2rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.home-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  margin-top: -5rem;
  /* offset header */
}

.hero-content {
  /* font-family: 'Inter', sans-serif; */
  text-align: center;
  max-width: 800px;
  width: 100%;
  z-index: 10;
}

.hero-title {
  font-size: clamp(2.4rem, 8vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  word-spacing: -0.1em;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 3.25rem;
}

.hero-title .accent-text {
  display: inline-block;
  /* Ensure it stays tight with previous text if needed */
  background: none;
  /* -webkit-text-fill-color: var(--accent-color); */
}

.glow-text {
  color: var(--accent-color);
  text-shadow: 0 0 30px rgba(61, 255, 153, 0.4);
  -webkit-text-fill-color: initial;
}

.home-search-box {
  position: relative;
  width: 100%;
  max-width: 710px;
  margin: 0 auto 1.5rem auto;
  padding: 6px;
  border-radius: 24px;
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.home-search-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  z-index: 1001;
  border-radius: 18px;
  overflow: hidden;
  background: #0d1117;
  /* Solid fallback */
  background: rgba(13, 17, 23, 0.98);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: block;
  /* Ensure it overrides any default hidden behavior */
}

.home-search-dropdown.hidden {
  display: none !important;
}

.home-search-dropdown .dropdown-item {
  padding: 1.25rem 1.75rem;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
}

.dropdown-item .source-tag-inline {
  font-size: 0.75rem;
  background: rgba(61, 255, 153, 0.15);
  color: var(--accent-color);
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.home-search-box:focus-within {
  border-color: rgba(61, 255, 153, 0.5);
  box-shadow: 0 0 40px rgba(61, 255, 153, 0.15);
  background: rgba(22, 27, 34, 0.9);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 1.25rem;
  padding: 1.10rem 1.75rem;
  font-weight: 500;
  font-family: 'Lexend', sans-serif;
}

.search-input::placeholder {
  font-family: 'Lexend', sans-serif;
}

/* Source View Special */
#source-view .hero-title {
  margin-bottom: 0.5rem;
}

#source-view .video-grid {
  padding-top: 0;
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin: 2rem 0 4rem 0;
}

.pagination-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.75rem;
  border-radius: 16px;
}

.page-num {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
}

.page-num:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-color);
}

.page-num.active {
  background: var(--accent-color);
  color: var(--accent-ink);
  box-shadow: 0 4px 15px var(--accent-glow);
}

/* ─── Mobile Source Toggle Button (hidden on desktop) ─── */
.source-toggle-btn {
  display: none;
}

/* ─── Mobile Nav Breakpoint ─── */
@media (max-width: 640px) {

  .header-content {
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
    position: relative;
  }

  /* Collapse all text in header, keep only icon on mobile nav */
  .global-header .logo-text,
  .global-header .accent-text {
    display: none;
  }

  .global-header .logo-icon {
    display: block;
  }

  /* Give search bar as much room as possible */
  .main-search-form {
    flex: 1;
    min-width: 0;
  }

  /* Hide the full source container by default on mobile */
  .source-search-container {
    display: none;
    width: 100%;
    order: 3;
    /* Sits below the main row */
  }

  /* When expanded, show it as a full-width second row */
  .global-header.source-expanded .source-search-container {
    display: block;
  }

  /* Show the toggle icon button on mobile */
  .source-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(22, 27, 34, 0.85);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-smooth);
  }

  .source-toggle-btn:hover,
  .global-header.source-expanded .source-toggle-btn {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(61, 255, 153, 0.1);
  }

  /* ─── Shrink Home Search Box (~0.7x) ─── */
  .home-search-box {
    padding: 4px;
    border-radius: 18px;
    max-width: 90%;
  }

  .search-input {
    font-size: 0.95rem;
    /* down from 1.25rem */
    padding: 0.8rem 1.2rem;
    /* down from 1.1rem 1.75rem */
  }

  .home-search-box .search-icon-large {
    width: 18px !important;
    /* down from 24px */
    height: 18px !important;
    margin-left: 0.75rem !important;
  }

  .home-search-dropdown .dropdown-item {
    padding: 0.4rem 1.0rem;
    /* down from 1.25rem 1.75rem */
    font-size: 0.8rem;
    /* down from 1rem */
  }

  .dropdown-item .source-tag-inline {
    font-size: 0.65rem;
    padding: 2px 4px;
  }
}

/* ─── Site Footer ─── */
.site-footer {
  margin-top: auto;
  padding: 1rem 2rem;
  text-align: center;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(13, 17, 23, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-footer .footer-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 0.75rem;
  line-height: 1.6;
}

.site-footer p {
  margin-bottom: 0.75rem;
}

.site-footer .footer-links {
  margin-top: 1.5rem;
  font-weight: 500;
}

.site-footer .footer-links a {
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--transition-smooth);
  margin: 0 0.5rem;
}

.site-footer .footer-links a:hover {
  color: var(--accent-color);
}

/* ─── Folder Card Component ─── */
.folder-card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: visible;
  cursor: default;
  transition: transform 0.25s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.2s ease;
  background: #0f0f1a;
  z-index: 1;
  container-type: inline-size;
}

.folder-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(61, 255, 153, 0.5);
  box-shadow:
    0 15px 30px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(61, 255, 153, 0.35);
  z-index: 100;
}

.folder-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1;
}

/* Stacked wide thumbnails with perspective tilt */
.folder-contents {
  position: absolute;
  top: 5%;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  perspective: 1000px;
  /* Enable 3D tilt */
  /* Allow overflow at top and sides but clip at the bottom to match card radius */
  clip-path: inset(-100px -20px 0 -20px round 0 0 20px 20px);
}

.folder-thumb-stack {
  position: absolute;
  width: 96%;
  /* Fill width-wise */
  height: 90%;
  border-radius: 12px;
  background-color: rgba(30, 36, 46, 1);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.5s ease;
  /* Tilt forward on X axis */
  transform-origin: bottom center;
  transform: translateY(15px) rotateX(-25deg);
}

/* Stacking and Hover logic (3 is back-most, peeks out top) */
.folder-thumb-stack:nth-child(3) {
  transform: translateY(-10px) rotateX(0deg) scale(0.94);
  opacity: 0.5;
  z-index: 3;
}

.folder-thumb-stack:nth-child(2) {
  transform: translateY(0px) rotateX(-1deg) scale(0.98);
  opacity: 0.8;
  z-index: 4;
}

.folder-thumb-stack:nth-child(1) {
  transform: translateY(10px) rotateX(-3deg) scale(1);
  z-index: 5;
}

/* The "Pop Up" effect - they all lift but maintain the staggered peeking */
.folder-card:hover .folder-thumb-stack:nth-child(3) {
  transform: translateY(-20px) rotateX(-1deg) scale(0.94);
}

.folder-card:hover .folder-thumb-stack:nth-child(2) {
  transform: translateY(-10px) rotateX(-3deg) scale(0.98);
}

.folder-card:hover .folder-thumb-stack:nth-child(1) {
  transform: translateY(0px) rotateX(-5deg) scale(1.02);
}

/* Glass Front Plate - Unified tilted plate */
.folder-front {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 40%;
  /* background: rgba(255, 255, 255, 0.04); */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px 10px 15px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  /* Tilt the front plate forward slightly to match thumbnails */
  transform-origin: bottom center;
  transform: rotateX(-15deg);
  /* Integrated tab shape */
  clip-path: polygon(0 0, 110px 0, 140px 25px, 100% 25px, 100% 100%, 0 100%);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
}

.folder-info {
  width: 100%;
  /* Counter-tilt the text slightly if needed, but usually looks fine */
}



.folder-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(0.5rem, 6cqi, 1rem);
  font-weight: 500;
  color: white;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  text-align: left;
  padding: 0.5rem 1.5rem;
  padding-top: 20px;
  letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════════════════════
   CLIP ENGINE PRO — premium chrome (badge, account, auth modal)
   Injected/used by auth.js. Free site never loads these.
   ═══════════════════════════════════════════════════════════ */

/* ─── Hero subtitle (Pro value prop) ─── */
.hero-subtitle {
  margin-top: -2rem;
  margin-bottom: 2.5rem;
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  font-weight: 500;
  color: var(--text-dim);
}

.hero-subtitle::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
  vertical-align: middle;
}

/* ─── PRO badge ─── */
.pro-badge {
  display: inline-block;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 1.5px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-2));
  padding: 3px 7px;
  border-radius: 6px;
  margin-left: 0.45rem;
  vertical-align: middle;
  text-transform: uppercase;
  box-shadow: 0 0 14px var(--accent-glow);
}

/* ─── Account / Sign-in control in header ─── */
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.5rem 0.95rem;
  border-radius: 12px;
  background: rgba(22, 30, 27, 0.85);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.account-btn:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 0 18px var(--accent-glow);
  color: var(--accent-color);
}

.account-btn .account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-2));
  flex-shrink: 0;
}

/* On the home nav, push the control to the far right */
.home-nav .account-wrap {
  margin-left: auto;
}

/* ─── Auth modal ─── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(3, 6, 5, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease-out forwards;
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 22px;
  padding: 2.25rem 2rem 2rem;
  background: rgba(13, 19, 16, 0.98);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 40px var(--accent-glow);
  animation: fadeIn 0.3s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

.auth-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  margin-bottom: 0.35rem;
}

.auth-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.auth-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.3rem;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.auth-tab.active {
  background: var(--accent-color);
  color: var(--accent-ink);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  letter-spacing: 0.3px;
}

.auth-field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

.auth-field input:focus {
  border-color: var(--glass-border-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.95rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-2));
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px var(--accent-glow);
}

/* Social sign-in (Google / Discord) */
.auth-social {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.auth-social-btn:hover {
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.auth-social-btn svg,
.auth-social-btn img {
  width: 18px;
  height: 18px;
}

.auth-social-btn.discord {
  background: rgba(88, 101, 242, 0.12);
  border-color: rgba(88, 101, 242, 0.4);
}

.auth-social-btn.discord:hover {
  background: rgba(88, 101, 242, 0.22);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0 1.1rem;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.auth-note {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(61, 255, 153, 0.06);
  border: 1px solid rgba(61, 255, 153, 0.15);
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
}

.auth-msg {
  min-height: 1.1rem;
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-color);
}

.auth-msg.error {
  color: #ff6b6b;
}

/* Signed-in account menu */
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  z-index: 2001;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(13, 19, 16, 0.98);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.account-menu .menu-email {
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--glass-border);
  word-break: break-all;
}

.account-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.account-menu .menu-item:hover {
  background: rgba(61, 255, 153, 0.1);
  color: var(--accent-color);
}

.account-wrap {
  position: relative;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .account-btn .account-label {
    display: none;
  }

  .account-btn {
    padding: 0.45rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   CLIP ENGINE PRO — minimal-luxe landing + media-first cards
   (overrides the base home / card styling above)
   ═══════════════════════════════════════════════════════════ */

/* ─── Landing top bar (defined glass bar) ─── */
.lux-nav {
  background: rgba(8, 12, 10, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.95rem 2.5rem;
}

.lux-nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
  margin-right: 1.5rem;
}

.lux-nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.lux-nav-link:hover {
  color: var(--accent-color);
}

@media (max-width: 640px) {
  .lux-nav-links {
    display: none;
  }
}

/* ─── Home stage: glow + grain layering ─── */
.lux-home {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* Animated line-waves background (canvas) */
.linewaves-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.linewaves-bg.ready {
  opacity: 1;
}

.lux-home::after {
  /* subtle film grain */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: 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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

.lux-hero {
  position: relative;
  z-index: 2;
}

/* ─── Headline ─── */
.lux-hero .hero-title {
  font-size: clamp(2.9rem, 9vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.93;
  margin-bottom: 2.6rem;
}

.lux-hero .hero-title .accent-text {
  background: none;
  -webkit-text-fill-color: var(--accent-color);
  color: var(--accent-color);
  text-shadow: 0 0 45px rgba(61, 255, 153, 0.5);
}

/* ─── Search bar ─── */
.lux-search {
  max-width: 660px;
  margin: 0 auto;
  padding: 7px 7px 7px 1.4rem;
  border-radius: 18px;
  background: rgba(12, 18, 15, 0.72);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lux-search:focus-within {
  border-color: var(--glass-border-hover);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 24px 60px rgba(0, 0, 0, 0.5);
}

.lux-search .search-icon-large {
  width: 22px;
  height: 22px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.lux-search .search-input {
  font-size: 1.1rem;
  font-weight: 500;
  padding: 1rem 0.9rem;
}

.lux-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: none;
  border-radius: 13px;
  cursor: pointer;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-2));
  box-shadow: 0 0 18px var(--accent-glow);
  transition: var(--transition-smooth);
}

.lux-search-btn:hover {
  transform: scale(1.06);
}

.lux-search-btn svg,
.lux-search-btn i {
  width: 20px;
  height: 20px;
}

@media (max-width: 640px) {
  .lux-nav {
    padding: 1rem 1.25rem;
  }

  .lux-search {
    max-width: 92%;
    padding: 5px 5px 5px 1.1rem;
  }

  .lux-search .search-input {
    font-size: 1rem;
    padding: 0.85rem 0.7rem;
  }

  .lux-search-btn {
    width: 42px;
    height: 42px;
  }
}

/* ─── Media-first result cards (refined) ─── */
.video-card {
  border-radius: 10px;
  transition: transform 0.35s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.3s ease;
  transform-origin: center center;
  will-change: transform;
  z-index: 1;
}

.video-card.glass {
  background: rgba(12, 17, 15, 0.85);
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.video-card:hover {
  transform: translateY(-6px) scale(1.035);
  z-index: 10;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.55),
    0 0 34px rgba(61, 255, 153, 0.32);
}

/* Minimal static neon stroke — appears on hover while the preview plays */
.video-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: var(--accent-color);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 6;
}

.video-card:hover::after {
  opacity: 0.5;
}

.card-overlay {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.1) 45%, transparent 65%);
  padding: 14px;
}

.source-tag {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-weight: 600;
}