/* ===== SODIUM VAPOR NOCTURNE ===== */
/* Inspired by the warm orange glow of real sodium vapor street lamps. */
/* Cinematic. Intimate. Like a poem you find folded in your coat pocket. */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Sodium vapor palette */
  --sodium: #d4871c;
  --sodium-bright: #e8a040;
  --sodium-dim: #a06210;
  --sodium-glow: rgba(212, 135, 28, 0.15);
  --sodium-glow-strong: rgba(212, 135, 28, 0.35);

  /* Night sky */
  --void: #06060c;
  --night: #0a0a14;
  --dusk: #12121e;
  --steel: #4a6680;
  --ash: #2a2a38;

  /* Text */
  --text-bright: #f0e6d8;
  --text-mid: #b8a898;
  --text-dim: #6a5f54;
  --text-ghost: #3a3530;

  /* Spacing */
  --sp-xs: 0.5rem;
  --sp-sm: 1rem;
  --sp-md: 2rem;
  --sp-lg: 3rem;
  --sp-xl: 5rem;
  --sp-2xl: 8rem;

  /* Sidebar */
  --sidebar-width: 80px;

  /* Type */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
}

/* Day Mode */
:root.day-mode {
  --sodium: #b87a1a;
  --sodium-bright: #c9892a;
  --sodium-dim: #9a6812;
  --sodium-glow: rgba(184, 122, 26, 0.08);
  --sodium-glow-strong: rgba(184, 122, 26, 0.2);

  --void: #f2ede6;
  --night: #f7f3ee;
  --dusk: #ebe5dc;
  --steel: #8a9aaa;
  --ash: #d8d2ca;

  --text-bright: #1a1510;
  --text-mid: #4a4238;
  --text-dim: #8a8078;
  --text-ghost: #c8c0b8;
}

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*:focus { outline: none; }

html {
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }

body {
  font-family: var(--font-display);
  background: var(--void);
  color: var(--text-bright);
  overflow: hidden;
  height: 100vh;
  line-height: 1.6;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-font-smoothing: antialiased;
}
body::-webkit-scrollbar { display: none; }

a, button, video, img, input, textarea, select {
  outline: none !important;
  border: none;
}

/* ===== FILM GRAIN OVERLAY ===== */
.film-grain {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  mix-blend-mode: overlay;
}

:root.day-mode .film-grain {
  opacity: 0.02;
}

/* ===== THEME SWITCHER ===== */
.theme-switcher {
  position: fixed;
  top: var(--sp-md);
  right: var(--sp-md);
  z-index: 1000;
}

.theme-toggle {
  background: rgba(212, 135, 28, 0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 135, 28, 0.15);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  transition: all 0.4s var(--ease-out-expo);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: rgba(212, 135, 28, 0.12);
  border-color: var(--sodium);
  box-shadow: 0 0 30px var(--sodium-glow);
  transform: scale(1.05);
}

.theme-icon {
  font-size: 18px;
  transition: all 0.5s var(--ease-out-expo);
  position: absolute;
}

.sun-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.moon-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

:root.day-mode .sun-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

:root.day-mode .moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

:root.day-mode .theme-toggle {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

:root.day-mode .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* ===== MOBILE MENU ===== */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: var(--sp-md);
  left: var(--sp-md);
  z-index: 1000;
  background: transparent;
  border: 1px solid var(--text-ghost);
  border-radius: 4px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-expo);
}

.mobile-menu-toggle:hover {
  border-color: var(--sodium);
}

.hamburger-line {
  width: 18px;
  height: 1px;
  background: var(--text-mid);
  margin: 4px 0;
  transition: all 0.3s var(--ease-out-expo);
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.nav-item {
  display: block;
  text-decoration: none;
  color: var(--text-ghost);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  padding-left: 16px;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 1px;
  background: var(--sodium);
  transition: width 0.4s var(--ease-out-expo);
  transform: translateY(-50%);
}

.nav-item:hover {
  color: var(--text-mid);
}

.nav-item:hover::before {
  width: 8px;
}

.nav-item.active {
  color: var(--sodium);
}

.nav-item.active::before {
  width: 8px;
  background: var(--sodium);
}

.nav-number {
  font-variant-numeric: tabular-nums;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  height: 100vh;
  overflow: hidden;
  background: var(--void);
}

/* ===== PAGE STRUCTURE ===== */
.page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* ===== LANDING PAGE ===== */
.landing-page {
  background: var(--void);
  position: relative;
}

/* Subtle ambient glow from below */
.landing-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('images/main-street-lamp.png');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  opacity: 0.6;
  z-index: 1;
  animation: breathe 6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 60px rgba(212, 135, 28, 0.3));
}

.landing-page::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--void) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

@keyframes breathe {
  0% {
    opacity: 0.5;
    filter: drop-shadow(0 0 40px rgba(212, 135, 28, 0.2));
  }
  100% {
    opacity: 0.7;
    filter: drop-shadow(0 0 80px rgba(212, 135, 28, 0.4));
  }
}

.landing-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  padding: var(--sp-xl) var(--sp-lg);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 100vh;
  padding-bottom: var(--sp-2xl);
}

.landing-left {
  flex: 1;
}

.landing-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--sodium-dim);
  display: block;
  margin-bottom: var(--sp-sm);
  margin-left: 4px;
}

.main-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 300;
  font-style: normal;
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  text-shadow: 0 0 120px var(--sodium-glow-strong);
}

.landing-right {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-lg);
  padding-bottom: 0.5rem;
}

.landing-epigraph {
  border-left: 1px solid var(--sodium-dim);
  padding-left: var(--sp-md);
}

.subtitle {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.5;
  margin-bottom: 0;
}

.subtitle-secondary {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: var(--sp-xs);
}

.explore-btn {
  background: transparent;
  border: 1px solid var(--sodium-dim);
  color: var(--sodium);
  padding: 14px 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.5s var(--ease-out-expo);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.explore-btn:hover {
  background: var(--sodium);
  color: var(--void);
  border-color: var(--sodium);
  box-shadow: 0 0 40px var(--sodium-glow-strong);
}

.explore-arrow {
  font-size: 16px;
  transition: transform 0.4s var(--ease-out-expo);
}

.explore-btn:hover .explore-arrow {
  transform: translateY(4px);
}

/* ===== LAMP PAGES ===== */
.lamp-page {
  background: var(--void);
  position: relative;
}

/* Subtle ambient vignette */
.lamp-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    transparent 0%,
    var(--void) 100%
  );
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}

.lamp-content {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
  padding: var(--sp-md);
}

/* Alternate layout: text on left, media on right */
.lamp-page--reverse .lamp-content {
  flex-direction: row-reverse;
}

.lamp-media-side {
  flex: 0 0 auto;
  position: relative;
}

.lamp-text-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.lamp-number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--sodium-dim);
  opacity: 0.6;
}

.lamp-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text-bright);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.lamp-location {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: var(--sp-xs);
}

.lamp-story {
  margin-top: var(--sp-md);
  position: relative;
  padding-left: var(--sp-md);
}

.lamp-story::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--sodium-dim);
  opacity: 0.4;
}

.lamp-story p {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.6;
  font-style: italic;
}

/* ===== VIDEO COMPONENTS ===== */
.lamp-video-container {
  position: relative;
  width: 340px;
  height: 600px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--night);
  transition: all 0.6s var(--ease-out-expo);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 80px var(--sodium-glow);
}

.lamp-video-container:hover {
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6),
              0 0 100px var(--sodium-glow-strong);
  transform: translateY(-4px);
}

.lamp-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.6s var(--ease-out-expo);
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--night);
  color: var(--text-ghost);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.fix-it-btn {
  position: absolute;
  bottom: var(--sp-sm);
  right: var(--sp-sm);
  background: rgba(212, 135, 28, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 135, 28, 0.2);
  border-radius: 2px;
  padding: 8px 16px;
  color: var(--sodium);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s var(--ease-out-expo);
  z-index: 10;
}

.fix-it-btn:hover {
  background: rgba(212, 135, 28, 0.2);
  border-color: var(--sodium);
  box-shadow: 0 0 20px var(--sodium-glow);
}

.fix-it-btn:active {
  transform: scale(0.97);
}

:root.day-mode .fix-it-btn {
  display: none;
}

/* ===== PHOTO COMPONENTS ===== */
.lamp-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 340px;
  height: 280px;
}

.photo-half {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  background: var(--night);
  transition: all 0.5s var(--ease-out-expo);
}

.photo-half:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.lamp-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.6s var(--ease-out-expo);
}

.photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--night);
  color: var(--text-ghost);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
}

/* ===== DAY/NIGHT MODE VISIBILITY ===== */
:root.day-mode .lamp-video-container {
  display: none;
}

:root.day-mode .lamp-story {
  display: none;
}

:root.day-mode .photo-half:has(img[alt*="on"]) {
  display: none;
}

:root.day-mode .photo-half:first-child {
  display: none;
}

:root.day-mode .lamp-photos {
  grid-template-columns: 1fr;
  width: 340px;
  height: 600px;
}

:root.day-mode .photo-half:last-child {
  display: block;
}

:root:not(.day-mode) .lamp-video-container {
  display: block;
}

:root:not(.day-mode) .lamp-photos {
  display: none;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 12, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s var(--ease-out-expo);
  backdrop-filter: blur(20px);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s;
}

.lightbox-close:hover {
  color: var(--sodium);
}

/* ===== SWIPE HINT ===== */
.swipe-hint-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 12, 0.9);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.swipe-hint-overlay.show {
  display: flex;
}

.swipe-hint-content {
  text-align: center;
  padding: var(--sp-lg);
  background: var(--dusk);
  border: 1px solid var(--text-ghost);
  border-radius: 2px;
  max-width: 280px;
}

.swipe-animation {
  position: relative;
  height: 60px;
  margin-bottom: var(--sp-md);
  overflow: hidden;
}

.swipe-finger {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--sodium);
  border-radius: 50%;
  top: 50%;
  left: 20%;
  transform: translateY(-50%);
  animation: swipeGesture 2.5s var(--ease-in-out) infinite;
}

.swipe-trail {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sodium-dim), transparent);
  top: 50%;
  left: 20%;
  right: 20%;
  transform: translateY(-50%);
  opacity: 0.4;
  animation: swipeTrail 2.5s var(--ease-in-out) infinite;
}

.swipe-text {
  color: var(--text-mid);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: var(--sp-md);
}

.swipe-hint-close {
  background: var(--sodium);
  color: var(--void);
  border: none;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 0;
}

.swipe-hint-close:hover {
  background: var(--sodium-bright);
}

@keyframes swipeGesture {
  0%, 100% { left: 20%; opacity: 1; }
  50% { left: 70%; opacity: 0.6; }
}

@keyframes swipeTrail {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.4; }
}

/* ===== PAGE ENTRANCE ANIMATIONS ===== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Landing page staggered entrance */
.landing-label {
  animation: fadeSlideUp 1s var(--ease-out-expo) 0.2s both;
}

.main-title {
  animation: fadeSlideUp 1.2s var(--ease-out-expo) 0.4s both;
}

.landing-epigraph {
  animation: fadeSlideUp 1s var(--ease-out-expo) 0.8s both;
}

.explore-btn {
  animation: fadeSlideUp 0.8s var(--ease-out-expo) 1.2s both;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .landing-content {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: var(--sp-lg);
    padding-bottom: var(--sp-xl);
    gap: var(--sp-lg);
  }

  .landing-right {
    flex: 0 0 auto;
  }

  .lamp-content {
    flex-direction: column !important;
    align-items: center;
    text-align: center;
    gap: var(--sp-lg);
  }

  .lamp-text-side {
    align-items: center;
  }

  .lamp-story {
    padding-left: 0;
    border-left: none;
  }

  .lamp-story::before {
    display: none;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(6, 6, 12, 0.8);
    backdrop-filter: blur(12px);
    border-color: var(--text-ghost);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    top: 70px;
    left: var(--sp-md);
    transform: translateX(-120%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s var(--ease-out-expo);
    background: rgba(6, 6, 12, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 2px;
    padding: var(--sp-lg);
    border: 1px solid var(--text-ghost);
  }

  .sidebar.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .main-title {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .lamp-video-container,
  .lamp-photos {
    width: 280px;
    height: 480px;
  }

  :root.day-mode .lamp-photos {
    width: 280px;
    height: 480px;
  }

  .lamp-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .landing-content {
    padding: var(--sp-md);
    padding-bottom: var(--sp-lg);
  }

  .landing-right {
    flex: 0 0 auto;
    width: 100%;
  }

  .lamp-video-container,
  .lamp-photos {
    width: 240px;
    height: 400px;
  }

  :root.day-mode .lamp-photos {
    width: 240px;
    height: 400px;
  }

  .lamp-title {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }
}

/* ===== SCROLLBAR KILL ===== */
::-webkit-scrollbar { display: none; }
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
