/* ============================================
   Valentines — For Vienna

   Color Journey (sunset → evening):
     Early:   #f6f2e5 cream bg, #e07843 sunset orange
     Middle:  #d4a574 warm dusk, #8b6f5e muted earth
     Late:    #3d4f6a twilight blue
     End:     #1e2d45 deep evening blue
   ============================================ */

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  background: #f6f2e5;
  color: #3e3832;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Screens
   ============================================ */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  z-index: 0;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* ============================================
   Password Gate
   ============================================ */

#password-gate {
  background: #f6f2e5;
}

.password-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.password-prompt {
  font-size: 1.25rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #3e3832;
  opacity: 0;
  animation: fadeIn 1.2s ease 0.3s forwards;
}

.password-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeIn 1.2s ease 0.8s forwards;
}

#password-input {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  padding: 0.6rem 1rem;
  border: 1.5px solid #d4cfc4;
  border-radius: 0;
  background: transparent;
  color: #3e3832;
  width: 220px;
  outline: none;
  transition: border-color 0.3s ease;
}

#password-input:focus {
  border-color: #e07843;
}

#password-input::placeholder {
  color: #b8b2a6;
  font-style: italic;
}

#password-submit {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid #d4cfc4;
  background: transparent;
  color: #3e3832;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

#password-submit:hover {
  border-color: #e07843;
  color: #e07843;
}

.password-error {
  font-size: 0.9rem;
  font-style: italic;
  color: #c97a5a;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.password-error.visible {
  opacity: 1;
}

/* ============================================
   Landing Page
   ============================================ */

#landing {
  background: #f6f2e5;
  cursor: pointer;
  padding-bottom: 80px; /* match slideshow garden clearance */
}

#wind-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.landing-card {
  position: relative;
  z-index: 2;
  width: min(380px, 80vw);
  aspect-ratio: 3 / 5;
  background: linear-gradient(145deg, #e07843, #f0a06a);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  box-shadow:
    0 20px 60px rgba(224, 120, 67, 0.15),
    0 4px 20px rgba(224, 120, 67, 0.08);
}

.landing-text {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 300;
  font-style: italic;
  color: #faf8f2;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 1.6s ease 0.5s forwards;
}

.landing-subtitle {
  font-size: 0.9rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(250, 248, 242, 0.6);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  opacity: 0;
  animation: fadeIn 1.2s ease 2s forwards;
}

/* ============================================
   Slideshow
   ============================================ */

#slideshow {
  background: #f6f2e5;
  transition: background-color 0.6s ease, opacity 0.8s ease, visibility 0.8s ease;
  flex-direction: column;
  padding-bottom: 80px; /* clearance for hydrangea garden */
}

#stars-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.slide-container {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
}

/* --- Slide --- */

.slide {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

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

/* --- Photo Card (matches landing card proportions) --- */

.slide-card {
  width: min(380px, 80vw);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 16px 50px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.6s ease;
}

.slide-photo-wrapper {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #3e3832;
  position: relative;
}

.slide-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Tap zones — left half goes back, right half goes forward */

.photo-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 2;
  cursor: pointer;
}

.photo-tap-left {
  left: 0;
}

.photo-tap-right {
  right: 0;
}

.slide-message-wrapper {
  padding: 1.25rem 1.5rem;
  transition: background-color 0.6s ease, color 0.6s ease;
}

.slide-message {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

/* --- Text-only cards --- */

.slide-card-text {
  width: min(380px, 80vw);
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 16px 50px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.06);
  transition: background-color 0.6s ease, color 0.6s ease, box-shadow 0.6s ease;
}

.text-card-inner {
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.text-card-message {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.8;
  letter-spacing: 0.03em;
  text-align: center;
}

/* --- Hydrangea garden --- */

#hydrangea-canvas {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  pointer-events: none;
  z-index: 15;
}

/* ============================================
   Slideshow Navigation
   ============================================ */

.slideshow-nav {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.75rem 1rem 0;
  width: min(380px, 80vw);
}

.nav-btn {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(62, 56, 50, 0.2);
  border-radius: 50%;
  background: transparent;
  color: rgba(62, 56, 50, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.4s ease, color 0.4s ease, opacity 0.4s ease;
  flex-shrink: 0;
}

.nav-btn:hover {
  border-color: rgba(62, 56, 50, 0.5);
  color: rgba(62, 56, 50, 0.8);
}

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

/* Progress bar */

.progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(62, 56, 50, 0.12);
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(62, 56, 50, 0.4);
  border-radius: 1px;
  transition: width 0.35s ease;
}

/* ============================================
   Dark theme overrides (applied via JS)
   ============================================ */

#slideshow.theme-dark .nav-btn {
  border-color: rgba(246, 242, 229, 0.2);
  color: rgba(246, 242, 229, 0.5);
}

#slideshow.theme-dark .nav-btn:hover {
  border-color: rgba(246, 242, 229, 0.5);
  color: rgba(246, 242, 229, 0.8);
}

#slideshow.theme-dark .progress-bar {
  background: rgba(246, 242, 229, 0.12);
}

#slideshow.theme-dark .progress-fill {
  background: rgba(246, 242, 229, 0.4);
}

/* ============================================
   Animations
   ============================================ */

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
