/* =====================================================================
   MES — Mansour Electrical Service
   Core stylesheet: tokens, layout, components, animation
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------- */
:root {
  /* ------------------------------------------------------------------
     Monochrome palette — matches the black-and-white MES logo.
     Light background, black ink, greys for hierarchy.
     ------------------------------------------------------------------ */

  /* Surfaces, lightest to darkest */
  --ink:            #FFFFFF;   /* page background        */
  --ink-2:          #F6F6F7;   /* alternating band       */
  --ink-3:          #EFEFF1;   /* insets, media wells    */
  --surface:        #FFFFFF;   /* cards                  */
  --surface-2:      #F1F1F3;   /* raised elements        */

  --line:           rgba(10, 10, 12, .10);
  --line-strong:    rgba(10, 10, 12, .22);

  /* Ink */
  --white:          #FFFFFF;
  --black:          #0A0A0C;
  --text:           #0A0A0C;   /* headings, body         */
  --text-dim:       #55555E;   /* secondary copy         */
  --text-faint:     #8A8A93;   /* labels, meta           */

  /* "Accent" is simply black — kept as a variable so every
     component still has one highlight colour to point at. */
  --accent:         #0A0A0C;
  --accent-2:       #2A2A30;
  --accent-deep:    #000000;
  --accent-glow:    rgba(10, 10, 12, .16);

  /* Inverted block (dark sections on a light page) */
  --invert-bg:      #0A0A0C;
  --invert-text:    #FFFFFF;
  --invert-dim:     #A8A8B0;
  --invert-line:    rgba(255, 255, 255, .14);

  /* Greys standing in for the old status colours */
  --blue:           #55555E;
  --violet:         #55555E;
  --green:          #0A0A0C;
  --red:            #0A0A0C;

  /* Type */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  /* Fluid type scale */
  --fs-hero:  clamp(2.75rem, 8vw, 7rem);
  --fs-h1:    clamp(2.25rem, 5.5vw, 4.25rem);
  --fs-h2:    clamp(1.85rem, 4vw, 3rem);
  --fs-h3:    clamp(1.35rem, 2.4vw, 1.85rem);
  --fs-h4:    clamp(1.1rem, 1.8vw, 1.3rem);
  --fs-body:  clamp(.975rem, 1.1vw, 1.0625rem);
  --fs-sm:    .875rem;
  --fs-xs:    .78rem;

  /* Space */
  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;    --sp-7: 3rem;    --sp-8: 4rem;
  --sp-9: 6rem;    --sp-10: 8rem;

  --section-y: clamp(4.5rem, 9vw, 9rem);
  --container: 1280px;
  --gutter: clamp(1.15rem, 4vw, 3rem);

  /* Radius + shadow */
  --r-sm: 8px;  --r-md: 14px;  --r-lg: 22px;  --r-xl: 32px;  --r-pill: 999px;

  --shadow-sm: 0 1px 3px rgba(10,10,12,.06), 0 1px 2px rgba(10,10,12,.04);
  --shadow-md: 0 8px 30px rgba(10,10,12,.09), 0 2px 8px rgba(10,10,12,.05);
  --shadow-lg: 0 24px 70px rgba(10,10,12,.14), 0 6px 20px rgba(10,10,12,.07);
  --shadow-accent: 0 14px 40px -12px rgba(10,10,12,.28);

  /* Motion */
  --ease-out:  cubic-bezier(.22, 1, .36, 1);
  --ease-io:   cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: .22s;  --dur: .45s;  --dur-slow: .9s;

  --header-h: 78px;
}

/* ---------------------------------------------------------------------
   2. Reset
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Fallback only — Lenis handles smooth scroll when JS is on */
}

html.lenis { scroll-behavior: auto; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

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

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.025em;
}

::selection { background: var(--accent); color: #FFFFFF; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--ink-2); }
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: var(--r-pill);
  border: 2px solid var(--ink-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-deep); }

/* ---------------------------------------------------------------------
   3. RTL
   --------------------------------------------------------------------- */
[dir="rtl"] {
  --font-display: 'Cairo', 'Segoe UI', sans-serif;
  --font-body:    'Cairo', 'Segoe UI', sans-serif;
}
[dir="rtl"] body { letter-spacing: 0; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 { letter-spacing: 0; }
[dir="rtl"] .u-mono { font-family: var(--font-body); }

/* ---------------------------------------------------------------------
   4. Layout primitives
   --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: 1560px; }
.container--narrow { max-width: 820px; }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: calc(var(--section-y) * .6); }
.section--flush-top { padding-top: 0; }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }

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

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); } .mt-7 { margin-top: var(--sp-7); }
.mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }

.u-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.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;
}

.skip-link {
  position: absolute; top: -100px; left: var(--sp-4);
  z-index: 999; padding: var(--sp-3) var(--sp-5);
  background: var(--accent); color: var(--ink);
  border-radius: var(--r-sm); font-weight: 700;
  transition: top var(--dur-fast);
}
.skip-link:focus { top: var(--sp-4); }

/* ---------------------------------------------------------------------
   5. Section headers
   --------------------------------------------------------------------- */
.sec-head {
  max-width: 760px;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.sec-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: '';
  width: 28px; height: 1px;
  background: currentColor;
  opacity: .7;
}
.sec-head--center .eyebrow::after {
  content: '';
  width: 28px; height: 1px;
  background: currentColor;
  opacity: .7;
}

.sec-title { font-size: var(--fs-h2); margin-bottom: var(--sp-4); }
.sec-sub { color: var(--text-dim); font-size: 1.05em; max-width: 62ch; }
.sec-head--center .sec-sub { margin-inline: auto; }

/* Gradient accent text */
.grad {
  background: linear-gradient(120deg, var(--accent-2), var(--accent) 45%, var(--accent-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------------------------------------------------------------------
   6. Buttons
   --------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: .95rem 1.9rem;
  border-radius: var(--r-pill);
  font-weight: 650;
  font-size: var(--fs-sm);
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  transition: transform var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              background-color var(--dur-fast),
              color var(--dur-fast),
              border-color var(--dur-fast);
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn--primary {
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 10px 34px -10px var(--accent-glow);
}
.btn--primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, var(--accent-2), var(--accent-deep));
  opacity: 0;
  transition: opacity var(--dur);
  z-index: -1;
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px -12px var(--accent-glow);
}
.btn--primary:hover::before { opacity: 1; }

.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  background: rgba(10,10,12,.05);
}

.btn--light { background: var(--white); color: var(--ink); }
.btn--light:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.btn--sm { padding: .65rem 1.3rem; font-size: var(--fs-xs); }
.btn--lg { padding: 1.15rem 2.4rem; font-size: 1rem; }
.btn--block { width: 100%; }

.btn:disabled, .btn[aria-busy="true"] {
  opacity: .6; pointer-events: none;
}

/* Text link with animated underline */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--accent);
  font-weight: 600;
  font-size: var(--fs-sm);
  position: relative;
}
.link-arrow svg {
  width: 15px; height: 15px;
  transition: transform var(--dur) var(--ease-out);
}
[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
.link-arrow:hover svg { transform: translateX(5px); }
[dir="rtl"] .link-arrow:hover svg { transform: scaleX(-1) translateX(5px); }
.link-arrow::after {
  content: '';
  position: absolute;
  bottom: -3px; inset-inline-start: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width var(--dur) var(--ease-out);
}
.link-arrow:hover::after { width: 100%; }

/* ---------------------------------------------------------------------
   7. Preloader
   --------------------------------------------------------------------- */
.preloader {
  position: fixed; inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: var(--ink);
  transition: opacity .7s var(--ease-out), visibility .7s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }

.preloader__inner { text-align: center; }

.preloader__logo {
  width: 96px; height: 96px;
  margin: 0 auto var(--sp-5);
  animation: preload-pulse 1.7s var(--ease-io) infinite;
}
.preloader__logo circle { stroke-dasharray: 264; animation: draw-ring 2s var(--ease-io) infinite; }

@keyframes preload-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(.93); opacity: .75; }
}
@keyframes draw-ring {
  0%   { stroke-dashoffset: 264; }
  60%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -264; }
}

.preloader__bar {
  width: 190px; height: 2px;
  margin-inline: auto;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.preloader__fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
  transition: width .3s var(--ease-out);
}
.preloader__pct {
  margin-top: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-faint);
  letter-spacing: .18em;
}

/* ---------------------------------------------------------------------
   8. Custom cursor (desktop, fine pointer only)
   --------------------------------------------------------------------- */
.cursor, .cursor-dot {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9998;
  border-radius: 50%;
  will-change: transform;
  mix-blend-mode: difference;
}
.cursor {
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,.55);
  transition: width .3s var(--ease-out), height .3s var(--ease-out),
              background-color .3s, border-color .3s, opacity .3s;
}
.cursor-dot {
  width: 5px; height: 5px;
  background: var(--white);
}
.cursor.is-hover {
  width: 62px; height: 62px;
  background: rgba(255,255,255,.14);
  border-color: transparent;
}
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-dot { display: none !important; }
}

/* ---------------------------------------------------------------------
   9. Scroll progress bar
   --------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0; inset-inline-start: 0;
  height: 2px; width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2), var(--accent));
  z-index: 9997;
  will-change: transform;
}
[dir="rtl"] .scroll-progress { transform-origin: 100% 50%; }

/* ---------------------------------------------------------------------
   10. Header
   --------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0; inset-inline: 0;
  z-index: 900;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color var(--dur) var(--ease-out),
              backdrop-filter var(--dur),
              border-color var(--dur),
              height var(--dur) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.header.is-stuck {
  height: 66px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom-color: var(--line);
}
.header.is-hidden { transform: translateY(-100%); }
.header { transition-property: background-color, backdrop-filter, border-color, height, transform; }

.header__inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  z-index: 2;
}
.logo__mark {
  width: 44px; height: 44px;
  transition: transform var(--dur) var(--ease-spring);
}
.logo:hover .logo__mark { transform: rotate(-8deg) scale(1.06); }
.logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.logo__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.01em;
}
.logo__tag {
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
@media (max-width: 420px) { .logo__text { display: none; } }

/* Nav */
.nav { display: flex; align-items: center; gap: var(--sp-1); }
.nav__link {
  position: relative;
  padding: .55rem .85rem;
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--text-dim);
  border-radius: var(--r-sm);
  transition: color var(--dur-fast);
  white-space: nowrap;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: .3rem;
  inset-inline-start: .85rem;
  width: 0; height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: width var(--dur) var(--ease-out);
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after { width: calc(100% - 1.7rem); }
.nav__link.is-active { color: var(--accent); }
.nav__link.is-active::after { width: calc(100% - 1.7rem); }

/* Dropdown */
.nav__item { position: relative; }
.nav__toggle { display: inline-flex; align-items: center; gap: 5px; }
.nav__toggle svg { width: 11px; height: 11px; transition: transform var(--dur-fast); }
.nav__item:hover .nav__toggle svg { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-start: 0;
  min-width: 230px;
  padding: var(--sp-2);
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(24px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.97);
  transform-origin: top center;
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              visibility var(--dur-fast);
}
.nav__item:hover .dropdown,
.nav__item:focus-within .dropdown {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
}
.dropdown__link {
  display: block;
  padding: .6rem .8rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  transition: background-color var(--dur-fast), color var(--dur-fast),
              padding-inline-start var(--dur-fast);
}
.dropdown__link:hover {
  background: rgba(10,10,12,.06);
  color: var(--accent);
  padding-inline-start: 1.1rem;
}

.header__actions { display: flex; align-items: center; gap: var(--sp-3); }

/* Language switch */
.lang-switch {
  display: flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.03);
}
.lang-switch a {
  padding: .3rem .7rem;
  border-radius: var(--r-pill);
  font-size: .74rem;
  font-weight: 650;
  color: var(--text-faint);
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.lang-switch a.is-active { background: var(--accent); color: var(--ink); }
.lang-switch a:not(.is-active):hover { color: var(--text); }

/* Burger */
.burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  position: relative;
  z-index: 2;
}
.burger span {
  position: absolute;
  inset-inline-start: 12px;
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur-fast);
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 26px; }
.burger.is-open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.is-open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 899;
  background: rgba(255,255,255,.99);
  backdrop-filter: blur(26px);
  padding: calc(var(--header-h) + 2rem) var(--gutter) 2rem;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease-out), visibility var(--dur);
}
.drawer.is-open { opacity: 1; visibility: visible; }

.drawer__nav { display: flex; flex-direction: column; gap: var(--sp-1); }
.drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem .4rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 650;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(22px);
  transition: color var(--dur-fast), padding-inline-start var(--dur-fast);
}
.drawer.is-open .drawer__link {
  animation: drawer-in .55s var(--ease-out) forwards;
}
.drawer__link:hover, .drawer__link.is-active {
  color: var(--accent);
  padding-inline-start: 1rem;
}
.drawer__link span { font-family: var(--font-mono); font-size: .7rem; color: var(--text-faint); }

@keyframes drawer-in {
  to { opacity: 1; transform: translateY(0); }
}

.drawer__footer {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

@media (max-width: 1080px) {
  .nav { display: none; }
  .burger { display: block; }
}

/* ---------------------------------------------------------------------
   11. Hero
   --------------------------------------------------------------------- */
/* The hero is the one inverted block: black canvas, white type.
   It keeps the WebGL field readable and gives the light page an anchor. */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--header-h);
  isolation: isolate;
  background: var(--invert-bg);
  color: var(--invert-text);
}
.hero .hero__title,
.hero .hero__meta-num { color: var(--invert-text); }
.hero .hero__sub,
.hero .hero__badge   { color: var(--invert-dim); }
.hero .hero__meta,
.hero .hero__badge   { border-color: var(--invert-line); }
.hero .hero__meta-label,
.hero .scroll-hint__text { color: var(--invert-dim); }

/* Buttons invert inside the hero so they stay legible */
.hero .btn--primary {
  background: var(--invert-text);
  color: var(--invert-bg);
  box-shadow: 0 10px 34px -10px rgba(0,0,0,.55);
}
.hero .btn--primary::before {
  background: linear-gradient(120deg, #FFFFFF, #D8D8DC);
}
.hero .btn--ghost {
  border-color: var(--invert-line);
  color: var(--invert-text);
  background: rgba(255,255,255,.06);
}
.hero .btn--ghost:hover {
  border-color: var(--invert-text);
  color: var(--invert-bg);
  background: var(--invert-text);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0;
  transition: opacity 1.6s var(--ease-out);
}
#hero-canvas.is-ready { opacity: 1; }

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, transparent 0%, rgba(10,10,12,.5) 68%, var(--invert-bg) 100%),
    linear-gradient(180deg, rgba(10,10,12,.65) 0%, transparent 26%, transparent 72%, var(--invert-bg) 100%);
  pointer-events: none;
}

/* Grid floor — CSS 3D, cheap */
.hero__grid {
  position: absolute;
  inset-inline: -30%;
  bottom: -12%;
  height: 62%;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.13) 1px, transparent 1px);
  background-size: 62px 62px;
  transform: perspective(560px) rotateX(74deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 78%);
  animation: grid-flow 22s linear infinite;
  pointer-events: none;
}
@keyframes grid-flow {
  to { background-position: 0 62px, 62px 0; }
}

.hero__content { position: relative; z-index: 2; max-width: 940px; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: .45rem 1rem .45rem .55rem;
  margin-bottom: var(--sp-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(12px);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.hero__badge b { color: var(--accent); font-weight: 650; }

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  position: relative;
  flex-shrink: 0;
}
.pulse-dot::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-ring 2s var(--ease-out) infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: .8; }
  100% { transform: scale(3.2); opacity: 0; }
}

.hero__title {
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: .96;
  letter-spacing: -.04em;
  margin-bottom: var(--sp-5);
}
[dir="rtl"] .hero__title { line-height: 1.2; letter-spacing: 0; }

.hero__sub {
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  color: var(--text-dim);
  max-width: 60ch;
  margin-bottom: var(--sp-6);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-4); }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}
.hero__meta-item { display: flex; flex-direction: column; gap: 2px; }
.hero__meta-num {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.hero__meta-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.scroll-hint {
  position: absolute;
  bottom: var(--sp-6);
  inset-inline-end: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  z-index: 2;
}
.scroll-hint__text {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-faint);
  writing-mode: vertical-rl;
}
[dir="rtl"] .scroll-hint__text { writing-mode: vertical-lr; }
.scroll-hint__line {
  width: 1px; height: 62px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-hint__line::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 22px;
  background: var(--accent-2);
  animation: scroll-trace 2.1s var(--ease-io) infinite;
}
@keyframes scroll-trace {
  0%   { transform: translateY(-24px); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: translateY(62px); opacity: 0; }
}
@media (max-width: 900px) { .scroll-hint { display: none; } }

/* ---------------------------------------------------------------------
   12. Scroll reveal
   --------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity .95s var(--ease-out), transform .95s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-52px); }
[data-reveal="right"] { transform: translateX(52px); }
[data-reveal="scale"] { transform: scale(.9); }
[data-reveal="flip"]  { transform: perspective(1100px) rotateX(-22deg) translateY(38px); }
[data-reveal="zoom"]  { transform: scale(1.14); opacity: 0; }

[data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Per-character / per-word text reveal */
.split-line { display: block; overflow: hidden; }
.split-word,
.split-char {
  display: inline-block;
  transform: translateY(105%) rotate(4deg);
  opacity: 0;
  transition: transform .95s var(--ease-out), opacity .7s var(--ease-out);
}
.is-in .split-word,
.is-in .split-char { transform: none; opacity: 1; }

/* ---------------------------------------------------------------------
   13. Cards — the 3D tilt system
   --------------------------------------------------------------------- */
.card {
  position: relative;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  background: linear-gradient(160deg, var(--surface) 0%, var(--ink-3) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  transition: transform var(--dur) var(--ease-out),
              border-color var(--dur),
              box-shadow var(--dur);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    460px circle at var(--mx, 50%) var(--my, 50%),
    rgba(10,10,12,.07),
    transparent 42%
  );
  opacity: 0;
  transition: opacity var(--dur);
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.card:hover::before { opacity: 1; }

.card__inner { transform: translateZ(28px); }

.card__icon {
  width: 54px; height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: var(--sp-4);
  border-radius: var(--r-md);
  background: linear-gradient(140deg, rgba(10,10,12,.08), rgba(10,10,12,.03));
  border: 1px solid rgba(10,10,12,.14);
  color: var(--accent);
  transition: transform var(--dur) var(--ease-spring), background-color var(--dur);
}
.card__icon svg { width: 25px; height: 25px; }
.card:hover .card__icon {
  transform: translateZ(34px) scale(1.1) rotate(-6deg);
}

.card__title {
  font-size: var(--fs-h4);
  margin-bottom: var(--sp-3);
  transition: color var(--dur-fast);
}
.card:hover .card__title { color: var(--accent); }

.card__text { color: var(--text-dim); font-size: var(--fs-sm); }

.card__num {
  position: absolute;
  top: var(--sp-4);
  inset-inline-end: var(--sp-5);
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(255,255,255,.035);
  pointer-events: none;
  transition: color var(--dur);
}
.card:hover .card__num { color: rgba(10,10,12,.06); }

.card__list {
  margin-top: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.card__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.card__list svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
  margin-top: .35em;
  color: var(--accent);
}

.card__link { margin-top: var(--sp-5); }

/* Card with a photo */
.card--media { padding: 0; }
.card--media .card__body { padding: clamp(1.4rem, 2.6vw, 2rem); }

.media {
  position: relative;
  overflow: hidden;
  background: var(--ink-3);
}
.media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(5,5,10,.82) 0%, transparent 55%);
  opacity: .85;
  transition: opacity var(--dur);
}
.media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease-out), filter var(--dur);
}
.card:hover .media img { transform: scale(1.07); }
.media--16-9 { aspect-ratio: 16 / 9; }
.media--4-3  { aspect-ratio: 4 / 3; }
.media--1-1  { aspect-ratio: 1 / 1; }
.media--3-4  { aspect-ratio: 3 / 4; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: .28rem .75rem;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(10,10,12,.07);
  color: var(--accent);
  border: 1px solid rgba(10,10,12,.16);
}
/* Floating badges sit on photographs, so they keep the dark treatment */
.badge--float {
  position: absolute;
  top: var(--sp-4);
  inset-inline-start: var(--sp-4);
  z-index: 2;
  background: rgba(10,10,12,.72);
  backdrop-filter: blur(10px);
  color: #FFFFFF;
  border-color: rgba(255,255,255,.22);
}

/* ---------------------------------------------------------------------
   14. Service / project grids
   --------------------------------------------------------------------- */
.services-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }

.projects-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }

/* Featured asymmetric layout */
@media (min-width: 960px) {
  .projects-grid--feature { grid-template-columns: repeat(6, 1fr); }
  .projects-grid--feature > *:nth-child(1) { grid-column: span 4; }
  .projects-grid--feature > *:nth-child(2) { grid-column: span 2; }
  .projects-grid--feature > *:nth-child(3) { grid-column: span 2; }
  .projects-grid--feature > *:nth-child(4) { grid-column: span 4; }
  .projects-grid--feature > *:nth-child(n+5) { grid-column: span 2; }
}

.project-card { display: block; }
.project-card .media { aspect-ratio: 4 / 3; }
.project-card__body {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: clamp(1.2rem, 2.4vw, 1.9rem);
  z-index: 2;
  transform: translateY(14px);
  transition: transform var(--dur) var(--ease-out);
}
.card:hover .project-card__body { transform: translateY(0); }
.project-card__title { font-size: var(--fs-h4); margin-bottom: var(--sp-1); }
.project-card__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  letter-spacing: .06em;
}
.project-card__reveal {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height var(--dur) var(--ease-out), opacity var(--dur), margin-top var(--dur);
}
.card:hover .project-card__reveal {
  max-height: 90px;
  opacity: 1;
  margin-top: var(--sp-3);
}

/* Filter pills */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.filter {
  padding: .55rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--text-dim);
  transition: all var(--dur-fast);
}
.filter:hover { border-color: var(--line-strong); color: var(--text); }
.filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 650;
}

.is-filtered-out {
  display: none !important;
}

/* ---------------------------------------------------------------------
   15. Marquee
   --------------------------------------------------------------------- */
.marquee {
  overflow: hidden;
  padding-block: var(--sp-5);
  border-block: 1px solid var(--line);
  background: var(--ink-2);
  user-select: none;
}
.marquee__track {
  display: flex;
  gap: var(--sp-7);
  width: max-content;
  animation: marquee-run var(--marquee-dur, 34s) linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-faint);
  white-space: nowrap;
  transition: color var(--dur-fast);
}
.marquee__item:hover { color: var(--accent); }
.marquee__item svg { width: 20px; height: 20px; color: var(--accent); opacity: .55; }
@keyframes marquee-run {
  to { transform: translateX(-50%); }
}
[dir="rtl"] .marquee__track { animation-direction: reverse; }

/* ---------------------------------------------------------------------
   16. Stats counters
   --------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--sp-5);
}
.stat {
  position: relative;
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--surface), var(--ink-3));
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur);
}
.stat:hover { transform: translateY(-7px); border-color: rgba(10,10,12,.34); }
.stat::after {
  content: '';
  position: absolute;
  top: 0; inset-inline-start: 50%;
  width: 42%; height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--dur);
}
.stat:hover::after { opacity: 1; }
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.9rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  margin-bottom: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.stat__num sup { font-size: .45em; vertical-align: super; margin-inline-start: 2px; }
.stat__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------------------------------------------------------------------
   17. Process timeline
   --------------------------------------------------------------------- */
.process { position: relative; display: grid; gap: var(--sp-6); }
@media (min-width: 900px) {
  .process { grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
  .process::before {
    content: '';
    position: absolute;
    top: 33px;
    inset-inline: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong) 15%, var(--line-strong) 85%, transparent);
  }
  .process::after {
    content: '';
    position: absolute;
    top: 33px;
    inset-inline-start: 12%;
    width: 0; height: 1px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 2.2s var(--ease-out);
  }
  .process.is-in::after { width: 76%; }
}

.step { position: relative; text-align: center; }
.step__dot {
  width: 66px; height: 66px;
  margin: 0 auto var(--sp-4);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-faint);
  position: relative;
  z-index: 2;
  transition: all var(--dur) var(--ease-spring);
}
.step:hover .step__dot {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.09);
  box-shadow: 0 0 0 7px rgba(10,10,12,.05);
}
.step__title { font-size: var(--fs-h4); margin-bottom: var(--sp-2); }
.step__text { color: var(--text-dim); font-size: var(--fs-sm); }

/* ---------------------------------------------------------------------
   18. Before / after slider
   --------------------------------------------------------------------- */
.ba {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  border: 1px solid var(--line);
  touch-action: pan-y;
  background: var(--ink-3);
}
.ba img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ba__after {
  clip-path: inset(0 0 0 var(--pos, 50%));
}
/* The handle sits over photographs, so it is white with a dark shadow */
.ba__handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  background: #FFFFFF;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 18px rgba(0,0,0,.55);
}
.ba__grip {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: #FFFFFF;
  display: grid;
  place-items: center;
  color: #0A0A0C;
  box-shadow: 0 6px 26px rgba(0,0,0,.45);
}
.ba__grip svg { width: 22px; height: 22px; }
.ba__label {
  position: absolute;
  top: var(--sp-4);
  z-index: 2;
  padding: .3rem .85rem;
  border-radius: var(--r-pill);
  background: rgba(10,10,12,.76);
  color: #FFFFFF;
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  pointer-events: none;
}
.ba__label--before { inset-inline-start: var(--sp-4); }
.ba__label--after  { inset-inline-end: var(--sp-4); color: #FFFFFF; font-weight: 700; }

/* ---------------------------------------------------------------------
   19. Testimonials
   --------------------------------------------------------------------- */
.testi-track {
  display: flex;
  gap: var(--sp-5);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--sp-4);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.testi-track::-webkit-scrollbar { display: none; }

.testi {
  flex: 0 0 min(94%, 430px);
  scroll-snap-align: start;
  padding: clamp(1.7rem, 3vw, 2.5rem);
  background: linear-gradient(160deg, var(--surface), var(--ink-3));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  position: relative;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur);
}
.testi:hover { transform: translateY(-6px); border-color: rgba(10,10,12,.30); }
.testi__quote-mark {
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: .7;
  color: rgba(10,10,12,.13);
  margin-bottom: var(--sp-2);
}
.testi__text {
  color: var(--text);
  margin-bottom: var(--sp-5);
  font-size: 1.02em;
}
.testi__stars { display: flex; gap: 3px; margin-bottom: var(--sp-4); color: var(--accent); }
.testi__stars svg { width: 15px; height: 15px; }
.testi__author { display: flex; align-items: center; gap: var(--sp-3); }
.testi__avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.testi__name { font-weight: 650; font-size: var(--fs-sm); }
.testi__role { font-size: var(--fs-xs); color: var(--text-faint); }

.carousel-nav { display: flex; gap: var(--sp-2); }
.carousel-btn {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text-dim);
  transition: all var(--dur-fast);
}
.carousel-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(10,10,12,.05);
}
.carousel-btn svg { width: 17px; height: 17px; }
[dir="rtl"] .carousel-btn svg { transform: scaleX(-1); }

/* ---------------------------------------------------------------------
   20. Accordion (FAQ)
   --------------------------------------------------------------------- */
.acc { border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__btn {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-5);
  padding: clamp(1.15rem, 2.4vw, 1.7rem) 0;
  text-align: start;
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 650;
  color: var(--text);
  transition: color var(--dur-fast);
}
.acc__btn:hover { color: var(--accent); }
.acc__item.is-open .acc__btn { color: var(--accent); }

.acc__icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  position: relative;
  transition: all var(--dur) var(--ease-out);
  margin-top: 2px;
}
.acc__icon::before, .acc__icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur-fast);
}
.acc__icon::before { width: 13px; height: 1.5px; }
.acc__icon::after  { width: 1.5px; height: 13px; }
.acc__item.is-open .acc__icon {
  border-color: var(--accent);
  background: rgba(10,10,12,.06);
  transform: rotate(180deg);
}
.acc__item.is-open .acc__icon::after { transform: scaleY(0); opacity: 0; }

.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease-out);
}
.acc__item.is-open .acc__panel { grid-template-rows: 1fr; }
.acc__panel-inner { overflow: hidden; }
.acc__body {
  padding-bottom: var(--sp-6);
  color: var(--text-dim);
  max-width: 68ch;
}

/* ---------------------------------------------------------------------
   21. Gallery
   --------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  grid-auto-rows: 210px;
  gap: var(--sp-3);
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  cursor: zoom-in;
  background: var(--ink-3);
}
.gallery-item:nth-child(6n+1) { grid-row: span 2; }
.gallery-item:nth-child(6n+4) { grid-column: span 2; }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .9s var(--ease-out), filter var(--dur);
  filter: saturate(.88);
}
.gallery-item:hover img { transform: scale(1.09); filter: saturate(1.1); }
.gallery-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: var(--sp-4);
  background: linear-gradient(to top, rgba(5,5,10,.88), transparent 62%);
  opacity: 0;
  transition: opacity var(--dur);
}
.gallery-item:hover .gallery-item__overlay { opacity: 1; }
.gallery-item__title { font-family: var(--font-display); font-weight: 650; font-size: var(--fs-sm); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background: rgba(5,5,10,.95);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur), visibility var(--dur);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: min(96vw, 1400px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--r-md);
  transform: scale(.93);
  transition: transform var(--dur) var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.lightbox.is-open img { transform: scale(1); }
.lightbox__close, .lightbox__nav {
  position: absolute;
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--white);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(8px);
  transition: all var(--dur-fast);
}
.lightbox__close:hover, .lightbox__nav:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.lightbox__close { top: var(--sp-5); inset-inline-end: var(--sp-5); }
.lightbox__nav svg, .lightbox__close svg { width: 20px; height: 20px; }
.lightbox__nav--prev { inset-inline-start: var(--sp-5); }
.lightbox__nav--next { inset-inline-end: var(--sp-5); }
.lightbox__caption {
  position: absolute;
  bottom: var(--sp-6);
  inset-inline: 0;
  text-align: center;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

/* ---------------------------------------------------------------------
   22. Forms
   --------------------------------------------------------------------- */
.form { display: grid; gap: var(--sp-4); }
.form-row { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

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

.label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.label span { color: var(--accent); }

.input, .textarea, .select {
  width: 100%;
  padding: .9rem 1.1rem;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast), background-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--ink-3);
  box-shadow: 0 0 0 3px rgba(10,10,12,.07);
}
.textarea { resize: vertical; min-height: 130px; line-height: 1.6; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236C6C80' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 15px;
  padding-inline-end: 2.6rem;
}
[dir="rtl"] .select { background-position: left 1rem center; padding-inline-end: 1.1rem; padding-inline-start: 2.6rem; }
.select option { background: var(--ink-2); color: var(--text); }

.file-drop {
  padding: var(--sp-6);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-fast);
  color: var(--text-faint);
}
.file-drop:hover, .file-drop.is-drag {
  border-color: var(--accent);
  background: rgba(10,10,12,.03);
  color: var(--accent);
}
.file-drop input { display: none; }
.file-drop svg { width: 26px; height: 26px; margin: 0 auto var(--sp-2); }

.field-error {
  font-size: var(--fs-xs);
  color: var(--red);
}
.input.has-error, .textarea.has-error, .select.has-error {
  border-color: var(--red);
}

.alert {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.alert--success { background: rgba(59,209,111,.09); border-color: rgba(59,209,111,.3); color: #8ce8ad; }
.alert--error   { background: rgba(255,90,90,.09);  border-color: rgba(255,90,90,.3);  color: #ff9d9d; }
.alert--info    { background: rgba(61,169,252,.09); border-color: rgba(61,169,252,.3); color: #a5d6ff; }

/* Honeypot */
.hp { position: absolute !important; left: -9999px !important; opacity: 0 !important; height: 0 !important; }

/* ---------------------------------------------------------------------
   23. Contact info blocks
   --------------------------------------------------------------------- */
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--line);
}
.contact-item:last-child { border-bottom: none; }
.contact-item__icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: rgba(10,10,12,.06);
  border: 1px solid rgba(10,10,12,.14);
  color: var(--accent);
}
.contact-item__icon svg { width: 19px; height: 19px; }
.contact-item__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 3px;
}
.contact-item__value { font-weight: 550; }
.contact-item__value a:hover { color: var(--accent); }

.map-embed {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--ink-3);
  filter: grayscale(1) invert(.92) hue-rotate(180deg) contrast(.88);
}
.map-embed iframe { width: 100%; height: 100%; border: 0; }

/* ---------------------------------------------------------------------
   24. CTA band
   --------------------------------------------------------------------- */
.cta-band {
  position: relative;
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: linear-gradient(135deg, var(--ink-3), var(--surface));
  border: 1px solid var(--line);
  text-align: center;
  isolation: isolate;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: -50%;
  z-index: -1;
  background: conic-gradient(from 0deg, transparent, rgba(10,10,12,.07), transparent 30%);
  animation: cta-spin 14s linear infinite;
}
@keyframes cta-spin { to { transform: rotate(360deg); } }
.cta-band__title { font-size: var(--fs-h2); margin-bottom: var(--sp-4); }
.cta-band__text { color: var(--text-dim); max-width: 55ch; margin: 0 auto var(--sp-6); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: center; }

/* ---------------------------------------------------------------------
   25. Page hero (inner pages)
   --------------------------------------------------------------------- */
.page-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3.5rem, 7vw, 6.5rem));
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
  overflow: hidden;
  isolation: isolate;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  inset-inline-start: 50%;
  width: 900px; height: 900px;
  transform: translateX(-50%);
  z-index: -1;
  background: radial-gradient(circle, rgba(10,10,12,.06), transparent 62%);
  pointer-events: none;
}
.page-hero__title { font-size: var(--fs-h1); margin-bottom: var(--sp-4); }
.page-hero__sub { color: var(--text-dim); max-width: 62ch; font-size: 1.06em; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-faint);
  margin-bottom: var(--sp-5);
  letter-spacing: .06em;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb svg { width: 12px; height: 12px; opacity: .5; }
[dir="rtl"] .breadcrumb svg { transform: scaleX(-1); }

/* ---------------------------------------------------------------------
   26. Article / rich text
   --------------------------------------------------------------------- */
.prose { max-width: 74ch; color: var(--text-dim); font-size: 1.06em; line-height: 1.85; }
.prose > * + * { margin-top: 1.35em; }
.prose h2, .prose h3, .prose h4 { color: var(--text); margin-top: 2.2em; margin-bottom: .7em; }
.prose h2 { font-size: var(--fs-h3); }
.prose h3 { font-size: var(--fs-h4); }
.prose h4 { font-size: 1.08em; }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-2); }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-top: .55em; }
.prose li::marker { color: var(--accent); }
.prose img { border-radius: var(--r-md); margin-block: 2em; }
.prose blockquote {
  padding-inline-start: var(--sp-5);
  border-inline-start: 2px solid var(--accent);
  font-size: 1.12em;
  color: var(--text);
  font-style: italic;
}
.prose code {
  font-family: var(--font-mono);
  font-size: .88em;
  padding: .15em .45em;
  background: var(--ink-3);
  border-radius: 5px;
  color: var(--accent-2);
}
.prose hr { border: none; border-top: 1px solid var(--line); margin-block: 2.5em; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.prose th, .prose td { padding: .7rem 1rem; border: 1px solid var(--line); text-align: start; }
.prose th { background: var(--ink-3); color: var(--text); font-weight: 650; }

/* ---------------------------------------------------------------------
   27. Team
   --------------------------------------------------------------------- */
.team-card { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--ink-3); }
.team-card .media { aspect-ratio: 3 / 4; }
.team-card__body {
  position: absolute;
  inset-inline: 0; bottom: 0;
  padding: var(--sp-5);
  z-index: 2;
}
.team-card__name { font-size: var(--fs-h4); margin-bottom: 2px; }
.team-card__role { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent); letter-spacing: .08em; }
.team-card__bio {
  color: var(--text-dim);
  font-size: var(--fs-sm);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height var(--dur) var(--ease-out), opacity var(--dur), margin-top var(--dur);
}
.team-card:hover .team-card__bio { max-height: 140px; opacity: 1; margin-top: var(--sp-3); }

/* ---------------------------------------------------------------------
   28. Certifications
   --------------------------------------------------------------------- */
.cert {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--ink-2);
  transition: all var(--dur) var(--ease-out);
}
.cert:hover { border-color: rgba(10,10,12,.34); transform: translateY(-4px); }
.cert__icon {
  width: 52px; height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: rgba(10,10,12,.06);
  color: var(--accent);
}
.cert__icon svg { width: 24px; height: 24px; }
.cert__icon img { width: 100%; height: 100%; object-fit: contain; }
.cert__name { font-weight: 650; margin-bottom: 3px; }
.cert__desc { font-size: var(--fs-sm); color: var(--text-dim); }

/* ---------------------------------------------------------------------
   29. Jobs
   --------------------------------------------------------------------- */
.job {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--ink-2);
  transition: all var(--dur) var(--ease-out);
}
.job:hover { border-color: rgba(10,10,12,.34); transform: translateY(-3px); }
.job__title { font-size: var(--fs-h4); margin-bottom: var(--sp-2); }
.job__meta { display: flex; flex-wrap: wrap; gap: var(--sp-4); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-faint); letter-spacing: .06em; }
.job__meta span { display: inline-flex; align-items: center; gap: 5px; }
.job__meta svg { width: 13px; height: 13px; color: var(--accent); }

/* ---------------------------------------------------------------------
   30. Footer
   --------------------------------------------------------------------- */
.footer {
  position: relative;
  padding-top: clamp(3.5rem, 7vw, 6rem);
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; inset-inline-start: 50%;
  width: 60%; height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .45;
}
.footer__grid {
  display: grid;
  gap: var(--sp-7);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  padding-bottom: var(--sp-7);
}
.footer__brand { max-width: 320px; }
.footer__about { color: var(--text-dim); font-size: var(--fs-sm); margin-block: var(--sp-4); }
.footer__title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-4);
}
.footer__links { display: flex; flex-direction: column; gap: var(--sp-3); }
.footer__links a {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  transition: color var(--dur-fast), padding-inline-start var(--dur-fast);
}
.footer__links a:hover { color: var(--accent); padding-inline-start: 7px; }

.socials { display: flex; gap: var(--sp-3); }
.social {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text-dim);
  transition: all var(--dur) var(--ease-out);
}
.social:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-4px) rotate(-6deg);
}
.social svg { width: 17px; height: 17px; }

.newsletter { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.newsletter .input { flex: 1; padding-block: .7rem; }

.footer__bottom {
  padding-block: var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
.footer__bottom a:hover { color: var(--accent); }

/* Floating action buttons */
.fab-stack {
  position: fixed;
  bottom: var(--sp-5);
  inset-inline-end: var(--sp-5);
  z-index: 880;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.fab {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur);
}
.fab:hover { transform: scale(1.1) translateY(-3px); }
.fab svg { width: 23px; height: 23px; }
/* Monochrome floating buttons — black pills with white glyphs */
.fab--wa   { background: #0A0A0C; color: #FFFFFF; }
.fab--call { background: #0A0A0C; color: #FFFFFF; }
.fab--top {
  background: #FFFFFF;
  color: #0A0A0C;
  border: 1px solid var(--line-strong);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
}
.fab--top.is-visible { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 640px) { .fab { width: 46px; height: 46px; } .fab svg { width: 20px; height: 20px; } }

/* ---------------------------------------------------------------------
   31. 3D decorative elements
   --------------------------------------------------------------------- */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .38;
  pointer-events: none;
  z-index: -1;
  will-change: transform;
}
.orb--accent { background: radial-gradient(circle, var(--accent), transparent 68%); }
.orb--blue   { background: radial-gradient(circle, var(--blue), transparent 68%); }
.orb--violet { background: radial-gradient(circle, var(--violet), transparent 68%); }

/* Rotating wireframe cube — pure CSS 3D */
.cube-wrap {
  perspective: 900px;
  width: 200px; height: 200px;
  pointer-events: none;
}
.cube {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: cube-spin 22s linear infinite;
}
.cube__face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(10,10,12,.34);
  background: rgba(10,10,12,.02);
}
.cube__face:nth-child(1) { transform: translateZ(100px); }
.cube__face:nth-child(2) { transform: rotateY(180deg) translateZ(100px); }
.cube__face:nth-child(3) { transform: rotateY(90deg) translateZ(100px); }
.cube__face:nth-child(4) { transform: rotateY(-90deg) translateZ(100px); }
.cube__face:nth-child(5) { transform: rotateX(90deg) translateZ(100px); }
.cube__face:nth-child(6) { transform: rotateX(-90deg) translateZ(100px); }
@keyframes cube-spin {
  0%   { transform: rotateX(-22deg) rotateY(0deg); }
  100% { transform: rotateX(-22deg) rotateY(360deg); }
}

/* Parallax layer */
[data-parallax] { will-change: transform; }

/* Noise texture overlay */
/* The film-grain overlay belonged to the dark theme. On a white page any
   blend mode either muddies the background or greys out the inverted hero,
   so the layer is kept in the markup but disabled. */
.noise { display: none; }

/* ---------------------------------------------------------------------
   32. Utilities
   --------------------------------------------------------------------- */
.divider { height: 1px; background: var(--line); border: none; }
.divider--glow { background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .35; }

.empty-state {
  padding: var(--sp-9) var(--sp-5);
  text-align: center;
  color: var(--text-faint);
  border: 1.5px dashed var(--line);
  border-radius: var(--r-lg);
}
.empty-state svg { width: 44px; height: 44px; margin: 0 auto var(--sp-4); opacity: .4; }

.pagination { display: flex; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-7); }
.pagination a, .pagination span {
  min-width: 42px; height: 42px;
  display: grid;
  place-items: center;
  padding-inline: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  transition: all var(--dur-fast);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .is-current { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 650; }

/* ---------------------------------------------------------------------
   33. Reduced motion
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .split-word, .split-char { opacity: 1 !important; transform: none !important; }
  .cursor, .cursor-dot, .noise { display: none !important; }
  #hero-canvas { display: none; }
  .hero__grid { animation: none; }
}

/* ---------------------------------------------------------------------
   34. Print
   --------------------------------------------------------------------- */
@media print {
  .header, .footer, .fab-stack, .cursor, .cursor-dot,
  .noise, .preloader, #hero-canvas, .scroll-progress { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .stat { border-color: #ccc; }
  a { text-decoration: underline; }
}
