/* Case v2: one-language reading, phone-first structure. Loads after hms-case.css and only on pages that opt in. */

/* Warm light surfaces replace the ink hero, header, contact and floating bar on v2 pages. */
:root{--sand:#f5f4ef;--sand-text:#3d3f44;--sand-muted:#5d5f64;--sand-line:rgba(28,29,32,.14)}

/* Language: the head script sets data-lang; without JavaScript both languages stay visible. */
html[data-lang=en] .ar,html[data-lang=ar] .en{display:none!important}
html[data-lang] .bilingual{gap:0}
html[data-lang=ar] body{font-family:Cairo,Portfolio,sans-serif}
html[data-lang=ar] .ar{font-size:inherit;line-height:1.75;text-align:start}
html[data-lang=ar] :is(h1,h2,h3) .ar,html[data-lang=ar] :is(.hero-statement,.dept-line,.next-title) .ar{line-height:1.35;font-weight:600}
html[data-lang=ar] .case-hero h1{font-size:clamp(36px,5.2vw,76px)}
html[data-lang=ar] .hero-statement{font-size:21px}
html[data-lang=ar] .module h2,html[data-lang=ar] .dept-sheet .module h2{font-size:clamp(26px,2.8vw,40px)}
html[data-lang=ar] .skip-link{left:auto;right:20px}
html[dir=rtl] svg.dir-icon{transform:scaleX(-1)}
html[dir=rtl] .primary-link:hover svg.dir-icon{transform:scaleX(-1) translateX(4px)}
html[dir=rtl] .footer-line button{text-align:right}
html[dir=rtl] .expand-icon{right:auto;left:12px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media(prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}

/* Header */
.case-header{position:relative;z-index:2;min-height:72px;padding-block:16px;gap:14px;justify-content:flex-end;background:transparent;color:var(--ink)}
html:not(.js) .case-header{background:var(--sand)}
.case-header nav{align-items:center;gap:22px}
.lang-toggle{min-height:40px;min-width:44px;padding:0 15px;border:1px solid rgba(28,29,32,.28);border-radius:40px;background:transparent;color:var(--ink);font:600 15px/1 Cairo,sans-serif}
.lang-toggle:lang(en){font-family:Portfolio,sans-serif;font-weight:400}
.lang-toggle:hover{background:var(--ink);border-color:var(--ink);color:#fff}
html:not([data-lang]) .lang-toggle{display:none}
.case-header{justify-content:space-between}
.case-header a:hover{text-decoration:none}
.header-back{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-size:15px;white-space:nowrap}
.header-back svg{width:20px;height:20px;transition:transform .2s}
.header-back:hover svg{transform:translateX(-3px)}
html[dir=rtl] .header-back:hover svg{transform:scaleX(-1) translateX(-3px)}
.header-end{display:flex;align-items:center;gap:10px}
.case-header .header-links{display:none;align-items:center;gap:26px;margin-inline-end:10px;font-size:15px}
.header-links a{position:relative;padding-block:6px}
.header-links a::after{content:'';position:absolute;left:0;right:0;bottom:0;height:1px;background:currentColor;transform:scaleX(0);transition:transform .25s}
.header-links a:hover::after{transform:scaleX(1)}
.menu-toggle,.menu-close{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:var(--ink);color:#fff;flex:none;transition:background .2s}
.menu-toggle:hover,.menu-close:hover{background:var(--accent)}
.menu-bars{display:grid;gap:5px;width:18px}
.menu-bars i{display:block;height:1.5px;border-radius:2px;background:currentColor;transition:transform .25s;transform-origin:left}
html[dir=rtl] .menu-bars i{transform-origin:right}
.menu-toggle:hover .menu-bars i:last-child{transform:scaleX(.6)}
.menu-close svg{width:20px;height:20px}
html:not(.js) .menu-toggle{display:none}
html:not(.js) .case-header .header-links{display:flex;flex-wrap:wrap;gap:6px 18px}
@media(min-width:1040px){.case-header .header-links{display:flex}.header-links .menu-only{display:none}.menu-toggle{display:none}}

/* Site menu panel (built by case-v2.js from the header links) */
.site-menu{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--sand);color:var(--ink);overflow-y:auto}
.site-menu::backdrop{background:rgba(20,21,23,.35)}
.menu-inner{min-height:100%;display:flex;flex-direction:column;padding:14px var(--gutter) calc(28px + env(safe-area-inset-bottom))}
.menu-top{display:flex;align-items:center;justify-content:space-between;min-height:44px}
.menu-title{font-size:15px;color:var(--sand-muted)}
.menu-links{display:flex;flex-direction:column;margin-top:48px;border-top:1px solid var(--sand-line)}
.menu-links a{display:flex;align-items:baseline;gap:16px;padding:16px 0;border-bottom:1px solid var(--sand-line);font-size:clamp(34px,9vw,52px);line-height:1.1;letter-spacing:-.02em;transition:color .2s}
html[data-lang=ar] .menu-links a{font-size:clamp(30px,8vw,46px);letter-spacing:normal}
.menu-index{min-width:26px;font-size:14px;letter-spacing:normal;color:var(--sand-muted);font-family:Portfolio,sans-serif}
.menu-links a:hover,.menu-links a[aria-current=page]{color:var(--accent)}
.menu-foot{margin-top:auto;padding-top:40px;display:grid;gap:16px;justify-items:start}
.menu-wa{display:inline-flex;align-items:center;gap:10px;min-height:56px;padding:0 24px;border-radius:60px;background:var(--ink);color:#fff;font-size:16px}
.menu-wa .wa-icon{width:22px;height:22px;color:#25d366}
.menu-wa:hover{background:var(--accent)}
.menu-mail{font-size:16px;color:var(--sand-text)}
@media(prefers-reduced-motion:no-preference){
  .site-menu[open] .menu-inner{animation:case-fade .3s ease both}
  .site-menu[open] .menu-links a{animation:menu-rise .5s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(.08s + var(--i) * .06s)}
}
@keyframes menu-rise{from{opacity:0;transform:translateY(18px)}}

/* Hero */
.case-hero.wrap{gap:24px;margin-top:-72px;padding-top:92px;padding-bottom:52px;position:relative;isolation:isolate;overflow:hidden;background:var(--sand);color:var(--ink)}
.case-hero .hero-description{color:var(--sand-text)}
.hero-statement{color:var(--ink);text-wrap:balance}
.dept-line,.section-intro,.module-lead{text-wrap:pretty}
.hero-facts{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid var(--sand-line)}
.hero-facts a{display:flex;flex-direction:column;gap:4px;padding-top:14px;height:100%}
.hero-facts li+li a{padding-inline-start:14px;border-inline-start:1px solid var(--sand-line)}
.hero-facts strong{font-weight:400;font-size:clamp(32px,3vw,44px);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;font-family:Portfolio,sans-serif}
.hero-facts .bilingual{font-size:14px;line-height:1.3;color:var(--sand-muted)}
.hero-facts a:hover strong{color:var(--accent)}
.hero-actions{display:flex;gap:10px}
.hero-actions>a{flex:1 1 auto;justify-content:center}
.case-hero .hero-actions .primary-link{order:0;margin:0;min-height:56px;padding:0 16px;gap:10px;background:var(--ink);color:#fff;transition:background .2s}
.case-hero .hero-actions .primary-link:hover{background:var(--accent)}
.case-hero .hero-actions .primary-link .en{font-size:16px}
.wa-link{display:inline-flex;align-items:center;gap:8px;min-height:56px;padding:0 16px;border-radius:60px;border:1px solid rgba(28,29,32,.28);color:var(--ink);font-size:16px;transition:background .2s,color .2s}
.hero-actions svg{width:22px;height:22px}
@media(max-width:359px){.hero-actions{flex-wrap:wrap}}
.wa-link:hover{background:var(--ink);border-color:var(--ink);color:#fff}
.wa-icon{color:#1a9e4b}
.wa-link:hover .wa-icon,.bar-wa .wa-icon,.contact-wa .wa-icon{color:#25d366}
.case-hero .capture-note{margin-top:0;color:var(--sand-muted)}
.hero-proof{position:relative}
.hero-device{margin:0;position:relative;padding-bottom:17%}
.device-link{display:block;position:relative;aspect-ratio:1200/685;cursor:zoom-in}
.device-screen{position:absolute;left:10.92%;top:2.19%;width:78.17%;height:86.28%;overflow:hidden;background:#fff}
.device-screen img{width:100%;height:100%;object-fit:cover;object-position:top center}
.device-frame{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.hero-lens{position:absolute;inset-inline-end:0;bottom:0;width:72%;display:block;border-radius:12px;overflow:hidden;border:1px solid rgba(28,29,32,.12);background:#f4f5f7;box-shadow:0 0 0 6px var(--sand),0 26px 44px -18px rgba(28,29,32,.42);transform-origin:100% 100%;cursor:zoom-in}
html[dir=rtl] .hero-lens{transform-origin:0 100%}
.hero-lens img{width:100%;height:auto;aspect-ratio:552/280}
.lens-tag{position:absolute;left:6px;top:6px;display:grid;place-items:center;width:28px;height:28px;border-radius:7px;background:var(--ink);color:#fff}
.lens-tag svg{width:16px;height:16px}
.hero-lens:hover .lens-tag{background:var(--accent)}
.hero-device figcaption{position:absolute;inset-inline-start:0;bottom:0;width:25%;margin:0;font-size:13px;line-height:1.35;color:var(--sand-muted)}
html[data-lang=ar] .hero-device figcaption .ar{line-height:1.45}
@media(prefers-reduced-motion:no-preference){
  .js .device-link{animation:case-rise .9s cubic-bezier(.2,.7,.2,1) both}
  .js .hero-lens{animation:case-lens .8s .45s cubic-bezier(.2,.8,.2,1.15) both}
  .js .hero-facts,.js .hero-device figcaption{animation:case-fade .7s .7s ease both}
}
@keyframes case-rise{from{opacity:0;transform:translateY(28px)}}
@keyframes case-lens{from{opacity:0;transform:translateY(18px) scale(.86)}}
@keyframes case-fade{from{opacity:0}}
@media(max-width:1039px){
  .case-hero h1{order:0}.hero-statement{order:1}.hero-proof{order:2;margin-top:6px}.hero-actions{order:3}.hero-facts{order:4}.hero-description{order:5}.case-hero .capture-note{order:6}
  .case-hero h1{font-size:44px}
}
@media(min-width:1040px){
  .case-hero.wrap{padding-top:120px;padding-bottom:72px;min-height:0}
  .hero-copy{display:flex;flex-direction:column;gap:26px}
  .hero-copy>*{margin:0}
  .hero-actions{margin-top:4px}
  .hero-actions>a{flex:0 0 auto}
  .hero-proof{align-self:center;padding-top:0}
  .hero-lens{width:58%}
  .hero-device{padding-bottom:12%}
}

/* Shared hero background: crisp, light circles that slowly grow and shrink behind the hero content (layer built by case-v2.js). */
.hero-bg{position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden}
.hero-bg span{position:absolute;aspect-ratio:1;border-radius:50%;transform:scale(var(--from));animation:hero-breathe var(--time) ease-in-out var(--delay,0s) infinite alternate;will-change:transform}
.hero-bg .c1{width:min(92vw,620px);top:-16%;right:-30%;background:#e9e7de;--from:.86;--to:1.18;--time:8s}
.hero-bg .c2{width:min(122vw,840px);top:-26%;right:-44%;border:1.5px solid rgba(69,92,233,.28);--from:1.12;--to:.84;--time:8s}
.hero-bg .c3{width:min(68vw,440px);top:40%;left:-24%;background:rgba(69,92,233,.1);--from:.74;--to:1.2;--time:6.5s;--delay:-3s}
.hero-bg .c4{width:min(26vw,170px);bottom:16%;right:6%;background:rgba(166,180,255,.4);--from:.6;--to:1.3;--time:5s;--delay:-1.5s}
.hero-bg .c5{width:min(44vw,280px);bottom:-8%;left:34%;border:1.5px solid rgba(28,29,32,.14);--from:1.25;--to:.75;--time:6s;--delay:-4s}
@media(min-width:1040px){
  .hero-bg .c1{top:-30%;right:-8%}
  .hero-bg .c2{top:-46%;right:-19%}
  .hero-bg .c3{top:auto;bottom:-28%;left:-8%}
  .hero-bg .c4{bottom:10%;right:46%}
  .hero-bg .c5{bottom:auto;top:12%;left:38%}
}
html[dir=rtl] .hero-bg{transform:scaleX(-1)}
.hero-bg.is-paused span{animation-play-state:paused}
@keyframes hero-breathe{to{transform:scale(var(--to))}}
@media(prefers-reduced-motion:reduce){.hero-bg span{animation:none}}
@media print{.hero-bg{display:none}}

/* Hero for mobile-app projects: two real phone screens overlapping */
.hero-phones{position:relative;display:flex;justify-content:center;align-items:flex-start;max-width:520px;margin-inline:auto;padding:6px 0 10px}
.phone-shot{position:relative;z-index:1;display:block;width:46%;overflow:hidden;border:6px solid var(--ink);border-radius:28px;background:#fff;box-shadow:0 28px 46px -22px rgba(28,29,32,.5);cursor:zoom-in;transform:rotate(-2.5deg)}
.phone-shot+.phone-shot{z-index:0;margin-top:13%;margin-inline-start:-7%;transform:rotate(3deg)}
html[dir=rtl] .phone-shot{transform:rotate(2.5deg)}
html[dir=rtl] .phone-shot+.phone-shot{transform:rotate(-3deg)}
.phone-shot img{width:100%;height:auto}
@media(prefers-reduced-motion:no-preference){
  .js .phone-shot{animation:case-rise .9s cubic-bezier(.2,.7,.2,1) both}
  .js .phone-shot+.phone-shot{animation-delay:.25s}
}
.dept-thumb.is-portrait img{object-fit:contain;padding-top:10px}
@media(max-width:719px){.project-value{padding-block:56px}}
.project-value .section-intro{margin-top:18px}

/* Website cases (body.site-case): responsive hero and an open page tour */
.hero-site{position:relative;margin:0;padding-bottom:16%}
.site-browser{display:block;overflow:hidden;border:1px solid var(--sand-line);border-radius:12px;background:#fff;box-shadow:0 30px 60px -32px rgba(28,29,32,.5);cursor:zoom-in}
.browser-bar{display:flex;align-items:center;gap:6px;height:26px;padding:0 10px;background:#ecebe4;border-bottom:1px solid var(--sand-line)}
.browser-bar i{flex:none;width:8px;height:8px;border-radius:50%;background:#cbc8bd}
.browser-address{flex:0 1 46%;height:12px;margin-inline-start:10px;border-radius:8px;background:#fff}
.site-browser img{width:100%;height:auto;aspect-ratio:1.44;object-fit:cover;object-position:top center}
.site-phone{position:absolute;bottom:0;inset-inline-end:3%;width:26%;overflow:hidden;border:5px solid var(--ink);border-radius:22px;background:#fff;box-shadow:0 0 0 5px var(--sand),0 24px 40px -18px rgba(28,29,32,.55);cursor:zoom-in}
.site-phone img{width:100%;height:auto}
.hero-site figcaption{position:absolute;bottom:0;inset-inline-start:0;width:60%;margin:0;font-size:13px;line-height:1.35;color:var(--sand-muted)}
@media(prefers-reduced-motion:no-preference){
  .js .site-browser{animation:case-rise .9s cubic-bezier(.2,.7,.2,1) both}
  .js .site-phone{animation:case-lens .8s .45s cubic-bezier(.2,.8,.2,1.15) both;transform-origin:50% 100%}
  .js .hero-site figcaption{animation:case-fade .7s .7s ease both}
}
.site-case .departments .module{display:grid;gap:22px;margin-top:56px;padding-top:40px}
@media(max-width:1039px){
  .site-case .module-copy{display:contents}
  .site-case .tour-label{order:0;margin-bottom:-8px}.site-case .module-copy>h2{order:1}.site-case .module-shots{order:2}.site-case .module-lead{order:3;margin-top:0}.site-case .capabilities{order:4;margin-top:0}
}
.tour-label{display:flex;align-items:baseline;gap:10px;margin-bottom:14px;font-size:14px;color:var(--muted)}
.tour-index{font-family:Portfolio,sans-serif;font-variant-numeric:tabular-nums;color:var(--accent)}
.site-case .capabilities{margin-top:20px;border:0}
.site-case .capabilities summary{display:none}
.site-case .feature-list{padding:0}
.site-case .feature-list li{margin-top:16px;padding-top:16px}
.site-case .feature-list h3{font-size:19px}
.site-case .feature-list p{margin-top:6px;font-size:16px;color:var(--muted)}
.site-case .module-shots .screen-figure:not(.is-phone) .screen-link{padding-top:22px;background:#fff;background-image:radial-gradient(circle at 12px 11px,#cbc8bd 3.5px,transparent 4px),radial-gradient(circle at 24px 11px,#cbc8bd 3.5px,transparent 4px),radial-gradient(circle at 36px 11px,#cbc8bd 3.5px,transparent 4px),linear-gradient(#ecebe4,#ecebe4);background-size:100% 22px;background-repeat:no-repeat;border-color:var(--line)}
.site-case .module-shots .is-phone{flex:0 0 auto;width:46%;min-width:0;max-width:230px}
.site-case .module-shots .is-phone .screen-link{border:5px solid var(--ink);border-radius:22px;background:#fff}
.site-case .module-shots .is-phone img{max-height:none}
.site-case .module-shots .is-tall{max-width:none;min-width:min(84vw,640px)}
.site-case .module-shots .is-tall img{aspect-ratio:1.44;max-height:none;object-fit:cover;object-position:50% 0}
@media(prefers-reduced-motion:no-preference){
  .site-case .is-tall .screen-link img{transition:object-position 6s ease-in-out}
  .site-case .is-tall .screen-link:hover img{object-position:50% 100%}
  @media(hover:none){.site-case .is-tall .screen-link img{animation:tall-scroll 12s ease-in-out 1.5s infinite alternate}}
}
@keyframes tall-scroll{0%,12%{object-position:50% 0}88%,100%{object-position:50% 100%}}
@media(min-width:1040px){
  .site-case .departments .module{grid-template-columns:1fr 1fr;align-items:center;gap:64px;margin-top:88px;padding-top:56px}
  .site-case .module-copy{position:static}
  .site-case .module-shots{order:0;display:flex;align-items:flex-start;gap:20px}
  .site-case .module:nth-of-type(odd) .module-shots{order:-1}
  .site-case .module-shots>.screen-figure:not(.is-phone){flex:1 1 0;min-width:0}
}
.site-case .gallery-chips,.site-case #gallery-count,.site-case #show-more,.site-case .gallery-controls{display:none!important}
.site-case .gallery-grid{display:flex;gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;margin:28px calc(var(--gutter)*-1) 0;padding:0 var(--gutter) 8px;scroll-padding-inline:var(--gutter);scrollbar-width:none}
.site-case .gallery-grid::-webkit-scrollbar{display:none}
.site-case .gallery-grid>.screen-figure{flex:0 0 74%;scroll-snap-align:start}
.site-case .gallery-grid>.portrait{flex-basis:44%}
@media(min-width:720px){.site-case .gallery-grid>.screen-figure{flex-basis:38%}.site-case .gallery-grid>.portrait{flex-basis:20%}}
@media(min-width:1040px){.site-case .gallery-grid{margin-inline:0;padding-inline:0}}

/* Light hero shared by Work, About and Contact */
.v2-hero{position:relative;isolation:isolate;overflow:hidden;margin-top:-72px;padding-top:104px;background:var(--sand);color:var(--ink)}
@media(min-width:1040px){.v2-hero{padding-top:136px}}

/* Chapter links: one language, one line */
html[data-lang] .chapter-links{gap:24px}
html[data-lang] .chapter-links>a{min-height:54px;padding:0;font-size:15px}

/* Shared section rhythm on phones */
@media(max-width:719px){
  .journey-section,.gallery-section,.accounts-section{padding-block:56px}
  .rollout-section{padding-bottom:56px}
  .section-intro{font-size:17px;margin-top:18px}
  html[data-lang] h2{font-size:30px}
}

/* Journey: compact numbered steps */
.journey-flow{gap:0 36px;margin-top:30px}
.journey-flow li{display:grid;grid-template-columns:40px minmax(0,1fr);padding:18px 0}
.journey-flow li:before{grid-row:span 2;margin:0;padding-top:3px;font-size:15px}
.journey-flow li h3{font-size:20px}
.journey-flow li>p{margin-top:4px;font-size:15px;color:var(--muted)}

/* Departments: a rail of cards that open a sheet */
.departments{padding-top:56px;border-top:1px solid var(--line)}
.dept-rail{display:flex;gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;margin:28px calc(var(--gutter)*-1) 0;padding:2px var(--gutter) 6px;scroll-padding-inline:var(--gutter);scrollbar-width:none;overscroll-behavior-x:contain}
.dept-rail::-webkit-scrollbar{display:none}
.dept-card{flex:0 0 min(80%,330px);scroll-snap-align:start;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff;transition:border-color .2s}
.dept-thumb{display:block;aspect-ratio:1.44;overflow:hidden;background:var(--soft);border-bottom:1px solid var(--line)}
.dept-thumb img{width:100%;height:100%;object-fit:cover;object-position:top center;transition:transform .5s cubic-bezier(.2,.7,.2,1)}
.dept-body{display:flex;flex-direction:column;gap:8px;flex:1;padding:16px 16px 18px}
.dept-name{display:flex;gap:8px;align-items:baseline;font-size:14px;line-height:1.35;color:var(--muted)}
.dept-index{font-variant-numeric:tabular-nums;font-family:Portfolio,sans-serif}
.dept-line{font-size:20px;line-height:1.25;letter-spacing:-.015em}
.dept-more{margin-top:auto;padding-top:12px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;color:var(--muted)}
.dept-more svg{width:20px;height:20px;color:var(--ink);transition:transform .2s}
.dept-card:hover{border-color:var(--ink)}
.dept-card:hover .dept-thumb img{transform:scale(1.04)}
.dept-card:hover .dept-more svg{transform:translateX(3px)}
html[dir=rtl] .dept-card:hover .dept-more svg{transform:scaleX(-1) translateX(3px)}
.rail-progress{position:relative;height:2px;margin-top:16px;background:var(--line);border-radius:2px;overflow:hidden}
.rail-progress span{position:absolute;top:0;bottom:0;inset-inline-start:0;width:30%;background:var(--ink);border-radius:2px}
html:not(.js) .rail-progress{display:none}
@media(min-width:720px) and (max-width:1039px){.dept-card{flex-basis:44%}}
@media(min-width:1040px){
  .dept-rail{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px;overflow:visible;margin:44px 0 0;padding:0}
  .rail-progress{display:none}
}

/* Department sheet (built by case-v2.js) */
.dept-sheet{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:var(--ink);overflow:hidden}
.dept-sheet::backdrop{background:rgba(20,21,23,.62)}
.sheet-panel{position:absolute;left:0;right:0;bottom:0;height:min(93dvh,100%);display:flex;flex-direction:column;background:#fff;border-radius:18px 18px 0 0;transform:translateY(var(--drag,0px));transition:transform .25s ease}
.sheet-panel.dragging{transition:none}
.dept-sheet[open] .sheet-panel{animation:sheet-up .42s cubic-bezier(.2,.8,.2,1)}
@keyframes sheet-up{from{transform:translateY(100%)}}
.sheet-bar{position:relative;flex:none;display:flex;align-items:center;gap:12px;padding:16px 12px 10px var(--gutter);border-bottom:1px solid var(--line);touch-action:none;cursor:grab}
html[dir=rtl] .sheet-bar{padding:16px var(--gutter) 10px 12px}
.sheet-handle{position:absolute;top:7px;left:50%;width:44px;height:5px;margin-left:-22px;border-radius:5px;background:#c9cbcf}
.sheet-title{flex:1;min-width:0;display:flex;gap:10px;align-items:baseline;font-size:15px;line-height:1.35;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sheet-title .dept-name{font-size:15px;color:var(--ink)}
.sheet-close{display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);flex:none}
.sheet-close:hover{border-color:var(--ink)}
.sheet-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:24px var(--gutter) 32px}
.sheet-body:focus{outline:0}
.sheet-nav{flex:none;display:flex;gap:10px;padding:10px var(--gutter) calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff}
.sheet-nav button{flex:1 1 0;min-width:0;min-height:52px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 14px;border:1px solid var(--line);border-radius:40px;background:#fff;color:var(--ink);font-size:15px}
.sheet-nav button>span:not(.sr-only){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sheet-nav button:hover{border-color:var(--ink)}
.sheet-nav .sheet-prev{flex:0 0 52px;padding:0}
.sheet-nav .sheet-prev-name{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.sheet-nav .sheet-next{justify-content:space-between;padding:0 16px 0 22px}
html[dir=rtl] .sheet-nav .sheet-next{padding:0 22px 0 16px}
.sheet-next-label{color:var(--muted);flex:none}
.sheet-next .sheet-next-name{flex:1;text-align:start}
.sheet-nav svg{width:20px;height:20px}
.dept-sheet .module{display:flex;flex-direction:column;border:0;margin:0;padding:0;gap:0}
.dept-sheet .module[hidden]{display:none}
.dept-sheet .module-copy{display:contents}
.dept-sheet .module h2{order:0;font-size:clamp(28px,3vw,40px)}
.dept-sheet .module-shots{order:1;margin-top:22px}
.dept-sheet .module-shots>.screen-figure{flex-basis:88%}
.dept-sheet .module-lead{order:2;margin-top:24px;font-size:17px}
.dept-sheet .capabilities{order:3}
.dept-sheet figcaption{font-size:15px;margin-top:10px}
@media(min-width:720px){.dept-sheet .module-shots{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;overflow:visible}}
@media(min-width:900px){
  .sheet-panel{top:0;left:auto;right:0;height:100%;width:min(780px,92vw);border-radius:0}
  html[dir=rtl] .sheet-panel{left:0;right:auto}
  .dept-sheet[open] .sheet-panel{animation:sheet-in .4s cubic-bezier(.2,.8,.2,1)}
  html[dir=rtl] .dept-sheet[open] .sheet-panel{animation-name:sheet-in-rtl}
  .sheet-handle{display:none}
  .sheet-bar{cursor:default;padding-top:12px}
}
@keyframes sheet-in{from{transform:translateX(100%)}}
@keyframes sheet-in-rtl{from{transform:translateX(-100%)}}
@media(prefers-reduced-motion:reduce){.dept-sheet[open] .sheet-panel{animation:none}}

/* Gallery: filter chips and a two-column phone grid */
.gallery-chips{display:flex;gap:8px;overflow-x:auto;margin:0 calc(var(--gutter)*-1);padding:2px var(--gutter) 4px;scrollbar-width:none;flex:1 0 100%}
.gallery-chips::-webkit-scrollbar{display:none}
.gallery-chips button{flex:none;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:1px solid var(--line);border-radius:40px;background:#fff;color:var(--ink);font-size:15px;white-space:nowrap}
.gallery-chips button:hover{border-color:var(--ink)}
.gallery-chips button[aria-pressed=true]{background:var(--ink);border-color:var(--ink);color:#fff}
.chip-count{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums;font-family:Portfolio,sans-serif}
.gallery-chips button[aria-pressed=true] .chip-count{color:#c7c9cd}
.has-chips .gallery-controls>label,.has-chips .gallery-controls>select{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.has-chips .gallery-controls{margin-block:24px 22px;gap:12px}
@media(min-width:1040px){.gallery-chips{flex-wrap:wrap;overflow:visible;margin:0;padding:0}}
@media(max-width:719px){
  .gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 12px}
  .gallery-grid figcaption{font-size:14px;line-height:1.35;margin-top:8px}
  .gallery-grid .expand-icon{width:32px;height:32px;bottom:8px;right:8px}
  html[dir=rtl] .gallery-grid .expand-icon{right:auto;left:8px}
  .gallery-grid .expand-icon svg{width:18px;height:18px}
  .gallery-grid .screen-link{border-radius:10px}
}

/* Roles as chips */
.role-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:26px}
.role-row{min-height:44px;padding:8px 14px 8px 16px;border:1px solid var(--line);border-radius:40px;gap:8px;justify-content:flex-start}
html[dir=rtl] .role-row{padding:8px 16px 8px 14px}
.role-row svg{width:16px;height:16px}
.role-row:hover{border-color:var(--accent)}
html[data-lang] .role-row .en,html[data-lang] .role-row .ar{font-size:15px}

/* Contact, next project and footer */
.contact-section{padding-bottom:40px;background:var(--sand);color:var(--ink);border-top:1px solid var(--sand-line)}
.contact-section .section-intro{color:var(--sand-text)}
.contact-section .contact-links>a{border-bottom-color:var(--sand-line)}
.contact-section .contact-links a:hover{color:var(--accent)}
.contact-section .footer-line{border-top-color:var(--sand-line)}
.contact-wa{display:flex;align-items:center;gap:14px;width:100%;max-width:520px;min-height:68px;margin-top:34px;padding:0 26px;border-radius:60px;background:var(--ink);color:#fff;font-size:20px;transition:background .2s}
.contact-wa>.bilingual{flex:1}
.contact-wa:hover{background:var(--accent)}
.contact-section .contact-links{margin-top:30px}
.next-project{display:grid;gap:14px;margin-top:64px;padding-top:26px;border-top:1px solid var(--sand-line)}
.next-label{font-size:14px;color:var(--sand-muted)}
.next-media{display:block;aspect-ratio:1.6;border-radius:12px;overflow:hidden;background:#fff;border:1px solid var(--sand-line)}
.next-media img{width:100%;height:100%;object-fit:cover;object-position:top center;transition:transform .6s cubic-bezier(.2,.7,.2,1)}
.next-title{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:clamp(28px,3.4vw,48px);line-height:1.1;letter-spacing:-.02em}
.next-title svg{width:30px;height:30px;transition:transform .2s}
.next-sub{font-size:16px;color:var(--sand-muted)}
.next-project:hover .next-media img{transform:scale(1.03)}
.next-project:hover .next-title svg{transform:translateX(4px)}
html[dir=rtl] .next-project:hover .next-title svg{transform:scaleX(-1) translateX(4px)}
.contact-section .footer-line{margin-top:48px}
@media(min-width:1040px){.next-project{grid-template-columns:1fr 1.2fr;align-items:end;column-gap:48px}.next-media{grid-column:2;grid-row:1/span 3}}
@media(max-width:1039px){.contact-section{padding-bottom:calc(28px + env(safe-area-inset-bottom))}}

/* Floating actions: appear after the hero buttons scroll away */
.action-bar{position:fixed;z-index:8;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));display:flex;gap:8px;padding:7px;background:rgba(245,244,239,.94);border:1px solid var(--sand-line);border-radius:60px;box-shadow:0 14px 34px -14px rgba(28,29,32,.4);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transform:translateY(160%);visibility:hidden;transition:transform .35s cubic-bezier(.2,.8,.2,1),visibility 0s .35s}
.action-bar[data-visible=true]{transform:none;visibility:visible;transition:transform .35s cubic-bezier(.2,.8,.2,1)}
html:not(.js) .action-bar{transform:none;visibility:visible}
.action-bar a{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 18px;border-radius:40px;color:var(--ink);font-size:15px}
.action-bar a:focus-visible{outline-offset:2px}
.action-bar .bar-wa{background:var(--ink);color:#fff}
.action-bar svg{width:20px;height:20px}
@media(min-width:1040px){.action-bar{left:auto;right:28px;bottom:28px}html[dir=rtl] .action-bar{right:auto;left:28px}.action-bar .bar-screens{display:none}}
@media(prefers-reduced-motion:reduce){.action-bar{transition:none}}

/* Viewer in one language */
#viewer-counter,.zoom-value{direction:ltr;unicode-bidi:isolate}
html[data-lang=en] .viewer-stage[aria-busy=true]:after{content:'Loading image…'}
html[data-lang=ar] .viewer-stage[aria-busy=true]:after{content:'جارٍ تحميل الصورة…';font-family:Cairo,sans-serif}
html[data-lang=ar] .viewer-header #viewer-arabic{margin:0;font-size:18px;line-height:1.4;font-weight:600}
@media(min-width:720px){html[data-lang=ar] .viewer-header #viewer-arabic{font-size:24px}}

@media print{
  .action-bar,.dept-rail,.rail-progress,.lang-toggle,.gallery-chips,.hero-actions,.hero-lens,.dept-sheet,.next-project{display:none!important}
  .device-frame{display:none}
  .device-link{aspect-ratio:auto}
  .device-screen{position:static;width:100%;height:auto}
  .hero-device{padding:0}
  .hero-device figcaption{position:static;width:auto;color:#000}
  .hero-facts{border-color:#999}
  .hero-facts .bilingual{color:#333}
}
