:root {
  --paper: #faf6ef;
  --burgundy: #570f24;
  --ink: #621d31;
  --muted: #80646a;
  --rule: #d9c9c6;
  --cream: #fff5e6;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --script: 'Love Light', 'Brush Script MT', cursive;
  --sans: 'Plus Jakarta Sans', Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid currentColor; outline-offset: 7px; }
button:disabled { cursor: default; }
main:focus { outline: none; }
p, h1, h2, h3 { margin: 0; }
img { display: block; max-width: 100%; }
::selection { color: var(--paper); background: var(--burgundy); }
.script { font-family: var(--script); font-weight: 400; }
.eyebrow { font-size: 10px; font-weight: 500; line-height: 1.8; letter-spacing: .2em; text-transform: uppercase; }

/* The supplied lace and stationery form the opening scene. */
.envelope-screen { display: none; position: relative; isolation: isolate; min-height: 100svh; padding: 52px 24px 40px; color: var(--cream); background: #300812; overflow: hidden; }
.js body:not(.invitation-open) .envelope-screen { display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
.js body:not(.invitation-open) main { display: none; }
.cover-background, .cover-shade { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.cover-background { object-fit: cover; object-position: center 58%; }
.cover-shade { z-index: -1; background: linear-gradient(180deg, #1e080a88, #20060925 45%, #160508a6); }
.cover-header { text-align: center; transition: opacity .35s, transform .5s; }
.cover-header .eyebrow { font-family: var(--serif); font-size: 14px; letter-spacing: .22em; }
.cover-names { font-size: clamp(76px, 8vw, 110px); line-height: 1.3; margin-top: 10px; text-shadow: 0 3px 25px #16050866; }
.cover-names > span, .couple-names > span { display: inline-block; font-family: var(--serif); font-style: italic; font-size: .49em; margin-inline: .12em; }
.cover-date { font-family: var(--serif); font-size: 18px; letter-spacing: .08em; margin-top: 8px; }
.envelope-stage { position: relative; display: block; width: min(76vw, 438px); aspect-ratio: 1588 / 990; flex-shrink: 0; padding: 0; margin: 70px auto 52px; border: 0; background: transparent; filter: drop-shadow(0 20px 24px #18040980); transition: transform .3s; }
.envelope-stage:hover:not(:disabled) { transform: translateY(-6px) rotate(-1deg); }
.envelope-stage:active:not(:disabled) { transform: scale(.98); }
.envelope-closed { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; transition: opacity .35s .1s, transform .6s; }
.envelope-back, .envelope-pocket { position: absolute; bottom: 0; left: 0; width: 100%; height: auto; opacity: 0; transition: opacity .35s .1s; pointer-events: none; }
.envelope-back { z-index: 1; }
.envelope-pocket { z-index: 3; }
.letter { position: absolute; display: flex; flex-direction: column; justify-content: center; gap: 14px; z-index: 2; left: 7%; bottom: 4%; width: 86%; height: 91%; background: var(--paper); color: var(--ink); border: 1px solid #d8b9a2; outline: 1px solid #dac9ba; outline-offset: -12px; opacity: 0; transition: transform .8s .3s cubic-bezier(.2,.7,.2,1), opacity .35s .3s; }
.letter-eyebrow { font-family: var(--serif); font-size: clamp(10px, 2.5vw, 14px); text-transform: uppercase; letter-spacing: .12em; }
.letter-names { font-size: clamp(32px, 7vw, 54px); }
.letter-date { font-family: var(--serif); font-size: 18px; }
.is-opening .envelope-closed { opacity: 0; transform: translateY(-9px); }
.is-opening .envelope-back, .is-opening .envelope-pocket { opacity: 1; }
.is-opening .letter { opacity: 1; transform: translateY(-50%); }
.is-opening .cover-header { opacity: 0; transform: translateY(-15px); }
.cover-action { text-align: center; transition: opacity .3s; }
.open-button { display: inline-flex; gap: 28px; align-items: center; background: none; border: 0; border-bottom: 1px solid #fff5e680; padding: 10px 0 13px; font-family: var(--serif); font-size: 24px; }
.open-button > span { font-family: var(--sans); font-size: 18px; }
.open-button:hover { border-bottom-color: var(--cream); }
.cover-action > p { font-family: var(--serif); font-style: italic; font-size: 17px; margin-top: 20px; }
.is-opening .cover-action { opacity: 0; }

/* Quiet cream stationery, with the original invitation's typefaces. */
.invitation-open main { animation: arrive .65s ease-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.invitation-hero { display: grid; grid-template-columns: 60% 40%; min-height: 820px; min-height: max(820px, 100svh); }
.invitation-copy { padding: 48px clamp(32px, 5vw, 86px) 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.masthead { display: flex; align-items: center; justify-content: center; }
.masthead .eyebrow { font-size: 9px; color: var(--muted); }
.invitation-message { text-align: center; padding-block: 60px 52px; position: relative; }
.bismillah { font-family: 'Amiri', serif; font-size: 28px; line-height: 1.9; }
.invitation-label { margin-top: 44px; }
.invitation-intro { font-family: var(--serif); font-size: 26px; line-height: 1.6; margin: 32px auto 0; max-width: 430px; text-wrap: pretty; }
.couple-names { font-size: clamp(76px, 8.7vw, 142px); line-height: 1.25; white-space: nowrap; margin: 20px -15px 7px; }
.countdown { text-align: center; margin: 4px auto 48px; width: min(100%, 360px); }
.countdown > .eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.countdown-units { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; }
.countdown-unit { display: flex; flex-direction: column; gap: 5px; position: relative; }
.countdown-unit + .countdown-unit::before { content: '·'; position: absolute; left: -2px; top: 7px; color: var(--muted); font-family: var(--serif); font-size: 24px; }
.countdown-number { font-family: var(--serif); font-size: 46px; font-variant-numeric: lining-nums tabular-nums; line-height: 1.1; }
.countdown-label { color: var(--muted); font-size: 11px; line-height: 1.5; }
.countdown-finished { font-family: var(--serif); font-size: 26px; font-style: italic; padding-block: 16px; }
.hero-date { display: flex; align-items: center; gap: 20px; border-top: 1px solid var(--rule); padding-top: 20px; }
.hero-date-number { font-family: var(--serif); font-size: 62px; line-height: 1; }
.hero-date-copy { display: flex; flex-direction: column; gap: 7px; font-size: 10px; letter-spacing: .08em; }
.hero-date-copy > :first-child { font-size: 12px; text-transform: uppercase; letter-spacing: .13em; }
.hero-date-copy > :last-child { color: var(--muted); }
.down-arrow { font-family: var(--serif); font-size: 28px; margin-left: auto; transition: transform .2s; }
.hero-date:hover .down-arrow { transform: translateY(5px); }
.hero-art { position: relative; overflow: hidden; background: var(--burgundy); }
.hero-art > img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 60%, #27060b7a); }
.art-caption { position: absolute; bottom: 60px; inset-inline: 20px; display: flex; flex-direction: column; gap: 12px; text-align: center; color: var(--cream); z-index: 1; }
.art-caption .script { font-size: clamp(36px, 4vw, 62px); }

/* One reception. Only the details guests need for the evening. */
.reception { background: var(--burgundy); color: var(--cream); padding: 100px 24px 94px; text-align: center; scroll-margin-top: 0; }
.reception-inner { max-width: 750px; margin-inline: auto; }
.reception .eyebrow { color: #e3c8ba; }
.reception h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(39px, 4.7vw, 64px); line-height: 1.15; margin-top: 16px; }
.reception h2 em { font-weight: 400; }
.reception-intro { font-family: var(--serif); font-size: 22px; line-height: 1.4; margin-top: 16px; color: #eedbce; }
.date-composition { display: grid; grid-template-columns: 1fr 152px 1fr; align-items: center; width: min(100%, 580px); margin: 44px auto; }
.date-side { display: flex; flex-direction: column; gap: 10px; padding-block: 17px; border-block: 1px solid #b68a8b66; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.date-side > :last-child { font-size: 9px; letter-spacing: .09em; color: #e3c8ba; }
.date-center { display: flex; flex-direction: column; gap: 2px; }
.day-number { font-family: var(--serif); font-size: 104px; line-height: 1; font-weight: 400; }
.date-year { font-family: var(--serif); font-size: 23px; letter-spacing: .12em; padding-left: .12em; }
.venue h3 { font-family: var(--serif); font-size: clamp(27px, 3vw, 38px); font-weight: 400; margin-top: 14px; }
.venue > p:not(.eyebrow) { font-family: var(--serif); font-size: 23px; margin-top: 8px; }
.venue .venue-region { font-family: var(--sans) !important; font-size: 10px !important; color: #e3c8ba; letter-spacing: .08em; margin-top: 12px !important; }
.event-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 40px; }
.action-link { display: inline-flex; align-items: center; gap: 10px; border: 1px solid #b68a8b; border-radius: 14px; padding: 14px 18px; min-height: 50px; font-size: 11px; transition: color .25s, border-color .25s, background-color .25s, transform .25s; }
.action-link:hover { color: #e8bfaa; border-color: var(--cream); }
.action-link:active { transform: scale(.98); }
.action-link > span { margin-left: 16px; }
.action-link svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.3; fill: none; }
.closing { padding: 76px 60px 24px; text-align: center; background: var(--paper); }
.closing-blessing { font-family: var(--serif); font-size: 30px; font-style: italic; line-height: 1.35; }
.closing-blessing { max-width: 500px; margin-inline: auto; text-wrap: pretty; }
.closing-note { font-family: var(--serif); font-size: 23px; line-height: 1.65; max-width: 490px; margin: 28px auto 0; color: var(--muted); text-wrap: pretty; }
.closing > .eyebrow { color: var(--muted); margin-top: 28px; font-size: 9px; }
.closing-names { font-size: 60px; line-height: 1.4; margin-top: 4px; }
.footer-line { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 50px; border-top: 1px solid var(--rule); padding-top: 16px; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.replay-button { padding: 13px 0; background: none; border: 0; font-size: 10px; min-height: 44px; }
.replay-button > span { margin-left: 8px; }
html:not(.js) .replay-button { display: none; }
.music-toggle { display: none; position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.music-toggle::before { content: ''; position: absolute; inset: 4px; border: 1px solid var(--rule); border-radius: 50%; background: var(--paper); box-shadow: 0 2px 8px #30081212; }
.music-toggle .music-label { display: none; }
.js .invitation-open .music-toggle { display: inline-flex; }
.music-toggle svg { position: relative; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.music-toggle .music-pause-icon, .music-toggle.is-playing .music-play-icon { display: none; }
.music-toggle.is-playing .music-pause-icon { display: block; }
.music-toggle:disabled { opacity: .7; }
.js .invitation-open .closing { padding-bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px)); }

/* Reveal whole text blocks without splitting Arabic or shifting their layout. */
.text-reveal { transition: opacity .75s ease, transform .75s cubic-bezier(.22, 1, .36, 1); transition-delay: var(--reveal-delay, 0ms); }
.text-reveal:not(.is-visible) { opacity: 0; transform: translateY(18px); }
.text-reveal.is-visible { opacity: 1; transform: translateY(0); }
.cover-header > * { animation: text-arrive .85s cubic-bezier(.22, 1, .36, 1) both; }
.cover-header .cover-names { animation-delay: .12s; }
.cover-header .cover-date { animation-delay: .24s; }
@keyframes text-arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
#reception:focus { outline: none; }

/* Phones and tablets use a spacious single column with generous touch targets. */
@media (max-width: 999px) {
  .envelope-screen { min-height: 100svh; padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); gap: 20px; }
  .cover-header { width: 100%; }
  .cover-header .eyebrow { font-size: 13px; letter-spacing: .16em; }
  .cover-names { font-size: clamp(58px, 18vw, 100px); white-space: nowrap; }
  .cover-date { font-size: 18px; }
  .envelope-stage { width: min(82vw, 46svh, 400px); margin-block: 36px 20px; }
  .envelope-stage:hover:not(:disabled) { transform: none; }
  .cover-action > p { font-size: 17px; margin-top: 14px; }
  .open-button { font-size: 24px; min-height: 48px; }
  .invitation-hero { display: flex; flex-direction: column; min-height: 0; }
  .invitation-copy { min-height: 0; padding: 36px clamp(24px, 7vw, 48px) 40px; }
  .masthead .eyebrow { font-size: 10px; letter-spacing: .12em; }
  .invitation-message { padding-block: 56px 52px; }
  .bismillah { font-size: 27px; }
  .invitation-label { margin-top: 40px; font-size: 11px; letter-spacing: .1em; }
  .invitation-intro { font-size: 23px; margin-top: 32px; max-width: 360px; }
  .couple-names { font-size: clamp(54px, 16.5vw, 108px); margin: 24px -8px; line-height: 1.3; }
  .countdown { margin-bottom: 48px; }
  .countdown-number { font-size: clamp(36px, 10vw, 44px); }
  .hero-date { gap: 16px; padding-top: 28px; min-height: 70px; }
  .hero-date-number { font-size: 56px; }
  .hero-date-copy { font-size: 12px; }
  .hero-art { height: 220px; }
  .hero-art > img { object-position: center 65%; }
  .hero-art::after { background: linear-gradient(#27060b18, #27060b85); }
  .art-caption { inset: 0; justify-content: center; align-items: center; gap: 8px; }
  .art-caption .script { font-size: 64px; }
  .reception { padding: 80px 28px; }
  .reception .eyebrow { font-size: 11px; }
  .reception h2 { max-width: 340px; margin: 24px auto 0; font-size: 43px; line-height: 1.2; }
  .reception h2 em { display: block; }
  .reception-intro { font-size: 21px; max-width: 280px; margin: 24px auto 0; line-height: 1.6; }
  .date-composition { grid-template-columns: 1fr 90px 1fr; margin-block: 48px 56px; }
  .date-side { font-size: 12px; letter-spacing: 0; gap: 9px; text-transform: none; padding-block: 15px; }
  .date-side > :last-child { font-size: 10px; letter-spacing: 0; line-height: 1.6; }
  .day-number { font-size: 80px; }
  .date-year { font-size: 23px; }
  .venue h3 { font-size: 30px; line-height: 1.3; max-width: 280px; margin: 24px auto 0; }
  .venue > p:not(.eyebrow) { font-size: 22px; margin-top: 16px; line-height: 1.5; }
  .venue .venue-region { font-size: 12px !important; }
  .event-actions { display: grid; justify-content: stretch; gap: 16px; max-width: 280px; margin: 40px auto 0; }
  .action-link { display: flex; justify-content: center; font-size: 13px; gap: 10px; min-height: 50px; border: 1px solid #b68a8b; padding: 14px 16px; }
  .action-link > span { margin-left: auto; }
  .action-link svg { width: 17px; height: 17px; margin-right: auto; }
  .action-link:active { background: #ffffff18; }
  .closing { padding: 72px 28px max(24px, env(safe-area-inset-bottom)); }
  .closing-blessing { font-size: 28px; line-height: 1.5; }
  .closing-note { font-size: 21px; }
  .closing-names { font-size: 56px; }
  .closing > .eyebrow { font-size: 11px; margin-top: 40px; }
  .footer-line { flex-wrap: wrap; justify-content: center; gap: 12px 24px; margin-top: 44px; padding-top: 24px; font-size: 11px; }
  .footer-line .replay-button { order: 3; flex-basis: 100%; min-height: 48px; font-size: 12px; }
}
@media (max-width: 360px) {
  .invitation-copy { padding-inline: 24px; }
  .invitation-intro { font-size: 22px; }
  .reception { padding-inline: 24px; }
  .reception h2 { font-size: 38px; }
  .date-composition { grid-template-columns: 1fr 78px 1fr; }
  .date-side { font-size: 11px; }
}
@media (min-width: 700px) and (max-width: 999px) {
  .invitation-copy { padding-inline: max(44px, calc((100vw - 620px) / 2)); }
  .hero-art { height: 280px; }
  .event-actions { display: flex; max-width: 460px; }
  .action-link { flex: 1; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .envelope-screen { padding-block: 18px; }
  .cover-names { font-size: 64px; margin-top: 0; }
  .cover-date { margin-top: 0; }
  .envelope-stage { width: min(32vw, 200px); margin-block: 10px; }
  .cover-action > p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .text-reveal:not(.is-visible) { opacity: 1; transform: none; }
}
@media print {
  @page { size: A5 portrait; margin: 12mm; }
  .envelope-screen, .hero-art, .masthead, .hero-date, .countdown, .event-actions, .footer-line { display: none !important; }
  .js body main { display: block !important; }
  .music-toggle { display: none !important; }
  .text-reveal:not(.is-visible) { opacity: 1; transform: none; }
  .invitation-hero { display: block; min-height: 0; }
  .invitation-copy { min-height: 0; padding: 0; }
  .invitation-message { padding: 0 0 20px; }
  .invitation-label { margin-top: 18px; }
  .couple-names { font-size: 76px; margin-block: 8px; }
  .reception-intro { display: none; }
  .reception { background: white; color: var(--ink); padding: 18px 0; border-top: 1px solid var(--rule); }
  .reception .eyebrow, .date-side > :last-child, .venue .venue-region { color: var(--muted); }
  .reception h2 { font-size: 32px; }
  .date-composition { margin-block: 18px; }
  .day-number { font-size: 64px; }
  .closing { padding: 20px 0 0; }
  .closing-blessing { font-size: 23px; }
  .closing > .eyebrow, .closing-names, .closing-note { display: none; }
}
