/* ===================================== */
/* PORTFOLIO SECTION STYLING            */
/* ===================================== */

#portfolio-section {
  padding-top: 0px;
  min-height: 100vh;
}

.portfolio-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 60px;
}

.portfolio-title {
  font-family: 'Ysabeau Infant', sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: white;
  text-align: center;
  margin-bottom: 80px;
  letter-spacing: 3px;
  text-shadow: 
      0px 0px 10px rgba(0, 0, 0, 1),
      0px 0px 15px rgba(0, 0, 0, 0.8),
      2px 2px 4px rgba(0, 0, 0, 0.9);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 40px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  isolation: isolate;
  transform: translateZ(0);
}

/* ===================================== */
/* LOCKED EFFECT - GRAY/WHITE OVERLAY   */
/* ===================================== */
.portfolio-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Changed to solid dark overlay instead of backdrop-filter */
  background: 
      linear-gradient(135deg, 
          rgba(24, 24, 24, 0.6) 0%, 
          rgba(51, 51, 51, 0.7) 25%,
          rgba(18, 18, 18, 0.65) 50%,
          rgba(50, 50, 50, 0.7) 75%,
          rgba(32, 32, 32, 0.6) 100%
      ),
      rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(15px); 
  display: flex;
  align-items: center;
  justify-content: center;
  transition: none;  /* ← CHANGED from 0.4s ease to none */
}

/* Hover effect - also remove backdrop-filter */
.portfolio-block.locked:hover .portfolio-lock-overlay {
  background: 
      linear-gradient(135deg, 
          rgba(100, 100, 100, 0.65) 0%, 
          rgba(110, 110, 110, 0.75) 25%,
          rgba(120, 120, 120, 0.7) 50%,
          rgba(105, 105, 105, 0.75) 75%,
          rgba(100, 100, 100, 0.65) 100%
      ),
      rgba(90, 90, 90, 0.55);
  transition: background 0.4s ease;  /* ← Only transition background, not all */
}

/* ===================================== */
/* PORTFOLIO BLOCK - BASE STYLING       */
/* ===================================== */

.portfolio-block {
  /* Visual Styling (from Rule #1) */
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(167, 162, 162, 0.415);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.675);
  
  /* 3D Animation Properties (from Rule #2) */
  transform-style: preserve-3d;
  backface-visibility: hidden;
  
  /* Initial Hidden State (from Rule #2) */
  opacity: 0;
  transform: 
      perspective(1000px)
      translateZ(300px)
      translateY(-50px)
      rotateX(-15deg)
      rotateY(8deg)
      scale(0.8);
  
  /* NO transitions initially (from Rule #2) */
  transition: none;
}

.portfolio-block:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* ===================================== */
/* SLEEK DIAGONAL SHINE EFFECT          */
/* ===================================== */

/* Shine overlay - always in resting position */
.portfolio-block::after {
  content: '';
  position: absolute;
  top: -15%;
  left: -30%; /* ← STARTS at resting position, not off-screen */
  width: 40%;
  height: 130%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0.1) 80%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(20deg);
  pointer-events: none;
  opacity: 0.4; /* ← STARTS visible */
  filter: blur(8px);
  z-index: 3;
  transition: none;
  /* NO transition here - only on hover */
}

/* Shine sweeps across on hover */
.portfolio-block:hover::after {
  left: 110%;
  opacity: 0.7;
  transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Ensure shine stays above lock overlay but below content */
.portfolio-lock-overlay {
  z-index: 5;
}

.lock-content {
  z-index: 15;
  position: relative;
}

/* ===================================== */
/* GLASSY FROSTED OVERLAY               */
/* ===================================== */

/* Glass overlay - NO BACKDROP FILTER */
.portfolio-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.25) 0%,        /* ← DARKENED - was rgba(255,255,255,...) */
    rgba(0, 0, 0, 0.3) 25%,        /* ← DARKENED */
    rgba(0, 0, 0, 0.35) 50%,       /* ← DARKENED */
    rgba(0, 0, 0, 0.3) 75%,        /* ← DARKENED */
    rgba(0, 0, 0, 0.25) 100%       /* ← DARKENED */
  );
  backdrop-filter: blur(2px) saturate(120%); 
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  transition: none;
}
/* Enhance glass effect on hover */
.portfolio-block:hover::before {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.12) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.12) 75%,
    rgba(255, 255, 255, 0.18) 100%
  );
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(3px) saturate(130%);
}

/* Add subtle inner shadow for depth */
.portfolio-block {
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.675),
    inset 0 1px 2px rgba(255, 255, 255, 0.1);
}
/* ===================================== */
/* LOCKED EFFECT - THUMBNAIL IMAGE      */
/* ===================================== */

.portfolio-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* MAXIMUM BLUR - Completely imperceptible */
  filter: blur(30px) grayscale(100%) brightness(0.5);
  opacity: 0.3;
  transition: all 0.4s ease;
}

/* On hover, slightly reduce blur but still keep it locked */
.portfolio-block.locked:hover .portfolio-thumbnail {
  filter: blur(25px) grayscale(100%) brightness(0.6);
  opacity: 0.4;
}


/* ===================================== */
/* LOCK ICON & CONTENT                  */
/* ===================================== */

.lock-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
  position: relative;
}

.lock-icon {
  font-size: 3rem;
  color: rgba(85, 94, 88, 0.665);
  text-shadow: 
      0px 0px 15px rgba(2, 37, 9, 0.546),
      0px 0px 20px rgba(8, 62, 24, 0.431),
      2px 2px 6px rgba(0, 0, 0, 0.9);
  transition: all 0.4s ease;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

.project-number {
  font-family: 'Ysabeau Infant', sans-serif;
  font-size: 1.5rem;
  font-weight: 200;
  color: rgba(255, 255, 255, 0.5);
  text-shadow: 
      0px 0px 10px rgba(0, 0, 0, 1),
      0px 0px 15px rgba(0, 0, 0, 0.8);
  transition: all 0.4s ease;
}

/* Hover effects for lock content */
.portfolio-block.locked:hover .lock-icon {
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
}

.portfolio-block.locked:hover .project-number {
  color: rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

/* ===================================== */
/* LOCKED STATE MESSAGE (OPTIONAL)      */
/* ===================================== */

/* Add a subtle "LOCKED" text below the icon */
.lock-content::after {
  content: 'LOCKED';
  font-family: 'Ysabeau Infant', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
  text-shadow: 
      0px 0px 8px rgba(0, 0, 0, 1),
      0px 0px 12px rgba(0, 0, 0, 0.8);
  margin-top: -10px;
}

.portfolio-block.locked:hover .lock-content::after {
  color: rgba(255, 255, 255, 0.7);
}

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

@media (max-width: 1024px) {
  .portfolio-container {
      padding: 40px 40px;
  }
  
  .portfolio-grid {
      gap: 30px;
  }
  
  .lock-icon {
      font-size: 2.5rem;
  }
  
  .project-number {
      font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .portfolio-title {
      font-size: 2rem;
      margin-bottom: 60px;
  }
  
  .portfolio-grid {
      grid-template-columns: repeat(2, 1fr);
      grid-template-rows: repeat(3, 1fr);
      gap: 25px;
  }
  
  .lock-icon {
      font-size: 2rem;
  }
  
  .project-number {
      font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .portfolio-container {
      padding: 40px 20px;
  }
  
  .portfolio-title {
      font-size: 1.8rem;
      letter-spacing: 2px;
  }
  
  .portfolio-grid {
      grid-template-columns: 1fr;
      grid-template-rows: repeat(6, 1fr);
      gap: 20px;
  }
  
  .lock-icon {
      font-size: 1.8rem;
  }
  
  .project-number {
      font-size: 1.5rem;
  }
}

/* ===================================== */
/* UNLOCK MODAL SYSTEM                  */
/* ===================================== */

/* Modal Overlay - Darkens the entire screen */
.unlock-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.unlock-modal.active {
  display: flex;
}

@keyframes fadeIn {
  from {
      opacity: 0;
  }
  to {
      opacity: 1;
  }
}

/* Modal Content Box */
.unlock-modal-content {
  background: linear-gradient(145deg, 
      rgba(30, 30, 35, 0.95) 0%,
      rgba(20, 20, 25, 0.98) 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 40px;
  max-width: 450px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
      transform: translateY(30px);
      opacity: 0;
  }
  to {
      transform: translateY(0);
      opacity: 1;
  }
}

/* Close Button */
.unlock-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 2rem;
  cursor: pointer;
  padding: 5px 10px;
  line-height: 1;
  transition: all 0.3s ease;
}

.unlock-close:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: rotate(90deg);
}

/* Modal Header */
.unlock-header {
  text-align: center;
  margin-bottom: 30px;
}

.unlock-modal-icon {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 15px;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.unlock-modal-title {
  font-family: 'Ysabeau Infant', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: white;
  letter-spacing: 2px;
  margin: 10px 0;
  text-shadow: 
      0px 0px 10px rgba(0, 0, 0, 1),
      0px 0px 15px rgba(0, 0, 0, 0.8);
}

.unlock-modal-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 5px 0 0 0;
  text-shadow: 0px 0px 8px rgba(0, 0, 0, 1);
}

/* Input Container */
.unlock-input-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 15px;
}

.unlock-input {
  width: 100%;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  outline: none;
}

.unlock-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 1px;
}

.unlock-input:focus {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Submit Button */
.unlock-submit-btn {
  width: 100%;
  padding: 15px 20px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  color: white;
  font-family: 'Ysabeau Infant', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.unlock-submit-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.unlock-submit-btn:active {
  transform: translateY(0);
}

/* Error Message */
.unlock-error-message {
  min-height: 24px;
  color: #ff6b6b;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  text-align: center;
  text-shadow: 0px 0px 8px rgba(0, 0, 0, 1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.unlock-error-message.show {
  opacity: 1;
}

/* Success Animation */
@keyframes successPulse {
  0%, 100% {
      transform: scale(1);
  }
  50% {
      transform: scale(1.05);
  }
}

.unlock-success {
  animation: successPulse 0.6s ease;
}

/* Responsive Design */
@media (max-width: 480px) {
  .unlock-modal-content {
      padding: 30px 25px;
  }
  
  .unlock-modal-title {
      font-size: 1.2rem;
      letter-spacing: 1px;
  }
  
  .unlock-modal-icon {
      font-size: 2.5rem;
  }
  
  .unlock-input {
      font-size: 1rem;
      padding: 12px 15px;
  }
  
  .unlock-submit-btn {
      font-size: 1rem;
      padding: 12px 15px;
  }
}

/* ===================================== */
/* UNLOCKED STATE STYLING               */
/* ===================================== */

/* Remove locked class styling when unlocked */
.portfolio-block.unlocked .portfolio-thumbnail {
  filter: none !important;
  opacity: 1 !important;
  transition: all 0.4s ease;
}

.portfolio-block.unlocked .portfolio-lock-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* Unlocked blocks are clickable links */
.portfolio-block.unlocked {
  cursor: pointer;
  position: relative;
}


.portfolio-block.unlocked:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
}

.portfolio-block.unlocked:hover .portfolio-thumbnail {
  filter: brightness(1.1);
  transform: scale(1.05);
}

/* Add a subtle overlay on hover to show it's clickable */
.portfolio-block.unlocked::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 12px;
}

.portfolio-block.unlocked:hover::before {
  opacity: 1;
}

/* Active/clicking state */
.portfolio-block.unlocked:active {
  transform: translateY(-5px);
}

/* ===================================== */
/* 3D FALLING ENTRANCE ANIMATION        */
/* ===================================== */


/* Animation keyframes - Simple fall and land */
@keyframes portfolioFallIn {
  0% {
      opacity: 0;
      transform: 
          perspective(1000px)
          translateZ(300px)
          translateY(-50px)
          rotateX(-15deg)
          rotateY(8deg)
          scale(0.8);
  }
  
  100% {
      opacity: 1;
      transform: 
          perspective(1000px)
          translateZ(0px)
          translateY(0px)
          rotateX(0deg)
          rotateY(0deg)
          scale(1);
  }
}

/* Active state - apply animation */
.portfolio-block.animate-in {
  animation: portfolioFallIn 1.6s forwards;
  /* Use hardware acceleration for smooth animation */
  will-change: transform, opacity;
}

/* After animation completes, restore normal transitions */
.portfolio-block.animation-complete {
  opacity: 1;
  transform: perspective(1000px) translateZ(0px) translateY(0px) rotateX(0deg) rotateY(0deg) scale(1);
  transition: all 0.4s ease;
}

/* Grid container needs perspective */
.portfolio-grid {
  perspective: 1500px;
  perspective-origin: center center;
}