:root {
  --pearl-1: #fdf6f8;
  --pearl-2: #f8eef2;
  --pearl-3: #f3e8ee;
  --pearl-4: #efe4ea;
  --text-dark: #3a2f35;
  --text-muted: #6b5d63;
  --accent: #c9a0a8;
  --accent-light: #e8cdd3;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Great Vibes', cursive;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  color: var(--text-dark);
  background:
    linear-gradient(160deg, #fef8fa 0%, #f9eef2 20%, #f5e8ee 40%, #f0e4ea 60%, #f7edf1 80%, #fef8fa 100%);
  background-size: 300% 300%;
  animation: pearlShift 14s ease-in-out infinite;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

@keyframes pearlShift {
  0%, 100% { background-position: 0% 0%; }
  33% { background-position: 100% 50%; }
  66% { background-position: 50% 100%; }
}

/* Iridescent shimmer sweep */
.shimmer-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.15) 42%,
    rgba(255, 240, 248, 0.45) 48%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(240, 230, 255, 0.35) 52%,
    rgba(255, 240, 248, 0.45) 56%,
    rgba(255, 255, 255, 0.15) 60%,
    transparent 65%,
    transparent 100%
  );
  background-size: 250% 100%;
  animation: shimmerSweep 9s ease-in-out infinite;
}

.iridescent-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 15% 20%, rgba(255, 255, 255, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 75%, rgba(255, 220, 235, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 50% 50%, rgba(255, 255, 255, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 90% 15%, rgba(230, 220, 255, 0.2) 0%, transparent 45%),
    radial-gradient(ellipse 40% 30% at 10% 85%, rgba(255, 230, 240, 0.25) 0%, transparent 45%);
  animation: iridescentPulse 10s ease-in-out infinite alternate;
}

@keyframes shimmerSweep {
  0% { background-position: 200% 0; opacity: 0.7; }
  50% { opacity: 1; }
  100% { background-position: -100% 0; opacity: 0.7; }
}

@keyframes iridescentPulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.02); }
}

/* Pearl edges */
.pearl-edges {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.pearl-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
}

@media (min-width: 769px) {
  .pearl-edge {
    width: 32px;
  }

  .pearl-edge-left .pearl-roll:nth-child(1),
  .pearl-edge-left .pearl-roll:nth-child(4),
  .pearl-edge-left .pearl-roll:nth-child(7),
  .pearl-edge-left .pearl-roll:nth-child(10) { left: 6px; }

  .pearl-edge-left .pearl-fall:nth-child(2),
  .pearl-edge-left .pearl-fall:nth-child(5),
  .pearl-edge-left .pearl-fall:nth-child(8) { left: 14px; }

  .pearl-edge-left .pearl-float:nth-child(3),
  .pearl-edge-left .pearl-float:nth-child(6),
  .pearl-edge-left .pearl-float:nth-child(9) { left: 10px; }

  .pearl-edge-right .pearl-roll:nth-child(2),
  .pearl-edge-right .pearl-roll:nth-child(5),
  .pearl-edge-right .pearl-roll:nth-child(8) { right: 6px; }

  .pearl-edge-right .pearl-fall:nth-child(1),
  .pearl-edge-right .pearl-fall:nth-child(4),
  .pearl-edge-right .pearl-fall:nth-child(7),
  .pearl-edge-right .pearl-fall:nth-child(10) { right: 10px; }

  .pearl-edge-right .pearl-float:nth-child(3),
  .pearl-edge-right .pearl-float:nth-child(6),
  .pearl-edge-right .pearl-float:nth-child(9) { right: 8px; }
}

.pearl-edge-left { left: 0; }
.pearl-edge-right { right: 0; }

.pearl {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 28% 25%,
    #ffffff 0%,
    #fff0f4 18%,
    #f0b8c6 45%,
    #d890a4 72%,
    #b87088 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    inset -2px -3px 5px rgba(255, 255, 255, 0.95),
    inset 2px 2px 4px rgba(140, 80, 100, 0.35),
    0 1px 3px rgba(160, 90, 110, 0.45),
    0 0 10px rgba(220, 140, 165, 0.65),
    0 0 20px rgba(255, 200, 215, 0.5);
  opacity: 0;
}

.pearl-sm { width: 9px; height: 9px; }
.pearl-lg { width: 17px; height: 17px; }

/* Rolling down the edge */
.pearl-roll {
  animation: pearlRoll 14s linear infinite;
}

.pearl-edge-left .pearl-roll:nth-child(1) { left: 18px; animation-delay: 0s; animation-duration: 13s; }
.pearl-edge-left .pearl-roll:nth-child(4) { left: 42px; animation-delay: 4s; animation-duration: 16s; }
.pearl-edge-left .pearl-roll:nth-child(7) { left: 28px; animation-delay: 8s; animation-duration: 12s; }
.pearl-edge-left .pearl-roll:nth-child(10) { left: 52px; animation-delay: 11s; animation-duration: 15s; }

.pearl-edge-right .pearl-roll:nth-child(2) { right: 22px; left: auto; animation-delay: 2s; animation-duration: 14s; }
.pearl-edge-right .pearl-roll:nth-child(5) { right: 48px; left: auto; animation-delay: 6s; animation-duration: 17s; }
.pearl-edge-right .pearl-roll:nth-child(8) { right: 30px; left: auto; animation-delay: 9s; animation-duration: 13s; }

/* Gentle falling with sway */
.pearl-fall {
  animation: pearlFall 11s ease-in-out infinite;
}

.pearl-edge-left .pearl-fall:nth-child(2) { left: 55px; animation-delay: 1s; animation-duration: 12s; }
.pearl-edge-left .pearl-fall:nth-child(5) { left: 12px; animation-delay: 5s; animation-duration: 14s; }
.pearl-edge-left .pearl-fall:nth-child(8) { left: 38px; animation-delay: 9s; animation-duration: 11s; }

.pearl-edge-right .pearl-fall:nth-child(1) { right: 15px; left: auto; animation-delay: 0s; animation-duration: 13s; }
.pearl-edge-right .pearl-fall:nth-child(4) { right: 42px; left: auto; animation-delay: 4s; animation-duration: 15s; }
.pearl-edge-right .pearl-fall:nth-child(7) { right: 55px; left: auto; animation-delay: 7s; animation-duration: 12s; }
.pearl-edge-right .pearl-fall:nth-child(10) { right: 25px; left: auto; animation-delay: 10s; animation-duration: 14s; }

/* Floating shimmer on the edge */
.pearl-float {
  animation: pearlFloat 8s ease-in-out infinite;
}

.pearl-edge-left .pearl-float:nth-child(3) { left: 32px; top: 30%; animation-delay: 0.5s; }
.pearl-edge-left .pearl-float:nth-child(6) { left: 8px; top: 55%; animation-delay: 3s; }
.pearl-edge-left .pearl-float:nth-child(9) { left: 48px; top: 78%; animation-delay: 6s; }

.pearl-edge-right .pearl-float:nth-child(3) { right: 35px; left: auto; top: 22%; animation-delay: 1.5s; }
.pearl-edge-right .pearl-float:nth-child(6) { right: 12px; left: auto; top: 48%; animation-delay: 4s; }
.pearl-edge-right .pearl-float:nth-child(9) { right: 50px; left: auto; top: 72%; animation-delay: 7.5s; }

@keyframes pearlRoll {
  0% {
    top: -5%;
    opacity: 0;
    transform: translateX(0) rotate(0deg) scale(0.6);
  }
  8% { opacity: 1; }
  50% {
    transform: translateX(6px) rotate(180deg) scale(1.05);
  }
  92% { opacity: 1; }
  100% {
    top: 105%;
    opacity: 0;
    transform: translateX(-4px) rotate(360deg) scale(0.7);
  }
}

@keyframes pearlFall {
  0% {
    top: -8%;
    opacity: 0;
    transform: translateX(0) scale(0.5);
  }
  10% { opacity: 1; }
  30% { transform: translateX(12px) scale(1.05); }
  60% { transform: translateX(-8px) scale(1); }
  90% { opacity: 0.95; }
  100% {
    top: 108%;
    opacity: 0;
    transform: translateX(5px) scale(0.6);
  }
}

@keyframes pearlFloat {
  0%, 100% {
    opacity: 0.75;
    transform: translateY(0) scale(0.95);
    filter: brightness(1.05);
  }
  25% {
    opacity: 1;
    transform: translateY(-12px) scale(1.15);
    filter: brightness(1.25);
  }
  50% {
    opacity: 0.85;
    transform: translateY(6px) scale(1.02);
    filter: brightness(1.1);
  }
  75% {
    opacity: 1;
    transform: translateY(-8px) scale(1.1);
    filter: brightness(1.2);
  }
}

@media (max-width: 600px) {
  .pearl-edge { width: 40px; }
  .pearl { width: 9px; height: 9px; }
  .pearl-sm { width: 7px; height: 7px; }
  .pearl-lg { width: 13px; height: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .shimmer-layer,
  .iridescent-layer,
  .pearl {
    animation: none !important;
  }
  .pearl { opacity: 0.75; }
}

main {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.section {
  text-align: center;
  padding: 60px 0;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }
.section:nth-child(6) { animation-delay: 0.6s; }
.section:nth-child(7) { animation-delay: 0.7s; }

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

.section-label {
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.section-title {
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dark);
}

.script-title {
  font-family: var(--font-script);
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-dark);
  max-width: 600px;
  margin: 0 auto;
}

.script-heading {
  font-family: var(--font-script);
  font-size: 3rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.hero {
  padding-top: 80px;
  padding-bottom: 40px;
}

.hero-label {
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.date-display {
  font-size: 1.8rem;
  letter-spacing: 0.2em;
  margin-top: 32px;
  color: var(--text-dark);
}

.divider {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin: 20px auto;
}

.divider.wavy {
  width: 80px;
  height: 8px;
  background: none;
  border: none;
  position: relative;
}

.divider.wavy::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 8'%3E%3Cpath d='M0 4 Q10 0 20 4 T40 4 T60 4 T80 4' fill='none' stroke='%23c9a0a8' stroke-width='1'/%3E%3C/svg%3E") no-repeat center;
}

/* Venue */
.venue-name {
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 24px;
}

.venue-address {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.map-container {
  width: 100%;
  height: 320px;
  margin-top: 32px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(58, 47, 53, 0.08);
}

/* Timeline */
.timeline {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.timeline-item {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 28px;
}

.timeline-time {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 72px;
  text-align: right;
  flex-shrink: 0;
}

.timeline-title {
  font-size: 1.15rem;
  color: var(--text-dark);
  min-width: 160px;
  text-align: left;
}

/* Dress code */
.dress-code-title {
  font-family: var(--font-script);
  font-size: clamp(2.4rem, 7vw, 3.5rem);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.2;
}

.dress-text {
  font-size: 1.15rem;
  max-width: 500px;
  margin: 24px auto 32px;
  line-height: 1.7;
}

.color-palette {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px;
}

.brush-stroke {
  position: relative;
  width: 56px;
  height: 72px;
  transform: rotate(-15deg);
  border-radius: 50% 40% 60% 30%;
  opacity: 0.85;
  filter: blur(0.3px);
  transition: transform 0.3s ease;
  cursor: default;
}

.brush-stroke:hover {
  transform: rotate(-15deg) scale(1.1);
  z-index: 2;
}

.color-label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) rotate(15deg);
  padding: 6px 12px;
  background: rgba(58, 47, 53, 0.88);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 12px rgba(58, 47, 53, 0.15);
}

.color-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(58, 47, 53, 0.88);
}

.brush-stroke:hover .color-label {
  opacity: 1;
  transform: translateX(-50%) rotate(15deg) translateY(-4px);
}

/* RSVP */
.rsvp-deadline {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 24px 0 32px;
}

.rsvp-form {
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--accent-light);
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-dark);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.attendance-toggle {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--accent-light);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.toggle-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.8);
}

.toggle-btn.active {
  border-color: var(--accent);
  background: rgba(201, 160, 168, 0.15);
}

.check-icon {
  width: 22px;
  height: 22px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s;
}

.toggle-btn.active .check-icon {
  background: var(--accent);
  color: white;
}

.checkbox-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.checkbox-item:hover {
  background: rgba(255, 255, 255, 0.5);
}

.checkbox-item input {
  display: none;
}

.checkbox-item .custom-check {
  width: 20px;
  height: 20px;
  border: 1px solid var(--accent-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s;
}

.checkbox-item input:checked + .custom-check {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.submit-btn:hover {
  background: #b88e96;
}

.form-message {
  text-align: center;
  margin-top: 16px;
  font-size: 1rem;
  min-height: 24px;
}

.form-message.success {
  color: #5a8a5a;
}

.form-message.error {
  color: #a05050;
}

.absence-message {
  animation: fadeInUp 0.4s ease;
}

.absence-box {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--accent-light);
  box-shadow: 0 4px 20px rgba(201, 160, 168, 0.12);
}

.absence-box-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.absence-box-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.absence-box textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--accent-light);
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-dark);
  resize: vertical;
}

.absence-box textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.countdown-value {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1;
}

.countdown-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}

.countdown-sep {
  font-size: 2rem;
  color: var(--accent);
  margin-top: -16px;
}

/* Contacts */
.contact-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 20px;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.contact-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.contact-name {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.contact-phone,
.contact-email {
  display: inline-block;
  font-size: 1.4rem;
  color: var(--text-dark);
  text-decoration: none;
  margin-top: 8px;
  transition: color 0.2s;
}

.contact-phone:hover,
.contact-email:hover {
  color: var(--accent);
}

.footer-note {
  margin-top: 48px;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text-muted);
}

@media (min-width: 769px) {
  html {
    font-size: 18px;
  }

  main {
    max-width: 780px;
    padding: 48px 32px 100px;
  }

  .section-label,
  .hero-label {
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .script-title {
    font-size: 3.6rem;
    max-width: 680px;
  }

  .dress-code-title {
    font-size: 4rem;
  }

  .date-display {
    font-size: 2.2rem;
  }

  .venue-name {
    font-size: 1.75rem;
  }

  .venue-address,
  .dress-text,
  .rsvp-deadline,
  .contact-text {
    font-size: 1.25rem;
  }

  .timeline-time {
    font-size: 1.6rem;
  }

  .timeline-title {
    font-size: 1.3rem;
  }

  .form-group label {
    font-size: 1.1rem;
  }

  .toggle-btn {
    font-size: 1.1rem;
    padding: 16px 20px;
  }

  .countdown-value {
    font-size: 3rem;
  }

  .contact-phone,
  .contact-email {
    font-size: 1.6rem;
  }

  .footer-note {
    font-size: 1.35rem;
  }
}

@media (max-width: 600px) {
  main {
    padding: 24px 16px 60px;
  }

  .section {
    padding: 40px 0;
  }

  .script-title {
    font-size: 1.8rem;
  }

  .timeline-item {
    gap: 20px;
  }

  .timeline-time {
    font-size: 1.2rem;
    min-width: 60px;
  }

  .timeline-title {
    min-width: 140px;
    font-size: 1.05rem;
  }

  .countdown-value {
    font-size: 1.8rem;
  }

  .countdown-item {
    min-width: 44px;
  }

  .brush-stroke {
    width: 44px;
    height: 58px;
  }
}
