/* ==================== Base & Variables ====================
   Palette matches the brand logo: near-black + warm cream, with a muted
   gold accent standing in for the old blue (logo itself is pure black/cream). */
:root{
  --bg: #0c0b09;
  --bg-alt: #121110;
  --surface: #1c1a17;
  --surface-2: #242220;
  --border: rgba(242, 238, 228, 0.10);
  --border-hover: rgba(242, 238, 228, 0.24);
  --silver: #cac4b6;
  --silver-dim: #8f8879;
  --silver-bright: #f2eee4;
  --navy: #1c1a17;
  --blue: #a9813f;
  --blue-light: #d4af6a;
  --blue-deep: #2b2013;
  --accent-gradient: linear-gradient(135deg, var(--blue-light), var(--silver));
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,0.6);
  --navbar-scrolled-bg: rgba(12,11,9,0.82);
  --radius: 16px;
  --font: 'Cairo', 'Tajawal', sans-serif;
  --ease: cubic-bezier(.19,1,.22,1);
}

/* Light theme — same variable names, only swapped when data-theme="light" is set.
   Background matches the logo's cream tone almost exactly. */
:root[data-theme="light"]{
  --bg: #f0ede4;
  --bg-alt: #e7e2d5;
  --surface: #ffffff;
  --surface-2: #f3efe4;
  --border: rgba(20,18,14,0.09);
  --border-hover: rgba(20,18,14,0.2);
  --silver: #4a4638;
  --silver-dim: #7a7464;
  --silver-bright: #16140f;
  --shadow-lg: 0 30px 60px -20px rgba(20,18,14,0.14);
  --navbar-scrolled-bg: rgba(240,237,228,0.85);
}

*,*::before,*::after{ box-sizing: border-box; margin:0; padding:0; }
html{ scroll-behavior: smooth; }
body{
  font-family: var(--font);
  background: var(--bg);
  color: var(--silver);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}
img{ max-width:100%; display:block; }
a{ text-decoration:none; color:inherit; }
ul{ list-style:none; }
button{ font-family: inherit; cursor:pointer; border:none; background:none; color:inherit; }
input, textarea, select{ font-family: inherit; }

.container{
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

::selection{ background: var(--blue-light); color: #100e0a; }

/* subtle noise overlay for texture */
.noise-overlay{
  position: fixed; inset:0; pointer-events:none; z-index: 2;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.cursor-glow{
  position: fixed; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,106,0.10), transparent 70%);
  pointer-events: none; z-index: 1; transform: translate(-50%,-50%);
  transition: opacity .3s ease;
  left: 50%; top: 50%;
}

/* ==================== Preloader ==================== */
.preloader{
  position: fixed; inset:0; background: var(--bg); z-index: 9999;
  display:flex; align-items:center; justify-content:center;
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
.preloader.hide{ opacity:0; visibility:hidden; }
.preloader-logo{
  font-size: 2rem; font-weight:800; letter-spacing: 1px; color: var(--silver-bright);
  animation: pulseFade 1.4s ease-in-out infinite;
}
.preloader-logo span{ color: var(--blue-light); }
@keyframes pulseFade{ 0%,100%{ opacity:.4 } 50%{ opacity:1 } }

/* ==================== Reveal Animation ==================== */
.reveal{
  opacity:0; transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.in-view{ opacity:1; transform: translateY(0); }

/* ==================== Navbar ==================== */
.navbar{
  position: fixed; top:0; left:0; right:0; z-index: 100;
  padding: 20px 0;
  transition: padding .35s ease, background .35s ease, border-color .35s ease;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled{
  padding: 12px 0;
  background: var(--navbar-scrolled-bg);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.navbar-inner{ display:flex; align-items:center; justify-content:space-between; gap: 24px; }
.brand{ display:flex; align-items:center; gap:10px; font-size: 1.3rem; font-weight: 800; color: var(--silver-bright); letter-spacing:.5px; }
.brand .dot{ color: var(--blue-light); }
.brand-logo{ height: 58px; width:auto; }
.brand-logo-dark{ display:block; }
.brand-logo-light{ display:none; }
:root[data-theme="light"] .brand-logo-dark{ display:none; }
:root[data-theme="light"] .brand-logo-light{ display:block; }
.brand-text{ display:none; align-items:center; }

/* ==================== Theme & language toggles ==================== */
.toggle-group{ display:flex; align-items:center; gap:10px; }
.theme-toggle{
  width: 42px; height:42px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border); color: var(--silver-bright); transition: all .3s ease; flex-shrink:0;
}
.theme-toggle:hover{ border-color: var(--blue-light); color: var(--blue-light); }
.theme-toggle svg{ width:19px; height:19px; }
.theme-toggle .icon-moon{ display:none; }
:root[data-theme="light"] .theme-toggle .icon-sun{ display:none; }
:root[data-theme="light"] .theme-toggle .icon-moon{ display:block; }

.lang-toggle{
  min-width: 42px; height:42px; padding: 0 14px; border-radius:999px; display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border); color: var(--silver-bright); font-size:.78rem; font-weight:800; letter-spacing:.5px;
  transition: all .3s ease; flex-shrink:0;
}
.lang-toggle:hover{ border-color: var(--blue-light); color: var(--blue-light); }

.nav-links{ display:flex; align-items:center; gap: 34px; }
.nav-links a{
  font-size: .95rem; font-weight:500; color: var(--silver-dim);
  position: relative; transition: color .25s ease;
}
.nav-links a::after{
  content:''; position:absolute; right:0; bottom:-6px; width:0; height:1px;
  background: var(--blue-light); transition: width .3s var(--ease);
}
.nav-links a:hover{ color: var(--silver-bright); }
.nav-links a:hover::after{ width:100%; }

.burger{ display:none; flex-direction:column; gap:5px; width:26px; z-index: 110; }
.burger span{ height:2px; background: var(--silver-bright); border-radius:2px; transition: transform .3s ease, opacity .3s ease; }
.burger.active span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.burger.active span:nth-child(2){ opacity:0; }
.burger.active span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* ==================== Buttons ==================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 14px 32px; border-radius: 999px; font-weight:700; font-size: .95rem;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s ease, color .3s ease, border-color .3s ease;
  white-space: nowrap;
}
.btn-primary{
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #100e0a;
  box-shadow: 0 10px 30px -8px rgba(212,175,106,0.45);
}
.btn-primary:hover{ transform: translateY(-3px); box-shadow: 0 16px 36px -8px rgba(212,175,106,0.6); }

.btn-outline{
  border: 1px solid var(--border-hover); color: var(--silver-bright);
  padding: 10px 26px;
}
.btn-outline:hover{ background: var(--surface); border-color: var(--blue-light); }

.btn-ghost{
  color: var(--silver-bright); border: 1px solid var(--border);
}
.btn-ghost:hover{ border-color: var(--border-hover); background: var(--surface); transform: translateY(-3px); }

/* ==================== Hero ==================== */
.hero{
  position: relative; min-height: 100vh; display:flex; align-items:center;
  padding: 140px 0 100px;
  overflow: hidden;
}
.hero-bg{ position:absolute; inset:0; z-index:0; }
.grid-lines{
  position:absolute; inset:0;
  background-image:
    linear-gradient(to left, rgba(242,238,228,0.05) 1px, transparent 1px),
    linear-gradient(to top, rgba(242,238,228,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 100%);
}
.glow{ position:absolute; border-radius:50%; filter: blur(100px); opacity:.5; }
.glow-1{ width:520px; height:520px; background: radial-gradient(circle, rgba(169,129,63,0.4), transparent 70%); top:-140px; left:-100px; }
.glow-2{ width:460px; height:460px; background: radial-gradient(circle, rgba(242,238,228,0.14), transparent 70%); bottom:-160px; right:-80px; }

.hero-inner{ position:relative; z-index:1; max-width: 820px; }
.hero-eyebrow{
  display:inline-block; font-size:.9rem; font-weight:600; color: var(--blue-light);
  padding: 8px 18px; border: 1px solid rgba(212,175,106,0.35); border-radius: 999px;
  background: rgba(212,175,106,0.08); margin-bottom: 26px;
}
.hero-title{
  font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 900; color: var(--silver-bright);
  line-height: 1.18; margin-bottom: 26px; letter-spacing: -.5px;
}
.hero-title-accent{
  display: inline-block; margin-top: 8px;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 500; letter-spacing: 0;
  background: var(--accent-gradient); -webkit-background-clip:text; background-clip:text; color:transparent;
}
.hero-desc{ font-size: 1.1rem; color: var(--silver-dim); max-width: 620px; margin-bottom: 40px; }
.hero-desc strong{ color: var(--silver-bright); font-weight:700; }
.hero-actions{ display:flex; gap: 18px; margin-bottom: 64px; flex-wrap: wrap; }

.hero-stats{ display:flex; gap: 52px; flex-wrap: wrap; }
.stat{ display:flex; flex-direction:column; }
.stat-num{ font-size: 2.4rem; font-weight:900; color: var(--silver-bright); }
.stat-plus{ font-size:1.6rem; font-weight:800; color: var(--blue-light); }
.stat-label{ font-size:.88rem; color: var(--silver-dim); margin-top:4px; }

.scroll-indicator{
  position:absolute; bottom: 36px; left:50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1.5px solid var(--border-hover); border-radius: 14px;
  display:flex; justify-content:center; padding-top:8px;
}
.scroll-indicator span{ width:4px; height:8px; border-radius:2px; background: var(--blue-light); animation: scrollDown 1.8s ease infinite; }
@keyframes scrollDown{ 0%{ opacity:1; transform: translateY(0);} 100%{ opacity:0; transform: translateY(14px);} }

/* ==================== Section Head ==================== */
.section-head{ max-width: 680px; margin-bottom: 60px; }
.section-head.center{ margin-left:auto; margin-right:auto; text-align:center; }
.section-tag{
  display:inline-block; font-size:.82rem; font-weight:700; letter-spacing:.5px; color: var(--blue-light);
  text-transform: uppercase; margin-bottom: 14px;
  padding: 6px 16px; border:1px solid rgba(212,175,106,0.3); border-radius:999px;
  background: rgba(212,175,106,0.06);
}
.section-title{ font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight:800; color: var(--silver-bright); line-height:1.3; }
.section-sub{ margin-top:16px; color: var(--silver-dim); font-size:1.02rem; }

section{ position: relative; padding: 120px 0; }

/* ==================== About ==================== */
.about{ background: var(--bg-alt); }
.about-grid{ display:grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items:start; }
.about-text p{ color: var(--silver-dim); margin-bottom: 20px; font-size: 1.02rem; }
.about-text strong{ color: var(--silver-bright); }
.about-badges{ display:flex; flex-wrap:wrap; gap:12px; margin-top: 28px; }
.badge{
  font-size:.85rem; font-weight:600; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--silver);
  background: var(--surface);
}

.frame-card{
  position:relative; border-radius: var(--radius); overflow:hidden; padding: 2px;
  background: linear-gradient(160deg, rgba(212,175,106,0.4), rgba(242,238,228,0.08) 40%, transparent 70%);
}
.frame-glow{
  position:absolute; inset:-40%; background: radial-gradient(circle at 30% 20%, rgba(212,175,106,0.25), transparent 60%);
  filter: blur(30px);
}
.frame-content{
  position:relative; background: var(--surface); border-radius: calc(var(--radius) - 2px);
  padding: 44px 36px;
}
.frame-role{ font-size:.82rem; color: var(--blue-light); font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
.frame-title{ font-size: 1.5rem; font-weight:800; color: var(--silver-bright); margin: 10px 0 4px; }
.frame-company{ color: var(--silver-dim); font-size:.95rem; }
.frame-divider{ height:1px; background: var(--border); margin: 26px 0; }
.frame-list li{ position:relative; padding-right: 22px; margin-bottom: 14px; color: var(--silver); font-size:.95rem; }
.frame-list li::before{
  content:''; position:absolute; right:0; top:8px; width:8px; height:8px; border-radius:2px;
  background: var(--blue-light); transform: rotate(45deg);
}

/* ==================== Services ==================== */
.services-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.service-card{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  padding: 36px 28px; transition: transform .4s var(--ease), border-color .4s ease, background .4s ease;
}
.service-card:hover{ transform: translateY(-8px); border-color: var(--border-hover); background: var(--surface-2); }
.service-icon{
  width:56px; height:56px; border-radius: 14px; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, rgba(212,175,106,0.18), rgba(242,238,228,0.06));
  color: var(--blue-light); margin-bottom: 22px;
}
.service-icon svg{ width: 28px; height:28px; }
.service-card h3{ font-size: 1.15rem; font-weight:700; color: var(--silver-bright); margin-bottom: 12px; }
.service-card p{ font-size: .92rem; color: var(--silver-dim); }

/* ==================== Portfolio ==================== */
.portfolio{ background: var(--bg-alt); }
.filters{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-bottom: 48px; }
.filter-btn{
  padding: 10px 24px; border-radius: 999px; font-size:.88rem; font-weight:600;
  color: var(--silver-dim); border: 1px solid var(--border); transition: all .3s ease;
}
.filter-btn:hover{ color: var(--silver-bright); border-color: var(--border-hover); }
.filter-btn.active{
  color: #100e0a; background: var(--accent-gradient); border-color: transparent;
}

.portfolio-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.p-card{
  position:relative; border-radius: var(--radius); overflow:hidden; aspect-ratio: 4/3;
  border: 1px solid var(--border); cursor: default;
  transition: transform .5s var(--ease), opacity .4s ease, border-color .4s ease;
}
.p-card:hover{ transform: translateY(-6px); border-color: var(--border-hover); }
.p-card.hidden-item{ display:none; }
.p-visual{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  transition: transform .6s var(--ease);
}
.p-card:hover .p-visual{ transform: scale(1.06); }
.p-visual svg{ width: 46%; height:46%; opacity:.9; color: rgba(242,238,228,0.85); }
.p-visual img{ width:100%; height:100%; object-fit:cover; display:block; }
.p-visual-fallback{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; }
/* Fixed dark chip regardless of theme: always floats over the thumbnail image. */
.p-play{
  position:absolute; top:14px; left:14px; width:34px; height:34px; border-radius:50%;
  background: rgba(10,9,7,0.6); color:#f2eee4; display:flex; align-items:center; justify-content:center;
  font-size:.75rem; backdrop-filter: blur(4px);
}

.p-overlay{
  position:absolute; inset:0; padding: 22px;
  display:flex; flex-direction:column; justify-content:flex-end;
  background: linear-gradient(to top, rgba(10,9,7,0.92) 10%, rgba(10,9,7,0.15) 60%, transparent 100%);
  opacity:0; transition: opacity .4s ease;
}
.p-card:hover .p-overlay{ opacity:1; }
.p-cat{ font-size:.75rem; font-weight:700; color: var(--blue-light); text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px; }
/* Fixed light colors (not theme-linked): this text always sits over the dark scrim above, in both themes. */
.p-title{ font-size: 1.05rem; font-weight:700; color: #f2eee4; }
.p-desc{
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  font-size:.82rem; color: rgba(242,238,228,0.75); margin-top:6px;
}

.portfolio-more{ text-align:center; margin-top: 48px; }
.portfolio-more p{ color: var(--silver-dim); font-size: .95rem; }

/* ==================== Experience / Timeline ==================== */
.timeline{ max-width: 780px; margin: 0 auto; position:relative; }
.timeline::before{
  content:''; position:absolute; top:0; bottom:0; right: 9px; width:1px;
  background: linear-gradient(to bottom, var(--blue-light), transparent);
}
.timeline-item{ position:relative; padding-right: 44px; padding-bottom: 52px; }
.timeline-item:last-child{ padding-bottom:0; }
.timeline-dot{
  position:absolute; right:0; top:6px; width:20px; height:20px; border-radius:50%;
  background: var(--bg); border: 2px solid var(--blue-light);
}
.timeline-dot::after{
  content:''; position:absolute; inset:4px; border-radius:50%; background: var(--blue-light);
}
.timeline-content{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  padding: 28px 30px;
}
.timeline-tag{
  display:inline-block; font-size:.75rem; font-weight:700; padding: 5px 14px; border-radius: 999px;
  background: var(--surface-2); color: var(--silver-dim); margin-bottom: 14px;
}
.timeline-tag.current{ background: rgba(212,175,106,0.18); color: var(--blue-light); }
.timeline-content h3{ font-size: 1.25rem; font-weight:800; color: var(--silver-bright); margin-bottom: 6px; }
.timeline-org{ font-size:.92rem; color: var(--blue-light); font-weight:600; margin-bottom: 14px; }
.timeline-org a{ color: inherit; border-bottom: 1px dashed currentColor; }
.timeline-desc{ font-size:.94rem; color: var(--silver-dim); }
.timeline-desc a{ color: var(--blue-light); font-weight:600; }

/* ==================== Episodes (dawah content CTA) ==================== */
.episodes-links{ display:flex; gap:16px; flex-wrap:wrap; justify-content:center; margin-top: 28px; }

/* ==================== Contact ==================== */
.contact-grid{ display:grid; grid-template-columns: 1.3fr .8fr; gap: 40px; }
.contact-form{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: 40px;
}
.form-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group{ margin-bottom: 22px; }
.form-group label{ display:block; font-size:.88rem; font-weight:600; color: var(--silver); margin-bottom: 8px; }
.form-group input, .form-group select, .form-group textarea{
  width:100%; padding: 13px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--silver-bright); font-size:.94rem; resize: vertical;
  transition: border-color .3s ease, background .3s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus{
  outline:none; border-color: var(--blue-light); background: var(--bg-alt);
}
.form-submit{ width:100%; }
.form-note{ margin-top: 14px; font-size:.88rem; color: var(--blue-light); min-height: 20px; text-align:center; }

.contact-info{ display:flex; flex-direction:column; gap: 18px; }
.info-card{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: 24px 26px;
}
.info-label{ display:block; font-size:.8rem; color: var(--silver-dim); margin-bottom: 8px; }
.info-value{ font-size: 1.05rem; font-weight:700; color: var(--silver-bright); }
.social-links{ display:flex; gap: 12px; margin-top: 6px; }
.social-btn{
  width: 46px; height:46px; border-radius: 12px; display:flex; align-items:center; justify-content:center;
  border: 1px solid var(--border); color: var(--silver); transition: all .3s ease;
}
.social-btn svg{ width:20px; height:20px; }
.social-btn:hover{ border-color: var(--blue-light); color: var(--blue-light); transform: translateY(-4px); }

/* ==================== Footer ==================== */
.footer{ border-top: 1px solid var(--border); padding: 34px 0; }
.footer-inner{ display:flex; align-items:center; justify-content:space-between; gap: 20px; flex-wrap:wrap; }
.footer-inner p{ font-size:.88rem; color: var(--silver-dim); }
.back-top{
  width: 40px; height:40px; border-radius:50%; border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; font-size:1.1rem;
  transition: all .3s ease;
}
.back-top:hover{ border-color: var(--blue-light); color: var(--blue-light); transform: translateY(-4px); }

/* ==================== Responsive ==================== */
@media (max-width: 980px){
  .services-grid{ grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid{ grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid{ grid-template-columns: 1fr; }
  .about-visual{ order:-1; }
}

@media (max-width: 760px){
  .nav-links{
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px); height: 100vh;
    background: var(--bg-alt); border-left: 1px solid var(--border);
    flex-direction: column; align-items:flex-start; justify-content:center; gap: 30px;
    padding: 40px; transform: translateX(100%); transition: transform .45s var(--ease);
    z-index: 105;
  }
  .nav-links.open{ transform: translateX(0); }
  .nav-links a{ font-size: 1.1rem; }
  .burger{ display:flex; }
  .brand-logo{ height: 46px; }
  .hero-stats{ gap: 30px; }
  .services-grid{ grid-template-columns: 1fr; }
  .portfolio-grid{ grid-template-columns: 1fr; }
  .form-row{ grid-template-columns: 1fr; }
  section{ padding: 84px 0; }
}

/* ==================== LTR (English) mirroring ====================
   Most flex layouts already mirror automatically via the dir attribute.
   These are the few rules using physical left/right that need an explicit flip. */
html[dir="ltr"] .timeline::before{ right:auto; left:9px; background: linear-gradient(to bottom, var(--blue-light), transparent); }
html[dir="ltr"] .timeline-item{ padding-right:0; padding-left:44px; }
html[dir="ltr"] .timeline-dot{ right:auto; left:0; }
html[dir="ltr"] .frame-list li{ padding-right:0; padding-left:22px; }
html[dir="ltr"] .frame-list li::before{ right:auto; left:0; }
html[dir="ltr"] .nav-links a::after{ right:auto; left:0; }
