/* ================================================================
   Sourav Mondal – Video Editor Portfolio
   Dark Cinematic • Glassmorphism • Smooth Animations
   ================================================================ */

/* ---------- Reset & Base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #0a0a0b;
  color: #eaeaea;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Custom Cursor ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(139, 92, 246, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  background: rgba(139, 92, 246, 0.08);
  backdrop-filter: blur(4px);
  transform: translate(-50%, -50%);
}

.cursor-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #8b5cf6;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #8b5cf6;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
}

.cursor.hovered {
  width: 70px;
  height: 70px;
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.18);
}

.cursor.hovered .cursor-label {
  opacity: 1;
}

.cursor.hidden {
  display: none !important;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.75rem;
  background: rgba(15, 15, 17, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.navbar.hide {
  transform: translateX(-50%) translateY(-120%);
}

.navbar .logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.navbar .logo span {
  color: #8b5cf6;
}

/* TEMPORARY: Hide navbar */
.navbar {
  display: none !important;
}

.nav-links {
  display: flex;
  gap: 2.2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
  transition: color 0.25s ease;
}

.nav-links a:hover {
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 1rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) contrast(1.1);
  transform: scale(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(139, 92, 246, 0.18), transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(59, 130, 246, 0.12), transparent 50%),
              linear-gradient(180deg, rgba(10,10,11,0.35), rgba(10,10,11,0.85));
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 900px;
  padding: 0 1rem;
}

.hero-name {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 0.5rem;
  display: block;
}

/* Hero animated title container – separate block below name */
.hero-title {
  text-align: center;
  min-height: 2rem;
  line-height: 2rem;
  margin-top: 0;
}

.hero-title #type-text {
  display: inline-block;
  white-space: nowrap;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #8b5cf6;
  text-transform: uppercase;
  opacity: 0.9;
  line-height: 2rem;
}

/* Center-based typewriter cursor */
.type-cursor {
  animation: blink 1s infinite;
  font-weight: 800;
  display: inline-block;
  position: relative;
  top: -0.28em;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: #a1a1aa;
  margin-bottom: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 2rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #4f46e5 100%);
  color: #fff;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

/* ---------- Floating Glassmorphism Elements ---------- */
.floating-elements {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4rem;
}

.float-item {
  position: absolute;
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45),
              inset 0 0 0 1px rgba(255, 255, 255, 0.15),
              0 0 30px rgba(139, 92, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 6s ease-in-out infinite;
  transition: transform 0.3s ease;
}

/* Add this class to any .float-item to hide its glassmorphism card background */
.float-item.no-glass {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.float-item .float-icon {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.35));
}

.float-item:nth-child(1) { top: 25%; left: 12%; animation-delay: 0s; data-speed: 1.0; }
.float-item:nth-child(2) { top: 28%; right: 12%; animation-delay: 1s; data-speed: 1.3; }
.float-item:nth-child(3) { bottom: 20%; left: 10%; animation-delay: 2s; data-speed: 0.9; }
.float-item:nth-child(4) { bottom: 30%; right: 8%; animation-delay: 0.5s; data-speed: 1.1; }
.float-item:nth-child(5) { top: 45%; right: 20%; animation-delay: 1.5s; data-speed: 0.8; }
.float-item:nth-child(6) { bottom: 45%; left: 20%; animation-delay: 2.5s; data-speed: 1.2; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(2deg); }
  66% { transform: translateY(10px) rotate(-1deg); }
}

/* Parallax movement handled by JS via data-speed */

/* ---------- Section Header ---------- */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: #a1a1aa;
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Portfolio Section ---------- */
.portfolio {
  padding: 5rem 1rem 7rem;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  max-width: 750px;
  margin: 0 auto;
  align-items: start;
}

.video-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #0f0f11;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  aspect-ratio: 9 / 16;
  display: block;
  height: auto;
  width: 100%;
  max-height: 80vh;
}

.video-card:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.15);
}

.card-media {
  position: relative;
  width: 100%;
  height: 100%;
  background: #1a1a1e;
}

.card-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}

.card-thumb.broken {
  display: none;
}

.card-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  background: #000;
}

.card-preview.visible {
  opacity: 1;
  pointer-events: auto;
}

.card-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.card-click-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  cursor: pointer;
}

.card-play {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(139,92,246,0.25) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 10;
}

.video-card:hover .card-play,
.card-preview.visible ~ .card-play {
  opacity: 1;
}

.card-play::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 14px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 2px;
}

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem;
  background: linear-gradient(to top, rgba(10,10,11,0.85), transparent);
  z-index: 10;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.8rem;
  color: #94a3b8;
}

.card-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
  border-radius: 20px;
  pointer-events: auto;
}

.card-fallback:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.35);
}

.card-fallback .fallback-icon {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

/* Mobile: single column */
@media (max-width: 900px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

@media (max-width: 640px) {
  .video-card {
    width: 100%;
    max-width: 100%;
  }
}

/* ---------- About Section ---------- */
.about {
  padding: 5rem 1rem 7rem;
  background: #0d0d0e;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-text h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.about-intro {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 1.25rem;
}

.about-approach {
  font-size: 1rem;
  color: #a1a1aa;
  margin-bottom: 1.75rem;
  line-height: 1.8;
}

.about-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
}

.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tools-list li {
  padding: 0.5rem 1.1rem;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 50px;
  font-size: 0.85rem;
  color: #c4b5fd;
  font-weight: 600;
}

/* ---------- Services Section ---------- */
.services {
  padding: 5rem 1rem 7rem;
}

.services-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
  max-width: 1000px;
  margin: 0 auto;
}

.service-card {
  flex: 0 1 auto;
  max-width: 300px;
  padding: 2.25rem 1.75rem;
  background: rgba(15, 15, 17, 0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.service-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.service-card p {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.7;
}

/* ---------- Contact Section ---------- */
.contact {
  padding: 5rem 1rem 8rem;
  background: #0d0d0e;
}

.contact-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: rgba(15, 15, 17, 0.4);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  transition: transform 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.contact-item:hover {
  transform: translateX(6px);
  border-color: rgba(139, 92, 246, 0.3);
}

.contact-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  min-width: 90px;
}

.contact-value {
  font-size: 1.1rem;
  color: #e2e8f0;
  font-weight: 500;
  transition: color 0.25s ease;
}

.contact-item:hover .contact-value {
  color: #8b5cf6;
}

.contact-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.contact-action {
  display: flex;
  justify-content: center;
}

.btn-hire {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 2.5rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #4f46e5 100%);
  color: #fff;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn-hire:hover {
  transform: translateY(-3px);
  filter: brightness(1.15);
  box-shadow: 0 16px 40px rgba(139, 92, 246, 0.5);
}

/* ---------- Video Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.modal.open {
  display: flex;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  z-index: 20;
  width: 100%;
  max-width: 90vw;
  max-height: 85vh;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  transform: scale(0.9);
  transition: transform 0.35s ease;
}

.modal.open .modal-content {
  transform: scale(1);
}

.modal-player {
  width: 100%;
  height: 100%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.modal-close:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .video-card {
    aspect-ratio: 9 / 16;
  }

  .modal-content {
    max-width: 90vw;
    max-height: 85vh;
    aspect-ratio: 9 / 16;
  }

  .contact-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .navbar {
    width: 92%;
    padding: 0.8rem 1.25rem;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 280px;
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 17, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255,255,255,0.08);
    transition: right 0.4s ease;
    gap: 0;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links li {
    margin: 1.4rem 0;
  }

  .nav-links a {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle span.active:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  .nav-toggle span.active:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle span.active:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  .floating-elements {
    padding: 2rem;
  }

  .float-item {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .float-item svg {
    width: 20px;
    height: 20px;
  }

  .hero-content {
    padding: 0 1rem;
  }
}

/* Ensure cursor does not appear on touch devices */
@media (hover: none) and (pointer: coarse) {
  .cursor {
    display: none !important;
  }
}
