:root {
  --bg-color: #0f1115;
  --text-color: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --primary-accent: #f5b041;
  --primary-hover: #e09e3a;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Crossfading System */
.hero-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: #000;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s ease-in-out, transform 8s ease-out;
  transform: scale(1.05);
}

.hero-bg.active {
  opacity: 1;
  transform: scale(1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);
  z-index: 1;
}

/* --- Cinematic Hero Layout --- */
.hero-layout {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  height: 100vh;
  padding: 0 4rem;
  overflow: hidden;
}

/* Left Content */
.hero-left {
  flex: 0 0 45%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-subtitle::before {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background-color: white;
}

.hero-title {
  font-family: 'Oswald', sans-serif;
  font-size: 6rem;
  font-weight: 700;
  line-height: 0.95;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  text-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: block !important;
  background: none;
  -webkit-text-fill-color: white;
}

.hero-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.7;
  max-width: 400px;
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.gold-btn {
  background-color: var(--primary-accent);
  color: #000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: var(--transition);
}

.gold-btn:hover { background: var(--primary-hover); }

.gold-btn svg {
  fill: currentColor;
}

.outline-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}

.outline-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

/* Right Carousel */
.hero-right {
  flex: 0 0 50%;
  height: 100vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 8rem;
  min-width: 0; /* Prevents flexbox blowout */
}

.carousel-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2rem 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.hero-card {
  flex: 0 0 240px;
  height: 340px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  scroll-snap-align: center;
  cursor: pointer;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: brightness(0.6);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  background: linear-gradient(135deg, #1f2937, #000000);
}

.hero-card.active {
  transform: scale(1.1) translateY(-10px);
  filter: brightness(1);
  z-index: 2;
}

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

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.card-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-label::before {
  content: '';
  display: block;
  width: 10px;
  height: 1px;
  background: white;
}

.card-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.4rem;
  text-transform: uppercase;
  line-height: 1.1;
  margin-top: 0.25rem;
}

/* Bottom Controls */
.hero-bottom-controls {
  position: absolute;
  bottom: 3rem;
  left: 4rem;
  right: 4rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  z-index: 20;
}

.arrows {
  display: flex;
  gap: 1rem;
}

.nav-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: white;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.nav-arrow:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

.progress-bar {
  flex-grow: 1;
  height: 2px;
  background: rgba(255,255,255,0.2);
  position: relative;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--primary-accent);
  width: 0%;
  transition: width 0.3s ease;
}

.active-index-display {
  font-family: 'Oswald', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.content-wrapper {
  padding: 2rem 2rem 5rem 2rem; /* Extra bottom padding for bottom nav */
}

.folders-grid {
  display: none;
}

/* Glassmorphism Utilities */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.hidden {
  display: none !important;
}

/* Top Navigation (Globe Express Style) */
.hero-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 2rem 4rem;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 1rem;
}

.brand-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
}

.top-nav {
  display: flex;
  gap: 2.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.top-nav a {
  color: white;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.3s;
  position: relative;
}

.top-nav a:hover {
  opacity: 1;
}

.top-nav a.active {
  opacity: 1;
}

.top-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-accent);
}

.header-actions {
  display: flex;
  gap: 1.5rem;
}

/* ==========================================
   BOTTOM NAVIGATION BAR (Inside Albums)
   ========================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(15, 17, 21, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  /* Safe area for phones with gesture bars */
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  transition: all 0.25s ease;
  font-size: 0.65rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.bottom-nav-btn:hover {
  color: var(--primary-accent);
  background: rgba(255, 255, 255, 0.06);
}

.bottom-nav-btn:active {
  transform: scale(0.92);
}

.bottom-nav-btn svg {
  width: 22px;
  height: 22px;
  transition: transform 0.25s ease;
}

.bottom-nav-btn:hover svg {
  transform: translateY(-1px);
}

.bottom-nav-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: 50%;
}

.bottom-nav-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bottom-nav-count {
  font-size: 0.7rem;
  color: var(--primary-accent);
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Buttons */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--glass-border);
  transform: scale(1.05);
}

.btn.primary {
  background: var(--primary-accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-family);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 1rem;
}

.btn.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.modal-content h2 {
  margin-bottom: 1rem;
}

.modal-content p {
  color: #9ca3af;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.input-group {
  margin-bottom: 1rem;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #d1d5db;
}

.input-group input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: white;
  font-family: var(--font-family);
  outline: none;
  transition: var(--transition);
}

.input-group input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Main Container */
#app-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* Doors Grid (Folders) */
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 10px 30px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.05);
}

.folder-card::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  pointer-events: none;
}

.folder-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: 8px;
  mix-blend-mode: overlay;
}

.folder-card:hover {
  transform: scale(1.05) rotateY(-15deg);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 20px 20px 40px rgba(0,0,0,0.4);
}

.folder-card:active {
  transform: scale(1.05) rotateY(-40deg);
}

.door-knob {
  position: absolute;
  right: 20px;
  top: 50%;
  width: 16px;
  height: 16px;
  background: radial-gradient(circle at 30% 30%, #fff, #9ca3af);
  border-radius: 50%;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
  transform: translateY(-50%);
}

.door-icon {
  width: 64px;
  height: 64px;
  color: var(--primary-accent);
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
  transition: var(--transition);
}

.folder-card:hover .door-icon {
  transform: translateY(-50px);
  color: #fff;
}

.folder-name {
  font-weight: 600;
  font-size: 1.2rem;
  text-align: center;
  word-break: break-word;
  padding: 0 1.5rem;
  color: #e2e8f0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  z-index: 2;
}

.folder-subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Images Grid (Photos) - Masonry Layout */
.gallery-grid {
  column-count: 2; /* Mobile default */
  column-gap: 1rem;
  width: 100%;
}

@media (min-width: 600px) {
  .gallery-grid {
    column-count: 3;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    column-count: 4;
  }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  background: #1a1c23;
  cursor: pointer;
  border-radius: 8px; /* Adds a nice touch to masonry */
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

@media (hover: none) {
  .gallery-item:hover img {
    transform: none; /* Disable hover scale on touch devices */
  }
}

/* Swipe (Cover Flow) Layout */
.swipe-container {
  width: 100vw;
  height: calc(100vh - 140px); /* Space for bottom nav */
  margin-left: calc(-50vw + 50%); /* Full bleed breakout from constrained parent */
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.swipe-track {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 50vw; /* Ensures first/last items can reach center */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
  height: 100%;
}

.swipe-track::-webkit-scrollbar {
  display: none;
}

.swipe-item {
  flex: 0 0 auto;
  height: 65vh; /* Fixed height, width scales by aspect-ratio */
  max-width: 85vw; /* Prevent panoramas from breaking screen */
  scroll-snap-align: center;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  transform: scale(0.85);
  filter: brightness(0.4) saturate(0.8);
  cursor: pointer;
  background: #1a1c23;
}

.swipe-item.active {
  transform: scale(1.05);
  filter: brightness(1) saturate(1.1);
  z-index: 10;
  box-shadow: 0 30px 60px rgba(0,0,0,0.8);
}

.swipe-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.swipe-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.5);
  pointer-events: none;
  animation: pulse 2s infinite;
}

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

/* Lightbox (Full Screen Viewer) */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.lightbox.hidden {
  opacity: 0;
  pointer-events: none;
}

/* UI Elements inside Lightbox */
.lightbox-ui {
  transition: opacity 0.3s ease;
}

.lightbox.ui-hidden .lightbox-ui {
  opacity: 0;
  pointer-events: none;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.8s ease; /* Smoother fade for slideshow */
}

.lightbox img.fade-out {
  opacity: 0;
}

@keyframes kenburns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.15) translate(-1%, 1%); }
}

.lightbox img.slideshow-active {
  animation: kenburns 15s ease-out infinite alternate;
}

.close-btn {
  position: absolute;
  top: 1rem;
  left: 1rem; /* iOS back style */
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  font-size: 1.2rem;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
}

.nav-btn:hover, .close-btn:hover {
  background: rgba(50, 50, 50, 0.8);
}

.nav-btn.prev {
  left: 1rem;
}

.nav-btn.next {
  right: 1rem;
}

/* Hide side arrows on mobile screens */
@media (max-width: 768px) {
  .nav-btn {
    display: none;
  }
}

.lightbox-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 1rem;
  text-align: center;
  color: white;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10;
}

.slideshow-toggle {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1010;
  background: rgba(15, 17, 21, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 14px;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow-toggle:hover {
  background: rgba(255,255,255,0.15);
  transform: translateX(-50%) scale(1.1);
}

.slideshow-toggle svg {
  width: 20px;
  height: 20px;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  justify-content: center;
  margin: 4rem 0;
}

/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */
@media (max-width: 768px) {
  /* Header & Nav */
  .hero-header {
    padding: 1rem 1.5rem;
  }
  .header-container {
    flex-wrap: nowrap;
    gap: 1rem;
  }
  .brand-logo {
    height: 32px;
  }
  .top-nav {
    display: none; /* Hide quick links on very small screens, use carousel */
  }
  
  /* Hero Layout */
  .hero-layout {
    flex-direction: column;
    padding: 5rem 1.5rem 1rem 1.5rem; /* 5rem top padding to clear header */
    height: 100vh;
    height: 100dvh; /* Adapts to mobile browser UI */
    justify-content: flex-start;
  }
  
  .hero-left {
    flex: none;
    width: 100%;
    height: auto; /* Override desktop 100vh */
    padding-top: 0;
    text-align: left;
    display: block; /* Override desktop flex center */
    margin-bottom: 2rem;
  }
  
  .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  .hero-title {
    font-size: 3.2rem; /* Prevent clipping */
    margin-bottom: 1rem;
    line-height: 1.1;
  }
  
  .hero-desc {
    display: none; /* Hide description on mobile to save space */
  }
  
  .hero-actions {
    gap: 1rem;
  }
  
  /* Carousel */
  .hero-right {
    flex: 1; /* Take up remaining space */
    width: 100%;
    height: auto; /* Override desktop 100vh */
    align-items: center;
    padding-bottom: 4rem; /* Space for absolute bottom controls */
  }
  
  .carousel-track {
    padding: 1rem 0;
    width: 100%;
  }
  
  .hero-card {
    flex: 0 0 160px; /* Scaled down for mobile */
    height: 230px;
  }
  
  .hero-card.active {
    transform: scale(1.05) translateY(-5px);
  }
  
  /* Bottom Controls */
  .hero-bottom-controls {
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    gap: 0.5rem;
  }
  
  .active-index-display {
    font-size: 1.5rem;
  }
  
  .nav-arrow {
    width: 36px;
    height: 36px;
  }
  
  /* Gallery padding - account for bottom nav bar */
  .content-wrapper {
    padding: 1rem 1rem 5rem 1rem;
  }
}


.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  border-top-color: var(--primary-accent);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: #9ca3af;
}
