/* دعوة · استوديو الدعوات */
:root{
  --paper:#f7f2e9;
  --paper-2:#efe7d8;
  --card:#fffdf8;
  --ink:#1c1813;
  --ink-soft:#4a4237;
  --muted:#7c7162;
  --gold:#a97c37;
  --gold-soft:#e3c78b;
  --line:rgba(28,24,19,.12);
  --shadow:0 1px 2px rgba(28,24,19,.04), 0 10px 30px -18px rgba(28,24,19,.35);
  --radius:18px;
  --display:"Amiri", "Times New Roman", serif;
  --ui:"Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  font-family:var(--ui);
  color:var(--ink);
  background:
    radial-gradient(120% 60% at 50% -10%, #fffdf7 0%, rgba(255,253,247,0) 60%),
    var(--paper);
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;cursor:pointer;background:none;border:0}
h1,h2,h3{font-family:var(--display);font-weight:700;line-height:1.25;margin:0}

/* ---------- topbar ---------- */
.topbar{
  position:sticky;top:0;z-index:20;
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;
  padding:10px 18px;
  background:color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter:saturate(140%) blur(14px);
  -webkit-backdrop-filter:saturate(140%) blur(14px);
  border-bottom:1px solid transparent;
  transition:border-color .3s ease, background .3s ease;
}
.topbar.is-stuck{border-bottom-color:var(--line)}
.brand{display:flex;align-items:center;gap:10px}
.monogram{
  width:38px;height:38px;flex:0 0 38px;
  display:grid;place-items:center;
  border-radius:12px;
  background:var(--ink);color:var(--gold-soft);
  font-family:var(--display);font-size:1.35rem;line-height:1;
  padding-bottom:2px;
}
.brand-text{display:flex;flex-direction:column;line-height:1.4;gap:1px}
.brand-text strong{font-family:var(--display);font-size:1.15rem;line-height:1.5;padding-top:2px;overflow:visible}
.brand-text small{font-size:.68rem;color:var(--muted);letter-spacing:.02em}
.topbar-link{
  font-size:.82rem;color:var(--ink-soft);
  border:1px solid var(--line);border-radius:999px;
  padding:6px 14px;
  background:var(--card);
}

/* ---------- hero ---------- */
main{max-width:1120px;margin:0 auto;padding:0 18px}
.hero{padding:26px 0 6px;text-align:center}
.eyebrow{
  font-family:var(--display);
  font-size:.95rem;letter-spacing:.04em;
  color:var(--gold);
  margin:0 0 10px;
}
.eyebrow span{opacity:.6;font-size:.8em;padding:0 4px}
.hero h1{
  font-size:clamp(1.9rem, 8.5vw, 3.1rem);
  letter-spacing:-.01em;
  margin-bottom:14px;
}
.hero h1 em{
  font-style:normal;
  color:var(--gold);
  position:relative;
  white-space:nowrap;
}
.hero h1 em::after{
  content:"";position:absolute;inset-inline:2px;bottom:.08em;height:.06em;
  background:linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  border-radius:2px;
}
.lede{
  max-width:36ch;margin:0 auto 22px;
  color:var(--ink-soft);font-size:.95rem;font-weight:300;
}
.facts{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:14px 18px;
  padding:16px 16px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:linear-gradient(180deg,#fffdf8,#fbf6ec);
  box-shadow:var(--shadow);
  text-align:center;
}
.fact{display:flex;flex-direction:column;gap:2px;min-width:0}
.fact-k{font-size:.68rem;letter-spacing:.08em;color:var(--gold);text-transform:uppercase}
.fact-v{font-family:var(--display);font-size:1.02rem}
.fact-s{font-size:.74rem;color:var(--muted)}
.fact-sep{width:1px;height:34px;background:var(--line)}
@media (max-width:559px){
  .facts{flex-direction:column;gap:12px}
  .fact{width:100%}
  .fact-sep{display:none}
  .fact + .fact{border-top:1px solid var(--line);padding-top:12px}
}

/* ---------- filters ---------- */
.filters{
  display:flex;gap:8px;overflow-x:auto;
  padding:22px 2px 4px;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.filters::-webkit-scrollbar{display:none}
.chip{
  flex:0 0 auto;
  font-size:.82rem;
  padding:7px 15px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--card);
  color:var(--ink-soft);
  transition:background .2s ease,color .2s ease,border-color .2s ease,transform .2s ease;
}
.chip[aria-pressed="true"]{
  background:var(--ink);color:#f7f2e9;border-color:var(--ink);
}
.chip:active{transform:scale(.97)}
.chip .n{font-size:.7em;opacity:.6;padding-inline-start:4px}

/* ---------- grid ---------- */
.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  padding:16px 0 8px;
}
@media (min-width:640px){ .grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px} }
@media (min-width:1000px){ .grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px} }

.card{
  position:relative;
  display:flex;flex-direction:column;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  box-shadow:var(--shadow);
  transition:transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease;
}
@media (hover:hover){
  .card:hover{transform:translateY(-3px);box-shadow:0 2px 4px rgba(28,24,19,.05),0 22px 40px -26px rgba(28,24,19,.5)}
}
.card-media{
  position:relative;
  aspect-ratio:3/4;
  overflow:hidden;
  background:var(--paper-2);
  border-bottom:1px solid var(--line);
}
.card-media img{
  width:100%;height:100%;
  object-fit:cover;object-position:top center;
  transition:transform .6s cubic-bezier(.2,.7,.3,1);
}
@media (hover:hover){ .card:hover .card-media img{transform:scale(1.04)} }
.card-media::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(180deg, rgba(0,0,0,0) 62%, rgba(0,0,0,.16));
  opacity:0;transition:opacity .3s ease;
}
@media (hover:hover){ .card:hover .card-media::after{opacity:1} }
.card-body{padding:11px 11px 12px;display:flex;flex-direction:column;gap:5px;flex:1}
.card-cat{
  font-size:.63rem;letter-spacing:.06em;color:var(--gold);
  display:flex;align-items:center;gap:5px;
}
.card-cat::before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor;opacity:.8}
.card-title{
  font-family:var(--display);
  font-size:1.02rem;line-height:1.3;
  margin:0;
}
.card-desc{
  margin:0;
  font-size:.72rem;line-height:1.6;color:var(--muted);
  font-weight:300;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}
.card-actions{display:flex;gap:6px;margin-top:auto;padding-top:9px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border-radius:999px;
  font-size:.78rem;
  padding:8px 12px;
  transition:background .2s ease,color .2s ease,border-color .2s ease,transform .15s ease;
  white-space:nowrap;
}
.btn:active{transform:scale(.97)}
.btn-primary{background:var(--ink);color:#f7f2e9;flex:1}
.btn-primary:hover{background:#2c251d}
.btn-ghost{border:1px solid var(--line);background:var(--card);color:var(--ink-soft)}
.btn-ghost:hover{border-color:rgba(28,24,19,.28)}
.btn-icon{width:36px;padding:8px 0;flex:0 0 36px}
.btn-icon svg{width:15px;height:15px}

/* ---------- how ---------- */
.how{
  margin:26px 0 10px;
  padding:22px 18px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:linear-gradient(180deg,#fffdf8,#f9f3e8);
}
.how h2{font-size:1.25rem;margin-bottom:12px}
.how ol{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.how li{display:flex;gap:10px;align-items:flex-start;font-size:.88rem;color:var(--ink-soft);font-weight:300}
.how li span{
  flex:0 0 24px;height:24px;border-radius:50%;
  display:grid;place-items:center;
  background:var(--paper-2);color:var(--gold);
  font-size:.75rem;font-family:var(--display);
}

/* ---------- footer ---------- */
.footer{
  text-align:center;
  padding:34px 18px 44px;
  color:var(--muted);
  font-size:.78rem;
  font-weight:300;
}
.footer-brand{font-family:var(--display);font-size:1.1rem;color:var(--ink);margin:0 0 4px}
.footer p{margin:0}

/* ---------- sheet ---------- */
.sheet{
  border:0;padding:0;background:transparent;
  width:min(560px, 100%);
  max-width:100%;max-height:100dvh;
  margin:auto auto 0;
  color:var(--ink);
}
.sheet::backdrop{background:rgba(24,20,15,.45);backdrop-filter:blur(3px)}
.sheet-inner{
  position:relative;
  background:var(--card);
  border-radius:22px 22px 0 0;
  overflow:hidden;
  max-height:92dvh;
  display:flex;flex-direction:column;
  animation:sheetIn .32s cubic-bezier(.2,.8,.25,1);
}
@keyframes sheetIn{from{transform:translateY(18px);opacity:.6}to{transform:translateY(0);opacity:1}}
.sheet-close{
  position:absolute;top:10px;inset-inline-start:10px;z-index:2;
  width:34px;height:34px;border-radius:50%;
  display:grid;place-items:center;
  background:rgba(255,253,248,.9);
  border:1px solid var(--line);
  backdrop-filter:blur(6px);
}
.sheet-close svg{width:16px;height:16px}
.sheet-media{flex:0 0 auto;max-height:44dvh;overflow:hidden;background:var(--paper-2)}
.sheet-media img{width:100%;height:100%;max-height:44dvh;object-fit:cover;object-position:top center}
.sheet-body{padding:16px 18px calc(20px + env(safe-area-inset-bottom));overflow-y:auto}
.sheet-cat{font-size:.66rem;letter-spacing:.08em;color:var(--gold);margin:0 0 4px}
.sheet-title{font-size:1.5rem;margin:0 0 8px}
.sheet-desc{font-size:.86rem;color:var(--ink-soft);font-weight:300;margin:0 0 12px}
.palette{display:flex;gap:7px;margin-bottom:16px}
.palette i{width:20px;height:20px;border-radius:50%;border:1px solid rgba(0,0,0,.08);display:block}
.sheet-actions{display:flex;gap:8px;flex-wrap:wrap}
.sheet-actions .btn{padding:11px 16px;font-size:.85rem}
.sheet-actions .btn-primary{flex:1 1 100%}
.sheet-url{
  margin:12px 0 0;font-size:.7rem;color:var(--muted);
  direction:ltr;text-align:left;
  word-break:break-all;
  background:var(--paper);border:1px solid var(--line);border-radius:10px;
  padding:8px 10px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}
@media (min-width:640px){
  .sheet{margin:auto;border-radius:22px}
  .sheet-inner{border-radius:22px;max-height:88dvh;display:grid;grid-template-columns:1fr 1fr}
  .sheet-media{max-height:none}
  .sheet-media img{max-height:none;height:100%}
  .sheet-body{max-height:88dvh}
}

/* ---------- toast ---------- */
.toast{
  position:fixed;inset-inline:0;bottom:calc(20px + env(safe-area-inset-bottom));
  margin:auto;width:max-content;max-width:80vw;
  background:var(--ink);color:#f7f2e9;
  font-size:.8rem;
  padding:9px 16px;border-radius:999px;
  opacity:0;transform:translateY(10px);
  transition:opacity .25s ease,transform .25s ease;
  pointer-events:none;z-index:50;
}
.toast.is-on{opacity:1;transform:translateY(0)}

/* ---------- reveal ---------- */
.reveal{opacity:0;transform:translateY(14px)}
.reveal.is-in{opacity:1;transform:none;transition:opacity .6s ease,transform .6s cubic-bezier(.2,.7,.3,1)}
.reveal.is-in:nth-child(2n){transition-delay:.05s}
.reveal.is-in:nth-child(3n){transition-delay:.1s}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms !important;transition-duration:.001ms !important}
  .reveal{opacity:1;transform:none}
  .card:hover{transform:none}
  .card:hover .card-media img{transform:none}
}
