/* ============================================================
   CUSTOM FONTS
   ============================================================ */
@font-face {
  font-family: 'Nicoletta Script';
  src: url('fonts/Nicoletta_script.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Masvol';
  src: url('fonts/cd-masvol-thin.otf') format('opentype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manege';
  src: url('fonts/ManegeDemo-Light.woff2') format('woff2'),
       url('fonts/ManegeDemo-Light.woff') format('woff'),
       url('fonts/ManegeDemo-Light.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   BASE / RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:        #F5F2EC;
  --cream-dark:   #EDE8DE;
  --green:        #4A5C35;
  --green-light:  #7a8c5a;
  --green-mid:    #5c6b40;
  --dark:         #1C1814;
  --dark-warm:    #231f1a;
  --card:         #FAFAF7;
  --text:         #3A3026;
  --text-light:   #6B5E50;
  --white:        #ffffff;
  --font-script:  'Great Vibes', cursive;
  --font-name:    'Dawning of a New Day', cursive;
  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-body:    'Raleway', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: url('assets/images/pattern_bg.png') repeat, var(--cream);
  background-size: 758px 801px, auto;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

/* ============================================================
   TYPOGRAPHY HELPERS
   ============================================================ */
.script-heading {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}
.script-heading.green  { color: var(--green); }
.script-heading.white  { color: var(--white); }

.body-text {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
}
.body-text.centered { text-align: center; }

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   1. HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('assets/images/hero_curtain.jpg') center center / cover no-repeat;
  background-color: var(--dark);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 10, 0.35);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 40px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hero-card {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  padding: 4px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.4);
  max-width: 220px;
  width: 100%;
  transform: translateX(2px);
}

.hero-card-border {
  border: 1px solid rgba(120, 100, 60, 0.28);
  padding: 40px 24px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

/* Inner double-border lace effect */
.hero-card-border::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 0.5px solid rgba(120, 100, 60, 0.2);
  pointer-events: none;
}

/* Scalloped lace outer edge using repeating radial masks */
.hero-card {
  -webkit-mask-image:
    radial-gradient(circle 5px at 5px 0,   transparent 5px, black 5px) -5px top    / 10px 5px repeat-x,
    radial-gradient(circle 5px at 5px 100%, transparent 5px, black 5px) -5px bottom / 10px 5px repeat-x,
    radial-gradient(circle 5px at 0   5px,  transparent 5px, black 5px) left  -5px  / 5px 10px repeat-y,
    radial-gradient(circle 5px at 100% 5px, transparent 5px, black 5px) right -5px  / 5px 10px repeat-y,
    linear-gradient(black, black) center / calc(100% - 10px) calc(100% - 10px) no-repeat;
  mask-image:
    radial-gradient(circle 5px at 5px 0,   transparent 5px, black 5px) -5px top    / 10px 5px repeat-x,
    radial-gradient(circle 5px at 5px 100%, transparent 5px, black 5px) -5px bottom / 10px 5px repeat-x,
    radial-gradient(circle 5px at 0   5px,  transparent 5px, black 5px) left  -5px  / 5px 10px repeat-y,
    radial-gradient(circle 5px at 100% 5px, transparent 5px, black 5px) right -5px  / 5px 10px repeat-y,
    linear-gradient(black, black) center / calc(100% - 10px) calc(100% - 10px) no-repeat;
}

.hero-swans {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  z-index: 2;
}

.hero-tag {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-style: italic;
  letter-spacing: 0.12em;
  color: var(--green-light);
  text-transform: uppercase;
}

.hero-names {
  font-family: var(--font-name);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--green);
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-align: center;
}

.hero-date {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  color: var(--text-light);
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ============================================================
   2. INVITATION
   ============================================================ */
.invitation {
  background: transparent;
  padding: 60px 0 50px;
}

.invitation .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.couple-frame-wrap {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  position: relative;
}

.couple-plate {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(256px, 72vw);
  aspect-ratio: 174 / 132;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
}

.couple-plate-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
  display: block;
}

.couple-tray {
  width: min(320px, 90vw);
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.couple-frame {
  width: 200px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  border: 12px solid transparent;
  background:
    linear-gradient(#ccc, #ccc) padding-box,
    radial-gradient(ellipse at top, #e8e0d0, #b0a090, #e8e0d0, #908070) border-box;
  box-shadow:
    0 0 0 2px rgba(160, 140, 110, 0.4),
    0 4px 24px rgba(0,0,0,0.15),
    inset 0 2px 8px rgba(0,0,0,0.15);
  position: relative;
}

.couple-frame::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 2px solid rgba(180, 160, 120, 0.5);
  pointer-events: none;
}

.couple-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(15%);
}

.invitation .script-heading {
  font-size: 2.2rem;
}

.invitation .body-text {
  max-width: 340px;
}

.big-date {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 300;
  color: var(--green);
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1;
  margin: 4px 0;
}

.closing-text {
  max-width: 280px;
  font-style: italic;
}

.swans-icon {
  width: 140px;
  height: auto;
  margin-top: 8px;
  opacity: 0.85;
}

/* ============================================================
   3. VENUE
   ============================================================ */
.venue {
  position: relative;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 56px 32px;
  background: url('assets/images/venue_bg.jpg') center center / cover no-repeat;
  background-color: var(--dark);
  overflow: hidden;
}

.venue::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 8, 0.52);
}

.venue-heading {
  position: relative;
  z-index: 1;
  font-size: 3rem;
  color: var(--cream);
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
  margin: 0;
}

.venue-layout {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 860px;
}

.venue-doorbell {
  width: 293px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}

.venue-photo-wrap {
  position: relative;
  flex-shrink: 0;
  width: 250px;
  height: calc(250px * 125.79 / 89.02);
}

.venue-location-photo {
  position: absolute;
  width: 74.5%;
  height: 83.2%;
  left: 49.9%;
  top: 49.1%;
  transform: translate(-50%, -50%);
  object-fit: fill;
}

.venue-frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.venue-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.venue-name {
  font-family: var(--font-name);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.1;
}

.venue-address {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  color: rgba(250, 245, 235, 0.9);
  line-height: 1.7;
}

.venue-desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 300;
  color: rgba(250, 245, 235, 0.75);
  font-style: italic;
  line-height: 1.7;
}

.btn-route {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 28px;
  border: 1px solid rgba(250, 245, 235, 0.75);
  color: rgba(250, 245, 235, 0.9);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  border-radius: 40px;
  transition: background 0.2s;
}

.btn-route:hover {
  background: rgba(250, 245, 235, 0.1);
}

/* ============================================================
   4. TIMELINE
   ============================================================ */
.timeline {
  background: transparent;
  padding: 64px 0 56px;
}

.timeline .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline .script-heading {
  font-family: 'Nicoletta Script', cursive;
  font-size: 2.4rem;
  margin-bottom: 40px;
}

.timeline-wrapper {
  position: relative;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--green-light);
  opacity: 0.5;
  transform: translateX(-50%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 36px 1fr;
  align-items: start;
  padding: 20px 0;
  position: relative;
}

/* Icon always LEFT */
.timeline-item .timeline-icon-wrap {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  padding-right: 16px;
}

/* Bow on the center line */
.timeline-item .timeline-bow-wrap {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 6px;
}

/* Text always RIGHT */
.timeline-item .timeline-content {
  grid-column: 3;
  grid-row: 1;
  padding-left: 16px;
  text-align: left;
}

.tl-icon {
  width: 52px;
  height: 58px;
}

.tl-bow {
  width: 48px;
  height: 36px;
}

.timeline-time {
  font-family: 'Manege', var(--font-serif);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--green);
  line-height: 1;
}

.timeline-event {
  font-family: 'Manege', var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 4px;
}

.timeline-desc {
  font-family: 'Manege', var(--font-body);
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-light);
  line-height: 1.5;
  margin-top: 4px;
}

/* ============================================================
   5. DRESSCODE
   ============================================================ */
.dresscode {
  background: transparent;
  padding: 60px 0 56px;
}

.dresscode .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.dresscode .script-heading {
  font-size: 2.4rem;
}

.dresscode-desc {
  max-width: 340px;
  font-style: italic;
  color: var(--text-light);
}

.dresscode-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 420px;
}

.dc-photo {
  overflow: hidden;
  aspect-ratio: 2/3;
}

.dc-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
}

.dc-photo:hover img { transform: scale(1.04); }

.color-palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 240px;
  width: 100%;
  margin-top: 8px;
}

.color-swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.2s;
  cursor: default;
}

.color-swatch:hover { transform: scale(1.1); }

.dresscode-avoid {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-light);
  text-align: center;
  margin-top: 8px;
}

.dresscode-signature {
  font-family: var(--font-name);
  font-size: 2rem;
  color: var(--green);
  margin-top: 8px;
}

/* ============================================================
   6. CONTACT
   ============================================================ */
.contact .script-heading {
  font-family: 'Nicoletta Script', cursive;
  font-size: clamp(1.8rem, 6vw, 3.6rem);
  letter-spacing: 0.04em;
}

.envelope-letter .letter-text,
.envelope-lower .letter-text {
  font-family: 'Masvol', serif;
  font-weight: 100;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  line-height: 1.8;
}

.envelope-lower .letter-text {
  font-family: 'Matangi', serif;
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--dark);
}

.contact {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('assets/images/contact_bg.jpg') center center / cover no-repeat;
}

.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.envelope-mobile-card { display: none; }

.contact-overlay {
  position: relative;
  z-index: 1;
  padding: 48px 24px;
  width: 100%;
  max-width: 760px;
  display: flex;
  justify-content: center;
}

.letter-card {
  background: linear-gradient(145deg, #faf6ee, #f5efe2);
  border: 1px solid rgba(160, 130, 80, 0.3);
  box-shadow: 0 12px 48px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.8);
  padding: 36px 32px 32px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  text-align: center;
}

.letter-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 0.5px solid rgba(140, 110, 60, 0.2);
  pointer-events: none;
}

.letter-title {
  font-size: 2rem;
  color: var(--green) !important;
}

.letter-text {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text);
}

.letter-text.small { font-size: 0.72rem; color: var(--text-light); }

.letter-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(120,90,50,0.4), transparent);
}

.wax-seal {
  width: 56px;
  height: 56px;
  margin-top: 4px;
  filter: drop-shadow(0 3px 6px rgba(100,30,30,0.3));
}

.wax-seal svg { width: 100%; height: 100%; }

/* ============================================================
   7. FORM
   ============================================================ */
.form-section {
  background: transparent;
  padding: 64px 0 72px;
}

.form-section .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.form-deadline {
  font-family: 'Manege', var(--font-body);
  font-size: 2rem;
  font-weight: 300;
  color: #5A6B2B;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0;
}

.form-card {
  background: transparent;
  border: 1px solid #5A6B2B;
  border-radius: 16px;
  padding: 32px 28px 28px;
  max-width: 460px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.form-title {
  font-family: 'Manege', var(--font-body);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.2em;
  color: #5A6B2B;
  text-align: center;
  margin-bottom: 10px;
}

.form-subtitle {
  font-family: 'Manege', var(--font-body);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 24px;
}

form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #5A6B2B;
  background: transparent;
  font-family: 'Manege', var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  border-radius: 0;
  -webkit-appearance: none;
}

input[type="text"]::placeholder { color: rgba(90,70,50,0.45); }
input[type="text"]:focus { border-color: var(--green-light); }

.field-label {
  font-family: 'Manege', var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: 'Manege', var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  padding: 2px 0;
  user-select: none;
}

.radio-option input[type="radio"] { display: none; }

.radio-custom {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(100,80,50,0.4);
  border-radius: 2px;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s;
}

.radio-option input:checked ~ .radio-custom {
  border-color: var(--green);
  background: var(--green);
}

.radio-option input:checked ~ .radio-custom::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: var(--white);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.guest-counter {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
}

.counter-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #5A6B2B;
  background: transparent;
  color: #5A6B2B;
  font-size: 1.3rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.counter-btn:hover { background: rgba(90,107,43,0.08); }

.counter-display {
  font-family: 'Manege', var(--font-body);
  font-size: 1.5rem;
  color: var(--text);
  min-width: 24px;
  text-align: center;
}

.btn-submit {
  margin-top: 8px;
  padding: 12px 36px;
  background: #5A6B2B;
  color: var(--white);
  font-family: 'Manege', var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  align-self: center;
  border-radius: 24px;
}

.btn-submit:hover { background: var(--green-mid); }
.btn-submit:active { transform: scale(0.98); }

.form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 20px;
  text-align: center;
}

.form-success p {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--green);
}

/* ============================================================
   8. GALLERY / CLOSING
   ============================================================ */
.gallery {
  position: relative;
  background: url('assets/images/bg_bw.jpg') center center / cover no-repeat;
  background-color: var(--dark);
  overflow: hidden;
  padding: 60px 0 80px;
}

/* Moody smoke/cloud background overlay */
.gallery::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 60%, rgba(80,70,55,0.5) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 30%, rgba(65,55,45,0.4) 0%, transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 80%, rgba(40,35,30,0.6) 0%, transparent 80%);
  pointer-events: none;
}

.gallery-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 32px;
}

.closing-signature {
  font-size: 2.6rem;
  line-height: 1.25;
  text-align: right;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
  align-self: flex-end;
  padding-right: 10px;
}

.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4vw;
  width: 100%;
  max-width: 800px;
}

.polaroid {
  background: #f8f5ef;
  padding: 12px;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.5),
    0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

.polaroid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: grayscale(30%) contrast(0.95);
}

.polaroid--tilt-left  { transform: rotate(-7deg) translateX(-2vw); align-self: start; }
.polaroid--tilt-right { transform: rotate(6deg)  translateX(-3vw); margin-top: 60px; }

.polaroid:hover { transform: rotate(0deg) scale(1.03); z-index: 2; }

/* ============================================================
   1b. HERO DOILY
   ============================================================ */
.hero-doily {
  position: relative;
  width: min(500px, 88vw);
  z-index: 1;
}

.doily-img { width: 100%; height: auto; display: block; }

.hero-doily-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.swans-wrap { display: flex; justify-content: center; }
.swans-img  { max-width: 140px; height: auto; }

/* ============================================================
   4b. TIMELINE ICON FALLBACKS
   ============================================================ */
.tl-icon-img     { display: none; }
.tl-icon-fallback { display: block; }

/* ============================================================
   5b. DRESSCODE CAROUSEL
   ============================================================ */
.dc-carousel {
  position: relative;
  width: 100%;
  max-width: 300px;
  overflow: hidden;
}

.dc-track {
  display: flex;
  width: 100%;
  line-height: 0;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.dc-slide {
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: top center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Tap zones — mobile only */
.dc-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  z-index: 3;
  cursor: pointer;
}
.dc-tap--prev { left: 0; }
.dc-tap--next { right: 0; }

@media (min-width: 640px) {
  .dc-tap { display: none; }
}

.dc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(250,248,244,0.92);
  border: 1px solid rgba(100,80,50,0.22);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--green);
  padding: 0;
  transition: background 0.2s;
}

.dc-arrow:hover { background: rgba(232,226,212,1); }
.dc-arrow--prev { left: 6px; }
.dc-arrow--next { right: 6px; }

@media (max-width: 639px) {
  .dc-arrow { display: none; }

  .dc-tap--prev::after,
  .dc-tap--next::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    color: rgba(55,40,25,0.55);
    font-size: 0.85rem;
    line-height: 20px;
    text-align: center;
    pointer-events: none;
  }
  .dc-tap--prev::after { content: '‹'; left: 6px; }
  .dc-tap--next::after { content: '›'; right: 6px; }
}

.dc-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}

.dc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(100,80,50,0.22);
  cursor: pointer;
  transition: background 0.2s;
}

.dc-dot.active { background: var(--green); }

.dc-colors {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.dc-color-ellipse {
  width: 64px;
  height: auto;
}

/* ============================================================
   6b. ENVELOPE CONTACT
   ============================================================ */
.envelope-wrap {
  position: relative;
  max-width: 720px;
  width: 100%;
  filter: drop-shadow(0 12px 40px rgba(0,0,0,0.4));
}

.envelope-img {
  width: 100%;
  height: auto;
  display: block;
}

.envelope-heading {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  width: 68%;
  text-align: center;
}

.envelope-letter {
  position: absolute;
  top: 27%;
  left: 50%;
  transform: translateX(-50%);
  width: 68%;
  text-align: center;
}

.envelope-seal {
  position: absolute;
  top: 59%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16%;
}

.envelope-seal img {
  width: 100%;
  height: auto;
  display: block;
}

.envelope-lower {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 65%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn-contact {
  display: inline-block;
  padding: 7px 24px;
  border: 1px solid var(--green);
  border-radius: 24px;
  color: var(--green);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-decoration: none;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.btn-contact:hover {
  background: var(--green);
  color: #fff;
}

/* Form success text */
.form-success-text {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--green);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Маленький телефон (< 390px) ── */
@media (max-width: 389px) {
  .hero-names       { font-size: 2rem; }
  .big-date         { font-size: 2.6rem; }
  .timeline-time    { font-size: 1.35rem; }
  .form-deadline    { font-size: 1.6rem; }
  .closing-signature { font-size: 2.1rem; }
  .dc-color-ellipse { width: 52px; }

  .envelope-letter .letter-text,
  .envelope-lower  .letter-text { font-size: 0.95rem; }
  .contact .script-heading      { font-size: 2.8rem; }
}

/* ── Мобильный (< 640px) ── */
@media (max-width: 639px) {

  /* Contact: конверт на мобиле — мелкий шрифт */
  .envelope-letter .letter-text,
  .envelope-lower  .letter-text { font-size: 0.62rem; letter-spacing: 0.02em; }
  .contact .script-heading      { font-size: clamp(1.4rem, 7vw, 2.4rem); }
  .envelope-letter              { top: 28%; }

  /* Hero */
  .hero-card        { max-width: 66vw; }
  .hero-card-border { padding: 34px 24px 28px; }
  .hero-doily-content { gap: 2px; }
  .hero-swans       { width: 54px; }
  .hero-names       { font-size: 2.0rem; }
  .hero-date        { font-size: 0.9rem; margin-top: 10px; }

  /* Venue: убираем звонок, стекуем вертикально */
  .venue-doorbell { display: none; }

  .venue-layout {
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }

  .venue-photo-wrap {
    width: min(200px, 55vw);
    height: calc(min(200px, 55vw) * 125.79 / 89.02);
  }

  .venue-info {
    align-items: center;
    text-align: center;
  }

  .venue-heading { font-size: 2.4rem; }
  .venue-name    { font-size: 1.8rem; }

  /* Gallery: поляроиды без крупных трансформаций */
  .polaroid--tilt-left  { transform: rotate(-4deg) translateX(-1vw); }
  .polaroid--tilt-right { transform: rotate(3deg)  translateX(-1vw); margin-top: 30px; }

  /* Form */
  .form-card    { padding: 24px 18px 22px; }
  .form-title   { font-size: 1.4rem; }
  .form-subtitle { font-size: 1rem; }
}

/* ── Планшет и десктоп (≥ 640px) ── */
@media (min-width: 640px) {
  .hero-names { font-size: 3rem; }
  .hero-card  { max-width: 220px; }

  .invitation .script-heading { font-size: 2.8rem; }
  .big-date   { font-size: 4rem; }

  .venue-heading              { font-size: 3rem; }
  .venue-photo-wrap           { width: 260px; height: calc(260px * 125.79 / 89.02); }

  .timeline .script-heading   { font-size: 3rem; }
  .timeline-wrapper           { max-width: 440px; }

  .dresscode .script-heading  { font-size: 3rem; }

  .contact .script-heading    { font-size: 3.6rem; }
  .envelope-wrap              { max-width: 576px; }

  .closing-signature          { font-size: 3.2rem; }
  .gallery-inner              { max-width: 900px; padding: 0 32px; }
}

/* ── Широкий десктоп (≥ 900px) ── */
@media (min-width: 900px) {
  .hero-card        { max-width: 364px; }
  .hero-card-border { padding: 35px 24px 29px; }
  .venue-doorbell   { display: block; }
  .timeline-wrapper { max-width: 500px; }
  .dc-color-ellipse { width: 72px; }
}
