@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  
  --bg-color: #030308;
  --text-primary: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --text-dim: rgba(255, 255, 255, 0.4);
  
  --color-accent: #00e5ff; /* Cyan */
  --color-purple: #bd00ff; /* Purple */
  
  --transition-smooth: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: all 0.25s ease;
}

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

html {
  background-color: var(--bg-color);
  scroll-behavior: smooth;
}

body {
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: transparent;
  overflow-x: hidden;
}

/* Background Canvas */
#galaxy-canvas {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(circle at center, #070718 0%, #030308 100%);
}

#nebula-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  background: 
    radial-gradient(circle at 20% 15%, rgba(189, 0, 255, 0.03) 0%, transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(0, 229, 255, 0.02) 0%, transparent 55%);
  filter: blur(50px);
}

/* Container */
.gallery-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* Navigation Bar */
.gallery-nav {
  padding: 1rem 0;
  margin-bottom: 2.5rem;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: var(--transition-fast);
}

.back-link svg {
  fill: currentColor;
  transition: var(--transition-fast);
}

.back-link:hover {
  color: var(--color-accent);
}

.back-link:hover svg {
  transform: translateX(-4px);
}

/* Header */
.gallery-header {
  text-align: center;
  margin-bottom: 5rem;
}

.gallery-header h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2.5rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 40%, rgba(255, 255, 255, 0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.gallery-header .subtitle {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-purple);
  text-shadow: 0 0 10px rgba(189, 0, 255, 0.3);
}

/* Loading & Error States */
.loading-state, .error-state {
  text-align: center;
  font-family: var(--font-display);
  color: var(--text-dim);
  font-size: 1.1rem;
  padding: 3rem;
}

/* Gallery Grid Layout */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 4rem 2rem;
  justify-items: center;
  width: 100%;
  padding: 3rem 0;
}

/* Gallery Item */
.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
  transition: var(--transition-smooth);
}

/* Hover state: clean 2D scaling */
.gallery-item:hover {
  transform: scale(1.05);
  z-index: 10;
}

/* 3D Curved Rectangular Screens */
.sphere-wrapper {
  position: relative;
  width: 310px;
  height: 190px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  /* Glowing outer ring */
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 8px 30px rgba(0, 0, 0, 0.8);
  transition: var(--transition-smooth);
}

.sphere-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  transition: var(--transition-smooth);
  filter: brightness(0.85);
}

/* Glass Screen Lens Overlay (Curved monitor reflection) */
.sphere-lens {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 14px;
  /* Glass glare sweep in top left, dark vignetting at screen edges */
  background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.07) 0%, rgba(0, 0, 0, 0.72) 75%, rgba(0, 0, 0, 0.9) 100%);
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.9),
    inset 4px 4px 15px rgba(255, 255, 255, 0.06);
  z-index: 10;
  pointer-events: none;
  transition: var(--transition-smooth);
}

/* Hover Animations */
.gallery-item:hover .sphere-wrapper {
  transform: scale(1.04);
  /* Intense cobalt/purple lens flare glow */
  box-shadow: 
    0 0 0 1px rgba(0, 229, 255, 0.25),
    0 15px 40px rgba(0, 0, 0, 0.9),
    0 0 30px rgba(0, 229, 255, 0.15);
}

.gallery-item:hover .sphere-image {
  transform: scale(1.12);
  filter: brightness(1.05);
}

.gallery-item:hover .sphere-lens {
  /* Let screen art shine through clearly, highlight glare reflection */
  background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.18) 0%, rgba(0, 0, 0, 0.25) 75%, rgba(0, 0, 0, 0.5) 100%);
  box-shadow: 
    inset 0 0 15px rgba(0, 0, 0, 0.6),
    inset 2px 2px 10px rgba(255, 255, 255, 0.1);
}

/* Alternating glows for items */
.gallery-item:nth-child(even):hover .sphere-wrapper {
  box-shadow: 
    0 0 0 1px rgba(189, 0, 255, 0.25),
    0 15px 40px rgba(0, 0, 0, 0.9),
    0 0 30px rgba(189, 0, 255, 0.15);
}

/* Lightbox Fullscreen Overlay Styling */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 3, 8, 0.93);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 1px rgba(255, 255, 255, 0.1);
  object-fit: contain;
}

.lightbox-caption {
  text-align: center;
  max-width: 600px;
  color: #fff;
}

.lightbox-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: #fff;
}

.lightbox-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Lightbox Close Button */
.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 1010;
}

.lightbox-close svg {
  fill: currentColor;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gallery-header h1 {
    font-size: 1.8rem;
  }
  
  .gallery-grid {
    gap: 3rem 2rem;
  }
  
  .sphere-wrapper {
    width: 200px;
    height: 200px;
  }
  
  .lightbox-title {
    font-size: 1.3rem;
  }
  
  .lightbox-desc {
    font-size: 0.85rem;
  }
  
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
}

/* Footer styling */
.gallery-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-align: center;
  padding: 3rem 1.5rem 1rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  margin-top: 4rem;
}

.footer-mail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  text-decoration: none;
}

.footer-mail-link svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.footer-mail-link:hover {
  color: var(--color-accent);
  transform: translateY(-3px) scale(1.15);
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6));
}
