/* ============================================================
   Drivo Media — style.css
   Phase 0: Reset + Design Tokens + Base layout
   Vanilla CSS only. Uses CSS logical properties for RTL/LTR.
   ============================================================ */

/* ============================================================
   1) CSS Reset (modern, minimal)
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  font-weight: 700;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Respect reduced-motion preferences */
@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;
  }
}

/* ============================================================
   2) Design Tokens — Brand Identity (all in :root)
   Change the brand in one place.
   ============================================================ */
:root {
  /* ============================================================
     Official Drivo Media brand palette — LIGHT THEME
     White background, near-black text, green accent used sparingly
     (CTAs, links, highlights only — never large glowing surfaces).
     ============================================================ */
  --green: #4f9a2c;         /* Primary green — darkened for AA contrast on white */
  --green-600: #3f7d22;     /* Darker green (gradient depth only) */
  --black: #12140f;         /* Primary text (near-black, not pure #000) */
  --white: #ffffff;         /* Primary background */
  --gray-900: #222222;      /* Reserved (unused in light mode) */
  --gray-100: #f5f5f5;      /* Cards / raised surfaces */

  /* --- Color: surfaces --- */
  --bg: var(--white);              /* page background */
  --bg-elevated: #f7f8f6;          /* cards / raised surfaces */
  --bg-subtle: #f1f2ef;            /* subtle fills, inputs */

  /* --- Color: text --- */
  --text: var(--black);            /* primary text */
  --text-muted: rgba(18, 20, 15, 0.62); /* secondary text */

  /* --- Color: brand accents (green only) --- */
  --accent: var(--green);      /* primary accent */
  --accent-2: var(--green-600); /* secondary accent — slightly darker for small text/links */
  --accent-ink: var(--white);  /* text on top of solid green fills */

  /* --- Gradients (subtle green depth, never a second hue) --- */
  --gradient: linear-gradient(135deg, #5fb238 0%, var(--green) 55%, var(--green-600) 100%);
  --gradient-soft: linear-gradient(
    135deg,
    rgba(79, 154, 44, 0.1) 0%,
    rgba(79, 154, 44, 0.03) 100%
  );

  /* --- Borders & radii --- */
  --border: rgba(18, 20, 15, 0.1);
  --border-strong: rgba(18, 20, 15, 0.18);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* --- Shadows: soft neutral only — no colored/accent glow --- */
  --shadow: 0 10px 24px -14px rgba(18, 20, 15, 0.18);
  --shadow-lg: 0 20px 48px -20px rgba(18, 20, 15, 0.22);
  --shadow-accent: var(--shadow); /* glow removed: buttons use the neutral shadow */

  /* --- Typography: families --- */
  --font-en-heading: "Sora", system-ui, sans-serif;
  --font-en-body: "Manrope", system-ui, sans-serif;
  --font-ar: "Tajawal", system-ui, sans-serif;

  /* Active families (swapped per language on <body>) */
  --font-heading: var(--font-ar);
  --font-body: var(--font-ar);

  /* --- Typography: fluid scale --- */
  --fs-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.85rem);
  --fs-sm: clamp(0.85rem, 0.82rem + 0.2vw, 0.95rem);
  --fs-base: clamp(1rem, 0.96rem + 0.25vw, 1.1rem);
  --fs-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --fs-xl: clamp(1.5rem, 1.25rem + 1.2vw, 2.2rem);
  --fs-2xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --fs-3xl: clamp(2.6rem, 1.8rem + 4vw, 5rem);

  /* --- Spacing scale --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* --- Layout --- */
  --container-max: 1200px;
  --container-pad: clamp(1rem, 4vw, 2.5rem);
  --section-pad: clamp(3.5rem, 8vw, 7rem);

  /* --- Animation --- */
  --dur-fast: 150ms;
  --dur: 280ms;
  --dur-slow: 500ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Z-index scale --- */
  --z-header: 100;
  --z-modal: 1000;

  color-scheme: light;
}

/* ============================================================
   3) Per-language font switching
   ============================================================ */
body.lang-ar {
  --font-heading: var(--font-ar);
  --font-body: var(--font-ar);
}

body.lang-en {
  --font-heading: var(--font-en-heading);
  --font-body: var(--font-en-body);
}

/* ============================================================
   4) Base body rules (works for both RTL & LTR)
   ============================================================ */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--text);
}

p {
  color: var(--text-muted);
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ============================================================
   5) Layout helpers — container & grid
   ============================================================ */

/* Centered content container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Vertical section rhythm */
.section {
  padding-block: var(--section-pad);
}

/* Responsive auto grid */
.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Auto-fit grid: cards flow and wrap on their own */
.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Flex helpers */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Accessibility: visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   6) Responsive breakpoints (mobile-first)
   ============================================================ */
@media (max-width: 900px) {
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   7) Buttons (shared)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1;
  padding-block: 0.8em;
  padding-inline: 1.5em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), background var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--lg {
  font-size: var(--fs-base);
  padding-block: 1em;
  padding-inline: 2em;
}

.btn--primary {
  background: transparent !important; /* زرار مفرغ من اللون */
  color: var(--accent) !important; /* الكلام بلون البراند الأخضر */
  border: 1.5px solid var(--accent) !important; /* إطار بلون البراند */
  box-shadow: none !important;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* طبقة اللون اللي هتملا الزرار من تحت لفوق */
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient); /* لون البراند */
  z-index: -1;
  transform: translateY(100%); /* مخفي تحت الزرار */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn--primary:hover {
  color: var(--accent-ink) !important; /* لون الكلام يتغير لأبيض */
  border-color: transparent !important;
  transform: translateY(-2px);
}

.btn--primary:hover::before {
  transform: translateY(0); /* اللون يطلع يملا الزرار */
}

/* ============================================================
   8) Header
   Kept dark (independent of the light page background) so the
   light-colored logo and its green accent stay legible. Starts as
   a solid black bar at the top of the page; once scrolling begins
   it eases smoothly into a semi-transparent frosted-glass surface
   for a touch of elegance.
   ============================================================ */
.header {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
  background: var(--black);
  border-block-end: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  transition: background var(--dur-slow) var(--ease-out),
    backdrop-filter var(--dur-slow) var(--ease-out), box-shadow var(--dur) var(--ease);
}

.header.is-scrolled {
  background: rgba(15, 17, 12, 0.72);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  box-shadow: var(--shadow-lg);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 72px;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  color: var(--white);
  flex-shrink: 0;
}

/* Brand logo image (used in header + footer). Height drives the size;
   width auto-scales with the logo's aspect ratio. */
.logo__img {
  height: 40px;
  width: auto;
  display: block;
  transition: opacity var(--dur) var(--ease);
}

.logo:hover .logo__img {
  opacity: 0.85;
}

/* Navigation */
.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-3), 2vw, var(--space-6));
}

.nav__link {
  position: relative;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  padding-block: var(--space-2);
  transition: color var(--dur) var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transition: width var(--dur) var(--ease-out);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--text);
}

.nav__link:hover::after,
.nav__link:focus-visible::after {
  width: 100%;
}

/* ------------------------------------------------------------
   Header color overrides — the header keeps its own dark surface
   independent of the light page background, so its text/controls
   use fixed light values instead of the page's --text/--text-muted.
   ------------------------------------------------------------ */
.header .nav__link {
  color: rgba(255, 255, 255, 0.7);
}

.header .nav__link:hover,
.header .nav__link:focus-visible {
  color: var(--white);
}

.header .lang-switch__btn {
  color: rgba(255, 255, 255, 0.7);
}

.header .lang-switch__btn:hover,
.header .lang-switch__btn.is-active {
  color: var(--white);
}

.header .lang-switch__sep {
  color: rgba(255, 255, 255, 0.24);
}

.header .burger__bar {
  background: var(--white);
}

/* Header actions */
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

/* Language switch */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.lang-switch__btn {
  font-family: var(--font-en-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.lang-switch__btn:hover {
  color: var(--text);
}

.lang-switch__btn.is-active {
  color: var(--text);
  background: var(--gradient-soft);
}

.lang-switch__sep {
  color: var(--border-strong);
}

/* Burger (mobile only) */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: var(--radius-sm);
}

.burger__bar {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

/* ============================================================
   9) Mobile off-canvas menu
   ============================================================ */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  visibility: hidden;
  pointer-events: none;
}

.mobile-menu.is-open {
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.mobile-menu.is-open .mobile-menu__backdrop {
  opacity: 1;
}

.mobile-menu__panel {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(82vw, 340px);
  background: var(--bg-elevated);
  border-inline-start: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-7) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  /* Off-canvas: slide from the inline-end edge (RTL-aware) */
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
}

/* In RTL the panel sits on the left, so it slides the other way */
[dir="rtl"] .mobile-menu__panel {
  transform: translateX(-100%);
}

.mobile-menu.is-open .mobile-menu__panel {
  transform: translateX(0);
}

.mobile-menu__close {
  align-self: flex-end;
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-menu__link {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
  padding-block: var(--space-3);
  border-block-end: 1px solid var(--border);
  transition: color var(--dur) var(--ease);
}

.mobile-menu__link:hover {
  color: var(--accent);
}

.mobile-menu__cta {
  margin-block-start: auto;
}

/* ============================================================
   10) Hero
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  /* Header is a solid, permanently-dark bar (not transparent), so the
     hero starts right below it like any other section. */
  padding-block-start: var(--section-pad);
  padding-block-end: var(--space-7);
  isolation: isolate;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  max-width: 900px;
}

.hero__eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent-2);
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--gradient-soft);
}

.hero__title {
  font-size: var(--fs-3xl);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* Rotating words */
/* Rotating words (Creative 3D Flip Animation) */
.rotator {
  display: inline-grid;
  vertical-align: bottom; /* بنرجعها للوضع الطبيعي عشان تقف على نفس السطر بالظبط */
  margin: 0 8px; /* مسافة متساوية ومريحة يمين وشمال الكلمة عشان ماتلزقش في حاجة */
  perspective: 600px;
}

.rotator__word {
  grid-area: 1 / 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform-origin: 50% 50%;
  transform: rotateX(-90deg) translateY(10px);
  transition: opacity 0.4s var(--ease),
              transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* الحل النضيف لقص الحروف من غير ما يوقع الكلمة من على السطر */
  padding: 0.1em 0 0.25em; 
  line-height: 1.0;
}
.rotator__word.is-active {
  opacity: 1;
  transform: rotateX(0deg) translateY(0);
}

.rotator__word.is-exit {
  opacity: 0;
  transform: rotateX(90deg) translateY(-10px);
}

.hero__subtitle {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  max-width: 620px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-block-start: var(--space-3);
}

/* Optional hero background image (behind the text, above the blobs) */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark scrim over the image so hero copy stays legible on bright
   photos. `.has-bg` is toggled by the <img> onload/onerror handlers,
   so it only appears once a real image has loaded. */
.hero.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(11, 11, 11, 0.5),
    rgba(11, 11, 11, 0.78)
  );
  pointer-events: none;
}

/* With a photo background, the dark scrim needs light text instead
   of the site's default dark-on-white copy. */
.hero.has-bg .hero__title,
.hero.has-bg .hero__subtitle,
.hero.has-bg .hero__eyebrow {
  color: #ffffff;
}

.hero.has-bg .hero__subtitle {
  color: rgba(255, 255, 255, 0.82);
}

/* Hide the default animated blobs whenever an image is loaded.
   If the image is missing/errors, `.has-bg` is never added and the
   blobs stay — the automatic fallback. */
.hero.has-bg .hero__blobs {
  display: none;
}

/* Animated gradient blobs (default background) */
.hero__blobs {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* On a white background, the same blobs read as a strong colored
   glow — opacity is kept low so they're a faint hint, not a glow. */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.07;
  will-change: transform;
}

.blob--1 {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  background: var(--accent);
  inset-block-start: -8%;
  inset-inline-start: -6%;
  animation: blobFloat 18s var(--ease) infinite;
}

.blob--2 {
  width: 38vw;
  height: 38vw;
  max-width: 480px;
  max-height: 480px;
  background: var(--accent-2);
  inset-block-start: 10%;
  inset-inline-end: -10%;
  animation: blobFloat 22s var(--ease) infinite reverse;
}

.blob--3 {
  width: 30vw;
  height: 30vw;
  max-width: 400px;
  max-height: 400px;
  background: var(--green);
  inset-block-end: -12%;
  inset-inline-start: 30%;
  opacity: 0.14;
  animation: blobFloat 26s var(--ease) infinite;
}

@keyframes blobFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(6%, 8%) scale(1.08);
  }
  66% {
    transform: translate(-5%, -4%) scale(0.95);
  }
}

/* ============================================================
   11) Marquee (infinite client logos)
   ============================================================ */
.marquee {
  margin-block-start: var(--space-8);
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
  overflow: hidden;
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}

/* Pause on hover */
.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee__group {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-6), 6vw, var(--space-9));
  padding-inline: clamp(var(--space-6), 6vw, var(--space-9));
}

.marquee__item {
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}

.marquee__item:hover {
  opacity: 1;
  color: var(--text);
}

/* Move exactly one group width; second (cloned) group fills the gap */
@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* RTL: scroll the other direction */
[dir="rtl"] .marquee__track {
  animation-name: marquee-rtl;
}

@keyframes marquee-rtl {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(50%);
  }
}

/* ============================================================
   12) Header / Hero responsive
   ============================================================ */
@media (max-width: 860px) {
  .nav,
  .header__cta {
    display: none;
  }

  .burger {
    display: flex;
  }
}

@media (max-width: 480px) {
  .lang-switch {
    order: -1;
  }
}

/* ============================================================
   13) Section head (reusable: eyebrow + title + subtitle)
   ============================================================ */
.section-head {
  max-width: 720px;
  margin-inline: auto;
  margin-block-end: var(--space-8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.section-head__eyebrow {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-2);
}

.section-head__title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-head__subtitle {
  font-size: var(--fs-lg);
  color: var(--text-muted);
}

/* ============================================================
   15) Stats — animated count-up
   ============================================================ */
.stats__grid {
  gap: var(--space-5);
}

.stat {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gradient-soft);
}

.stat__value {
  font-family: var(--font-en-heading);
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
}

.stat__label {
  margin-block-start: var(--space-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
}

/* ============================================================
   16) Services — dynamic card grid (3 per row, two rows)
   ============================================================ */
.services__grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 860px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .services__grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  position: relative;
  padding: var(--space-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

/* Accent glow that appears on hover */
.service-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform var(--dur) var(--ease-out);
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(122, 201, 67, 0.45);
  box-shadow: var(--shadow-lg);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card__icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--accent);
  background: rgba(122, 201, 67, 0.1);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.service-card:hover .service-card__icon {
  color: var(--accent);
  background: var(--gradient-soft);
  transform: scale(1.06);
}

.service-card__icon svg {
  width: 26px;
  height: 26px;
}

.service-card__title {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.service-card__desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ============================================================
   16c) Full-width showcase banner (replaceable site image)
   ============================================================ */
.showcase {
  margin-block: var(--space-8);
}

.showcase__link {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0; /* kill inline-image gap */
}

.showcase__img {
  width: 100%;
  height: auto;
  display: block;
}

/* When the real image is missing, hide the broken <img> and show the
   placeholder underneath instead (see JS `onerror` toggling is-missing). */
.showcase__img.is-missing {
  display: none;
}

.showcase__placeholder {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
  aspect-ratio: 21 / 9;
  line-height: 1.4;
  background: radial-gradient(
      120% 140% at 50% 0%,
      rgba(122, 201, 67, 0.14),
      transparent 60%
    ),
    var(--bg-elevated);
  border-block: 1px solid var(--border);
}

/* Placeholder is only revealed once the image errors out */
.showcase__img.is-missing + .showcase__placeholder {
  display: flex;
}

.showcase__hint {
  font-family: var(--font-en-body);
  font-size: var(--fs-sm);
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* ============================================================
   17) Portfolio — filters, grid, cards, overlay
   ============================================================ */

/* Filter buttons */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-block-end: var(--space-7);
}

.filter-btn {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.6em 1.3em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-btn.is-active {
  color: var(--accent-ink);
  background: var(--gradient);
  border-color: transparent;
}

/* Projects grid */
.portfolio__grid {
  position: relative; /* anchor for FLIP out-animation */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

/* Project card */
.project-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-elevated);
  aspect-ratio: 3 / 2;
}

.project-card.is-hidden {
  display: none;
}

.project-card__media,
.project-card__media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hover / focus overlay */
.project-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-5);
  background: linear-gradient(
    to top,
    rgba(11, 11, 18, 0.92) 0%,
    rgba(11, 11, 18, 0.5) 55%,
    rgba(11, 11, 18, 0) 100%
  );
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.project-card:hover .project-card__overlay,
.project-card:focus-visible .project-card__overlay,
.project-card:focus-within .project-card__overlay {
  opacity: 1;
}

.project-card__cat {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-2);
}

.project-card__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  /* Always sits on the dark image overlay above — fixed white,
     not the page's --text (which is dark for the white background). */
  color: #ffffff;
  transform: translateY(6px);
  transition: transform var(--dur) var(--ease-out);
}

.project-card:hover .project-card__title,
.project-card:focus-within .project-card__title {
  transform: translateY(0);
}

.project-card__view {
  margin-block-start: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--gradient);
  padding: 0.5em 1.2em;
  border-radius: var(--radius-pill);
}

/* ============================================================
   18) Modal / Lightbox
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  visibility: hidden;
  pointer-events: none;
}

.modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.modal.is-open .modal__backdrop {
  opacity: 1;
}

.modal__dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out),
    opacity var(--dur) var(--ease);
}

.modal.is-open .modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal__close {
  position: absolute;
  inset-block-start: var(--space-4);
  inset-inline-end: var(--space-4);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  color: var(--text);
  background: rgba(11, 11, 18, 0.55);
  transition: background var(--dur) var(--ease);
}

.modal__close:hover {
  background: rgba(11, 11, 18, 0.85);
}

.modal__media,
.modal__media svg {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-start-start-radius: var(--radius-lg);
  border-start-end-radius: var(--radius-lg);
}

.modal__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.modal__cat {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-2);
}

.modal__title {
  font-size: var(--fs-xl);
  font-weight: 800;
}

.modal__desc {
  color: var(--text-muted);
}

.modal__body .btn {
  margin-block-start: var(--space-3);
}

/* Portfolio responsive */
@media (max-width: 860px) {
  .portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .portfolio__grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   20) Narrow container (FAQ, forms)
   ============================================================ */
.container--narrow {
  max-width: 800px;
}

/* ============================================================
   21) FAQ — accordion
   ============================================================ */
.faq__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}

.faq-item.is-open {
  border-color: var(--border-strong);
}

.faq-item__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  text-align: start;
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
}

.faq-item__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--gradient-soft);
  color: var(--accent);
  transition: transform var(--dur) var(--ease-out), color var(--dur) var(--ease);
}

.faq-item__icon svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur) var(--ease-out);
}

.faq-item.is-open .faq-item__icon {
  color: var(--accent-ink);
  background: var(--gradient);
}

.faq-item.is-open .faq-item__icon svg {
  transform: rotate(45deg);
}

/* Smooth height animation via grid-template-rows trick */
.faq-item__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-slow) var(--ease-out);
}

.faq-item.is-open .faq-item__panel {
  grid-template-rows: 1fr;
}

.faq-item__panel-inner {
  overflow: hidden;
}

.faq-item__a {
  padding: 0 var(--space-6) var(--space-5);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

/* ============================================================
   22) CTA band
   ============================================================ */
.cta-band {
  margin-block: var(--space-8);
  padding-block: var(--space-8);
  background: var(--gradient);
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    60% 140% at 15% 20%,
    rgba(255, 255, 255, 0.25),
    transparent 60%
  );
  pointer-events: none;
}

.cta-band__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-6);
}

.cta-band__title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--accent-ink);
  letter-spacing: -0.5px;
}

.cta-band__subtitle {
  margin-block-start: var(--space-2);
  font-size: var(--fs-lg);
  /* Sits on the solid green gradient — matches --accent-ink above it. */
  color: rgba(255, 255, 255, 0.85);
}

.cta-band__btn {
  flex-shrink: 0;
  background: var(--black);
  color: var(--white);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.5);
}

.cta-band__btn:hover {
  background: #23261c;
}

/* ============================================================
   23) Contact — form + info panel
   ============================================================ */
.contact__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.field__input {
  width: 100%;
  padding: 0.85em 1em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-size: var(--fs-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field__input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.field__input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 201, 67, 0.2);
}

.field__input--area {
  resize: vertical;
  min-height: 120px;
}

.field.has-error .field__input {
  border-color: #f87171;
}

.field__error {
  min-height: 1.1em;
  font-size: var(--fs-xs);
  color: #f87171;
}

.form__status {
  min-height: 1.4em;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-2);
}

.form__status.is-success {
  color: #34d399;
}

/* Info panel */
.contact__info {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact__info-title {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.contact__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  transition: color var(--dur) var(--ease);
}

a.contact__row:hover {
  color: var(--accent-2);
}

.contact__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gradient-soft);
  color: var(--accent);
}

.contact__icon svg {
  width: 18px;
  height: 18px;
}

.contact__follow {
  margin-block-start: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.contact__wa {
  margin-block-start: var(--space-2);
  justify-content: center;
}

/* Social icon row (shared: contact panel + footer) */
.socials {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.socials__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease), background var(--dur) var(--ease);
}

.socials__link svg {
  width: 17px;
  height: 17px;
}

.socials__link:hover {
  color: var(--accent-ink);
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-3px);
}

/* ============================================================
   24) Footer
   Kept permanently dark (same reasoning as the header) so the
   light-colored logo stays legible regardless of the page theme.
   ============================================================ */
.footer {
  background: var(--black);
  border-block-start: 1px solid rgba(255, 255, 255, 0.08);
  padding-block-start: var(--space-8);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-7);
  padding-block-end: var(--space-7);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.footer__about {
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--fs-sm);
  max-width: 320px;
}

.footer__heading {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white);
  margin-block-end: var(--space-4);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__links a,
.footer__links span {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.62);
  transition: color var(--dur) var(--ease);
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__bottom {
  border-block-start: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: var(--space-5);
}

.footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer__copy {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.5);
}

/* Footer lang-switch (secondary toggle in the footer bottom bar) —
   also needs light text on the dark footer background. */
.footer .lang-switch__btn {
  color: rgba(255, 255, 255, 0.7);
}

.footer .lang-switch__btn:hover,
.footer .lang-switch__btn.is-active {
  color: var(--white);
}

.footer .lang-switch__sep {
  color: rgba(255, 255, 255, 0.24);
}

.footer .socials__link {
  color: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.16);
}

/* ============================================================
   25) Floating WhatsApp + Back-to-top
   ============================================================ */
.wa-float,
.to-top {
  position: fixed;
  inset-inline-end: var(--space-5);
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.wa-float {
  inset-block-end: var(--space-5);
  background: #25d366;
  color: #ffffff;
}

.wa-float:hover {
  transform: translateY(-3px) scale(1.05);
}

.to-top {
  inset-block-end: calc(var(--space-5) + 68px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   26) Responsive — FAQ / CTA / Contact / Footer
   ============================================================ */
@media (max-width: 900px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .cta-band__inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: start;
  }

  .footer__inner {
    grid-template-columns: 1fr;
  }

  .wa-float,
  .to-top {
    inset-inline-end: var(--space-4);
    width: 50px;
    height: 50px;
  }

  .to-top {
    inset-block-end: calc(var(--space-4) + 60px);
  }

  .wa-float {
    inset-block-end: var(--space-4);
  }
}

/* ============================================================
   27) Preloader
   ============================================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  /* Fixed dark background (not --bg): the logo has white text baked
     into the image, so it needs a dark surface regardless of theme. */
  background: var(--black);
  transition: opacity var(--dur-slow) var(--ease), visibility var(--dur-slow) var(--ease);
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__logo {
  height: 48px;
  width: auto;
  color: var(--text);
  animation: preloaderPulse 1.6s var(--ease) infinite;
}

@keyframes preloaderPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.97);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.preloader__bar {
  width: 160px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.preloader__progress {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: var(--gradient);
  transition: width var(--dur) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .preloader__logo {
    animation: none;
  }
}

/* ============================================================
   28) Scroll reveal (fade + slide up, IntersectionObserver-driven)
   Base state is inline via [data-reveal]; .is-visible plays it.
   GPU-friendly: transform + opacity only. Stagger delay is set
   per-element by JS via --reveal-delay.
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion: content is simply present, no motion/delay */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   30) Project detail page (project.html)
   ============================================================ */

/* `hidden` must win over the display rules below */
[hidden] {
  display: none !important;
}

.pdetail {
  padding-block-start: var(--space-8);
}

/* Loading + missing states */
.pdetail__loading {
  display: flex;
  justify-content: center;
  padding-block: var(--space-9);
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.pdetail__missing {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding-block: var(--space-9);
}

/* Intro meta line */
.pdetail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.pdetail__back {
  color: var(--accent);
  font-weight: 600;
  transition: opacity var(--dur) var(--ease);
}

.pdetail__back:hover {
  opacity: 0.75;
}

.pdetail__cat {
  font-weight: 600;
  color: var(--text);
}

.pdetail__sep {
  color: var(--border-strong);
}

.pdetail__title {
  margin-block: var(--space-4) var(--space-7);
  font-size: var(--fs-3xl);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  max-width: 18ch;
}

/* ============================================================
   تصميم تفاصيل المشروع (Graphica Style)
   ============================================================ */
.pdetail__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr; /* اليمين أكبر سيكا من الشمال */
  gap: clamp(var(--space-6), 8vw, var(--space-10));
  align-items: start;
  padding-block-end: var(--space-8);
  margin-top: var(--space-4);
}

/* --- العمود الأيمن --- */
.pdetail__col--text {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.pdetail__meta {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: -1rem; /* تقريب الميتا من العنوان */
}

.pdetail__title {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text);
  margin-block-end: var(--space-4);
  letter-spacing: -1px;
}

.pdetail__heading {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--accent); /* لون البراند */
  margin-block-end: var(--space-2);
}

.pdetail__body {
  font-size: var(--fs-base);
  font-weight: 600; /* خط سميك زي جرافيكا بالظبط */
  color: var(--text);
  line-height: 1.8;
  max-width: 95%; 
}

/* --- العمود الأيسر --- */
.pdetail__col--info {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  padding-top: var(--space-9); /* تنزيل العمود الشمال شوية ليتوازن مع العنوان */
  border: none;
  background: transparent;
}

/* خط فاصل فوق الداتا */
.pinfo-wrapper {
  border-top: 1px solid var(--border-strong);
  padding-top: var(--space-5);
}

/* شبكة الداتا بالعرض (4 عواميد) */
.pinfo {
  display: grid;
  grid-template-columns: repeat(4, 1fr); 
  gap: var(--space-3);
}

.pinfo__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: none !important;
  padding: 0 !important;
}

.pinfo__label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text);
}

.pinfo__value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pinfo__tags {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0;
}

.pinfo__tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
}

.pdetail__external {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent);
  transition: opacity 0.3s ease;
}

.pdetail__external:hover {
  opacity: 0.7;
}

/* تظبيط الموبايل */
@media (max-width: 900px) {
  .pdetail__grid {
    grid-template-columns: 1fr;
  }
  .pinfo {
    grid-template-columns: repeat(2, 1fr); /* عمودين في الموبايل بدل 4 */
  }
  .pdetail__col--info {
    padding-top: 0;
  }
}
.pinfo__tag {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
  padding: 0.4em 0.9em;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(122, 201, 67, 0.3);
  background: var(--gradient-soft);
}
/* ==================================
   إصلاح وتجميل نصوص تفاصيل المشروع (محاذاة لليمين)
   ================================== */
.pdetail__col--text {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* بيجبر العناوين تبدأ من اليمين */
  text-align: start; /* بيجبر النصوص تبدأ من اليمين */
  gap: var(--space-7);
  max-width: 860px;
  margin-top: var(--space-6); 
  /* شلنا margin: auto عشان البلوك يلزق في اليمين مع باقي الصفحة */
}

.pdetail__heading {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--text);
  margin-block-end: var(--space-4);
  position: relative;
  display: inline-block;
}

/* خط أخضر صغير تحت كل عنوان */
.pdetail__heading::after {
  content: "";
  position: absolute;
  bottom: -10px;
  right: 0; /* الخط يبدأ من اليمين */
  width: 45px;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
}

.pdetail__body {
  color: var(--text-muted);
  font-size: var(--fs-lg);
  line-height: 1.85;
  white-space: pre-line;
  text-align: start;
}

/* ==================================
   تأكيد محاذاة العنوان الرئيسي والشريط لليمين
   ================================== */
.pdetail__title,
.pdetail__meta {
  text-align: start;
  justify-content: flex-start;
}

.pinfo {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start; /* بيجبر شريط المعلومات يبدأ من اليمين */
  gap: clamp(var(--space-5), 6vw, var(--space-10));
}
.pdetail__external {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-block-start: var(--space-5);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  transition: gap var(--dur) var(--ease-out), opacity var(--dur) var(--ease);
}

.pdetail__external:hover {
  gap: var(--space-3);
  opacity: 0.8;
}

/* Flip the external-link arrow in RTL */
[dir="rtl"] .pdetail__external svg {
  transform: scaleX(-1);
}

/* Prev / next navigation */
.pnav {
  border-block: 1px solid var(--border);
  padding-block: var(--space-5);
}

.pnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.pnav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  transition: color var(--dur) var(--ease);
}

/* Only the "next" link sits at the end when it is the sole link */
.pnav__link--next {
  margin-inline-start: auto;
  text-align: end;
}

.pnav__link:hover {
  color: var(--text);
}

.pnav__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

/* Arrows are drawn LTR — mirror them in RTL */
[dir="rtl"] .pnav__arrow svg {
  transform: scaleX(-1);
}

.pnav__link:hover .pnav__arrow {
  color: var(--accent-ink);
  background: var(--gradient);
  border-color: transparent;
}

.pnav__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pnav__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.pnav__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stacked gallery */
.pgallery {
  padding-block: var(--space-8);
}

.pgallery__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.pgallery__item {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.pgallery__btn {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
}

.pgallery__item img,
.pgallery__item svg {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}

.pgallery__item--placeholder svg {
  aspect-ratio: 3 / 2;
}

.pgallery__btn:hover img {
  transform: scale(1.02);
}

/* Lightbox variant of the shared modal */
.modal__dialog--media {
  width: min(1100px, 100%);
  background: transparent;
  border: none;
  box-shadow: none;
}

.modal--media .modal__media,
.modal--media .modal__media img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  border-radius: var(--radius);
  object-fit: contain;
}

/* Full-width, short CTA band (matches reference).
   Full-bleed background, content constrained by .container inside. */
.pcta {
  margin-block-start: var(--space-8);
  padding-block: clamp(var(--space-6), 5vw, var(--space-8));
  border-block: 1px solid var(--border);
  background: radial-gradient(
      100% 180% at 100% 0%,
      rgba(122, 201, 67, 0.12),
      transparent 55%
    ),
    var(--bg-elevated);
}

.pcta__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(var(--space-5), 4vw, var(--space-8));
}

.pcta__eyebrow {
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-block-end: var(--space-3);
}

.pcta__title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.pcta__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
}

.pcta__desc {
  font-size: var(--fs-base);
  color: var(--text-muted);
  max-width: 52ch;
}

/* Stack on smaller screens */
@media (max-width: 760px) {
  .pcta__inner {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

/* Project page responsive */
@media (max-width: 900px) {
  .pdetail__grid {
    grid-template-columns: 1fr;
  }

  .pdetail__col--info {
    position: static;
  }

  .pdetail__title {
    max-width: none;
  }
}

@media (max-width: 600px) {
  .pnav__inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .pnav__link--next {
    margin-inline-start: 0;
    justify-content: flex-end;
  }
}

/* Empty portfolio message */
.portfolio__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding-block: var(--space-7);
}

/* ============================================================
   29) Micro-interactions — shared animated underline for
   plain text links (footer links, contact rows) that don't
   already have their own hover treatment.
   ============================================================ */
.footer__links a,
.contact__row {
  position: relative;
  width: fit-content;
}

.footer__links a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: -2px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width var(--dur) var(--ease-out);
}

.footer__links a:hover::after {
  width: 100%;
}
/* ============================================================
   Linear-Style Minimal Header Overrides
   ============================================================ */
/* 1. تنحيف الهيدر وتصغير المسافات */
.header__inner {
  min-height: 56px !important; 
}

/* 2. تهدئة ألوان اللينكات وإلغاء الخطوط */
.header .nav__link {
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
.header .nav__link::after {
  display: none !important; /* بيلغي الخط اللي بيظهر تحت الكلمة */
}
.header .nav__link:hover {
  color: #ffffff !important;
}

/* 3. زرار الأكشن (Linear Pill Button) */
.header .header__cta {
  background: #ffffff !important;
  color: #000000 !important;
  font-size: 13px !important;
  padding: 0.5em 1.25em !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  transform: none !important; /* بيلغي النطّة عشان يفضل هادي */
  transition: background 0.2s ease !important;
}
.header .header__cta:hover {
  background: #e6e6e6 !important;
}

/* 4. تظبيط زراير اللغة لتتماشى مع الهدوء */
.header .lang-switch__btn {
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}
.header .lang-switch__btn.is-active,
.header .lang-switch__btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}
.header .lang-switch__sep {
  color: rgba(255, 255, 255, 0.15) !important;
}
/* منع زرار الهيدر من التداخل مع ستايل الكورسور */
.header .header__cta::before {
  display: none !important;
}
.header .header__cta {
  border: none !important;
}

/* ============================================================
   Custom Cursor — Cuberto-style
   Two independently-animated layers driven by cursor.js:
     .cursor-dot    small solid dot, follows the pointer almost 1:1
     .cursor-ring   larger ring, follows with more lag (smooth trail)
   On hover it reads a per-element mode via [data-cursor]:
     link    -> ring grows + fills solid (brand green)
     view    -> ring grows + shows a "View" label (used on project cards)
     magnetic -> the element itself is pulled toward the pointer (see cursor.js)
   Hidden entirely on touch/coarse-pointer devices — this is a
   mouse-only embellishment, never a requirement to use the site.
   ============================================================ */
@media (pointer: fine) {
  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor .project-card,
  body.has-custom-cursor .filter-btn {
    cursor: none;
  }

  .cursor-dot,
  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    pointer-events: none;
    will-change: transform;
    /* JS sets --x/--y (in px, top-left origin) every frame */
    transform: translate(var(--x, 0), var(--y, 0)) translate(-50%, -50%);
  }

  .cursor-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    transition: opacity 0.2s ease, background-color 0.25s ease;
  }

  .cursor-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
      height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
      background-color 0.3s ease, border-color 0.3s ease, opacity 0.2s ease;
  }

  /* Label shown inside the ring in "view" mode (e.g. "View" on
     project cards). Empty and invisible the rest of the time. */
  .cursor-ring__label {
    font-family: var(--font-en-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--accent-ink);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  /* Hide both layers until the mouse actually moves (avoids a stray
     dot at 0,0 on load) and while the pointer leaves the window. */
  body:not(.cursor-active) .cursor-dot,
  body:not(.cursor-active) .cursor-ring {
    opacity: 0;
  }

  /* --- Hover states, set by cursor.js via data-cursor-state on <body> --- */

  /* Generic links/buttons: ring grows and fills solid brand green,
     the dot hides (the ring becomes the whole pointer). */
  body[data-cursor-state="link"] .cursor-ring {
    width: 56px;
    height: 56px;
    background: var(--accent);
    border-color: var(--accent);
  }
  body[data-cursor-state="link"] .cursor-dot {
    opacity: 0;
  }

  /* Project cards: bigger ring + "View" label, same solid fill. */
  body[data-cursor-state="view"] .cursor-ring {
    width: 84px;
    height: 84px;
    background: var(--accent);
    border-color: var(--accent);
  }
  body[data-cursor-state="view"] .cursor-dot {
    opacity: 0;
  }
  body[data-cursor-state="view"] .cursor-ring__label {
    opacity: 1;
  }

  /* Text inputs: thin tall bar instead of a circle (I-beam feel). */
  body[data-cursor-state="text"] .cursor-ring {
    width: 2px;
    height: 24px;
    border-radius: 2px;
    background: var(--accent);
    border-color: var(--accent);
  }
  body[data-cursor-state="text"] .cursor-dot {
    opacity: 0;
  }
/* ============================================================
   Clean Custom Cursor (Arrow + Disappearing Dot)
   ============================================================ */
@media (pointer: fine) {
  .cuberto-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    background-color: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border 0.3s ease, opacity 0.3s ease;
  }

  /* إخفاء نقطة الماوس بنعومة لما تقف على أي زرار عشان الزرار نفسه يظهر */
  .cuberto-cursor.is-hovering {
    width: 0px;
    height: 0px;
    opacity: 0;
    border: none;
  }
}
}
/* ============================================================
   إجبار العناوين الفرعية على شكل جرافيكا (صغيرة وبلون الموقع)
   ============================================================ */
.pdetail__heading {
  font-size: 1rem !important; /* حجم صغير وشيك جداً */
  font-weight: 800 !important; /* خط سميك */
  color: var(--accent) !important; /* لون البراند الأخضر */
  margin-bottom: 8px !important; 
  padding-bottom: 0 !important;
}

/* إخفاء الخط الأخضر القديم اللي كان بيظهر تحت العناوين بالقوة */
.pdetail__heading::after {
  display: none !important;
}

/* تصغير المسافة بين العناوين والنصوص عشان تبقى متماسكة زي جرافيكا */
.pdetail__col--text {
  gap: var(--space-5) !important;
}

.pdetail__col--info {
  gap: var(--space-5) !important;
}
/* ============================================================
   تظبيط مسافات العنوان الرئيسي (تقريب الكلمة وإبعاد السطور)
   ============================================================ */
.hero__title {
  line-height: 1.4 !important; /* بيبعد السطر اللي فوق عن السطر اللي تحت عشان العين ترتاح */
}

.rotator {
  margin-inline-start: 4px !important; /* بيقرب الكلمة الخضرا جداً من كلمة "بنصنع" */
  margin-inline-end: 8px !important; /* بيسيب مسافة صغيرة من الناحية التانية */
}
/* ============================================================
   تظبيط العنوان الرئيسي على الموبايل (Responsive Hero Title)
   ============================================================ */
@media (max-width: 768px) {
  .hero__title {
    line-height: 1.25 !important; /* بنلم السطور على بعضها في الموبايل عشان الجملة تتقري حتة واحدة */
    font-size: 2.2rem !important; /* بنصغر الخط سِنة بسيطة عشان الكلمات تيجي جنب بعضها بدل ما تكسر سطور كتير */
  }
  
  .rotator {
    margin-inline-start: 4px !important;
    margin-inline-end: 4px !important;
  }
}
/* ============================================================
   تعديل وتجميل سيكشن "أعمالنا" (Modern Portfolio Grid)
   ============================================================ */
.section#portfolio, 
.section[id*="portfolio"],
.portfolio-section {
  padding-block: var(--space-7) !important; /* تقليل المسافات البيضا الكبيرة فوق وتحت */
}

/* تظبيط رأس السيكشن (العنوان والوصف) ليكون متناسق */
.portfolio__header, .section__header {
  margin-bottom: var(--space-6) !important;
  text-align: center;
}

/* شبكة المشاريع عشان تملى العين */
.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-5);
}

/* تحويل كارت المشروع لشكل بانوراما فخم */
.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
}

/* تظبيط صورة الكارت لتكون واسعة وواضحة */
.project-card__image-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-alt);
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.project-card:hover .project-card__image {
  transform: scale(1.05); /* زووم ناعم جداً على الصورة زي الكبار */
}

/* تفاصيل الكارت من تحت */
.project-card__content {
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}

.project-card__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
}

.project-card__cat {
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: 600;
}
/* ============================================================
   تعديل وتجميل بانر "جاهز لتحريك علامتك؟" (Full-width CTA)
   ============================================================ */
.cta-banner, 
.section--cta, 
.cta {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding-block: clamp(3rem, 6vw, 5rem);
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
  background: var(--gradient) !important; /* تدرج فخم للخلفية */
  border-radius: 0 !important; /* إلغاء الحواف الحادة عشان ياخد عرض الشاشة */
}

/* تظبيط محتويات البانر من جوا لتكون في منتصف الشاشة بالعرض المناسب */
.cta-banner__content, 
.section--cta .container {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-5);
}
