/* ============================================
   MOONCAKE STUDIO — Additional Features
   Showreel, transitions, enhanced cards
   ============================================ */

/* --- SHOWREEL SECTION --- */
.showreel {
  padding: 4rem 0 2rem;
  background: var(--bg-primary);
}

.showreel-wrapper {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.showreel-video-container {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  cursor: pointer;
}

.showreel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.showreel-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: rgba(10, 10, 10, 0.4);
  opacity: 1;
  transition: opacity 0.5s ease, background 0.5s ease;
  cursor: pointer;
  z-index: 2;
}

.showreel-overlay.playing {
  opacity: 0;
  pointer-events: none;
}

.showreel-overlay:hover {
  background: rgba(10, 10, 10, 0.3);
}

.showreel-play {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.3s;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.showreel-play:hover {
  transform: scale(1.15);
  color: var(--accent);
}

.showreel-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  pointer-events: all;
  cursor: pointer;
}

/* Showreel border glow */
.showreel-wrapper::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 40%, transparent 60%, var(--accent));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 1;
  opacity: 0.5;
}

/* --- PAGE TRANSITION --- */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 10001;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.7, 0, 0.3, 1);
  pointer-events: none;
}

.page-transition.active {
  transform: scaleX(1);
}

/* --- ENHANCED PROJECT CARDS --- */
.project-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.project-card-image {
  overflow: hidden;
}

.project-card .project-placeholder,
.project-card img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-placeholder,
.project-card:hover .project-card-image img {
  transform: scale(1.08);
}

/* --- PROJECT TAGS --- */
.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.project-tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-muted);
}

/* --- HORIZONTAL SCROLL PROJECTS (alternative layout) --- */
.projects-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0 2rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.projects-scroll::-webkit-scrollbar {
  display: none;
}

.projects-scroll .project-card {
  flex: 0 0 350px;
  scroll-snap-align: start;
}

/* --- FLOATING CTA --- */
.floating-cta {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.floating-cta.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.floating-cta .btn {
  box-shadow: 0 8px 30px rgba(211, 133, 100, 0.4);
  padding: 0.75rem 1.5rem;
}

/* --- PROCESS / PIPELINE VISUAL --- */
.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 2rem 0;
  overflow-x: auto;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  position: relative;
}

.pipeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -1rem;
  top: 50%;
  width: 2rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.3;
}

.pipeline-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: relative;
}

.pipeline-dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s;
}

.pipeline-step:hover .pipeline-dot::after {
  opacity: 1;
}

.pipeline-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- NAV ACTIVE STATE --- */
.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  width: 100%;
}

/* --- SMOOTH SCROLL PERFORMANCE --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --- AI SECTION --- */
.ai-section {
  background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(200, 145, 155, 0.06) 50%, var(--bg-primary) 100%);
  position: relative;
  overflow: hidden;
}

.ai-section::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(200, 145, 155, 0.06), transparent 70%);
  pointer-events: none;
}

.ai-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 4rem;
  align-items: center;
}

.ai-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.ai-feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.ai-feature-icon {
  color: var(--accent);
  font-size: 1rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.ai-feature strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.ai-feature p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.6;
}

.ai-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ai-graphic:hover .ai-particles-canvas {
  pointer-events: all;
}

.ai-graphic {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.ai-orbit {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-core {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  z-index: 2;
  text-shadow: 0 0 30px rgba(200, 145, 155, 0.4), 0 0 60px rgba(200, 145, 155, 0.15);
}

.ai-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  animation: spin 20s linear infinite;
}

.ai-ring-2 {
  inset: 20px;
  border-style: dashed;
  animation-direction: reverse;
  animation-duration: 15s;
}

.ai-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(200, 145, 155, 0.5);
}

.ai-dot-1 { top: 0; left: 50%; transform: translateX(-50%); }
.ai-dot-2 { bottom: 15%; right: 5%; }
.ai-dot-3 { bottom: 15%; left: 5%; }

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

.ai-labels {
  display: flex;
  gap: 1.5rem;
}

.ai-labels span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 50px;
}

/* Project card images */
.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 1024px) {
  .ai-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .ai-visual {
    order: -1;
  }
}

@media (max-width: 768px) {
  .ai-orbit {
    width: 160px;
    height: 160px;
  }
}

/* --- RESPONSIVE SHOWREEL --- */
@media (max-width: 768px) {
  .showreel {
    padding: 2rem 0 1rem;
  }

  .showreel-play svg {
    width: 56px;
    height: 56px;
  }

  .floating-cta {
    bottom: 1rem;
    right: 1rem;
  }
}

/* --- SCROLL TO TOP BUTTON --- */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(12, 10, 14, 0.85);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s, border-color 0.3s, background 0.3s;
  pointer-events: none;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.scroll-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(200, 145, 155, 0.1);
}

/* --- CREATIVE POLISH: Gradient line separators --- */
.section + .section::before {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 0 auto 0;
  opacity: 0.4;
}

/* --- CREATIVE POLISH: Section tag styling upgrade --- */
.section-tag {
  position: relative;
  display: inline-block;
}

.section-tag::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.7;
}

/* --- CREATIVE POLISH: Project card overlay gradient upgrade --- */
.project-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover::after {
  opacity: 0.6;
}

@media (max-width: 768px) {
  .scroll-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* ============================================
   PROJECT FILTERS
   ============================================ */
.project-filters {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.55rem 1.4rem;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}

/* Hidden project cards during filter */
.project-card.filter-hidden {
  display: none;
}

/* --- COMMERCIALS PLACEHOLDER --- */
.commercials-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-card);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.commercials-placeholder:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.commercials-placeholder span {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================
   CLIENTS LOGO GRID
   ============================================ */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 2rem;
  align-items: center;
  justify-items: center;
  max-width: 820px;
  margin: 0 auto;
}

.client-logo-img {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  opacity: 0.6;
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.client-logo-img:hover {
  opacity: 1;
  transform: scale(1.08);
}

.client-logo-img img {
  max-width: 100%;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

@media (max-width: 768px) {
  .clients-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .client-logo-img img {
    max-width: 100px;
    max-height: 50px;
  }
}

@media (max-width: 480px) {
  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* ============================================
   IP DEVELOPMENT SECTION
   ============================================ */
.ip-dev {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(200, 145, 155, 0.04) 50%, var(--bg-secondary) 100%);
  overflow: hidden;
}

.ip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.ip-services {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.ip-service-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.ip-service-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.ip-service-num {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  min-width: 2rem;
}

.ip-service-item strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.ip-service-item p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 768px) {
  .ip-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ============================================
   VIDEO LIGHTBOX (Showreel Player)
   ============================================ */
.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.video-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.vl-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 3;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.3s, transform 0.3s;
}

.vl-close:hover {
  opacity: 1;
  transform: scale(1.2);
}

.vl-wrapper {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
}

.vl-wrapper video {
  width: 100%;
  display: block;
  background: black;
}

.vl-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
}

.vl-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.2s;
}

.vl-btn:hover {
  opacity: 1;
  color: var(--accent);
}

/* Play/Pause icon toggle */
.vl-play-pause .vl-icon-pause { display: none; }
.video-lightbox.playing .vl-play-pause .vl-icon-play { display: none; }
.video-lightbox.playing .vl-play-pause .vl-icon-pause { display: block; }

/* Mute icon toggle */
.vl-mute .vl-icon-muted { display: none; }
.video-lightbox.muted .vl-mute .vl-icon-vol { display: none; }
.video-lightbox.muted .vl-mute .vl-icon-muted { display: block; }

.vl-progress {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.vl-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.vl-progress:hover .vl-progress-bar {
  background: var(--accent-light);
}

.vl-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 85px;
}

/* Fullscreen icon toggle */
.vl-fullscreen .vl-icon-compress { display: none; }
.video-lightbox.fullscreen .vl-fullscreen .vl-icon-expand { display: none; }
.video-lightbox.fullscreen .vl-fullscreen .vl-icon-compress { display: block; }

.video-lightbox.fullscreen .vl-wrapper {
  width: 100%;
  max-width: none;
  border-radius: 0;
}

.vl-volume {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.vl-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.vl-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .vl-wrapper {
    width: 100vw;
    border-radius: 0;
  }
  .vl-volume {
    display: none;
  }
  .vl-time {
    min-width: auto;
  }
}

/* ============================================
   SECTION CANVAS — Interactive background effects
   ============================================ */
.section-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
