/* ============================================================
   MEZNA AI — mezna.ai
   Dark cinematic design system
   EN: PP Neue Montreal · AR: Tabliq (headings) + Noto Sans Arabic
   ============================================================ */

@font-face {
  font-family: "Damoon";
  src: url("../fonts/DAMOON-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Damoon";
  src: url("../fonts/DAMOON-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Damoon";
  src: url("../fonts/DAMOON-Bold.ttf") format("truetype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07070c;
  --bg-2: #0c0c14;
  --ink: #f4f2f7;
  --ink-dim: rgba(244, 242, 247, 0.62);
  --ink-faint: rgba(244, 242, 247, 0.38);
  --magenta: #f326b8;
  --violet: #8a2df0;
  --grad: linear-gradient(96deg, #ff3dc8 0%, #b32ee8 55%, #7a2df0 100%);
  --card: rgba(255, 255, 255, 0.035);
  --card-border: rgba(255, 255, 255, 0.08);
  --radius: 20px;
  --font-display: "PP Neue Montreal", "Neue Montreal", Inter, system-ui, sans-serif;
  --font-body: "PP Neue Montreal", "Neue Montreal", Inter, system-ui, sans-serif;
  --font-logo: "Poppins", system-ui, sans-serif;
  --nav-h: 76px;
}

html[lang="ar"] {
  --font-display: "Damoon", "Noto Sans Arabic", system-ui, sans-serif;
  --font-body: "Damoon", "Noto Sans Arabic", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.lenis { height: auto; scroll-behavior: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { letter-spacing: 0; line-height: 1.25; }

h2 { font-size: clamp(2.4rem, 5.5vw, 4.4rem); }
h3 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
h4 { font-size: 1.1rem; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--magenta); color: #fff; }

/* Gradient text */
.grad-text, .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-logo { font-family: var(--font-logo); font-weight: 700; font-size: 2.4rem; color: var(--ink); }
.loader-bar { width: 160px; height: 2px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 40%; background: var(--grad); border-radius: 2px; animation: loadslide 1.1s ease-in-out infinite; }
@keyframes loadslide { 0% { transform: translateX(-100%);} 100% { transform: translateX(400%);} }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 clamp(20px, 4vw, 56px);
  transition: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s;
}
.nav.scrolled {
  background: rgba(7, 7, 12, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.nav-logo { font-family: var(--font-logo); font-weight: 700; font-size: 1.55rem; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: clamp(18px, 2.6vw, 38px); }
.nav-links a { font-size: 0.92rem; font-weight: 500; color: var(--ink-dim); transition: color 0.25s; position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--grad); border-radius: 2px; transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 14px; }

.lang-toggle {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.16);
  color: var(--ink); border-radius: 999px; padding: 8px 16px;
  font-family: "Damoon", "Noto Sans Arabic", var(--font-display); font-size: 0.88rem; cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}
.lang-toggle:hover { background: rgba(255,255,255,0.1); border-color: rgba(243,38,184,0.5); }
html[lang="ar"] .lang-toggle { font-family: var(--font-display); }
.lang-toggle-mm { font-size: 1.1rem; padding: 12px 28px; }

.nav-burger { display: none; background: none; border: 0; cursor: pointer; width: 44px; height: 44px; position: relative; z-index: 130; flex-shrink: 0; }
.nav-burger span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 6px auto; border-radius: 2px; transition: transform 0.35s, opacity 0.35s; }
.nav-burger.open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(7,7,12,0.96); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6vh;
  opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: var(--ink); }
.mobile-menu .mm-cta { font-size: 1.2rem; padding: 14px 34px; border-radius: 999px; background: var(--grad); -webkit-text-fill-color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 32px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s;
  will-change: transform;
}
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 32px rgba(220, 45, 200, 0.35);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 44px rgba(220, 45, 200, 0.5); }
.btn-ghost {
  border: 1px solid rgba(255,255,255,0.22); color: var(--ink);
  background: rgba(255,255,255,0.04);
}
.btn-ghost:hover { transform: translateY(-2px); background: rgba(255,255,255,0.09); }
.btn-small { padding: 10px 22px; font-size: 0.88rem; }
.btn-big { padding: 20px 46px; font-size: clamp(1.1rem, 2.4vw, 1.5rem); }

/* ---------- Sections ---------- */
.section { padding: clamp(90px, 12vw, 160px) clamp(20px, 6vw, 80px); max-width: 1440px; margin: 0 auto; }
.section-head { margin-bottom: clamp(44px, 6vw, 80px); }
.section-sub { max-width: 680px; color: var(--ink-dim); margin-top: 22px; }
.eyebrow {
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.22em; color: var(--ink-faint); margin-bottom: 18px;
}
html[lang="ar"] .eyebrow { letter-spacing: 0.05em; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-video { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(7,7,12,0.68), rgba(7,7,12,0.68)),
    radial-gradient(ellipse at center, transparent 20%, rgba(7,7,12,0.6) 72%, rgba(7,7,12,0.95) 100%),
    linear-gradient(to top, var(--bg) 0%, transparent 30%),
    linear-gradient(to bottom, rgba(7,7,12,0.55) 0%, transparent 24%);
}
.hero-content { position: relative; z-index: 2; text-align: center; padding: 0 20px; max-width: 1100px; text-shadow: 0 2px 24px rgba(0,0,0,0.55); }
.hero-eyebrow {
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.32em; color: var(--ink-dim); margin-bottom: 26px;
}
html[lang="ar"] .hero-eyebrow { letter-spacing: 0.06em; }
.hero-title {
  font-size: clamp(2.9rem, 8.6vw, 7rem);
  line-height: 0.98; letter-spacing: -0.03em; margin-bottom: 30px;
}
html[lang="ar"] .hero-title { line-height: 1.22; letter-spacing: 0; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero-title .line > span { display: inline-block; }
.hero-sub { color: var(--ink-dim); font-size: clamp(1rem, 1.8vw, 1.25rem); margin-bottom: 40px; max-width: 760px; margin-left: auto; margin-right: auto; }
.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 1.5px solid rgba(255,255,255,0.3); border-radius: 14px;
}
.scroll-hint span {
  position: absolute; top: 8px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px;
  background: var(--grad); border-radius: 3px;
  animation: scrollhint 1.8s ease-in-out infinite;
}
@keyframes scrollhint { 0%,100% { transform: translateY(0); opacity: 1;} 55% { transform: translateY(12px); opacity: 0.2;} }

/* ---------- Manifesto ---------- */
.manifesto { max-width: 1100px; }
.manifesto-text {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 4.2vw, 3.2rem); line-height: 1.25; letter-spacing: -0.015em;
}
html[lang="ar"] .manifesto-text { letter-spacing: 0; line-height: 1.5; }
.manifesto-text em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.manifesto-text .word { opacity: 0.14; display: inline; }

/* ---------- Pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
.pillar {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: clamp(28px, 3vw, 44px);
  position: relative; overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s;
}
.pillar::before {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(243, 38, 184, 0.12), transparent 45%);
  transition: opacity 0.4s; pointer-events: none;
}
.pillar:hover { transform: translateY(-6px); border-color: rgba(243, 38, 184, 0.35); }
.pillar:hover::before { opacity: 1; }
.pillar-num {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 48px;
}
.pillar h3 { margin-bottom: 16px; }
.pillar p { color: var(--ink-dim); font-size: 0.99rem; margin-bottom: 22px; }
.pillar ul { list-style: none; }
.pillar li { padding: 9px 0; border-top: 1px solid rgba(255,255,255,0.07); color: var(--ink-faint); font-size: 0.9rem; }
.pillar li::before { content: "→ "; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
html[dir="rtl"] .pillar li::before { content: "← "; }

/* ---------- Media features (mascot / production / engine) ---------- */
.media-feature { position: relative; }

/* Desktop: full-bleed background */
@media (min-width: 821px) {
  .mascot { min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
  .mascot-media { position: absolute; inset: 0; }
  .mascot-media video, .mascot-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
  #mascot2 .mascot-media video { object-position: center 72%; }
  .mascot::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(7,7,12,0.94) 6%, rgba(7,7,12,0.25) 45%, transparent 70%),
                linear-gradient(to bottom, var(--bg) 0%, transparent 18%);
    pointer-events: none;
  }
  .mascot-copy { position: relative; z-index: 2; padding: clamp(50px, 7vw, 110px) clamp(20px, 6vw, 80px); max-width: 780px; }

  .feature { min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
  .feature-media { position: absolute; inset: 0; }
  .feature-video { width: 100%; height: 100%; object-fit: cover; }
  .feature-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to right, rgba(7,7,12,0.9) 0%, rgba(7,7,12,0.55) 46%, rgba(7,7,12,0.15) 100%),
                linear-gradient(to top, var(--bg) 2%, transparent 24%),
                linear-gradient(to bottom, var(--bg) 0%, transparent 16%);
  }
  html[dir="rtl"] .feature-overlay {
    background: linear-gradient(to left, rgba(7,7,12,0.9) 0%, rgba(7,7,12,0.55) 46%, rgba(7,7,12,0.15) 100%),
                linear-gradient(to top, var(--bg) 2%, transparent 24%),
                linear-gradient(to bottom, var(--bg) 0%, transparent 16%);
  }
  .feature-content { position: relative; z-index: 2; padding: clamp(80px, 10vw, 140px) clamp(20px, 6vw, 80px); max-width: 860px; }
}

/* Mobile: stacked — full-width 16:9 video block + copy below (nothing gets cropped) */
@media (max-width: 820px) {
  .media-feature { padding: 56px 0 8px; }
  .mascot-media, .feature-media { position: relative; inset: auto; }
  .feature-media-box {
    margin: 0 16px; border-radius: 16px; overflow: hidden;
    border: 1px solid var(--card-border);
    aspect-ratio: 16/9; background: var(--bg-2);
  }
  .feature-media-box video, .feature-media-box img { width: 100%; height: 100%; object-fit: cover; }
  .feature-overlay { display: none; }
  .mascot::after { display: none; }
  .mascot-copy, .feature-content { padding: 30px 22px 42px; }
}

.feature-content > p, .mascot-copy > p:last-child { color: var(--ink-dim); margin: 24px 0 36px; max-width: 560px; font-size: clamp(1rem, 1.6vw, 1.15rem); }
.mascot-copy > p:last-child { margin-bottom: 0; }

.engine-points { display: grid; gap: 18px; margin-top: 34px; max-width: 620px; }
.engine-point {
  background: rgba(7,7,12,0.55); backdrop-filter: blur(8px);
  border: 1px solid var(--card-border); border-radius: 16px; padding: 22px 26px;
}
.engine-point h4 { margin-bottom: 8px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.engine-point p { color: var(--ink-dim); font-size: 0.95rem; }

/* ---------- Training ---------- */
.modules { display: grid; gap: 14px; margin-bottom: clamp(50px, 6vw, 80px); }
.module {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 16px;
  transition: border-color 0.3s;
}
.module[open] { border-color: rgba(243,38,184,0.35); }
.module summary {
  display: flex; align-items: center; gap: 20px;
  padding: 22px 26px; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.02rem, 2vw, 1.3rem);
}
.module summary::-webkit-details-marker { display: none; }
.module-num {
  font-size: 0.8rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}
.module-plus { margin-left: auto; color: var(--ink-faint); font-weight: 400; font-size: 1.4rem; transition: transform 0.3s; }
html[dir="rtl"] .module-plus { margin-left: 0; margin-right: auto; }
.module[open] .module-plus { transform: rotate(45deg); }
.module p { padding: 0 26px 24px 66px; color: var(--ink-dim); font-size: 0.97rem; }
html[dir="rtl"] .module p { padding: 0 66px 24px 26px; }

.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 26px); }
.case {
  border-left: 2px solid; border-image: var(--grad) 1;
  padding: 6px 0 6px 24px;
}
html[dir="rtl"] .case { border-left: 0; border-right: 2px solid; border-image: var(--grad) 1; padding: 6px 24px 6px 0; }
.case h4 { margin-bottom: 10px; font-family: var(--font-display); }
.case p { color: var(--ink-dim); font-size: 0.93rem; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-title { font-size: clamp(2.8rem, 7vw, 5.6rem); margin-bottom: 18px; }
.contact-sub { color: var(--ink-dim); margin-bottom: 44px; font-size: clamp(1rem, 1.8vw, 1.2rem); }

.contact-form {
  max-width: 640px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
  text-align: start;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form input,
.contact-form textarea {
  width: 100%; padding: 16px 20px; border-radius: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink); font-family: inherit; font-size: 1rem;
  transition: border-color 0.25s, background 0.25s;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(255,255,255,0.38); }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none; border-color: rgba(255,61,200,0.55);
  background: rgba(255,255,255,0.07);
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form .btn { align-self: center; margin-top: 10px; }
.contact-form .btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.form-status { min-height: 1.5em; font-size: 0.95rem; text-align: center; color: var(--ink-dim); }
.form-status.ok { color: #7ef0c0; }
.form-status.err { color: #ff8aa8; }

.contact-alt { margin-top: 44px; }
.contact-or { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 18px; }
.contact-socials { display: flex; gap: 16px; justify-content: center; }
.social-btn {
  width: 54px; height: 54px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  color: var(--ink-dim);
  transition: transform 0.25s ease, background 0.25s, border-color 0.25s, color 0.25s;
}
.social-btn:hover {
  transform: translateY(-3px);
  background: var(--grad); border-color: transparent; color: #fff;
}
.social-btn svg { width: 22px; height: 22px; }
.social-btn-sm { width: 42px; height: 42px; }
.social-btn-sm svg { width: 18px; height: 18px; }
.footer-socials { display: flex; gap: 12px; }

@media (max-width: 680px) {
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .contact-form { gap: 12px; }
  .contact-form input,
  .contact-form textarea {
    padding: 15px 18px; font-size: 16px; border-radius: 16px;
  }
  .contact-form textarea { min-height: 110px; }
  .contact-form .btn {
    width: 100%; align-self: stretch;
    padding: 16px 32px; font-size: 1.05rem; margin-top: 6px;
  }
  .form-status { font-size: 0.9rem; }
  .contact-alt { margin-top: 26px; }
  .contact-or { font-size: 0.85rem; margin-bottom: 14px; }
  .contact-socials { gap: 14px; }
  .social-btn { width: 48px; height: 48px; }
  .social-btn svg { width: 20px; height: 20px; }
  .footer-top { justify-content: center; text-align: center; }
  .footer-top .nav-logo { width: 100%; text-align: center; }
  .footer-links { justify-content: center; width: 100%; }
  .footer-socials { justify-content: center; width: 100%; }
  .footer-bottom p { text-align: center; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid rgba(255,255,255,0.07); padding: clamp(36px, 5vw, 60px) clamp(20px, 6vw, 80px) 34px; }
.footer-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 22px; margin-bottom: 30px; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-dim); font-size: 0.92rem; transition: color 0.25s; }
.footer-links a:hover { color: var(--ink); }
.footer-bottom p { color: var(--ink-faint); font-size: 0.82rem; }

/* ---------- Reveal helpers ---------- */
.reveal-up { opacity: 0; transform: translateY(30px); }
.no-js .reveal-up, .no-anim .reveal-up { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .pillars { grid-template-columns: 1fr; }
  .cases { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 820px) {
  .nav-links, .nav-cta { display: none; }
  .nav-right .lang-toggle { display: none; }
  .nav-burger { display: block; }
  .hero-title { font-size: clamp(2.5rem, 11.5vw, 4.2rem); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-hint span { animation: none; }
  html { scroll-behavior: auto; }
}
