/* ═══════════════════════════════════════════════════════════════
   سعودي ساوند ميكسر v2 — "الموقع كجلسة مكس سينمائية"
   هوية من عالم الصوت: timecode، قنوات مكسر، EQ حي، REC.
   حركة: CSS scroll-driven (مع فولباك IO) + prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #08090b;
  --surface: #0e1014;
  --surface-2: #13161b;
  --line: #1e222a;
  --amber: #f0a832;
  --amber-soft: rgba(240, 168, 50, .12);
  --rec: #ff453a;
  --text: #f2efe8;
  --muted: #8f897b;
  --font-ar-display: 'Alexandria', sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --max: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  font-size: 18px;               /* عربي: +12% عن اللاتيني */
  line-height: 1.85;             /* عربي: ≥1.8 */
  letter-spacing: 0;             /* عربي: ممنوع التباعد */
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); letter-spacing: .08em; }
.accent { color: var(--amber); }

/* ── حبيبات الفيلم ── */
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) }
  40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-2%) }
  80% { transform: translate(3%,3%) }
}

/* ── شريط تقدم القراءة (scroll-driven) ── */
.progress {
  position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 100;
  background: linear-gradient(90deg, var(--amber), #ffce6b);
  transform-origin: 0 50%; transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .progress { animation: progress linear both; animation-timeline: scroll(root); }
  @keyframes progress { to { transform: scaleX(1); } }
}

/* ── التنقل ── */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max); margin-inline: auto; padding: .9rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-ar-display); font-weight: 800; font-size: 1.05rem; }
.brand-en { color: var(--muted); font-size: .72rem; border: 1px solid var(--line); padding: .1rem .45rem; border-radius: 4px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; font-size: .95rem; }
.nav-links a { color: var(--muted); transition: color .25s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  color: var(--bg) !important; background: var(--amber); padding: .4rem 1.1rem;
  border-radius: 6px; font-weight: 700; transition: transform .2s, box-shadow .2s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--amber-soft); }

/* ── مؤشر REC ── */
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); display: inline-block; }
.rec-dot.blink { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.rec-live { color: var(--rec); display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; }

/* ═══════════ HERO ═══════════ */
.hero {
  min-height: 100svh; position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem 1.4rem 9rem;
  background:
    radial-gradient(1000px 500px at 85% 10%, rgba(240,168,50,.07), transparent 60%),
    radial-gradient(700px 400px at 10% 90%, rgba(255,69,58,.05), transparent 60%),
    var(--bg);
}
.hero-meta {
  position: absolute; top: 4.6rem; inset-inline: 0;
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--max); margin-inline: auto; padding-inline: 1.4rem;
  width: 100%; font-size: .8rem; color: var(--muted);
}
.hero-content { max-width: var(--max); margin-inline: auto; width: 100%; }
.hero-kicker { color: var(--amber); font-size: .85rem; margin-bottom: 1.4rem; opacity: 0; animation: rise .8s .2s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-title {
  font-family: var(--font-ar-display); font-weight: 900;
  font-size: clamp(2.6rem, 8.5vw, 6.4rem); line-height: 1.28;
  margin-bottom: 1.6rem;
}
.ht-line { display: block; overflow: hidden; }
.ht-word { display: inline-block; opacity: 0; transform: translateY(110%); animation: wordUp .9s cubic-bezier(.2,.7,.2,1) forwards; }
.w1 { animation-delay: .35s } .w2 { animation-delay: .48s }
.w3 { animation-delay: .62s } .w4 { animation-delay: .78s }
@keyframes wordUp { to { opacity: 1; transform: translateY(0); } }
@keyframes rise { to { opacity: 1; } }
.hero-sub { max-width: 620px; color: var(--muted); font-size: 1.08rem; margin-bottom: 2.4rem; opacity: 0; animation: rise .8s 1s forwards; }
.hero-sub strong { color: var(--text); }
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; opacity: 0; animation: rise .8s 1.15s forwards; }

.btn {
  display: inline-block; padding: .85rem 2rem; border-radius: 8px;
  font-weight: 700; font-size: 1rem; transition: transform .22s, box-shadow .22s, background .22s;
}
.btn-solid { background: var(--amber); color: var(--bg); }
.btn-solid:hover { transform: translateY(-3px); box-shadow: 0 10px 34px rgba(240,168,50,.3); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-3px); }
.btn-big { font-size: 1.15rem; padding: 1.05rem 2.6rem; direction: ltr; font-family: var(--font-mono); letter-spacing: 0; }

/* ── الـEQ الحي ── */
.eq {
  position: absolute; bottom: 0; inset-inline: 0; height: 90px;
  display: flex; align-items: flex-end; gap: 4px; padding-inline: 1.4rem;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.eq i {
  flex: 1; min-width: 3px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--amber), rgba(240,168,50,.25));
  height: 12%; opacity: .8;
  animation: eqBounce var(--dur, 1.1s) ease-in-out var(--del, 0s) infinite alternate;
}
@keyframes eqBounce { to { height: var(--peak, 70%); } }
.eq-footer { position: static; height: 46px; opacity: .5; margin-bottom: 1rem; }

/* ═══════════ الأقسام العامة ═══════════ */
main { position: relative; z-index: 2; }
section { padding: 5.5rem 1.4rem; max-width: var(--max); margin-inline: auto; }
.sec-head { margin-bottom: 3rem; max-width: 640px; }
.sec-tag { color: var(--amber); font-size: .78rem; display: block; margin-bottom: .9rem; }
.sec-head h2 { font-family: var(--font-ar-display); font-weight: 800; font-size: clamp(1.7rem, 4.2vw, 2.7rem); line-height: 1.35; margin-bottom: .8rem; }
.sec-head p { color: var(--muted); }

/* ── ظهور العناصر بالسكرول ── */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@supports (animation-timeline: view()) {
  .reveal { transition: none; animation: reveal .9s cubic-bezier(.2,.7,.2,1) both; animation-timeline: view(); animation-range: entry 0% entry 42%; }
  @keyframes reveal { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
}

/* ═══════════ CLIENTS MARQUEE ═══════════ */
.clients { padding-block: 2.4rem; border-block: 1px solid var(--line); max-width: none; }
.clients-label { text-align: center; color: var(--muted); font-size: .75rem; margin-bottom: 1.1rem; }
.marquee { overflow: hidden; }
.marquee-track {
  display: flex; align-items: center; gap: 3rem; width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(50%); } } /* RTL: يتحرك يمين */
.client-name { font-family: var(--font-ar-display); font-weight: 700; font-size: 1.5rem; color: var(--muted); transition: color .3s; white-space: nowrap; }
.client-name:hover { color: var(--amber); }
.client-sep { color: var(--amber); opacity: .5; font-size: .7rem; }

/* ═══════════ STATS ═══════════ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.2rem; text-align: center; padding-block: 4rem; }
.stat { padding: 1.6rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stat-num, .stat-plus { font-family: var(--font-mono); font-size: 2.6rem; font-weight: 500; color: var(--amber); }
.stat-label { display: block; color: var(--muted); font-size: .92rem; margin-top: .3rem; }

/* ═══════════ SHOWREEL ═══════════ */
.reel-frame { border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: var(--surface); box-shadow: 0 30px 80px rgba(0,0,0,.5); }

/* lite-youtube */
.lite-yt { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; cursor: pointer; background: #000; }
.lite-yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .3s, transform .5s; }
.lite-yt:hover img { opacity: 1; transform: scale(1.03); }
.lite-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play-btn {
  position: absolute; inset: 0; margin: auto; width: 74px; height: 74px;
  border-radius: 50%; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--amber) 92%, #fff); color: var(--bg);
  display: grid; place-items: center;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 0 0 0 rgba(240,168,50,.4);
}
.lite-yt:hover .play-btn { transform: scale(1.12); box-shadow: 0 0 0 16px rgba(240,168,50,.12); }
.work-grid .play-btn { width: 54px; height: 54px; }

/* ═══════════ FILMS WALL ═══════════ */
.films-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.3rem; }
.films-grid .film:first-child { grid-row: span 1; }
@media (min-width: 900px) {
  .films-grid { grid-template-columns: repeat(5, 1fr); }
  .films-grid .film:first-child { grid-column: span 2; grid-row: span 1; } /* كسر متعمد للشبكة */
}
.film {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .35s;
}
.film img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 2/2.9; transition: transform .6s; }
.film:hover { transform: translateY(-8px); border-color: var(--amber); box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px var(--amber-soft); }
.film:hover img { transform: scale(1.05); }
.film-laurel {
  position: absolute; bottom: 0; inset-inline: 0; padding: 2rem .9rem .8rem;
  background: linear-gradient(0deg, rgba(5,6,8,.95), transparent);
  font-size: .85rem; font-weight: 700;
}
.film-laurel.gold { color: var(--amber); }
.films-more { margin-top: 2rem; }
.link-arrow { color: var(--amber); font-weight: 700; border-bottom: 1px solid transparent; transition: border-color .25s; }
.link-arrow:hover { border-color: var(--amber); }

/* ═══════════ SERVICES = CHANNELS ═══════════ */
.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.3rem; }
.channel {
  position: relative; padding: 1.8rem 1.6rem 1.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  transition: transform .3s, border-color .3s, background .3s;
}
.channel:nth-child(even) { transform: translateY(14px); } /* إيقاع غير متناظر */
.channel:hover { border-color: var(--amber); background: var(--surface-2); transform: translateY(-6px); }
.channel:nth-child(even):hover { transform: translateY(8px); }
.ch-num { color: var(--amber); font-size: .75rem; }
.channel h3 { font-family: var(--font-ar-display); font-weight: 700; font-size: 1.25rem; margin: .7rem 0 .5rem; }
.channel p { color: var(--muted); font-size: .95rem; }
.ch-fader { position: absolute; top: 1.6rem; inset-inline-end: 1.4rem; display: flex; gap: 4px; align-items: flex-end; height: 26px; }
.ch-fader i { width: 4px; border-radius: 2px; background: var(--amber); opacity: .5; height: calc(var(--lvl) * 100%); transition: height .4s, opacity .3s; }
.channel:hover .ch-fader i { opacity: 1; animation: eqBounce 0.9s ease-in-out infinite alternate; --peak: 100%; }

/* ═══════════ GEAR ═══════════ */
.gear-wrap { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .gear-wrap { grid-template-columns: 1fr 1.3fr; align-items: start; } }
.gear-list { list-style: none; display: grid; gap: .9rem; }
.gear-list li {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .3s, transform .3s;
}
.gear-list li:hover { border-color: var(--amber); transform: translateX(-6px); }
.g-tag { color: var(--amber); font-size: .7rem; border: 1px solid var(--amber-soft); background: var(--amber-soft); padding: .2rem .5rem; border-radius: 5px; min-width: 52px; text-align: center; }
.gear-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.gear-photos img { border-radius: 12px; border: 1px solid var(--line); aspect-ratio: 4/3; object-fit: cover; transition: transform .4s, border-color .3s; }
.gear-photos img:first-child { grid-column: span 2; aspect-ratio: 21/9; }
.gear-photos img:hover { transform: scale(1.02); border-color: var(--amber); }

/* ═══════════ TEAM ═══════════ */
.roles { display: flex; flex-wrap: wrap; gap: .9rem; }
.role {
  font-family: var(--font-mono); font-size: .88rem; padding: .7rem 1.4rem;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  transition: all .3s;
}
.role:hover { color: var(--amber); border-color: var(--amber); transform: translateY(-3px); }

/* ═══════════ WORK GRID ═══════════ */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.work-grid .lite-yt { border: 1px solid var(--line); border-radius: 12px; }
.work-grid .lite-yt:hover { border-color: var(--amber); }

/* ═══════════ QUOTE ═══════════ */
.quote { text-align: center; padding-block: 6rem; }
.quote blockquote {
  font-family: var(--font-ar-display); font-weight: 700;
  font-size: clamp(1.4rem, 3.6vw, 2.3rem); line-height: 1.7; max-width: 820px; margin-inline: auto;
}
.quote cite { display: block; margin-top: 1.4rem; font-family: var(--font-ar); font-style: normal; font-weight: 400; font-size: 1rem; color: var(--muted); }

/* ═══════════ CONTACT ═══════════ */
.contact { max-width: none; background: linear-gradient(180deg, transparent, rgba(240,168,50,.05)); border-top: 1px solid var(--line); }
.contact-inner { max-width: var(--max); margin-inline: auto; text-align: center; padding-block: 3rem; }
.contact h2 { font-family: var(--font-ar-display); font-weight: 900; font-size: clamp(2rem, 6vw, 3.6rem); margin-block: 1rem 1rem; }
.contact p { color: var(--muted); max-width: 520px; margin: 0 auto 2.4rem; }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.8rem; margin-top: 2.6rem; }
.socials a { font-family: var(--font-mono); font-size: .9rem; color: var(--muted); border-bottom: 1px solid transparent; transition: color .25s, border-color .25s; }
.socials a:hover { color: var(--amber); border-color: var(--amber); }
.contact-loc { margin-top: 2.6rem; font-size: .8rem; color: var(--muted); }

/* ═══════════ FOOTER ═══════════ */
.footer { text-align: center; padding: 2.4rem 1.4rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; position: relative; z-index: 2; }
.footer .rec-dot { width: 7px; height: 7px; }

/* ═══════════ موبايل ═══════════ */
@media (max-width: 720px) {
  .nav-links { gap: 1rem; font-size: .85rem; }
  .nav-links a:not(.nav-cta):nth-child(3), .nav-links a:not(.nav-cta):nth-child(4) { display: none; }
  .brand-en { display: none; }
  .hero { padding-bottom: 7rem; }
  .hero-meta { font-size: .68rem; }
  .channel:nth-child(even) { transform: none; }
  .channel:nth-child(even):hover { transform: translateY(-6px); }
  section { padding-block: 3.6rem; }
}

/* ═══════════ تقليل الحركة ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ht-word, .hero-kicker, .hero-sub, .hero-ctas { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* منع كسر العبارات المركّبة بالفوتر على الشاشات الضيقة */
.nowrap { white-space: nowrap; }
