@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Prata&display=swap");

:root {
  --ink: #302a43;
  --cream: #fff9fd;
  --pink: #f2d6e9;
  --lilac: #ddc0dc;
  --violet: #ad9aca;
  --periwinkle: #9ea6d3;
  --deep: #39344f;
  --line: rgba(255, 255, 255, .36);
  --p-slow: 0px;
  --p-medium: 0px;
  --p-fast: 0px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--deep);
}

body {
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 12% 8%, rgba(242, 214, 233, .88), transparent 25rem),
    radial-gradient(circle at 92% 29%, rgba(158, 166, 211, .8), transparent 28rem),
    radial-gradient(circle at 18% 72%, rgba(173, 154, 202, .72), transparent 27rem),
    linear-gradient(155deg, #443d60 0%, #8e80aa 42%, #675f89 72%, #332e4a 100%);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  min-width: 320px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: .28;
  background:
    linear-gradient(120deg, transparent 25%, rgba(255,255,255,.12) 45%, transparent 64%);
}

a { color: inherit; }

.parallax-backdrop {
  position: fixed;
  inset: -15vh -15vw;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.parallax-orb {
  position: absolute;
  width: 55vw;
  max-width: 420px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(55px);
  opacity: .46;
}

.orb-one {
  top: 8%;
  left: -16%;
  background: var(--pink);
  transform: translateY(var(--p-slow));
}

.orb-two {
  top: 54%;
  right: -22%;
  background: var(--periwinkle);
  transform: translateY(var(--p-medium));
}

.float-piece {
  position: absolute;
  width: 90px;
  opacity: .28;
  filter: saturate(.6) hue-rotate(185deg);
  will-change: transform;
}

.piece-one { top: 10%; right: -22px; transform: translateY(var(--p-medium)) rotate(22deg); }
.piece-two { top: 32%; left: -28px; transform: translateY(var(--p-slow)) rotate(-18deg); }
.piece-three { top: 61%; right: -34px; transform: translateY(var(--p-fast)) rotate(38deg); }
.piece-four { top: 80%; left: -25px; transform: translateY(var(--p-medium)) rotate(-8deg); }

.gate-closed { overflow: hidden; }

.envelope-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  min-height: 100svh;
  padding: max(34px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(242,214,233,.65), transparent 19rem),
    radial-gradient(circle at 14% 15%, rgba(158,166,211,.58), transparent 18rem),
    linear-gradient(155deg, #443d60, #9587af 54%, #46405f);
  transition: opacity .65s ease .35s, visibility .65s ease .35s;
}

.envelope-gate::after {
  position: absolute;
  inset: 18px;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 200px 200px 28px 28px;
}

.envelope-gate p {
  margin: 0 0 22px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.envelope-gate > span {
  margin-top: 20px;
  font-size: .8rem;
  letter-spacing: .08em;
  opacity: .78;
}

.envelope-button {
  width: min(88vw, 430px);
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 28px 32px rgba(10,20,16,.33));
  animation: envelope-float 3.4s ease-in-out infinite;
  transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .45s ease;
}

.opening-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 1px;
  height: 1px;
}

.opening-burst img {
  position: absolute;
  width: var(--burst-size);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.3);
  filter: saturate(.8) hue-rotate(180deg) drop-shadow(0 8px 8px rgba(46,37,65,.2));
}

.envelope-gate.is-opening .opening-burst img {
  animation: burst-open 1.15s cubic-bezier(.15,.7,.2,1) forwards;
}

@keyframes burst-open {
  10% { opacity: 1; }
  75% { opacity: .92; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--burst-x)), calc(-50% + var(--burst-y))) rotate(var(--burst-r)) scale(1); }
}

.envelope-button img {
  display: block;
  width: 100%;
  height: auto;
}

.envelope-button:focus-visible {
  border-radius: 20px;
  outline: 3px solid #f2d7c9;
  outline-offset: 8px;
}

.envelope-gate.is-opening {
  opacity: 0;
  visibility: hidden;
}

.envelope-gate.is-opening .envelope-button {
  opacity: 0;
  transform: scale(1.35) rotate(-2deg);
}

@keyframes envelope-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

.invitation-page {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: 100svh;
  padding: max(38px, env(safe-area-inset-top)) 24px max(40px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 38%, rgba(242, 214, 233, .2), transparent 20rem),
    linear-gradient(160deg, rgba(173, 154, 202, .2), rgba(57, 52, 79, .18));
}

.hero::before {
  position: absolute;
  inset: 20px;
  z-index: -1;
  content: "";
  border: 1px solid var(--line);
  border-radius: 200px 200px 28px 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), transparent 70%);
}

.hero-glow {
  position: absolute;
  z-index: -2;
  width: 310px;
  height: 430px;
  border-radius: 50%;
  background: rgba(242, 214, 233, .18);
  filter: blur(60px);
}

.kicker,
.statement p,
.section-number {
  margin: 0;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .23em;
  text-transform: uppercase;
}

h1, h2, .script-label, footer strong {
  font-family: "Prata", Georgia, serif;
  font-weight: 400;
}

h1 {
  margin: 24px 0 30px;
  font-size: clamp(3.15rem, 15vw, 5.2rem);
  line-height: .96;
  letter-spacing: -.055em;
}

h1 span {
  display: block;
  margin: .17em 0;
  font-family: "Manrope", sans-serif;
  font-size: .24em;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.date-mark {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100%, 330px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.date-mark strong {
  padding: 8px 18px;
  font: 400 3.8rem/1 "Prata", Georgia, serif;
  border-inline: 1px solid var(--line);
}

.date-mark span {
  font-size: .67rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.scroll-cue {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  width: 22px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 14px;
}

.scroll-cue span {
  display: block;
  width: 3px;
  height: 7px;
  margin: 7px auto;
  border-radius: 3px;
  background: white;
  animation: scroll 1.8s infinite;
}

@keyframes scroll {
  0% { transform: translateY(0); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateY(13px); opacity: 0; }
}

.photo-section { padding: 12px 24px 70px; }

.photo-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.52);
  background: rgba(57, 52, 79, .22);
  box-shadow: 0 25px 65px rgba(48, 42, 67, .28);
}

.photo-frame::after {
  position: absolute;
  inset: 12px;
  content: "";
  border: 1px solid rgba(255,255,255,.18);
}

.photo-couple {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 180px 180px 18px 18px;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.content-section {
  position: relative;
  margin: 0 14px 26px;
  padding: 70px 28px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 32px;
  background: rgba(57, 52, 79, .38);
  box-shadow: 0 22px 60px rgba(48, 42, 67, .2);
  backdrop-filter: blur(12px);
}

.content-section h2,
.rsvp-invite h2 {
  margin: 8px auto 24px;
  font-size: clamp(2rem, 10vw, 3.25rem);
  line-height: 1.14;
  letter-spacing: -.035em;
}

.content-section p { margin: 0 auto 18px; max-width: 390px; }

.script-label {
  color: var(--pink);
  font-size: 1.18rem;
  font-style: italic;
}

.intro { padding-top: 80px; padding-bottom: 80px; }

.statement {
  min-height: 360px;
  padding: 90px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.statement h2 {
  margin: 18px 0;
  font: 400 clamp(2.8rem, 13vw, 4.6rem)/1.08 "Prata", Georgia, serif;
}

.section-number {
  position: absolute;
  top: 24px;
  left: 28px;
  color: rgba(255,255,255,.5);
}

.photo-landscape {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 34px 0 24px;
  border-radius: 20px;
}

.setting-photo {
  position: relative;
  min-height: 700px;
  margin: 14px;
  overflow: hidden;
  border-radius: 32px;
  box-shadow: 0 28px 70px rgba(48, 42, 67, .32);
}

.setting-photo > img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
}

.setting-photo::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 48%, rgba(48,42,67,.86) 100%);
}

.setting-photo > div {
  position: absolute;
  right: 26px;
  bottom: 38px;
  left: 26px;
  z-index: 1;
}

.setting-photo h2 {
  max-width: 390px;
  margin: 8px 0 0;
  font: 400 clamp(2rem, 10vw, 3.1rem)/1.16 "Prata", Georgia, serif;
}

.dress-code {
  margin-top: 26px;
  padding-top: 82px;
  padding-bottom: 76px;
}

.color-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: min(100%, 360px);
  margin: 34px auto 0;
}

.color-swatches span {
  display: block;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50% 50% 44% 56%;
  background: var(--swatch);
  box-shadow:
    inset 0 1px 10px rgba(255,255,255,.45),
    0 12px 28px rgba(48,42,67,.22);
}

.color-swatches span:nth-child(even) {
  transform: translateY(12px) rotate(5deg);
}

.button {
  min-height: 56px;
  padding: 15px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 999px;
  font-size: .83rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .2s, background .2s;
}

.button:active { transform: scale(.98); }

.timeline-list {
  margin-top: 34px;
  text-align: left;
}

.timeline-list > div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,.22);
}

.timeline-list time {
  font: 400 1.55rem/1.2 "Prata", Georgia, serif;
}

.timeline-list span {
  color: rgba(255,255,255,.78);
  font-size: .83rem;
  line-height: 1.55;
}

.timeline-list strong {
  display: block;
  margin-bottom: 4px;
  color: white;
  font-size: .95rem;
}

.rsvp-invite {
  padding: 100px 30px;
  color: var(--ink);
  text-align: center;
  background: linear-gradient(145deg, var(--pink), var(--lilac) 48%, var(--periwinkle));
}

.rsvp-invite .script-label { color: #69597e; }
.rsvp-invite h2 { max-width: 440px; font-size: clamp(2rem, 9vw, 3.1rem); }

.button-light {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

footer {
  padding: 100px 24px max(65px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

footer p { margin: 0 0 6px; color: var(--pink); }
footer strong { font-size: 2.1rem; }
footer span { margin-top: 18px; font-size: .72rem; letter-spacing: .28em; }

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* RSVP */
.rsvp-page {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
}

.rsvp-scene { width: 100%; max-width: 680px; margin: 0 auto; }

.letter-card {
  padding: 48px clamp(22px, 7vw, 56px);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 30px;
  background: rgba(57, 52, 79, .68);
  box-shadow: 0 24px 70px rgba(48, 42, 67, .3);
  backdrop-filter: blur(18px);
}

.letter-card h1 {
  margin: 6px 0 14px;
  font-size: clamp(2.8rem, 13vw, 5rem);
  text-align: left;
}

.letter-card .eyebrow { color: var(--pink); font-size: .78rem; letter-spacing: .15em; text-transform: uppercase; }
.letter-card .invite-copy { margin-bottom: 30px; }
.back-link { display: inline-block; margin-bottom: 28px; font-size: .82rem; }

.rsvp-form { display: grid; gap: 22px; }
.rsvp-form > label { display: grid; gap: 8px; }
.rsvp-form label > span, .rsvp-form legend { font-size: .86rem; font-weight: 600; }

.rsvp-form input,
.rsvp-form textarea,
.rsvp-form select {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  color: white;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 14px;
  outline: none;
  background: rgba(255,255,255,.08);
  font: inherit;
  font-size: 16px;
}

.rsvp-form textarea { resize: vertical; }
.rsvp-form input:focus, .rsvp-form textarea:focus, .rsvp-form select:focus { border-color: var(--pink); }
.rsvp-form select option { color: #1d2e26; }
.rsvp-form fieldset { margin: 0; padding: 18px; border: 1px solid rgba(255,255,255,.28); border-radius: 14px; }
.rsvp-form fieldset label { padding: 8px 0; display: flex; gap: 10px; align-items: center; }
.rsvp-form fieldset input { width: 22px; min-height: 22px; accent-color: var(--violet); }
.rsvp-form .submit { width: 100%; color: white; background: var(--ink); cursor: pointer; }
.hp-field { position: absolute; left: -9999px; }

/* Admin */
.admin-card { max-width: 1200px; }
.admin-page .rsvp-scene { max-width: 1200px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 28px 0; }
.stats-grid div { padding: 18px; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; }
.stats-grid span, .stats-grid strong { display: block; }
.stats-grid strong { font-size: 2rem; }
.response-table-wrap { overflow-x: auto; margin-top: 28px; }
.response-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.response-table th, .response-table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.15); text-align: left; }
.delete-rsvp { color: white; border: 0; background: transparent; cursor: pointer; }
.delete-rsvp svg { width: 22px; fill: none; stroke: currentColor; }

@media (min-width: 700px) {
  .invitation-page { max-width: 660px; }
  .content-section { padding-inline: 64px; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px), (pointer: coarse) {
  .parallax-backdrop {
    display: none;
  }

  .content-section,
  .letter-card {
    backdrop-filter: none;
  }

  .js .reveal {
    transition-duration: .45s;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
