:root {
  --rust: #b1602f;
  --rust-deep: #8a4423;
  --caramel: #d99a5b;
  --caramel-light: #eac48e;
  --cream: #faf3e7;
  --cream-dark: #f0e2cb;
  --linen: #fffaf2;
  --ink: #4a3324;
  --ink-soft: #8a7358;
  --serif: 'Bitter', serif;
  --script: 'Caveat', cursive;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-weight: 400;
  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;
  background:
    linear-gradient(180deg, rgba(74,51,36,0.55) 0%, rgba(74,51,36,0.88) 100%),
    url('../resources/knit-texture.jpg') center / 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(320px, 78vw);
  height: auto;
  cursor: pointer;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,0.35)) sepia(0.25) saturate(1.1);
  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: #fbf0e0;
  font-family: var(--script);
  font-weight: 600;
  letter-spacing: 0.5px;
  font-size: 1.7rem;
  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-weight: 600;
  font-size: 2.1rem;
  color: var(--rust);
  margin-bottom: 2px;
}

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

/* HERO */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: 40px 0 56px;
  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-tint {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(74,51,36,0.15) 0%, rgba(74,51,36,0.25) 45%, rgba(74,51,36,0.88) 100%);
}

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

.hero-kicker {
  font-size: 1rem;
  color: var(--caramel-light);
  font-style: italic;
  margin-bottom: 14px;
}

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

.hero-occasion {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--caramel-light);
  margin-bottom: 16px;
}

.hero-date {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 34px;
}

/* PAW SCROLL CUE */
.paw-scroll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--caramel-light);
  text-decoration: none;
}

.paw-icon {
  width: 34px;
  height: 34px;
  color: var(--caramel-light);
  animation: paw-tap 2.2s ease-in-out infinite;
}

@keyframes paw-tap {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
  50% { transform: translateY(7px) scale(1.08); opacity: 1; }
}

.paw-scroll-label {
  font-family: var(--script);
  font-weight: 600;
  font-size: 1.25rem;
  border-bottom: 2px dashed var(--caramel-light);
  padding-bottom: 2px;
}

.paw-scroll:hover .paw-icon,
.paw-scroll:hover .paw-scroll-label {
  color: #fff;
}
.paw-scroll:hover .paw-scroll-label { border-color: #fff; }

/* 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(--linen);
  border-radius: 16px;
  padding: 30px 22px;
  box-shadow: 0 8px 26px rgba(138,68,35,0.1);
  border: 1px solid var(--cream-dark);
  text-align: center;
  position: relative;
}

.event-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--caramel-light);
  border-radius: 10px;
  pointer-events: none;
}

.event-icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  color: var(--rust);
}

.event-icon svg { width: 100%; height: 100%; }

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

.event-time {
  color: var(--rust);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: var(--serif);
}

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

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

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

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

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

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

.cd-item {
  background: var(--linen);
  border: 1px solid var(--cream-dark);
  border-radius: 12px;
  padding: 16px 18px;
  min-width: 74px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(138,68,35,0.08);
}

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

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

/* PHOTO ACCENT */
.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 35%;
}

.photo-break::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(74,51,36,0.78) 0%, rgba(74,51,36,0.05) 55%);
}

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

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

.ornament { margin: 12px 0; color: var(--caramel); display: flex; justify-content: center; }
.ornament-paw { width: 26px; height: 26px; }

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

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

.rsvp-form {
  background: var(--linen);
  border-radius: 16px;
  padding: 36px 30px;
  box-shadow: 0 10px 30px rgba(138,68,35,0.12);
  text-align: left;
  border: 2px dashed var(--caramel-light);
  overflow: hidden;
  transition: height 0.7s ease;
}

.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: 10px;
  font-family: var(--serif);
  font-weight: 400;
  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(--rust);
}

.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(--rust); }

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

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

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

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

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

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

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

/* FOOTER */
.footer {
  text-align: center;
  padding: 30px;
  color: var(--ink-soft);
  font-weight: 400;
  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; }
}
