@font-face {
  font-family: "Amiri";
  src: url("/assets/amiri.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Arabic";
  src: url("/assets/arabic-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ivory: #fbf8f1;
  --paper: #f4eee2;
  --gold: #aa8a4e;
  --gold-light: #d4bd8b;
  --green: #344d44;
  --green-deep: #233d34;
  --ink: #344d44;
  --muted: #7b8075;
  --line: rgba(170, 138, 78, .3);
  --sans: "Noto Sans Arabic", sans-serif;
  --serif: "Amiri", serif;
  --header-height: 88px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body {
  margin: 0;
  min-width: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button, input, textarea { border-radius: 0; }
button:disabled { cursor: wait; opacity: .6; }
button, input, textarea, fieldset { min-width: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
em { font-style: normal; color: var(--gold); }
img { max-width: 100%; display: block; }
::selection { color: var(--ivory); background: var(--green); }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
}

/* A quiet masthead, deliberately separate from the stationery. */
.site-header {
  height: var(--header-height);
  padding: 0 clamp(22px, 5vw, 88px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--green);
  color: var(--ivory);
  border-bottom: 1px solid rgba(251, 248, 241, .12);
  position: relative;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
}
.brand img { width: 28px; height: 28px; }
.brand-caption {
  margin-inline-start: 14px;
  padding-inline-start: 22px;
  border-inline-start: 1px solid rgba(251, 248, 241, .2);
  color: rgba(251, 248, 241, .58);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 2;
}
.header-actions { display: flex; align-items: center; gap: 26px; }
.text-button {
  border: 0;
  padding: 8px 0;
  background: transparent;
  font-size: 11px;
  line-height: 2;
  transition: color .2s;
}
.text-button span { margin-inline-start: 10px; color: var(--gold-light); }
.text-button:hover { color: var(--gold-light); }
.music-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 15px;
  border: 1px solid rgba(251, 248, 241, .25);
  border-radius: 40px;
  background: transparent;
  color: var(--ivory);
  font-size: 10px;
  transition: border-color .25s, background .25s;
}
.music-button:hover, .music-button.playing {
  border-color: var(--gold-light);
  background: rgba(251, 248, 241, .045);
}
.sound-bars { height: 16px; display: flex; align-items: center; gap: 3px; direction: ltr; }
.sound-bars i {
  display: block;
  width: 2px;
  height: 6px;
  background: var(--gold-light);
  transform-origin: center;
}
.sound-bars i:nth-child(2) { height: 14px; }
.sound-bars i:nth-child(3) { height: 10px; }
.sound-bars i:nth-child(4) { height: 7px; }
.music-button.playing .sound-bars i { animation: sound-wave .9s ease-in-out infinite alternate; }
.music-button.playing .sound-bars i:nth-child(2) { animation-delay: -.4s; }
.music-button.playing .sound-bars i:nth-child(3) { animation-delay: -.7s; }
.music-button.playing .sound-bars i:nth-child(4) { animation-delay: -.2s; }
@keyframes sound-wave { from { transform: scaleY(.35); } to { transform: scaleY(1.15); } }

/* The first view is a green room for the envelope, not a background image. */
.opening {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  padding: 44px 24px 36px;
  overflow: hidden;
  color: var(--ivory);
  background:
    radial-gradient(ellipse at 50% 48%, rgba(145, 155, 116, .13), transparent 58%),
    radial-gradient(ellipse at 0% 100%, rgba(18, 38, 29, .26), transparent 60%),
    linear-gradient(130deg, #344d44, #30493f 80%);
  text-align: center;
}
.opening::before, .opening::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(70vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(212, 189, 139, .075);
  border-radius: 50%;
  pointer-events: none;
}
.opening::before { top: -49%; right: -24%; }
.opening::after { bottom: -55%; left: -27%; }
.opening-stars {
  color: var(--gold-light);
  font-size: 23px;
  line-height: 1;
  margin-bottom: 20px;
}
.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 10px;
  font-weight: 500;
  line-height: 2;
  letter-spacing: .015em;
}
.eyebrow.light { color: var(--gold-light); }
.opening-intro h1 {
  font-size: clamp(48px, 5.1vw, 72px);
  line-height: 1.15;
  margin: 15px 0 13px;
}
.opening-intro h1 em { color: var(--gold-light); }
.opening-intro p { font-size: 11px; color: rgba(251, 248, 241, .64); }

/* Paper layers stay in a flat stacking context; only the flap rotates in 3D.
   Both faces remain visible so the open flap never disappears or exposes a
   mirrored seam. The letter rises after the flap has cleared its path. */
.envelope {
  --envelope-width: 350px;
  display: block;
  position: relative;
  width: var(--envelope-width);
  height: 230px;
  max-width: calc(100vw - 56px);
  flex: 0 0 auto;
  margin: 47px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  perspective: 1100px;
  perspective-origin: 50% 25%;
  transform-style: flat;
  text-align: center;
  outline-offset: 16px;
  filter: drop-shadow(0 23px 20px rgba(10, 26, 18, .24));
}
.envelope > span { position: absolute; display: block; }
.envelope-back {
  inset: 0;
  z-index: 0;
  border: 1px solid #d7c9b0;
  border-radius: 4px;
  background: linear-gradient(155deg, #f3eddf, #ebe2d0);
  box-shadow: inset 0 0 22px rgba(131, 104, 56, .08);
}
.envelope-letter {
  z-index: 2;
  top: 8px;
  left: 7%;
  width: 86%;
  height: 213px;
  padding: 15px 12px;
  border: 1px solid rgba(170, 138, 78, .38);
  background: var(--ivory);
  box-shadow: 0 0 0 5px #f8f4eb, 0 3px 14px rgba(67, 49, 24, .12);
  color: var(--green);
  transform: translateY(0);
  transition: transform .85s cubic-bezier(.22, .61, .36, 1) .55s;
  will-change: transform;
}
.envelope-letter > span, .envelope-letter > strong { display: block; }
.envelope-letter > span:not(.letter-ornament):not(.letter-and) { font-size: 8px; margin: 1px 0 6px; }
.envelope-letter strong {
  max-width: 100%;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.letter-ornament { color: var(--gold); font-family: var(--serif); font-size: 23px; line-height: 1.4; }
.letter-and { color: var(--gold); font-family: var(--serif); font-size: 20px; line-height: 1.1; }
.envelope-front {
  inset: 0;
  z-index: 4;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(0deg, #f5efe3, #fbf7ef 70%);
  clip-path: polygon(0 100%, 50% 42%, 100% 100%);
}
.envelope-side {
  inset: 0;
  z-index: 3;
  border-radius: 4px;
}
.envelope-side.left {
  background: linear-gradient(34deg, #eee5d5 0%, #f7f1e6 48%, #e2d5bd 49%, #f4eddf 50%);
  clip-path: polygon(0 0, 53% 53%, 0 100%);
}
.envelope-side.right {
  background: linear-gradient(-34deg, #f4ecde 0%, #fcf8ef 48%, #dfd1b7 49%, #f7f1e6 50%);
  clip-path: polygon(100% 0, 47% 53%, 100% 100%);
}
.envelope-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(146deg, transparent 49.6%, rgba(170, 138, 78, .18) 49.9%, transparent 50.4%),
              linear-gradient(214deg, transparent 49.6%, rgba(170, 138, 78, .16) 49.9%, transparent 50.4%);
  opacity: .55;
}
.envelope-flap {
  inset: 0;
  z-index: 5;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(175deg, #fbf8f1 5%, #f1e8d9 61%, #ddcfb6 62%);
  clip-path: polygon(0 0, 100% 0, 50% 63%);
  transform-origin: center top;
  transform: rotateX(0deg);
  backface-visibility: visible;
  transition: transform .85s cubic-bezier(.4, 0, .2, 1), z-index 0s .43s;
}
.wax-seal {
  z-index: 6;
  top: 51%;
  left: calc(50% - 27px);
  width: 54px;
  height: 54px;
  display: grid !important;
  place-items: center;
  border: 1px solid #98773c;
  border-radius: 47% 53% 48% 51% / 51% 45% 55% 49%;
  background: radial-gradient(circle at 35% 27%, #cbb079, #aa8a4e 65%, #8e6d35);
  color: #f7ecd2;
  box-shadow: inset 0 0 0 3px rgba(210, 183, 125, .45), inset 0 0 0 5px rgba(101, 73, 27, .16), 0 4px 7px rgba(62, 45, 16, .24);
  transition: opacity .25s ease, transform .4s ease;
}
.wax-seal span {
  font-family: var(--serif);
  font-size: 29px;
  line-height: 1;
  padding-bottom: 5px;
  text-shadow: 0 1px 0 #8c6a31;
}
.envelope:not(.open):hover .wax-seal { transform: scale(1.04); }
.envelope.open .envelope-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .envelope-letter { transform: translateY(-65%); }
.envelope.open .wax-seal { opacity: 0; transform: scale(.85); pointer-events: none; }
.envelope.open { cursor: default; }
.open-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 33px;
  font-size: 10px;
  color: var(--gold-light);
}
.hint-line { width: 29px; height: 1px; background: rgba(212, 189, 139, .45); }
.opening-footnote { font-size: 9px; color: rgba(251, 248, 241, .38); margin-top: 35px; }

/* The invitation is rendered like a small, bordered printed card. */
.invitation { overflow: clip; }
.is-open .invitation { animation: invitation-arrives .85s ease both; }
@keyframes invitation-arrives { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.invitation-hero {
  padding: 76px 24px 92px;
  background: radial-gradient(ellipse at 50% 40%, #fffcf6 0%, var(--ivory) 65%);
  display: flex;
  justify-content: center;
}
.invitation-card {
  width: 480px;
  max-width: 100%;
  position: relative;
  padding: 41px 40px 29px;
  text-align: center;
  border: 1px solid var(--gold);
  background: var(--ivory);
  box-shadow: 0 14px 40px rgba(88, 72, 42, .04);
}
.invitation-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(170, 138, 78, .55);
  pointer-events: none;
}
.card-ornament { display: block; font-family: var(--serif); color: var(--gold); font-size: 37px; line-height: 1.4; margin-bottom: 14px; }
.invitation-card h1 { font-size: 35px; line-height: 1.7; margin: 9px 0 7px; }
.invitation-copy { font-size: 10px; color: var(--muted); }
.couple-names { padding: 32px 0 25px; }
.couple-names h2 { font-size: clamp(36px, 4.3vw, 55px); line-height: 1.4; overflow-wrap: anywhere; }
.and-word { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.4; color: var(--gold); margin: 1px 0; }
.ornamental-rule { display: flex; align-items: center; justify-content: center; gap: 15px; color: var(--gold); font-size: 16px; }
.ornamental-rule span { height: 1px; width: 54px; background: var(--line); }
.card-date { font-size: 12px; margin-top: 22px; }
.card-venue { font-size: 11px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.card-closing { font-family: var(--serif); font-size: 20px; color: var(--gold); margin: 28px 0 21px; }
.discover-link { display: inline-flex; align-items: center; gap: 15px; font-size: 9px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.discover-link span { font-size: 16px; color: var(--gold); transition: transform .2s; }
.discover-link:hover span { transform: translateY(3px); }

.event-details {
  width: min(980px, calc(100% - 96px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
  gap: 100px;
  padding: 76px 0 91px;
  border-top: 1px solid var(--line);
}
.section-heading { padding-top: 16px; }
.section-heading h2, .rsvp-heading h2 { font-size: clamp(35px, 3.6vw, 48px); line-height: 1.4; margin-top: 17px; }
.detail-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 22px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.detail-item:first-child { padding-top: 11px; }
.detail-item:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-number { font-family: var(--serif); color: var(--gold); font-size: 18px; padding-top: 4px; }
.detail-item h3 { font-size: 26px; line-height: 1.6; }
.detail-item p { font-size: 12px; margin-top: 8px; overflow-wrap: anywhere; }
.address { display: block; font-size: 10px; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.map-link { display: inline-block; color: var(--gold); border-bottom: 1px solid var(--line); font-size: 10px; padding-bottom: 3px; margin-top: 16px; }
.map-link:hover { color: var(--green); }

/* A green editorial introduction meets an ivory reply form. */
.rsvp-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(1100px, calc(100% - 96px));
  margin: 0 auto 80px;
  border: 1px solid var(--line);
  background: #f7f3eb;
}
.rsvp-heading {
  position: relative;
  padding: 69px clamp(32px, 4.5vw, 68px);
  background: var(--green);
  color: var(--ivory);
  overflow: hidden;
}
.rsvp-heading::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(212, 189, 139, .22);
  pointer-events: none;
}
.rsvp-heading .eyebrow, .rsvp-heading em { color: var(--gold-light); }
.rsvp-heading h2 { margin-top: 22px; }
.rsvp-heading p { font-size: 11px; color: rgba(251, 248, 241, .65); line-height: 2.2; max-width: 280px; margin-top: 23px; }
.rsvp-flourish { display: block; color: var(--gold-light); font-family: var(--serif); font-size: 73px; line-height: 1.3; margin-top: 55px; opacity: .7; }
.rsvp-form { padding: 42px clamp(24px, 3.6vw, 50px) 34px; }
form label, fieldset legend { font-size: 11px; color: var(--green); }
.rsvp-form > label { display: block; margin-bottom: 8px; }
input:not([type="radio"]), textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(52, 77, 68, .2);
  background: rgba(255, 255, 255, .46);
  color: var(--green);
  font-size: 12px;
  line-height: 1.8;
  transition: border-color .2s, box-shadow .2s;
  min-height: 47px;
}
textarea { resize: vertical; min-height: 88px; max-height: 260px; }
input::placeholder, textarea::placeholder { color: #96988c; opacity: 1; font-size: 10px; }
input:not([type="radio"]):focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(170, 138, 78, .1); outline-offset: 2px; }
fieldset { padding: 0; margin: 24px 0; border: 0; }
fieldset legend { padding: 0; margin-bottom: 10px; }
.attendance-options { display: grid; gap: 9px; }
.attendance-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  min-height: 67px;
  border: 1px solid rgba(52, 77, 68, .2);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.attendance-choice input {
  position: absolute;
  width: 18px;
  height: 18px;
  inset-inline-start: 13px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choice-circle { flex: 0 0 17px; width: 17px; height: 17px; border: 1px solid rgba(52, 77, 68, .4); border-radius: 50%; display: grid; place-items: center; }
.choice-circle::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); transform: scale(0); transition: transform .15s; }
.attendance-choice small { display: block; font-size: 9px; line-height: 1.8; color: var(--muted); margin-top: 2px; }
.attendance-choice:hover { border-color: var(--gold); }
.attendance-choice:has(input:checked) { border-color: var(--green); background: rgba(52, 77, 68, .05); }
.attendance-choice:has(input:checked) .choice-circle { border-color: var(--green); }
.attendance-choice:has(input:checked) .choice-circle::after { transform: scale(1); }
.attendance-choice:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }
.optional { color: var(--muted); font-size: 9px; font-weight: 400; }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 48px;
  padding: 11px 20px;
  border: 1px solid var(--green);
  background: var(--green);
  color: var(--ivory);
  font-size: 11px;
  line-height: 1.9;
  transition: background .2s, border-color .2s;
}
.primary-button:hover { background: var(--green-deep); border-color: var(--green-deep); }
.primary-button span { color: var(--gold-light); font-size: 16px; }
.rsvp-form .primary-button { width: 100%; margin-top: 23px; }
.form-note { font-size: 9px; color: var(--muted); margin-top: 12px; line-height: 2; }
.form-warning { font-size: 11px; color: #8c442c; padding: 10px 13px; background: #f2e7dd; border-inline-start: 2px solid #aa6d4e; margin: 14px 0; }
.form-feedback { font-size: 11px; color: var(--green); margin-top: 12px; }
.form-feedback:empty { display: none; }
.secondary-button { background: transparent; color: var(--green); border-color: var(--line); }
.secondary-button:hover { background: rgba(170, 138, 78, .08); border-color: var(--gold); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 41px 24px 30px;
  text-align: center;
}
.footer-ornament { font-family: var(--serif); color: var(--gold); font-size: 27px; }
.site-footer p { font-family: var(--serif); font-size: 26px; margin: 4px 0 7px; }
.site-footer > span:not(.footer-ornament) { display: block; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.site-footer .text-button { margin-top: 25px; color: var(--gold); font-size: 9px; border-bottom: 1px solid var(--line); }
.site-footer .text-button:hover { color: var(--green); }

/* Settings are a native modal. Never override a dialog's closed state. */
dialog {
  width: min(620px, calc(100% - 36px));
  max-width: 620px;
  max-height: 90vh;
  max-height: 90svh;
  margin: auto;
  padding: 32px 34px;
  border: 1px solid var(--gold);
  background: var(--ivory);
  color: var(--green);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 25px 100px rgba(14, 31, 22, .3);
  scrollbar-width: thin;
  scrollbar-color: var(--gold-light) var(--ivory);
}
dialog::backdrop { background: rgba(22, 40, 31, .67); backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-size: 35px; line-height: 1.4; margin-top: 4px; }
.close-button { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; padding: 0; border: 1px solid var(--line); background: transparent; font-family: var(--sans); font-size: 26px; line-height: 1; }
.close-button:hover { border-color: var(--gold); background: #f1ebdf; }
.settings-intro { font-size: 11px; color: var(--muted); line-height: 2.1; margin: 19px 0 24px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
#settings-form > label, .settings-grid label { display: block; margin-bottom: 15px; }
#settings-form label input { margin-top: 7px; }
#settings-form label small { display: block; color: var(--muted); font-size: 9px; line-height: 1.9; margin-top: 6px; }
#settings-form input[type="date"], #settings-form input[type="time"] { min-width: 0; max-width: 100%; }
#settings-form .primary-button { width: 100%; margin-top: 8px; }
input[dir="ltr"] { text-align: left; font-family: var(--sans); }
.share-panel { border-top: 1px solid var(--line); margin-top: 29px; padding-top: 22px; }
.share-panel h3 { font-size: 25px; line-height: 1.5; }
.share-panel p { font-size: 10px; color: var(--muted); line-height: 2; margin: 8px 0 15px; }
.share-panel .secondary-button { width: 100%; }
#share-url { margin-top: 12px; font-size: 10px; background: #f2ecdf; }
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 13px 24px;
  border: 1px solid rgba(212, 189, 139, .55);
  background: var(--green-deep);
  box-shadow: 0 8px 24px rgba(22, 40, 31, .2);
  color: var(--ivory);
  font-size: 11px;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}

@media (min-width: 1500px) {
  .opening { padding-top: 60px; padding-bottom: 48px; }
  .opening-intro h1 { font-size: 76px; }
  .envelope { margin-top: 55px; }
}

@media (max-width: 900px) {
  .brand-caption { display: none; }
  .event-details { width: calc(100% - 64px); gap: 50px; }
  .rsvp-section { width: calc(100% - 64px); }
  .rsvp-heading { padding: 48px 30px; }
  .rsvp-form { padding: 32px 25px; }
}

@media (max-width: 640px) {
  :root { --header-height: 74px; }
  .site-header { padding-inline: 20px; gap: 12px; }
  .brand { font-size: 27px; gap: 7px; }
  .brand img { width: 24px; height: 24px; }
  .header-actions { gap: 14px; }
  .text-button { font-size: 9px; }
  .text-button span { margin-inline-start: 4px; }
  .music-button { width: 38px; height: 38px; min-height: 38px; padding: 0; justify-content: center; }
  #music-label { display: none; }
  .opening { padding: 35px 20px 30px; }
  .opening-stars { font-size: 19px; margin-bottom: 17px; }
  .opening-intro h1 { font-size: 54px; margin-top: 13px; }
  .opening-intro p { font-size: 10px; }
  .envelope { --envelope-width: 330px; height: 217px; margin-top: 42px; }
  .envelope-letter { height: 200px; padding-top: 12px; }
  .envelope-letter strong { font-size: 24px; }
  .open-hint { margin-top: 29px; gap: 12px; font-size: 9px; }
  .opening-footnote { margin-top: 26px; }
  .invitation-hero { padding: 40px 21px 54px; }
  .invitation-card { padding: 32px 25px 25px; }
  .card-ornament { font-size: 31px; margin-bottom: 11px; }
  .invitation-card h1 { font-size: 31px; }
  .couple-names { padding: 27px 0 23px; }
  .couple-names h2 { font-size: clamp(34px, 10vw, 48px); }
  .card-closing { margin-top: 25px; }
  .event-details { width: calc(100% - 48px); grid-template-columns: 1fr; gap: 29px; padding: 43px 0 49px; }
  .section-heading { padding-top: 0; }
  .section-heading h2 { font-size: 36px; margin-top: 13px; }
  .detail-item { gap: 18px; padding: 21px 0; }
  .detail-item:first-child { padding-top: 0; }
  .rsvp-section { width: calc(100% - 40px); grid-template-columns: 1fr; margin-bottom: 48px; }
  .rsvp-heading { padding: 36px 30px 39px; }
  .rsvp-heading h2 { font-size: 38px; margin-top: 15px; }
  .rsvp-heading p { margin-top: 14px; max-width: 230px; }
  .rsvp-flourish { position: absolute; bottom: 18px; left: 30px; font-size: 52px; margin: 0; opacity: .45; }
  .rsvp-form { padding: 28px 24px; }
  .site-footer { padding-top: 30px; }
  dialog { width: calc(100% - 28px); padding: 23px 21px; }
  .dialog-heading h2 { font-size: 31px; }
  .settings-grid { gap: 10px; }
}

@media (max-width: 380px) {
  .site-header { padding-inline: 16px; }
  .header-actions { gap: 10px; }
  .brand { font-size: 25px; }
  .opening { padding-inline: 18px; }
  .opening-intro h1 { font-size: 49px; }
  .envelope { --envelope-width: 304px; height: 200px; }
  .envelope-letter { height: 184px; padding: 9px 10px; }
  .envelope-letter strong { font-size: 23px; }
  .letter-ornament { font-size: 21px; }
  .wax-seal { width: 50px; height: 50px; left: calc(50% - 25px); }
  .hint-line { width: 20px; }
  .invitation-card { padding-inline: 22px; }
  .invitation-copy { font-size: 9px; }
  .settings-grid { grid-template-columns: 1fr; gap: 0; }
  .rsvp-form { padding-inline: 20px; }
}

@media (max-height: 760px) and (min-width: 641px) {
  .opening { padding-top: 28px; padding-bottom: 24px; }
  .opening-stars { margin-bottom: 12px; }
  .opening-intro h1 { font-size: 53px; margin: 10px 0; }
  .envelope { margin-top: 35px; }
  .open-hint { margin-top: 25px; }
  .opening-footnote { margin-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .envelope-letter { will-change: auto; }
  .music-button.playing .sound-bars i { animation: none; }
}
