/* Work index + case-study pages. Loaded after style.css; never restyles the homepage. */
:root {
  --case-line: 1.35;
  --type-case: clamp(56px, 7.4vw + 8px, 128px);
  --type-part: clamp(34px, 2.4vw + 14px, 52px);
  --type-lead: clamp(21px, 0.9vw + 13px, 28px);
}

/* ---------- pixel-sky band (index + case hero) ---------- */
.band {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 132px var(--gutter) 200px;
}
.band canvas.card-sky { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; image-rendering: pixelated; }
.band .intro {
  position: relative; max-width: 920px;
  padding: 36px 40px 40px; border-radius: 28px; background: #fff;
}
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--soft); font-size: 15px; }
.crumb:hover { color: var(--ink); }
.crumb svg { width: 16px; height: 16px; transform: scaleX(-1) rotate(-90deg); }
[dir="rtl"] .crumb svg { transform: rotate(-90deg); }
.status {
  display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0;
  padding: 4px 10px 4px 8px; border-radius: 8px; background: var(--chip);
  color: rgba(0,0,0,.72); font-size: 14px; line-height: 20px;
}
.status i { width: 10px; height: 10px; flex: none; background: var(--sky-deep); }
.status.concept { background: #fde7dc; color: #a8380f; }
.status.gift { background: #fff1d6; color: #7a4a00; }
.status.gift i { background: #e0a21f; }
.band h1 {
  margin: 14px 0 0; font-family: var(--font-hl); font-style: italic; font-weight: 400;
  font-size: var(--type-case); line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance;
}
.band .promise { max-width: 30em; margin: 18px 0 0; font-size: var(--type-lead); line-height: 1.3; text-wrap: pretty; }
.band .tags { margin: 22px 0 0; }

/* ---------- case hero: large desktop shot, phone over its corner ---------- */
.stage-wrap { position: relative; z-index: 2; margin-top: -150px; padding: 0 var(--gutter); }
.stage {
  position: relative; aspect-ratio: 1264 / 660; overflow: hidden;
  border-radius: 28px; background: var(--bg, #f3ede8);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 20px 60px rgba(0,0,0,.08);
}
.stage .shots { --dx: 13%; --dy: 8.5%; --dw: 66%; --mx: 70%; --my: 25%; --mw: 15.5%; }
.stage .shots .sd { border-radius: 10px; }
.stage .shots .sm { border-radius: 18px; border-width: 4px; }
.stage.dark { background: radial-gradient(120% 100% at 30% 0%, #5a2410 0%, #24100a 55%, #120806 100%); }

/* ---------- parts (the 6-part template) ---------- */
.case-body { padding: 96px var(--gutter) 0; }
.part {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  padding: 56px 0; border-top: 1px solid var(--rule);
}
.part:first-child { border-top: 0; padding-top: 24px; }
.part > h2 {
  grid-column: 1 / 5; margin: 0; align-self: start; position: sticky; top: 32px;
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-hl); font-style: italic; font-weight: 400;
  font-size: var(--type-part); line-height: 1.08; letter-spacing: -0.03em;
}
.part > h2 canvas { width: 26px; height: 26px; flex: none; border-radius: 4px; image-rendering: pixelated; }
.part > .body { grid-column: 6 / 13; min-width: 0; }
.lead { margin: 0; font-size: var(--type-lead); line-height: 1.38; text-wrap: pretty; }
.lead + .lead { margin-top: 16px; }

.built { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: b; }
.built li {
  counter-increment: b; display: grid; grid-template-columns: 34px 1fr; gap: 10px;
  padding: 18px 20px; border-radius: 12px; background: var(--card);
  font-size: 17px; line-height: 1.5;
}
.built li::before { content: counter(b, decimal-leading-zero); color: var(--accent); font-size: 14px; font-weight: 500; line-height: 26px; }
.role {
  display: flex; gap: 14px; align-items: flex-start; margin: 16px 0 0;
  padding: 20px; border-radius: 12px; background: #000; color: #fff; font-size: 17px; line-height: 1.5;
}
.role canvas { width: 22px; height: 22px; flex: none; margin-top: 2px; border-radius: 3px; image-rendering: pixelated; }
.role b { display: block; margin-bottom: 2px; color: rgba(255,255,255,.62); font-size: 13px; font-weight: 500; }

.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.num-card { display: flex; flex-direction: column; gap: 14px; padding: 26px 28px 28px; border-radius: 28px; background: #f4f4f5; }
.num-card .what { margin: 0; color: var(--soft); font-size: 15px; line-height: 1.4; }
.num-card .ba {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3em; margin: 0;
  font-family: var(--font-hl); font-style: italic; font-weight: 400;
  font-size: clamp(44px, 3vw + 18px, 68px); line-height: 1.1; letter-spacing: -0.03em;
}
.num-card .ba .to { color: var(--accent); font-style: normal; font-family: var(--font-site); font-size: .55em; }
.num-card .how { margin: 0; padding-top: 14px; border-top: 1px solid var(--rule); color: rgba(0,0,0,.62); font-size: 14px; line-height: 1.5; }
.num-card .how b { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 500; }

.scope { margin: 0; padding: 28px; border-radius: 28px; background: #000; color: #fff; list-style: none; display: grid; gap: 14px; }
.scope li { display: grid; grid-template-columns: 14px 1fr; gap: 14px; font-size: 17px; line-height: 1.5; }
.scope li::before { content: ""; width: 8px; height: 8px; margin-top: 9px; background: var(--sky-deep); box-shadow: 4px 4px 0 var(--sky-mid); }

/* ---------- gallery: real screenshots at inspection size ---------- */
.gallery { padding: 56px 0; border-top: 1px solid var(--rule); }
.gallery > h2 {
  display: flex; align-items: center; gap: 14px; margin: 0 0 32px;
  font-family: var(--font-hl); font-style: italic; font-weight: 400;
  font-size: var(--type-part); line-height: 1.08; letter-spacing: -0.03em;
}
.gallery > h2 canvas { width: 26px; height: 26px; flex: none; border-radius: 4px; image-rendering: pixelated; }
.desk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; margin: 0; padding: 0; list-style: none; }
.desk > li:first-child { grid-column: 1 / -1; }
.phones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; margin: 56px 0 0; padding: 0; list-style: none; }
.desk + .phones, .gallery > .phones:first-of-type { margin-top: 56px; }
.gallery > h2 + .phones { margin-top: 0; }
.shot { margin: 0; }
.shot img { width: 100%; height: auto; background: #f1efed; }
.shot.d img { border-radius: 12px; box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 12px 40px rgba(0,0,0,.08); }
.shot.m img { border-radius: 22px; border: 4px solid #141414; background: #141414; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.shot figcaption { margin-top: 14px; color: var(--faint); font-size: 14px; line-height: 1.45; }
.shot figcaption b { display: block; color: var(--ink); font-size: 15px; font-weight: 500; }
.gallery .note { margin: 32px 0 0; color: var(--faint); font-size: 14px; }

/* ---------- end of page: link, prev/next, WhatsApp ---------- */
.case-end { padding: 40px var(--gutter) 0; }
.live-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 40px 0; border-top: 1px solid var(--rule); }
.live-row .btn svg { width: 18px; height: 18px; }
.live-row .btn { gap: 8px; }
.offline { display: inline-flex; align-items: center; gap: 10px; margin: 0; height: 44px; padding: 0 18px; border-radius: 22px; background: var(--chip); color: var(--soft); font-size: 15px; }
.offline i { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.3); }
.pn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 24px; }
.pn a { display: grid; grid-template-columns: minmax(0, 1fr) 140px; align-items: center; gap: 20px; padding: 14px 14px 14px 24px; border-radius: 20px; background: var(--card); transition: background-color .1s; }
[dir="rtl"] .pn a { padding: 14px 24px 14px 14px; }
.pn a:hover { background: var(--card-hover); }
.pn small { display: block; color: var(--faint); font-size: 13px; }
.pn strong { display: block; margin-top: 2px; font-size: 20px; font-weight: 500; line-height: 1.25; }
.pn .thumb { position: relative; display: block; aspect-ratio: 256 / 171; overflow: hidden; border-radius: 10px; background: var(--bg, #efe6df); }
.pn .thumb .shots { --dx: 12.5%; --dy: 9%; --dw: 66%; --mx: 70.5%; --my: 37%; --mw: 17%; }
.pn .thumb .shots .sd { border-radius: 3px; }
.pn .thumb .shots .sm { border-radius: 5px; border-width: 2px; }

.case-cta { position: relative; isolation: isolate; overflow: hidden; margin: 24px 0 96px; padding: 96px 24px; border-radius: 28px; text-align: center; }
.case-cta canvas.card-sky { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; image-rendering: pixelated; }
.case-cta .panel { display: grid; justify-items: center; gap: 18px; max-width: 560px; margin: 0 auto; padding: 40px 32px; border-radius: 28px; background: #fff; }
.case-cta h2 { margin: 0; font-size: clamp(40px, 3.4vw + 14px, 72px); font-weight: 500; line-height: .95; letter-spacing: -0.01em; }
.case-cta p { max-width: 24rem; margin: 0; color: var(--soft); font-size: 17px; line-height: 1.42; }

/* ---------- work index ---------- */
.index-band { padding-bottom: 120px; }
.index-band h1 { margin-top: 6px; }
.index-band .count { margin: 16px 0 0; color: var(--faint); font-size: 15px; }
.index-body { position: relative; z-index: 2; margin-top: -64px; padding: 0 var(--gutter); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 8px; border-radius: 26px; background: #fff; width: fit-content; max-width: 100%; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.06); }
.filters button {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border: 0; border-radius: 20px; background: #f4f4f5; cursor: pointer; font-size: 15px; font-weight: 500;
  transition: background-color .1s, color .1s;
}
.filters button:hover { background: #ebebec; }
.filters button[aria-pressed="true"] { background: #000; color: #fff; }
.filters button span { color: var(--faint); font-weight: 400; font-size: 13px; }
.filters button[aria-pressed="true"] span { color: rgba(255,255,255,.6); }
.index-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 16px; }
.index-tiles .tile-card strong { font-size: 18px; margin-top: 2px; }
.index-tiles .tile-card .why { font-size: 15px; }
.index-tiles li[hidden] { display: none; }
.index-empty { margin: 0; color: var(--faint); }

/* ---------- Arabic ---------- */
[dir="rtl"] .band h1, [dir="rtl"] .part > h2, [dir="rtl"] .gallery > h2, [dir="rtl"] .case-cta h2 {
  font-family: var(--font-hl); font-style: normal; font-weight: 900; line-height: 1.38;
}
[dir="rtl"] .band h1 { font-size: clamp(52px, 6.6vw + 8px, 112px); line-height: 1.38; padding-block: .04em; }
[dir="rtl"] .band .promise, [dir="rtl"] .lead { line-height: 1.7; }
[dir="rtl"] .built li, [dir="rtl"] .role, [dir="rtl"] .scope li { line-height: 1.75; }
[dir="rtl"] .num-card .ba { font-family: var(--font-site); font-weight: 700; line-height: 1.35; }
[dir="rtl"] .num-card .ba .to { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .num-card .how, [dir="rtl"] .shot figcaption { line-height: 1.7; }
[dir="rtl"] .pn strong { font-weight: 700; }
[dir="rtl"] .case-cta h2 { line-height: 1.38; }
[dir="rtl"] .index-tiles .tile-card .why { line-height: 1.6; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .part > h2 { grid-column: 1 / -1; position: static; margin-bottom: 24px; }
  .part > .body { grid-column: 1 / -1; }
  .index-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 900px) {
  .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
  .pn { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .band { padding: 96px 16px 150px; }
  .band .intro { padding: 24px 22px 26px; border-radius: 24px; }
  .stage-wrap { margin-top: -110px; padding: 0 16px; }
  .stage { aspect-ratio: 342 / 300; border-radius: 24px; }
  .stage .shots { --dx: 6.5%; --dy: 9%; --dw: 76%; --mx: 71.5%; --my: 34%; --mw: 22%; }
  .stage .shots .sm { border-radius: 12px; border-width: 3px; }
  .case-body { padding: 56px 16px 0; }
  .part { padding: 40px 0; }
  .built li { grid-template-columns: 28px 1fr; padding: 16px; font-size: 16px; }
  .role, .scope li { font-size: 16px; }
  .scope { padding: 22px; border-radius: 24px; }
  .num-card { padding: 22px; border-radius: 24px; }
  .gallery { padding: 40px 0; }
  .shot.m img { border-radius: 16px; border-width: 3px; }
  .shot figcaption { font-size: 13px; }
  .case-end { padding: 24px 16px 0; }
  .pn a { grid-template-columns: minmax(0, 1fr) 104px; padding-inline-start: 18px; }
  .pn strong { font-size: 17px; }
  .case-cta { padding: 56px 14px; border-radius: 24px; }
  .case-cta .panel { padding: 30px 20px; }
  .index-band { padding-bottom: 96px; }
  .index-body { margin-top: -48px; padding: 0 16px; }
  .filters { gap: 6px; padding: 6px; border-radius: 24px; }
  .filters button { height: 38px; padding: 0 13px; font-size: 14px; }
  .index-tiles { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 380px) {
  .filters button span { display: none; }
}
.crumb { width: fit-content; }
.status { display: flex; width: fit-content; }
.live-row .url { color: var(--faint); font-size: 15px; }
.num-card .ba .a { display: inline-flex; align-items: baseline; gap: .3em; white-space: nowrap; }
.num-card .ba .b { white-space: nowrap; }
.num-card .ba.long { font-size: clamp(36px, 2vw + 16px, 50px); }
