@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;600;700&family=Lato:wght@300;400;700&display=swap');

:root {
  --primary: #6385a4;
  --primary-dark: #122941;
  --cream: #f4eee7;
  --white: #ffffff;
  --text-main: #333;
  --text-muted: #666;
  
  --font-title: 'Dancing Script', cursive;
  --font-ui: 'Lato', sans-serif;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0; padding: 0;
  font-family: var(--font-ui);
  color: var(--text-main);
  background: var(--cream);
  overflow-x: hidden;
}

.invitation-container {
  max-width: 500px;
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* Animations */
@keyframes shake-vertical {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes shake-vertical-reverse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
@keyframes shake-bottom {
  0%, 100% { transform: rotate(0deg); transform-origin: bottom center; }
  50% { transform: rotate(2deg); transform-origin: bottom center; }
}
@keyframes vibrate-1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 2px); }
  50% { transform: translate(2px, -2px); }
  75% { transform: translate(2px, 2px); }
}
.shake-vertical { animation: shake-vertical 4s ease-in-out infinite; }
.shake-vertical-reverse { animation: shake-vertical-reverse 4.5s ease-in-out infinite; }
.shake-bottom { animation: shake-bottom 6s ease-in-out infinite; }
.vibrate-1-8s { animation: vibrate-1 8s linear infinite; }
.vibrate-1-10s { animation: vibrate-1 10s linear infinite; }
.vibrate-1-15s { animation: vibrate-1 15s linear infinite; }

/* Blocks Setup */
.block {
  position: relative;
  padding: 60px 20px;
  z-index: 1;
}

/* 1. First Block: Gradient Krem & Foto Header */
.block-header {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  position: relative;
  padding-bottom: 80px;
  /* background will be injected inline */
}
.ornament-abs {
  position: absolute;
  z-index: 2;
}

/* 2. Second Block: Mempelai (Biru) */
.block-mempelai {
  background: var(--primary-dark);
  color: var(--white);
  text-align: center;
  margin: 0;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  position: relative;
  z-index: 2;
  margin-top: -30px;
  padding-top: 80px;
}
.mempelai-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 40px;
}
.mempelai-photo {
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  margin-bottom: 10px;
}
.mempelai-name {
  font-family: var(--font-title);
  font-size: 2.4rem;
  color: var(--white);
  margin: 0;
}

/* 3. Third Block: Acara, Kisah, Galeri (Cream + Ornaments) */
.block-cream {
  background: var(--cream);
  color: var(--primary-dark);
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  margin-top: -30px;
  position: relative;
  z-index: 3;
}
.card-event {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.05);
  position: relative;
}
.card-event h3 {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--primary);
  margin: 0 0 10px;
}

/* 4. Fourth Block: RSVP (Biru) */
.block-blue {
  background: var(--primary-dark);
  color: var(--white);
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  margin-top: -30px;
  position: relative;
  z-index: 4;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  color: var(--primary-dark);
  margin-bottom: 15px;
  font-family: var(--font-ui);
}
.form-input::placeholder { color: rgba(0,0,0,0.4); }
select option { color: #000; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
}

/* Base Typo */
.title {
  font-family: var(--font-title);
  font-size: 3rem;
  line-height: 1.1;
  color: var(--primary-dark);
  margin: 0;
}
.title.white { color: #fff; }
.subtitle {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  font-weight: 700;
}
.subtitle.white { color: rgba(255,255,255,0.8); }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.gallery-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
}

/* Timeline */
.timeline {
  border-left: 2px solid var(--primary);
  margin-left: 10px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: left;
}
.timeline-item {
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  background: var(--primary);
  border-radius: 50%;
  left: -27px;
  top: 5px;
}
.timeline-item img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* Responsive Fix for Short Mobile Screens */
@media screen and (max-height: 750px) {
  .cover-frame-wrapper {
      min-height: 280px !important;
  }
  .cover-names {
      font-size: 3rem !important;
  }
  .cover-section {
      padding: 15px 15px !important;
  }
  .cover-text-bottom {
      margin-top: 15px !important;
  }
}
@media screen and (max-height: 650px) {
  .cover-frame-wrapper {
      min-height: 220px !important;
  }
  .cover-names {
      font-size: 2.5rem !important;
  }
  .cover-title-top {
      margin-bottom: 10px !important;
  }
}
