:root {
  --sage: #7f9471;
  --sage-deep: #5d7050;
  --gold: #c9a04a;
  --gold-light: #e3c583;
  --terracotta: #c17d52;
  --cream: #faf6ee;
  --cream-dark: #f0e7d4;
  --ink: #45402f;
  --ink-soft: #86795f;
  --serif: 'Cormorant Garamond', serif;
  --display: 'Playfair Display', serif;
  --script: 'Parisienne', cursive;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  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: 32px;
  background:
    linear-gradient(180deg, rgba(127,148,113,0.5) 0%, rgba(69,64,47,0.82) 100%),
    url('../resources/balloons-bg.jpg') center 40% / cover no-repeat;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

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

.envelope {
  width: min(340px, 80vw);
  height: auto;
  cursor: pointer;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,0.4));
  transition: transform 0.3s ease;
}

.envelope:hover { transform: scale(1.04); }

.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 {
  color: #fbf5e8;
  letter-spacing: 1px;
  font-size: 1.4rem;
  font-style: italic;
  text-align: center;
  max-width: 320px;
}

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

.section-kicker {
  font-family: var(--script);
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 2px;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 600;
  margin-bottom: 40px;
  color: var(--sage-deep);
}

/* HERO — photo + typography */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 0;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

.hero-photo-wrap {
  width: 100%;
  height: 46vh;
  min-height: 300px;
  position: relative;
  overflow: hidden;
}

.hero-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(69,64,47,0.05) 0%, var(--cream) 96%);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}

.hero-inner {
  max-width: 560px;
  padding: 8px 24px 0;
  margin-top: -10px;
}

.hero-kicker {
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 14px;
}

.hero-name {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.4rem, 13vw, 5.6rem);
  color: var(--sage-deep);
  line-height: 1;
  margin-bottom: 4px;
}

.hero-occasion {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 18px;
}

.hero-date {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 40px;
}

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

.hero-arrow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--sage);
  animation: bounce 2s ease-in-out infinite;
  transition: background 0.25s ease, transform 0.25s ease;
}

.hero-scroll:hover .hero-arrow-btn {
  background: var(--sage);
  transform: scale(1.06);
}

.hero-arrow {
  width: 18px;
  height: 18px;
  color: var(--sage-deep);
  transition: color 0.25s ease;
}

.hero-scroll:hover .hero-arrow { color: #fff; }

.hero-scroll small {
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* 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: #fff;
  border-radius: 10px;
  padding: 28px 22px;
  box-shadow: 0 8px 26px rgba(93,112,80,0.12);
  border: 1px solid var(--cream-dark);
  text-align: center;
}

.event-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--gold);
}

.event-card h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--sage-deep);
  margin-bottom: 10px;
}

.event-time {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: var(--display);
}

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

.map-btn {
  display: inline-block;
  border: 1px solid var(--sage);
  color: var(--sage-deep);
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 0.88rem;
  letter-spacing: 1px;
  transition: all 0.25s ease;
}

.map-btn:hover {
  background: var(--sage);
  color: #fff;
}

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

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

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

.cd-item {
  background: #fff;
  border: 1px solid var(--cream-dark);
  border-radius: 10px;
  padding: 16px 18px;
  min-width: 74px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(93,112,80,0.1);
}

.cd-item span {
  display: block;
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--sage-deep);
}

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

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

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

.photo-break::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(69,64,47,0.75) 0%, rgba(69,64,47,0.05) 55%);
}

.photo-break-caption {
  position: absolute;
  left: 0; right: 0; bottom: 26px;
  text-align: center;
  color: #fbf5e8;
  font-style: italic;
  font-size: 1.05rem;
  padding: 0 30px;
  z-index: 2;
}

/* MESSAGE */
.message-section { background: var(--cream-dark); }

.ornament { font-size: 1.3rem; margin: 12px 0; color: var(--sage); }

.message-text {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink);
  max-width: 560px;
  margin: 0 auto;
}

/* RSVP */
.rsvp-section { background: var(--cream-dark); }

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

.rsvp-form {
  background: #fff;
  border-radius: 10px;
  padding: 36px 30px;
  box-shadow: 0 10px 30px rgba(93,112,80,0.14);
  text-align: left;
  border: 2px dashed var(--gold-light);
}

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

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

.form-row input[type="text"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
  font-family: var(--serif);
  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(--sage);
}

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

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

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

.rsvp-submit {
  width: 100%;
  padding: 14px;
  background: var(--sage-deep);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.25s ease;
}

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

.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(--sage-deep);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.rsvp-agenda-btn {
  display: inline-block;
  background: var(--sage-deep);
  color: #fff;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 30px;
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 1px;
  transition: background 0.25s ease, transform 0.25s ease;
}

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

/* FOOTER */
.footer {
  text-align: center;
  padding: 30px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

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