/* Case-study pages (/work/<project>/). Each page sets its client's colours on .case:
   --c1 main brand colour, --c2 accent, --c3 light, --c4 dark, --on1 text on --c1. Himam's own red only appears in the header, the call to action and the footer. */
.case{--c1:#242021;--c2:#8C0031;--c3:#FFEEE6;--c4:#242021;--on1:#fff;overflow:hidden}
.case section{position:relative}
.case .lbl{font-family:var(--display);font-weight:500;font-size:13px;letter-spacing:.08em;text-transform:uppercase;opacity:.7}
html[dir="rtl"] .case .lbl{letter-spacing:0;text-transform:none}

/* Hero: the client's colour, their logo large, the facts underneath */
.cs-hero{background:var(--c1);color:var(--on1);min-height:min(92svh,920px);display:grid;grid-template-rows:auto 1fr auto;isolation:isolate}
.cs-hero .back{padding-top:22px;font-family:var(--display);font-size:14px}
.cs-hero .back a{text-decoration:none;opacity:.8}
.cs-hero .back a:hover{opacity:1}
.cs-hero .stage{display:grid;place-items:center;padding-block:40px}
.cs-hero .stage svg{width:min(78vw,640px);height:auto;display:block}
.cs-hero .bgimg{position:absolute;inset:0;z-index:-1;background-size:cover;background-position:center;opacity:.09;mix-blend-mode:luminosity}
.cs-hero .facts{display:grid;grid-template-columns:minmax(0,1.4fr) repeat(3,minmax(0,1fr));gap:24px;padding-block:28px 34px;border-top:1px solid color-mix(in srgb,var(--on1) 28%,transparent)}
.cs-hero h1{font-weight:500;font-size:clamp(30px,4vw,54px);line-height:1.15}
.cs-hero .facts div{display:grid;align-content:end;gap:2px}
.cs-hero .facts b{font-family:var(--display);font-weight:500;font-size:clamp(15px,1.3vw,18px)}

/* Intro */
.cs-intro{padding-block:clamp(64px,10vw,140px)}
.cs-intro .in{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:clamp(32px,6vw,96px);align-items:start}
.cs-intro h2{font-weight:500;font-size:clamp(26px,3.4vw,46px);line-height:1.35}
html[lang="en"] .cs-intro h2{line-height:1.18}
.cs-intro h2 em{font-style:normal;color:var(--c2)}
.cs-intro p{margin-top:22px;color:var(--muted);font-size:clamp(17px,1.4vw,19px);max-width:34em}
.cs-intro ul{list-style:none;margin:0;padding:0;border-top:2px solid var(--ink)}
.cs-intro li{display:flex;justify-content:space-between;gap:12px;padding:13px 0;border-bottom:1px solid var(--line);font-family:var(--display);font-weight:500}
.cs-intro li span{color:var(--muted);font-family:var(--body);font-weight:400;font-variant-numeric:tabular-nums}

/* Logo on its backgrounds */
.cs-logos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(8px,1vw,14px);padding-inline:clamp(8px,1vw,14px)}
.cs-logos > div{aspect-ratio:4/3;display:grid;place-items:center;border-radius:clamp(10px,1.4vw,18px);overflow:hidden}
.cs-logos > div.wide{grid-column:span 2;aspect-ratio:21/9}
.cs-logos svg{width:56%;height:auto;max-height:60%}
.cs-logos > div.wide svg{width:40%}

/* Palette */
.cs-pal{padding-block:clamp(64px,9vw,120px)}
.cs-pal .row{display:grid;grid-template-columns:2.2fr 1.4fr 1fr 1fr;gap:clamp(8px,1vw,14px);height:clamp(260px,34vw,440px)}
.cs-pal .sw{border-radius:clamp(10px,1.4vw,18px);padding:clamp(14px,1.6vw,22px);display:flex;flex-direction:column;justify-content:flex-end;gap:2px;transform-origin:bottom}
.cs-pal .sw b{font-family:var(--display);font-weight:500;font-size:clamp(15px,1.4vw,19px)}
.cs-pal .sw code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;opacity:.8;direction:ltr;text-align:start}
.cs-pal .sw.line{box-shadow:inset 0 0 0 1px var(--line)}

/* Big bleed images */
.cs-bleed{margin:0;position:relative;overflow:hidden}
.cs-bleed img{display:block;width:100%;height:auto}
.cs-bleed.crop img{height:clamp(320px,56vw,820px);object-fit:cover}
.cs-bleed figcaption{position:absolute;inset:auto auto 18px 18px;background:rgba(36,32,33,.6);color:#fff;backdrop-filter:blur(8px);font-size:13px;padding:6px 12px;border-radius:999px;font-family:var(--display)}
html[dir="rtl"] .cs-bleed figcaption{inset:auto 18px 18px auto}

/* Two-up: text beside an image */
.cs-two{padding-block:clamp(64px,9vw,120px)}
.cs-two .in{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(12px,1.4vw,18px);align-items:stretch}
.cs-two figure{margin:0;border-radius:clamp(10px,1.4vw,18px);overflow:hidden;position:relative;min-height:320px}
.cs-two figure img{width:100%;height:100%;object-fit:cover;display:block}
.cs-two .tile{display:grid;place-items:center}
.cs-two .tile svg{width:62%;height:auto}
.cs-two .tag{position:absolute;inset:16px auto auto 16px;font-family:var(--display);font-size:13px;padding:5px 12px;border-radius:999px;background:rgba(255,255,255,.88);color:var(--ink)}
html[dir="rtl"] .cs-two .tag{inset:16px 16px auto auto}
.cs-head{display:flex;align-items:baseline;justify-content:space-between;gap:20px;margin-bottom:clamp(24px,3vw,40px)}
.cs-head h2{font-weight:500;font-size:clamp(24px,2.8vw,38px)}
.cs-head p{color:var(--muted);max-width:28em}

/* Stationery on a desk */
.cs-desk{background:var(--c3);padding-block:clamp(70px,10vw,150px);overflow:hidden}
.cs-desk .in{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(24px,5vw,80px);align-items:center}
.cs-desk .sheet{position:relative;justify-self:center;width:min(100%,520px);aspect-ratio:1787/2526}
.cs-desk .sheet img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:3px;box-shadow:0 2px 3px rgba(0,0,0,.08),0 40px 70px -24px rgba(36,32,33,.45)}
.cs-desk .sheet img.under{transform:rotate(-7deg) translate(-9%,3%);filter:brightness(.97)}
.cs-desk .sheet img.over{transform:rotate(3deg)}
.cs-desk h2{font-weight:500;font-size:clamp(24px,2.8vw,38px)}
.cs-desk p{color:var(--muted);margin-top:14px;max-width:26em}

/* Phones */
.cs-phones{background:var(--c4);color:#fff;padding-block:clamp(70px,10vw,150px);overflow:hidden}
.cs-phones .cs-head p{color:rgba(255,255,255,.72)}
.phones{display:flex;justify-content:center;align-items:flex-end;gap:clamp(12px,3vw,44px)}
.phone{width:clamp(150px,21vw,290px);aspect-ratio:9/19;border-radius:clamp(22px,3vw,42px);background:#0e0e0f;padding:clamp(6px,.8vw,10px);box-shadow:0 50px 80px -40px rgba(0,0,0,.7),inset 0 0 0 1.5px rgba(255,255,255,.14);position:relative;flex:none}
.phone::before{content:"";position:absolute;top:clamp(12px,1.6vw,20px);left:50%;width:28%;height:clamp(14px,1.8vw,24px);background:#0e0e0f;border-radius:999px;transform:translateX(-50%);z-index:2}
.phone .scr{width:100%;height:100%;border-radius:clamp(16px,2.3vw,33px);overflow:hidden;position:relative;background:#fff}
.phone .scr img{width:100%;height:100%;object-fit:cover;display:block}
.phone .scr .ov{position:absolute;inset:0;display:grid;justify-items:center;align-content:start;padding-top:24%}
.phone .scr .ov svg{width:66%;height:auto}
.phone:nth-child(2){transform:translateY(-8%)}

/* Social posts grid */
.posts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(8px,1vw,14px)}
.post{aspect-ratio:4/5;border-radius:clamp(8px,1vw,14px);overflow:hidden;position:relative}
.post img{width:100%;height:100%;object-fit:cover;display:block}
.post .ov{position:absolute;inset:0;display:grid;place-items:center;align-content:center;gap:clamp(8px,1.2vw,16px);padding:12%;text-align:center}
.post .ov svg{width:58%;height:auto}
.post .ov span{font-family:"IBM Plex Sans Arabic",var(--body);font-weight:500;font-size:clamp(12px,1.4vw,20px);line-height:1.5}

/* Highlight covers */
.hls{display:flex;justify-content:center;gap:clamp(14px,3vw,40px);flex-wrap:wrap}
.hls figure{margin:0;display:grid;justify-items:center;gap:10px}
.hls .ring{width:clamp(84px,11vw,150px);aspect-ratio:1;border-radius:50%;padding:4px;background:conic-gradient(var(--c2),var(--c1),var(--c2))}
.hls .ring div{width:100%;height:100%;border-radius:50%;border:4px solid #fff;overflow:hidden;display:grid;place-items:center}
.hls .ring svg{width:70%;height:auto}
.hls figcaption{font-size:13px;color:var(--muted);font-family:var(--display)}

/* Browser frame for a web banner */
.browser{border-radius:clamp(10px,1.2vw,16px);overflow:hidden;box-shadow:0 40px 80px -46px rgba(36,32,33,.55);background:#fff;border:1px solid var(--line)}
.browser .bar{display:flex;gap:6px;padding:12px 14px;background:#F4EEEA;direction:ltr}
.browser .bar i{width:11px;height:11px;border-radius:50%;background:#D9CCC6}
.browser img{display:block;width:100%;height:auto}

/* Ask: Himam red */
.cs-ask{background:var(--red);color:var(--on-red);padding-block:clamp(70px,10vw,140px)}
.cs-ask .in{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:clamp(28px,5vw,72px);align-items:end}
.cs-ask h2{font-weight:500;font-size:clamp(30px,4.4vw,62px);line-height:1.2}
html[lang="en"] .cs-ask h2{line-height:1.08}
.cs-ask p{margin-top:18px;opacity:.9;max-width:30em}
.cs-ask .cta{display:flex;gap:12px;flex-wrap:wrap;margin-top:30px}
.next{display:block;text-decoration:none;border-radius:16px;overflow:hidden;background:var(--red-deep);position:relative}
.next .cv{aspect-ratio:16/10;display:grid;place-items:center;overflow:hidden}
.next .cv img{width:100%;height:100%;object-fit:cover;transition:transform 1s cubic-bezier(.2,.7,.2,1)}
.next .cv svg{width:60%;height:auto;transition:transform 1s cubic-bezier(.2,.7,.2,1)}
.next:hover .cv img,.next:hover .cv svg{transform:scale(1.05)}
.next .t{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;font-family:var(--display)}
.next .t small{opacity:.75;font-size:13px;display:block}
.next .t b{font-weight:500;font-size:19px}

/* Reveal on scroll (only with JS and when motion is welcome) */
@media (prefers-reduced-motion:no-preference){
  .js .rv{opacity:0;transform:translateY(34px);transition:opacity .9s cubic-bezier(.2,.7,.2,1),transform .9s cubic-bezier(.2,.7,.2,1)}
  .js .rv.in-view{opacity:1;transform:none}
  .js .cs-pal .sw.rv{transform:scaleY(.6)}
  .js .cs-pal .sw.rv.in-view{transform:none}
  .js .cs-hero .stage svg{animation:rise 1.4s cubic-bezier(.2,.7,.2,1) both}
  .js .phone.rv:nth-child(2).in-view{transform:translateY(-8%)}
  .js .cs-desk .sheet img.over{transition:transform 1.2s cubic-bezier(.2,.7,.2,1)}
  .js .cs-desk .sheet:not(.in-view) img.over{transform:rotate(0) translateY(6%)}
}
@keyframes rise{from{opacity:0;transform:translateY(30px) scale(.96)}to{opacity:1;transform:none}}

@media (max-width:900px){
  .cs-hero .facts{grid-template-columns:repeat(3,minmax(0,1fr))}
  .cs-hero .facts .name{grid-column:1/-1}
  .cs-intro .in,.cs-desk .in,.cs-ask .in,.cs-two .in{grid-template-columns:minmax(0,1fr)}
  .cs-pal .row{grid-template-columns:repeat(2,minmax(0,1fr));height:auto}
  .cs-pal .sw{aspect-ratio:1}
  .cs-logos{grid-template-columns:minmax(0,1fr)}
  .cs-logos > div.wide{grid-column:auto;aspect-ratio:4/3}
  .cs-logos > div.wide svg{width:56%}
  .cs-head{flex-direction:column;align-items:flex-start;gap:8px}
}
@media (max-width:600px){
  .cs-hero{min-height:auto}
  .cs-hero .stage{padding-block:70px}
  .phones{gap:10px}
  .phone{width:31vw;border-radius:20px;padding:5px}
  .phone .scr{border-radius:16px}
  .phone::before{top:10px;height:10px}
  .posts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .posts .post:nth-child(3){grid-column:1/-1;aspect-ratio:16/10}
}
