* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000000;
  color: #ffffff;
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Static Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Photo Card Container */
.photo-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 1536; /* Maintain 2:3 ratio */
  cursor: pointer;
  perspective: 1000px; /* Enable 3D space */
}

/* 3D Inner Wrapper */
.photo-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.photo-card.flipped .photo-card-inner {
  transform: rotateY(180deg);
}

/* Front & Back Faces */
.photo-card-front, .photo-card-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: transparent;
  border: none;
  overflow: hidden;
  border-radius: 0;
}

.photo-card-back {
  transform: rotateY(180deg);
}

.photo-card:hover .photo-card-front,
.photo-card:hover .photo-card-back {
  /* removed box shadow */
}

/* Hover effects removed */
.photo-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.4s ease;
  filter: grayscale(0.2) brightness(0.6);
  border-radius: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.maximize-btn {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0.7;
  transition: all 0.2s ease;
  padding: 0;
}

.maximize-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.maximize-btn svg {
  width: 18px;
  height: 18px;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
}

.modal-overlay.active {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  opacity: 1;
  pointer-events: all;
}

/* Modal Content EXACTLY like index copy.html */
.modal-content {
  position: relative;
  display: flex;
  flex-direction: row;
  width: 90vw;
  max-width: 1200px;
  height: 85vh;
  transform: scale(0.95) translateY(20px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  
  /* Premium Card Look from index copy.html - WITH NO RADIUS */
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0; /* Zero radius per request */
  padding: 2rem;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Left Side - 3D Card */
.modal-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 2rem;
}

.card-3d {
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1024 / 1536;
  perspective: 1500px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.card-3d.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 0; /* Zero radius per request */
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  background: #111;
}

.card-back {
  transform: rotateY(180deg);
}

.card-front img, .card-back img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  position: relative;
  border-radius: 0; /* Zero radius per request */
}

.click-hint {
  margin-top: 2rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.2rem;
  animation: pulse 2s infinite;
  text-transform: uppercase;
}

@keyframes pulse {
  0% { opacity: 0.3; }
  50% { opacity: 0.8; }
  100% { opacity: 0.3; }
}

/* Right Side - Typewriter Text */
.modal-right {
  flex: 1;
  padding: 2rem 1.5rem 2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.08); /* clean separator */
}

/* Custom Scrollbar for right side */
.modal-right::-webkit-scrollbar {
  width: 4px;
}
.modal-right::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0;
}
.modal-right::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0;
}
.modal-right::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.typewriter-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  color: #ffffff;
  font-weight: 600;
  line-height: 1.2;
}

.card-desc {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 300;
  white-space: pre-wrap;
}

/* Close Button matching index copy.html */
.modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 0; /* Zero radius per request */
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1001;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-close svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Fallback texts for images */
.fallback-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #666;
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 2rem;
  width: 100%;
  z-index: 1;
}

/* Responsive */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }
  .photo-card {
    max-width: 320px;
    margin: 0 auto;
  }
}

/* Responsive Mobile - Modal */
@media (max-width: 768px) {
  .modal-content {
    flex-direction: column;
    height: 90vh;
    padding: 1.5rem;
  }
  
  .modal-left {
    flex: 0 0 auto;
    padding: 0 0 1.5rem 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  .card-3d {
    max-width: 180px;
  }
  
  .modal-right {
    flex: 1;
    padding: 1.5rem 0 0 0;
    align-items: flex-start;
    border-left: none;
  }
  
  .card-title {
    font-size: 1.5rem;
  }
  
  .card-desc {
    font-size: 1.1rem;
  }
  
  .click-hint {
    margin-top: 1rem;
    font-size: 0.9rem;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }
}
