/* ══════════════════════════════════════════
   DATE INVITE — style.css
   Elements: Bridges · Spring Flowers · Flight · FaceTime
══════════════════════════════════════════ */

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

:root {
  --r:     #d4614e;
  --r2:    #b84a38;
  --peach: #f0a07a;
  --cream: #fdf3e9;
  --gold:  #c9893e;
  --gold2: #e8b86d;
  --blush: #f5c4aa;
  --deep:  #2b1510;
  --text:  #4a2518;
}

html { scroll-behavior: smooth; }

body {
  background: var(--deep);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  color: var(--cream);
  overflow-x: hidden;
}

/* ══════════════════════════════════════════
   CANVAS
══════════════════════════════════════════ */
#bgCanvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ══════════════════════════════════════════
   FLIGHT — BIRDS LAYER
══════════════════════════════════════════ */
#birdsLayer { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

.bird {
  position: absolute;
  font-size: 1.1rem;
  opacity: 0;
  animation: birdFly linear infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}

@keyframes birdFly {
  0%   { opacity: 0;   transform: translateX(-60px) translateY(0px) scale(0.7); }
  5%   { opacity: 0.7; }
  50%  { transform: translateX(50vw) translateY(var(--drift)) scale(1); }
  95%  { opacity: 0.5; }
  100% { opacity: 0;   transform: translateX(110vw) translateY(var(--drift2)) scale(0.8); }
}

/* ══════════════════════════════════════════
   PAGE LAYOUT
══════════════════════════════════════════ */
.page {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 60px 24px;
}

/* ══════════════════════════════════════════
   SCENE 1 — ENVELOPE
══════════════════════════════════════════ */
#scene1 { flex-direction: column; text-align: center; }

.pre-text {
  font-weight: 200; font-size: .72rem;
  letter-spacing: .35em; text-transform: uppercase;
  color: rgba(240,160,122,.6);
  margin-bottom: 32px; opacity: 0;
  animation: fadeSlideUp .8s ease .3s forwards;
}

.envelope-wrap {
  position: relative; width: min(340px, 88vw);
  cursor: pointer; opacity: 0;
  animation: fadeSlideUp .9s cubic-bezier(.22,.88,.34,1.05) .6s forwards;
}
.envelope-wrap:hover .env-lid    { transform: rotateX(-180deg); }
.envelope-wrap:hover .env-shadow { transform: translateX(-50%) scaleX(1.1); opacity: .5; }

.env-shadow {
  position: absolute; bottom: -18px; left: 50%;
  transform: translateX(-50%) scaleX(.85);
  width: 88%; height: 24px;
  background: radial-gradient(ellipse, rgba(0,0,0,.5) 0%, transparent 70%);
  transition: transform .4s, opacity .4s; opacity: .35;
}

.envelope {
  width: 100%; aspect-ratio: 1.6/1; position: relative;
  filter: drop-shadow(0 20px 48px rgba(0,0,0,.55));
}

.env-body {
  position: absolute; inset: 0;
  background: linear-gradient(160deg,#f5dcc8 0%,#edd0b0 40%,#e0bb96 100%);
  border-radius: 8px; overflow: hidden;
}
.env-body::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg,transparent,transparent 20px,rgba(210,140,80,.06) 20px,rgba(210,140,80,.06) 21px);
}

.env-flap-left, .env-flap-right, .env-flap-bottom { position: absolute; border-style: solid; }

.env-flap-bottom {
  bottom: 0; left: 0; right: 0; height: 0;
  border-width: 0 0 calc(min(340px,88vw)*.31) calc(min(340px,88vw)*.5);
  border-color: transparent transparent #d4a97a transparent;
  filter: brightness(.88);
}
.env-flap-right {
  right: 0; top: 0; bottom: 0; width: 0; height: 0;
  border-width: calc(min(340px,88vw)*.31) 0 0 calc(min(340px,88vw)*.5);
  border-color: transparent transparent transparent #c9985e;
  filter: brightness(.82);
}
.env-flap-left {
  left: 0; top: 0; bottom: 0; width: 0; height: 0;
  border-width: 0 0 calc(min(340px,88vw)*.31) calc(min(340px,88vw)*.5);
  border-color: transparent transparent #c9985e transparent;
  filter: brightness(.78);
}

.env-lid {
  position: absolute; top: 0; left: 0; right: 0; height: 0;
  border-style: solid;
  border-width: calc(min(340px,88vw)*.33) calc(min(340px,88vw)*.5) 0 calc(min(340px,88vw)*.5);
  border-color: #e8c898 transparent transparent transparent;
  transform-origin: top center;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1); z-index: 3;
}

.env-seal {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-30%); z-index: 4; font-size: 2rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.3));
  animation: sealPulse 2.5s ease-in-out infinite;
}
@keyframes sealPulse {
  0%,100% { filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
  50%     { filter: drop-shadow(0 2px 18px rgba(212,97,78,.7)); }
}

.env-letter {
  position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%);
  width: 72%; background: var(--cream); border-radius: 4px; padding: 10px 8px;
  text-align: center; font-family: 'Playfair Display',serif; font-size: .62rem;
  font-style: italic; color: #8a5a3a; box-shadow: 0 2px 12px rgba(0,0,0,.18); opacity: .8;
}

.tap-hint {
  margin-top: 28px; font-size: .68rem; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(240,160,122,.45);
  display: flex; align-items: center; gap: 10px; justify-content: center;
  opacity: 0;
  animation: fadeSlideUp .8s ease 1.2s forwards, blink 2.2s ease-in-out 2s infinite;
}
.tap-hint::before, .tap-hint::after { content: ''; width: 28px; height: 1px; background: rgba(240,160,122,.3); }
@keyframes blink { 0%,100%{opacity:.45} 50%{opacity:.9} }

/* ══════════════════════════════════════════
   SCENE 2
══════════════════════════════════════════ */
#scene2 { display: none; flex-direction: column; align-items: center; }

.hero-quote {
  text-align: center; margin-bottom: 48px;
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s ease, transform .9s ease;
}
.hero-quote.visible { opacity: 1; transform: translateY(0); }

.hero-quote .script {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.8rem,9vw,4.8rem);
  color: var(--peach); line-height: 1.1;
  text-shadow: 0 0 60px rgba(240,160,122,.4);
}
.hero-quote .sub {
  font-weight: 200; font-size: .72rem; letter-spacing: .3em;
  text-transform: uppercase; color: rgba(240,160,122,.5); margin-top: 10px;
}

/* ══════════════════════════════════════════
   INVITATION CARD
══════════════════════════════════════════ */
.inv-card {
  position: relative; width: min(480px,92vw);
  background: linear-gradient(155deg,#fdf6ed 0%,#f8edda 50%,#f3e2c6 100%);
  border-radius: 24px; overflow: hidden; color: var(--text);
  box-shadow:
    0 0 0 1px rgba(201,137,62,.2),
    0 8px 32px rgba(0,0,0,.35),
    0 32px 80px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.7);
  opacity: 0; transform: translateY(32px) scale(.96);
  transition: opacity 1s ease .2s, transform 1s cubic-bezier(.22,.88,.34,1.05) .2s;
}
.inv-card.visible { opacity: 1; transform: translateY(0) scale(1); }
.inv-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg,transparent,var(--gold),var(--gold2),var(--gold),transparent);
}

/* ══════════════════════════════════════════
   CARD ILLUSTRATION HEADER
   ( Bridge + Sky + Flowers + FaceTime badge )
══════════════════════════════════════════ */
.card-illus {
  position: relative; height: 230px; overflow: hidden;
}

/* — Sky — */
.illus-sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,#1a0e28 0%,#2e1a3a 35%,#5c2a38 65%,#8c3e30 85%,#b8602a 100%);
}
.illus-sky::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 25%, rgba(255,200,100,.12) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 40%, rgba(200,100,160,.10) 0%, transparent 45%);
}

/* — Bridge SVG — */
.bridge-svg {
  position: absolute; bottom: 38px; left: 0; width: 100%; height: 120px;
  z-index: 2;
}

/* — SPRING FLOWERS ROW — */
.flowers-row {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 44px; z-index: 4;
  display: flex; align-items: flex-end; justify-content: space-around;
  padding: 0 8px 4px;
  background: linear-gradient(to top, rgba(43,21,16,.6) 0%, transparent 100%);
}

.flower {
  display: inline-block;
  animation: flowerSway ease-in-out infinite alternate;
  transform-origin: bottom center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
  font-size: 1.4rem;
}
@keyframes flowerSway {
  from { transform: rotate(-8deg) scale(.92); }
  to   { transform: rotate(8deg)  scale(1.08); }
}
.f1 { animation-duration: 2.8s; font-size: 1.5rem; }
.f2 { animation-duration: 3.2s; animation-delay: .3s; font-size: 1.3rem; }
.f3 { animation-duration: 2.5s; animation-delay: .6s; font-size: 1.6rem; }
.f4 { animation-duration: 3.5s; animation-delay: .2s; font-size: 1.2rem; }
.f5 { animation-duration: 2.9s; animation-delay: .8s; font-size: 1.5rem; }
.f6 { animation-duration: 3.1s; animation-delay: .4s; font-size: 1.3rem; }
.f7 { animation-duration: 2.7s; animation-delay: .7s; font-size: 1.4rem; }
.f8 { animation-duration: 3.4s; animation-delay: .1s; font-size: 1.2rem; }
.f9 { animation-duration: 2.6s; animation-delay: .5s; font-size: 1.5rem; }

/* Card illus caption */
.card-illus-text {
  position: absolute; bottom: 44px; left: 0; right: 0;
  padding: 8px 20px;
  text-align: center;
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: .85rem; color: rgba(253,243,233,.6);
  letter-spacing: .04em; z-index: 3;
}

/* ══════════════════════════════════════════
   CARD CONTENT
══════════════════════════════════════════ */
.card-content { padding: 28px 28px 24px; }

.salutation {
  font-family: 'Great Vibes', cursive; font-size: 2.6rem;
  color: var(--r); line-height: 1; margin-bottom: 14px;
}

.message-text {
  font-size: .9rem; line-height: 1.95; color: #5a3020; margin-bottom: 24px;
}
.message-text strong { font-weight: 500; color: var(--r2); }

/* Detail tiles */
.details-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 11px; margin-bottom: 22px;
}
.detail-tile {
  background: linear-gradient(135deg,rgba(212,97,78,.08),rgba(201,137,62,.06));
  border: 1px solid rgba(201,137,62,.2); border-radius: 14px; padding: 13px 14px;
  transition: transform .25s, box-shadow .25s;
}
.detail-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(212,97,78,.12); }
.detail-tile-icon  { font-size: 1.2rem; margin-bottom: 5px; display: block; }
.detail-tile-label { font-size: .6rem; letter-spacing: .15em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 2px; }
.detail-tile-value { font-family: 'Playfair Display',serif; font-size: .92rem; font-weight: 500; color: #5a2a18; line-height: 1.3; }

/* ══════════════════════════════════════════
   SPRING FLOWERS DIVIDER
══════════════════════════════════════════ */
.flower-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin: 0 0 20px;
  font-size: 1rem;
}
.flower-divider span:nth-child(3) {
  color: var(--gold); font-size: .8rem; letter-spacing: 2px;
}
.flower-divider span {
  animation: divFlower 2s ease-in-out infinite alternate;
}
.flower-divider span:nth-child(1) { animation-delay: 0s; }
.flower-divider span:nth-child(2) { animation-delay: .2s; }
.flower-divider span:nth-child(4) { animation-delay: .4s; }
.flower-divider span:nth-child(5) { animation-delay: .1s; }
@keyframes divFlower {
  from { transform: translateY(0) rotate(-5deg); }
  to   { transform: translateY(-4px) rotate(5deg); }
}

/* RSVP */
.rsvp-heading {
  font-family: 'Playfair Display',serif; font-style: italic; font-size: 1.25rem;
  color: #7a3020; text-align: center; margin-bottom: 18px;
}

.btns { display: flex; flex-direction: column; gap: 12px; }

.btn {
  width: 100%; padding: 15px 20px; border: none; border-radius: 50px;
  font-family: 'Jost',sans-serif; font-size: .78rem; font-weight: 400;
  letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
  position: relative; overflow: hidden; transition: transform .25s, box-shadow .25s;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg,transparent 0%,rgba(255,255,255,.18) 50%,transparent 100%);
  transform: translateX(-100%); transition: transform .5s ease;
}
.btn:hover::before { transform: translateX(100%); }
.btn:active { transform: scale(.97); }

.btn-yes {
  background: linear-gradient(135deg,var(--r) 0%,var(--r2) 100%); color: #fff;
  box-shadow: 0 6px 24px rgba(180,60,48,.4), 0 2px 6px rgba(180,60,48,.2);
}
.btn-yes:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(180,60,48,.45); }

.btn-maybe {
  background: transparent; border: 1px solid rgba(201,137,62,.4); color: var(--gold);
}
.btn-maybe:hover { border-color: var(--gold); background: rgba(201,137,62,.07); transform: translateY(-2px); }

/* Ribbon */
.card-ribbon {
  height: 52px;
  background: linear-gradient(135deg,#c45a45 0%,#9e3e2c 60%,#7a2e22 100%);
  display: flex; align-items: center; justify-content: center; gap: 16px;
  position: relative; overflow: hidden;
}
.card-ribbon::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg,transparent,transparent 10px,rgba(255,255,255,.03) 10px,rgba(255,255,255,.03) 11px);
}
.ribbon-text { font-family: 'Great Vibes',cursive; font-size: 1.45rem; color: rgba(255,255,255,.85); position: relative; }
.ribbon-dots { display: flex; gap: 6px; position: relative; }
.ribbon-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.4); animation: rdot 1.4s ease-in-out infinite; }
.ribbon-dot:nth-child(2) { animation-delay: .2s; }
.ribbon-dot:nth-child(3) { animation-delay: .4s; }
@keyframes rdot { 0%,100%{transform:scale(1);opacity:.4} 50%{transform:scale(1.6);opacity:.9} }

/* ══════════════════════════════════════════
   RESPONSE SCREEN
══════════════════════════════════════════ */
.response-screen {
  display: none; text-align: center; padding: 38px 28px 32px;
  animation: fadeSlideUp .7s cubic-bezier(.22,.88,.34,1.05) both;
}
.response-screen .r-emoji { font-size: 3.8rem; margin-bottom: 14px; display: block; animation: bounceIn .6s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes bounceIn { from{transform:scale(0)} to{transform:scale(1)} }
.response-screen .r-title { font-family: 'Great Vibes',cursive; font-size: 2.6rem; color: var(--r); margin-bottom: 10px; }
.response-screen .r-sub   { font-family: 'Playfair Display',serif; font-style: italic; font-size: 1rem; color: #7a4030; line-height: 1.7; }
.response-screen .r-note  { margin-top: 16px; font-size: .75rem; letter-spacing: .1em; color: #b07050; }

.countdown-wrap { margin-top: 22px; display: flex; justify-content: center; gap: 14px; }
.cd-unit {
  background: linear-gradient(135deg,rgba(212,97,78,.12),rgba(201,137,62,.08));
  border: 1px solid rgba(201,137,62,.2); border-radius: 12px; padding: 10px 13px; min-width: 58px;
}
.cd-num   { font-family: 'Playfair Display',serif; font-size: 1.75rem; font-weight: 700; color: var(--r); display: block; line-height: 1; }
.cd-label { font-size: .55rem; letter-spacing: .14em; text-transform: uppercase; color: #a07050; display: block; margin-top: 4px; }

/* ══════════════════════════════════════════
   CSS FALLING PETALS
══════════════════════════════════════════ */
.css-petal {
  position: fixed; pointer-events: none; z-index: 1;
  border-radius: 60% 10% 60% 10%; opacity: 0;
  animation: cssfall linear infinite;
}
@keyframes cssfall {
  0%   { opacity: 0;   transform: translateY(-40px) rotate(0deg); }
  6%   { opacity: .55; }
  94%  { opacity: .4;  }
  100% { opacity: 0;   transform: translateY(105vh) rotate(540deg); }
}

/* ══════════════════════════════════════════
   SPARKLES
══════════════════════════════════════════ */
.sp {
  position: fixed; pointer-events: none; z-index: 100;
  font-size: 1.1rem; opacity: 0;
  animation: spOut .9s ease-out forwards;
}
@keyframes spOut {
  0%   { opacity: 1; transform: scale(0) translate(0,0); }
  60%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.3) translate(var(--tx),var(--ty)); }
}

/* ══════════════════════════════════════════
   SHARED KEYFRAMES
══════════════════════════════════════════ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   SCREENSHOT & SHARE SECTION
══════════════════════════════════════════ */
.share-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(201,137,62,.15);
}

.share-label {
  font-size: .65rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #a07050;
  margin-bottom: 14px;
  text-align: center;
}

.screenshot-hint {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.screenshot-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ss-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(212,97,78,.06), rgba(201,137,62,.04));
  border: 1px solid rgba(201,137,62,.15);
  border-radius: 12px;
}

.ss-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--r), var(--r2));
  color: #fff;
  font-size: .7rem;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.ss-text {
  font-size: .82rem;
  color: #7a4030;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
}

.share-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 18px;
  border-radius: 50px;
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .22s, box-shadow .22s;
}
.share-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  transform: translateX(-100%);
  transition: transform .5s ease;
}
.share-btn:hover::before { transform: translateX(100%); }
.share-btn:active        { transform: scale(.97); }

.save-img-btn {
  background: linear-gradient(135deg, #d4614e 0%, #b84a38 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(180,60,48,.38);
}
.save-img-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(180,60,48,.45);
}

/* ══════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════ */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: var(--deep); }
::-webkit-scrollbar-thumb { background: var(--r); border-radius: 2px; }
