/* ==========================================================================
   Luanna & Arlei — convite
   ========================================================================== */

:root {
  --ink: #2c3824;
  --forest: #647445;  /* green for text on beige (client spec) */
  --moss: var(--forest);
  --sage: #6b7f5b;
  --cream: #f5efe4;
  --paper: #fbf7f0;
  --sand: #e8dcc6;
  /* The flat salvia every dark panel is painted in. Flat, not a gradient:
     the gradient bottomed out at near-black, which is not what salvia is. */
  --green: #6E6F4E;
  --gold: #b8965a;
  --gold-2: #e8d7ae;
  --gold-soft: rgba(184, 150, 90, .35);

  --serif: "GFS Didot", Didot, "Bodoni 72", "Times New Roman", serif;
  --serif-italic: "Playfair Display", Didot, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* Envelope geometry (portrait, 1 : 1.4). Shares the card's 92vw so the
     envelope, the invitation and the page all resolve to one width on a
     phone, which keeps the opening from feeling like a jump in scale. */
  --env-w: min(480px, 92vw, calc(68svh / 1.4));
  --env-h: calc(var(--env-w) * 1.4);

  /* Card geometry (portrait, 1 : 1.265). Fully expanded size.
     On narrow viewports the aspect-locked height is too short for
     minimum-readable text, so the height also floors against a
     generous share of the viewport (never below the aspect ratio). */
  --card-w: min(680px, 92vw, calc(84svh / 1.265));
  --card-h: max(calc(var(--card-w) * 1.265), min(78svh, 620px));
}

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

/* An element given `hidden` goes, whatever display it sets for itself.
   The browser's own `[hidden] { display: none }` is a user-agent rule, so
   any author rule — `.event { display: flex }` — quietly outranks it and
   the element stays on screen. Every hidden/shown part of this site is
   driven by that attribute, so it has to win. */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Keep all reading copy and native controls on the same sans face. Display
   classes opt into the serif separately, so headings stay intentional. */
button, input, select, textarea { font-family: var(--sans); }

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--cream);
  padding: .6rem 1rem; z-index: 100; border-radius: 4px;
  text-decoration: none; font-size: .9rem;
}
.skip:focus { top: 1rem; }

/* ---------- type helpers ---------- */

.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow--light { color: var(--cream); }

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  color: var(--ink);
}
.display em { font-style: italic; font-family: var(--serif-italic); font-weight: 400; color: var(--moss); }
.display--light { color: var(--cream); }
.display--light em { color: var(--cream); }
.display--sm { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }

.wrap {
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
}
.wrap--narrow { width: min(760px, 100% - 3rem); }

.section { padding: clamp(5rem, 12vh, 9rem) 0; position: relative; scroll-margin-top: 5.5rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .95rem 1.7rem;
  border-radius: 999px;
  font-family: var(--sans); font-weight: 400; font-size: .8rem;
  letter-spacing: .22em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--forest);
  transition: background .35s var(--ease-out), color .35s var(--ease-out), transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.btn--solid { background: var(--forest); color: var(--cream); }
.btn--solid:hover { background: var(--ink); transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(44, 56, 36, .6); }
.btn--ghost { background: transparent; color: var(--forest); }
.btn--ghost:hover { background: var(--forest); color: var(--cream); }
.btn--wide { width: 100%; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ==========================================================================
   GATE — a word decides which celebration a guest is invited to.
   The lock class is set in the page <head>, before anything paints, so the
   invitation never flashes up behind the gate.
   ========================================================================== */

.is-locked body { overflow: hidden; }
.is-locked body > *:not(.gate) { visibility: hidden; }

.is-asking { overflow: hidden; }

.gate {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: clamp(1.5rem, 6vw, 3rem);
  background: rgba(38, 50, 31, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--cream);
  overflow-y: auto;
}
.gate__box {
  position: relative;
  width: min(26rem, 100%);
  text-align: center;
  display: grid; gap: .5rem;
  padding: clamp(1.8rem, 5vw, 2.6rem);
  background: var(--green);
  border: 1px solid rgba(184, 150, 90, .3);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7);
}
.gate__close {
  position: absolute; top: .4rem; right: .6rem;
  appearance: none; background: none; border: 0;
  color: var(--cream);
  font-size: 1.6rem; line-height: 1;
  width: 44px; height: 44px; cursor: pointer;
}
.gate__close:hover { color: var(--cream); }
.gate__close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* What stands in for the details until a guest opens their invitation. */
.locked { text-align: center; padding: clamp(1rem, 3vh, 2rem) 0; }
.locked__text {
  margin: 1.2rem auto 2rem; max-width: 44ch;
  color: rgba(44, 56, 36, .78);
}
.gate__box .display { margin-bottom: .4rem; }
.gate__text {
  margin: 0 0 1.6rem;
  color: var(--cream);
}
.gate__label {
  font-size: .68rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--cream); text-align: left;
}
.gate__input {
  width: 100%;
  font: inherit; font-size: 1.05rem; color: var(--cream);
  background: transparent;
  border: 0; border-bottom: 1px solid rgba(245, 239, 228, .65);
  padding: .7rem 0; margin-bottom: 1.4rem;
  border-radius: 0;
  text-align: center; letter-spacing: .08em;
}
.gate__input:focus { outline: none; border-bottom-color: var(--gold-2); }
.gate .btn--solid { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.gate .btn--solid:hover { background: var(--gold-2); border-color: var(--gold-2); }
.gate__error {
  margin: 1rem 0 0; min-height: 1.4rem;
  font-size: .92rem; color: #e5a99b;
}

/* The celebration switch, for guests invited to both. It sits with the date
   it changes; the nav has no room for it on a phone. */
.edition-slot { display: flex; justify-content: center; margin-bottom: 1.6rem; }
.edition { color: var(--forest); font-size: .72rem; letter-spacing: .24em; }
.edition button { text-transform: uppercase; }
.edition button.is-on { color: var(--gold); border-bottom-color: var(--gold-soft); }

/* ==========================================================================
   READING PROGRESS
   Phones hide the native scrollbar entirely, so there is otherwise no clue
   how long the page runs. Gold reads on both the forest hero and the paper
   sections, so one treatment carries the whole page.
   ========================================================================== */

.progress {
  position: fixed; z-index: 40;
  right: clamp(.5rem, 1.4vw, 1rem);
  top: 24vh; bottom: 24vh;
  width: 2px;
  background: rgba(184, 150, 90, .2);
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s var(--ease-out);
}
/* Only shown once we know there is something to scroll. */
.progress.is-on { opacity: 1; }
.progress__bar {
  display: block; width: 100%; height: 100%;
  background: var(--gold);
  border-radius: inherit;
  transform: scaleY(0);
  transform-origin: 50% 0;
}

/* ==========================================================================
   NAV
   ========================================================================== */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  color: var(--ink);
  background: linear-gradient(to bottom, rgba(245, 239, 228, .92), rgba(245, 239, 228, .7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(184, 150, 90, .18);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform .6s var(--ease-out), opacity .6s var(--ease-out), visibility 0s linear .6s;
}
.nav.is-visible { transform: none; opacity: 1; visibility: visible; transition: transform .6s var(--ease-out), opacity .6s var(--ease-out); }
.no-js .nav, .is-static-hero .nav { visibility: visible; }

.nav__mono {
  display: inline-flex; align-items: center;
  text-decoration: none; line-height: 1;
}
.nav__mono img {
  display: block;
  width: 2.5rem; height: 2.5rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .18));
}

.nav__right { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.nav__links { display: flex; gap: clamp(1rem, 3vw, 2.2rem); align-items: center; }
.nav__links a {
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; text-decoration: none; font-weight: 400;
  opacity: .8; transition: opacity .3s;
}
.nav__links a:hover { opacity: 1; }
.nav__cta { padding: .55rem 1rem; border: 1px solid var(--forest); border-radius: 999px; opacity: 1 !important; }

/* The menu button only exists where the six links do not fit on one line
   (Spanish, the longest, wraps below ~1070px). */
.nav__toggle { display: none; }

@media (max-width: 1100px) {
  .nav__right { gap: .6rem; }

  .nav__toggle {
    display: grid; place-items: center;
    width: 44px; height: 44px;          /* a comfortable tap target */
    appearance: none; background: none; border: 0;
    cursor: pointer; color: inherit;
    order: -1;                          /* before the RSVP button */
  }
  .nav__bars, .nav__bars::before, .nav__bars::after {
    content: ""; display: block;
    width: 20px; height: 1px;
    background: currentColor;
    transition: transform .3s var(--ease-out), opacity .2s linear;
  }
  .nav__bars { position: relative; }
  .nav__bars::before { position: absolute; top: -6px; }
  .nav__bars::after  { position: absolute; top: 6px; }
  /* Open: the bars become a cross. */
  [aria-expanded="true"] .nav__bars { background: transparent; }
  [aria-expanded="true"] .nav__bars::before { transform: translateY(6px) rotate(45deg); }
  [aria-expanded="true"] .nav__bars::after  { transform: translateY(-6px) rotate(-45deg); }

  /* The section links drop out of the bar into a panel beneath it. */
  .nav__links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch;
    gap: 0;
    padding: .5rem clamp(1rem, 4vw, 2.5rem) 1.2rem;
    background: var(--cream);
    border-bottom: 1px solid rgba(184, 150, 90, .18);
    /* Closed by default; `hidden` is not used so the panel can animate. */
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a {
    padding: .9rem 0;                   /* 44px-ish rows */
    opacity: 1;
    border-bottom: 1px solid rgba(184, 150, 90, .14);
  }
  /* The RSVP link is the one thing to press in here, so it is filled rather
     than outlined — an outline at full width read as a cut-off box. */
  .nav__links .nav__cta {
    margin-top: 1.1rem; padding: 1rem;
    background: var(--forest); color: var(--cream);
    border: 0; border-radius: 999px;
    text-align: center;
  }
}

/* ---------- language toggle ---------- */

.lang {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .68rem; letter-spacing: .18em; font-weight: 400;
}
.lang button {
  appearance: none; -webkit-appearance: none;
  background: none; border: 0; padding: .25rem .1rem;
  font: inherit; letter-spacing: inherit; color: inherit;
  cursor: pointer;
  opacity: .5;
  border-bottom: 1px solid transparent;
  transition: opacity .3s var(--ease-out), border-color .3s var(--ease-out), color .3s var(--ease-out);
}
.lang button:hover { opacity: .85; }
.lang button.is-on { opacity: 1; color: var(--gold); border-bottom-color: var(--gold-soft); cursor: default; }
.lang button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.lang__sep { width: 1px; height: 11px; background: currentColor; opacity: .25; }

.lang--nav { color: var(--ink); }

/* Floating over the dark hero, so the guest can switch before scrolling. */
.lang--hero {
  position: absolute; z-index: 20;
  top: max(1.1rem, env(safe-area-inset-top)); right: clamp(1rem, 4vw, 2.5rem);
  color: var(--cream);
}
.lang--hero button.is-on { color: var(--cream); border-bottom-color: rgba(232, 215, 174, .5); }
.js .lang--hero { transition: opacity .5s var(--ease-out), visibility 0s linear .5s; }
/* Hand over to the nav's toggle once the envelope has finished opening. */
.js body.nav-up .lang--hero { opacity: 0; pointer-events: none; visibility: hidden; }

/* ==========================================================================
   HERO — envelope
   ========================================================================== */

.hero {
  position: relative;
  /* Scroll travel for the whole opening is this minus the visible stage
     (100svh). Phones pay for every screen of it with a thumb, so they get a
     shorter run than the desktop. */
  height: 340svh;
  /* The dark ground belongs to the stage, not to the hero's full height. The
     hero is several screens tall while the stage is one, so any hero
     background paints below the pinned stage and shows as a green band under
     the finished full-screen invitation, cutting it off from the page. */
  background: var(--cream);
  color: var(--cream);
}

@media (max-width: 700px) {
  .hero { height: 260svh; }
}

.hero__stage {
  position: relative;
  height: 100svh;
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding-top: 4svh;
  overflow: hidden;
  background: var(--green);
}

/* Fine paper grain across the stage — kept extremely subtle. */
.hero__stage::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  pointer-events: none;
  opacity: .5;
}

.scene { position: relative; }

.envelope {
  position: relative;
  width: var(--env-w);
  height: var(--env-h);
}

/* Stacking (all siblings, so z-index swaps work mid-animation):
   back 1 · liner 2 · card 3 (→10 once out) · pocket 4 · flap 6 (→0 once folded back) · seal 8 */

.envelope__back {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, #ece3d2 0%, #e2d6c0 100%);
  border-radius: 6px;
  box-shadow: 0 40px 60px -10px rgba(0, 0, 0, .5), 0 8px 16px rgba(0, 0, 0, .25);
  will-change: transform, opacity;
}

.envelope__liner {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  height: 60%;
  overflow: hidden;
  border-radius: 6px 6px 0 0;
}
.envelope__liner svg { width: 100%; height: 100%; }

.envelope__pocket {
  position: absolute; inset: 0; z-index: 4;
  width: 100%; height: 100%;
  border-radius: 6px;
}

.envelope__flap {
  position: absolute; left: 0; top: 0; z-index: 6;
  width: 100%; height: 57.5%;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.flap__face {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flap__face--front { border-radius: 6px 6px 0 0; }
.flap__face--back { transform: rotateX(180deg); }
.flap__shade { opacity: var(--flap-shade, 0); }

.envelope__seal {
  position: absolute; z-index: 8;
  left: 50%; top: 57.5%;
  width: calc(var(--env-w) * .17);
  height: calc(var(--env-w) * .17);
  margin-left: calc(var(--env-w) * -.085);
  margin-top: calc(var(--env-w) * -.085);
  border-radius: 50%;
  background: transparent;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .06),
    inset 0 2px 4px rgba(255, 255, 255, .15),
    inset 0 -3px 6px rgba(0, 0, 0, .35),
    0 6px 12px rgba(0, 0, 0, .35);
  display: grid; place-items: center;
  will-change: transform, opacity;
}
.envelope__seal img {
  display: block;
  width: 136%; height: 136%;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, .24));
}
.hero__hint {
  position: absolute; left: 50%; bottom: max(1.6rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
  font-size: .68rem; letter-spacing: .34em; text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
}
.hero__hintline {
  display: block; width: 1px; height: 44px;
  background: linear-gradient(to bottom, rgba(232, 215, 174, .9), transparent);
  animation: hintline 2.2s var(--ease-out) infinite;
}
@keyframes hintline {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  35% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  70% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ---------- The card ---------- */

/* The paper surface that takes over the viewport at the final beat. It sits
   directly behind the card (same size and centre, so it is invisible until it
   grows) and holds no text, so scaling it never magnifies the typography. */
.card-paper {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 9;
  width: var(--card-w);
  height: var(--card-h);
  /* Centring is left to GSAP (xPercent/yPercent), as on .card — setting it
     here too would offset the element twice. */
  background: linear-gradient(180deg, #fdfaf4 0%, #f7f1e6 100%);
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}

.card {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 3;
  width: var(--card-w);
  height: var(--card-h);
  container-type: inline-size;
  will-change: transform;
  border-radius: 4px;
  color: var(--ink);
  /* --card-skin fades the card's own paper, grain and shadow together as the
     surface above takes over, leaving only the text. All of it rides on the
     one pseudo-element, so the fade is a single opacity rather than three
     blurred shadow layers recomputed every frame. */
  --card-skin: 1;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .15  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg, #fdfaf4 0%, #f7f1e6 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .8) inset,
    0 30px 60px -30px rgba(0, 0, 0, .55),
    0 10px 24px -14px rgba(0, 0, 0, .35);
  opacity: var(--card-skin);
  pointer-events: none;
}

.card__frame {
  position: absolute; inset: 4.2cqw;
  --frame-alpha: 1;
  border: 1px solid rgba(184, 150, 90, calc(.35 * var(--frame-alpha)));
  outline: 1px solid rgba(184, 150, 90, calc(.35 * var(--frame-alpha)));
  outline-offset: 1.1cqw;
  display: grid; grid-template-rows: 1fr auto; justify-items: center;
  text-align: center;
  padding: 5cqw 7cqw 3.5cqw;
}
.card__content {
  min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.card__ornament { color: var(--gold); width: 24cqw; margin-bottom: 4cqw; }

.card__names {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  line-height: .95;
  display: flex; flex-direction: column; align-items: center;
}
.card__name { font-size: 12.5cqw; letter-spacing: .02em; }
.card__amp {
  font-size: 7cqw; font-style: italic; font-family: var(--serif-italic); color: var(--gold);
  margin: .8cqw 0;
}

.card__lead {
  margin: 4.5cqw 0 5cqw;
  font-style: italic; font-family: var(--serif-italic); font-weight: 400;
  font-size: clamp(1rem, 4cqw, 1.35rem); line-height: 1.35; color: var(--moss);
}

/* Both celebrations, side by side where the card is wide enough and stacked
   where it is not. Just when and where — the rest is behind the passcode. */
.card__both {
  display: grid;
  gap: 4cqw;
  width: 100%;
  text-align: center;
}
.card__cel { display: flex; flex-direction: column; gap: 1.2cqw; }
.card__celdate {
  font-family: var(--sans); font-weight: 400;
  font-size: clamp(.7rem, 2.1cqw, .95rem);
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold);
}
.card__celvenue {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.05rem, 4.4cqw, 1.6rem);
  line-height: 1.15;
}
.card__celwhere {
  font-size: clamp(.68rem, 1.9cqw, .9rem);
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--moss);
}
.card__celrule { display: none; }

@container (min-width: 400px) {
  .card__both { grid-template-columns: 1fr auto 1fr; align-items: center; gap: 3cqw; }
  .card__celrule {
    display: block; width: 1px; height: 78%;
    background: var(--gold-soft);
  }
}

.card__date {
  display: flex; align-items: center; gap: 4cqw;
  font-family: var(--serif);
}
.card__weekday, .card__time {
  font-family: var(--sans); font-weight: 400;
  font-size: clamp(.75rem, 2cqw, 1rem); letter-spacing: .28em; text-transform: uppercase;
  color: var(--ink);
}
.card__daybox {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 4cqw;
  border-left: 1px solid var(--gold-soft);
  border-right: 1px solid var(--gold-soft);
  line-height: 1;
}
.card__month, .card__year { font-size: clamp(.75rem, 2.6cqw, 1.05rem); letter-spacing: .3em; text-transform: uppercase; font-family: var(--sans); font-weight: 400; }
.card__day { font-size: 11cqw; font-weight: 400; line-height: 1; margin: .6cqw 0; color: var(--forest); font-variant-numeric: lining-nums; }

.card__place {
  margin: 5cqw 0 0;
  display: flex; flex-direction: column; gap: 1cqw;
}
.card__venue { font-family: var(--serif); font-size: 4.6cqw; font-weight: 500; letter-spacing: .02em; }
.card__city { font-size: clamp(.75rem, 2.1cqw, 1rem); letter-spacing: .3em; text-transform: uppercase; font-weight: 400; color: var(--moss); }

.card__scroll {
  margin-top: 3cqw;
  display: inline-flex; flex-direction: column; align-items: center; gap: .6cqw;
  font-size: clamp(.875rem, 1.8cqw, 1.05rem); letter-spacing: .3em; text-transform: uppercase; text-decoration: none;
  color: var(--gold); font-weight: 400;
}
.card__scroll svg { width: 3.4cqw; height: 3.4cqw; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(.6cqw); } }

/* Static state (no JS or reduced motion): show the open card only. */
.no-js .hero, .hero.is-static { height: auto; padding: 0; }
/* The padding rides on the stage so the dark ground still frames the card. */
.no-js .hero__stage, .hero.is-static .hero__stage {
  height: auto; overflow: visible;
  padding: clamp(5rem, 14vh, 8rem) 0;
}
.no-js .envelope, .hero.is-static .envelope { width: var(--card-w); height: var(--card-h); }
.no-js .envelope [data-env], .hero.is-static .envelope [data-env],
.no-js .hero__hint, .hero.is-static .hero__hint { display: none; }
.no-js .card, .hero.is-static .card { transform: translate(-50%, -50%); }
.no-js .nav, .is-static-hero .nav { transform: none; opacity: 1; }

/* ==========================================================================
   O DIA
   ========================================================================== */

.section--day { background: var(--cream); text-align: center; }
.section--day .display { margin-bottom: 2.5rem; }

.countdown {
  display: flex; justify-content: center; gap: clamp(1.2rem, 4vw, 3rem);
  margin: 0 auto 2.5rem;
}
.countdown__unit { display: flex; flex-direction: column; align-items: center; min-width: 3.2rem; }
.countdown__num {
  font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 400; line-height: 1;
  color: var(--forest); font-variant-numeric: lining-nums tabular-nums;
}
.countdown__label { margin-top: .5rem; font-size: .66rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }

.events {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  /* One venue per celebration, so the card is sized to read as a single
     card rather than a lonely column in a two-up grid. */
  max-width: 520px; margin: 0 auto;
}
.events.is-both { max-width: 1080px; }
.event {
  background: var(--paper);
  border: 1px solid rgba(184, 150, 90, .25);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  box-shadow: 0 30px 50px -40px rgba(44, 56, 36, .35);
}
.event__photo {
  width: calc(100% + clamp(3rem, 6vw, 5rem));
  margin: calc(clamp(2rem, 4vw, 3rem) * -1) 0 1.7rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sand);
}
.event__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.event__icon { width: 44px; color: var(--gold); margin-bottom: .8rem; }
.event__kicker { margin: 0; font-size: .68rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); font-weight: 400; }
.event__title { margin: .3rem 0 0; font-family: var(--serif); font-size: 1.9rem; font-weight: 500; line-height: 1.1; }
.event__time { margin: .2rem 0 .4rem; font-style: italic; font-family: var(--serif-italic); font-size: 1.25rem; color: var(--moss); font-variant-numeric: lining-nums; }
.event__address { margin: 0 0 1.4rem; font-size: .95rem; color: rgba(44, 56, 36, .75); line-height: 1.5; }

/* Minimap. Warmed slightly so it sits on the paper rather than on top of it. */
.event__map {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 0 1.4rem;
  border: 1px solid rgba(184, 150, 90, .3);
  background: var(--sand);
  overflow: hidden;
}
.event__mapframe {
  width: 100%; height: 100%;
  border: 0; display: block;
  filter: sepia(.32) saturate(.8) contrast(.95) brightness(1.02);
}
@media (prefers-reduced-motion: reduce) {
  .event__mapframe { filter: none; }
}

/* Sits between the countdown and the venue cards: saving the date is the
   thing to do at this point, the venues are reference. */
.day__actions { margin: 0 0 clamp(3.5rem, 8vh, 5rem); }

/* The way back out, for a wrong word or a shared phone. */
.day__back { margin: 2.5rem 0 0; }

/* The reply block follows the venue card inside the same section, so it needs
   room of its own — otherwise the heading sits on the card's bottom edge. */
.events + .eyebrow { margin-top: clamp(4rem, 10vh, 6rem); }

/* Travel & stay: three short cards in the same paper as the venue card. */
.travel {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  max-width: 1080px; margin: 0 auto;
  text-align: center;
}
.travel__card {
  background: var(--paper);
  border: 1px solid rgba(184, 150, 90, .25);
  padding: clamp(1.6rem, 3vw, 2.2rem) clamp(1.3rem, 2.5vw, 2rem);
}
.travel__title { margin: 0 0 1rem; font-family: var(--serif); font-size: 1.5rem; font-weight: 400; line-height: 1.15; }
.travel__text { margin: 0; color: rgba(44, 56, 36, .8); line-height: 1.6; }
.travel__text + .travel__text { margin-top: .8rem; }
.travel__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.travel__list a { color: var(--forest); font-weight: 400; text-decoration: underline; text-decoration-color: var(--gold-soft); text-underline-offset: 3px; }
.travel__list a:hover { text-decoration-color: currentColor; }
.travel__list span { display: block; margin-top: .15rem; font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }

/* ==========================================================================
   NOSSA HISTÓRIA
   ========================================================================== */

.section--story {
  background: var(--green);
  color: var(--cream);
  text-align: center;
}

.quote {
  margin: 2.2rem auto 0;
  max-width: 560px;
  font-style: italic; font-family: var(--serif-italic); font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.45; color: var(--cream);
}

/* Long-form chapters share a reading column; photographs mark the changes
   in the story without making guests open or advance through the copy. */
.story-book {
  margin-top: clamp(3.5rem, 7vw, 6rem);
  padding: clamp(1.5rem, 4.5vw, 4rem);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .12);
}

.story-spread {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
.story-spread + .story-spread {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--gold-soft);
}
.story-spread__visual {
  position: sticky;
  top: 7rem;
}
.story-photo {
  position: relative;
  margin: .5rem 0 0;
  padding: .65rem .65rem 0;
  background: var(--cream);
  border: 1px solid var(--sand);
  transform: rotate(-2deg);
}
.story-spread:nth-child(2) .story-photo { transform: rotate(2deg); }
.story-photo > img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.story-photo figcaption {
  padding: .5rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.story-photo figcaption img {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .18));
}

.story-chapters { list-style: none; margin: 0; padding: 0; }
.story-chapter { position: relative; }
.story-chapter + .story-chapter {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--gold-soft);
}
.story-chapter__number {
  display: block;
  margin-bottom: .8rem;
  color: #93713c;
  font-family: var(--serif);
  font-size: 2rem;
  font-style: italic; font-family: var(--serif-italic);
  line-height: 1;
}
.tl__when {
  display: block;
  margin-bottom: .7rem;
  font-size: .67rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--forest);
  font-weight: 400;
}
.tl__title {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.08;
  text-wrap: balance;
}
.tl__text {
  margin: 0;
  color: #47503f;
  font-size: 1.0625rem;
  line-height: 1.85;
}
.story-ending {
  margin: clamp(4rem, 8vw, 7rem) auto 0;
  max-width: 640px;
  text-align: center;
}
.story-ending__photo {
  width: min(100%, 420px);
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
  padding: .65rem .65rem 0;
  background: var(--cream);
  border: 1px solid var(--sand);
  transform: rotate(-1.5deg);
}
.story-ending__photo > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.story-ending__photo figcaption {
  padding: .5rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.story-ending__photo figcaption img {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .18));
}
.story-ending .story-chapter__number,
.story-ending .tl__when { color: var(--cream); }
.story-ending .story-chapter__number { margin-bottom: 1.5rem; }
.story-ending .tl__title { font-size: clamp(2.5rem, 5vw, 3.6rem); font-style: italic; font-family: var(--serif-italic); }
.story-ending .tl__text { color: var(--cream); }

@media (max-width: 760px) {
  .story-book { width: 100%; padding: 2.5rem max(1.5rem, 6vw); }
  .story-spread { grid-template-columns: minmax(0, 1fr); gap: 2.75rem; }
  .story-spread__visual { position: static; width: min(78%, 310px); margin-inline: auto; }
  .story-photo { margin-top: 0; }
  .story-chapters { min-width: 0; }
  .story-chapter + .story-chapter { margin-top: 2rem; padding-top: 2rem; }
  .story-chapter__number { font-size: 1.7rem; }
  .tl__text { line-height: 1.8; }
}

/* A short landscape viewport must not hide the bottom of a pinned photo. */
@media (max-height: 650px) {
  .story-spread__visual { position: static; }
}

/* ==========================================================================
   TRAJE + PRESENTES
   ========================================================================== */

.section--info { background: var(--sand); }
.info {
  display: grid; gap: clamp(3rem, 6vw, 6rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}
.info__block .display--sm { margin-bottom: 1.2rem; }
.info__text { margin: 0 0 1.8rem; max-width: 46ch; color: rgba(44, 56, 36, .8); }

/* ==========================================================================
   RSVP — now part of the day section, not a section of its own
   ========================================================================== */

.rsvp__note { margin: 1.6rem 0 3rem; color: rgba(44, 56, 36, .8); }
.rsvp__both {
  margin: -1.6rem auto 3rem; max-width: 46ch;
  padding: .9rem 1.2rem;
  border: 1px solid var(--gold-soft);
  background: var(--paper);
  font-size: .95rem; color: var(--forest);
}
.rsvp__note strong { font-weight: 500; color: var(--forest); }

.form {
  text-align: left;
  display: grid; gap: 1.5rem;
  max-width: 560px; margin: 0 auto;
  background: var(--paper);
  padding: clamp(1.6rem, 4vw, 2.8rem);
  border: 1px solid rgba(184, 150, 90, .25);
  box-shadow: 0 40px 60px -50px rgba(44, 56, 36, .45);
}
.field { display: grid; gap: .5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend {
  font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 400; color: var(--forest);
  padding: 0;
}
.field__optional { text-transform: none; letter-spacing: .04em; color: rgba(44, 56, 36, .55); }
.field input[type="text"], .field select, .field textarea {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 1px solid rgba(44, 56, 36, .35);
  padding: .6rem 0; border-radius: 0;
  transition: border-color .3s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--gold); }
.field textarea { resize: vertical; }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b8965a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right .2rem center;
}

.field--choice legend { margin-bottom: .6rem; }
.choice { display: flex; align-items: center; gap: .75rem; cursor: pointer; padding: .35rem 0; }
.choice input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 50%; border: 1px solid rgba(44, 56, 36, .5); display: grid; place-items: center; transition: border-color .2s; }
.choice input::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--forest); transform: scale(0); transition: transform .25s var(--ease-out); }
.choice input:checked { border-color: var(--forest); }
.choice input:checked::after { transform: scale(1); }
.choice input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.choice span { font-size: 1rem; text-transform: none; letter-spacing: normal; color: var(--ink); }

.field.is-invalid input, .field.is-invalid select { border-bottom-color: #b04a3a; }
.field.is-invalid legend { color: #b04a3a; }

.form__status { margin: 0; min-height: 1.5rem; text-align: center; font-size: .95rem; color: var(--moss); }
.form__status.is-error { color: #b04a3a; }

/* ==========================================================================
   PRESENTES — secondary page
   ========================================================================== */

/* No envelope to open here, so the nav is present from the first paint. */
.page .nav { transform: none; opacity: 1; visibility: visible; }

.page-head {
  background: var(--green);
  color: var(--cream);
  text-align: center;
  padding: clamp(7rem, 18vh, 10rem) 0 clamp(3.5rem, 9vh, 5.5rem);
}
.page-head .display { color: var(--cream); }
.page-head .display em { color: var(--cream); }
.page-head__text {
  margin: 1.6rem auto 0;
  max-width: 52ch;
  color: var(--cream);
}

.section--gifts,
.section--travel { background: var(--cream); }

.gifts__intro {
  max-width: 60ch; margin: 1.2rem 0 0;
  color: rgba(44, 56, 36, .8); line-height: 1.7;
}
.gifts {
  list-style: none; padding: 0;
  display: grid; gap: clamp(1rem, 2.4vw, 1.6rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  margin: clamp(2.5rem, 6vh, 4rem) 0 0;
  counter-reset: gift;
}
.gift {
  counter-increment: gift;
  display: flex; flex-direction: column;
  padding: clamp(1.4rem, 3vw, 1.9rem);
  background: var(--paper);
  border: 1px solid rgba(184, 150, 90, .25);
  box-shadow: 0 30px 50px -40px rgba(44, 56, 36, .35);
}
/* Numbered like the chapters of the story. */
.gift::before {
  content: counter(gift, decimal-leading-zero);
  display: block; margin-bottom: .8rem;
  font-family: var(--serif-italic); font-style: italic;
  font-size: 1.5rem; line-height: 1; color: #93713c;
}
.gift__title {
  margin: 0 0 .6rem;
  font-family: var(--serif); font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  font-weight: 400; line-height: 1.15;
}
.gift__text { margin: 0; font-size: .97rem; line-height: 1.6; color: rgba(44, 56, 36, .78); }
/* Pinned to the bottom so the prices line up across a row. */
.gift__prices { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: 1.4rem; }
.gift__price { flex: 1 1 0; padding: .75rem 1rem; letter-spacing: .08em; white-space: nowrap; }
.transfer { scroll-margin-top: 6rem; }

/* ---------- galeria ---------- */

.section--gallery { background: var(--cream); }

.gallery {
  display: grid; gap: clamp(1rem, 2.4vw, 1.6rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  margin-top: clamp(2.5rem, 6vh, 4rem);
  list-style: none; padding: 0;
}
.gallery__item { margin: 0; }
/* Empty frames until the couple's own photographs arrive. */
.gallery__media {
  aspect-ratio: 3 / 4;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--sand) 0%, #f1e8d7 100%);
  border: 1px solid rgba(184, 150, 90, .25);
  color: var(--gold);
  overflow: hidden;
}
.gallery__media svg { width: clamp(34px, 8vw, 46px); }
.gallery__media img { width: 100%; height: 100%; object-fit: cover; }
.gallery__caption {
  margin: .8rem 0 0;
  font-size: .8rem; letter-spacing: .04em; color: rgba(44, 56, 36, .7);
}
.gallery__note {
  margin: clamp(2.5rem, 6vh, 3.5rem) auto 0; max-width: 46ch;
  text-align: center; font-size: .95rem; color: rgba(44, 56, 36, .7);
}

.section--transfer { background: var(--sand); }

.transfer {
  max-width: 620px; margin: clamp(2.5rem, 6vh, 3.5rem) auto 0;
  background: var(--paper);
  border: 1px solid rgba(184, 150, 90, .25);
  padding: clamp(1.5rem, 4vw, 2.6rem);
  box-shadow: 0 40px 60px -50px rgba(44, 56, 36, .45);
  text-align: left;
}
.transfers-both {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  max-width: 1080px;
  margin: clamp(2.5rem, 6vh, 3.5rem) auto 0;
}
.transfers-both .transfer { max-width: none; margin: 0; }
.transfer__row {
  display: grid; gap: .45rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(184, 150, 90, .22);
}
.transfer__row:last-child { border-bottom: 0; padding-bottom: 0; }
.transfer__row:first-child { padding-top: 0; }
.transfer__label {
  font-size: .68rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--forest); font-weight: 400;
}
.transfer__value {
  margin: 0;
  font-family: var(--serif); font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  overflow-wrap: anywhere;
}
.transfer__line { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }
.transfer__copy {
  padding: .55rem 1.1rem;
  font-size: .68rem; letter-spacing: .2em;
  min-height: 44px;
}
.transfer__note {
  margin: 2rem auto 0; max-width: 52ch;
  font-size: .95rem; color: rgba(44, 56, 36, .72); text-align: center;
}
.transfer__qr {
  display: grid;
  justify-items: center;
  gap: .8rem;
  padding-top: 1.2rem;
}
.transfer__qr-image {
  display: block;
  width: min(260px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(184, 150, 90, .25);
  padding: .8rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  background: var(--green); color: var(--cream);
  text-align: center;
  padding: clamp(4rem, 10vh, 7rem) 1.5rem calc(2.5rem + env(safe-area-inset-bottom));
}
.footer__ornament { width: 120px; margin: 0 auto 1.8rem; color: var(--gold-2); }
.footer__sign { margin: 0; font-style: italic; font-family: var(--serif-italic); font-size: 1.35rem; color: var(--cream); line-height: 1.4; }
.footer__sign span { display: block; font-style: normal; font-family: var(--serif); font-size: clamp(2.4rem, 5vw, 3.4rem); color: var(--cream); margin-top: .4rem; line-height: 1.05; }
.footer__meta { margin: 3rem 0 0; font-size: .66rem; letter-spacing: .3em; text-transform: uppercase; color: var(--cream); }

/* ==========================================================================
   Reveal (driven by JS; without JS everything is visible)
   ========================================================================== */

.js [data-reveal] { opacity: 0; transform: translateY(26px); }
.js [data-reveal].is-in { opacity: 1; transform: none; transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero__hintline, .card__scroll svg { animation: none; }
}
