/* EPCI invitation — "threads of trust meet".
   Light, soft, one memorable moment (opening the sealed card). Everything else is quiet. */

/* ---------- tokens ---------- */
:root{
  /* brand */
  --petrol:#002730; --teal:#003F4F; --mint:#00D49C; --pale:#B7F2DD; --paper:#F4F6F5;
  --mist:#F3F9F7; --mist-2:#E2F1EC; --line:#D3E3DF; --muted:#4A6065; --focus:#006B53;
  /* champagne, used only for VIP */
  --gold:#C3A266; --gold-d:#7B5C1F; --gold-soft:#F6ECD2;
  /* accent follows the guest type */
  --acc:var(--mint); --acc-d:var(--focus); --acc-soft:var(--pale);
  --f:'IBM Plex Sans Arabic','Segoe UI',Tahoma,'Noto Sans Arabic','Geeza Pro',Arial,sans-serif;
  --r:28px;
  --ease:cubic-bezier(.22,.8,.2,1);
  --shadow:0 1px 2px rgba(0,39,48,.05),0 10px 30px -8px rgba(0,39,48,.14),0 40px 80px -30px rgba(0,63,79,.22);
}
body[data-vip="1"]{ --acc:var(--gold); --acc-d:var(--gold-d); --acc-soft:var(--gold-soft); }

/* ---------- base ---------- */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; min-height:100vh; min-height:100svh; color:var(--petrol); font-family:var(--f);
  font-size:17px; line-height:1.8; -webkit-font-smoothing:antialiased;
  background:#E9F4F0;
}
[hidden]{display:none !important}
img{display:block;max-width:100%;height:auto}
button{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--focus);outline-offset:3px;border-radius:10px}
bdi{unicode-bidi:isolate}

/* ---------- background ---------- */
.bg{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:0;background:linear-gradient(180deg,#F5FAF8 0%,#E9F4F0 55%,#DDEEE8 100%)}
.bg:before{content:"";position:absolute;top:-30vmax;inset-inline-end:-25vmax;width:75vmax;height:75vmax;
  background:radial-gradient(closest-side,rgba(0,212,156,.17),rgba(0,212,156,0) 70%)}
.bg:after{content:"";position:absolute;bottom:-35vmax;inset-inline-start:-30vmax;width:80vmax;height:80vmax;
  background:radial-gradient(closest-side,rgba(183,242,221,.55),rgba(183,242,221,0) 70%)}
.threads{position:absolute;inset:0;width:100%;height:100%}
.threads path{fill:none;stroke-linecap:round;vector-effect:non-scaling-stroke}
.threads .t1{stroke:var(--acc);stroke-width:1.6;opacity:.55}
.threads .t2{stroke:var(--teal);stroke-width:1.2;opacity:.18}
.threads .t3{stroke:var(--acc);stroke-width:1;opacity:.32}
/* the threads are revealed from the start edge once the page is ready */
.threads{clip-path:inset(0 0 0 0)}
body.is-ready .threads{animation:reveal 2.4s var(--ease) .2s both}
@keyframes reveal{from{clip-path:inset(0 0 0 100%)}to{clip-path:inset(0 0 0 0)}}

.stage{position:relative;z-index:1;min-height:100vh;min-height:100svh;display:flex;flex-direction:column;justify-content:center}

/* ---------- the mark (three bars) ---------- */
.mark{display:grid;gap:4px;width:22px}
.mark i{display:block;height:4px;border-radius:3px;background:var(--acc)}
.mark i:nth-child(2){opacity:.8}
.mark i:nth-child(3){opacity:.6}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;min-height:54px;padding:0 30px;border:0;border-radius:999px;
  font-weight:600;font-size:17px;line-height:1;cursor:pointer;text-decoration:none;
  transition:transform .2s var(--ease),box-shadow .2s var(--ease),background-color .2s;
}
.btn.primary{background:var(--acc);color:var(--petrol);box-shadow:0 8px 22px -8px rgba(0,63,79,.35)}
body[data-vip="1"] .btn.primary{background:linear-gradient(135deg,#DCC48F,#C3A266)}
.btn.primary:hover{transform:translateY(-1px);box-shadow:0 12px 26px -8px rgba(0,63,79,.42)}
.btn.primary:active{transform:translateY(0)}
.btn.quiet{background:transparent;color:var(--muted);font-weight:500;min-height:48px;padding:0 18px}
.btn.quiet:hover{color:var(--petrol);background:rgba(0,63,79,.05)}
.btn[disabled]{opacity:.55;cursor:progress;transform:none}
.link{background:none;border:0;padding:8px 6px;color:var(--muted);font-size:15px;text-decoration:underline;text-underline-offset:4px;cursor:pointer}
.link:hover{color:var(--petrol)}

/* ---------- 1. sealed card ---------- */
.sealed{
  min-height:100vh;min-height:100svh;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:26px;padding:28px 20px;overflow-x:clip;
}
.env{
  position:relative;width:min(80vw,340px);aspect-ratio:4/5.2;background:#fff;border-radius:var(--r);box-shadow:var(--shadow);
  display:flex;flex-direction:column;align-items:center;padding:34px 22px 0;text-align:center;
  transition:transform .9s var(--ease),opacity .6s .3s;
}
.env:before{content:"";position:absolute;inset:10px;border:1px solid var(--line);border-radius:calc(var(--r) - 10px);pointer-events:none}
.env-logo{margin-top:6px}
.env-for{margin:30px 0 4px;font-size:15px;color:var(--muted)}
.long-name .env-name{font-size:23px}
.long-name .name{font-size:clamp(24px,6.4vw,32px)}
.env-name{margin:0;font-size:clamp(26px,7vw,32px);font-weight:500;line-height:1.5;overflow-wrap:anywhere;max-width:100%}
.env-vip{margin:8px 0 0}
.env-vip span,.vip span{
  display:inline-block;padding:1px 14px 0;border:1px solid var(--gold);border-radius:999px;color:var(--gold-d);
  font-size:12.5px;font-weight:600;line-height:1.9;letter-spacing:.14em;background:var(--gold-soft);
}
/* three threads tied across the card, running out to the edges of the screen */
.ribbons{position:absolute;top:75%;height:30px;inset-inline:-120vw;pointer-events:none}
.ribbons i{position:absolute;inset-inline:0;height:3px;border-radius:3px;background:var(--acc);transition:transform .9s var(--ease),opacity .7s}
.ribbons i:nth-child(1){top:0}
.ribbons i:nth-child(2){top:13px;opacity:.75}
.ribbons i:nth-child(3){top:26px;opacity:.5}
.seal{
  position:absolute;top:calc(75% - 22px);inset-inline-start:calc(50% - 37px);width:74px;height:74px;border-radius:50%;
  background:#fff;border:2px solid var(--acc);box-shadow:0 8px 22px -8px rgba(0,39,48,.35);cursor:pointer;
  display:grid;place-items:center;transition:transform .35s var(--ease),opacity .5s;
}
.seal:hover{transform:scale(1.06)}
.seal .mark{width:26px}
body.is-ready .seal{animation:breathe 3.6s ease-in-out 1.6s infinite}
@keyframes breathe{0%,100%{box-shadow:0 8px 22px -8px rgba(0,39,48,.35),0 0 0 0 rgba(0,212,156,.0)}50%{box-shadow:0 8px 22px -8px rgba(0,39,48,.35),0 0 0 10px rgba(0,212,156,.14)}}
body[data-vip="1"].is-ready .seal{animation-name:breathe-g}
@keyframes breathe-g{0%,100%{box-shadow:0 8px 22px -8px rgba(0,39,48,.35),0 0 0 0 rgba(195,162,102,0)}50%{box-shadow:0 8px 22px -8px rgba(0,39,48,.35),0 0 0 10px rgba(195,162,102,.2)}}
.hint{margin:0;font-size:14.5px;color:var(--muted)}

/* opening: the threads untie and run off, the seal lets go, the card lifts away */
.sealed.is-opening .ribbons i:nth-child(odd){transform:translateX(120vw)}
.sealed.is-opening .ribbons i:nth-child(even){transform:translateX(-120vw)}
.sealed.is-opening .ribbons i{opacity:0}
.sealed.is-opening .seal{transform:scale(.4);opacity:0;animation:none}
.sealed.is-opening .env{transform:translateY(-18px) scale(1.03);opacity:0}
.sealed.is-opening .btn,.sealed.is-opening .hint{opacity:0;transition:opacity .3s}

/* ---------- 2. the invitation ---------- */
.card{
  position:relative;width:min(100% - 28px,560px);margin:44px auto 36px;background:#fff;border-radius:var(--r);
  box-shadow:var(--shadow);padding:44px 26px 30px;
}
.card:before{content:"";position:absolute;inset:0;border-radius:inherit;border:1px solid rgba(0,63,79,.07);pointer-events:none}
.col{text-align:center}
.logo{margin:4px auto 0}
.for{margin:26px 0 2px;font-size:15px;color:var(--muted)}
.name{margin:0;font-size:clamp(28px,7.6vw,40px);font-weight:500;line-height:1.45;overflow-wrap:anywhere}
.vip{margin:8px 0 0}
.rule{display:grid;gap:3px;width:30px;margin:24px auto}
.rule i{display:block;height:3px;border-radius:2px;background:var(--acc)}
.rule i:nth-child(2){opacity:.75}.rule i:nth-child(3){opacity:.5}
.lead{margin:0 auto;max-width:34ch;font-size:16.5px;color:var(--muted);text-wrap:balance}
.lg{display:none}
.title{margin:6px 0 0;font-size:clamp(27px,7vw,36px);font-weight:600;line-height:1.5;text-wrap:balance}
.en{margin:6px 0 0;font-size:13.5px;line-height:1.5;color:var(--muted);text-wrap:balance}
.sentence{margin:22px auto 0;max-width:30ch;font-size:18.5px;font-weight:300;line-height:2;color:var(--teal);text-wrap:balance}

.facts{margin:30px 0 0;padding:0;border-top:1px solid var(--line)}
.fact{padding:13px 4px 12px;border-bottom:1px solid var(--line);text-align:center}
.fact dt{margin:0;font-size:13.5px;color:var(--muted);line-height:1.6}
.fact dd{margin:0;font-size:21px;font-weight:500;line-height:1.55}
.fact .sub{display:block;font-size:15px;font-weight:400;color:var(--muted)}

/* RSVP */
.rsvp{margin-top:26px;text-align:center}
.r-q{margin:0 0 14px;font-size:19px;font-weight:500}
.r-ask{display:flex;flex-direction:column;align-items:center;gap:6px}
.r-ask .btn.primary{width:100%;max-width:340px}
.r-yes,.r-no{display:flex;flex-direction:column;align-items:center;gap:4px}
.r-t{margin:6px 0 0;font-size:21px;font-weight:600;line-height:1.5}
.r-s{margin:0 0 12px;color:var(--muted);font-size:16px;line-height:1.8;max-width:34ch;text-wrap:balance}
.r-yes .btn{width:100%;max-width:340px}
.r-when{margin:10px 0 0;font-size:13.5px;color:var(--muted)}
.r-err{margin:10px 0 0;color:#9A3B2E;font-size:15px}
.tick{width:60px;height:60px;fill:none;stroke:var(--acc-d);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.tick circle{fill:var(--acc-soft);stroke:var(--acc);stroke-dasharray:152;stroke-dashoffset:152}
.tick path{stroke-dasharray:40;stroke-dashoffset:40}
.rsvp.is-fresh .tick circle{animation:draw2 .7s var(--ease) forwards}
.rsvp.is-fresh .tick path{animation:draw2 .5s var(--ease) .45s forwards}
.rsvp:not(.is-fresh) .tick circle,.rsvp:not(.is-fresh) .tick path{stroke-dashoffset:0}
@keyframes draw2{to{stroke-dashoffset:0}}

.sign{margin:22px 0 0;font-size:17px;font-weight:500;color:var(--acc-d);text-align:center}

/* the invitation rises into place once the card opens (one orchestrated moment) */
.card .rise{opacity:0;transform:translateY(14px)}
.card.is-in .rise{opacity:1;transform:none;transition:opacity .7s var(--ease),transform .8s var(--ease);transition-delay:calc(var(--i,0) * 70ms + 120ms)}

/* ---------- 3. not valid ---------- */
.void{width:min(100% - 40px,460px);margin:0 auto;text-align:center;padding:60px 0}
.void h1{margin:30px 0 8px;font-size:26px;font-weight:600}
.void p{margin:0;color:var(--muted)}
.nojs{position:relative;z-index:2;margin:0;padding:20px;text-align:center}

/* ---------- laptop and wide screens: a real two-column composition ---------- */
@media (min-width:520px){.lg{display:inline}}
@media (min-width:960px){
  .stage{padding:20px 0}
  .env{width:340px}
  .card{
    width:min(1060px,100% - 72px);margin:36px auto;padding:0;display:grid;grid-template-columns:1.12fr 1fr;
    align-items:stretch;
  }
  .col-a{padding:58px 54px 44px;display:flex;flex-direction:column;justify-content:center}
  .col-b{
    padding:44px 48px 38px;display:flex;flex-direction:column;justify-content:center;
    background:linear-gradient(180deg,#F4FAF7,#EAF5F1);border-radius:0 var(--r) var(--r) 0;
    border-inline-start:1px solid var(--line);
  }
  html[dir="rtl"] .col-b{border-radius:var(--r) 0 0 var(--r)}
  .col-a{text-align:start}
  .col-a .logo,.col-a .rule{margin-inline:0}
  .col-a .sentence{margin-inline:0}
  .facts{margin-top:0}
  .name{font-size:clamp(32px,2.9vw,42px)}
  .title{font-size:clamp(28px,2.45vw,34px)}
  .lead{margin-inline:0;max-width:none}
}
@media (min-width:960px) and (max-height:760px){
  .card{margin:20px auto}
  .col-a{padding:36px 48px 30px}
  .col-b{padding:28px 42px 26px}
  .for{margin-top:16px}
  .rule{margin:14px 0}
  .sentence{margin-top:12px;font-size:17.5px;line-height:1.85}
  .fact{padding:9px 4px 8px}.fact dd{font-size:19px}
  .rsvp{margin-top:18px}
  .r-q{margin-bottom:10px;font-size:18px}
  .btn{min-height:50px}
  .sign{margin-top:12px}
  .name{font-size:clamp(30px,2.6vw,36px)}
  .title{font-size:clamp(26px,2.3vw,32px)}
  .tick{width:46px;height:46px}
  .r-t{font-size:19px;margin-top:2px}
  .r-s{font-size:15px;margin-bottom:8px}
  .r-when{margin-top:6px}
}

/* big screens: let the card grow a little instead of floating small */
@media (min-width:1700px) and (min-height:840px){
  .card{width:min(1200px,100% - 120px)}
  .col-a{padding:72px 64px 56px}
  .col-b{padding:56px 56px 48px}
  .name{font-size:46px}
  .title{font-size:38px}
  .sentence{font-size:20px}
  .fact dd{font-size:23px}
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion:reduce){
  *,*:before,*:after{animation:none !important;transition:none !important}
  .card .rise{opacity:1;transform:none}
  .tick circle,.tick path{stroke-dashoffset:0 !important}
}
