/* ============================================================
   MNU PRODUCTION — Global Stylesheet
   Apple-inspired light theme · Black / White / Red · Bilingual
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --bg-soft: #f5f5f7;
  --ink: #111111;
  --ink-soft: #484848;
  --ink-muted: #86868b;
  --line: #e8e8e8;
  --line-strong: #d2d2d7;
  --accent: #e10600;
  --accent-dark: #b30500;
  --accent-soft: #fdecec;

  --display: 'Fraunces', 'Amiri', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --sans-ar: 'IBM Plex Sans Arabic', 'Inter', sans-serif;
  --display-ar: 'Amiri', 'Fraunces', serif;

  --max: 1280px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

[data-lang="ar"] body { font-family: var(--sans-ar); direction: rtl; }
[data-lang="ar"] h1, [data-lang="ar"] h2, [data-lang="ar"] h3, [data-lang="ar"] .display { font-family: var(--display-ar); }

[data-lang="en"] [lang="ar"], [data-lang="ar"] [lang="en"] { display: none !important; }

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease);
}
.nav-inner {
  max-width: var(--max);
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.logo .dot { color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}
.nav-links a {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 400;
  transition: color 0.25s var(--ease);
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -22px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.72rem;
  font-family: var(--sans);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  letter-spacing: 0.05em;
}
.lang-btn:hover { color: var(--ink); border-color: var(--ink); }
.lang-btn .active-lang { color: var(--accent); font-weight: 600; }

.menu-toggle { display: none; background: none; border: none; color: var(--ink); cursor: pointer; padding: 0.4rem; }

/* ============ LAYOUT ============ */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.page { padding-top: var(--nav-h); }
section { padding: 6rem 0; }

/* ============ TYPE ============ */
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.2rem;
  display: inline-block;
}

.display-1 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}
.display-1 em { font-style: italic; color: var(--accent); font-weight: 400; }

.display-2 {
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 1.2rem;
}
.display-2 em { font-style: italic; color: var(--accent); }

.display-3 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 640px;
}

.small-muted {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
[data-lang="ar"] .btn { font-family: var(--sans-ar); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-text {
  background: none;
  padding: 0;
  color: var(--accent);
  gap: 0.4rem;
  font-weight: 500;
}
.btn-text:hover { gap: 0.7rem; }
[data-lang="ar"] .btn-text svg, [data-lang="ar"] .btn .arrow { transform: scaleX(-1); }

.arrow-icon { display: inline-block; transition: transform 0.3s var(--ease); }

/* ============ HERO ============ */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 8rem 0 4rem;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.85) 60%, var(--bg) 100%);
  z-index: 1;
}
.hero-media video, .hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
}

/* fade + rise on load */
.reveal-stagger > * { opacity: 0; transform: translateY(30px); animation: rise 1s var(--ease-out) forwards; }
.reveal-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.reveal-stagger > *:nth-child(2) { animation-delay: 0.25s; }
.reveal-stagger > *:nth-child(3) { animation-delay: 0.4s; }
.reveal-stagger > *:nth-child(4) { animation-delay: 0.55s; }
.reveal-stagger > *:nth-child(5) { animation-delay: 0.7s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ SECTION HEADER ============ */
.section-head {
  max-width: 700px;
  margin-bottom: 3.5rem;
}
.section-head.center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ============ CARDS ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-soft);
  border-radius: 22px;
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  position: relative;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}
.card-body { padding: 2rem; }
.card h3 { font-family: var(--display); font-size: 1.5rem; font-weight: 500; margin-bottom: 0.8rem; line-height: 1.2; }
.card p { color: var(--ink-soft); font-size: 0.95rem; }

/* ============ WORK GRID ============ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}
.work-tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg-soft);
  cursor: pointer;
  transition: transform 0.5s var(--ease-out);
}
.work-tile:hover { transform: translateY(-4px); }
.work-tile .media {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.work-tile .media video, .work-tile .media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}
.work-tile:hover .media video, .work-tile:hover .media img { transform: scale(1.04); }

.work-tile .media.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f7 0%, #e8e8e8 100%);
  color: var(--ink-muted);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.1rem;
}

.work-tile .caption {
  padding: 1.3rem 1.5rem;
}
.work-tile .cat {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
  display: block;
}
.work-tile .name { font-family: var(--display); font-size: 1.15rem; font-weight: 500; line-height: 1.25; }

.work-tile .play-badge {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  font-weight: 500;
  z-index: 2;
}
[data-lang="ar"] .work-tile .play-badge { right: auto; left: 1rem; }

/* ============ FOOTER ============ */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding: 4rem 0 2rem;
  margin-top: 6rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line);
}
.footer-brand h3 { font-family: var(--display); font-size: 1.4rem; font-weight: 500; margin-bottom: 0.8rem; }
.footer-brand p { color: var(--ink-soft); font-size: 0.9rem; max-width: 320px; }
.footer-col h4 { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 1.2rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { color: var(--ink-soft); font-size: 0.88rem; transition: color 0.25s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--ink-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============ CTA BAND ============ */
.cta-band {
  background: var(--ink);
  color: var(--bg);
  padding: 6rem 0;
  text-align: center;
  border-radius: 32px;
  margin: 0 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(225, 6, 0, 0.25), transparent 60%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: white; margin-bottom: 1.2rem; }
.cta-band p { color: rgba(255,255,255,0.7); max-width: 500px; margin: 0 auto 2rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.2rem;
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .menu-toggle { display: block; }
  section { padding: 4rem 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; }
  .work-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   LEVEL 1 POLISH — Smooth scroll, custom cursor, text reveals,
   parallax, magnetic buttons. Added October 2025.
   ============================================================ */

/* Lenis smooth scroll resets */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Custom cursor (desktop only) */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, [role="button"], input, textarea, select, .clickable, .work-tile { cursor: none; }

  .cursor-dot, .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    mix-blend-mode: difference;
  }
  .cursor-dot {
    width: 6px; height: 6px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.2s var(--ease), height 0.2s var(--ease), opacity 0.2s;
  }
  .cursor-ring {
    width: 36px; height: 36px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
                border-color 0.3s, background 0.3s;
  }
  .cursor-ring.hovering {
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.7);
  }
  .cursor-dot.hovering { width: 0; height: 0; opacity: 0; }
  .cursor-ring.clicking { width: 28px; height: 28px; }
}

/* Reveal: text rises word-by-word */
.split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.split-word > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease-out);
}
.split-word.in > span {
  transform: translateY(0);
}

/* Stagger word reveals */
.split-word:nth-child(1) > span { transition-delay: 0.05s; }
.split-word:nth-child(2) > span { transition-delay: 0.10s; }
.split-word:nth-child(3) > span { transition-delay: 0.15s; }
.split-word:nth-child(4) > span { transition-delay: 0.20s; }
.split-word:nth-child(5) > span { transition-delay: 0.25s; }
.split-word:nth-child(6) > span { transition-delay: 0.30s; }
.split-word:nth-child(7) > span { transition-delay: 0.35s; }
.split-word:nth-child(8) > span { transition-delay: 0.40s; }
.split-word:nth-child(n+9) > span { transition-delay: 0.45s; }

/* Subtle parallax on images marked with data-parallax */
[data-parallax] {
  will-change: transform;
}

/* Magnetic button hover (slight pull toward cursor) */
.btn-magnetic {
  transition: transform 0.4s var(--ease-out);
}

/* Smooth image reveal on scroll */
.img-reveal {
  position: relative;
  overflow: hidden;
}
.img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: left;
  transition: transform 1.2s var(--ease-out);
}
.img-reveal.revealed::after {
  transform: scaleX(0);
  transform-origin: right;
}
.img-reveal img, .img-reveal video {
  transform: scale(1.15);
  transition: transform 1.5s var(--ease-out);
}
.img-reveal.revealed img, .img-reveal.revealed video {
  transform: scale(1);
}

/* Slightly more dramatic existing reveal */
.reveal {
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
}

/* Hero subtle fade-in entrance */
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.loaded { animation: heroFadeIn 0.8s var(--ease-out); }

/* Better link underlines (Apple-style) */
.nav-links a {
  position: relative;
}
.nav-links a:hover { color: var(--ink); }

/* Page transition overlay */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}
.page-transition.in {
  opacity: 1;
}
.page-transition.out {
  opacity: 0;
}

/* Stats counter — initial state is "not yet animated" */
.stat-num[data-target] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.stat-num[data-target].counted {
  opacity: 1;
  transform: translateY(0);
}

/* Slow continuous scroll marquee (decorative band) */
.scroll-marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0;
  background: var(--bg);
}
.scroll-marquee-track {
  display: inline-flex;
  gap: 4rem;
  animation: marqueeScroll 60s linear infinite;
  white-space: nowrap;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--ink-muted);
  align-items: center;
}
.scroll-marquee-track .dot { color: var(--accent); font-style: normal; }
@keyframes marqueeScroll {
  to { transform: translateX(-50%); }
}

/* Hero gets a subtle scale on scroll (parallax-feeling depth) */
.hero-scale {
  transition: transform 0.1s linear;
  will-change: transform;
}
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body { cursor: auto !important; }
  .cursor-dot, .cursor-ring { display: none !important; }
}
/* ============ UTILITIES ============ */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; } .mt-4 { margin-top: 4rem; }
.mb-1 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 2rem; } .mb-3 { margin-bottom: 3rem; }
.flex { display: flex; gap: 1rem; flex-wrap: wrap; }
.flex-center { justify-content: center; }
