/* Base reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Poppins', Arial, sans-serif;
  background: url("../assets/img/photos/IMG_8966.jpg") center/cover fixed no-repeat;
  color: #fff;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(#0008, #0008);
  pointer-events: none;
}
img {
  max-width: 100%;
  display: block;
}
button, [tabindex] {
  outline: none;
}
:focus {
  outline: 2px solid #4ECDC4;
  outline-offset: 2px;
}

/* Typography */
h1, h2, h3 {
  font-weight: 600;
}
h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
h2 {
  font-size: 1.6rem;
  margin: 2rem 0 1rem 0;
  text-align: center;
}
h3 {
  font-size: 1.2rem;
}
p, li, span, button {
  font-size: 1rem;
  font-weight: 400;
}

/* Hero Card */
.hero {
  background: none;
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.letter {
  margin-top: 10rem;
  position: static;
  z-index: auto;
  text-align: center;
  max-width: 180px;
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.92);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  opacity: 0;
  transition: opacity .6s ease .6s;
}

/* Timeline */
.timeline {
  margin: 2rem 0;
  padding: 1rem 0;
}
.events {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  list-style: none;
  align-items: center;
  padding: 0;
}
.event {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.event .avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s;
}
.event .caption {
  margin-top: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  text-align: center;
}
.event:focus .avatar,
.event:hover .avatar {
  transform: scale(1.1);
}
.event:focus .caption,
.event:hover .caption {
  opacity: 1;
}
@media (min-width: 700px) {
  .events {
    flex-direction: row;
    justify-content: center;
    overflow-x: auto;
    gap: 2.5rem;
  }
}

/* Scavenger Hunt */
.scavenger {
  margin: 2rem 0 3rem 0;
  text-align: center;
}
.hunt-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.hunt-item {
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
  outline: none;
}
.hunt-item:focus,
.hunt-item.pulse {
  animation: pulse 1s infinite alternate;
  box-shadow: 0 0 0 4px #4ECDC4;
}
dialog {
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  padding: 2rem 1.5rem;
  max-width: 320px;
  margin: auto;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: #222;
}
dialog::backdrop {
  background: rgba(0,0,0,0.18);
}
#coupons {
  margin: 2rem auto 0 auto;
  background: #4ECDC4;
  color: #fff;
  border-radius: 10px;
  padding: 1.5rem 1rem;
  max-width: 340px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  text-align: left;
}
#coupons h3 {
  margin-bottom: 1rem;
  color: #fff;
  font-weight: 600;
}
#coupons li {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Animations: flap, pulse, flip */
@keyframes flapOpen {
  from { transform: rotateX(0deg); }
  to { transform: rotateX(-130deg); }
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6;}
  100% { transform: scale(1.1); opacity:1;}
}

/* Utility */
[hidden] { display: none !important; }

footer {
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
  color: #777;
  background: #fff;
  margin-top: 2rem;
}

/* === SIMPLE REALISTIC 3D PRESENT BOX === */
.present {
  width: 240px;
  height: 240px;
  position: relative;
  transform: perspective(800px) rotateX(10deg) rotateY(-10deg);
  border: none;
  background: none;
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.12);
  margin-bottom: 2rem;
}

.present .box {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 100%;
  background: linear-gradient(120deg, #8B0000 80%, #a52a2a 100%);
  border-radius: 16px;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18) inset;
}

.present .lid {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 38%;
  background: linear-gradient(120deg, #a52a2a 80%, #8B0000 100%);
  border-radius: 16px 16px 8px 8px;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .5s cubic-bezier(.34,1.56,.64,1);
}

.present .ribbon-x, .present .ribbon-y {
  position: absolute;
  background: linear-gradient(90deg, #FFD700 60%, #B8860B 100%);
  box-shadow: 0 2px 8px #b8860b44 inset, 0 1px 0 #fff8 inset;
  z-index: 4;
  border-radius: 8px;
  opacity: 1;
  transition: transform .4s cubic-bezier(.25,.46,.45,.94) .1s, opacity .4s cubic-bezier(.25,.46,.45,.94) .1s;
}
.present .ribbon-x {
  width: 100%; height: 18px;
  top: 50%; left: 0;
  transform: translateY(-50%);
}
.present .ribbon-y {
  width: 18px; height: 100%;
  left: 50%; top: 0;
  transform: translateX(-50%);
}

.present .bow {
  position: absolute;
  top: -36px; left: 50%;
  width: 120px; height: 76px;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.18));
  pointer-events: none;
  transition: opacity .2s;
}
.present .bow-loop {
  width: 56px; height: 64px;
  border-radius: 50% 50% 40% 40%/60% 60% 40% 40%;
  background: linear-gradient(120deg, #FFD700 60%, #fffbe6 100%, #FFD700 80%);
  box-shadow: 0 2px 8px #b8860b44 inset, 0 1px 0 #fff8 inset;
  margin: 0 2px;
  position: relative;
}
.present .bow-knot {
  width: 36px; height: 36px;
  background: linear-gradient(120deg, #FFD700 80%, #B8860B 100%);
  border-radius: 50%;
  box-shadow: 0 1px 4px #b8860b44 inset;
  position: absolute;
  left: 50%; top: 24px;
  transform: translateX(-50%);
  z-index: 1;
}

/* Flower Reveal */
.flower-reveal {
  position: absolute;
  top: 50%; left: 50%;
  width: 140px; height: 140px;
  background: url('../assets/img/photos/flower.png') center/cover no-repeat;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: all 0.6s ease-out;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.present.open .flower-reveal {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Animation Sequence */
.present.open .bow { opacity: 0; transition: opacity .1s; }
.present.open .ribbon-x { transform: translateY(-50%) translateX(-250%); opacity: 0; }
.present.open .ribbon-y { transform: translateX(-50%) translateY(-250%); opacity: 0; }
.present.open .lid { transform: translateY(-120%); opacity: 0; }
.present.open .box { animation: pop .3s cubic-bezier(.77,0,.18,1) .3s both; }
@keyframes pop { 0% { transform: scale(1); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
.present.open .open-text { opacity: 0; }

/* Prompt text */
.present .open-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  color: #FFD700;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  z-index: 7;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* Cast shadow under box */
.present::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -12px;
  width: 80px; height: 16px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.08) 100%);
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
}

.gallery {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: nowrap;
}

.frame-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  overflow-x: auto;
  margin: 0;
}

#frame {
  display: block;
  width: auto;
  height: auto;
  max-width: 95vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 8px 32px #0005;
}

.arrow {
  background: #ffffff33;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  padding: 0.2rem 0.8rem;
  cursor: pointer;
}
.arrow:hover {
  background: #ffffff66;
}

.texts {
  list-style: none;
  padding: 0;
  max-width: 700px;
  margin: 2rem auto;
}
.texts li {
  margin: 1rem 0;
}
.texts p {
  background: #ffffff22;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  font-style: italic;
}

@media (max-width: 600px) {
  #frame {
    max-width: 98vw;
    max-height: 40vh;
  }
}

.birthday-gold {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #FFD700;
  text-shadow: 0 2px 8px #b8860b55, 0 1px 0 #fff8;
  margin: 2.5rem 0 1.5rem 0;
  letter-spacing: 0.04em;
  font-family: 'Poppins', Arial, sans-serif;
}

.present.marshes .flower-reveal {
  background: url('../assets/img/photos/marshes.png') center/cover no-repeat;
}

.presents-intro {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 500;
  color: #fffbe6;
  margin-bottom: 1.2rem;
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
  font-family: 'Poppins', Arial, sans-serif;
}

.gallery-intro {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 400;
  color: #fffbe6;
  margin-bottom: 1.2rem;
  margin-top: 2.2rem;
  letter-spacing: 0.01em;
  font-family: 'Poppins', Arial, sans-serif;
}
