:root {
  --cream: #FFFBF0;
  --sky: #E6F1FA;
  --sky-mid: #BFD9EF;
  --navy: #1E3A5F;
  --ink-soft: #4A5F78;
  --olive: #5B621D;
  --sage: #9DB89A;
  --lemon: #FFDE59;
  --lemon-soft: #FFF3B8;
  --blue: #2F6DA3;
  --script-blue: #2F6DA3;
  --line: rgba(30, 58, 95, 0.16);
  --radius: 20px;
  --script: 'Great Vibes', cursive;
  --sans: 'Nunito', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* no rubber band past the azulejo strip at the end (or above the top) */
html { scroll-behavior: smooth; overscroll-behavior-y: none; background: #fff; }
body { overscroll-behavior-y: none; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--navy);
  background-color: var(--cream);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0 0.25 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
}
body.is-closed { overflow: hidden; }
img { max-width: 100%; display: block; }
strong { font-weight: 700; }

/* ── Envelope ───────────────────────────────────── */
.envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px 16px;
  background: radial-gradient(circle at 50% 35%, #F4F9FD 0%, var(--sky) 60%, #D4E6F5 100%);
  transition: opacity 0.7s ease 1.3s, visibility 0s linear 2s;
}
.envelope {
  position: relative;
  width: min(86vw, 360px);
  aspect-ratio: 1.45;
  perspective: 900px;
}
.envelope-back, .envelope-front, .envelope-flap {
  position: absolute;
  inset: 0;
  border-radius: 14px;
}
.envelope-back { background: #A9CBEA; box-shadow: 0 18px 40px rgba(30, 58, 95, 0.18); }
.envelope-card {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 8%;
  bottom: 6%;
  background: var(--cream);
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: transform 0.9s cubic-bezier(.2,.8,.2,1) 0.55s;
}
.envelope-card img { width: 46%; }
.envelope-front {
  background: linear-gradient(160deg, #C6DDF1, #B4D2EC);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
}
.envelope-flap {
  background: linear-gradient(180deg, #D5E6F5, #BCD6EE);
  clip-path: polygon(0 0, 100% 0, 50% 56%);
  transform-origin: top;
  transition: transform 0.6s ease;
  z-index: 2;
}
.envelope-seal {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 54px;
  transform: translate(-50%, -50%);
  z-index: 3;
  filter: drop-shadow(0 3px 6px rgba(120, 90, 20, 0.3));
  animation: seal-pulse 2.4s ease-in-out infinite;
  transition: opacity 0.3s ease;
}
.envelope-to {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
  text-align: center;
}
.envelope-open { min-width: 220px; font-size: 1.15rem; }

.is-opening .envelope-seal { opacity: 0; animation: none; }
.is-opening .envelope-flap { transform: rotateX(180deg); z-index: 0; }
.is-opening .envelope-card { transform: translateY(-58%); z-index: 1; }
.is-opening .envelope-front { z-index: 2; }
.is-opening .envelope-open, .is-opening .envelope-to { opacity: 0; transition: opacity 0.3s; }
.is-open .envelope-screen { opacity: 0; visibility: hidden; pointer-events: none; }

@keyframes seal-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

.sample-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px 16px;
  background: var(--lemon);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

/* ── Layout ─────────────────────────────────────── */
main { max-width: 640px; margin: 0 auto; overflow: hidden; }
.section { padding: 56px 20px; text-align: center; }
.section.alt { background: rgba(230, 241, 250, 0.7); }
.section-title {
  margin: 0 0 12px;
  font-family: var(--script);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.15;
  color: var(--script-blue);
}
/* little blue heart under every title, like the printed invitation */
.section-title::after {
  content: '';
  display: block;
  width: 16px;
  height: 14px;
  margin: 8px auto 0;
  background: url("assets/corazon.svg") center / contain no-repeat;
}
.section-sub { margin: 0 auto 24px; max-width: 30em; color: var(--ink-soft); }

.tile-strip {
  height: 26px;
  background: url("assets/azulejo.svg") repeat-x center / 26px 26px;
  opacity: 0.9;
}

/* ── Cover ──────────────────────────────────── */
.cover { padding: 20px 14px 40px; }
.cover-frame {
  position: relative;
  padding: 96px 18px 72px;
  border: 2px solid var(--sky-mid);
  border-radius: 6px;
  /* thin lemon line inside the blue frame */
  box-shadow: inset 0 0 0 6px var(--cream), inset 0 0 0 7.5px rgba(255, 222, 89, 0.9);
}
.corner { position: absolute; width: 46%; max-width: 230px; pointer-events: none; }
.corner { width: 31%; }
.corner-l { top: -6px; left: -16px; transform: rotate(26deg); transform-origin: 0 0; }
/* mirror of the left branch, pivoting on the top right corner */
.corner-r { top: -6px; right: -16px; transform: rotate(-26deg) translateX(-100%) scaleX(-1); transform-origin: 100% 0; }
.corner-bl { top: auto; bottom: -6px; left: -12px; width: 30%; transform: rotate(-22deg); transform-origin: 0 100%; }
.ribbon {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 150px;
  transform: translateX(-50%);
}
.cover-kicker {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cover-event {
  margin: 2px 0 0;
  font-family: var(--script);
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  line-height: 1.1;
  color: var(--script-blue);
}
.cover-de {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cover-name {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.8rem, 18vw, 6rem);
  line-height: 1.1;
  color: var(--script-blue);
}
.cover-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 8px;
}
.cover-divider span { width: 70px; height: 1px; background: var(--script-blue); opacity: 0.4; }
.cover-divider img { width: 18px; }
.bear-wrap { position: relative; width: min(66vw, 280px); margin: 0 auto; }
.bear-wash {
  position: absolute;
  inset: 8% -4% 2%;
  border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 45% 45%, rgba(191, 217, 239, 0.75), rgba(191, 217, 239, 0) 70%);
}
.bear { position: relative; animation: bob 4.5s ease-in-out infinite; }
.bear-extras { position: absolute; right: -14%; bottom: 0; width: 46%; }
.cover-date {
  margin: 18px 0 0;
  font-size: clamp(0.95rem, 4.6vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cover-time { margin: 2px 0 0; color: var(--ink-soft); font-weight: 600; font-size: clamp(0.9rem, 4.3vw, 1.1rem); }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-6px) rotate(-1.2deg); }
}
@keyframes sway {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(1.6deg); }
}

/* ── Message ────────────────────────────────────── */
.message p { max-width: 28em; margin: 0 auto 14px; }
.message-lead {
  font-family: var(--script);
  font-size: 2.1rem;
  line-height: 1.25;
  color: var(--script-blue);
}

/* ── Countdown ──────────────────────────────────── */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 420px;
  margin: 8px auto 14px;
}
.countdown div {
  padding: 14px 4px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(30, 58, 95, 0.06);
}
.countdown span { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; }
.countdown small { font-size: 0.8rem; color: var(--ink-soft); }
.countdown-text { margin: 0; font-weight: 600; color: var(--ink-soft); }

/* ── When and where ─────────────────────────────── */
.info-card {
  max-width: 440px;
  margin: 0 auto 22px;
  padding: 8px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
}
.info-row { display: flex; gap: 14px; padding: 14px 0; }
.info-row + .info-row { border-top: 1px solid var(--line); }
.info-icon { font-size: 1.5rem; line-height: 1.4; }
.info-row small { color: var(--ink-soft); }

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid var(--navy);
  font: 700 1.05rem var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #274b78; }
.btn-outline { background: #fff; color: var(--navy); }
.btn-outline:hover { background: var(--sky); }
.btn-block { width: 100%; }
.btn-small { min-height: 48px; font-size: 1rem; }
.btn-whatsapp {
  margin-top: 16px;
  background: transparent;
  border-color: transparent;
  color: var(--blue);
  text-decoration: underline;
  font-weight: 600;
}
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .link-btn:focus-visible, .stepper button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* ── Program ────────────────────────────────────── */
.timeline {
  list-style: none;
  max-width: 360px;
  margin: 0 auto 26px;
  padding: 0;
  text-align: left;
}
.timeline li {
  position: relative;
  padding: 0 0 22px 34px;
  border-left: 2px dashed var(--sky-mid);
  margin-left: 10px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -11px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: url("assets/rodaja.svg") center / cover;
}
.timeline time { display: block; font-weight: 700; }
.timeline span { color: var(--ink-soft); }
.dress { margin: 0; color: var(--ink-soft); }
.chip {
  display: inline-block;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--navy);
}
.chip-blue { background: var(--sky-mid); }
.chip-lemon { background: var(--lemon); }

/* ── Forms ──────────────────────────────────────── */
.card-form {
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(30, 58, 95, 0.06);
  text-align: left;
}
.field { display: block; margin-bottom: 18px; }
.field > span, .choice legend { display: block; margin-bottom: 6px; font-weight: 700; }
.field small { font-weight: 400; color: var(--ink-soft); }
input[type="text"], input[type="date"], textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid #C7D5E3;
  border-radius: 14px;
  background: var(--cream);
  font: 400 1.05rem var(--sans);
  color: var(--navy);
}
textarea { resize: vertical; }
/* iOS gives date inputs their own width and centers the value: keep it inside the card */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.choice { border: 0; margin: 0 0 18px; padding: 0; }
.choice label { display: block; margin-bottom: 10px; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 2px solid #C7D5E3;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.choice input:checked + span { border-color: var(--navy); background: var(--sky); }
.choice input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: 18px; }
.stepper button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--navy);
  background: #fff;
  color: var(--navy);
  font: 700 1.5rem var(--sans);
  cursor: pointer;
}
.stepper output { min-width: 2ch; font-size: 1.6rem; font-weight: 700; text-align: center; }
.form-error { min-height: 1.2em; margin: 0 0 10px; color: #B42318; font-weight: 600; font-size: 0.95rem; }

.thanks {
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: pop 0.5s cubic-bezier(.2,.8,.2,1);
}
.thanks img { width: 130px; margin: 0 auto 6px; }
.thanks .thanks-lemon { width: 64px; }
.thanks-title { margin: 0 0 6px; font-family: var(--script); font-size: 2.2rem; color: var(--script-blue); line-height: 1.2; }
.thanks p { margin: 0 0 8px; }
.link-btn {
  background: none;
  border: 0;
  padding: 8px;
  font: 600 1rem var(--sans);
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* ── Gifts ── */
.gift-frame {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 16px 24px;
  border: 2px solid var(--sky-mid);
  border-radius: 28px;
  box-shadow: inset 0 0 0 6px var(--cream), inset 0 0 0 7.5px rgba(255, 222, 89, 0.9);
}
.gift-top {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 44px;
  transform: translateX(-50%);
  background: var(--cream);
  border-radius: 50%;
  padding: 2px;
}
.script-note {
  margin: 22px auto 0;
  max-width: 22em;
  font-family: var(--script);
  font-size: 1.9rem;
  line-height: 1.25;
  color: var(--script-blue);
}
/* ──────────────────────────────────────── */
.gift-cards {
  display: grid;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto 20px;
}
.gift-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.gift-icon { font-size: 1.6rem; }
.gift-card h3 { margin: 4px 0; font-size: 1.1rem; }
.gift-card p { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.gift-link { margin-top: 14px; }
.gift-soon { margin-top: 10px !important; font-size: 0.9rem !important; font-style: italic; }
.gift-card { display: flex; flex-direction: column; align-items: center; }
.yape-box {
  max-width: 440px;
  margin: 16px auto 0;
  padding: 20px;
  border: 1px dashed var(--navy);
  border-radius: var(--radius);
  background: #fff;
}
.yape-box p { margin: 0 0 6px; }
.yape-number { font-size: 1.6rem; font-weight: 700; letter-spacing: 0.06em; }
.yape-holder { color: var(--ink-soft); margin-bottom: 14px !important; }
.copied { min-height: 1.4em; margin-top: 8px !important; font-weight: 700; color: var(--olive); }

/* ── Footer ─────────────────────────────────────── */
.footer { padding: 40px 0 0; text-align: center; background: rgba(230, 241, 250, 0.7); }
.footer .branch { margin-bottom: 8px; transform: scaleX(-1); }
.footer-thanks { margin: 0 20px 6px; font-weight: 700; }
.footer-sign { margin: 0 20px 28px; font-family: var(--script); font-size: 2rem; color: var(--script-blue); }
.ciao { margin: 0 0 18px; font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }

/* ── Reveal on scroll ───────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (min-width: 560px) {
  .btn-row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .gift-cards { grid-template-columns: 1fr 1fr; }
  .choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .choice label { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: none; }
}

/* "Baby Shower Brunch de" stays on one line on small phones */

