/* ============================================================
   MDSALS — Legal & Strategic Advisory
   style.css — Main Stylesheet
   ============================================================ */

/* ── CSS Reset & Box Sizing ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:               #0B0B0B;
  --bg2:              #111111;
  --silver:           #C0C0C0;
  --hi-silver:        #E5E5E5;
  --green:            #6FAF73;
  --text:             #F5F5F5;
  --text2:            rgba(245, 245, 245, 0.55);
  --card-bg:          rgba(255, 255, 255, 0.015);
  --card-border:      rgba(192, 192, 192, 0.08);
  --card-hover-border:rgba(192, 192, 192, 0.18);
  --nav-bg:           rgba(11, 11, 11, 0.85);
  --section-divider:  rgba(192, 192, 192, 0.06);
  --logo-filter:      invert(1) hue-rotate(180deg) brightness(1.2);
  
  --font-en:          'Outfit', sans-serif;
  --font-ar:          'Noto Kufi Arabic', sans-serif;
  --ease-luxury:      cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out:      cubic-bezier(0.65, 0, 0.35, 1);
  
  transition: background 0.5s var(--ease-luxury), color 0.5s var(--ease-luxury);
}

[data-theme="light"] {
  --bg:               #FFFFFF;
  --bg2:              #F5F5F5;
  --silver:           #666666;
  --hi-silver:        #222222;
  --text:             #111111;
  --text2:            rgba(17, 17, 17, 0.55);
  --card-bg:          rgba(0, 0, 0, 0.02);
  --card-border:      rgba(0, 0, 0, 0.08);
  --card-hover-border:rgba(0, 0, 0, 0.18);
  --nav-bg:           rgba(255, 255, 255, 0.85);
  --section-divider:  rgba(0, 0, 0, 0.06);
  --logo-filter:      none;
}

/* ── Bilingual Display Logic ── */
[lang="ar"] .en { display: none !important; }
[lang="en"] .ar { display: none !important; }

[lang="en"] body {
  font-family: var(--font-en);
  letter-spacing: -0.01em;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  line-height: 1.8;
  overflow-x: hidden;
}

/* ============================================================
   LOADER
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s var(--ease-in-out), transform 0.8s var(--ease-in-out), visibility 0.8s;
}

#loader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.94);
}

#loader img {
  width: 140px;
  filter: var(--logo-filter);
  margin-bottom: 25px;
  animation: logoEntrance 1.5s var(--ease-luxury) forwards;
}

.loader-bar {
  width: 120px;
  height: 1px;
  background: rgba(192, 192, 192, 0.1);
  position: relative;
  overflow: hidden;
}

.loader-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--silver);
  transform: translateX(-100%);
  animation: barProgress 1.5s var(--ease-luxury) forwards;
}

@keyframes barProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}

@keyframes logoEntrance {
  0% { opacity: 0; transform: scale(0.98); filter: blur(5px) var(--logo-filter); }
  100% { opacity: 1; transform: scale(1); filter: blur(0px) var(--logo-filter); }
}

/* Page entrance */
body {
  opacity: 0;
  transition: opacity 1s var(--ease-in-out);
}

body.loaded {
  opacity: 1;
}

/* ============================================================
   NAVBAR
   ============================================================ */
nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  padding: 30px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: 0.5s var(--ease-luxury);
}

nav.scrolled {
  padding: 18px 60px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--section-divider);
}

.nav-logo img {
  width: 75px;
  filter: var(--logo-filter);
  transition: 0.4s var(--ease-luxury);
}

.nav-links {
  display: flex;
  gap: 35px;
  list-style: none;
}

.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: 0.3s var(--ease-luxury);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.control-btn {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--silver);
  transition: 0.3s var(--ease-luxury);
}

.control-btn:hover {
  border-color: var(--green);
  color: var(--green);
  transform: scale(1.1);
}

.lang-toggle {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
}

/* Hide sun in dark, moon in light */
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
.sr {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s var(--ease-luxury), transform 1.2s var(--ease-luxury);
}

.sr.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.2s; }
.reveal-delay-2 { transition-delay: 0.4s; }
.reveal-delay-3 { transition-delay: 0.6s; }

.soft-zoom-img {
  overflow: hidden;
  border-radius: 4px;
}

.soft-zoom-img img {
  transform: scale(1.1);
  transition: transform 2.5s var(--ease-luxury);
}

.visible .soft-zoom-img img {
  transform: scale(1);
}

/* ============================================================
   LAYOUT
   ============================================================ */
section {
  padding: 160px 10%;
}

.section-tag {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 20px;
  display: block;
  font-weight: 600;
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  color: var(--hi-silver);
  margin-bottom: 60px;
  line-height: 1.2;
}

#contact .section-title {
  margin-bottom: 20px;
  text-align: center;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text2);
  margin-bottom: 60px;
  max-width: 800px;
  font-weight: 400;
  line-height: 1.6;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 50px;
  border-radius: 2px;
  transition: 0.6s var(--ease-luxury);
}

.card:hover {
  border-color: var(--green);
  transform: translateY(-10px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

.card h4 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--hi-silver);
}

.card p {
  font-size: 1rem;
  color: var(--text2);
  line-height: 1.9;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo img {
  width: 200px;
  filter: var(--logo-filter);
}

/* ============================================================
   AMBITION
   ============================================================ */
#ambition { text-align: center; }

.ambition-quote {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  max-width: 1000px;
  margin: 0 auto 80px;
  font-weight: 300;
  line-height: 2.2;
  color: var(--hi-silver);
}

.ambition-portrait {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 30px;
  filter: grayscale(0.1) brightness(1.1);
  border: 1px solid var(--card-border);
}

.ambition-info {
  margin-top: 10px;
}

.ambition-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--hi-silver);
  line-height: 1.6;
  margin-bottom: 12px;
}

.ambition-role {
  font-size: 1rem;
  color: var(--text2);
  line-height: 1.6;
  font-weight: 400;
}

/* ============================================================
   PERSONAL WORD
   ============================================================ */
#word {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 100px;
  align-items: center;
}

.word-img-wrap {
  position: relative;
}

.word-img {
  width: 100%;
  height: 600px;
  object-fit: cover;
  object-position: top center;
}

.word-title-gradient {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: linear-gradient(90deg, #FFFFFF, var(--silver));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 40px;
}

[data-theme="light"] .word-title-gradient {
  background: linear-gradient(90deg, #111111, #555555);
  background-clip: text;
  -webkit-background-clip: text;
}

.signature-block {
  margin-top: 80px;
}

.signature-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.signature-logo {
  max-width: 100px;
  filter: var(--logo-filter);
  opacity: 0.6;
}

/* ============================================================
   CONTACT
   ============================================================ */
#contact { text-align: center; }
.contact-items {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text2);
  text-decoration: none;
  font-weight: 400;
  transition: 0.3s;
}

.contact-item:hover { color: var(--hi-silver); }
.contact-item svg { width: 22px; stroke: var(--green); }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 60px 10%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--section-divider);
}

footer img { width: 60px; filter: var(--logo-filter); opacity: 0.4; }

.menu-toggle {
  display: none;
  z-index: 1000;
}

.menu-toggle svg {
  width: 22px;
  stroke: var(--hi-silver);
}

/* ============================================================
   MOBILE & RESPONSIVENESS
   ============================================================ */

@media (max-width: 1024px) {
  nav { padding: 20px 5%; }
  
  #word { 
    grid-template-columns: 1fr; 
    gap: 60px; 
    text-align: center; 
  }
  
  .word-img { height: 450px; }
  
  .signature-block { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
  }
}

@media (max-width: 850px) {
  .menu-toggle { display: flex; }
  
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    transform: translateY(-100%);
    transition: transform 0.6s var(--ease-luxury);
    z-index: 900;
  }
  
  .nav-links.open { transform: translateY(0); }
  
  .nav-links a { font-size: 1.5rem; }
  
  .cards-grid { grid-template-columns: 1fr; }
  
  .ambition-quote { font-size: 1.6rem; }
  .ambition-portrait { width: 180px; height: 180px; }
}

@media (max-width: 600px) {
  section { padding: 100px 6%; }
  
  .word-title-gradient { font-size: 2.2rem; margin-bottom: 30px; }
  
  .hero-logo img { width: 160px; }
  
  .contact-items { gap: 30px; }
  
  footer {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }
  
  #loader img { width: 100px; }
  
  .card { padding: 40px 30px; }
}

/* Landscape / Small Height adjust */
@media (max-height: 500px) and (orientation: landscape) {
  .nav-links { gap: 15px; }
  .nav-links a { font-size: 1rem; }
}
