:root {
  --sky-top: #1f2a36;
  --sky-mid: #3a4b5c;
  --sky-low: #5b6e7e;
  --asphalt: #2a323a;
  --paper: #f3eede;
  --paper-edge: #d9d0b8;
  --ink: #1c2330;
  --ink-soft: #4a5566;
  --rain: rgba(200, 218, 232, 0.55);
  --window: #f4c560;
  --teardrop: #5b8fb1;
  --tape: rgba(244, 197, 96, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Marker Felt", cursive;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(244, 197, 96, 0.06), transparent 40%),
    radial-gradient(ellipse at 80% 10%, rgba(91, 143, 177, 0.10), transparent 50%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-low) 80%, var(--asphalt) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
}

/* faint wet-paper noise / film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.45 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ============== RAIN ============== */
.rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.drop {
  position: absolute;
  top: -10vh;
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--rain));
  opacity: 0.5;
  animation: fall linear infinite;
}
.drop.thick {
  width: 1.5px;
  height: 80px;
  opacity: 0.65;
}

@keyframes fall {
  to { transform: translate3d(-30px, 120vh, 0); }
}

/* ============== NAVBAR ============== */
.topbar {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px 0;
  color: #f3eede;
  font-size: 0.98rem;
}
.topbar .brand {
  color: #f3eede;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  transform: rotate(-1.5deg);
  display: inline-block;
  text-shadow: 1px 1px 0 #1c2330, 2px 2px 0 rgba(91,143,177,0.35);
  transition: transform 240ms ease;
}
.topbar .brand:hover { transform: rotate(0deg) scale(1.04); }

.topbar .nav-link {
  color: rgba(243, 238, 222, 0.78);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: rgba(244, 197, 96, 0.55);
  text-underline-offset: 4px;
  font-style: italic;
  font-size: 1.18rem;
  transition: color 200ms ease;
}
.topbar .nav-link:hover { color: var(--window); }
.topbar .nav-link.active {
  color: var(--window);
  text-decoration-color: var(--window);
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    gap: 10px;
    padding-top: 18px;
    text-align: center;
  }
}

/* ============== HERO ============== */
.hero {
  position: relative;
  z-index: 3;
  max-width: 880px;
  margin: 0 auto;
  padding: 90px 28px 30px;
  text-align: center;
  color: #f3eede;
}

.weather {
  margin: 0 0 28px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: rgba(243, 238, 222, 0.65);
  font-style: italic;
}

h1 {
  margin: 0;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 6.4rem);
  line-height: 1;
  color: #f3eede;
  text-shadow:
    2px 2px 0 #1c2330,
    4px 4px 0 rgba(91, 143, 177, 0.4),
    0 8px 30px rgba(0,0,0,0.4);
  transform: rotate(-2deg);
  display: inline-block;
}

.intro {
  margin: 30px auto 0;
  max-width: 36ch;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: rgba(243, 238, 222, 0.88);
}
.intro em {
  color: var(--window);
  font-style: italic;
}

.signoff {
  margin: 18px 0 0;
  font-size: 0.9rem;
  color: rgba(243, 238, 222, 0.45);
  font-style: italic;
}

.update-note {
  display: inline-block;
  margin: 22px 0 0;
  padding: 8px 16px;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--window);
  border-radius: 999px;
  transform: rotate(-1.5deg);
  box-shadow:
    0 4px 0 rgba(0,0,0,0.25),
    0 10px 24px rgba(244, 197, 96, 0.35),
    0 0 40px rgba(244, 197, 96, 0.25);
  animation: wiggle 4s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-1.5deg); }
  50%      { transform: rotate(1.5deg); }
}

/* ============== GALLERY ============== */
.gallery {
  position: relative;
  z-index: 3;
  max-width: 1180px;
  margin: 40px auto 0;
  padding: 30px 28px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 56px 36px;
}

.polaroid {
  position: relative;
  background: var(--paper);
  padding: 16px 16px 22px;
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 22px 36px rgba(0, 0, 0, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.3);
  transform: rotate(var(--tilt, -1.5deg));
  transition: transform 380ms cubic-bezier(.2,.8,.2,1.1), box-shadow 380ms ease;
  opacity: 0;
  animation: pin 700ms ease forwards;
}

.polaroid::before {
  /* damp paper edge stain */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 10% 100%, rgba(91, 143, 177, 0.18), transparent 35%),
    radial-gradient(ellipse at 95% 0%, rgba(91, 143, 177, 0.12), transparent 30%);
  pointer-events: none;
  mix-blend-mode: multiply;
}

.polaroid:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.03);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 30px 50px rgba(0, 0, 0, 0.55),
    0 8px 14px rgba(0, 0, 0, 0.35);
}

.polaroid:nth-child(odd)  { --tilt: -2.4deg; }
.polaroid:nth-child(even) { --tilt: 1.8deg;  }
.polaroid:nth-child(3n)   { --tilt: 2.6deg;  }
.polaroid:nth-child(5n)   { --tilt: -3deg;   }
.polaroid:nth-child(7n)   { --tilt: 1.2deg;  }

/* tape strips */
.tape {
  position: absolute;
  top: -12px;
  width: 56px;
  height: 18px;
  background: var(--tape);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 2;
}
.tape-l { left: 14px;  transform: rotate(-8deg); }
.tape-r { right: 14px; transform: rotate(7deg);  }

.tape::before, .tape::after {
  /* torn edges */
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 4px;
  background: inherit;
  filter: blur(0.5px);
}
.tape::before { left: -4px;  clip-path: polygon(60% 0, 100% 30%, 60% 60%, 100% 100%, 0 100%, 0 0); }
.tape::after  { right: -4px; clip-path: polygon(0 0, 40% 30%, 0 60%, 40% 100%, 100% 100%, 100% 0); }

.photo-wrap {
  position: relative;
  aspect-ratio: 1 / 1.05;
  overflow: hidden;
  background: #1c2330;
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) contrast(0.95) brightness(0.92) hue-rotate(-8deg);
  transition: filter 500ms ease, transform 500ms ease;
}

.polaroid:hover .photo-wrap img {
  filter: saturate(0.95) contrast(1) brightness(0.98);
  transform: scale(1.04);
}

/* a single wet drop bead on each photo */
.raindrop {
  position: absolute;
  top: 14%;
  right: 12%;
  width: 14px;
  height: 18px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.55), rgba(91,143,177,0.35));
  box-shadow:
    inset 1px 1px 1px rgba(255,255,255,0.7),
    inset -1px -1px 2px rgba(0,0,0,0.18),
    0 1px 3px rgba(0,0,0,0.3);
  pointer-events: none;
  opacity: 0.9;
}
.polaroid:nth-child(2n) .raindrop { top: 60%; right: auto; left: 18%; }
.polaroid:nth-child(3n) .raindrop { top: 30%; left: 12%; right: auto; width: 10px; height: 14px; }
.polaroid:nth-child(5n) .raindrop { top: 70%; right: 20%; }

.note {
  margin: 14px 4px 0;
  text-align: center;
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.35;
  font-style: italic;
  letter-spacing: 0.01em;
}

@keyframes pin {
  from {
    opacity: 0;
    transform: rotate(var(--tilt, -1.5deg)) translateY(40px);
  }
  to {
    opacity: 1;
    transform: rotate(var(--tilt, -1.5deg)) translateY(0);
  }
}

/* ============== FOOTER ============== */
.bottom {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 30px 20px 70px;
  color: rgba(243, 238, 222, 0.55);
  font-size: 0.95rem;
}
.bottom p { margin: 4px 0; }
.bottom .tiny {
  font-size: 0.78rem;
  opacity: 0.6;
  font-style: italic;
}
.bottom .inspired {
  margin-top: 18px;
  font-size: 0.88rem;
  font-style: italic;
  opacity: 0.7;
}
.bottom .inspired a {
  color: var(--window);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 4px;
}
.bottom .inspired a:hover {
  color: #ffd97a;
}
.bottom .copyright {
  margin-top: 10px;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  opacity: 0.5;
}

@media (max-width: 600px) {
  .hero { padding-top: 60px; }
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 44px 22px;
    padding: 20px 18px 60px;
  }
  body::before { right: 6vw; top: 12vh; }
}

@media (prefers-reduced-motion: reduce) {
  .drop, .update-note { animation: none; }
  .polaroid { animation: none; opacity: 1; }
}

/* ============== HARAMBE MEMORIAL PAGE ============== */
.memorial-hero {
  padding-top: 50px;
  padding-bottom: 10px;
}
.memorial-hero h1 {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 1.05;
  transform: rotate(-1.2deg);
}
.memorial-hero .dates {
  margin: 22px 0 0;
  font-style: italic;
  color: rgba(243, 238, 222, 0.62);
  letter-spacing: 0.04em;
}

.memorial-main {
  position: relative;
  z-index: 3;
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 28px 60px;
}

.memorial-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px 36px;
  margin-bottom: 70px;
}
.memorial-photos .polaroid:nth-child(1) { --tilt: -3deg;  transform: rotate(-3deg); }
.memorial-photos .polaroid:nth-child(2) { --tilt:  2.4deg; transform: rotate(2.4deg); }

/* companion song card on the harambe page */
.companion {
  position: relative;
  max-width: 560px;
  margin: 0 auto 50px;
  padding: 22px 22px 18px;
  background: var(--paper);
  border-radius: 4px;
  transform: rotate(-1.2deg);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 22px 36px rgba(0, 0, 0, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.3);
}
.companion::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 8% 100%, rgba(91, 143, 177, 0.18), transparent 35%),
    radial-gradient(ellipse at 95% 0%,  rgba(91, 143, 177, 0.12), transparent 30%);
  pointer-events: none;
  mix-blend-mode: multiply;
}
.companion-label {
  margin: 4px 0 14px;
  text-align: center;
  font-size: 1rem;
  color: var(--ink);
  font-style: italic;
  line-height: 1.35;
}
.companion-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #1c2330;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.15);
  transition: transform 220ms ease;
}
.companion-frame:hover { transform: scale(1.01); }
.companion-frame:focus-visible {
  outline: 3px solid var(--window);
  outline-offset: 3px;
}
.companion-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  cursor: auto;
}
.companion-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) brightness(0.78);
  transition: filter 220ms ease;
}
.companion-frame:hover .companion-thumb {
  filter: saturate(0.95) brightness(0.88);
}
.companion-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: var(--window);
  color: var(--ink);
  font-size: 1.6rem;
  padding-left: 6px;
  box-shadow:
    0 6px 18px rgba(0,0,0,0.45),
    0 0 0 6px rgba(244, 197, 96, 0.18),
    0 0 30px rgba(244, 197, 96, 0.4);
  transition: transform 220ms ease, box-shadow 220ms ease;
  pointer-events: none;
}
.companion-frame:hover .companion-play {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow:
    0 8px 22px rgba(0,0,0,0.5),
    0 0 0 8px rgba(244, 197, 96, 0.22),
    0 0 40px rgba(244, 197, 96, 0.55);
}
.companion-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-style: italic;
  opacity: 0.8;
}

.memorial-prose {
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  padding: 44px clamp(24px, 5vw, 56px) 48px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 26px 50px rgba(0, 0, 0, 0.45),
    0 6px 14px rgba(0, 0, 0, 0.3);
  position: relative;
}
.memorial-prose::before {
  /* rain-stained edge */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 5% 95%, rgba(91, 143, 177, 0.18), transparent 35%),
    radial-gradient(ellipse at 95% 5%, rgba(91, 143, 177, 0.14), transparent 30%);
  pointer-events: none;
  mix-blend-mode: multiply;
}

.memorial-prose h2 {
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin: 36px 0 12px;
  color: var(--ink);
  transform: rotate(-0.8deg);
  display: inline-block;
  border-bottom: 3px solid var(--window);
  padding-bottom: 2px;
}
.memorial-prose h2:first-child { margin-top: 0; }

.memorial-prose p {
  margin: 0 0 18px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.memorial-prose p em {
  color: var(--ink);
  font-style: italic;
}

.memorial-prose .quote {
  display: inline-block;
  padding: 1px 8px;
  background: rgba(244, 197, 96, 0.45);
  border-radius: 3px;
  font-weight: 700;
  color: var(--ink);
  transform: rotate(-1deg);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.memorial-shot {
  margin: 36px auto;
  max-width: 520px;
  --tilt: 1.8deg;
  transform: rotate(1.8deg);
}
.photo-wrap-wide {
  aspect-ratio: 3 / 2;
}

.signoff-line {
  margin-top: 28px !important;
  text-align: center;
  font-size: 1.15rem !important;
  font-style: italic;
  color: var(--ink) !important;
  transform: rotate(-1deg);
}

@media (max-width: 600px) {
  .memorial-photos {
    grid-template-columns: 1fr;
    gap: 60px;
  }
  .memorial-prose {
    padding: 32px 22px 36px;
  }
}
