/* ===================================================
   Joseph Alexander Liba — Baptism Invitation
   =================================================== */

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

:root {
  --sky-top: #c9dff5;
  --sky-bottom: #e8f4fd;
  --cream: #fdfaf4;
  --card-bg: #ffffff;
  --gold: #c9a84c;
  --gold-light: #f0d98a;
  --gold-dark: #a07a30;
  --text-dark: #3a2a0f;
  --text-mid: #6b4f2a;
  --text-soft: #9b7c52;
  --navy: #1a3a5c;
  --blue-accent: #5b8fc9;
  --shimmer-1: #d4af37;
  --shimmer-2: #f7e87a;
  --shimmer-3: #b8962e;
  --shimmer-4: #fff1a0;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(160deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

/* ===================================================
   BACKGROUND — Floating clouds
   =================================================== */

.clouds-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background-image: url('clouds.png');
  background-size: contain;
  background-repeat: no-repeat;
  animation: drift linear infinite;
  opacity: 0.35;
}

@keyframes drift {
  from { transform: translateX(-300px); }
  to   { transform: translateX(calc(100vw + 300px)); }
}

/* ===================================================
   SUN CHARACTER
   =================================================== */

.sun-character {
  position: fixed;
  top: 24px;
  right: 32px;
  width: 90px;
  height: 90px;
  z-index: 10;
  animation: sun-pulse 4s ease-in-out infinite;
  cursor: default;
  user-select: none;
}

@keyframes sun-pulse {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50%       { transform: scale(1.06) rotate(2deg); }
}

.sun-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 200, 80, 0.45) 0%, transparent 70%);
  animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

.sun-rays {
  position: absolute;
  inset: 0;
  animation: spin-rays 20s linear infinite;
}

@keyframes spin-rays { to { transform: rotate(360deg); } }

/* Sun character is 90×90px. Face is inset:10px → radius 35px, center at (45,45).
   Ray starts at y=7px (just outside face). transform-origin y = 45-7 = 38px
   → pivot lands exactly on sun center for all rotations. */
.ray {
  position: absolute;
  top: 7px;
  left: calc(50% - 2px);
  width: 4px;
  height: 15px;
  background: linear-gradient(to bottom, #f7d775, transparent);
  border-radius: 2px 2px 0 0;
  transform-origin: 2px 38px;
}

.ray:nth-child(1) { transform: rotate(0deg);   }
.ray:nth-child(2) { transform: rotate(45deg);  }
.ray:nth-child(3) { transform: rotate(90deg);  }
.ray:nth-child(4) { transform: rotate(135deg); }
.ray:nth-child(5) { transform: rotate(180deg); }
.ray:nth-child(6) { transform: rotate(225deg); }
.ray:nth-child(7) { transform: rotate(270deg); }
.ray:nth-child(8) { transform: rotate(315deg); }

.sun-face {
  position: absolute;
  inset: 10px;
  background: radial-gradient(circle at 38% 35%, #ffe88a, #f5c842);
  border-radius: 50%;
  box-shadow:
    inset 0 -4px 8px rgba(180, 120, 0, 0.25),
    0 3px 12px rgba(200, 140, 0, 0.35);
}

.sun-eye {
  position: absolute;
  top: 32%;
  width: 14px; height: 18px;
  background: #fff;
  border-radius: 50%;
  border: 1.5px solid rgba(140, 90, 0, 0.3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sun-eye.left  { left: 24%; }
.sun-eye.right { right: 24%; }

.sun-pupil {
  width: 7px; height: 7px;
  background: #3a2a0f;
  border-radius: 50%;
  transition: transform 0.08s ease-out;
  will-change: transform;
}

.sun-cheek {
  position: absolute;
  top: 52%;
  width: 12px; height: 6px;
  background: rgba(255, 140, 100, 0.45);
  border-radius: 50%;
}
.sun-cheek.left  { left: 14%; }
.sun-cheek.right { right: 14%; }

.sun-mouth {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 11px;
  border: 2.5px solid rgba(140, 90, 0, 0.7);
  border-top: none;
  border-radius: 0 0 22px 22px;
}

/* Blinking */
.sun-eye { animation: blink 5s ease-in-out infinite; }
@keyframes blink {
  0%, 90%, 100% { transform: scaleY(1); }
  95%            { transform: scaleY(0.1); }
}

/* ===================================================
   CARD WRAPPER + 3D TILT
   =================================================== */

.card-wrapper {
  position: relative;
  z-index: 5;
  perspective: 1200px;
  padding: 40px 20px;
  width: 100%;
  max-width: 860px;
}

.invitation-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 36px 44px 28px;
  box-shadow:
    0 8px 40px rgba(58, 42, 15, 0.12),
    0 2px 12px rgba(58, 42, 15, 0.08),
    0 0 0 1px rgba(200, 168, 80, 0.18);
  transform-style: preserve-3d;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
  will-change: transform;
  position: relative;
  overflow: hidden;
}

/* Paper texture spots */
.invitation-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(200, 168, 80, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(180, 140, 60, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* Spotlight highlight following cursor */
.invitation-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at calc(var(--x, 50%)) calc(var(--y, 50%)),
    rgba(255, 248, 220, 0.6) 0%,
    rgba(255, 248, 220, 0.15) 35%,
    transparent 65%
  );
  pointer-events: none;
  border-radius: inherit;
  transition: background 0.1s ease-out;
}

.invitation-card:hover {
  box-shadow:
    0 16px 60px rgba(58, 42, 15, 0.18),
    0 4px 20px rgba(58, 42, 15, 0.1),
    0 0 0 1px rgba(200, 168, 80, 0.28);
}

/* ===================================================
   CARD INNER LAYOUT
   =================================================== */

.card-inner {
  display: flex;
  gap: 36px;
  align-items: center;
  margin-bottom: 24px;
}

.card-text {
  flex: 1;
  min-width: 0;
}

.card-illustration {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ===================================================
   ORNAMENT + TITLE
   =================================================== */

.cross-ornament {
  font-size: 1em;
  color: var(--gold);
  letter-spacing: 6px;
  margin-bottom: 10px;
  text-align: center;
}

.title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  line-height: 1.15;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.title-line {
  display: block;
  background: linear-gradient(
    90deg,
    var(--shimmer-3) 0%,
    var(--shimmer-1) 25%,
    var(--shimmer-2) 50%,
    var(--shimmer-4) 60%,
    var(--shimmer-1) 75%,
    var(--shimmer-3) 100%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  from { background-position: 250% center; }
  to   { background-position: 0% center; }
}

.title-line:first-child { font-size: 1.7em; }
.title-line.sub         { font-size: 0.95em; font-style: normal; letter-spacing: 4px; margin: 2px 0; }
.title-line.name-line   { font-size: 2em; font-weight: 600; font-style: normal; line-height: 1.05; }

/* ===================================================
   INTRO + DETAILS
   =================================================== */

.intro-text {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9em;
  color: var(--text-mid);
  text-align: center;
  margin-bottom: 18px;
  line-height: 1.6;
  font-weight: 400;
}

.details-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.detail-icon {
  font-size: 1.3em;
  line-height: 1.3;
  flex-shrink: 0;
}

.detail-label {
  font-size: 0.7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-dark);
  margin-bottom: 1px;
}

.detail-value {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

.address-value {
  cursor: pointer;
}

/* ===================================================
   ACTION BUTTONS
   =================================================== */

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 50px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.9em;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  box-shadow: 0 3px 12px rgba(160, 120, 40, 0.35);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(160, 120, 40, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-full {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.btn-secondary {
  background: linear-gradient(135deg, #faf3db, #f5e9b8);
  color: var(--gold-dark);
  border: 1.5px solid rgba(200, 168, 80, 0.4);
  box-shadow: 0 2px 8px rgba(160, 120, 40, 0.15);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #f5e9b8, #f0d98a);
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(160, 120, 40, 0.25);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-icon {
  display: flex;
  align-items: center;
}

.btn-icon.copied svg {
  stroke: #4caf50;
}

/* ===================================================
   ILLUSTRATION — Dove art
   =================================================== */

.dove-art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: float 4s ease-in-out infinite;
  will-change: transform;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

.dove-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #e8f4fd, #c9dff5);
  border: 2px solid rgba(200, 168, 80, 0.3);
  box-shadow:
    0 8px 30px rgba(91, 143, 201, 0.2),
    inset 0 2px 8px rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.dove-emoji {
  font-size: 5em;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(91, 143, 201, 0.4));
  animation: dove-bob 3s ease-in-out infinite;
}

@keyframes dove-bob {
  0%, 100% { transform: rotate(-5deg) scale(1); }
  50%       { transform: rotate(5deg) scale(1.05); }
}

.dove-glow {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(240, 220, 120, 0.2) 0%, transparent 70%);
  animation: glow-pulse 3s ease-in-out infinite;
}

.baptism-drops {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.drop {
  display: block;
  width: 8px;
  height: 12px;
  background: linear-gradient(to bottom, #a8d4f0, #5b8fc9);
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  animation: drip 2s ease-in-out infinite;
}

.drop:nth-child(1) { animation-delay: 0s; }
.drop:nth-child(2) { animation-delay: 0.3s; }
.drop:nth-child(3) { animation-delay: 0.6s; }

@keyframes drip {
  0%, 100% { opacity: 0.4; transform: translateY(0) scaleY(1); }
  50%       { opacity: 1;   transform: translateY(4px) scaleY(1.2); }
}

.baby-name-art {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1em;
  font-style: italic;
  font-weight: 300;
  color: var(--gold-dark);
  letter-spacing: 2px;
  text-align: center;
  opacity: 0.85;
}

/* ===================================================
   CARD FOOTER — Scripture quote
   =================================================== */

.card-footer {
  border-top: 1px solid rgba(200, 168, 80, 0.25);
  padding-top: 24px;
  text-align: center;
}

.footer-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95em;
  color: var(--text-soft);
  line-height: 1.8;
}

/* ===================================================
   EMOJI POPUP
   =================================================== */

.emoji-popup {
  position: fixed;
  font-size: 2em;
  pointer-events: none;
  z-index: 999;
  animation: popup-fly 1.4s ease-out forwards;
}

@keyframes popup-fly {
  0%   { transform: translateY(0) scale(0.5); opacity: 1; }
  100% { transform: translateY(-80px) scale(1.2); opacity: 0; }
}

/* ===================================================
   COPY ADDRESS FEEDBACK
   =================================================== */

@keyframes copied-flash {
  0%   { background: linear-gradient(135deg, #d4edda, #b8dfc6); }
  100% { background: linear-gradient(135deg, #faf3db, #f5e9b8); }
}

.copied-flash {
  animation: copied-flash 0.4s ease-out;
}

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

@media (max-width: 768px) {
  .card-wrapper {
    padding: 20px 12px;
  }

  .invitation-card {
    padding: 32px 24px 28px;
  }

  .card-inner {
    flex-direction: column-reverse;
    gap: 28px;
  }

  .dove-circle {
    width: 130px;
    height: 130px;
  }

  .dove-emoji {
    font-size: 3.5em;
  }

  .title-line:first-child { font-size: 1.3em; }
  .title-line.sub         { font-size: 0.8em; }
  .title-line.name-line   { font-size: 1.6em; }

  .sun-character {
    transform: scale(0.65);
    transform-origin: top right;
    top: 10px;
    right: 12px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}

@media (hover: none) {
  .invitation-card {
    transform: none !important;
  }
}

/* ===================================================
   RSVP MODAL
   =================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 50, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow:
    0 24px 60px rgba(20, 30, 50, 0.3),
    0 0 0 1px rgba(200, 168, 80, 0.2);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1em;
  color: var(--text-soft);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.modal-close:hover {
  background: rgba(0,0,0,0.06);
}

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

.modal-step.hidden {
  display: none;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6em;
  font-style: italic;
  font-weight: 300;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.3;
}

/* ── Option buttons ── */

.rsvp-options {
  display: flex;
  gap: 12px;
  width: 100%;
}

.rsvp-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  border: 2px solid rgba(200, 168, 80, 0.25);
  border-radius: 14px;
  background: #fdfaf4;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
  touch-action: manipulation;
}

.rsvp-option:hover {
  border-color: var(--gold);
  background: #fffaed;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(160, 120, 40, 0.15);
}

.rsvp-option:active {
  transform: translateY(0);
}

.rsvp-option.selected {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fffaed, #fff3cc);
  box-shadow: 0 4px 14px rgba(160, 120, 40, 0.2);
}

.option-icon {
  font-size: 2em;
  line-height: 1;
}

.option-label {
  font-size: 0.78em;
  font-weight: 700;
  color: var(--text-mid);
  text-align: center;
}

/* ── Step 2 form ── */

.modal-response-msg {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25em;
  font-style: italic;
  color: var(--text-mid);
  text-align: center;
  line-height: 1.4;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.modal-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(200, 168, 80, 0.35);
  border-radius: 10px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9em;
  color: var(--text-dark);
  background: #fdfaf4;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: none;
}

.modal-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 168, 80, 0.15);
}

.modal-textarea {
  min-height: 80px;
}

/* ── Step 3 confirm ── */

.confirm-icon {
  font-size: 3.5em;
  line-height: 1;
  animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes pop-in {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.confirm-msg {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3em;
  font-style: italic;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.5;
}

/* ===================================================
   CONFETTI
   =================================================== */

.confetti-piece {
  position: fixed;
  top: -20px;
  width: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 200;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0%   { transform: translateY(0)    rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}
