/* Mika gallery — «ترابيزة شغل فنانة ديكوباج».
   التصميم الأساسي من Stitch، ومكتوب هنا CSS عادي من غير build. */

:root {
  --cream: #f7f0e6;
  --cream-2: #efe5d6;
  --newsprint: #ede2ce;
  --blush: #ebc9c4;
  --rose: #a24f5d;
  --rose-dark: #86404c;
  --gold: #b08a3e;
  --ink: #2a2320;
  --muted: #5c4f48;
  --sage: #9ba58a;
  --blue: #24405c;
  --twine: #9e2b2b;
  --line: #d5c5ae;

  --font-head: "Aref Ruqaa", "Amiri", serif;
  --font-body: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-script: "Great Vibes", cursive;

  --shadow: 0 8px 22px rgba(42, 35, 32, .09);
  --shadow-lift: 0 16px 34px rgba(42, 35, 32, .16);
  --page: 960px;
  --gutter: 22px;
  --arch: 160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--cream);
  /* حبيبات ورق خفيفة */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .18 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 16px/1.7 var(--font-body);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.35; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 7vw, 3.2rem); }
h2 { font-size: clamp(1.75rem, 5vw, 2.3rem); }
h3 { font-size: 1.35rem; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--blush); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }

.wrap { width: min(100% - (var(--gutter) * 2), var(--page)); margin-inline: auto; }
.section { padding-block: 60px; position: relative; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--cream); padding: 8px 14px; z-index: 60; }
.skip:focus { top: 12px; }

/* ---------- شريط النسخة التجريبية ---------- */
.demo-strip { background: var(--ink); color: var(--cream); text-align: center; font-size: .82rem; padding: 5px 16px; }

/* ---------- الهيدر ---------- */
.site-header { border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-inline: auto; }
.brand img { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--gold); box-shadow: var(--shadow); transition: transform .4s; }
.brand:hover img { transform: rotate(-8deg) scale(1.05); }
.brand b { font: 400 2rem/1.1 var(--font-script); white-space: nowrap; }
.nav { display: flex; gap: 6px; width: 100%; justify-content: center; }
.nav a { text-decoration: none; padding: 6px 14px; font-weight: 500; font-size: .95rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--rose); }
.nav a[aria-current="page"] { color: var(--rose); border-bottom-color: var(--gold); }
@media (min-width: 620px) {
  .brand { margin-inline: 0; }
  .nav { width: auto; }
}
@media (max-width: 619px) {
  .site-header .wrap { padding-block: 8px; gap: 2px; }
  .brand img { width: 40px; height: 40px; }
  .brand b { font-size: 1.7rem; }
}

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 10px 28px; border-radius: 999px;
  border: 1px solid var(--gold); background: var(--cream-2); color: var(--ink);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .15s, background-color .2s, box-shadow .2s;
}
.btn:hover { background: var(--blush); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--rose); color: #fff; box-shadow: var(--shadow), inset 0 0 0 3px rgba(247, 240, 230, .18); }
.btn-primary:hover { background: var(--rose-dark); box-shadow: var(--shadow-lift), inset 0 0 0 3px rgba(247, 240, 230, .18); }
.btn-block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- عناصر الورق ---------- */
.heading { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.heading::before { content: ""; width: 13px; height: 13px; border-radius: 50%; background: var(--twine); border: 1px solid var(--gold); flex: none; }

.tag {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  background: var(--newsprint); border: 1px solid var(--gold); box-shadow: var(--shadow);
  padding: 4px 16px 6px; border-radius: 4px; transform-origin: 100% 0;
}
.tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--cream); border: 2px solid var(--twine); flex: none; }
.tag h3, .tag h2 { font-size: 1.2rem; }

.stamp {
  display: inline-block; font-size: .78rem; font-weight: 700; line-height: 1; padding: 5px 10px 6px;
  border: 1.5px solid currentColor; border-radius: 3px; color: var(--twine);
  outline: 1px solid currentColor; outline-offset: 2px; transform: rotate(-3deg);
}
.stamp[data-status="available"] { color: #4d5c38; }
.stamp[data-status="sold"] { color: var(--muted); text-decoration: line-through; }

.rope { height: 14px; width: 100%; display: block; }

/* ---------- البراويز ---------- */
.frame { position: relative; display: block; padding: 9px; background: var(--cream-2); border: 1px solid var(--gold); box-shadow: var(--shadow); transition: box-shadow .3s, transform .3s; }
.frame > span { display: block; overflow: hidden; border: 1px solid var(--gold); }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, 0, 0, 1); }
.frame-rect { border-radius: 4px; }
.frame-rect > span { aspect-ratio: 4 / 5; }
.frame-arch { border-radius: var(--arch) var(--arch) 6px 6px; }
.frame-arch > span { aspect-ratio: 3 / 4; border-radius: var(--arch) var(--arch) 2px 2px; }
.frame-oval, .frame-oval > span, .frame-circle, .frame-circle > span { border-radius: 50%; }
.frame-oval > span { aspect-ratio: 3 / 4; }
.frame-circle > span { aspect-ratio: 1; }
.frame-oval, .frame-circle { border-width: 3px; border-style: double; }
.frame-double { border-width: 5px; border-style: double; background: var(--newsprint); }
.frame-double > span { aspect-ratio: 3 / 4; }
.frame-mat { border-radius: 14px; background: var(--newsprint); padding: 13px; }
.frame-mat > span { aspect-ratio: 1; border-radius: 4px; }
a:hover .frame { box-shadow: var(--shadow-lift); }
a:hover .frame img { transform: scale(1.05); }

/* ---------- الهيرو ---------- */
.hero { padding-block: 18px 52px; }
.hero .wrap { display: grid; gap: 22px; align-items: center; }
.hero-art { position: relative; display: grid; place-items: center; padding-block: 14px; isolation: isolate; }
.paper { position: absolute; z-index: -1; width: min(86%, 360px); height: 94%; border: 1px solid var(--line); box-shadow: var(--shadow); }
.paper-a { background: var(--newsprint); transform: rotate(-5deg); clip-path: polygon(0 2%, 8% 0, 19% 1.6%, 31% 0, 46% 2%, 60% .4%, 74% 1.8%, 88% 0, 100% 2%, 98.6% 24%, 100% 47%, 98.4% 71%, 100% 98%, 87% 100%, 71% 98.4%, 55% 100%, 38% 98.2%, 22% 100%, 9% 98.4%, 0 100%, 1.6% 76%, 0 52%, 1.5% 27%); }
.paper-a::after { content: ""; position: absolute; inset: 18px; opacity: .35; background: repeating-linear-gradient(180deg, transparent 0 7px, var(--muted) 7px 8px); mask: repeating-linear-gradient(90deg, #000 0 74px, transparent 74px 84px); }
.paper-b { background: var(--blush); border-color: var(--gold); transform: rotate(3.5deg); width: min(80%, 330px); height: 89%; border-radius: 18px; }
.oval { position: relative; width: min(58vw, 310px); aspect-ratio: 3 / 4; }
/* تقريب بسيط عشان الخلفية حوالين القطعة تستخبى */
.oval > img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: cover; clip-path: ellipse(41.6% 41.6% at 50% 50%); transform: scale(1.2); }
@media (min-width: 760px) { .oval { width: 310px; } }
.oval svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.seal {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 35% 30%, #b73c3c, var(--twine) 55%, #741d1d); color: var(--cream);
  border: 2px solid var(--gold); box-shadow: var(--shadow); font: italic 700 1.15rem/1 Georgia, "Times New Roman", serif; direction: ltr; letter-spacing: -.04em;
}
.oval .seal { position: absolute; bottom: 4px; inset-inline-start: 12px; transform: rotate(-12deg); }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.hero-copy p { font-size: 1.15rem; color: var(--muted); max-width: 34ch; }
@media (min-width: 760px) { .hero .wrap { grid-template-columns: 1fr 1fr; } }

.bird { position: absolute; width: 54px; top: 6px; left: 6px; pointer-events: none; animation: fly 8s ease-in-out infinite; }
.bird .wing { transform-box: fill-box; transform-origin: 90% 90%; animation: wing .38s ease-in-out infinite; }
@keyframes fly { 0%, 100% { transform: translate(0, 0) rotate(-4deg); } 35% { transform: translate(14px, -10px) rotate(3deg); } 70% { transform: translate(4px, 12px) rotate(-1deg); } }
@keyframes wing { 50% { transform: scaleY(.45) rotate(-10deg); } }

/* ---------- حيطة الأقسام ---------- */
.categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 18px; align-items: start; }
.categories a { text-decoration: none; text-align: center; display: block; }
.categories a:nth-child(even) { margin-top: 34px; }
.categories .name { display: block; font: 700 1.4rem/1.4 var(--font-head); margin-top: 12px; }
@media (min-width: 720px) { .categories { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 30px; } }

/* ---------- قطع مختارة ---------- */
.band { background: rgba(239, 229, 214, .75); border-block: 1px solid var(--line); }
.featured { display: grid; gap: 40px; }
.featured a { text-decoration: none; display: flex; flex-direction: column; align-items: center; }
.featured .frame { width: 100%; }
.featured .tag { margin-top: -14px; z-index: 1; rotate: -2deg; }
.featured a:nth-child(even) .tag { rotate: 2deg; }
@media (min-width: 720px) {
  .featured { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 44px 34px; align-items: start; }
  .featured a:nth-child(1) { grid-column: span 7; }
  .featured a:nth-child(2) { grid-column: span 5; margin-top: 60px; }
  .featured a:nth-child(3) { grid-column: span 5; }
  .featured a:nth-child(4) { grid-column: span 7; margin-top: 40px; }
}
.more { display: flex; justify-content: center; margin-top: 44px; }

/* ---------- من أول لمسة ---------- */
.process { display: grid; gap: 28px; }
.process figure { margin: 0; padding: 16px 16px 20px; background: var(--newsprint); box-shadow: var(--shadow); position: relative; rotate: -1.2deg; }
.process figure:nth-child(2) { background: var(--blush); rotate: 1.2deg; }
.process figure::before { content: ""; position: absolute; top: -11px; left: 50%; width: 92px; height: 24px; translate: -50% 0; rotate: -3deg; background: rgba(176, 138, 62, .35); }
.process img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--gold); }
.process figcaption { margin-top: 12px; }
@media (min-width: 620px) { .process { grid-template-columns: 1fr 1fr; } .process figure:nth-child(2) { margin-top: 44px; } }

/* ---------- الحكاية ---------- */
.story { background: var(--blue); color: var(--cream); border-block: 3px double var(--gold); }
.story .wrap { display: grid; gap: 36px; align-items: center; }
.story .frame { width: min(100%, 300px); margin-inline: auto; }
.story .frame img { object-position: 50% 22%; }
.story p { font-size: 1.15rem; max-width: 44ch; }
.story hr { width: 82px; border: 0; border-top: 2px solid var(--gold); margin: 14px 0 18px; }
@media (min-width: 720px) { .story .wrap { grid-template-columns: 5fr 7fr; } }

/* ---------- خطوات الطلب ---------- */
.steps { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 22px; max-width: 560px; }
.steps::before, .steps::after { content: ""; position: absolute; inset-inline-start: 20px; top: 24px; bottom: 24px; width: 2px; margin-inline-start: -1px; }
.steps::before { background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 11px); }
.steps::after { background: repeating-linear-gradient(180deg, var(--twine) 0 9px, #c25050 9px 12px); transform-origin: top; transform: scaleY(var(--progress, 1)); }
.steps li { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.knot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; background: var(--cream); border: 2px solid var(--line); color: var(--muted); transition: background-color .3s, color .3s, transform .3s, border-color .3s; }
.steps li.is-tied .knot, .no-js .knot { background: var(--twine); color: var(--cream); border-color: var(--gold); transform: scale(1.08); }
.steps strong { flex: 1; font: 700 1.35rem/1.4 var(--font-head); background: var(--cream-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 18px; }

/* ---------- اللفة (طلب / ختام) ---------- */
.parcel {
  position: relative; isolation: isolate; text-align: center; overflow: hidden;
  background: var(--newsprint); border: 2px solid var(--gold); border-radius: 8px;
  box-shadow: var(--shadow-lift); padding: 44px 24px 46px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.parcel::before { content: ""; position: absolute; inset: 14px; z-index: -2; opacity: .2; background: repeating-linear-gradient(180deg, transparent 0 8px, var(--muted) 8px 9px); mask: repeating-linear-gradient(90deg, #000 0 96px, transparent 96px 110px); }
.parcel .string { position: absolute; z-index: -1; background: repeating-linear-gradient(135deg, var(--twine) 0 5px, #c25050 5px 7px); }
.parcel .string-h { inset-inline: 0; top: 80px; height: 3px; }
.parcel .string-v { top: 0; bottom: 0; left: calc(50% - 1.5px); width: 3px; }
.parcel .seal { width: 74px; height: 74px; font-size: 1.5rem; }
.parcel .label { background: var(--newsprint); padding: 2px 20px; font: 400 2.3rem/1.35 var(--font-script); }

/* ---------- الفوتر ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--cream-2); padding-block: 28px 96px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.site-footer a { text-decoration: none; font-weight: 500; }
.site-footer a:hover { color: var(--rose); }
.site-footer span { color: var(--muted); }

.fab { position: fixed; left: 18px; bottom: 18px; z-index: 20; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--rose); color: #fff; border: 2px solid var(--gold); box-shadow: var(--shadow-lift); }
.fab svg { width: 28px; height: 28px; }
.fab::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--gold); animation: halo 2.8s ease-out infinite; pointer-events: none; }
@keyframes halo { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(1.38); opacity: 0; } }

/* ---------- الخيط الأحمر ---------- */
.thread { position: fixed; top: 0; bottom: 0; right: 3px; width: 14px; z-index: 4; pointer-events: none; }
.thread svg { width: 100%; height: 100%; overflow: visible; }
.thread .bead { position: absolute; right: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--twine); border: 2px solid var(--gold); margin-top: -6px; }
@media (min-width: 1040px) { .thread { right: calc((100vw - var(--page)) / 2 - 34px); } }

/* ---------- المعرض ---------- */
.page-head { padding-block: 34px 8px; display: grid; gap: 8px; }
.page-head p { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 18px 8px; }
.chip { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 16px; background: var(--newsprint); border: 1px solid var(--gold); border-radius: 4px; font-weight: 500; box-shadow: 0 3px 8px rgba(42, 35, 32, .07); transition: transform .15s, background-color .2s; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--twine); }
.chip:hover { background: var(--blush); transform: rotate(-2deg); }
.chip[aria-pressed="true"] { background: var(--rose); color: #fff; }
.chip[aria-pressed="true"]::before { background: var(--cream); }

.wall { columns: 2; column-gap: 18px; padding-block: 26px 60px; }
@media (min-width: 720px) { .wall { columns: 3; column-gap: 30px; } }
.hung { break-inside: avoid; display: block; text-decoration: none; text-align: center; padding-bottom: 38px; }
.hung .hanger { display: block; width: 62%; height: 30px; margin-inline: auto; overflow: visible; }
.hung .swing { display: block; transform-origin: 50% 4px; }
.hung h2 { font-size: 1.15rem; margin: 12px 0 8px; }
.hung:hover .swing { animation: nudge 1.1s ease-in-out; }
.js-reveal .hung.is-in .swing { animation: hang 1.3s cubic-bezier(.3, .7, .4, 1) backwards; animation-delay: var(--delay, 0s); }
.js-reveal .hung:not(.is-in) { opacity: 0; }
.js-reveal .hung.is-in:hover .swing { animation: nudge 1.1s ease-in-out; }
@keyframes hang { 0% { transform: translateY(-16px) rotate(7deg); opacity: 0; } 30% { opacity: 1; transform: rotate(-4deg); } 55% { transform: rotate(2.4deg); } 78% { transform: rotate(-1deg); } 100% { transform: rotate(0); } }
@keyframes nudge { 25% { transform: rotate(2.2deg); } 60% { transform: rotate(-1.4deg); } 85% { transform: rotate(.5deg); } }

.empty { margin-block: 30px 70px; padding: 40px 24px; text-align: center; background: var(--newsprint); border: 1px solid var(--gold); box-shadow: var(--shadow); border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ---------- صفحة القطعة ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin-block: 20px; text-decoration: none; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--rose); }
.piece { display: grid; gap: 32px; padding-bottom: 56px; align-items: start; }
@media (min-width: 760px) { .piece { grid-template-columns: 1fr 1fr; gap: 48px; } }
.viewer { background: var(--cream-2); border: 2px solid var(--gold); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.viewer-main { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--newsprint); width: 100%; padding: 0; cursor: zoom-in; display: block; }
.viewer-main img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, 0, 0, 1); }
.viewer-main .hint { position: absolute; bottom: 12px; left: 12px; background: var(--cream); border: 1px solid var(--gold); border-radius: 999px; padding: 4px 14px; font-size: .85rem; font-weight: 700; box-shadow: var(--shadow); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.thumbs button { aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--cream); cursor: pointer; }
.thumbs button[aria-pressed="true"] { border: 3px solid var(--rose); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.info > p { color: var(--muted); font-size: 1.08rem; }
.details { width: 100%; margin: 0; background: var(--newsprint); border: 1px solid var(--gold); border-radius: 12px; box-shadow: var(--shadow); padding: 6px 20px; }
.details div { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding-block: 12px; }
.details div + div { border-top: 1px dashed var(--gold); }
.details dt { font: 700 1.25rem/1.4 var(--font-head); }
.details dd { margin: 0; color: var(--twine); text-align: end; }
.info .actions { width: 100%; flex-direction: column; }
.related { border-top: 1px solid var(--line); padding-block: 44px 64px; }
.related-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.related-list a { text-decoration: none; text-align: center; }
.related-list span.name { display: block; font: 700 1.15rem/1.4 var(--font-head); margin-top: 10px; }
@media (min-width: 620px) { .related-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 619px) { .related-list a:nth-child(3) { display: none; } }

dialog { border: 0; padding: 0; background: transparent; max-width: min(94vw, 620px); max-height: 94dvh; overflow: visible; color: var(--ink); }
dialog::backdrop { background: rgba(42, 35, 32, .86); }
.close { position: absolute; top: -14px; left: -10px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; background: var(--twine); color: var(--cream); border: 2px solid var(--gold); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.zoom-box { overflow: auto; max-height: 86dvh; background: var(--cream); border: 2px solid var(--gold); border-radius: 12px; padding: 8px; touch-action: pan-x pan-y; }
.zoom-box img { width: 100%; margin-inline: auto; cursor: zoom-in; }
.zoom-box.is-zoomed img { width: 220%; max-width: none; cursor: zoom-out; }

/* ---------- صفحة الطلب ---------- */
.order { display: grid; gap: 34px; padding-block: 26px 70px; align-items: start; }
@media (min-width: 800px) { .order { grid-template-columns: 7fr 5fr; } .order aside { position: sticky; top: 20px; } }
.order form { display: grid; gap: 22px; min-width: 0; }
.field { background: var(--cream-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 20px; margin: 0; min-width: 0; }
fieldset.field legend { float: right; width: 100%; padding: 0; }
fieldset.field legend + * { clear: both; }
.field-title { display: block; font: 700 1.3rem/1.5 var(--font-head); margin-bottom: 12px; }
.field input[type="text"], .field select { width: 100%; min-height: 48px; background: var(--cream); border: 1px solid var(--gold); border-radius: 6px; padding: 8px 14px; }
.field input::placeholder { color: #7d6e66; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 520px) { .choices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.choice, .swatch { position: relative; cursor: pointer; }
.choice input, .swatch input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--cream); border: 1px solid var(--gold); border-radius: 6px; font-weight: 500; transition: background-color .2s, transform .15s; }
.choice svg { width: 30px; height: 30px; color: var(--gold); }
.choice:hover span { background: var(--blush); }
.choice input:checked + span { background: var(--blush); box-shadow: inset 0 0 0 2px var(--twine); transform: rotate(-1.5deg); }
.choice input:checked + span svg { color: var(--twine); }
.choice input:focus-visible + span, .swatch input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch span { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 6px 5px 16px; background: var(--cream); border: 1px solid var(--line); border-radius: 999px; font-size: .92rem; }
.swatch i { width: 30px; height: 30px; border-radius: 47% 53% 50% 50% / 55% 48% 52% 45%; border: 1px solid var(--gold); background: var(--paint); }
.swatch input:checked + span { background: var(--blush); border-color: var(--twine); box-shadow: inset 0 0 0 1px var(--twine); }
.swatch input:checked + span i::after { content: "✓"; display: grid; place-items: center; height: 100%; font-style: normal; font-weight: 700; color: #fff; text-shadow: 0 0 4px #000; }
.pair { display: grid; gap: 22px; }
@media (min-width: 560px) { .pair { grid-template-columns: 1fr 1fr; } }
.error { display: flex; align-items: center; gap: 8px; background: var(--blush); border: 1px solid var(--twine); color: #751f1f; border-radius: 6px; padding: 8px 14px; margin-bottom: 12px; font-weight: 700; }
.field.has-error { border: 2px solid var(--twine); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(6px); } 60% { transform: translateX(-4px); } }
.note { color: var(--muted); font-size: .95rem; }

.gift { position: relative; background: var(--newsprint); border: 2px solid var(--gold); border-radius: 16px; box-shadow: var(--shadow-lift); padding: 24px 22px; }
.gift::before { content: ""; position: absolute; top: -26px; right: 34px; width: 3px; height: 44px; background: var(--twine); rotate: 24deg; }
.gift-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px dashed var(--twine); padding-bottom: 14px; margin-bottom: 8px; }
.gift-head h2 { font-size: 1.45rem; display: flex; align-items: center; gap: 10px; }
.gift-head h2::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--cream); border: 3px solid var(--twine); }
.gift-head .seal { width: 44px; height: 44px; font-size: .9rem; }
.gift-ref { display: flex; align-items: center; gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.gift-ref img { width: 56px; height: 68px; object-fit: cover; border: 1px solid var(--gold); border-radius: 4px; }
.gift-ref span { flex: 1; font-size: .95rem; }
.gift-ref button { background: none; border: 0; color: var(--twine); cursor: pointer; text-decoration: underline; padding: 8px; }
.gift dl { margin: 0 0 22px; }
.gift dl div { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; padding-block: 9px; border-bottom: 1px solid var(--line); }
.gift dt { color: var(--muted); font-size: .92rem; flex: none; }
.gift dd { margin: 0; text-align: end; overflow-wrap: anywhere; min-width: 0; font-weight: 500; }
.gift dd.is-fresh { animation: ink .6s; }
@keyframes ink { from { color: var(--twine); background: var(--blush); } }

/* لف الطلب وختمه */
.wrapping { width: min(92vw, 400px); }
.wrapping .parcel { min-height: 320px; justify-content: flex-end; padding-block: 120px 26px; }
.wrapping .parcel .string-h { top: 92px; }
.wrapping .seal { position: absolute; top: 54px; left: calc(50% - 38px); width: 76px; height: 76px; }
.wrapping .sheet { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--blush); z-index: 2; border-inline: 1px solid var(--gold); display: none; }
dialog[open] .wrapping .sheet { display: block; animation: unfold .75s cubic-bezier(.6, 0, .2, 1) forwards; }
.wrapping .sheet-r { right: 0; transform-origin: right; }
.wrapping .sheet-l { left: 0; transform-origin: left; }
@keyframes unfold { 0%, 15% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
dialog[open] .wrapping .string-h { animation: tie-h .5s .65s backwards; }
dialog[open] .wrapping .string-v { animation: tie-v .5s .8s backwards; }
@keyframes tie-h { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }
@keyframes tie-v { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
dialog[open] .wrapping .seal { animation: press .5s 1.25s cubic-bezier(.3, 1.5, .5, 1) backwards; }
@keyframes press { from { transform: scale(2.4) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.wrapping h2 { background: var(--newsprint); padding: 0 16px; font-size: 1.6rem; }
.wrapping .actions { flex-direction: column; width: 100%; }
.wrapping textarea { width: 100%; min-height: 150px; border: 1px solid var(--gold); background: var(--cream); border-radius: 6px; padding: 10px; font-size: .9rem; }

/* ---------- ظهور هادي مع السكرول ---------- */
.js-reveal .reveal { opacity: 0; translate: 0 22px; transition: opacity .6s, translate .7s cubic-bezier(.2, 0, 0, 1); }
.js-reveal .reveal.is-in { opacity: 1; translate: 0 0; }

/* ---------- انتقال الصفحات: صورة القطعة بتطير لصفحتها ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.viewer-main img { view-transition-name: piece; }
::view-transition-group(piece) { animation-duration: .55s; animation-timing-function: cubic-bezier(.3, .7, .2, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

/* ---------- دخول الهيرو ---------- */
@property --sweep { syntax: "<angle>"; inherits: false; initial-value: 360deg; }
.hero { position: relative; overflow: hidden; }
.paper-a { animation: deal 1s cubic-bezier(.2, .7, .2, 1) backwards; }
.paper-b { animation: deal 1s .14s cubic-bezier(.2, .7, .2, 1) backwards; }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(0) scale(.9); } }
.oval { animation: drop 1.1s .28s cubic-bezier(.3, 1.25, .5, 1) backwards, breathe 7s 1.5s ease-in-out infinite; }
@keyframes drop { from { opacity: 0; transform: translateY(-44px) rotate(-7deg) scale(1.08); } }
@keyframes breathe { 50% { transform: translateY(-7px) rotate(.6deg); } }
.oval > svg { -webkit-mask: conic-gradient(#000 var(--sweep), transparent 0); mask: conic-gradient(#000 var(--sweep), transparent 0); animation: sweep 1.5s .75s cubic-bezier(.5, 0, .2, 1) backwards; }
@keyframes sweep { from { --sweep: 0deg; } }
.oval .seal { animation: stamp-in .55s 1.9s cubic-bezier(.3, 1.5, .5, 1) backwards; }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-46deg) scale(2.8); } }
/* حركة خفيفة مع الماوس على الديسكتوب */
.hero-art .paper-a { translate: calc(var(--px, 0) * -16px) calc(var(--py, 0) * -12px); }
.hero-art .paper-b { translate: calc(var(--px, 0) * -8px) calc(var(--py, 0) * -6px); }
.hero-art .oval { translate: calc(var(--px, 0) * 10px) calc(var(--py, 0) * 8px); }
.hero-art > * { transition: translate .4s ease-out; }

.hero h1 span { display: inline-block; animation: rise .8s cubic-bezier(.2, .7, .2, 1) backwards; }
.hero h1 span:nth-child(1) { animation-delay: .45s; }
.hero h1 span:nth-child(2) { animation-delay: .6s; }
.hero h1 span:nth-child(3) { animation-delay: .75s; }
.flourish { width: min(250px, 70%); height: 20px; margin-top: -14px; overflow: visible; }
.flourish path { stroke-dasharray: 1; animation: write 1.3s 1.2s ease-in-out backwards; }
@keyframes write { from { stroke-dashoffset: 1; } }
.hero-copy p { animation: rise .8s .95s backwards; }
.hero-copy .actions { animation: rise .8s 1.1s backwards; }
@keyframes rise { from { opacity: 0; translate: 0 26px; } }

.petals i { position: absolute; width: 13px; height: 19px; border-radius: 50% 0 50% 50%; background: var(--blush); border: 1px solid rgba(176, 138, 62, .6); opacity: 0; pointer-events: none; animation: petal var(--t, 11s) var(--d, 0s) linear infinite; left: var(--x); top: -24px; }
.petals i:nth-child(even) { background: var(--sage); width: 9px; height: 14px; }
@keyframes petal { 0% { opacity: 0; translate: 0 0; rotate: 0deg; } 12% { opacity: .85; } 80% { opacity: .6; } 100% { opacity: 0; translate: var(--drift, -60px) 620px; rotate: 320deg; } }

/* ---------- شريط الجرايد المتحرك ---------- */
body[data-page="home"] main { overflow-x: clip; }
.ribbon { direction: ltr; overflow: hidden;background: var(--newsprint); border-block: 1px solid var(--gold); box-shadow: var(--shadow); rotate: -1.6deg; width: 106%; margin: 6px -3% 10px; }
.ribbon-track { display: flex; width: max-content; animation: run 32s linear infinite; }
.ribbon ul { list-style: none; margin: 0; padding: 0; display: flex; }
.ribbon li { display: flex; align-items: center; gap: 26px; padding: 7px 13px; font: 700 1.2rem/1.6 var(--font-head); white-space: nowrap; direction: rtl; }
.ribbon li::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--twine); border: 1px solid var(--gold); margin-inline-start: 0; }
@keyframes run { to { transform: translateX(-50%); } }

/* ---------- ظهور الأقسام ---------- */
.heading::after { content: ""; height: 2px; width: 70px; background: repeating-linear-gradient(90deg, var(--twine) 0 8px, transparent 8px 11px); transform-origin: right; transition: scale .9s .35s cubic-bezier(.2, .7, .2, 1); }
.js-reveal .heading.reveal:not(.is-in)::after { scale: 0 1; }
.reveal .frame img { transition: transform .6s cubic-bezier(.2, 0, 0, 1), scale 1.5s cubic-bezier(.2, .7, .2, 1); }
.js-reveal .reveal:not(.is-in) .frame img { scale: 1.18; }
.js-reveal .categories .reveal:not(.is-in) { rotate: 5deg; translate: 0 40px; }
.js-reveal .categories .reveal:nth-child(even):not(.is-in) { rotate: -5deg; }
.categories .reveal, .featured .reveal { transition: opacity .6s var(--delay, 0s), translate .8s var(--delay, 0s) cubic-bezier(.2, .7, .2, 1), rotate .9s var(--delay, 0s) cubic-bezier(.3, 1.4, .5, 1); }
.featured .reveal .tag { animation: tag-swing 5s ease-in-out infinite; }
@keyframes tag-swing { 50% { transform: rotate(3.5deg); } }

.js-reveal .process figure:not(.is-in) { translate: 0 50px; rotate: -7deg; }
.js-reveal .process figure:nth-child(2):not(.is-in) { rotate: 7deg; }
.process figure.reveal { transition: opacity .6s, translate .8s cubic-bezier(.2, .7, .2, 1), rotate .9s cubic-bezier(.3, 1.4, .5, 1); }
.js-reveal .process figure.is-in::before { animation: tape .5s .55s backwards; }
@keyframes tape { from { opacity: 0; scale: 1.5; } }

.js-reveal .parcel.is-in .string-h { animation: tie-h .7s .35s backwards; }
.js-reveal .parcel.is-in .string-v { animation: tie-v .7s .75s backwards; }
.js-reveal .parcel.is-in > .seal { animation: press .55s 1.35s cubic-bezier(.3, 1.5, .5, 1) backwards; }

.story { overflow: hidden; }
.story .bird { top: 24px; left: 8%; width: 64px; }
.story hr { transform-origin: right; transition: scale 1s .4s; }
.js-reveal .story .reveal:not(.is-in) hr { scale: 0 1; }

/* لمعة على البرواز وميل خفيف مع الماوس */
.frame > span { position: relative; }
.frame > span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255, 246, 220, .45) 50%, transparent 62%); translate: 120% 0; pointer-events: none; }
@media (hover: hover) {
  a:hover .frame > span::after { translate: -120% 0; transition: translate .9s ease; }
  .tilt .frame { transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out, box-shadow .3s; }
}

/* البراويز في المعرض بتتمرجح مع سرعة السكرول */
.hung .swing { rotate: var(--sway, 0deg); }
.hung:nth-child(even) .swing { rotate: calc(var(--sway, 0deg) * -.7); }

/* زرار WhatsApp العايم بيظهر بعد أول سكرول */
.fab { transition: translate .4s cubic-bezier(.3, 1.4, .5, 1), opacity .3s, visibility .3s; }
.fab:not(.is-on) { translate: 0 90px; opacity: 0; visibility: hidden; }

/* ---------- صفحة القطعة ---------- */
.info > * { animation: rise .6s backwards; }
.info > :nth-child(2) { animation-delay: .07s; }
.info > :nth-child(3) { animation-delay: .14s; }
.info > :nth-child(4) { animation-delay: .21s; }
.info > :nth-child(5) { animation-delay: .28s; }
.info > .stamp { animation: stamp-in .5s .35s cubic-bezier(.3, 1.5, .5, 1) backwards; }

/* ---------- صفحة الطلب ---------- */
.field { position: relative; transition: border-color .3s; }
.field.is-done { border-color: var(--gold); }
.field.is-done::after { content: "✓"; position: absolute; top: -10px; left: -8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--twine); color: var(--cream); border: 2px solid var(--gold); font-weight: 700; font-size: .85rem; animation: stamp-in .4s cubic-bezier(.3, 1.5, .5, 1); }
.gift { transform-origin: 85% -26px; }
.gift.is-nudged { animation: tag-nudge .9s ease-out; }
@keyframes tag-nudge { 25% { transform: rotate(1.6deg); } 55% { transform: rotate(-.9deg); } 80% { transform: rotate(.35deg); } }
.burst { position: absolute; top: 90px; left: 50%; z-index: 3; pointer-events: none; }
.burst i { position: absolute; width: 10px; height: 15px; border-radius: 50% 0 50% 50%; background: var(--rose); opacity: 0; }
.burst i:nth-child(3n) { background: var(--gold); }
.burst i:nth-child(3n + 1) { background: var(--sage); }
dialog[open] .burst i { animation: burst 1.1s 1.5s cubic-bezier(.1, .7, .3, 1); }
@keyframes burst { 0% { opacity: 1; translate: 0 0; rotate: 0deg; } 100% { opacity: 0; translate: var(--x) var(--y); rotate: 260deg; } }

@media (min-width: 720px) {
  .categories { max-width: 860px; margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .petals, .burst { display: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  dialog[open] .wrapping .sheet { display: none; }
  .js-reveal .reveal, .js-reveal .hung:not(.is-in) { opacity: 1; translate: 0 0; }
}
