/* ===== Arab Engineers Group - Design System v3 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap');

:root {
  /* Emerald base (kept under --navy-* names so existing references resolve) */
  --navy-900: #0e2f28;
  --navy-700: #14463b;
  --navy-500: #2e8466;
  --navy-50:  #e7efea;

  --gold:       #C9A84C;
  --gold-hover: #b8923e;
  --gold-muted: rgba(201, 168, 76, 0.12);

  --bg:      #f5f8f5;
  --bg-alt:  #eaf2ec;
  --surface: #ffffff;
  --text:       #0e2f28;
  --text-muted: #51665e;
  --border:     #d2e1d8;
  --primary:       var(--navy-700);
  --primary-hover: var(--navy-900);
  --accent: var(--navy-500);

  --shadow-sm: 0 4px 12px -4px rgba(14, 47, 40, 0.08);
  --shadow:    0 10px 30px -15px rgba(14, 47, 40, 0.20);
  --shadow-lg: 0 20px 40px -15px rgba(14, 47, 40, 0.28);

  --font-heading-en: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-heading-ar: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif;
  --font-heading: var(--font-heading-en);
  --font-body: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'SFMono-Regular', 'Courier New', monospace;

  /* Blueprint grid lines */
  --bp-line:        rgba(20, 70, 59, 0.06);
  --bp-line-strong: rgba(20, 70, 59, 0.11);

  --radius:    8px;
  --radius-lg: 12px;
  --container: 1200px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --navy-900: #07211c;
  --navy-700: #0e2f28;
  --navy-500: #2e8466;
  --bg:      #07211c;
  --bg-alt:  #0e2f28;
  --surface: #143c33;
  --text:       #e6f0ea;
  --text-muted: #9fb6ac;
  --border:     #2a4d43;
  --primary:       #5fb89c;
  --primary-hover: #84cdb2;
  --accent: #3fa183;
  --gold:       #d4b05a;
  --gold-hover: #c49a44;
  --gold-muted: rgba(212, 176, 90, 0.12);
  --bp-line:        rgba(130, 200, 175, 0.06);
  --bp-line-strong: rgba(130, 200, 175, 0.11);
  --shadow:    0 10px 30px -15px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.70);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Site-wide blueprint grid — subtle technical canvas behind all content */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--bp-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, #000 35%, transparent 90%);
          mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, #000 35%, transparent 90%);
}
body > * { position: relative; z-index: 1; }
[dir="rtl"] {
  text-align: right;
  font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

/* Accessibility: visible keyboard focus + branded selection */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}
*:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--gold); color: var(--navy-900); }

h1, h2, h3, h4 {
  font-family: var(--font-heading-en);
  color: var(--text);
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 0.75em;
  letter-spacing: -0.025em;
}
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4 {
  font-family: var(--font-heading-ar);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.25rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.35rem; }
p  { margin-bottom: 1em; color: var(--text-muted); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* SVG Icons */
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-lg { width: 28px; height: 28px; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--font-heading-en); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand img { width: 42px; height: 42px; object-fit: contain; }
[data-theme="dark"] .brand img { filter: brightness(0) invert(1); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: 0.65rem; font-weight: 400; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-body); }

.nav-links { display: flex; list-style: none; gap: 2rem; align-items: center; }
.nav-links a {
  color: var(--text); font-weight: 500; font-size: 0.95rem;
  position: relative; padding: 0.5rem 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transition: transform var(--transition);
  transform-origin: right;
}
[dir="ltr"] .nav-links a::after { transform-origin: left; }
.nav-links a.active::after,
.nav-links a:hover::after { transform: scaleX(1); }

.nav-actions { display: flex; gap: 0.5rem; align-items: center; }
.icon-btn {
  height: 38px; min-width: 38px; padding: 0 0.6rem;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: transparent;
  border-radius: var(--radius); color: var(--text);
  cursor: pointer; transition: all var(--transition);
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
}
.icon-btn:hover { background: var(--bg-alt); border-color: var(--gold); color: var(--gold); }
#langToggle { min-width: 46px; font-family: var(--font-body); }
.menu-toggle { display: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer; transition: all var(--transition);
  font-family: inherit; letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 14px -4px rgba(20, 70, 59, 0.35);
}
.btn-primary:hover {
  background: var(--primary-hover); color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(20, 70, 59, 0.45);
}
.btn-outline { border-color: var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ===== Hero (light, with animated engineering blueprint) ===== */
.hero {
  position: relative;
  padding: 7rem 0 6rem;
  background:
    linear-gradient(160deg, var(--bg) 0%, var(--bg-alt) 68%, color-mix(in oklab, var(--navy-500) 9%, var(--bg)) 100%);
  color: var(--text);
  text-align: start;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 45% 55% at 88% 25%, var(--gold-muted), transparent 60%),
    radial-gradient(ellipse 55% 50% at 6% 95%, color-mix(in oklab, var(--navy-500) 12%, transparent), transparent 60%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle, var(--bp-line-strong) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000, transparent 80%);
}
.hero .container { position: relative; z-index: 2; }
.hero-content { max-width: 600px; }
.hero h1 {
  margin: 0 0 1.25rem;
  background: linear-gradient(180deg, var(--navy-900) 36%, var(--gold) 140%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 { color: var(--text); -webkit-text-fill-color: var(--text); background: none; }
}
.hero p { color: var(--text-muted); max-width: 560px; margin: 0 0 2.5rem; font-size: 1.1rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: flex-start; flex-wrap: wrap; }
.hero .btn-primary { background: var(--gold); color: var(--navy-900); box-shadow: 0 8px 24px -8px rgba(201,168,76,0.55); }
.hero .btn-primary:hover { background: var(--gold-hover); color: var(--navy-900); }
.hero .btn-outline { color: var(--text); border-color: var(--border); }
.hero .btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.hero .eyebrow { color: var(--gold); }

/* ===== Animated blueprint scene ===== */
.hero-blueprint {
  position: absolute; inset-block: 0; inset-inline-end: 0; z-index: 1;
  width: min(50%, 640px);
  display: grid; place-items: center;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 62%, transparent 100%);
          mask-image: linear-gradient(to left, #000 62%, transparent 100%);
}
[dir="rtl"] .hero-blueprint {
  -webkit-mask-image: linear-gradient(to right, #000 62%, transparent 100%);
          mask-image: linear-gradient(to right, #000 62%, transparent 100%);
}
.hero-blueprint svg { width: 100%; height: auto; max-height: 92%; }
.bp-ink, .bp-gold {
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.bp-ink  { stroke: var(--navy-700); }
.bp-gold { stroke: var(--gold); }
.bp-node { fill: var(--gold); stroke: none; animation: bpPulse 3s ease-in-out infinite; }

.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: bpDraw 11s var(--ease-out) infinite; }
@keyframes bpDraw {
  0%   { stroke-dashoffset: 1; opacity: 0.12; }
  6%   { opacity: 1; }
  34%  { stroke-dashoffset: 0; }
  80%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 1; opacity: 0.12; }
}
.bp-spin { animation: geoRotate 55s linear infinite; }
@keyframes geoRotate { to { transform: rotate(360deg); } }
@keyframes bpPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
/* Crane suspended load — gentle pendulum sway */
.bp-load { animation: bpSway 5s ease-in-out infinite; }
@keyframes bpSway { 0%, 100% { transform: rotate(-2.6deg); } 50% { transform: rotate(2.6deg); } }
.bp-scan { opacity: 0; animation: bpScan 7s ease-in-out infinite; }
@keyframes bpScan {
  0%   { transform: translateY(0);     opacity: 0; }
  8%   { opacity: 0.85; }
  48%  { transform: translateY(352px); opacity: 0.85; }
  60%  { transform: translateY(352px); opacity: 0; }
  100% { transform: translateY(0);     opacity: 0; }
}

/* Trust bar */
.trust-bar {
  display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center;
  gap: 0; padding-top: 3rem;
}
.trust-bar span {
  color: var(--text-muted);
  font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600; padding: 0 1.5rem;
  border-inline-end: 1px solid var(--border);
}
.trust-bar span:first-child { padding-inline-start: 0; }
.trust-bar span:last-child { border-inline-end: none; }

/* ===== Sections ===== */
.section { padding: 5.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 3.5rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.74rem; letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold); font-weight: 700;
  margin-bottom: 0.95rem;
  position: relative;
  padding-inline-start: 1.4rem;
}
.eyebrow::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%;
  width: 9px; height: 9px; margin-top: -5px;
  border: 1.5px solid var(--gold); transform: rotate(45deg);
}
.section-head .eyebrow::after {
  content: "";
  display: block;
  width: 36px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin: 0.55rem auto 0;
  border-radius: 2px;
}
[dir="rtl"] .section-head .eyebrow::after {
  background: linear-gradient(270deg, var(--gold), transparent);
}

/* ===== Grid / Cards ===== */
.grid { display: grid; gap: 1.5rem; perspective: 1400px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy-700), var(--gold));
  transform: scaleX(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: right;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
[dir="ltr"] .card::after { transform-origin: left; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(201,168,76,0.35); }
.card:hover::after { transform: scaleX(1); }

.card-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  color: #fff;
  display: grid; place-items: center;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  transition: transform var(--transition);
}
.card:hover .card-icon { transform: scale(1.08); }
.card-icon .icon { width: 26px; height: 26px; }
.card h3 { margin-bottom: 0.5rem; }
.card p { margin-bottom: 0; }

/* Why Us */
.why-card { text-align: center; padding: 2.5rem 1.5rem; }
.why-card .card-icon { margin: 0 auto 1.25rem; }
[dir="rtl"] .why-card .card-icon { margin: 0 auto 1.25rem; }

/* Process Steps */
.process { position: relative; }
.process::before {
  content: ""; position: absolute;
  top: 27px; left: 12.5%; right: 12.5%; height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.4; z-index: 0;
}
.step { text-align: center; position: relative; z-index: 1; padding: 0 0.5rem; }
.step-num {
  width: 56px; height: 56px;
  background: var(--bg);
  border: 2px solid var(--gold);
  color: var(--gold);
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 1.25rem;
  font-family: var(--font-heading-en);
  font-weight: 700; font-size: 1.25rem;
  transition: all var(--transition);
  box-shadow: 0 0 0 0 rgba(201,168,76,0);
}
.step:hover .step-num {
  background: var(--gold);
  color: var(--navy-900);
  box-shadow: 0 0 0 6px var(--gold-muted);
}
.section-alt .step-num { background: var(--bg-alt); }
.section-alt .step:hover .step-num { background: var(--gold); }
.step h3 { font-size: 1.05rem; }
.step p { font-size: 0.9rem; }

/* Testimonials */
.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  position: relative;
  transition: all var(--transition);
}
.testimonial:hover { box-shadow: var(--shadow); border-color: var(--gold-muted); transform: translateY(-3px); }
.testimonial::before {
  content: "\201C";
  position: absolute; top: 0.5rem; left: 1.5rem;
  font-family: Georgia, serif; font-size: 5.5rem;
  color: var(--gold); opacity: 0.18; line-height: 1;
}
[dir="rtl"] .testimonial::before {
  content: "\201D";
  left: auto; right: 1.5rem;
}
.testimonial p { font-size: 1.05rem; color: var(--text); font-style: italic; margin-bottom: 1.5rem; line-height: 1.8; }
.testimonial-author { display: flex; align-items: center; gap: 1rem; }
.testimonial-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--gold));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-heading-en); font-weight: 700;
  flex-shrink: 0;
}
.testimonial-info strong { display: block; color: var(--text); }
.testimonial-info span { font-size: 0.85rem; color: var(--gold); font-weight: 500; }

/* Portfolio */
.portfolio-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 2.5rem; }
.filter-btn {
  padding: 0.55rem 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--gold); color: var(--gold); }
.filter-btn.active { background: var(--gold); color: var(--navy-900); border-color: var(--gold); font-weight: 600; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 24, 20, 0.92);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 2rem;
}
.lightbox.open { display: flex; animation: lbFade 0.3s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.lightbox-stage {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1rem;
  max-width: min(1100px, 92vw);
}
.lightbox img {
  max-width: 100%; max-height: 82vh; border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8);
  animation: lbZoom 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes lbZoom { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.lightbox-counter {
  color: rgba(255,255,255,0.8); font-size: 0.85rem; letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.lightbox-close {
  position: absolute; top: 1.5rem; inset-inline-end: 1.5rem;
  background: rgba(255,255,255,0.1); color: #fff; border: none;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.4rem;
  display: grid; place-items: center;
  transition: background var(--transition), transform var(--transition);
}
.lightbox-close:hover { background: var(--gold); color: var(--navy-900); transform: rotate(90deg); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); color: #fff;
  cursor: pointer; display: grid; place-items: center; z-index: 2;
  transition: background var(--transition), border-color var(--transition);
}
.lightbox-nav:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-900); }
.lightbox-nav .icon { width: 26px; height: 26px; }
.lightbox-prev { inset-inline-start: 1.5rem; }
.lightbox-next { inset-inline-end: 1.5rem; }
/* Mirror chevrons for RTL so they point the natural direction */
[dir="rtl"] .lightbox-prev .icon,
[dir="rtl"] .lightbox-next .icon { transform: scaleX(-1); }

/* Split / About */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
.split img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat {
  text-align: center; padding: 2.25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy-700), var(--gold));
  transform: scaleX(0);
  transition: transform 0.35s ease;
  transform-origin: right;
}
[dir="ltr"] .stat::before { transform-origin: left; }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold-muted); }
.stat:hover::before { transform: scaleX(1); }
.stat-num {
  font-family: var(--font-heading-en);
  font-size: 2.6rem; color: var(--gold);
  font-weight: 700; line-height: 1;
}
.stat-num::after { content: "+"; font-size: 1.8rem; }
.stat-label { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.5rem; }

/* Timeline */
.timeline { position: relative; padding: 1rem 0; }
.timeline::before {
  content: ""; position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px; background: var(--border);
  transform: translateX(-50%);
}
[dir="rtl"] .timeline::before {
  left: auto; right: 50%;
  transform: translateX(50%);
}
.timeline-item { position: relative; width: 50%; padding: 1rem 2.5rem; }
.timeline-item:nth-child(odd) { left: 0; text-align: right; }
.timeline-item:nth-child(even) { left: 50%; text-align: left; }
[dir="rtl"] .timeline-item:nth-child(odd)  { left: 0; right: 0; text-align: right; }
[dir="rtl"] .timeline-item:nth-child(even) { left: auto; right: 50%; text-align: right; }
.timeline-item::before {
  content: ""; position: absolute; top: 1.5rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--bg);
  box-shadow: 0 0 0 3px var(--gold-muted);
}
.timeline-item:nth-child(odd)::before  { right: -8px; left: auto; }
.timeline-item:nth-child(even)::before { left: -8px; right: auto; }
[dir="rtl"] .timeline-item:nth-child(odd)::before  { right: -8px; left: auto; }
[dir="rtl"] .timeline-item:nth-child(even)::before { right: -8px; left: auto; }
.timeline-year {
  font-family: var(--font-heading-en);
  color: var(--gold); font-weight: 700; font-size: 1.25rem; margin-bottom: 0.25rem;
}
.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: all var(--transition);
}
.timeline-content:hover { border-color: var(--gold-muted); box-shadow: var(--shadow-sm); }

/* Team */
.team-card { text-align: center; padding: 2rem 1.5rem; }
.team-avatar {
  width: 110px; height: 110px; margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--gold));
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-heading-en); font-weight: 700; font-size: 2rem;
  border: 4px solid var(--bg);
  box-shadow: var(--shadow), 0 0 0 1px var(--gold-muted);
  transition: transform var(--transition), box-shadow var(--transition);
}
.team-card:hover .team-avatar {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg), 0 0 0 3px var(--gold-muted);
}
.team-card h3 { margin-bottom: 0.25rem; }
.team-role { color: var(--gold); font-size: 0.9rem; font-weight: 500; margin-bottom: 0.75rem; }

/* FAQ */
.faq { max-width: 800px; margin: 0 auto; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.faq-item:hover { border-color: rgba(201,168,76,0.3); }
.faq-item.open { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-muted); }
.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: 600; color: var(--text);
  background: none; border: none; width: 100%;
  font-family: inherit; font-size: 1rem;
  text-align: inherit;
  gap: 1rem;
}
.faq-question::after {
  content: "+"; color: var(--gold); font-size: 1.5rem;
  font-weight: 400; transition: transform var(--transition);
  flex-shrink: 0;
}
.faq-item.open .faq-question::after { transform: rotate(45deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height 0.35s ease;
  padding: 0 1.5rem;
}
.faq-item.open .faq-answer { max-height: 300px; padding: 0 1.5rem 1.25rem; }
.faq-answer p { margin: 0; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; }
.contact-info { display: flex; flex-direction: column; gap: 1rem; }
.contact-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.contact-item:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.contact-item .ico {
  width: 44px; height: 44px;
  background: var(--gold-muted);
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--gold);
  flex-shrink: 0;
  transition: background var(--transition);
}
.contact-item:hover .ico { background: var(--gold); color: var(--navy-900); }
.contact-item strong { display: block; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; margin-bottom: 0.25rem; }
.contact-item span, .contact-item a { color: var(--text); font-weight: 500; }

.map-embed {
  width: 100%; height: 350px; border: 0; border-radius: var(--radius-lg);
  margin-top: 2rem; box-shadow: var(--shadow);
  filter: grayscale(0.3);
}
[data-theme="dark"] .map-embed { filter: invert(0.9) grayscale(0.5) hue-rotate(180deg); }

/* Forms */
form {
  display: flex; flex-direction: column; gap: 1rem;
  background: var(--surface); padding: 2rem;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
}
label { font-size: 0.9rem; font-weight: 500; color: var(--text); margin-bottom: 0.4rem; display: block; }
input, textarea, select {
  width: 100%; padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  border-radius: var(--radius);
  font-family: inherit; font-size: 0.95rem;
  transition: all var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-muted);
}
textarea { min-height: 140px; resize: vertical; }
.form-error { color: #d33; font-size: 0.85rem; margin-top: 0.25rem; min-height: 1em; }
/* Contact form success state (replaces the form after a message is sent) */
.contact-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 2.5rem 1.5rem;
  animation: successPop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.contact-success-icon {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1f9d55;
  background: color-mix(in oklab, #1f9d55 14%, transparent);
  border: 2px solid color-mix(in oklab, #1f9d55 38%, transparent);
}
.contact-success-icon .env { width: 46px; height: 46px; }
.contact-success-icon .check {
  position: absolute;
  bottom: -3px;
  inset-inline-end: -3px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1f9d55;
  color: #fff;
  display: grid;
  place-items: center;
  border: 4px solid var(--bg);
  box-shadow: 0 4px 12px -4px rgba(31, 157, 85, 0.6);
  animation: checkPop 0.45s 0.25s cubic-bezier(0.22, 1.4, 0.5, 1) backwards;
}
.contact-success-icon .check svg { width: 20px; height: 20px; }
.contact-success-title { font-size: 1.5rem; margin: 0.4rem 0 0; color: var(--text); }
.contact-success-text { color: var(--text-muted); max-width: 440px; margin: 0; }
.contact-success-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.6rem;
}
@keyframes successPop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes checkPop {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: none; }
}
form .btn-primary { background: var(--gold); color: var(--navy-900); }
form .btn-primary:hover { background: var(--gold-hover); color: var(--navy-900); }

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 70%, rgba(201,168,76,0.2) 100%);
  color: #fff;
  padding: 4.5rem 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(201,168,76,0.2), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(46,132,102,0.3), transparent 45%);
}
.cta-banner > * { position: relative; }
.cta-banner h2 { color: #fff; }
.cta-banner p { color: rgba(255,255,255,0.85); max-width: 600px; margin: 0 auto 1.75rem; }
.cta-banner .btn-primary {
  background: var(--gold); color: var(--navy-900);
  box-shadow: 0 6px 24px -6px rgba(201,168,76,0.5);
  font-weight: 700;
}
.cta-banner .btn-primary:hover {
  background: var(--gold-hover); color: var(--navy-900);
  box-shadow: 0 10px 28px -6px rgba(201,168,76,0.6);
}

/* WhatsApp floating */
.whatsapp-float {
  position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 40;
  width: 56px; height: 56px;
  background: #25d366; color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: transform var(--transition);
  animation: wapulse 2.5s infinite;
}
[dir="rtl"] .whatsapp-float { left: auto; right: 1.5rem; }
.whatsapp-float:hover { transform: scale(1.12); color: #fff; }
.whatsapp-float .icon { width: 28px; height: 28px; stroke: #fff; }
@keyframes wapulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(37,211,102,0.4), 0 0 0 0 rgba(37,211,102,0.3); }
  50%       { box-shadow: 0 8px 24px rgba(37,211,102,0.4), 0 0 0 12px rgba(37,211,102,0); }
}

/* Breadcrumbs */
.breadcrumbs { padding: 1rem 0; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs span { margin: 0 0.5rem; }

/* Footer */
.site-footer {
  background: var(--navy-900);
  color: #cdd5e3;
  padding: 4.5rem 0 1.5rem;
  margin-top: 5rem;
}
[data-theme="dark"] .site-footer { background: #06091a; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.site-footer .brand { color: #fff; margin-bottom: 1rem; }
.site-footer .brand-text small { color: rgba(255,255,255,0.5); }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1.25rem; }
.site-footer p, .site-footer a { color: #cdd5e3; font-size: 0.9rem; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.social-links { display: flex; gap: 0.75rem; margin-top: 1rem; }
.social-links a {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%; color: #cdd5e3;
  transition: all var(--transition);
}
.social-links a:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-900); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem; text-align: center;
  font-size: 0.85rem; color: #6b7a96;
}

/* ===== Scroll Progress Bar ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--navy-700), var(--gold));
  pointer-events: none;
  transition: width 0.08s linear;
}

/* ===== Back To Top ===== */
.back-to-top {
  position: fixed; bottom: 5.5rem;
  inset-inline-end: 1.5rem;
  z-index: 40;
  width: 44px; height: 44px;
  background: var(--gold); color: var(--navy-900);
  border: none; border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0; transform: translateY(16px);
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(201,168,76,0.4);
}
.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover   { transform: translateY(-4px); box-shadow: 0 8px 22px rgba(201,168,76,0.55); }
.back-to-top .icon   { width: 20px; height: 20px; }

/* ===== Page Header (inner pages) ===== */
.page-header {
  position: relative;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  padding: 3.5rem 0 3rem;
  overflow: hidden;
  color: #fff;
}
.page-header::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at top right, rgba(201,168,76,0.18), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(46,132,102,0.25), transparent 55%);
  pointer-events: none;
}
.page-header::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.page-header .container { position: relative; z-index: 1; }
.page-header .eyebrow { color: var(--gold); }
.page-header h1 { color: #fff; margin-bottom: 0.5rem; font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
.page-header .ph-breadcrumbs {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: rgba(255,255,255,0.55);
  margin-top: 1rem; flex-wrap: wrap;
}
.page-header .ph-breadcrumbs a { color: rgba(255,255,255,0.55); }
.page-header .ph-breadcrumbs a:hover { color: var(--gold); }
.page-header .ph-breadcrumbs .sep { opacity: 0.4; }

/* Page header entrance */
.page-header .eyebrow { animation: phFadeUp 0.55s ease both 0.05s; }
.page-header h1        { animation: phFadeUp 0.55s ease both 0.18s; }
.page-header .ph-breadcrumbs { animation: phFadeUp 0.45s ease both 0.30s; }
@keyframes phFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Hero stagger entrance ===== */
.hero-content > * {
  opacity: 0;
  transform: translateY(22px);
  animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-content .eyebrow      { animation-delay: 0.10s; }
.hero-content h1             { animation-delay: 0.24s; }
.hero-content p              { animation-delay: 0.38s; }
.hero-content .hero-actions  { animation-delay: 0.52s; }
.hero-content .trust-bar     { animation-delay: 0.66s; }
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Card stagger (nth-child transition-delay) ===== */
.grid .reveal:nth-child(1) { transition-delay: 0.00s; }
.grid .reveal:nth-child(2) { transition-delay: 0.09s; }
.grid .reveal:nth-child(3) { transition-delay: 0.18s; }
.grid .reveal:nth-child(4) { transition-delay: 0.27s; }
.grid .reveal:nth-child(5) { transition-delay: 0.36s; }
.grid .reveal:nth-child(6) { transition-delay: 0.45s; }
.process .reveal:nth-child(1) { transition-delay: 0.00s; }
.process .reveal:nth-child(2) { transition-delay: 0.10s; }
.process .reveal:nth-child(3) { transition-delay: 0.20s; }
.process .reveal:nth-child(4) { transition-delay: 0.30s; }

/* ===== Star ratings ===== */
.star-rating {
  display: flex; gap: 2px; margin-bottom: 1rem;
  color: var(--gold); font-size: 1.05rem;
}
.star-rating svg {
  width: 16px; height: 16px;
  fill: var(--gold); stroke: none;
}

/* ===== Stats icons ===== */
.stat-icon {
  display: flex; justify-content: center; margin-bottom: 0.75rem;
  color: var(--gold); opacity: 0.75;
}
.stat-icon .icon { width: 30px; height: 30px; }

/* ===== Mobile menu slide animation ===== */
@media (max-width: 700px) {
  .nav-links {
    display: flex !important;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    padding: 0 1.5rem;
    border-bottom: none;
    box-shadow: none;
  }
  .nav-links.open {
    max-height: 360px; opacity: 1;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px -8px rgba(14,47,40,0.15);
  }
}

/* ===== 404 page ===== */
.page-404 {
  min-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 4rem 1.5rem;
}
.page-404 .num-404 {
  font-family: var(--font-heading-en);
  font-size: clamp(6rem, 18vw, 11rem);
  font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--navy-700), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 0.25rem;
}
.page-404 h1 { margin-bottom: 0.5rem; }
.page-404 p  { max-width: 480px; margin: 0 auto 2rem; }
.page-404-geo {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0.06;
}
.page-404-geo svg { position: absolute; right: -80px; top: -80px; width: 480px; height: 480px; }

/* ===== Animations ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ====== Portfolio cards (grid) ====== */
.portfolio-intro {
  text-align: center; max-width: 620px; margin: 0 auto 2.25rem;
  color: var(--text-muted); font-size: 1.05rem;
}
.project-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklab, var(--gold) 45%, var(--border));
  color: var(--text);
}
.project-card-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg-alt); }
.project-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.project-card:hover .project-card-media img { transform: scale(1.07); }
.project-card-tag {
  position: absolute; inset-block-start: 0.85rem; inset-inline-start: 0.85rem;
  background: var(--gold); color: var(--navy-900);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  box-shadow: 0 4px 12px -4px rgba(201,168,76,0.5);
}
.project-card-cta {
  position: absolute; inset-inline: 0; inset-block-end: 0;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem; color: var(--navy-900); font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.02em;
  background: var(--gold);
  transform: translateY(101%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-card:hover .project-card-cta { transform: translateY(0); }
.project-card-cta .cta-arrow { stroke: var(--navy-900); transition: transform var(--transition); }
.project-card:hover .project-card-cta .cta-arrow { transform: translateX(4px); }
[dir="rtl"] .project-card-cta .cta-arrow { transform: scaleX(-1); }
[dir="rtl"] .project-card:hover .project-card-cta .cta-arrow { transform: scaleX(-1) translateX(4px); }
.project-card-body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; gap: 0.75rem; }
.project-card-title { margin: 0; font-size: 1.2rem; color: var(--text); }
.project-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.project-card-meta .pc-year { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-muted); }
.project-card-meta .pc-year .icon { stroke: var(--gold); }
.project-card-meta .pc-type {
  color: var(--gold); font-weight: 600;
  background: var(--gold-muted); padding: 0.25rem 0.7rem; border-radius: 999px;
}
.project-card.hidden { display: none; }

/* ====== Project detail page ====== */
.project-hero.page-header { position: relative; }
.project-hero.page-header::before {
  background-image: linear-gradient(135deg, rgba(14,47,40,0.92), rgba(14,47,40,0.78)), var(--hero-img);
  background-size: cover; background-position: center;
}
.project-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 2.5rem; align-items: start;
}
.project-cover {
  margin: 0 0 2rem; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.project-cover img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.project-overview h2,
.project-gallery-block h2 {
  position: relative; padding-inline-start: 1rem;
}
.project-overview h2::before,
.project-gallery-block h2::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0.15em; bottom: 0.15em;
  width: 4px; border-radius: 4px;
  background: linear-gradient(var(--gold), var(--navy-500));
}
.project-overview h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.project-overview p { font-size: 1.05rem; line-height: 1.9; color: var(--text-muted); }
.project-overview p:last-child { margin-bottom: 0; }
.project-info {
  position: sticky; top: 90px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.project-info .info-row {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.project-info .info-row:first-child { padding-top: 0; }
.info-icon {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold-muted);
}
.info-icon .icon { width: 20px; height: 20px; stroke: var(--gold); }
.info-text { display: flex; flex-direction: column; gap: 0.15rem; }
.info-label { font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.03em; }
.info-value { font-size: 1.02rem; font-weight: 600; color: var(--text); }
.info-back { display: block; text-align: center; margin-top: 1.4rem; }

.project-gallery-block { margin-top: 3.5rem; }
.project-gallery-block h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }

/* Mosaic gallery: mixed wide / tall / large tiles packed with no gaps */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
  gap: 1rem;
}
.gallery-item {
  position: relative;
  margin: 0; border-radius: var(--radius-lg); overflow: hidden;
  cursor: zoom-in; background: var(--bg-alt);
  box-shadow: var(--shadow-sm);
  animation: tileIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-item:hover img { transform: scale(1.08); }
/* Hover zoom overlay */
.gallery-zoom {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(14, 47, 40, 0.45);
  opacity: 0; transition: opacity var(--transition);
}
.gallery-zoom .icon {
  width: 30px; height: 30px; stroke: #fff;
  transform: scale(0.7); transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.gallery-item:hover .gallery-zoom { opacity: 1; }
.gallery-item:hover .gallery-zoom .icon { transform: scale(1); }
/* Staggered entrance */
.gallery-item:nth-child(1) { animation-delay: 0.04s; }
.gallery-item:nth-child(2) { animation-delay: 0.10s; }
.gallery-item:nth-child(3) { animation-delay: 0.16s; }
.gallery-item:nth-child(4) { animation-delay: 0.22s; }
.gallery-item:nth-child(5) { animation-delay: 0.28s; }
.gallery-item:nth-child(6) { animation-delay: 0.34s; }
.gallery-item:nth-child(7) { animation-delay: 0.40s; }
.gallery-item:nth-child(8) { animation-delay: 0.46s; }
@keyframes tileIn { from { opacity: 0; transform: scale(0.96) translateY(16px); } to { opacity: 1; transform: none; } }
/* Size variants */
.gallery-item.g-wide { grid-column: span 2; }
.gallery-item.g-tall { grid-row: span 2; }
.gallery-item.g-big  { grid-column: span 2; grid-row: span 2; }

.project-notfound { text-align: center; padding: 6rem 0; }
.project-notfound h2 { font-size: 1.8rem; margin-bottom: 0.75rem; }
.project-notfound p { max-width: 460px; margin: 0 auto 1.75rem; }

/* ============================================================
   BLUEPRINT SYSTEM + KINETIC MOTION  (site-wide)
   ============================================================ */

/* --- Header: shrink + sharpen on scroll --- */
.site-header.scrolled {
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  box-shadow: 0 1px 0 var(--border), 0 10px 30px -22px rgba(14,47,40,0.5);
}
.site-header.scrolled .nav { padding: 0.55rem 0; }
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.site-header.scrolled::after { opacity: 0.55; }

/* --- Section-alt as a stronger blueprint canvas --- */
.section-alt { position: relative; }
.section-alt::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--bp-line-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-line-strong) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, #000, transparent 78%);
          mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, #000, transparent 78%);
}
.section-alt > .container { position: relative; z-index: 1; }

/* --- Section heads: bold + technical crosshair frame --- */
.section-head h2 { position: relative; display: inline-block; }
.section-head .eyebrow::after { width: 48px; height: 2px; }

/* --- Buttons: kinetic bracket + shine sweep --- */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease-out);
}
.btn:hover::before { transform: translateX(120%); }
[dir="rtl"] .btn:hover::before { transform: translateX(-120%); }
[dir="rtl"] .btn::before { transform: translateX(120%); }
.btn-outline {
  position: relative;
}
.btn-outline::after {
  content: ""; position: absolute; inset: 5px;
  border: 1px dashed transparent; border-radius: 4px;
  transition: border-color var(--transition);
  pointer-events: none;
}
.btn-outline:hover::after { border-color: color-mix(in oklab, var(--gold) 55%, transparent); }

/* --- Cards: blueprint frame + cursor-tracking glow + 3D tilt --- */
.card, .testimonial, .project-card {
  --mx: 50%; --my: 50%;
  transform-style: preserve-3d;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0;
  background: radial-gradient(240px circle at var(--mx) var(--my), var(--gold-muted), transparent 62%);
  transition: opacity var(--transition);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.card:hover {
  outline: 1px dashed color-mix(in oklab, var(--gold) 42%, transparent);
  outline-offset: -7px;
}
/* Blueprint icon frame */
.card-icon {
  position: relative;
  background: var(--gold-muted);
  color: var(--gold);
  border: 1px solid color-mix(in oklab, var(--gold) 40%, transparent);
  border-radius: 6px;
  overflow: visible;
}
.card-icon .icon { stroke: var(--gold); }
.card-icon::before, .card-icon::after {
  content: ""; position: absolute; width: 9px; height: 9px;
  border: 1.5px solid var(--gold); opacity: 0.85;
}
.card-icon::before { top: -4px; inset-inline-start: -4px; border-inline-end: 0; border-block-end: 0; }
.card-icon::after  { bottom: -4px; inset-inline-end: -4px; border-inline-start: 0; border-block-start: 0; }
.card:hover .card-icon {
  background: var(--gold); color: var(--navy-900);
  transform: translateZ(20px) scale(1.06);
}
.card:hover .card-icon .icon { stroke: var(--navy-900); }

/* Cursor glow for testimonials too */
.testimonial { position: relative; overflow: hidden; }
.testimonial::after {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--gold-muted), transparent 62%);
  transition: opacity var(--transition); pointer-events: none;
}
.testimonial:hover::after { opacity: 1; }
.testimonial > * { position: relative; z-index: 1; }

/* --- Stats: blueprint plate --- */
.stat { position: relative; transition: transform var(--transition); }
.stat:hover { transform: translateY(-4px); }

/* --- Kinetic reveal: richer, directional entrance --- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.7s ease, transform 0.7s var(--ease-out); }
.reveal.visible { opacity: 1; transform: none; }
.grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.grid .reveal:nth-child(5) { transition-delay: 0.24s; }
.grid .reveal:nth-child(6) { transition-delay: 0.30s; }

/* --- Project cards on the portfolio grid: blueprint index tag --- */
.project-card { --mx: 50%; --my: 50%; }
.project-card::after {
  content: ""; position: absolute; inset: 0; z-index: 2; opacity: 0;
  background: radial-gradient(300px circle at var(--mx) var(--my), rgba(201,168,76,0.10), transparent 60%);
  transition: opacity var(--transition); pointer-events: none;
}
.project-card:hover::after { opacity: 1; }

/* Responsive */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .process::before { display: none; }
  .timeline::before { left: 8px; transform: none; }
  [dir="rtl"] .timeline::before { right: 8px; left: auto; transform: none; }
  .timeline-item { width: 100% !important; left: 0 !important; right: 0 !important; padding-inline-start: 2.5rem; padding-inline-end: 0; text-align: start !important; }
  .timeline-item::before { inset-inline-start: 0 !important; inset-inline-end: auto !important; }
  .project-layout { grid-template-columns: 1fr; gap: 1.75rem; }
  .project-info { position: static; }
}

@media (max-width: 880px) {
  /* Hero stacks: centered text, blueprint becomes a faint full-bleed backdrop */
  .hero { text-align: center; }
  .hero-content { max-width: 100%; margin-inline: auto; }
  .hero-actions, .trust-bar { justify-content: center; }
  .hero-blueprint {
    width: 100%; opacity: 0.16;
    -webkit-mask-image: none; mask-image: none;
  }
}

@media (max-width: 760px) {
  /* Collapse mosaic to a clean 2-column grid; big/wide span the full width */
  .project-gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .gallery-item.g-tall { grid-row: span 1; }
  .gallery-item.g-wide { grid-column: span 2; }
  .gallery-item.g-big  { grid-column: span 2; grid-row: span 2; }
}

@media (max-width: 700px) {
  .menu-toggle { display: grid; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    gap: 1rem;
    /* animation via max-height in the Animations section above */
  }
  .grid-3, .grid-2, .grid-4, .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 5rem 0 4rem; }
  .section { padding: 4rem 0; }
  .brand-text small { display: none; }
  .trust-bar span { padding: 0.4rem 1rem; border-inline-end: none; }
  .cta-banner { padding: 3rem 1.5rem; }
  .lightbox { padding: 1rem; }
  .lightbox-nav { width: 42px; height: 42px; }
  .lightbox-prev { inset-inline-start: 0.5rem; }
  .lightbox-next { inset-inline-end: 0.5rem; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .lightbox.open,
  .lightbox img,
  .bp-spin, .bp-node, .bp-scan, .draw, .bp-load { animation: none !important; }
  .draw { stroke-dashoffset: 0 !important; opacity: 1 !important; }
  .bp-scan { opacity: 0 !important; }
  .project-card,
  .project-card-cta,
  .gallery-item img,
  .gallery-zoom,
  .lightbox-close { transition-duration: 0.01ms !important; }
}
