/*
/* Base Theme Variables */
:root {
  --bg: #0f0f14;
  --surface: #17171f;
  --text: #e8e8f0;
  --muted: #9aa0b4;
  --primary: #7c5cff;
  --accent: #00e5ff;

  --radius: 16px;
  --shadow: 0 20px 40px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Decorative gradient backdrop */
.site-bg {
  position: fixed; inset: -10% -10% auto -10%; height: 60vh;
  /* Fallback */
  background: radial-gradient(1200px 400px at 15% 20%, rgba(124, 92, 255, .5), transparent 70%),
              radial-gradient(800px 300px at 85% 10%, rgba(0, 229, 255, .5), transparent 70%);
  /* Existing */
  background: radial-gradient(1200px 400px at 15% 20%, color-mix(in srgb, var(--primary) 70%, transparent), transparent 70%),
              radial-gradient(800px 300px at 85% 10%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%);
  filter: blur(40px) saturate(1.2);
  opacity: 0.35; pointer-events: none; z-index: 0;
}

.container { width: min(1100px, 92%); margin: 0 auto; position: relative; z-index: 1; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
  /* Fallback background/border */
  background-color: rgba(15, 15, 20, 0.80);
  border-bottom: 1px solid rgba(23, 23, 31, 0.70);
  /* Existing color-mix (will override on supported browsers) */
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--surface) 70%, transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand-logo {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  color: white; background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px; box-shadow: var(--shadow);
}

.nav { display: flex; gap: 18px; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav-link:hover { color: var(--text); }

/* Hero */
.hero { padding: 64px 0; }
.hero-title {
  font-size: clamp(32px, 6vw, 48px);
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--accent) 50%, var(--text)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subtitle { color: var(--muted); margin-top: 8px; }
.search { display: flex; gap: 10px; margin-top: 20px; }
.search-input {
  flex: 1; padding: 12px 14px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent);
  background: var(--surface); color: var(--text);
}
.btn { padding: 10px 16px; border-radius: 12px; border: none; cursor: pointer; font-weight: 600; }
.btn-primary {
  color: white; background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow);
}
.btn-secondary {
  color: var(--text); background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent);
}

/* Grid of assets */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px; margin: 30px 0 40px;
}
.card {
  /* Fallback */
  background-color: rgba(23, 23, 31, 0.85);
  border: 1px solid rgba(23, 23, 31, 0.60);
  /* Existing */
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent);
  display: grid; grid-template-rows: 160px auto; text-decoration: none; color: inherit;
  overflow: hidden; position: relative;
  transform-style: preserve-3d; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px) rotateX(2deg) rotateY(-1deg); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 30%, var(--surface)); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 14px; }
.card-title { font-weight: 700; margin: 0 0 6px; }
.card-text { color: var(--muted); margin: 0 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 6px 8px; border-radius: 999px; }

/* Admin cards should not reserve a media row */
.card.admin-card { grid-template-rows: auto; }

/* Make the body columnar so actions sit below the scrollable area */
.card.admin-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Scrollable region inside each admin asset card */
.scroll-rect {
  /* Adjust height to taste or expose as a CSS var */
  --scroll-rect-height: 120px;
  max-height: var(--scroll-rect-height);
  overflow-y: auto;
  padding-right: 6px; /* room for scrollbar */
  overscroll-behavior: contain;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}

/* Optional: nicer scrollbar */
.scroll-rect::-webkit-scrollbar { width: 8px; }
.scroll-rect::-webkit-scrollbar-track { background: transparent; }
.scroll-rect::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 35%, var(--surface));
  border-radius: 8px;
}

/* Keep actions row tidy */
.card-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Asset page hero */
.asset-hero {
  display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: center;
  margin: 32px 0; padding: 22px; background: color-mix(in srgb, var(--surface) 75%, transparent);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
}
.asset-hero-media img { width: 100%; border-radius: 12px; box-shadow: var(--shadow); }
.asset-title { font-size: clamp(28px, 5vw, 40px); margin: 0; }
.asset-subtitle { color: var(--muted); margin-top: 8px; }
.asset-cta { display: flex; gap: 10px; margin-top: 16px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.gallery .shot img { width: 100%; border-radius: 12px; display: block; }

/* Content cards */
.asset-content { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: 40px; }
.content-card {
  /* Fallback */
  background-color: #17171f;
  border: 1px solid rgba(23, 23, 31, 0.55);
  /* Existing */
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
  padding: 18px;
}
.content-card h2 { margin-top: 0; }
.prose { color: var(--text); }
.prose .video { aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; }
.prose iframe { width: 100%; height: 100%; display: block; }

/* Footer */
.site-footer { padding: 30px 0; border-top: 1px solid color-mix(in srgb, var(--surface) 70%, transparent); margin-top: 30px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.socials { display: flex; gap: 12px; }
.social { color: var(--muted); text-decoration: none; }
.social:hover { color: var(--text); }

/* Pagination (basic) */
.pagination nav { display: flex; gap: 10px; flex-wrap: wrap; }
.pagination nav a, .pagination nav span {
  padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent); color: var(--text); text-decoration: none;
}

/* Theme Panel */
.theme-panel {
  /* Fallback */
  background-color: #17171f;
  border: 1px solid rgba(23, 23, 31, 0.55);
  /* Existing */
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
  position: fixed; inset: auto 20px 20px auto; width: 360px;
  box-shadow: var(--shadow); z-index: 20;
}
.theme-panel-inner { padding: 14px; }
.theme-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.icon-btn { background: transparent; color: var(--text); border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent); border-radius: 8px; padding: 6px 10px; }
.label { display: block; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.preset-row { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 12px; margin: 8px 0 14px; }
.preset-list { display: flex; gap: 8px; flex-wrap: wrap; }
.preset { padding: 8px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent); background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text); cursor: pointer; }
.panel-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Responsive tweaks */
@media (max-width: 900px) {
  .asset-hero { grid-template-columns: 1fr; }
}

/* NEW: Force 4 columns per row on wide screens, auto-extend rows vertically */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* 4 per row */
  gap: 18px;
  margin: 30px 0 40px;
  align-items: stretch;
}

/* Responsive: 3/2/1 columns on smaller widths */
@media (max-width: 1200px) {
  .assets-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .assets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .assets-grid { grid-template-columns: 1fr; }
}

/* Home: Mega Hero */
.home-hero {
  position: relative;
  padding: 80px 0 40px;
  overflow: clip;
}
.home-hero .hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.orb {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  filter: blur(60px) saturate(1.2);
  opacity: .35;
  animation: float 16s ease-in-out infinite;
}
.orb-a { top: -120px; left: -80px; background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 65%, transparent), transparent); }
.orb-b { top: -160px; right: -160px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 65%, transparent), transparent); animation-delay: 3s; }
.orb-c { bottom: -220px; left: 30%; background: radial-gradient(closest-side, color-mix(in srgb, var(--text) 12%, transparent), transparent); animation-delay: 6s; }
.gridlines {
  position: absolute; inset: 0;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--surface) 35%, transparent) 1px, transparent 1px),
                    linear-gradient(to bottom, color-mix(in srgb, var(--surface) 35%, transparent) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: .12;
}

@keyframes float {
  0%, 100% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(0, 20px, 0); }
}

.hero-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; position: relative; z-index: 1; }
.hero-copy .hero-title {
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--accent) 50%, var(--text)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-copy .hero-lead { color: var(--muted); margin-top: 8px; font-size: 18px; }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.home-marquee { margin-top: 18px; overflow: hidden; mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); }
.marquee-track { display: inline-flex; gap: 10px; animation: marquee 18s linear infinite; }
.marquee-track .chip { padding: 6px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); font-weight: 600; font-size: 12px; white-space: nowrap; }

@keyframes marquee {
  from { transform: translateX(0); } to { transform: translateX(-50%); }
}

.hero-showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.showcase-card { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent); }
.showcase-thumb {
  height: 240px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 30%, var(--bg)), color-mix(in srgb, var(--accent) 25%, var(--bg)));
}
.showcase-thumb.alt {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, var(--bg)), color-mix(in srgb, var(--primary) 25%, var(--bg)));
}
.showcase-overlay {
  position: absolute; inset: auto 12px 12px 12px; padding: 12px;
  border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
}
.overlay-title { font-weight: 700; }
.overlay-sub { color: var(--muted); font-size: 14px; }

/* Stats bar */
.home-stats { 
    display: flex; 
    justify-content: center; /* This centers them horizontally */
    flex-wrap: wrap;         /* This makes them stack on mobile */
    gap: 12px; 
    margin: 28px 0; 
}

.stat { 
    flex: 1;                /* Allows them to grow */
    min-width: 200px;       /* Prevents them from getting too skinny */
    max-width: 260px;       /* Prevents them from getting too wide */
    padding: 16px; 
    background: color-mix(in srgb, var(--surface) 85%, transparent); 
    border-radius: 16px; 
    text-align: center; 
    border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent); 
}

.stat-num { font-size: 28px; font-weight: 800; }
.stat-label { color: var(--muted); }

/* Featured grid */
.home-section .section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 12px; }
.section-title { margin: 0; font-size: 22px; }
.link { color: var(--accent); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

.featured-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1100px) { .featured-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .featured-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .featured-grid { grid-template-columns: 1fr; } }

.feature-card {
  /* Fallback */
  background-color: rgba(23, 23, 31, 0.85);
  border: 1px solid rgba(23, 23, 31, 0.55);
  /* Existing */
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
  display: grid; grid-template-rows: 160px auto; text-decoration: none; color: inherit;
  border-radius: 16px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 25%, var(--surface)); }
.feature-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-body { padding: 12px; }
.feature-title { font-weight: 700; }
.feature-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.feature-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 6px 8px; border-radius: 999px; }

/* CTA banner */
.home-cta .cta-inner {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  padding: 18px;
  border-radius: 16px;
  /* Fallback */
  background-color: #17171f;
  border: 1px solid rgba(23, 23, 31, 0.55);
  /* Existing */
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
}
.home-cta .cta-copy h3 { margin: 0; }
.home-cta .cta-copy p { margin: 6px 0 0; color: var(--muted); }

/* Testimonials */
.home-testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 36px; }
.testi-card {
  /* Fallback */
  background-color: rgba(23, 23, 31, 0.85);
  border: 1px solid rgba(23, 23, 31, 0.55);
  /* Existing */
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
  padding: 16px; border-radius: 16px;
}
.testi-quote { margin: 0; font-style: italic; }
.testi-meta { margin-top: 8px; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .home-stats { grid-template-columns: repeat(2, 1fr); }
  .home-testimonials { grid-template-columns: 1fr; }
}
