/* Alifilm — design language modelled on apple.com/home measurements */
:root {
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --paper: #ffffff;
  --gray: #f5f5f7;
  --night: #000000;
  --night-ink: #f5f5f7;
  --night-ink-2: #86868b;
  --blue: #0071e3;
  --link: #0066cc;
  --link-night: #2997ff;
  --line: #d2d2d7;
  --nav-h: 44px;
  --gutter: 12px;
  --radius-pill: 980px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Arabic", "IBM Plex Sans Arabic", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.28,.11,.32,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
/* Latin-only tracking: Arabic must never get letter-spacing (breaks joining) */
.en, [lang="en"] { letter-spacing: -0.015em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Global nav ---------- */
.gnav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(250, 250, 252, .8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.gnav-inner {
  max-width: 1024px; height: 100%; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.gnav-logo { display: flex; align-items: center; height: 100%; padding: 0 8px; color: var(--ink); }
.gnav-logo img, .gnav-logo svg { height: 15px; width: auto; }
.gnav-list { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; flex: 1; justify-content: space-between; max-width: 640px; margin-inline-start: 24px; }
.gnav-list a {
  display: flex; align-items: center; height: var(--nav-h); padding: 0 10px;
  font-size: 12px; color: rgba(0,0,0,.8); transition: color .3s var(--ease);
}
.gnav-list a:hover, .gnav-list a[aria-current="page"] { color: #000; }
.gnav-list a[aria-current="page"] { font-weight: 600; }
.gnav-burger { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink); }
.gnav-burger span { display: block; width: 17px; height: 1px; background: currentColor; margin: 5px auto; transition: transform .3s var(--ease); }
.gnav.open .gnav-burger span:first-child { transform: translateY(3px) rotate(45deg); }
.gnav.open .gnav-burger span:last-child  { transform: translateY(-3px) rotate(-45deg); }

@media (max-width: 833px) {
  .gnav-inner { padding: 0 8px 0 16px; }
  .gnav-burger { display: block; }
  .gnav-list {
    position: fixed; inset: var(--nav-h) 0 auto 0; height: 0; overflow: hidden;
    flex-direction: column; justify-content: flex-start; max-width: none; margin: 0;
    background: #fafafc;
    padding: 0 48px; transition: height .4s var(--ease);
  }
  .gnav.open .gnav-list { height: calc(100vh - var(--nav-h)); padding-top: 20px; }
  .gnav-list a { font-size: 28px; font-weight: 600; height: auto; padding: 8px 0; color: var(--ink); opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }
  .gnav.open .gnav-list a { opacity: 1; transform: none; }
}

/* ---------- Buttons ---------- */
.btns { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 35px; padding: 8px 18px; border-radius: var(--radius-pill);
  font-size: 14px; line-height: 1.29; border: 1px solid var(--blue);
  background: var(--blue); color: #fff; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: #0077ed; border-color: #0077ed; }
.btn-ghost { background: transparent; color: var(--link); }
.btn-ghost:hover { background: var(--blue); color: #fff; }
.tile-dark .btn-ghost { color: var(--link-night); border-color: var(--link-night); }
.tile-dark .btn-ghost:hover { background: var(--link-night); color: #000; }
.btn[aria-disabled="true"] { background: transparent; border-color: var(--line); color: var(--ink-2); cursor: default; }
.tile-dark .btn[aria-disabled="true"] { border-color: #424245; color: var(--night-ink-2); }

/* ---------- Tiles (home) ---------- */
.stack { display: grid; gap: var(--gutter); padding-bottom: var(--gutter); }
.tile {
  position: relative; overflow: hidden; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  padding: 52px 24px 0; min-height: 580px;
  background: var(--paper);
}
.tile-gray { background: var(--gray); }
.tile-dark { background: var(--night); color: var(--night-ink); }
.tile-hero { min-height: 692px; padding-top: 56px; }
.tile-kicker { font-size: 17px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.tile-dark .tile-kicker { color: var(--night-ink-2); }
.tile-headline { font-size: 40px; line-height: 1.1; font-weight: 600; }
.tile-hero .tile-headline { font-size: 56px; line-height: 1.07; }
.tile-subhead { font-size: 21px; line-height: 1.38; margin-top: 6px; }
.tile-hero .tile-subhead { font-size: 28px; line-height: 1.14; }
.tile-visual { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; padding: 32px 0 48px; }
.tile-link { position: absolute; inset: 0; z-index: 1; }
.tile .btns { position: relative; z-index: 2; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); padding: 0 var(--gutter); }
.grid-2 .tile { min-height: 580px; }
.grid-2 .tile-headline { font-size: 40px; }

@media (max-width: 1068px) {
  .tile-hero .tile-headline { font-size: 48px; }
  .tile-hero .tile-subhead { font-size: 24px; }
}
@media (max-width: 734px) {
  .grid-2 { grid-template-columns: 1fr; padding: 0; }
  .tile { min-height: 500px; padding: 44px 16px 0; }
  .tile-hero { min-height: 560px; }
  .tile-headline, .grid-2 .tile-headline { font-size: 32px; }
  .tile-hero .tile-headline { font-size: 40px; }
  .tile-subhead { font-size: 19px; }
  .tile-hero .tile-subhead { font-size: 21px; }
}

/* ---------- Gallery scroller ---------- */
.section { padding: 80px 0; }
.section-gray { background: var(--gray); }
.section-head { max-width: 980px; margin: 0 auto 32px; padding: 0 22px; }
.section-title { font-size: 48px; line-height: 1.08; font-weight: 600; }
.section-title .muted { color: var(--ink-2); }
.scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(372px, 82vw); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px max(22px, calc((100vw - 980px) / 2)) 32px;
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.card {
  scroll-snap-align: start; position: relative; border-radius: 18px; overflow: hidden;
  min-height: 480px; padding: 30px; display: flex; flex-direction: column;
  background: var(--paper); box-shadow: 2px 4px 12px rgba(0,0,0,.08);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: scale(1.015); box-shadow: 2px 4px 16px rgba(0,0,0,.16); }
.card.tile-dark { background: #000; }
.card.tile-gray { background: #fbfbfd; }
.card-eyebrow { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; }
.card.tile-dark .card-eyebrow { color: var(--night-ink-2); }
.card-title { font-size: 28px; line-height: 1.14; font-weight: 600; margin-top: 6px; }
.card-text { font-size: 17px; margin-top: 8px; color: var(--ink-2); }
.card.tile-dark .card-text { color: var(--night-ink-2); }
.card .tile-visual { padding: 24px 0 0; }
.card .tile-visual > * { transform: scale(.72); }
.scroller-nav { display: flex; justify-content: flex-end; gap: 16px; max-width: 980px; margin: 0 auto; padding: 0 22px; }
.scroller-nav button {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(210,210,215,.64); color: rgba(0,0,0,.56); font-size: 18px; line-height: 1;
  transition: background .2s;
}
.scroller-nav button:hover { background: rgba(223,223,227,.7); color: rgba(0,0,0,.64); }

/* ---------- Category / chooser strip ---------- */
.chooser { display: flex; justify-content: center; gap: 40px; padding: 28px 22px 4px; flex-wrap: wrap; }
.chooser a { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 12px; color: var(--ink); }
.chooser .chip { width: 64px; height: 54px; display: grid; place-items: center; }
.chooser a:hover span:last-child { color: var(--link); }

/* ---------- Page hero (category & work) ---------- */
.page-hero { max-width: 980px; margin: 0 auto; padding: 72px 22px 40px; }
.page-hero h1 { font-size: 80px; line-height: 1.05; font-weight: 600; }
.page-hero p { font-size: 28px; line-height: 1.14; font-weight: 600; color: var(--ink-2); margin-top: 10px; max-width: 640px; }
@media (max-width: 734px) {
  .page-hero { padding: 48px 16px 28px; }
  .page-hero h1 { font-size: 48px; }
  .page-hero p { font-size: 21px; }
  .section-title { font-size: 32px; }
}

.work-hero { text-align: center; padding: 64px 22px 0; }
.work-hero .tile-kicker { margin-bottom: 8px; }
.work-hero h1 { font-size: 80px; line-height: 1.05; font-weight: 600; }
.work-hero .tag { font-size: 28px; font-weight: 600; margin-top: 8px; }
.work-hero .meta { font-size: 17px; color: var(--ink-2); margin-top: 18px; }
.work-stage { max-width: 1024px; margin: 40px auto 0; border-radius: 28px; overflow: hidden; min-height: 460px; display: flex; align-items: center; justify-content: center; }
.work-stage.tile-dark { background: #000; } .work-stage.tile-gray, .work-stage.tile-light { background: var(--gray); }
.work-summary { max-width: 692px; margin: 0 auto; padding: 72px 22px 24px; font-size: 21px; line-height: 1.52; font-weight: 600; color: var(--ink-2); }
.work-summary strong { color: var(--ink); }
.highlights { max-width: 980px; margin: 0 auto; padding: 24px 22px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.highlight { background: var(--gray); border-radius: 18px; padding: 28px; }
.highlight h3 { font-size: 21px; line-height: 1.2; font-weight: 600; }
.highlight p { font-size: 17px; color: var(--ink-2); margin-top: 8px; }
.specs { max-width: 692px; margin: 0 auto; padding: 72px 22px; }
.specs h2 { font-size: 32px; font-weight: 600; margin-bottom: 16px; }
.specs dl { margin: 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-weight: 600; } .specs dd { margin: 0; color: var(--ink-2); }
@media (max-width: 734px) {
  .work-hero h1 { font-size: 48px; } .work-hero .tag { font-size: 21px; }
  .work-stage { margin: 32px 0 0; border-radius: 0; min-height: 360px; }
  .work-summary { font-size: 19px; padding-top: 48px; }
  .specs div { grid-template-columns: 1fr; gap: 2px; }
}

.empty { max-width: 980px; margin: 0 auto 80px; padding: 0 22px; color: var(--ink-2); }

/* ---------- Footer ---------- */
.gfoot { background: var(--gray); color: rgba(0,0,0,.56); font-size: 12px; line-height: 1.33; }
.gfoot-inner { max-width: 980px; margin: 0 auto; padding: 18px 22px 22px; }
.gfoot-note { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.gfoot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 20px 0; }
.gfoot-cols h3 { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.gfoot-cols ul { list-style: none; margin: 0; padding: 0; }
.gfoot-cols li { margin-bottom: 8px; }
.gfoot-cols a { color: rgba(0,0,0,.72); } .gfoot-cols a:hover { text-decoration: underline; }
.gfoot-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.gfoot-legal .mark { height: 11px; width: auto; color: var(--ink); }
@media (max-width: 734px) { .gfoot-cols { grid-template-columns: 1fr 1fr; } }

/* ---------- Visuals (pure CSS/SVG art) ---------- */
.vis-arabic { position: relative; font-size: clamp(120px, 22vw, 240px); line-height: 1; font-weight: 700; }
.vis-arabic .word {
  background: linear-gradient(180deg, #fff 10%, #86868b 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.vis-arabic .glow { position: absolute; inset: 20% 10%; background: radial-gradient(closest-side, rgba(41,151,255,.35), transparent); filter: blur(30px); z-index: -1; }
.vis-arabic { isolation: isolate; }

.vis-window { width: min(520px, 92%); border-radius: 14px; background: #fff; box-shadow: 0 30px 60px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.06); overflow: hidden; text-align: start; }
.vis-window .bar { height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 12px; background: #f5f5f7; border-bottom: 1px solid #e8e8ed; direction: ltr; }
.vis-window .bar i { width: 11px; height: 11px; border-radius: 50%; background: #d2d2d7; }
.vis-window .body { display: grid; grid-template-columns: 34% 1fr; min-height: 240px; }
.vis-window .side { background: #fbfbfd; border-inline-end: 1px solid #e8e8ed; padding: 14px; display: grid; gap: 9px; align-content: start; }
.vis-window .side b { height: 9px; border-radius: 5px; background: #e8e8ed; }
.vis-window .side b:first-child { background: var(--ink); width: 70%; }
.vis-window .main { padding: 18px; display: grid; gap: 12px; align-content: start; }
.vis-window .orb { width: 92px; height: 92px; margin: 6px auto 4px; border-radius: 50%; background: conic-gradient(from 200deg, #1d1d1f, #86868b, #f5f5f7, #1d1d1f); animation: spin 14s linear infinite; box-shadow: inset 0 0 0 10px #fff; }
.vis-window .main b { height: 9px; border-radius: 5px; background: #e8e8ed; }
.vis-window .main b.s { width: 60%; }
@keyframes spin { to { transform: rotate(360deg); } }

.vis-meter { width: min(420px, 92%); display: grid; gap: 14px; direction: ltr; }
.vis-meter .row { display: grid; grid-template-columns: 22px 1fr 64px; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.vis-meter .row span:first-child { font-weight: 600; color: var(--ink); }
.vis-meter .track { height: 14px; border-radius: 7px; background: #e8e8ed; overflow: hidden; }
.vis-meter .fill { height: 100%; border-radius: 7px; background: var(--ink); transform-origin: left; animation: grow 1.4s var(--ease) both; }
.vis-meter .row:nth-child(2) .fill { background: #424245; animation-delay: .1s; }
.vis-meter .row:nth-child(3) .fill { background: #6e6e73; animation-delay: .2s; }
.vis-meter .row:nth-child(4) .fill { background: #a1a1a6; animation-delay: .3s; }
.vis-meter .big { font-size: 64px; font-weight: 600; color: var(--ink); line-height: 1; margin-bottom: 8px; text-align: center; }
@keyframes grow { from { transform: scaleX(0); } }

.vis-pack { position: relative; width: 210px; height: 230px; }
.vis-pack .box { position: absolute; inset: 0; border-radius: 34px; background: linear-gradient(160deg, #fff, #e8e8ed); box-shadow: 0 30px 50px rgba(0,0,0,.14), inset 0 0 0 1px rgba(0,0,0,.05); display: grid; place-items: center; font-size: 96px; font-weight: 700; color: var(--ink); }
.vis-pack .box:nth-child(1) { transform: translate(-34px, 18px) rotate(-8deg); opacity: .5; }
.vis-pack .box:nth-child(2) { transform: translate(34px, 18px) rotate(8deg); opacity: .5; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .vis-window .orb, .vis-meter .fill { animation: none; }
  .card:hover { transform: none; }
}
