:root {
  --sky: #aed8f2;
  --sky-deep: #6fb3de;
  --sky-deeper: #4a8fc2;
  --cream: #fffdf6;
  --cream-warm: #fff6de;
  --sun: #f6c667;
  --sun-soft: #ffe6a3;
  --ink: #3d5266;
  --ink-soft: #7590a3;
  --white: #ffffff;
  --display: 'Baloo 2', sans-serif;
  --body: 'Quicksand', sans-serif;
  --script: 'Caveat', cursive;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-weight: 500;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

body.locked {
  overflow: hidden;
  height: 100vh;
}

/* ENVELOPE INTRO */
.envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(74,143,194,0.28) 0%, rgba(174,216,242,0.9) 55%, rgba(255,246,222,0.95) 100%),
    url('../resources/envelope-sky.jpg') center 30% / cover no-repeat;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.envelope-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sky-deco {
  position: absolute;
  font-size: 2.6rem;
  opacity: 0.8;
  filter: drop-shadow(0 6px 10px rgba(74,143,194,0.25));
  animation: driftY 5s ease-in-out infinite;
}
.sky-deco-1 { top: 10%; left: 10%; animation-delay: 0s; font-size: 3.2rem; }
.sky-deco-2 { bottom: 14%; right: 10%; animation-delay: 1.4s; font-size: 2.8rem; }
.sky-deco-3 { top: 18%; right: 16%; animation-delay: 0.7s; font-size: 1.8rem; }

@keyframes driftY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.envelope {
  width: min(320px, 78vw);
  height: auto;
  cursor: pointer;
  filter: drop-shadow(0 14px 26px rgba(74,143,194,0.4));
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
}

.envelope:hover { transform: scale(1.04) rotate(-1deg); }

.envelope.shake {
  animation: envelope-shake 0.5s ease;
  pointer-events: none;
}

@keyframes envelope-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-8px) rotate(-3deg); }
  30% { transform: translateX(7px) rotate(3deg); }
  45% { transform: translateX(-6px) rotate(-2deg); }
  60% { transform: translateX(5px) rotate(2deg); }
  75% { transform: translateX(-3px) rotate(-1deg); }
  90% { transform: translateX(2px) rotate(1deg); }
}

.envelope-hint {
  position: relative;
  z-index: 2;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.15rem;
  text-align: center;
  max-width: 300px;
  background: rgba(255,255,255,0.55);
  padding: 10px 18px;
  border-radius: 24px;
}

.section {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.section-kicker {
  font-family: var(--script);
  font-weight: 600;
  font-size: 2.1rem;
  color: var(--sky-deeper);
  margin-bottom: 2px;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.2vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 40px;
  color: var(--ink);
}

/* HERO */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 40px 0 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.hero-bg-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(174,216,242,0.15) 0%, rgba(255,253,246,0.55) 55%, var(--cream) 92%);
}

.hero-clouds {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.floaty {
  position: absolute;
  font-size: 2.4rem;
  animation: driftY 6s ease-in-out infinite;
  filter: drop-shadow(0 8px 14px rgba(74,143,194,0.2));
}
.cloud-a { top: 12%; left: 8%; font-size: 3rem; animation-duration: 7s; }
.cloud-b { top: 22%; right: 10%; font-size: 2.2rem; animation-duration: 5.5s; animation-delay: 1s; }
.star-a { top: 8%; right: 26%; font-size: 1.5rem; animation-duration: 4s; animation-delay: 0.5s; }
.moon-a { top: 34%; left: 20%; font-size: 1.8rem; animation-duration: 6.5s; animation-delay: 1.6s; }

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 560px;
  padding: 0 24px;
}

.hero-kicker {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.hero-name {
  font-family: var(--script);
  font-weight: 700;
  font-size: clamp(3.6rem, 14vw, 6rem);
  color: var(--sky-deeper);
  line-height: 1;
  margin-bottom: 6px;
  text-shadow: 0 6px 18px rgba(255,255,255,0.7);
}

.hero-occasion {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 14px;
}

.hero-date {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  color: var(--white);
  background: var(--sky-deep);
  padding: 8px 20px;
  border-radius: 30px;
  margin-bottom: 44px;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  text-decoration: none;
}

.scroll-cloud {
  font-size: 2.2rem;
  animation: bobCloud 2.4s ease-in-out infinite;
  transition: transform 0.25s ease;
}

.scroll-cue:hover .scroll-cloud { transform: scale(1.12); }

@keyframes bobCloud {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.scroll-cue small {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
}

/* EVENTS */
.events-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 90px 24px 20px;
  text-align: center;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
  text-align: left;
}

.event-card {
  background: var(--white);
  border-radius: 26px;
  padding: 30px 22px;
  box-shadow: 0 10px 28px rgba(111,179,222,0.18);
  border: 2px solid #eaf5fc;
  text-align: center;
}

.event-icon {
  font-size: 1.9rem;
  margin-bottom: 10px;
}

.event-card h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sky-deeper);
  margin-bottom: 10px;
}

.event-time {
  color: var(--sun);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 1.1rem;
}

.event-place {
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.map-btn {
  display: inline-block;
  border: 2px solid var(--sky-deep);
  color: var(--sky-deeper);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.25s ease;
}

.map-btn:hover {
  background: var(--sky-deep);
  color: var(--white);
}

/* COUNTDOWN */
.countdown-wrap {
  margin-top: 56px;
}

.countdown-label {
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.countdown {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.cd-item {
  background: var(--white);
  border: 2px solid #eaf5fc;
  border-radius: 20px;
  padding: 16px 20px;
  min-width: 78px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(111,179,222,0.14);
}

.cd-item span {
  display: block;
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--sky-deeper);
}

.cd-item small {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-soft);
}

/* PHOTO BREAK */
.photo-break {
  position: relative;
  height: 42vh;
  min-height: 280px;
  overflow: hidden;
  margin-top: 70px;
}

.photo-break img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.photo-break::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(61,82,102,0.62) 0%, rgba(61,82,102,0.02) 55%);
}

.photo-break-caption {
  position: absolute;
  left: 0; right: 0; bottom: 26px;
  text-align: center;
  color: var(--cream);
  font-weight: 600;
  font-size: 1.02rem;
  padding: 0 30px;
  z-index: 2;
}

/* MESSAGE */
.message-section { background: var(--cream-warm); border-radius: 40px; margin: 20px auto; }

.ornament { font-size: 1.2rem; margin: 12px 0; letter-spacing: 6px; }

.message-text {
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--ink);
  max-width: 560px;
  margin: 0 auto;
}

/* RSVP */
.rsvp-section { background: var(--cream-warm); border-radius: 40px; margin: 20px auto 0; }

.rsvp-sub {
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 32px;
}

.rsvp-form {
  background: var(--white);
  border-radius: 26px;
  padding: 36px 30px;
  box-shadow: 0 12px 32px rgba(111,179,222,0.18);
  text-align: left;
  border: 3px dashed var(--sky);
}

.form-row { margin-bottom: 22px; }

.form-row label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

.form-row input[type="text"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #eaf5fc;
  border-radius: 14px;
  font-family: var(--body);
  font-weight: 500;
  font-size: 1rem;
  background: var(--cream);
  color: var(--ink);
  resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--sky-deep);
}

.radio-group {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

.radio-option input { accent-color: var(--sky-deep); }

.rsvp-submit {
  width: 100%;
  padding: 14px;
  background: var(--sky-deeper);
  color: var(--white);
  border: none;
  border-radius: 30px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.rsvp-submit:hover { background: var(--sky-deep); }

.rsvp-fields {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.rsvp-fields.collapsed { opacity: 0; }

.rsvp-form {
  overflow: hidden;
  transition: height 0.7s ease;
}

.rsvp-success {
  text-align: center;
  padding: 12px 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.rsvp-success.visible { opacity: 1; }

.rsvp-success-text {
  color: var(--sky-deeper);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 20px;
}

.rsvp-agenda-btn {
  display: inline-block;
  background: var(--sky-deeper);
  color: var(--white);
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 30px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.5px;
  transition: background 0.25s ease, transform 0.25s ease;
}

.rsvp-agenda-btn:hover {
  background: var(--sky-deep);
  transform: scale(1.03);
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 34px 20px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
}

@media (max-width: 600px) {
  .section { padding: 60px 20px; }
  .events-section { padding: 70px 20px 20px; }
  .events-grid { grid-template-columns: 1fr; }
}
