/* ============================================================
   MAGARA TATTOO STUDIO — Video & Cinematic Enhancements
   Awwwards-level visual upgrade
   ============================================================ */

/* ── Hero Video Background ── */
.hero-video-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%) scale(1.08);
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease;
  filter: saturate(1.3) contrast(1.1) brightness(0.55);
}

.hero-video.loaded {
  opacity: 1;
}

/* Cinematic overlays */
.hero-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom,
      rgba(13,7,20,0.85) 0%,
      rgba(13,7,20,0.25) 30%,
      rgba(13,7,20,0.15) 55%,
      rgba(13,7,20,0.55) 80%,
      rgba(13,7,20,0.98) 100%
    ),
    linear-gradient(to right,
      rgba(13,7,20,0.4) 0%,
      transparent 40%,
      transparent 60%,
      rgba(13,7,20,0.3) 100%
    );
}

.hero-video-overlay-color {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg,
    rgba(123,53,204,0.12) 0%,
    transparent 50%,
    rgba(155,93,222,0.08) 100%
  );
  mix-blend-mode: screen;
}

/* Film grain overlay */
.film-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='1'/%3E%3C/svg%3E");
  animation: grainShift 0.08s steps(1) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0,0); }
  10%  { transform: translate(-1%,-2%); }
  20%  { transform: translate(2%,1%); }
  30%  { transform: translate(-2%,2%); }
  40%  { transform: translate(1%,-1%); }
  50%  { transform: translate(2%,2%); }
  60%  { transform: translate(-1%,1%); }
  70%  { transform: translate(1%,2%); }
  80%  { transform: translate(-2%,-1%); }
  90%  { transform: translate(2%,-2%); }
  100% { transform: translate(0,0); }
}

/* ── Cinematic Letterbox (optional) ── */
.cinematic-bars::before,
.cinematic-bars::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 0;
  background: #0D0714;
  z-index: 3;
  transition: height 1.5s cubic-bezier(0.77,0,0.18,1);
}
.cinematic-bars::before { top: 0; }
.cinematic-bars::after  { bottom: 0; }
.cinematic-bars.open::before,
.cinematic-bars.open::after { height: 3.5%; }

/* ── Floating particles on hero ── */
.particles-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.55;
}

/* ── Video Section (Parallax) ── */
.video-section {
  position: relative;
  overflow: hidden;
  min-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-section-bg {
  position: absolute;
  inset: -10%;
  z-index: 0;
}

.video-section-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.2) contrast(1.1) brightness(0.45);
}

.video-section-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(123,53,204,0.15) 0%, transparent 70%),
    linear-gradient(to bottom, rgba(13,7,20,0.9), rgba(13,7,20,0.5), rgba(13,7,20,0.9));
  z-index: 1;
}

.video-section-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 6rem 2rem;
}

/* ── Horizontal Scroll Gallery ── */
.gallery-h-scroll {
  overflow: hidden;
  position: relative;
}

.gallery-h-track {
  display: flex;
  gap: 1.5rem;
  padding: 2rem 0;
  width: max-content;
  animation: galleryScroll 35s linear infinite;
}

.gallery-h-track:hover { animation-play-state: paused; }

.gallery-h-item {
  width: clamp(260px, 28vw, 380px);
  aspect-ratio: 3/4;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}

.gallery-h-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.6s ease;
  filter: saturate(0.85) brightness(0.9);
}

.gallery-h-item:hover img {
  transform: scale(1.06);
  filter: saturate(1.1) brightness(1.0);
}

.gallery-h-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,7,20,0.85) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.gallery-h-item:hover .gallery-h-item-overlay { opacity: 1; }

@keyframes galleryScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Magnetic Button ── */
.btn-magnetic {
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── Logo Animation Reveal ── */
.logo-reveal {
  overflow: hidden;
  position: relative;
}

.logo-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-bg);
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(0.77,0,0.18,1);
}

body.loaded .logo-reveal::after {
  transform: scaleX(0);
  transform-origin: right;
}

/* ── Split Text Reveal ── */
.split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.split-char {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.34,1.56,0.64,1), opacity 0.6s ease;
}

body.loaded .split-char {
  transform: translateY(0);
  opacity: 1;
}

/* Staggered char delays (0–24) */
.split-char:nth-child(1)  { transition-delay: 0.4s; }
.split-char:nth-child(2)  { transition-delay: 0.44s; }
.split-char:nth-child(3)  { transition-delay: 0.48s; }
.split-char:nth-child(4)  { transition-delay: 0.52s; }
.split-char:nth-child(5)  { transition-delay: 0.56s; }
.split-char:nth-child(6)  { transition-delay: 0.60s; }
.split-char:nth-child(7)  { transition-delay: 0.64s; }
.split-char:nth-child(8)  { transition-delay: 0.68s; }
.split-char:nth-child(9)  { transition-delay: 0.72s; }
.split-char:nth-child(10) { transition-delay: 0.76s; }
.split-char:nth-child(11) { transition-delay: 0.80s; }
.split-char:nth-child(12) { transition-delay: 0.84s; }
.split-char:nth-child(13) { transition-delay: 0.88s; }
.split-char:nth-child(14) { transition-delay: 0.92s; }
.split-char:nth-child(15) { transition-delay: 0.96s; }
.split-char:nth-child(16) { transition-delay: 1.00s; }
.split-char:nth-child(17) { transition-delay: 1.04s; }
.split-char:nth-child(18) { transition-delay: 1.08s; }
.split-char:nth-child(19) { transition-delay: 1.12s; }
.split-char:nth-child(20) { transition-delay: 1.16s; }

/* ── Parallax Depth ── */
[data-parallax] {
  will-change: transform;
}

/* ── Stats Counter Glow ── */
.stat-number {
  position: relative;
}

.stat-number::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-primary), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-item:hover .stat-number::after { opacity: 1; }

/* ── Neon Glow Text ── */
.text-neon {
  text-shadow:
    0 0 7px rgba(155,93,222,0.8),
    0 0 21px rgba(155,93,222,0.6),
    0 0 42px rgba(123,53,204,0.4),
    0 0 82px rgba(123,53,204,0.2);
}

/* ── Award-ribbon badge ── */
.award-badge {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 500;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotateBadge 20s linear infinite;
  box-shadow: var(--glow-md);
  cursor: none;
}

@keyframes rotateBadge {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Preloader with logo video ── */
.preloader-video-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid rgba(123,53,204,0.3);
  box-shadow: var(--glow-md);
}

.preloader-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.4) brightness(0.9);
}

/* ── Color-duotone filter on images ── */
.img-duotone {
  filter: sepia(20%) saturate(1.2) hue-rotate(220deg) brightness(0.85);
  transition: filter 0.6s ease;
}
.img-duotone:hover {
  filter: sepia(0%) saturate(1.1) hue-rotate(0deg) brightness(0.95);
}

/* ── Ink drip animated line ── */
.ink-line {
  width: 1px;
  background: linear-gradient(to bottom, var(--c-primary), transparent);
  animation: inkDrip 2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes inkDrip {
  0%   { transform: scaleY(0); opacity: 1; }
  60%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ── Horizontal pinned section indicator ── */
.section-progress {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  opacity: 0;
  transition: opacity 0.4s;
}

.section-progress.visible { opacity: 1; }

.section-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}

.section-dot.active {
  width: 6px;
  height: 24px;
  border-radius: 3px;
  background: var(--c-primary-2);
  box-shadow: 0 0 10px rgba(155,93,222,0.7);
}

/* ── Image zoom parallax on cards ── */
.parallax-img-wrap {
  overflow: hidden;
  border-radius: inherit;
}

.parallax-img-wrap img {
  transform: scale(1.12);
  transition: transform 0.1s linear;
}

/* ── Scroll-driven gradient background ── */
.scroll-gradient {
  background-attachment: fixed;
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Floating UI elements ── */
.float-ui {
  animation: floatUI 4s ease-in-out infinite;
}

@keyframes floatUI {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

/* ── Glass morphism card ── */
.glass-card-v2 {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── Responsive video fixes ── */
@media (max-width: 768px) {
  .hero-video {
    width: 100%;
    height: 100%;
    min-width: unset;
    min-height: unset;
    object-fit: cover;
  }
  
  .award-badge { display: none; }
  .section-progress { display: none; }
  
  .gallery-h-item {
    width: clamp(200px, 70vw, 280px);
  }
}

/* ── Preloader enhanced ── */
#preloader .preloader-logo {
  width: 200px;
  filter: drop-shadow(0 0 30px rgba(123,53,204,0.6));
}

/* ── Hero bottom ink fade ── */
.hero-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, var(--c-bg));
  z-index: 3;
  pointer-events: none;
}

/* ── Active nav pill ── */
.nav-link.active {
  color: var(--c-white);
}

/* ── Scroll progress line ── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-2), var(--c-accent));
  z-index: 2000;
  width: 0%;
  transition: width 0.05s linear;
  box-shadow: 0 0 8px rgba(155,93,222,0.7);
}

/* ── Video mosaic section ── */
.video-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
  gap: 1rem;
}

.video-mosaic-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/5;
}

.video-mosaic-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: unset;
}

.video-mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25,0.46,0.45,0.94);
  filter: saturate(0.9);
}

.video-mosaic-item:hover img {
  transform: scale(1.05);
  filter: saturate(1.1);
}

@media (max-width: 768px) {
  .video-mosaic {
    grid-template-columns: 1fr 1fr;
  }
  .video-mosaic-item:first-child {
    grid-column: span 2;
  }
}

/* ── Artist card image fix ── */
.artist-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Hero expandline keyframe ── */
@keyframes expandLine {
  0%   { width: 0; opacity: 0; }
  100% { width: 240px; opacity: 1; }
}

/* ── Hero divider element ── */
#hero-divider {
  animation: expandLine 1.2s ease 1.3s forwards !important;
  opacity: 0;
}
