/* عطور — public site
   Layout: a private gallery — one centered column of generous rooms, cream walls, deep-red lettering;
   the signature travels from the wall to the corner. */

:root {
  --bg: #f5dec5;          /* main cream */
  --bg-alt: #eccdad;      /* deeper band */
  --bg-soft: #f9e9d7;     /* lighter band */
  --well: #fcf2e6;        /* inputs, image wells */
  --red: #720000;         /* brand red */
  --red-2: #5e1410;       /* labels */
  --text: #4a1410;        /* body text */
  --muted: #7a4c40;
  --line: rgba(114, 0, 0, .26);
  --faint: rgba(114, 0, 0, .07);
  --error: #b8440c;
  --on-red: #f5dec5;

  --display: "Shiyam", "Aref Ruqaa Ink", "Amiri", serif;
  --body: "Shiyam", system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --navh: 72px;
  --gutL: max(16px, env(safe-area-inset-left, 0px));
  --gutR: max(16px, env(safe-area-inset-right, 0px));
  --safeT: env(safe-area-inset-top, 0px);
  --safeB: env(safe-area-inset-bottom, 0px);
  --space: clamp(64px, 10vw, 128px);
  color-scheme: light;
}
@media (max-width: 640px) { :root { --navh: 60px; } }
@media (max-height: 520px) and (orientation: landscape) { :root { --navh: 52px; --space: 48px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); font-weight: 400;
  font-size: clamp(16px, 0.9rem + 0.35vw, 19px); line-height: 1.9;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: var(--safeT); z-index: 60; background: var(--bg); }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: -100px; right: 16px; z-index: 100; background: var(--red); color: var(--on-red); padding: 8px 14px; }
.skip:focus { top: calc(var(--safeT) + 8px); }

.wrap { max-width: 1160px; margin-inline: auto; padding-left: var(--gutL); padding-right: var(--gutR); }
.narrow { max-width: 780px; }
.center { text-align: center; }
.mt { margin-top: clamp(40px, 7vw, 88px); }

h1, h2, h3 { font-family: var(--display); color: var(--red); font-weight: 700; font-variation-settings: "SWSH" 10; text-wrap: balance; margin: 0; line-height: 1.5; }
.title { font-size: clamp(1.8rem, 1.2rem + 3vw, 3.3rem); text-align: center; }
.page-title { font-size: clamp(2rem, 1.3rem + 3.6vw, 3.6rem); }
.lead { text-align: center; color: var(--muted); margin: .6rem auto 0; max-width: 48ch; }
.lead.strong { color: var(--text); max-width: 54ch; }

.band { padding-block: var(--space); }
.alt { background: var(--bg-alt); }
.alt2 { background: var(--bg-soft); }

.orn { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px auto 0; }
.orn::before, .orn::after { content: ""; height: 1px; width: min(120px, 22vw); background: linear-gradient(to left, transparent, var(--line)); }
.orn::after { background: linear-gradient(to right, transparent, var(--line)); }
.orn i { width: 12px; height: 12px; border: 1px solid var(--red); transform: rotate(45deg); position: relative; }
.orn i::after { content: ""; position: absolute; inset: 3px; background: var(--red); }

/* ---------- navigation ---------- */
.nav {
  position: fixed; top: var(--safeT); inset-inline: 0; height: var(--navh); z-index: 50;
  display: flex; align-items: center; padding-left: var(--gutL); padding-right: var(--gutR);
  transition: background .5s, box-shadow .5s;
}
.nav.solid { background: rgba(245, 222, 197, .95); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.nav nav { display: flex; align-items: center; }
.nav ul { list-style: none; display: flex; gap: clamp(14px, 3vw, 36px); margin: 0; padding: 0; }
.nav a { display: inline-block; font-size: clamp(15px, 1.5vw, 17px); color: var(--red-2); text-decoration: none; padding: 10px 2px; border-bottom: 1px solid transparent; transition: color .3s, border-color .3s; }
.nav a[aria-current="page"] { color: var(--red); border-color: var(--red); font-weight: 600; }
@media (hover: hover) { .nav a:hover { color: var(--red); } }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--well); border-radius: 50%; color: var(--red); cursor: pointer; place-items: center; }
.menu-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
@media (max-width: 420px) {
  .menu-btn { display: grid; }
  .nav ul {
    position: absolute; top: calc(var(--navh) - 4px); right: var(--gutR);
    flex-direction: column; gap: 0; min-width: 190px; padding: 8px;
    background: var(--well); border: 1px solid var(--line); box-shadow: 0 18px 40px -18px rgba(74, 20, 16, .45);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .25s, transform .25s, visibility .25s;
  }
  .nav.open ul { opacity: 1; visibility: visible; transform: none; }
  .nav a { display: block; padding: 12px 14px; border: 0; }
  .nav a[aria-current="page"] { background: var(--faint); }
}

/* ---------- signature ---------- */
#sig { position: fixed; top: 0; left: 0; z-index: 55; transform-origin: 0 0; will-change: transform; cursor: pointer; background: none; border: 0; padding: 0; }
#sig .mask {
  width: 100%; height: 100%;
  background: linear-gradient(115deg, #4f0000 0%, var(--red) 35%, #8c1a10 52%, var(--red) 70%, #4f0000 100%);
  -webkit-mask: var(--sig) center / contain no-repeat; mask: var(--sig) center / contain no-repeat;
}
#sig img { width: 100%; height: 100%; object-fit: contain; }
#sig img.tinted { filter: brightness(0) saturate(100%) invert(9%) sepia(94%) saturate(4719%) hue-rotate(356deg) brightness(78%) contrast(118%); }
.hero { height: 100vh; height: 100svh; min-height: 320px; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 50% 46%, var(--bg-soft) 0%, var(--bg) 55%, var(--bg-alt) 100%); }
.hero .frame { position: absolute; inset: calc(var(--safeT) + clamp(12px, 3vw, 34px)) clamp(12px, 3vw, 34px) calc(var(--safeB) + clamp(12px, 3vw, 34px)); border: 1px solid var(--line); pointer-events: none; }
.hero .frame::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--faint); }
.cue { position: absolute; bottom: calc(36px + var(--safeB)); left: 50%; width: 1px; height: 54px; background: linear-gradient(var(--red), transparent); transform: translateX(-50%); animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 0%, 100% { opacity: .25; transform: translate(-50%, 0); } 50% { opacity: .9; transform: translate(-50%, 8px); } }
@media (max-height: 520px) and (orientation: landscape) { .cue { display: none; } }

.page-top { padding-top: calc(var(--navh) + var(--safeT) + clamp(36px, 6vw, 90px)); padding-bottom: var(--space); }

/* ---------- home ---------- */
.intro-text { font-family: var(--display); font-weight: 600; font-variation-settings: "SWSH" 10; font-size: clamp(1.5rem, 1rem + 2.6vw, 3rem); color: var(--red); text-align: center; line-height: 1.75; max-width: 24ch; margin: 0 auto; text-wrap: balance; }
.pair { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(14px, 3vw, 32px); margin-top: clamp(40px, 7vw, 80px); align-items: end; }
.pair .slot:nth-child(2) { margin-bottom: clamp(24px, 6vw, 72px); }
@media (max-width: 600px) and (orientation: portrait) { .pair { grid-template-columns: 1fr; } .pair .slot:nth-child(2) { margin-bottom: 0; } }

.slot { margin: 0; position: relative; background: var(--well); border: 1px solid var(--line); overflow: hidden; max-width: 100%; }
.slot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.slot.fit img { object-fit: contain; }
.ph { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 16px; color: var(--red);
  background: repeating-linear-gradient(45deg, transparent 0 14px, var(--faint) 14px 15px), var(--well); }
.ph b { font-family: "Aref Ruqaa Ink", serif; font-size: clamp(2.2rem, 7vw, 4.5rem); line-height: 1; opacity: .5; font-weight: 400; }
.ph span { font-size: 14px; color: var(--muted); }
.r43 { aspect-ratio: 4/3; } .r34 { aspect-ratio: 3/4; } .r45 { aspect-ratio: 4/5; } .r169 { aspect-ratio: 16/9; }
@media (max-width: 600px) { .r169 { aspect-ratio: 4/3; } }

.about { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; margin-top: clamp(32px, 6vw, 64px); }
.about .copy { min-width: 0; }
.about p { margin: 0 0 1.4em; font-size: clamp(17px, 1rem + .4vw, 21px); line-height: 2.1; }
@media (max-width: 820px) and (orientation: portrait), (max-width: 640px) { .about { grid-template-columns: 1fr; } .about .slot { max-width: 520px; margin-inline: auto; width: 100%; } }

.featured { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2.5vw, 28px); margin-top: clamp(32px, 6vw, 64px); }
.featured .slot:nth-child(2) { transform: translateY(clamp(0px, 3vw, 40px)); }
@media (max-width: 680px) and (orientation: portrait) {
  .featured { grid-template-columns: 1fr; } .featured .slot:nth-child(2) { transform: none; }
  .featured .slot { max-width: 520px; width: 100%; margin-inline: auto; }
}
.zoom { cursor: zoom-in; }
.zoom::after { content: ""; position: absolute; inset: 10px; border: 1px solid var(--line); opacity: 0; transition: opacity .5s; pointer-events: none; }
@media (hover: hover) { .zoom:hover img { transform: scale(1.035); } .zoom:hover::after { opacity: 1; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; font-family: var(--body); font-weight: 600; font-size: 17px; padding: 12px 32px; border-radius: 2px; border: 1px solid var(--red);
  background: linear-gradient(135deg, #560000, var(--red) 50%, #86140c); color: var(--on-red); text-decoration: none; cursor: pointer; transition: transform .3s, box-shadow .3s; }
@media (hover: hover) { .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -12px rgba(114, 0, 0, .55), 0 0 0 4px var(--faint); } }
.btn.ghost { background: transparent; color: var(--red); }
@media (hover: hover) { .btn.ghost:hover { background: var(--faint); } }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

.quote { font-family: var(--display); font-variation-settings: "SWSH" 6; font-size: clamp(1.2rem, 1rem + 1.4vw, 1.9rem); text-align: center; color: var(--red-2); margin: 1.2rem 0 0; font-weight: 400; }
.quote b { color: var(--red); font-weight: 800; }
.vision-text { margin-top: clamp(28px, 5vw, 48px); font-size: clamp(17px, 1rem + .4vw, 21px); line-height: 2.1; text-align: center; }
.vision-text p { margin: 0 0 1.2em; }
.vision-text p:last-child { font-family: var(--display); color: var(--red); font-size: 1.25em; font-weight: 600; }

.steps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px clamp(20px, 6vw, 72px); padding: 0; margin: clamp(28px, 5vw, 52px) 0; }
.steps li { display: flex; align-items: center; gap: 14px; font-family: var(--display); font-weight: 600; font-size: clamp(1.15rem, 1rem + .8vw, 1.6rem); color: var(--red-2); }
.steps .n { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--red); transform: rotate(45deg); color: var(--red); font-size: 18px; }
.steps .n span { transform: rotate(-45deg); }

.closing { position: relative; overflow: hidden; background: var(--bg-soft); padding-block: clamp(96px, 16vw, 200px); }
.closing canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.closing .inner { position: relative; text-align: center; }
.closing h2 { font-size: clamp(2.1rem, 1.2rem + 4.5vw, 4.6rem); }
.closing p { font-family: var(--display); font-weight: 500; font-size: clamp(1.1rem, 1rem + 1vw, 1.75rem); color: var(--red-2); margin: 1rem 0 0; }

/* ---------- footer ---------- */
.foot-band { background: var(--bg-alt); border-top: 1px solid var(--line); padding-block: 44px calc(32px + var(--safeB)); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.social { display: flex; flex-wrap: wrap; gap: 12px 22px; list-style: none; padding: 0; margin: 0; }
.social a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--red-2); font-size: 15px; }
.social .ic { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; transition: background .3s, border-color .3s; }
@media (hover: hover) { .social a:hover .ic { background: var(--faint); border-color: var(--red); } }
.social svg { width: 18px; height: 18px; fill: var(--red); }
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.copy-r { font-size: 14px; color: var(--muted); margin: 0; }
.copy-r strong { font-family: var(--display); color: var(--red); font-size: 22px; font-weight: 700; display: block; }
.copy-r small { font-size: 12px; opacity: .8; }

/* ---------- portfolio ---------- */
.works { display: grid; gap: clamp(64px, 11vw, 140px); margin-top: clamp(40px, 8vw, 96px); }
.work { display: grid; gap: 18px; justify-items: center; }
.work .slot { width: 100%; max-width: 1000px; background: var(--well); }
.work .slot img { height: auto; max-height: min(82vh, 82svh); object-fit: contain; margin-inline: auto; }
.work .slot.empty { aspect-ratio: 3/2; }
.work h2 { font-size: clamp(1.4rem, 1rem + 1.8vw, 2.1rem); text-align: center; }
.work p { margin: 0; max-width: 60ch; text-align: center; color: var(--muted); }
.work .idx { font-size: 13px; color: var(--red); opacity: .75; }
@media (max-height: 520px) and (orientation: landscape) { .work .slot img { max-height: 78svh; } }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--text); }
dialog::backdrop { background: rgba(60, 20, 12, .45); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(252, 242, 230, .92); color: var(--red); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.lb { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; background: rgba(245, 222, 197, .98);
  display: none; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px;
  padding: calc(10px + var(--safeT)) var(--gutR) calc(12px + var(--safeB)) var(--gutL); }
.lb[open] { display: grid; }
.lb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lb-stage { display: grid; place-items: center; min-height: 0; position: relative; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 80px -30px rgba(74, 20, 16, .6); }
.lb-cap { text-align: center; font-family: var(--display); color: var(--red); font-size: 1.25rem; min-height: 1.6em; margin: 0; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { right: 0; } .lb-next { left: 0; }
.lb-count { font-size: 14px; color: var(--muted); }

/* design picker: a sheet that scrolls inside itself */
.sheet { width: min(980px, calc(100vw - 24px)); max-height: min(86vh, 86dvh); margin: auto; background: var(--bg); border: 1px solid var(--red);
  display: none; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.sheet[open] { display: grid; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.sheet-head h3 { font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem); }
.sheet-head .hint { margin: 2px 0 0; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 18px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 42vw), 1fr)); gap: 14px; align-content: start; }
.sheet-foot { display: flex; justify-content: flex-start; gap: 10px; padding: 12px 20px calc(12px + var(--safeB)); border-top: 1px solid var(--line); background: var(--bg-soft); flex-wrap: wrap; }
.sheet-foot .btn { min-width: 140px; }
@media (max-width: 600px) {
  .sheet { width: 100vw; max-width: 100vw; max-height: 88dvh; margin: auto 0 0; border-width: 1px 0 0; }
  .sheet-head { padding: 14px 16px 10px; } .sheet-body { padding: 14px 16px; gap: 10px; } .sheet-foot { padding-inline: 16px; }
  .sheet-foot { flex-wrap: nowrap; }
  .sheet-foot .btn { flex: 1; min-width: 0; padding-inline: 12px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .sheet { max-height: 96dvh; } .sheet-body { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
.design { position: relative; display: grid; cursor: pointer; }
.design input { position: absolute; opacity: 0; pointer-events: none; }
.design .card .vis { aspect-ratio: 3/4; }
.design .zoom-btn { position: absolute; top: 8px; left: 8px; width: 36px; height: 36px; z-index: 2; }
.design .zoom-btn svg { width: 16px; height: 16px; }
.chosen-design { margin-top: 14px; display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--red); background: var(--well); flex-wrap: wrap; }
.chosen-design img, .chosen-design .ph-mini { width: 64px; height: 80px; object-fit: cover; border: 1px solid var(--line); flex: none; background: var(--bg-soft); }
.chosen-design .txt { flex: 1; min-width: 140px; }
.chosen-design .txt b { display: block; color: var(--red); }
.chosen-design .txt span { font-size: 14px; color: var(--muted); }

/* ---------- order form ---------- */
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(290px, 30vw, 360px); gap: clamp(20px, 4vw, 48px); align-items: start; margin-top: clamp(32px, 6vw, 64px); }
.order-main { min-width: 0; }
@media (max-width: 1000px), (max-height: 640px) and (orientation: landscape) { .order-grid { grid-template-columns: minmax(0, 1fr); } }
.fs { border: 1px solid var(--line); background: rgba(252, 242, 230, .55); padding: clamp(16px, 3.5vw, 36px); margin: 0 0 20px; min-width: 0; }
.fs legend { font-family: var(--display); font-weight: 700; font-size: clamp(1.2rem, 1rem + 1vw, 1.75rem); color: var(--red); padding-inline: 10px; margin-inline-start: -10px; line-height: 1.4; }
.req { color: var(--red); font-size: 13px; margin-inline-start: 6px; font-weight: 600; font-family: var(--body); }
.opt { color: var(--muted); font-size: 13px; margin-inline-start: 6px; font-family: var(--body); }
.field { display: grid; gap: 8px; margin-top: 16px; min-width: 0; }
.field.flush { margin-top: 0; }
.field label { font-size: 15px; color: var(--red-2); }
.inp { width: 100%; background: var(--well); border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px; font-size: 16px; color: var(--text); min-height: 48px; transition: border-color .25s, box-shadow .25s; text-align: start; }
.inp[dir="ltr"] { text-align: left; }
textarea.inp { min-height: 120px; resize: vertical; line-height: 1.8; }
textarea.big { min-height: 150px; font-size: clamp(17px, 1rem + .3vw, 20px); }
textarea.short { min-height: 88px; }
.inp::placeholder { color: rgba(122, 76, 64, .55); }
.inp:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--faint); }
.inp[aria-invalid="true"] { border-color: var(--error); }
.err { color: var(--error); font-size: 14px; margin: 6px 0 0; }
.err:empty { display: none; }
.hint { font-size: 14px; color: var(--muted); margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

/* selectable cards */
.choices { display: grid; gap: 12px; margin-top: 16px; }
.choice { position: relative; display: grid; cursor: pointer; min-width: 0; }
.choice input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.card { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); background: var(--well); transition: border-color .25s, box-shadow .25s, transform .25s; height: 100%; min-width: 0; }
@media (hover: hover) { .choice:hover .card { border-color: rgba(114, 0, 0, .55); transform: translateY(-2px); } }
.choice input:focus-visible + .card { outline: 2px solid var(--red); outline-offset: 3px; }
.choice input:checked + .card { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 0 5px var(--faint); }
.card .vis { aspect-ratio: 4/3; position: relative; overflow: hidden; display: grid; place-items: center; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.card .vis img { width: 100%; height: 100%; object-fit: cover; }
.card .cap { padding: 10px 8px; text-align: center; font-family: var(--display); font-weight: 600; font-size: clamp(.95rem, .85rem + .4vw, 1.15rem); color: var(--red-2); display: flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.4; min-width: 0; }
.card .cap .t { min-width: 0; overflow-wrap: anywhere; }
.choice input:checked + .card .cap { color: var(--red); }
.tick { width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--well); }
.choice input:checked + .card .tick { background: var(--red); border-color: var(--red); }
.choice input:checked + .card .tick::after { content: ""; width: 6px; height: 10px; border: solid var(--on-red); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.sample { font-size: clamp(1.2rem, 1rem + 1.4vw, 2rem); color: var(--red); line-height: 1.6; padding: 6px; text-align: center; }
.s-naskh { font-family: "Amiri", serif; }
.s-ruqaa { font-family: "Aref Ruqaa Ink", serif; }
.s-ph { font-size: 13px; color: var(--muted); padding: 8px; text-align: center; }

/* calligraphy styles: the styles share one row; "اقترح علي" gets its own row */
.styles { display: grid; gap: 12px; margin-top: 16px; }
.style-row { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 14px); }
.style-row .sample { font-size: clamp(1rem, 5.2vw, 2rem); white-space: nowrap; }
@media (max-width: 400px) {
  .style-row .card .cap { font-size: .92rem; padding: 8px 4px; }
  .style-row .tick { display: none; }
  .style-row .choice input:checked + .card .cap { text-decoration: underline; text-underline-offset: 6px; }
}
.suggest .card { grid-template-rows: none; grid-template-columns: clamp(96px, 22vw, 180px) minmax(0, 1fr); }
.suggest .card .vis { aspect-ratio: auto; min-height: 96px; border-bottom: 0; border-inline-end: 1px solid var(--line); }
.suggest .card .cap { justify-content: flex-start; padding: 14px 18px; text-align: start; flex-wrap: wrap; }
.suggest .card .cap small { display: block; width: 100%; font-family: var(--body); font-weight: 400; font-size: 14px; color: var(--muted); }

/* inks */
.inks { grid-template-columns: repeat(auto-fill, minmax(min(110px, 28vw), 1fr)); }
.inks .card { grid-template-rows: auto auto; }
.inks .card .vis { aspect-ratio: auto; padding: 18px 8px 4px; border: 0; background: transparent; }
.swatch { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .3); }
.choice input:checked + .card .swatch { border-color: var(--red); }

/* sizes */
.sizes { grid-template-columns: repeat(auto-fill, minmax(min(150px, 36vw), 1fr)); }
.sizes .card .vis svg { width: 70%; height: 80%; }
.sizes .count { display: block; font-family: var(--body); font-weight: 400; font-size: 12px; color: var(--muted); }

.cond { margin-top: 16px; padding: 16px; border-inline-start: 2px solid var(--red); background: var(--faint); }
.cond .note { font-family: var(--display); font-weight: 700; color: var(--red); font-size: 1.2rem; margin: 0; }
.cond-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 18px; align-items: start; }
.cond-fields { min-width: 0; }
@media (max-width: 560px) { .cond-row { grid-template-columns: 1fr; } .cond-row .slot { max-width: 220px; } }

/* summary */
.summary { position: sticky; top: calc(var(--navh) + var(--safeT) + 20px); border: 1px solid var(--red); background: var(--bg-soft); padding: clamp(18px, 3vw, 26px); max-height: calc(100vh - var(--navh) - var(--safeT) - 40px); overflow-y: auto; }
@media (max-width: 1000px), (max-height: 640px) and (orientation: landscape) { .summary { position: static; max-height: none; } }
.summary h3 { font-size: 1.5rem; text-align: center; }
.summary dl { margin: 16px 0 0; display: grid; gap: 12px; }
.summary dt { font-size: 13px; color: var(--red); font-weight: 600; }
.summary dd { margin: 2px 0 0; font-size: 15px; color: var(--text); overflow-wrap: anywhere; white-space: pre-line; unicode-bidi: plaintext; text-align: start; }
.summary dd.empty { color: rgba(122, 76, 64, .55); }
.summary .phrase { font-size: 18px; }
.summary hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.submit-row { display: grid; gap: 12px; justify-items: center; margin-top: 20px; }
.submit-row .btn { width: 100%; font-size: 19px; min-height: 54px; }
.fail { border: 1px solid var(--error); padding: 16px; display: grid; gap: 12px; justify-items: center; text-align: center; font-size: 15px; width: 100%; }
.done { border: 1px solid var(--red); background: var(--bg-soft); padding: clamp(28px, 6vw, 64px); text-align: center; display: grid; gap: 20px; justify-items: center; }
.done:focus { outline: none; }
.done .seal { width: 80px; height: 80px; border: 1px solid var(--red); transform: rotate(45deg); display: grid; place-items: center; }
.done .seal svg { transform: rotate(-45deg); width: 36px; height: 36px; stroke: var(--red); fill: none; stroke-width: 1.6; }
.done p { font-family: var(--display); font-weight: 700; font-size: clamp(1.2rem, 1rem + 1.4vw, 1.8rem); color: var(--red); margin: 0; max-width: 30ch; }
.spin { width: 18px; height: 18px; border: 2px solid rgba(245, 222, 197, .35); border-top-color: var(--on-red); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* very small / folded phones */
@media (max-width: 320px) {
  :root { --gutL: max(12px, env(safe-area-inset-left, 0px)); --gutR: max(12px, env(safe-area-inset-right, 0px)); }
  .fs { padding: 14px 12px; }
}
/* dual-screen foldables: keep content off the hinge on the order page */
@media (horizontal-viewport-segments: 2) {
  .order-grid { grid-template-columns: minmax(0, env(viewport-segment-width 0 0, 1fr)) minmax(0, 1fr); column-gap: calc(env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px) + 24px); }
  .summary { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
@media print { .nav, #sig, .foot-band, .submit-row { display: none; } }
