/* ================================
   PORTFOLIO - DESIGN SYSTEM
   ================================ */

/* CSS Variables */
:root {
  /* Colors - Dark Theme */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-card-hover: #1a1a1a;

  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;

  --accent: #ffffff;
  --accent-subtle: rgba(255, 255, 255, 0.1);

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', var(--font-main);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

img,
video {
  max-width: 100%;
  display: block;
}

/* ================================
   TYPOGRAPHY
   ================================ */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.25rem;
}

.text-muted {
  color: var(--text-secondary);
}

.text-small {
  font-size: 0.875rem;
}

/* ================================
   LAYOUT
   ================================ */

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ================================
   NAVIGATION
   ================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  background: linear-gradient(to bottom, var(--bg-primary), transparent);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

/* ================================
   HERO SECTION
   ================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Video Background */
.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video placeholder when no video */
.hero-video-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Gaussian Blur Gradient Overlay - Smooth multi-layer */
.hero-video-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  mask: linear-gradient(to right,
      black 0%,
      rgba(0, 0, 0, 0.8) 35%,
      rgba(0, 0, 0, 0.4) 55%,
      transparent 75%);
  -webkit-mask: linear-gradient(to right,
      black 0%,
      rgba(0, 0, 0, 0.8) 35%,
      rgba(0, 0, 0, 0.4) 55%,
      transparent 75%);
}

/* Second blur layer - stronger blur that extends into black area */
.hero-video-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  mask: linear-gradient(to right,
      black 0%,
      rgba(0, 0, 0, 0.9) 20%,
      rgba(0, 0, 0, 0.5) 35%,
      transparent 50%);
  -webkit-mask: linear-gradient(to right,
      black 0%,
      rgba(0, 0, 0, 0.9) 20%,
      rgba(0, 0, 0, 0.5) 35%,
      transparent 50%);
}

/* Dark overlay that merges with blur - very gradual fade */
.hero-blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  z-index: 3;
  background: linear-gradient(to right,
      rgba(10, 10, 10, 0.95) 0%,
      rgba(10, 10, 10, 0.85) 30%,
      rgba(10, 10, 10, 0.6) 50%,
      rgba(10, 10, 10, 0.3) 70%,
      transparent 100%);
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 10;
  max-width: 600px;
  padding-left: var(--space-lg);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-sm);
}

.hero-title {
  margin-bottom: var(--space-md);
}

.hero-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: var(--space-xl);
  max-width: 480px;
}

/* ================================
   BUTTONS
   ================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--accent-subtle);
  border-color: var(--border-hover);
}

.btn-icon {
  transition: transform var(--transition-fast);
}

.btn:hover .btn-icon {
  transform: translateX(4px);
}

/* ================================
   PROJECTS SECTION
   ================================ */

.projects-section {
  padding: var(--space-2xl) 0;
  background: var(--bg-primary);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.section-title {
  color: var(--text-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

/* Project Card */
.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-8px) scale(1.05);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 255, 255, 0.05);
}

.project-thumbnail {
  aspect-ratio: 16/10;
  background: var(--bg-secondary);
  overflow: hidden;
  position: relative;
}

/* Overlay gradient on hover */
.project-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      transparent 0%,
      transparent 50%,
      rgba(0, 0, 0, 0.6) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.project-card:hover .project-thumbnail::after {
  opacity: 1;
}

.project-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-thumbnail img {
  transform: scale(1.1);
}

/* Placeholder for project thumbnails */
.project-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all var(--transition-base);
}

.project-card:hover .project-thumbnail-placeholder {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #1a1a1a 100%);
  color: var(--text-secondary);
  transform: scale(1.05);
}

.project-card:hover .project-thumbnail-placeholder span {
  transform: scale(1.15);
}

.project-thumbnail-placeholder span {
  transition: transform var(--transition-base);
}

.project-info {
  padding: var(--space-md);
}

.project-category {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.project-title {
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ================================
   PROJECTS SLIDER
   ================================ */

.projects-slider {
  position: relative;
}

.slider-container {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: var(--radius-lg);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
}

.slider-container::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.slider-track {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-sm);
}

.slider-card {
  flex: 0 0 calc(50% - var(--space-lg) / 2);
  min-width: calc(50% - var(--space-lg) / 2);
  scroll-snap-align: start;
  cursor: default;
  /* No click on homepage slider */
}

.slider-card:hover {
  transform: none;
  /* No hover animation on homepage slider */
}

/* Slider Responsive */
@media (max-width: 768px) {
  .slider-card {
    flex: 0 0 85%;
    min-width: 85%;
  }
}

/* ================================
   PROJECTS PAGE
   ================================ */

.page-header {
  padding-top: 120px;
  padding-bottom: var(--space-xl);
}

.page-title {
  margin-bottom: var(--space-sm);
}

.page-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
}

.projects-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: var(--space-lg);
  padding-bottom: var(--space-2xl);
}

/* ================================
   FOOTER
   ================================ */

.footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

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

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1024px) {

  /* Make video fullscreen on tablets */
  .hero-video-container {
    width: 100%;
  }

  .hero-content {
    max-width: 500px;
  }

  /* Stronger blur overlay for better text readability */
  .hero-blur-overlay {
    width: 65%;
    background: linear-gradient(to right,
        rgba(10, 10, 10, 0.98) 0%,
        rgba(10, 10, 10, 0.9) 40%,
        rgba(10, 10, 10, 0.7) 60%,
        rgba(10, 10, 10, 0.4) 80%,
        transparent 100%);
  }
}

/* Desktop video visible, mobile hidden */
.hero-video-desktop {
  display: block;
}

.hero-video-mobile {
  display: none;
}

@media (max-width: 768px) {

  /* Swap videos on mobile */
  .hero-video-desktop {
    display: none;
  }

  .hero-video-mobile {
    display: block;
  }

  /* Keep EXACT same layout as desktop */
  .hero {
    min-height: 100vh;
    padding-top: 60px;
  }

  .hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  /* Keep same left-to-right blur as desktop */
  .hero-video-container::before {
    mask: linear-gradient(to right,
        black 0%,
        rgba(0, 0, 0, 0.8) 35%,
        rgba(0, 0, 0, 0.4) 55%,
        transparent 75%);
    -webkit-mask: linear-gradient(to right,
        black 0%,
        rgba(0, 0, 0, 0.8) 35%,
        rgba(0, 0, 0, 0.4) 55%,
        transparent 75%);
  }

  .hero-video-container::after {
    mask: linear-gradient(to right,
        black 0%,
        rgba(0, 0, 0, 0.9) 20%,
        rgba(0, 0, 0, 0.5) 35%,
        transparent 50%);
    -webkit-mask: linear-gradient(to right,
        black 0%,
        rgba(0, 0, 0, 0.9) 20%,
        rgba(0, 0, 0, 0.5) 35%,
        transparent 50%);
  }

  /* Keep same left-side dark overlay */
  .hero-blur-overlay {
    display: block;
    width: 55%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(to right,
        rgba(10, 10, 10, 0.95) 0%,
        rgba(10, 10, 10, 0.85) 30%,
        rgba(10, 10, 10, 0.6) 50%,
        rgba(10, 10, 10, 0.3) 70%,
        transparent 100%);
  }

  /* Content stays on left like desktop */
  .hero-content {
    position: relative;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    max-width: 55%;
    text-align: left;
  }

  .hero-description {
    max-width: 100%;
    font-size: 0.95rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .nav-links {
    gap: var(--space-md);
  }

  .projects-page-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }

  h1 {
    font-size: 2rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}