:root {
  --bg: #0b0b0b;
  --fg: #f4f1ea;
  --muted: #a39f96;
  --line: rgba(244, 241, 234, 0.14);
  --accent: #e8c27a;
  --wa: #25d366;
  --pad: clamp(16px, 4vw, 48px);
  --display: "Archivo", system-ui, sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
:lang(ar) { --display: "Alexandria", system-ui, sans-serif; --body: "Alexandria", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* loader */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; pointer-events: none; }
.loader-bar { width: 120px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.loader-bar::after { content: ""; position: absolute; inset: 0; background: var(--fg); transform: scaleX(0); transform-origin: left; animation: load 1s var(--ease) forwards; }
:dir(rtl) .loader-bar::after { transform-origin: right; }
@keyframes load { to { transform: scaleX(1); } }
.no-js .loader, .is-ready .loader { display: none; }

/* nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: 18px var(--pad); mix-blend-mode: difference; }
.nav-logo { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: 0.02em; }
.nav-logo span { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 32px); }
.nav-links { display: flex; gap: clamp(14px, 2.5vw, 32px); font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; }
:lang(ar) .nav-links { text-transform: none; letter-spacing: 0; font-size: 15px; }
.nav-links a { position: relative; padding: 12px 0; }
.nav-links a::after { content: ""; position: absolute; inset: auto 0 8px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform 0.5s var(--ease); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-lang { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px; border: 1px solid currentColor; border-radius: 99px; font-size: 14px; }
.nav-toggle { display: none; width: 44px; height: 44px; position: relative; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: currentColor; transition: transform 0.5s var(--ease); }
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 26px; }
.nav.is-open { mix-blend-mode: normal; }
.nav.is-open .nav-toggle span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav.is-open .nav-toggle span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* hero */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; display: grid; place-items: center; text-align: center; }
.hero-media { position: absolute; inset: 0; background: #151515 center / cover no-repeat; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s var(--ease); }
.hero-video.is-on { opacity: 1; }
.hero-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0.25), rgba(0,0,0,0.65)), linear-gradient(to bottom, rgba(0,0,0,0.35), transparent 30%, transparent 70%, var(--bg)); }
.hero-content { position: relative; padding: 0 var(--pad); }
.hero-role { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
:lang(ar) .hero-role { letter-spacing: 0; font-size: 15px; }
.hero-name { font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: clamp(64px, 15vw, 210px); line-height: 0.86; letter-spacing: -0.02em; margin: 0; text-transform: uppercase; }
:lang(ar) .hero-name { font-weight: 800; line-height: 1.12; font-size: clamp(64px, 14vw, 190px); letter-spacing: 0; }
.hero-name .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero-name .line:last-child { color: var(--accent); }
.hero-name .ch { display: inline-block; will-change: transform; }
.hero-tagline { font-size: clamp(17px, 2vw, 22px); font-weight: 300; margin: 18px 0 30px; }
.reveal-line { overflow: hidden; }
.reveal-line > span { display: inline-block; }
.reel-btn { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; padding: 8px 20px 8px 8px; border-radius: 99px; background: rgba(255,255,255,0.08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); transition: background 0.4s var(--ease), transform 0.4s var(--ease); }
:dir(rtl) .reel-btn { padding: 8px 8px 8px 20px; }
.reel-btn:hover { background: rgba(255,255,255,0.16); transform: translateY(-2px); }
.reel-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--fg); display: grid; place-items: center; }
.reel-icon svg { width: 16px; fill: var(--bg); margin-inline-start: 2px; }
:dir(rtl) .reel-icon svg { transform: scaleX(-1); margin-inline-start: 0; margin-inline-end: 2px; }
.hero-scroll { position: absolute; bottom: 28px; left: 50%; width: 1px; height: 54px; background: var(--line); overflow: hidden; }
.hero-scroll span { position: absolute; inset: 0; background: var(--fg); animation: drip 2.2s var(--ease) infinite; }
@keyframes drip { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* work */
.work { position: relative; }
.work-head { padding: clamp(80px, 12vw, 160px) var(--pad) 40px; display: flex; flex-wrap: wrap; gap: 24px; align-items: end; justify-content: space-between; }
.section-title { font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: clamp(36px, 6vw, 84px); line-height: 1; margin: 0; letter-spacing: -0.01em; }
:lang(ar) .section-title { letter-spacing: 0; line-height: 1.25; }
.panel { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; background: var(--bg); }
.panel-bg { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(40px) brightness(0.45) saturate(1.2); transform: scale(1.1); }
.panel-frame { position: relative; height: min(82svh, 860px); aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; box-shadow: 0 40px 120px rgba(0,0,0,0.6); background: #111; }
.is-landscape .panel-frame { height: auto; width: 100%; aspect-ratio: auto; position: absolute; inset: 0; border-radius: 0; }
.panel-video { width: 100%; height: 100%; object-fit: cover; }
.panel-label { position: absolute; inset-inline-start: var(--pad); bottom: clamp(24px, 6vh, 56px); max-width: min(40vw, 460px); }
.panel-count { display: block; font-size: 13px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.panel-title { font-family: var(--display); font-weight: 800; font-stretch: 108%; font-size: clamp(28px, 4vw, 60px); line-height: 1.02; margin: 0 0 10px; }
:lang(ar) .panel-title { line-height: 1.3; }
.panel-meta { font-size: 14px; color: var(--muted); }

/* about */
.about { position: relative; z-index: 2; background: var(--bg); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: center; padding: clamp(96px, 14vw, 180px) var(--pad); }
.about-photo { aspect-ratio: 4 / 5; overflow: hidden; border-radius: 12px; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); }
.about-body { font-size: clamp(20px, 2.4vw, 32px); line-height: 1.45; font-weight: 300; margin: 24px 0 40px; }
.about-body .w { display: inline-block; }
.brands-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); margin: 0 0 12px; font-weight: 400; }
:lang(ar) .brands-title { letter-spacing: 0; font-size: 15px; }
.brands { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 20px; font-weight: 600; }

/* contact */
.contact { position: relative; z-index: 2; background: var(--bg); text-align: center; padding: clamp(80px, 12vw, 160px) var(--pad); border-top: 1px solid var(--line); }
.contact-title { font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: clamp(40px, 8vw, 120px); line-height: 0.95; margin: 0 auto 20px; max-width: 14ch; }
:lang(ar) .contact-title { line-height: 1.25; }
.contact-body { color: var(--muted); font-size: 18px; margin: 0 0 36px; }
.contact-wa { display: inline-block; background: var(--wa); color: #06371f; font-weight: 700; font-size: 18px; padding: 18px 36px; border-radius: 99px; transition: transform 0.4s var(--ease); }
.contact-wa:hover { transform: scale(1.04); }
.contact-phone { color: var(--muted); margin: 18px 0 0; font-variant-numeric: tabular-nums; }
.footer { position: relative; z-index: 2; background: var(--bg); padding: 24px var(--pad); font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

/* floating whatsapp */
.wa-float { position: fixed; z-index: 60; bottom: max(18px, env(safe-area-inset-bottom)); inset-inline-end: 18px; display: flex; align-items: center; gap: 10px; background: var(--wa); color: #06371f; font-weight: 700; font-size: 14px; padding: 12px 18px 12px 14px; border-radius: 99px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); transition: transform 0.4s var(--ease); }
:dir(rtl) .wa-float { padding: 12px 14px 12px 18px; }
.wa-float:hover { transform: translateY(-3px); }
.wa-float svg { width: 22px; height: 22px; fill: currentColor; }

/* reel dialog */
.reel { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0,0,0,0.94); color: var(--fg); }
.reel[open] { display: grid; place-items: center; }
.reel::backdrop { background: rgba(0,0,0,0.8); }
.reel-video { max-width: 100vw; max-height: 100svh; height: 100svh; }
.reel-close { position: absolute; top: 14px; inset-inline-end: 18px; z-index: 2; font-size: 36px; line-height: 1; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.1); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links { position: fixed; top: 0; left: 0; width: 100vw; height: 100svh; z-index: -1; flex-direction: column; justify-content: center; align-items: center; gap: 8px; background: rgba(11,11,11,0.97); font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: 0; text-transform: none; opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0.4s; }
  :lang(ar) .nav-links { font-size: 34px; }
  .nav.is-open .nav-links { opacity: 1; visibility: visible; }
  .panel-frame { height: 72svh; }
  .panel-label { max-width: calc(100% - 2 * var(--pad)); bottom: 18px; text-shadow: 0 2px 16px rgba(0,0,0,0.8); }
  .about { grid-template-columns: 1fr; }
  .wa-float span { display: none; }
  .wa-float, :dir(rtl) .wa-float { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .loader { display: none; }
}
[dir="rtl"] .panel-count { text-align: right; }
@media (max-width: 760px) {
  .hero-video { filter: brightness(0.55) saturate(1.1); }
  .hero-shade { background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), rgba(0,0,0,0.75)), linear-gradient(to bottom, rgba(0,0,0,0.4), transparent 30%, transparent 70%, var(--bg)); }
}

/* sound toggle */
.sound-btn { position: absolute; bottom: 14px; inset-inline-end: 14px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); transition: transform 0.3s var(--ease), background 0.3s; }
.sound-btn:hover { transform: scale(1.08); background: rgba(0,0,0,0.75); }
.sound-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--fg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-btn .spk { fill: var(--fg); stroke: none; }
.sound-btn .on { display: none; }
.sound-btn[aria-pressed="true"] .on { display: inline; }
.sound-btn[aria-pressed="true"] .off { display: none; }
.sound-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.sound-btn[aria-pressed="true"] svg { stroke: var(--bg); }
.sound-btn[aria-pressed="true"] .spk { fill: var(--bg); }

/* home: link to the library */
.work-more { position: relative; z-index: 2; background: var(--bg); text-align: center; padding: clamp(56px, 8vw, 96px) var(--pad) 0; }
.more-btn { display: inline-flex; align-items: center; gap: 8px; padding: 16px 32px; border: 1px solid var(--fg); border-radius: 99px; font-size: 16px; transition: background 0.4s var(--ease), color 0.4s var(--ease); }
.more-btn:hover { background: var(--fg); color: var(--bg); }

/* library page */
.page-library .loader { display: none; }
.library { padding: clamp(110px, 14vw, 160px) var(--pad) clamp(64px, 8vw, 120px); }
.lib-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.lib-sub { color: var(--muted); font-size: 18px; margin: 16px 0 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: clamp(10px, 1.4vw, 18px); }
.tile { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: #161616; text-align: start; isolation: isolate; }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease), opacity 0.4s var(--ease); }
.tile video { opacity: 0; }
.tile.is-preview video { opacity: 1; }
.tile:hover img, .tile:hover video { transform: scale(1.04); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent 45%); z-index: 1; }
.tile-play { position: absolute; z-index: 2; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); opacity: 0; transform: scale(0.8); transition: all 0.4s var(--ease); }
.tile-play svg { width: 20px; fill: var(--fg); margin-inline-start: 3px; }
.tile:hover .tile-play, .tile:focus-visible .tile-play { opacity: 1; transform: scale(1); }
.tile-text { position: absolute; z-index: 2; inset: auto 14px 14px; display: grid; gap: 4px; }
.tile-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.tile-meta { font-size: 12px; color: var(--muted); }
@media (hover: none) { .tile-play { opacity: 1; transform: scale(1); } }

/* player prev/next + caption */
.reel-prev, .reel-next { position: absolute; top: 50%; z-index: 2; width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; font-size: 34px; line-height: 1; background: rgba(255,255,255,0.1); }
.reel-prev { inset-inline-start: 16px; }
.reel-next { inset-inline-end: 16px; }
:dir(rtl) .reel-prev, :dir(rtl) .reel-next { transform: scaleX(-1); }
.reel-caption { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0; text-align: center; font-size: 14px; color: var(--muted); pointer-events: none; }
.reel-video { height: calc(100svh - 64px); }
@media (max-width: 760px) {
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { border-radius: 10px; }
  .tile-text { inset: auto 10px 10px; }
  .tile-title { font-size: 13px; }
  .tile-play { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .reel-prev, .reel-next { top: auto; bottom: 48px; margin-top: 0; }
}
