/* ═══════════════════════════════════════════════════════════════════════
   BuildX - Lumina Grid.

   Tailwind (CDN) carries the layout and the design tokens; this file holds
   what a utility class cannot express: the self-hosted Arabic face, the
   architectural grid, the glass and gradient treatments, the component
   classes the templates reuse, and the handful of RTL corrections Tailwind's
   logical utilities do not cover.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Arabic face (self-hosted; Inter has no Arabic coverage) ──────────── */
@font-face {
  font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('fonts/plex-sans-arabic-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('fonts/plex-sans-arabic-500.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('fonts/plex-sans-arabic-700.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  --primary:        #00696c;
  --primary-tint:   #03a1a5;
  --secondary:      #3c6566;
  --tertiary:       #934a17;
  --surface:        #f5fafa;
  --surface-lowest: #ffffff;
  --stroke:         #CBD5E1;
  --grid-line:      #E2E8F0;
  --on-surface:     #171d1d;
  --on-variant:     #3d4949;
  --error:          #ba1a1a;
  --glass:          rgba(255, 255, 255, .7);
}

html { scroll-padding-top: 6.5rem; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

/* ── Architectural grid ───────────────────────────────────────────────── */
.bg-architectural-grid {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Glass ────────────────────────────────────────────────────────────── */
.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
/* Backdrop blur is a progressive enhancement; without it the panel must
   still be opaque enough to read against the grid. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-panel { background: rgba(255, 255, 255, .92); }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero-gradient {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* In RTL the gradient should run with the text, right to left. */
[dir="rtl"] .hero-gradient {
  background: linear-gradient(to left, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
}

@keyframes pulse-glow {
  0%, 100% { opacity: .3; transform: scale(1); }
  50%      { opacity: .6; transform: scale(1.05); }
}
.hero-glow { animation: pulse-glow 8s infinite alternate ease-in-out; }

/* Soft colour blooms behind the contact panel. */
.blob { border-radius: 9999px; filter: blur(60px); }
.blob--primary   { background: rgba(0, 105, 108, .10); }
.blob--secondary { background: rgba(60, 101, 102, .10); }

/* Hatched overlay on the solid gradient stat tile. */
.tile-hatch {
  background-image: repeating-linear-gradient(
    45deg, rgba(0,0,0,.10) 0 1px, transparent 1px 8px);
}

/* Radial lift inside the solid-primary services card. */
.dev-glow { background-image: radial-gradient(circle at 100% 100%, #fff 0%, transparent 50%); }

/* Case-study plates: scrim so text stays legible over the pattern. */
.case-scrim {
  background: linear-gradient(to top, var(--surface-lowest) 0%, rgba(255,255,255,.8) 45%, transparent 100%);
}
.case-fade { background: linear-gradient(to right, var(--surface-lowest), transparent); }
[dir="rtl"] .case-fade { background: linear-gradient(to left, var(--surface-lowest), transparent); }

/* ── Process timeline ─────────────────────────────────────────────────── */
.timeline-line {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 24px;
  width: 1px;
  background: var(--stroke);
  z-index: 0;
}
.step-dot {
  position: absolute;
  top: 2rem;
  inset-inline-start: 24px;
  transform: translateX(-50%);
  width: 16px; height: 16px;
  background: var(--surface-lowest);
  border: 2px solid var(--primary);
  border-radius: 50%;
  z-index: 10;
  transition: background-color .3s ease-out;
}
.group:hover .step-dot { background: var(--primary); }

/* translateX flips sign in RTL, so mirror it to keep the dot centred. */
[dir="rtl"] .step-dot { transform: translateX(50%); }

@media (min-width: 768px) {
  .timeline-line { inset-inline-start: 50%; transform: translateX(-50%); }
  .step-dot      { inset-inline-start: 50%; top: auto; }
  [dir="rtl"] .timeline-line { transform: translateX(50%); }
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: .25rem;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: .05em;
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s ease-out, color .2s ease-out,
              border-color .2s ease-out, box-shadow .2s ease-out;
}
.btn-lg { padding: 1rem 2rem; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 105, 108, .30);
}
.btn-primary:hover { background: var(--primary-tint); }

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #bfebeb; color: #426b6c; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: rgba(0, 105, 108, .06); }

.btn-primary:disabled, .btn-secondary:disabled, .btn-outline:disabled {
  opacity: .6; cursor: not-allowed;
}

/* ── Form ─────────────────────────────────────────────────────────────── */
.field-label {
  display: block;
  margin-bottom: .25rem;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--on-variant);
}
.field {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--surface-lowest);
  border: 1px solid var(--stroke);
  border-radius: .5rem;
  color: var(--on-surface);
  font: inherit;
  font-size: 16px;                 /* 16px keeps iOS from zooming on focus */
  transition: border-color .2s ease-out, box-shadow .2s ease-out;
}
.field::placeholder { color: #8a9596; }
.field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.field[aria-invalid="true"] { border-color: var(--error); }

.err {
  margin-top: .375rem;
  font-size: 12px;
  line-height: 16px;
  color: var(--error);
}

/* Honeypot: off-screen for bots, never shown or focusable for people. */
.hp {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Skip link ────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 100;
  padding: .75rem 1.25rem;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 .25rem .25rem;
}
.skip-link:focus { inset-inline-start: 1rem; }

/* ── RTL corrections Tailwind's logical utilities do not cover ────────── */

/* Material Symbols are drawn LTR; the directional ones need mirroring.
   Applied per-icon in the templates via `rtl:rotate-180` / `rtl:-scale-x-100`,
   which Tailwind emits only when this direction attribute is present. */
[dir="rtl"] .material-symbols-outlined.mirror { transform: scaleX(-1); }

/* Latin runs (emails, URLs) inside Arabic copy: isolate the run so its
   characters order left-to-right, without `direction: ltr`, which would also
   left-align the element inside its right-aligned column. */
[dir="rtl"] a[href^="mailto:"] { unicode-bidi: isolate; }

/* The registered entity name is Arabic-script on both sites. The English page
   runs on Inter, which has no Arabic coverage, so name the Arabic face here
   and isolate the run from the surrounding LTR line. */
.legal-name {
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  unicode-bidi: isolate;
}

/* ── Motion ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
