@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Libre+Baskerville:ital@0;1&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0a0a0f;
  overflow: hidden;
  width: 100vw;
  height: 100dvh;
  font-family: 'Libre Baskerville', serif;
}

#tunnel-container {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 900px;
  perspective-origin: 50% 50%;
  overflow: hidden;
}

/* Subtle vignette overlay */
#tunnel-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 100;
}

/* The vanishing point glow */
.vanishing-point {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,220,180,0.15) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
}

/* Date display in center */
.date-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  text-align: center;
  pointer-events: none;
}

.date-display .month {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 4vw, 2.8rem);
  font-weight: 700;
  color: rgba(255, 245, 230, 0.95);
  text-shadow: 0 0 40px rgba(0,0,0,0.9), 0 0 80px rgba(0,0,0,0.6);
  letter-spacing: 0.08em;
  transition: opacity 0.6s ease;
}

.date-display .year {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(0.8rem, 2vw, 1.2rem);
  font-weight: 400;
  color: rgba(255, 220, 180, 0.7);
  text-shadow: 0 0 30px rgba(0,0,0,0.9);
  margin-top: 4px;
  letter-spacing: 0.15em;
  transition: opacity 0.6s ease;
}

.date-display .description {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: clamp(0.6rem, 1.4vw, 0.8rem);
  font-weight: 400;
  color: rgba(255, 220, 180, 0.5);
  text-shadow: 0 0 20px rgba(0,0,0,0.9);
  margin-top: 6px;
  letter-spacing: 0.08em;
  min-height: 1.2em;
  transition: opacity 0.6s ease;
}

/* Tunnel lane - each side */
.tunnel-lane {
  position: absolute;
  overflow: visible;
}

/* Card styling */
.memory-card {
  position: absolute;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  transition: none;
  will-change: transform, opacity;
  border: 2px solid rgba(255,255,255,0.08);
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* Real image cards — transparent background, no card border */
.memory-card.image-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.memory-card .card-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #0a0a0f;
}

/* Image cards get transparent inner background */
.memory-card.image-card .card-inner {
  background: transparent;
}

/* Image display — natural sizing so border hugs the actual image */
.memory-card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

/* Placeholder card number */
.memory-card .card-number {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  z-index: 2;
}

.memory-card .card-date {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.55rem;
  color: rgba(255,255,255,0.5);
  z-index: 2;
}

/* Ambient particles */
.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 220, 180, 0.3);
  pointer-events: none;
  z-index: 50;
}

#tunnel-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Subtle tunnel edge lines for depth reinforcement */
.tunnel-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.tunnel-lines::before,
.tunnel-lines::after {
  content: '';
  position: absolute;
  background: rgba(255, 220, 180, 0.04);
}

/* Horizontal convergence lines */
.tunnel-lines::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, rgba(255,220,180,0.06), transparent 40%, transparent 60%, rgba(255,220,180,0.06));
}

/* Vertical convergence line */
.tunnel-lines::after {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, rgba(255,220,180,0.06), transparent 40%, transparent 60%, rgba(255,220,180,0.06));
}

/* Subtle scan lines for atmosphere */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 99;
}

/* Loading state */
.loading-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 3.5vw, 2rem);
  color: rgba(255, 220, 180, 0.85);
  letter-spacing: 0.18em;
  white-space: nowrap;
  z-index: 200;
  overflow: visible;
}

/* Mask slides left→right, revealing the text underneath with a soft fade edge.
   "both" fill mode ensures the mask covers text during the initial delay too. */
.loading-text::after {
  content: '';
  position: absolute;
  top: -12px;
  left: -24px;
  width: 150%;
  bottom: -12px;
  background: linear-gradient(to right,
    transparent 0%,
    #0a0a0f     15%,
    #0a0a0f     100%
  );
  animation: mask-slide 2.8s ease-out 0.8s both;
}

@keyframes mask-slide {
  from { transform: translateX(-15%); }
  to   { transform: translateX(100%); }
}
