/* Momeneist · Fajar & Weli — wedding invitation */
:root {
  --page: #FFF6EF;        /* outer background */
  --card: #FAF0E8;        /* invitation paper */
  --card-2: #F9EDE4;
  --green: #2C4A3B;       /* main text / script */
  --green-soft: #5D6F62;  /* body text */
  --sage: #A9B9A5;
  --coral: #E8866A;
  --blush: #F3CFC0;       /* arch lines */
  --line: #B9C7B6;
  --white: #FFFDFB;
  --script: "Pinyon Script", cursive;
  --serif: "EB Garamond", Georgia, serif;
  --col: 440px;           /* invitation column width on desktop */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--green-soft);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; height: 100dvh; }
img { max-width: 100%; display: block; }
h1, h2, p { margin: 0; }

/* ---------- column / card ---------- */
.card {
  position: relative;
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  background: var(--card);
  box-shadow: 0 0 60px rgba(214, 170, 150, .18);
}
.topbar {
  position: relative;
  z-index: 3;
  padding: 16px 12px 14px;
  background: var(--page);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--green);
}

/* ---------- florals ---------- */
.floral {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}
.floral--tl { top: 0; left: 0; width: 50%; transform-origin: 0 0; }
.floral--tr { top: 0; right: 0; width: 30%; transform-origin: 100% 0; }
.floral--bl { bottom: 0; left: 0; width: 28%; transform-origin: 0 100%; }
.floral--br { bottom: 0; right: 0; width: 35%; transform-origin: 100% 100%; }

.sway { animation: sway 7s ease-in-out infinite alternate; }
.sway--alt { animation-duration: 8.5s; animation-delay: -3s; }
@keyframes sway {
  from { transform: rotate(-1.2deg) scale(1); }
  to   { transform: rotate(1.2deg) scale(1.015); }
}

/* tap a floral corner: it blooms */
.floral { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.floral.is-bloom { animation: bloom .9s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bloom {
  0%   { transform: scale(1) rotate(0); }
  35%  { transform: scale(1.08) rotate(2.5deg); }
  70%  { transform: scale(.98) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ---------- petals ---------- */
.petals {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, var(--col));
  transform: translateX(-50%);
  z-index: 55;
  overflow: hidden;
  pointer-events: none;
}
.petal {
  position: absolute;
  top: -24px;
  width: var(--s, 12px);
  height: calc(var(--s, 12px) * .78);
  border-radius: 150% 0 150% 0;
  background: linear-gradient(135deg, #FBD3C2 0%, #F2A58C 60%, #E8866A 100%);
  opacity: .85;
  will-change: transform;
  animation: fall var(--d, 10s) linear forwards;
}
.petal--leaf { background: linear-gradient(135deg, #D6E2CF 0%, #A9B9A5 100%); }
@keyframes fall {
  0%   { transform: translate(0, 0) rotate(var(--r, 0deg)); }
  25%  { transform: translate(var(--x1, 20px), 25vh) rotate(calc(var(--r, 0deg) + 90deg)); }
  50%  { transform: translate(var(--x2, -15px), 52vh) rotate(calc(var(--r, 0deg) + 180deg)); }
  75%  { transform: translate(var(--x1, 20px), 78vh) rotate(calc(var(--r, 0deg) + 270deg)); }
  100% { transform: translate(var(--x2, -15px), 108vh) rotate(calc(var(--r, 0deg) + 360deg)); opacity: .2; }
}
.petal--burst {
  top: var(--y0);
  left: var(--x0);
  animation: burst var(--d, 1.4s) cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes burst {
  0%   { transform: translate(-50%, -50%) scale(.3) rotate(0); opacity: 1; }
  60%  { opacity: .9; }
  100% { transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by))) scale(1) rotate(var(--r, 180deg)); opacity: 0; }
}

/* ---------- cover ---------- */
.cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--page);
  transition: transform 1.1s cubic-bezier(.7, 0, .2, 1), opacity 1.1s ease;
}
.cover.is-open { transform: translateY(-100%); opacity: .4; pointer-events: none; }
.cover__card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.frame {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
}
.arch {
  position: absolute;
  z-index: 0;
  inset: 4% 7% -2%;
  border: 1.5px solid var(--blush);
  border-radius: 999px 999px 0 0 / 220px 220px 0 0;
  opacity: .7;
}
.arch::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--blush);
  border-radius: inherit;
  opacity: .6;
}
.cover__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.4dvh, 14px);
  padding: 3dvh 34px 4dvh;
  text-align: center;
}
.eyebrow {
  font-size: clamp(17px, 2.6dvh, 21px);
  letter-spacing: .08em;
  color: var(--green-soft);
}
.names {
  font-family: var(--script);
  font-weight: 400;
  color: var(--green);
  font-size: clamp(42px, 8.2dvh, 70px);
  line-height: 1.02;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.names .amp { font-size: 1em; line-height: 1; }
.rule {
  width: 50px;
  border: 0;
  border-top: 1px solid var(--green-soft);
  margin: clamp(4px, 1.5dvh, 16px) auto;
  opacity: .7;
}
.parents {
  max-width: 300px;
  font-size: clamp(14px, 2dvh, 16px);
  line-height: 1.4;
}
.when {
  margin-top: clamp(4px, 1.6dvh, 18px);
  font-size: clamp(17px, 2.6dvh, 20px);
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--green);
}
.when--sm { font-size: 18px; margin: 4px 0 18px; }

.guest { margin-top: 4px; }
.guest__label { font-size: 14px; letter-spacing: .06em; }
.guest__name {
  font-size: clamp(19px, 2.8dvh, 23px);
  font-weight: 600;
  color: var(--green);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  margin-top: 6px;
  padding: 11px 34px;
  border: 1.3px solid var(--green);
  border-radius: 999px;
  background: var(--white);
  color: var(--green);
  font: 600 17px/1.2 var(--serif);
  letter-spacing: .03em;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s, color .25s, transform .25s;
}
.btn:hover, .btn:focus-visible { background: var(--green); color: var(--white); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn--ghost { background: transparent; }

/* ---------- invitation sections ---------- */
.invitation { overflow: hidden; }
.section {
  position: relative;
  padding: clamp(110px, 18vw, 140px) 30px;
  text-align: center;
  border-top: 1px solid rgba(243, 207, 192, .55);
}
.section__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.section .floral--tl { width: 42%; }
.section .floral--tr { width: 28%; }
.section .floral--bl { width: 25%; }
.section .floral--br { width: 32%; }

.title {
  font-size: 28px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: .01em;
}
.script-title {
  font-family: var(--script);
  font-weight: 400;
  font-size: 54px;
  line-height: 1.1;
  color: var(--green);
}
.script-title--lg { font-size: 62px; margin-top: 18px; }
.muted { max-width: 330px; font-size: 16px; }
.bigdate {
  display: flex;
  gap: 10px;
  font-size: 40px;
  font-weight: 600;
  color: var(--green);
}
.bigdate__sep { color: var(--coral); }

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin: 16px 0 8px;
}
.countdown div {
  padding: 12px 0 8px;
  border: 1px solid var(--blush);
  border-radius: 999px 999px 14px 14px;
  background: rgba(255, 253, 251, .7);
}
.countdown b {
  display: block;
  font-size: 26px;
  font-weight: 600;
  color: var(--green);
  line-height: 1.1;
}
.countdown span { font-size: 13px; letter-spacing: .06em; }

.map {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 6px 0 10px;
  border-radius: 160px 160px 14px 14px;
  overflow: hidden;
  border: 1px solid var(--blush);
  background: var(--card-2);
}
.map iframe { width: 100%; height: 100%; border: 0; }

/* ---------- forms ---------- */
.form {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  text-align: left;
}
.field { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.field span, .choice legend { font-size: 15px; font-weight: 600; color: var(--green); }
.field input, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--green);
  font: 17px/1.4 var(--serif);
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(44, 74, 59, .12);
}
.choice {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.choice legend { margin-bottom: 6px; }
.choice label {
  flex: 1 1 130px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--green);
  cursor: pointer;
}
.choice label:has(input:checked) { border-color: var(--green); background: #EEF2EC; }
.choice input { accent-color: var(--green); }
.form__msg { min-height: 1.4em; font-size: 15px; text-align: center; color: var(--green); }
.form__msg.is-error { color: #B4533A; }

.wishes-head {
  width: 100%;
  max-width: 360px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--blush);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.wishes-head h3 { margin: 0; font-size: 20px; font-weight: 600; color: var(--green); }
.wishes-head span { font-size: 14px; }
.wishes {
  list-style: none;
  width: 100%;
  max-width: 360px;
  max-height: 420px;
  overflow-y: auto;
  margin: 8px 0 0;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.wishes li {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 253, 251, .8);
  border: 1px solid rgba(243, 207, 192, .7);
}
.wishes b { display: block; color: var(--green); font-size: 16px; }
.wishes p { font-size: 16px; }
.wishes time { font-size: 13px; opacity: .75; }
.wishes .empty { text-align: center; background: none; border: 0; }

.gifts { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.gift {
  padding: 18px;
  border: 1px solid var(--blush);
  border-radius: 16px;
  background: rgba(255, 253, 251, .8);
}
.gift__bank { font-weight: 700; letter-spacing: .08em; color: var(--green); }
.gift__no { font-size: 22px; font-weight: 600; color: var(--green); letter-spacing: .04em; }
.gift .btn { padding: 7px 22px; font-size: 15px; }

.section--verse { padding-top: 120px; padding-bottom: 120px; }
.verse { margin: 0; max-width: 340px; }
.verse p {
  font-size: 19px;
  font-style: italic;
  line-height: 1.6;
  color: var(--green);
}
.verse footer {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--coral);
}

.section--closing { padding-bottom: 170px; }
.couple { font-size: 22px; font-weight: 600; color: var(--green); letter-spacing: .06em; }
.privacy {
  max-width: 320px;
  margin-top: 22px;
  font-size: 14px;
  font-style: italic;
  opacity: .85;
}
.brand { margin-top: 18px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; opacity: .6; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
  .sway, .floral.is-bloom { animation: none; }
  .petals { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cover { transition: opacity .3s; }
}
