/* ==========================================================================
   JUSTPICS // JOURNEY SERIES
   Cinematic, Immersive, Editorial Aesthetic
   Inspired by deep atmospheric storytelling and fluid navigation
   ========================================================================== */

:root {
  /* Default Ambient Base */
  --color-bg-base: #050608;
  --color-bg-gradient: linear-gradient(180deg, #050608 0%, #0a0e14 100%);
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.6);
  --color-accent: #f5c044;

  --font-display: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;

  --motion-slow: 1.2s cubic-bezier(0.2, 0, 0, 1);
  --motion-standard: 0.6s cubic-bezier(0.2, 0, 0, 1);
}

/* --------------------------------------------------------------------------
   Atmospheric Shifts
   -------------------------------------------------------------------------- */
body[data-ambience="rainy-night"] {
  --color-bg-base: #05080f;
  --color-bg-gradient: linear-gradient(180deg, #020305 0%, #0b1320 100%);
  --color-accent: #7bb5fa;
}

body[data-ambience="summer-night"] {
  --color-bg-base: #0d0602;
  --color-bg-gradient: linear-gradient(180deg, #050201 0%, #1a0e05 100%);
  --color-accent: #f5a944;
}

body[data-ambience="winter-storm"] {
  --color-bg-base: #080a0c;
  --color-bg-gradient: linear-gradient(180deg, #030405 0%, #11151a 100%);
  --color-accent: #b3d4ff;
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--color-bg-gradient);
  background-attachment: fixed;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 2s ease-in-out;
  -webkit-font-smoothing: antialiased;
}

/* Cinematic Background Layers */
#ambient-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

.film-grain {
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background-image: url('data:image/svg+xml;utf8,%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.08"/%3E%3C/svg%3E');
  pointer-events: none;
  z-index: 1;
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  30% { transform: translate(3%, -15%); }
  50% { transform: translate(12%, 9%); }
  70% { transform: translate(9%, 4%); }
  90% { transform: translate(-1%, 7%); }
}

.vignette-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ==========================================================================
   Floating HUD (Heads-Up Display)
   ========================================================================== */
.floating-hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 100;
  pointer-events: none; /* Let clicks pass through empty areas */
}
.floating-hud > * { pointer-events: auto; } /* Re-enable for children */

@media (max-width: 768px) {
  .floating-hud { padding: 1.5rem; flex-wrap: wrap; gap: 1rem; }
  .hud-center { order: 3; width: 100%; display: flex; justify-content: center; }
}

/* Brand */
.brand-logo {
  display: flex; flex-direction: column; align-items: flex-start;
  text-decoration: none; color: #fff; gap: 0.5rem;
}
.brand-logo svg { width: 32px; height: 32px; transition: transform var(--motion-slow); }
.brand-logo:hover svg { transform: rotate(90deg); }
.brand-text {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
}

/* Atmosphere Selector */
.atmosphere-selector {
  display: flex; align-items: center; gap: 1.5rem;
}
.atmos-btn {
  background: none; border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 400;
  letter-spacing: 0.15em; text-transform: uppercase;
  cursor: pointer; transition: color var(--motion-standard);
  position: relative; padding: 0.5rem 0;
}
.atmos-btn::after {
  content: ''; position: absolute; bottom: 0; left: 50%;
  width: 0; height: 1px; background: var(--color-accent);
  transition: all var(--motion-standard); transform: translateX(-50%);
}
.atmos-btn:hover { color: #fff; }
.atmos-btn.active { color: #fff; }
.atmos-btn.active::after { width: 100%; }

/* Right Controls */
.hud-right { display: flex; align-items: center; gap: 2rem; }

.audio-controls { display: flex; align-items: center; gap: 0.75rem; }

.hud-icon-btn {
  background: none; border: none; color: var(--color-text-secondary);
  cursor: pointer; transition: color var(--motion-standard);
  display: flex; align-items: center; justify-content: center;
}
.hud-icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.hud-icon-btn:hover, .hud-icon-btn.active { color: var(--color-accent); }

.volume-slider {
  -webkit-appearance: none;
  width: 60px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
.audio-controls:hover .volume-slider {
  opacity: 1; pointer-events: auto;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.volume-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }

.hud-text-btn {
  background: none; border: none; color: #fff;
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; position: relative;
}
.hud-text-btn::before {
  content: ''; position: absolute; left: -1rem; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--color-accent);
  opacity: 0; transition: opacity var(--motion-standard);
}
.hud-text-btn:hover::before { opacity: 1; }

/* ==========================================================================
   Full-Viewport Hero
   ========================================================================== */
.cinematic-hero {
  height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative; z-index: 10;
  text-align: center;
}

.hero-content {
  perspective: 1000px;
}

.hero-kicker {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 300;
  letter-spacing: 0.4em; text-transform: uppercase; color: var(--color-accent);
  margin-bottom: 2rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 400; line-height: 0.9;
  text-transform: uppercase; letter-spacing: -0.02em;
  margin-bottom: 3rem;
  text-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.hero-description {
  font-family: var(--font-body); font-size: 1rem; font-weight: 300;
  color: var(--color-text-secondary);
  max-width: 400px; margin: 0 auto; line-height: 1.8;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute; bottom: 3rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.scroll-line {
  width: 1px; height: 60px; background: rgba(255,255,255,0.2); position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: ''; position: absolute; top: -50%; left: 0; width: 100%; height: 50%;
  background: var(--color-accent);
  animation: scrollDrop 2.5s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}
@keyframes scrollDrop {
  0% { top: -50%; }
  100% { top: 100%; }
}

/* ==========================================================================
   Chapter / Exploration Nav
   ========================================================================== */
.chapter-nav {
  position: fixed; left: 3rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 1.5rem; z-index: 90;
}
@media (max-width: 1200px) {
  .chapter-nav { display: none; } /* Hide on smaller screens, rely on scrolling */
}
.chapter-link {
  background: none; border: none; text-align: left;
  font-family: var(--font-body); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(255,255,255,0.3); cursor: pointer; transition: all var(--motion-standard);
  display: flex; align-items: center; gap: 1rem;
}
.chapter-link::before {
  content: ''; width: 0; height: 1px; background: var(--color-accent);
  transition: width var(--motion-standard);
}
.chapter-link:hover, .chapter-link.active { color: #fff; }
.chapter-link.active::before { width: 24px; }

/* ==========================================================================
   Editorial Canvas (Gallery)
   ========================================================================== */
.editorial-canvas {
  position: relative; z-index: 10;
  max-width: 1600px; margin: 0 auto;
  padding: 10vh 2rem 20vh 2rem;
  display: flex; flex-direction: column; gap: 15vh;
}
@media (min-width: 1200px) {
  .editorial-canvas { padding-left: 18rem; /* Make room for chapter nav */ }
}

/* Asymmetric Image Blocks */
.editorial-plate {
  position: relative;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(60px);
  transition: opacity 1.2s cubic-bezier(0.2, 0, 0, 1), transform 1.2s cubic-bezier(0.2, 0, 0, 1);
}
.editorial-plate.in-view {
  opacity: 1; transform: translateY(0);
}

/* Layout Variations injected by JS */
.layout-center { width: 80%; margin: 0 auto; align-items: center; text-align: center; }
.layout-left { width: 65%; margin-right: auto; align-items: flex-start; }
.layout-right { width: 65%; margin-left: auto; align-items: flex-end; text-align: right; }
.layout-full { width: 100%; }

.plate-media {
  position: relative; width: 100%; overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  cursor: pointer;
}
.plate-img {
  width: 100%; height: auto; display: block;
  transform: scale(1.1); /* Extra scale for parallax */
  transition: transform 0.8s cubic-bezier(0.2, 0, 0, 1);
}
.plate-media:hover .plate-img { transform: scale(1.15); }

/* Editorial Captions */
.plate-caption {
  margin-top: 2.5rem; max-width: 480px;
}
.plate-meta {
  font-family: var(--font-body); font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-accent);
  margin-bottom: 1rem; display: block;
}
.plate-title {
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 400;
  margin-bottom: 1rem; line-height: 1.1;
}
.plate-desc {
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 300;
  color: var(--color-text-secondary); line-height: 1.8;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.cinematic-footer {
  text-align: center; padding: 4rem 2rem 6rem 2rem;
  font-family: var(--font-body); font-size: 0.75rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.2); position: relative; z-index: 10;
}

/* ==========================================================================
   Cinematic Lightbox (Pure focus mode)
   ========================================================================== */
.lightbox-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--motion-standard);
}
.lightbox-modal.active { opacity: 1; pointer-events: auto; }

.lightbox-close-btn {
  position: absolute; top: 3rem; right: 3rem;
  background: none; border: none; color: #fff; opacity: 0.5;
  width: 44px; height: 44px; cursor: pointer; z-index: 1010;
  transition: all var(--motion-standard);
}
.lightbox-close-btn:hover { opacity: 1; transform: scale(1.1); }
.lightbox-close-btn svg { width: 24px; height: 24px; fill: currentColor; }

.lightbox-stage {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}

/* Invisible nav zones */
.lightbox-nav-zone {
  position: absolute; top: 0; bottom: 0; width: 25vw; z-index: 1005; cursor: pointer;
}
.lightbox-nav-zone.left { left: 0; }
.lightbox-nav-zone.right { right: 0; }

.lightbox-img-wrapper {
  max-width: 90vw; max-height: 90vh;
  z-index: 1002; position: relative;
}
.lightbox-image {
  max-width: 100%; max-height: 90vh; object-fit: contain;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8); display: block;
}

.lightbox-metadata {
  position: absolute; bottom: 3rem; left: 3rem; max-width: 400px;
  z-index: 1010; pointer-events: none; opacity: 0.7; transition: opacity var(--motion-standard);
}
.lightbox-stage:hover ~ .lightbox-metadata { opacity: 1; }
.lightbox-title { font-family: var(--font-display); font-size: 2rem; font-weight: 400; margin-bottom: 0.5rem; }
.lightbox-desc { font-family: var(--font-body); font-size: 0.85rem; color: rgba(255,255,255,0.7); line-height: 1.6; margin-bottom: 1rem; }
.lightbox-exif-data { font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--color-accent); text-transform: uppercase; }

/* ==========================================================================
   Prologue (About Overlay)
   ========================================================================== */
.about-overlay {
  border: none; background: transparent;
  max-width: 100vw; max-height: 100vh; width: 100%; height: 100%;
  margin: 0; padding: 0;
}
.about-overlay::backdrop {
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.about-overlay[open] { animation: modalFadeIn 0.8s var(--motion-slow) forwards; }

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

.about-overlay-inner {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 2rem; color: #fff;
}
.about-close-btn {
  position: absolute; top: 3rem; right: 3rem;
  background: none; border: none; color: #fff; opacity: 0.5;
  width: 44px; height: 44px; cursor: pointer; transition: all 0.2s ease;
}
.about-close-btn:hover { opacity: 1; transform: scale(1.1); }
.about-close-btn svg { width: 24px; height: 24px; fill: currentColor; }

.about-content { max-width: 600px; text-align: center; }
.about-kicker { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--color-accent); margin-bottom: 1.5rem; }
.about-title { font-family: var(--font-display); font-size: clamp(3rem, 6vw, 4.5rem); font-weight: 300; line-height: 1.1; margin-bottom: 2.5rem; }
.about-body p { font-size: 1.1rem; line-height: 1.9; color: rgba(255,255,255,0.6); margin-bottom: 1.5rem; font-weight: 300; }

/* ==========================================================================
   Toast Notice
   ========================================================================== */
.toast-notice {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #fff; color: #000;
  padding: 0.75rem 1.5rem; border-radius: 4px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: all 0.4s cubic-bezier(0.2, 0, 0, 1);
  z-index: 2000;
}
.toast-notice.show { opacity: 1; transform: translateX(-50%) translateY(0); }
