:root{
  --bg1:#070508;
  --bg2:#120A12;
  --ink:#f4f0f4;
  --muted:rgba(244,240,244,.72);

  --gold1:#f5d37a;
  --gold2:#b7852a;
  --gold3:#fff2c8;

  --shadow: 0 30px 90px rgba(0,0,0,.55);
  --radius:22px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--ink);
  overflow:hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Serif headings */
.headline,
.inv-title{
  font-family:"Playfair Display", ui-serif, Georgia, serif;
}

/* Background */
.bg{position:fixed; inset:0; z-index:-1;}
.velvet{
  position:absolute; inset:0;
  background:
    radial-gradient(1200px 800px at 25% 15%, rgba(255,120,170,.10), transparent 60%),
    radial-gradient(1100px 900px at 80% 20%, rgba(255,210,120,.08), transparent 55%),
    radial-gradient(1000px 800px at 55% 80%, rgba(160,120,255,.06), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg1));
}
.sparkles{
  position:absolute; inset:-40px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.16) 0 1px, transparent 2px),
    radial-gradient(circle at 30% 70%, rgba(255,255,255,.10) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 30%, rgba(255,255,255,.12) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 55%, rgba(255,255,255,.08) 0 1px, transparent 2px),
    radial-gradient(circle at 90% 80%, rgba(255,255,255,.10) 0 1px, transparent 2px);
  opacity:.18;
  filter: blur(.25px);
  transform: rotate(-1deg);
}
.spotlight{
  position:absolute; inset:0;
  background: radial-gradient(900px 520px at 50% 45%, rgba(255,242,200,.11), transparent 62%);
  opacity:.95;
}
.vignette{
  position:absolute; inset:0;
  background: radial-gradient(circle at center, transparent 54%, rgba(0,0,0,.62) 120%);
}
.grain{
  position:absolute; inset:-30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  opacity:.22;
  mix-blend-mode: overlay;
  pointer-events:none;
}

/* Screens */
.center{
  height:100%;
  display:grid;
  place-items:center;
  padding: clamp(16px, 3vw, 26px);
}
.screen{
  position:fixed; inset:0;
  opacity:0;
  pointer-events:none;
  transform: translateY(10px) scale(.995);
  transition: opacity .45s ease, transform .45s ease;
}
.screen.active{
  opacity:1;
  pointer-events:auto;
  transform: translateY(0) scale(1);
}

/* Shared text */
.micro{
  letter-spacing:.26em;
  font-weight:800;
  font-size:11px;
  opacity:.82;
}
.gold{color: rgba(245,211,122,.95)}

/* Envelope stage */
.envelope-stage{
  width:min(560px, 94vw);
  border-radius: calc(var(--radius) + 14px);
  padding: 34px 26px 26px;
  text-align:center;
  cursor:pointer;
  user-select:none;

  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.035));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 40px 140px rgba(0,0,0,.55);
  backdrop-filter: blur(14px);
  position:relative;
  overflow:hidden;
  color:inherit;
  -webkit-tap-highlight-color: transparent;
}

.stage-glow{
  position:absolute; inset:-2px;
  background:
    radial-gradient(520px 240px at 50% 0%, rgba(245,211,122,.20), transparent 55%),
    radial-gradient(760px 360px at 10% 120%, rgba(255,120,170,.12), transparent 60%);
  opacity:.9;
  pointer-events:none;
}

/* Stable envelope area so letter always animates correctly */
.envelope-wrap{
  position:relative;
  display:grid;
  place-items:center;
  margin: 6px auto 0;
  width: clamp(240px, 52vw, 320px);
  height: clamp(210px, 46vw, 300px);
}

.envelope-glow{
  position:absolute;
  width: 340px;
  height: 240px;
  border-radius: 38px;
  background:
    radial-gradient(circle at 50% 40%, rgba(245,211,122,.26), transparent 62%),
    radial-gradient(circle at 60% 65%, rgba(255,120,170,.14), transparent 62%);
  filter: blur(18px);
  opacity: .70;
  animation: glowPulse 3.8s ease-in-out infinite;
  pointer-events:none;
}
@keyframes glowPulse{
  0%   { transform: scale(1);    opacity:.60; }
  50%  { transform: scale(1.05); opacity:.86; }
  100% { transform: scale(1);    opacity:.60; }
}

.seal-shimmer{
  position:absolute;
  width: 260px;
  height: 180px;
  border-radius: 30px;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.08) 45%, transparent 70%);
  filter: blur(1px);
  opacity: .0;
  animation: shimmerSweep 4.6s ease-in-out infinite;
  pointer-events:none;
}
@keyframes shimmerSweep{
  0%   { transform: translateX(-46px); opacity:0; }
  35%  { opacity:.16; }
  55%  { opacity:.10; }
  100% { transform: translateX(56px); opacity:0; }
}

/* Letter starts INSIDE the envelope area, then slides above */
.letter{
  position:absolute;
  width: 78%;
  height: 68%;
  border-radius: 18px;

  left: 50%;
  bottom: 26%;
  transform: translateX(-50%) translateY(26px);

  z-index: 1;
  opacity: .98;

  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.86));
  box-shadow: 0 18px 55px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.26);
  overflow:hidden;
}
.letter-edge{
  position:absolute;
  inset:0;
  background:
    radial-gradient(220px 90px at 50% 0%, rgba(245,211,122,.35), transparent 55%),
    linear-gradient(90deg, rgba(0,0,0,.05), transparent 35%, transparent 65%, rgba(0,0,0,.05));
  opacity:.55;
  pointer-events:none;
}
.letter-mark{
  position:absolute;
  left: 18px;
  top: 16px;
  display:flex;
  align-items:center;
  gap:10px;
  color: rgba(25,18,8,.70);
  font-family: "Playfair Display", ui-serif, Georgia, serif;
}
.letter-micro{font-size: 12px; letter-spacing:.08em;}
.letter-line{
  display:inline-block;
  width: 90px;
  height: 1px;
  background: rgba(25,18,8,.18);
  border-radius: 999px;
}

.envelope-stage.opening .letter{
  animation: letterOut 520ms cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes letterOut{
  0%   { transform: translateX(-50%) translateY(26px); }
  70%  { transform: translateX(-50%) translateY(-44px); }
  100% { transform: translateX(-50%) translateY(-40px); }
}

/* Envelope image */
.envelope-img{
  width: clamp(220px, 44vw, 290px);
  height:auto;
  position:relative;
  z-index:2;
  filter: drop-shadow(0 18px 44px rgba(0,0,0,.40));
}
.envelope-img.envelope{
  animation: floatEnvelope 3.4s ease-in-out infinite;
  will-change: transform;
}
@keyframes floatEnvelope{
  0%   { transform: translateY(2px); }
  50%  { transform: translateY(-6px); }
  100% { transform: translateY(2px); }
}

.envelope-stage.opening .envelope-img.envelope{
  animation: none;
  transform: translateY(8px) scale(.985);
}
.envelope-stage.opening .envelope-glow{
  opacity: 1;
  transform: scale(1.08);
}

.envelope-copy{margin-top: 10px; position:relative; z-index:1;}
.headline{
  font-size: clamp(30px, 6vw, 38px);
  font-weight:600;
  margin-top:10px;
  letter-spacing:.1px;
}
.subhead{
  margin-top:10px;
  color: var(--muted);
  font-size: 14px;
  line-height:1.6;
}

/* Question card */
.question-card{
  width:min(560px, 94vw);
  border-radius: calc(var(--radius) + 6px);
  padding: 44px 28px 26px;
  text-align:center;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  position:relative;
  overflow: visible;
}
.question-card::before{
  content:"";
  position:absolute; inset:-40px;
  background: radial-gradient(700px 260px at 50% 0%, rgba(245,211,122,.10), transparent 55%);
  opacity:.75;
  pointer-events:none;
}

.q-title{
  font-family: "Allura", cursive;
  font-weight: 400;
  font-size: clamp(44px, 7.2vw, 64px);
  line-height: 1.02;
  margin: 16px 0 10px;
  letter-spacing: .2px;
}
.q-subtitle{
  margin:0;
  color: rgba(244,240,244,.72);
  font-size: 14.5px;
  line-height:1.65;
}

.fineprint{
  margin-top:18px;
  font-size:12px;
  color: rgba(244,240,244,.65);
  letter-spacing:.14em;
  text-transform:uppercase;
}

/* Button row */
.btn-row{
  position:relative;
  margin-top: 22px;
  height: 62px;

  display:flex;
  justify-content:center;
  align-items:center;
  gap:14px;

  width: min(360px, 92%);
  margin-left:auto;
  margin-right:auto;

  overflow: visible;
  z-index: 3;
}
.btn-ghost{
  display:inline-block;
  min-width: 124px;
  height: 48px;
}

/* Buttons */
.btn{
  border-radius:999px;
  padding: 14px 22px;
  font-weight:800;
  font-size:15px;
  border: 1px solid rgba(255,255,255,.14);
  cursor:pointer;
  transition: transform .15s ease, filter .15s ease;
  min-width: 124px;
  -webkit-tap-highlight-color: transparent;
}
.btn:active{transform: scale(.98)}

.btn-yes{
  background: linear-gradient(180deg, rgba(245,211,122,.95), rgba(183,133,42,.92));
  color: #1a1208;
  border-color: rgba(245,211,122,.40);
}
.btn-yes:hover{filter: brightness(1.05); transform: translateY(-1px);}

.btn-no{
  background: rgba(255,255,255,.12);
  color: rgba(244,240,244,.94);
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 18px 65px rgba(0,0,0,.32), 0 0 0 2px rgba(0,0,0,.12);
  outline: 1px solid rgba(255,255,255,.10);
}

/* Invitation */
.invite-wrap{
  width:min(600px, 94vw);
  display:grid;
  gap:12px;
  justify-items:center;
}
.foil-frame{
  border-radius: calc(var(--radius) + 12px);
  padding: 2px;
  background:
    conic-gradient(from 180deg,
      rgba(245,211,122,.95),
      rgba(255,242,200,.75),
      rgba(183,133,42,.95),
      rgba(255,242,200,.70),
      rgba(245,211,122,.95)
    );
  box-shadow: 0 40px 120px rgba(0,0,0,.65);
}
.invite-card{
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(8,6,10,.92), rgba(10,6,10,.86));
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
  padding: 38px 28px 26px;
  text-align:center;
  position:relative;
  overflow:hidden;
  width:min(420px, 94vw);
}
.invite-card::before{
  content:"";
  position:absolute; inset:-40px;
  background:
    radial-gradient(760px 280px at 50% 0%, rgba(245,211,122,.12), transparent 56%),
    radial-gradient(900px 420px at 10% 120%, rgba(255,120,170,.08), transparent 60%);
  opacity:.85;
  pointer-events:none;
}

.invite-header{position:relative; z-index:1;}
.inv-title{
  margin: 12px 0 8px;
  font-size: clamp(30px, 6vw, 38px);
  font-weight:600;
  letter-spacing:.2px;
}
.inv-subtitle{margin:0; color: rgba(244,240,244,.70); font-size:14px;}

.divider{
  position:relative; z-index:1;
  height:1px; margin: 18px 0;
  background: linear-gradient(90deg, transparent, rgba(245,211,122,.55), transparent);
  opacity:.9;
}
.divider.soft{
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  opacity:.7;
}
.inv-grid{position:relative; z-index:1; display:grid; gap:10px; text-align:left;}
.row{
  display:flex; justify-content:space-between; align-items:center;
  gap:14px; padding: 12px 14px;
  border-radius:14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}
.label{font-size:11px; font-weight:800; letter-spacing:.22em; color: rgba(244,240,244,.60);}
.value{font-weight:800; color: rgba(244,240,244,.92);}

.reveal{
  border-radius:999px;
  padding: 10px 14px;
  font-weight:800;
  cursor:pointer;
  border: 1px solid rgba(245,211,122,.32);
  background: rgba(245,211,122,.09);
  color: rgba(255,242,200,.95);
  transition: filter .15s ease, transform .15s ease;
}
.reveal:hover{filter:brightness(1.08); transform: translateY(-1px);}
.location.hidden{display:none;}
.location{font-weight:800; color: rgba(255,242,200,.95);}

/* Closing */
.closing{position:relative; z-index:1; margin-top: 10px; text-align:center;}
.flourish{
  height: 12px;
  margin: 2px auto 12px;
  width: min(320px, 78%);
  background:
    radial-gradient(circle at 50% 50%, rgba(245,211,122,.32), transparent 60%),
    linear-gradient(90deg, transparent, rgba(245,211,122,.55), transparent);
  opacity: .9;
  border-radius: 999px;
}
.closing-line{
  margin: 0;
  font-size: 13px;
  color: rgba(244,240,244,.66);
  font-style: italic;
  letter-spacing:.2px;
}
.signature{
  margin-top: 10px;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  color: rgba(255,242,200,.82);
  font-weight: 700;
  letter-spacing:.06em;
  font-size: 12px;
}
.sig-mark{opacity:.7; transform: translateY(-1px);}
.sig-name{opacity:.95;}

/* Clean line-rose icon */
.signature::after{
  content:"";
  width: 28px;
  height: 28px;
  margin-left: 10px;
  display:inline-block;
  opacity:.65;
  background: rgba(245,211,122,.92);

  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 50c10 0 18-8 18-18 0-7-5-14-12-16 2-6-1-12-6-13-4-1-8 1-10 4-2-2-6-3-9-1-5 3-5 10-1 15-5 3-8 9-8 15 0 8 6 14 14 14' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M32 50c-5 0-9-4-9-9 0-4 3-8 7-9-3-2-5-5-5-9 0-5 4-9 9-9 4 0 8 3 9 7' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M32 50v10' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 50c10 0 18-8 18-18 0-7-5-14-12-16 2-6-1-12-6-13-4-1-8 1-10 4-2-2-6-3-9-1-5 3-5 10-1 15-5 3-8 9-8 15 0 8 6 14 14 14' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M32 50c-5 0-9-4-9-9 0-4 3-8 7-9-3-2-5-5-5-9 0-5 4-9 9-9 4 0 8 3 9 7' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M32 50v10' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.tiny{font-size:12px; color: rgba(244,240,244,.55);}

/* Mobile tweaks */
@media (max-width: 420px){
  .question-card{padding: 40px 20px 22px;}
  .btn{min-width: 118px; padding: 14px 18px;}
  .btn-ghost{min-width:118px; height:48px;}
  .invite-card{padding: 34px 20px 22px;}
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .screen{transition:none}
  .envelope-glow, .seal-shimmer, .envelope-img.envelope{ animation:none !important; }
  .btn,.reveal{transition:none}
}
