/* ==========================================================================
   BASSMA & ABDELRAHMAN — SITE STYLES
   Built on tokens.css. No raw hex outside this file's fallbacks.
   ========================================================================== */

:root {
  --nav-h: 68px;
}

html { scroll-padding-top: calc(var(--nav-h) + 8px); }

/* width/height attributes are layout hints only; never fix the rendered height */
img { height: auto; }

/* the hidden attribute must win over component display rules */
[hidden] { display: none !important; }

body { background: var(--paper-200); }

.wrap {
  width: 100%;
  max-width: var(--w-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }

/* ---------- skip link ---------- */
.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: -100px;
  z-index: 100;
  transition: top var(--dur-fast) var(--ease-out);
  background: var(--paper-50);
  color: var(--ink-900);
  padding: 12px 18px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
}
.skip:focus { top: 16px; }

/* ---------- navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(241, 232, 219, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  width: 100%;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  font-family: var(--font-display);
  font-size: 1.02rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-900);
  text-decoration: none;
  padding: 14px 0;
}
.brand em { font-style: italic; color: var(--gold-700); }
.nav-links { display: flex; gap: var(--s-5); }
.nav-links a {
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-600);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--ink-900); border-bottom-color: var(--gold-500); }

/* A live backdrop blur behind the intro is expensive on Android; the nav is
   hidden then anyway, so only enable it once the envelope is gone. */
html:not(.invite-opened) .site-nav { backdrop-filter: none; }
@media (pointer: coarse) {
  .site-nav { backdrop-filter: none; background: var(--paper-200); }
}
@media (max-width: 520px) { .nav-links { gap: var(--s-4); } .nav-links a { letter-spacing: 0.18em; } }

/* ---------- type utilities ---------- */
.label {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-600);
}
.lead {
  font-size: var(--fs-lead);
  line-height: 1.7;
  color: var(--ink-600);
  max-width: var(--w-prose);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 var(--s-7);
  border: 1px solid var(--olive-700);
  border-radius: var(--radius-sm);
  background: var(--olive-700);
  color: var(--paper-50);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--olive-800); border-color: var(--olive-800); }
.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-800);
}
.btn--ghost:hover { background: transparent; border-color: var(--ink-800); }
.btn--light {
  background: var(--paper-100);
  border-color: var(--paper-100);
  color: var(--ink-900);
}
.btn--light:hover { background: var(--paper-50); border-color: var(--paper-50); }
.btn--gold {
  background: transparent;
  border-color: var(--gold-500);
  color: var(--gold-400);
}
.btn--gold:hover { background: rgba(176, 138, 79, 0.12); border-color: var(--gold-400); color: var(--gold-300, #D6BB8A); }

.link-quiet {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-600);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-500);
  padding-bottom: 3px;
}
.link-quiet:hover { color: var(--ink-900); border-bottom-color: var(--ink-900); }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  place-items: center;
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
}

.hero__card {
  width: min(100%, 68rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  background: var(--paper-50);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

/* Left plate: the venue engraving, full-bleed to the card edge */
.hero__media { margin: 0; position: relative; background: var(--paper-100); min-height: 34rem; }
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
}

.hero__body {
  padding: clamp(2rem, 4.5vw, 3.5rem) clamp(1.35rem, 4vw, 3rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* On phones the engraving becomes a plate at the top of the card, and the
   type begins inside its fade. */
@media (max-width: 900px) {
  .hero__card { display: block; position: relative; }

  .hero__media {
    position: relative;
    inset: auto;
    height: clamp(250px, 66vw, 380px);
    opacity: 1;
    background: var(--paper-50);
    overflow: hidden;
  }
  .hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 24%;
  }
  .hero__media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 55%;
    background: linear-gradient(
      to top,
      var(--paper-50) 2%,
      rgba(252, 249, 243, 0.9) 34%,
      rgba(252, 249, 243, 0.55) 62%,
      rgba(252, 249, 243, 0) 100%
    );
    pointer-events: none;
  }

  .hero__body {
    position: relative;
    z-index: 1;
    margin-top: calc(-1 * clamp(56px, 15vw, 100px));
    padding-block: 0 clamp(2.25rem, 8vw, 3.25rem);
  }
}

.hero__eyebrow { display: grid; gap: 7px; margin-bottom: clamp(1.5rem, 3.5vw, 2.25rem); }
.hero__eyebrow .label { font-size: 0.66rem; letter-spacing: 0.32em; }

.hero__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  font-size: clamp(1.15rem, 4.4vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  color: var(--ink-900);
  white-space: nowrap;
}
.hero__amp {
  display: block;
  margin: 0.5em 0 0.46em;
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--gold-700);
}

.hero__line {
  margin: clamp(1.75rem, 4vw, 2.5rem) 0 clamp(1.25rem, 3vw, 1.75rem);
  font-size: 0.64rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-600);
}

/* date row */
.date-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 3.2vw, 1.75rem);
  padding-block: clamp(0.85rem, 2.5vw, 1.15rem);
}
.date-row__col { display: grid; gap: 3px; min-width: 52px; }
.date-row__month,
.date-row__pm {
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-600);
}
.date-row__day,
.date-row__time {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink-900);
  font-variant-numeric: lining-nums;
}
.date-row__day { font-size: clamp(1.7rem, 3.4vw, 2rem); }
.date-row__time { font-size: clamp(1.4rem, 2.9vw, 1.65rem); }
.date-row__venue {
  font-size: clamp(0.7rem, 1.6vw, 0.78rem);
  line-height: 1.7;
  color: var(--ink-600);
  letter-spacing: 0.01em;
}
.date-row__div {
  width: 1px;
  align-self: stretch;
  min-height: 56px;
  background: var(--line-strong);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  margin-top: clamp(1.5rem, 3vw, 1.75rem);
}
@media (max-width: 480px) {
  .hero__actions .btn { width: 100%; }
}



/* ---------- countdown ---------- */
.countdown-band {
  background: var(--paper-100);
  border-block: 1px solid var(--line);
  padding-block: clamp(2rem, 4.5vw, 2.75rem);
  text-align: center;
}
.countdown-band .label { color: var(--ink-600); font-size: 0.64rem; }
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 5vw, 3.5rem);
  margin-top: var(--s-5);
}
.countdown__unit { display: grid; gap: 6px; min-width: 54px; }
.countdown__unit b {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  font-size: clamp(1.8rem, 3.8vw, 2.4rem);
  line-height: 1;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums lining-nums;
}
.countdown__unit span {
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-400);
}

/* ---------- story / prints ---------- */
.story { background: var(--paper-200); }
.story__head { max-width: var(--w-content); margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.story__head h2 {
  font-size: var(--fs-h1);
  line-height: 1.1;
  margin: var(--s-4) 0 var(--s-4);
  max-width: 20ch;
}
.story__head .lead { margin-top: var(--s-3); }

.prints {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: start;
  padding-block: 1rem 3rem;
}

/* a physical print: white border, soft shadow, gentle movement on scroll */
.print {
  margin: 0;
  background: #ffffff;
  padding: 12px 12px 0;
  border: 1px solid rgba(23, 24, 15, 0.07);
  box-shadow: 0 22px 45px -22px rgba(23, 24, 15, 0.45),
              0 6px 16px rgba(23, 24, 15, 0.08);
  transform: translate3d(0, var(--shift, 0px), 0) rotate(var(--rot, 0deg));
  will-change: transform;
}
.print img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--paper-300);
}
.print figcaption {
  padding: 12px 4px 14px;
  text-align: center;
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.print--1 { grid-column: 1 / span 5; --rot: -1.6deg; margin-top: 2.5rem; }
.print--2 { grid-column: 6 / span 4; --rot: 1.1deg; }
.print--3 { grid-column: 10 / span 3; --rot: -0.9deg; margin-top: 4.5rem; }

@media (max-width: 900px) {
  .prints { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .print--1,
  .print--2,
  .print--3 { grid-column: span 1; margin-top: 0; }
  .print--3 { grid-column: 1 / -1; width: 64%; justify-self: center; margin-top: 0.5rem; }
}

/* ---------- venue ---------- */
.venue { background: var(--paper-100); }
.venue__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 900px) { .venue__grid { grid-template-columns: 1fr; } }

.venue__text h2 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.08;
  margin: var(--s-4) 0 var(--s-4);
}
.venue__lead { color: var(--ink-600); max-width: 27rem; line-height: 1.75; }
.venue__address {
  margin: var(--s-6) 0;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-600);
  line-height: 2.1;
}
.venue__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.venue__plate-wrap { position: relative; }
.venue__plate {
  margin: 0;
  background: var(--paper-50);
  border: 1px solid var(--line);
  padding: clamp(10px, 2vw, 18px);
}
.venue__plate img { width: 100%; height: auto; display: block; }
.venue__plate figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-400);
}

/* a small print pinned to the corner of the plate */
.print--venue {
  position: absolute;
  left: clamp(-26px, -3vw, -12px);
  bottom: 7%;
  width: clamp(120px, 26%, 190px);
  --rot: -4deg;
  padding: 8px;
  z-index: 2;
}
.print--venue img { aspect-ratio: 3 / 4; }
@media (max-width: 900px) {
  .print--venue { width: 108px; bottom: 12px; left: -8px; }
}

/* ---------- reply (night) ---------- */
.reply {
  position: relative;
  overflow: hidden;
  background: var(--night-900);
  color: var(--paper-100);
  padding-block: clamp(4rem, 9vw, 7.5rem);
}
.reply::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 52% at 16% 0%, rgba(176, 138, 79, 0.15), transparent 62%),
    radial-gradient(52% 50% at 88% 100%, rgba(127, 143, 108, 0.13), transparent 60%);
  pointer-events: none;
}
.reply .wrap { position: relative; }
.reply__inner {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: var(--s-4);
}
.reply .label { color: var(--gold-400); font-size: 0.64rem; }
.reply h2 {
  color: var(--paper-100);
  font-size: var(--fs-h2);
  letter-spacing: 0.01em;
}
.reply__rule { width: 64px; height: 1px; background: var(--gold-500); opacity: 0.55; }
.reply__when {
  color: var(--gold-200);
  opacity: 0.9;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 2;
}

/* form */
.rsvp {
  width: 100%;
  max-width: 36rem;
  display: grid;
  gap: var(--s-4);
  text-align: left;
  margin-top: var(--s-4);
}
.rsvp__row { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--s-3); }
@media (max-width: 560px) { .rsvp__row { grid-template-columns: 1fr; } }

.rfield { display: grid; gap: 8px; }
.rfield > span {
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-400);
}
.rfield > span em {
  font-style: normal;
  letter-spacing: 0.12em;
  color: var(--gold-200);
  opacity: 0.55;
}
.rfield input,
.rfield select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  background: var(--paper-50);
  border: 1px solid rgba(23, 24, 15, 0.25);
  border-radius: var(--radius-sm);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.rfield input::placeholder { color: var(--ink-400); }
.rfield input:focus,
.rfield select:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 168, 118, 0.3);
}

.rcheck {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--gold-200);
  opacity: 0.9;
  cursor: pointer;
}
.rcheck input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold-500);
  flex: none;
}
.rcheck input:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 2px; }

.rsvp__actions {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.rsvp__hint {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-200);
  opacity: 0.62;
}
.rsvp__status { min-height: 1.2em; font-size: 0.8rem; color: #E3A092; margin: 0; }

.rsvp__done {
  width: 100%;
  max-width: 36rem;
  padding: var(--s-5);
  border: 1px solid var(--line-inverse);
  background: rgba(247, 241, 231, 0.04);
  display: grid;
  gap: 8px;
  text-align: center;
}
.rsvp__done-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--paper-100);
}
.rsvp__done-body { font-size: 0.84rem; color: var(--gold-200); opacity: 0.82; }

.reply__divider {
  width: 100%;
  max-width: 36rem;
  height: 1px;
  background: var(--line-inverse);
  margin-block: var(--s-5);
}
.reply__save {
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-400);
}
.reply__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: center; }
@media (max-width: 480px) { .reply__actions .btn { width: 100%; } }
.reply__note {
  font-size: 0.7rem;
  color: var(--gold-200);
  opacity: 0.6;
  max-width: 30rem;
  line-height: 1.7;
}
.reply :focus-visible { outline-color: var(--gold-400); }

/* ---------- footer ---------- */
.footer {
  background: var(--paper-100);
  border-top: 1px solid var(--line);
  padding-block: var(--s-8);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.footer__mark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-900);
}
.footer__mark em { font-style: italic; color: var(--gold-700); }
.footer__meta {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-400);
}

/* ==========================================================================
   ENVELOPE INTRO
   A closed envelope with a wax seal. On click the seal breaks, the flap
   falls open and the invitation rises out; then the overlay fades away.
   ========================================================================== */

html:not(.js) .envelope-screen { display: none; }
html.js:not(.invite-opened) body { overflow: hidden; }
main:focus { outline: none; }

.envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(90% 70% at 50% 12%, rgba(252, 249, 243, 0.92), rgba(241, 232, 219, 0.35) 58%, rgba(213, 194, 169, 0.55)),
    var(--paper-300);
  transition: opacity 0.65s var(--ease-out);
}
.envelope-screen.is-done { opacity: 0; pointer-events: none; }
.envelope-screen:focus { outline: none; }

.envelope-stage {
  display: grid;
  justify-items: center;
  gap: clamp(1.25rem, 4vw, 2.25rem);
  padding: var(--s-5);
  text-align: center;
}
.envelope__label { color: var(--ink-600); font-size: 0.66rem; letter-spacing: 0.32em; }
.envelope__hint { color: var(--ink-600); font-size: 0.6rem; letter-spacing: 0.26em; }

/* envelope */
.envelope {
  position: relative;
  width: min(84vw, 520px);
  aspect-ratio: 1.5;
  perspective: 1500px;
  cursor: pointer;
  outline-offset: 14px;
  transform: translateZ(0);
}
.envelope:focus-visible { outline: 2px solid var(--focus); }
.envelope:hover .envelope__seal { transform: translate(-50%, -50%) scale(1.04); }

/* the inside of the envelope: a touch darker than the card, so the card
   visibly sits *in* something */
.envelope__back {
  position: absolute;
  inset: 0;
  /* a deeper, warmer inside than the outside paper */
  background: linear-gradient(180deg, #D6C2A6 0%, #E4D5BE 18%, #EFE4D2 62%, #F6F0E5 100%);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  /* static shadow on the panel instead of a filter on the moving wrapper:
     filters force expensive offscreen buffers on mid-range Android GPUs */
  box-shadow: inset 0 14px 20px -16px rgba(23, 24, 15, 0.55),
              0 24px 48px rgba(23, 24, 15, 0.16),
              0 4px 10px rgba(23, 24, 15, 0.06);
}

/* the outside faces are SVGs so the folds get a real hairline edge */
.envelope__front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 3;
}

.envelope__flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 52%;
  transform-origin: 50% 0;
  transform: rotateX(0deg);
  transition: transform 0.9s var(--ease-in-out),
              z-index 0s linear;
  z-index: 4;
  will-change: transform;
}
.envelope__flap svg { width: 100%; height: 100%; display: block; }

/* the invitation, sitting deep inside the pocket — a miniature of the
   real card: the engraving, the two names, the date */
.envelope__card {
  position: absolute;
  left: 50%;
  top: 10%;
  width: 64%;
  height: 80%;
  transform: translate3d(-50%, 0, 0);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(23, 24, 15, 0.10);
  box-shadow: 0 22px 44px rgba(23, 24, 15, 0.22),
              0 4px 10px rgba(23, 24, 15, 0.08);
  opacity: 0;
  z-index: 2;
  overflow: hidden;
  container-type: inline-size;
  will-change: transform, opacity;
  /* one transform, no rotation: the text is never re-rasterised, so the
     pull stays perfectly smooth on a phone */
  transition: opacity 0.4s var(--ease-out),
              transform 1.15s cubic-bezier(0.22, 0.61, 0.2, 1);
}

@media (min-width: 480px) {
  .envelope__card { top: 9%; width: 56%; }
}

.envelope__card-art {
  flex: none;
  height: 44%;
  overflow: hidden;
  background: var(--paper-50);
  border-bottom: 1px solid rgba(23, 24, 15, 0.08);
}
.envelope__card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  display: block;
}

.envelope__card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4% 6%;
  text-align: center;
}

.envelope__monogram {
  font-family: var(--font-display);
  font-size: 7.2cqw;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--ink-900);
}
.envelope__amp {
  font-family: var(--font-display);
  font-size: 3.8cqw;
  line-height: 1;
  color: var(--gold-700);
  margin: 1px 0;
}
.envelope__date {
  margin-top: 7%;
  font-size: 3.6cqw;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-600);
}

/* wax seal — the real seal artwork, keyed off its black backdrop */
.envelope__seal {
  position: absolute;
  left: 50%;
  top: 48%;
  width: clamp(84px, 14.5vw, 116px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 5;
  transition: opacity 0.3s var(--ease-out), transform 0.35s var(--ease-out);
}
/* a cheap, static cast shadow — a gradient, not a filter */
.envelope__seal::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 58%;
  width: 76%;
  height: 26%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(64, 36, 22, 0.30), rgba(64, 36, 22, 0));
  z-index: -1;
}
.envelope__seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* opening sequence */
@keyframes seal-break {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(-5deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.25) rotate(18deg); }
}
.envelope-screen.is-opening .envelope__seal {
  animation: seal-break 0.5s var(--ease-out) forwards;
}

/* The flap swings backwards, so once it is past edge-on it belongs BEHIND
   the invitation — that is what stops it covering the card as it rises. */
.envelope-screen.is-opening .envelope__flap {
  transform: rotateX(-180deg);
  z-index: 0;
  transition-delay: 0.15s, 0.55s;
}

/* the card is visible inside as soon as the flap lifts, then it is pulled */
.envelope-screen.is-opening .envelope__card {
  opacity: 1;
  transform: translate3d(-50%, -56%, 0);
  transition-delay: 0s, 0.8s;
}

.envelope-screen.is-opening .envelope__hint,
.envelope-screen.is-opening .envelope__label {
  opacity: 0;
  transition: opacity 0.3s;
}

.envelope-screen.is-done { opacity: 0; }
.envelope-screen.is-done .envelope__card {
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

@media (max-width: 560px) {
  .envelope { width: 88vw; }
  .envelope__hint { letter-spacing: 0.2em; }
  /* smaller blurs cost much less on a phone GPU */
  .envelope__back { box-shadow: 0 16px 28px rgba(23, 24, 15, 0.14); }
  .envelope__card { box-shadow: 0 12px 24px rgba(23, 24, 15, 0.16); }
}

@media (prefers-reduced-motion: reduce) {
  .envelope,
  .envelope__seal,
  .envelope__flap,
  .envelope__card {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation: none !important;
  }
}

/* ---------- reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

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