/* Rain Window - CSS Art Piece
   Techniques: Pseudo-elements, CSS animations, blur filters, gradients, transforms */

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

:root {
  --rain-color: rgba(180, 200, 220, 0.6);
  --glass-tint: rgba(150, 170, 190, 0.15);
  --warm-glow: rgba(255, 200, 120, 0.3);
  --city-dark: #1a1a2e;
  --city-mid: #2d2d44;
  --city-light: #4a4a6a;
  --sky-top: #2c3e50;
  --sky-bottom: #4a6572;
  --text-color: rgba(255, 255, 255, 0.85);
  --frame-color: #2a2a35;
}

body {
  min-height: 100vh;
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-bottom));
  font-family: 'Georgia', serif;
  overflow-x: hidden;
  color: var(--text-color);
}

.scene {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}

/* ============================================
   CITYSCAPE - Blurred background
   ============================================ */

.cityscape {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60vh;
  filter: blur(8px);
  opacity: 0.7;
  z-index: 1;
}

.building {
  position: absolute;
  bottom: 0;
  background: linear-gradient(to top, var(--city-dark), var(--city-mid));
  border-radius: 2px 2px 0 0;
}

/* Scattered city windows - glowing lights */
.building::before,
.building::after {
  content: '';
  position: absolute;
  background: rgba(255, 220, 150, 0.8);
  box-shadow: 0 0 10px rgba(255, 200, 100, 0.5);
}

.b1 { left: 5%; width: 8%; height: 35%; }
.b1::before { width: 30%; height: 8%; top: 20%; left: 20%; }
.b1::after { width: 30%; height: 8%; top: 50%; left: 50%; }

.b2 { left: 10%; width: 12%; height: 55%; }
.b2::before { width: 20%; height: 5%; top: 15%; left: 60%; }
.b2::after { width: 20%; height: 5%; top: 35%; left: 20%; }

.b3 { left: 18%; width: 6%; height: 40%; }
.b3::before { width: 40%; height: 10%; top: 30%; left: 30%; }

.b4 { left: 25%; width: 15%; height: 70%; }
.b4::before { width: 15%; height: 4%; top: 20%; left: 20%; }
.b4::after { width: 15%; height: 4%; top: 45%; left: 60%; }

.b5 { left: 38%; width: 10%; height: 45%; }
.b5::before { width: 25%; height: 8%; top: 25%; left: 40%; }

.b6 { left: 45%; width: 18%; height: 80%; }
.b6::before { width: 12%; height: 3%; top: 15%; left: 70%; }
.b6::after { width: 12%; height: 3%; top: 50%; left: 30%; }

.b7 { left: 58%; width: 8%; height: 50%; }
.b7::before { width: 35%; height: 8%; top: 40%; left: 35%; }

.b8 { left: 65%; width: 14%; height: 65%; }
.b8::before { width: 18%; height: 5%; top: 25%; left: 15%; }
.b8::after { width: 18%; height: 5%; top: 60%; left: 55%; }

.b9 { left: 78%; width: 10%; height: 48%; }
.b9::before { width: 30%; height: 7%; top: 35%; left: 40%; }

.b10 { left: 85%; width: 12%; height: 58%; }
.b10::before { width: 20%; height: 6%; top: 20%; left: 25%; }
.b10::after { width: 20%; height: 6%; top: 55%; left: 60%; }

/* Street lights reflection */
.street-lights {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 15%;
  background: linear-gradient(
    to top,
    rgba(255, 200, 100, 0.3),
    transparent
  );
}

/* ============================================
   WINDOW GLASS EFFECTS
   ============================================ */

.window-glass {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: var(--glass-tint);
  pointer-events: none;
}

/* Condensation - subtle foggy patches */
.condensation {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(200, 210, 220, 0.2), transparent),
    radial-gradient(ellipse 60% 40% at 80% 70%, rgba(200, 210, 220, 0.15), transparent),
    radial-gradient(ellipse 100% 30% at 50% 95%, rgba(200, 210, 220, 0.25), transparent);
  animation: condense 8s ease-in-out infinite alternate;
}

@keyframes condense {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Fog layer across the glass */
.fog-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(180, 190, 200, 0.1) 50%,
    rgba(180, 190, 200, 0.2) 100%
  );
}

/* ============================================
   RAINDROPS
   ============================================ */

.raindrops {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* Individual stationary droplets */
.drop {
  position: absolute;
  width: 8px;
  height: 8px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.8),
    var(--rain-color) 50%,
    rgba(150, 170, 190, 0.4)
  );
  border-radius: 50%;
  box-shadow:
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    0 0 8px rgba(255, 255, 255, 0.2);
}

/* Droplet positions and sizes */
.drop-1 { top: 15%; left: 12%; width: 10px; height: 10px; }
.drop-2 { top: 25%; left: 78%; width: 6px; height: 6px; }
.drop-3 { top: 8%; left: 45%; width: 12px; height: 12px; }
.drop-4 { top: 40%; left: 22%; width: 7px; height: 7px; }
.drop-5 { top: 55%; left: 85%; width: 9px; height: 9px; }
.drop-6 { top: 35%; left: 55%; width: 5px; height: 5px; }
.drop-7 { top: 65%; left: 8%; width: 8px; height: 8px; }
.drop-8 { top: 18%; left: 92%; width: 11px; height: 11px; }
.drop-9 { top: 72%; left: 35%; width: 6px; height: 6px; }
.drop-10 { top: 48%; left: 68%; width: 10px; height: 10px; }
.drop-11 { top: 82%; left: 52%; width: 7px; height: 7px; }
.drop-12 { top: 28%; left: 38%; width: 4px; height: 4px; }
.drop-13 { top: 60%; left: 90%; width: 8px; height: 8px; }
.drop-14 { top: 5%; left: 25%; width: 6px; height: 6px; }
.drop-15 { top: 45%; left: 5%; width: 9px; height: 9px; }

/* Running streaks - animated droplets */
.streak {
  position: absolute;
  width: 3px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--rain-color) 20%,
    rgba(255, 255, 255, 0.6) 50%,
    var(--rain-color) 80%,
    transparent
  );
  border-radius: 3px;
  opacity: 0;
  animation: streak-fall 4s ease-in infinite;
}

.streak::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.9),
    var(--rain-color)
  );
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.streak-1 { left: 20%; height: 120px; animation-delay: 0s; }
.streak-2 { left: 45%; height: 80px; animation-delay: 1.2s; }
.streak-3 { left: 70%; height: 150px; animation-delay: 0.6s; }
.streak-4 { left: 88%; height: 100px; animation-delay: 2s; }
.streak-5 { left: 33%; height: 90px; animation-delay: 2.8s; }

@keyframes streak-fall {
  0% {
    top: -15%;
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    top: 105%;
    opacity: 0;
  }
}

/* ============================================
   WINDOW FRAME
   ============================================ */

.window-frame {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.window-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 25px solid var(--frame-color);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    inset 5px 5px 15px rgba(0, 0, 0, 0.3);
}

.frame-horizontal {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 20px;
  background: var(--frame-color);
  transform: translateY(-50%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.frame-vertical {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 20px;
  background: var(--frame-color);
  transform: translateX(-50%);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

/* ============================================
   INDOOR ATMOSPHERE
   ============================================ */

.indoor {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* Warm interior glow */
.warm-glow {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: radial-gradient(
    ellipse 120% 100% at 50% 100%,
    var(--warm-glow),
    transparent 70%
  );
}

/* Tea/coffee cup silhouette */
.cup {
  position: absolute;
  bottom: 8%;
  right: 15%;
  width: 60px;
  height: 45px;
  background: linear-gradient(135deg, #3a3a4a 0%, #2a2a35 100%);
  border-radius: 5px 5px 25px 25px;
  box-shadow:
    5px 5px 20px rgba(0, 0, 0, 0.4),
    inset 0 -5px 15px rgba(0, 0, 0, 0.3);
}

.cup::before {
  content: '';
  position: absolute;
  right: -20px;
  top: 8px;
  width: 20px;
  height: 25px;
  border: 4px solid #3a3a4a;
  border-left: none;
  border-radius: 0 15px 15px 0;
}

.cup::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 35px;
  background: radial-gradient(
    ellipse at center,
    rgba(139, 90, 43, 0.8),
    rgba(80, 50, 20, 0.9)
  );
  border-radius: 3px 3px 20px 20px;
}

/* Steam animation */
.steam {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
}

.steam::before,
.steam::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: steam-rise 3s ease-out infinite;
}

.steam::before {
  width: 8px;
  height: 15px;
  left: 8px;
  animation-delay: 0s;
}

.steam::after {
  width: 10px;
  height: 18px;
  left: 20px;
  animation-delay: 1s;
}

@keyframes steam-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scaleX(1);
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scaleX(2);
  }
}

/* ============================================
   CONTENT - Poetry
   ============================================ */

.content {
  position: relative;
  z-index: 10;
  max-width: 500px;
  margin: 0 auto;
  padding: 15vh 2rem 10vh;
  text-align: center;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 3rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
}

.verse {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.9;
  margin-bottom: 2.5rem;
  font-style: italic;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
  opacity: 0.85;
}

.signature {
  display: block;
  margin-top: 3rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

/* ============================================
   BACK LINK
   ============================================ */

.back-link {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 100;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.back-link:hover {
  opacity: 1;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .window-frame::before {
    border-width: 15px;
  }

  .frame-horizontal {
    height: 12px;
  }

  .frame-vertical {
    width: 12px;
  }

  .cup {
    width: 45px;
    height: 35px;
    right: 10%;
    bottom: 5%;
  }

  .cup::before {
    width: 15px;
    height: 18px;
    right: -15px;
  }

  .content {
    padding: 12vh 1.5rem 8vh;
  }

  .verse {
    margin-bottom: 2rem;
  }

  .drop {
    transform: scale(0.8);
  }

  .back-link {
    bottom: 1rem;
    left: 1rem;
  }
}

@media (max-width: 480px) {
  .frame-horizontal,
  .frame-vertical {
    display: none;
  }

  .window-frame::before {
    border-width: 10px;
  }

  .cityscape {
    height: 50vh;
    filter: blur(6px);
  }

  .content {
    padding: 10vh 1rem 6vh;
  }

  h1 {
    margin-bottom: 2rem;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .streak {
    animation: none;
    opacity: 0.5;
    top: 30%;
  }

  .steam::before,
  .steam::after {
    animation: none;
    opacity: 0.3;
    transform: translateY(-20px);
  }

  .condensation {
    animation: none;
  }
}
