﻿/* ============================================================
   HOPEX — Software Company Website
   Author: HOPEX
   Stylesheet: global variables, layout, components, responsive
   ============================================================ */

/* ---------- 1. CSS VARIABLES ---------- */
:root {
  /* Brand palette — HOPEX identity (navy / tech blue / cyan / gold) */
  --primary: #0A2342;
  --primary-700: #0d2c53;
  --primary-600: #163a68;
  --accent: #00B4FF;
  --accent-600: #0098d9;
  --accent-100: rgba(0, 180, 255, .14);
  --cyan: #00E0D6;
  --gold: #D4AF37;

  /* Surfaces: near-black base with glass panels */
  --bg: #05070E;
  --bg-2: #080C18;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .07);
  --text: #E8EDF7;
  --muted: #93A3BC;
  --border: rgba(255, 255, 255, .1);
  --border-strong: rgba(255, 255, 255, .18);

  /* Scene accent — re-tinted per hero project by JS */
  --scene-a: #00B4FF;
  --scene-b: #D4AF37;

  /* Gradients — kept within the blue/cyan family to avoid muddy color mixing */
  --grad-accent: linear-gradient(135deg, var(--cyan) 0%, var(--accent) 100%);
  --grad-btn: linear-gradient(135deg, var(--accent-600) 0%, var(--primary-600) 100%);
  --grad-hero: radial-gradient(120% 90% at 50% 0%, #0e2647 0%, #05070E 62%);

  /* Elevation — glow-based rather than drop shadow */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, .55);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, .65);
  --shadow-accent: 0 14px 40px rgba(62, 142, 237, .38);

  /* Shape & motion */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.22, .68, .36, 1);
  --t-fast: .2s var(--ease);
  --t: .35s var(--ease);

  /* Layout */
  --nav-h: 76px;
  /* scales with the viewport instead of snapping to a fixed width, so the
     page keeps using screen space on large monitors and shrinks smoothly
     on small ones, while never growing past a readable line length */
  --container: min(94vw, 1400px);
}

/* ---------- 2. RESET & BASE ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

/* must outrank any component that sets its own display (e.g. .lightbox) */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* faint starfield wash so the near-black never reads as flat */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 15% 0%,   rgba(62, 142, 237, .10), transparent 70%),
    radial-gradient(50% 40% at 85% 20%,  rgba(124, 92, 252, .09), transparent 70%),
    radial-gradient(70% 50% at 50% 100%, rgba(62, 142, 237, .06), transparent 70%);
}

body.no-scroll { overflow: hidden; }

img, svg { max-width: 100%; display: block; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4 { line-height: 1.35; font-weight: 800; color: var(--text); }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* parked above the viewport rather than off to the side — a large inline
   offset makes the RTL document scroll horizontally */
.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -80px;
  z-index: 999;
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--t-fast);
}
.skip-link:focus { top: 0; }

/* ---------- 3. LAYOUT HELPERS ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding: 110px 0; }

.section-head {
  max-width: 680px;
  margin: 0 auto 60px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent);
  background: var(--accent-100);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  margin-bottom: 16px;
}

.section-sub,
.lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.gradient-text {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mini-title { font-size: 1.15rem; margin: 26px 0 14px; }

/* ---------- 4. BUTTONS ---------- */
.btn {
  --btn-bg: var(--accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  border-radius: 100px;
  font-weight: 700;
  font-size: .96rem;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background-color var(--t-fast), color var(--t-fast);
  will-change: transform;
}

.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(124, 92, 252, .38);
}
.btn-primary:active { transform: translateY(-1px); }

.btn-ghost {
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, .12);
  border-color: #fff;
  transform: translateY(-3px);
}

.btn-lg { padding: 16px 36px; font-size: 1.02rem; }
.btn-sm { padding: 9px 20px; font-size: .88rem; }
.btn-block { width: 100%; }

/* ---------- 5. NAVBAR ---------- */
.navbar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color var(--t), box-shadow var(--t), height var(--t);
}

.navbar.scrolled {
  height: 66px;
  background: rgba(5, 7, 14, .72);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .55);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 1.65rem;
  color: #fff;
  transition: color var(--t);
}
.navbar.scrolled .logo { color: #fff; }

.logo-mark {
  height: 40px;
  width: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 14px rgba(0, 180, 255, .38));
}

.logo-wordmark {
  height: 20px;
  width: auto;
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  position: relative;
  padding: 9px 15px;
  font-size: .95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .85);
  border-radius: 8px;
  transition: color var(--t-fast);
}
.navbar.scrolled .nav-link { color: var(--muted); }

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  inset-inline-start: 15px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
  transition: width var(--t);
}
.nav-link:hover,
.nav-link.active { color: #fff; }
.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link.active { color: var(--accent); }
.nav-link:hover::after,
.nav-link.active::after { width: calc(100% - 30px); }

.nav-cta {
  background: var(--grad-btn);
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 100px;
  margin-inline-start: 10px;
  box-shadow: var(--shadow-accent);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.nav-cta::after { display: none; }
.nav-cta:hover { transform: translateY(-2px); }

/* language switch + hamburger, kept together at the end of the bar */
.nav-links { margin-inline-start: auto; }

.nav-end {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language: a segmented control, not a toggle.
   A single button reading "EN" is ambiguous — it could mean "you are in
   English" or "switch to English". Showing both languages with the current
   one lit removes the guess, and it is one tap either way. */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  /* a hairline that keeps it from reading as a second call to action */
  margin-inline-end: 4px;
}

.lang-opt {
  position: relative;
  z-index: 1;
  min-width: 46px;
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 100px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-fast);
}
.lang-opt:hover { color: var(--text); }

/* a two-word button in the bar must never fold onto a second line */
.nav-end .btn { white-space: nowrap; }
.lang-opt[aria-pressed="true"] { color: #fff; cursor: default; }

/* The lit pill slides between the two options. Its left/width come from the
   active button's own box, measured in JS — the two labels are different
   widths, and that also makes it correct in both writing directions without
   a second rule. */
.lang-thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  border-radius: 100px;
  /* The contact button's gradient, and its tone as well as its hue.
     --grad-btn runs bright blue to dark navy across whatever it covers:
     over a 120px button you see the whole sweep and it settles into a
     deep blue, but squeezed into a 50px pill it stays up at the bright
     end and reads as a different, lighter colour. Pinning the gradient
     to roughly button width makes the pill show the same part of it.
     No glow either — the halo was what made it louder than the button
     it sits beside. */
  background: var(--grad-btn);
  background-size: 150px 100%;
  background-position: center;
  background-repeat: no-repeat;
  transition: left var(--t) var(--ease), width var(--t) var(--ease);
}
/* before JS measures, show nothing rather than a pill in the wrong place */
.lang-switch:not([data-active]) .lang-thumb { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .lang-thumb { transition: none; }
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  padding: 10px;
  z-index: 120;
}
.hamburger span {
  display: block;
  height: 2.5px;
  width: 100%;
  border-radius: 3px;
  background: #fff;
  transition: transform var(--t), opacity var(--t-fast), background-color var(--t);
}
.navbar.scrolled .hamburger span { background: #fff; }
.hamburger.open span { background: #fff; }
.hamburger.open span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(.3); }
.hamburger.open span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(11, 29, 58, .5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--t);
}
.nav-overlay.show { opacity: 1; }

/* ---------- 6. HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 50px) 0 90px;
  background: var(--grad-hero);
  overflow: hidden;
  isolation: isolate;
  transition: background 1.1s var(--ease);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

/* the scene glow is re-tinted per project — this is what makes the whole
   screen change identity when you switch, like the reference video */
.scene-glow {
  position: absolute;
  z-index: -2;
  inset: -20% -10% auto -10%;
  height: 130%;
  pointer-events: none;
  background:
    radial-gradient(46% 42% at 68% 34%, color-mix(in srgb, var(--scene-a) 55%, transparent), transparent 68%),
    radial-gradient(40% 40% at 26% 66%, color-mix(in srgb, var(--scene-b) 45%, transparent), transparent 70%);
  filter: blur(46px);
  opacity: .55;
  transition: background 1.1s var(--ease), opacity .8s var(--ease);
  animation: floatGlow 16s ease-in-out infinite alternate;
}

@keyframes floatGlow {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(46px, 40px) scale(1.12); }
}

/* faint technical grid, fading out toward the bottom */
.scene-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(80% 65% at 50% 35%, #000 20%, transparent 78%);
          mask-image: radial-gradient(80% 65% at 50% 35%, #000 20%, transparent 78%);
}

/* slow sweeping light beam */
.scene-beam {
  position: absolute;
  z-index: -1;
  top: -40%;
  inset-inline-start: -30%;
  width: 55%;
  height: 190%;
  pointer-events: none;
  transform: rotate(14deg);
  background: linear-gradient(90deg, transparent,
              color-mix(in srgb, var(--scene-a) 12%, transparent), transparent);
  filter: blur(28px);
  animation: sweep 11s ease-in-out infinite;
}

@keyframes sweep {
  0%, 100% { transform: translateX(-10%) rotate(14deg); opacity: 0; }
  45%      { opacity: .85; }
  100%     { transform: translateX(240%) rotate(14deg); }
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.02fr;
  align-items: center;
  gap: 56px;
}

.hero-copy { position: relative; }

.hero-title {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.5;
  letter-spacing: -.5px;
  margin-bottom: 18px;
  animation: heroTitleReveal .95s var(--ease-premium) .25s both;
}
.hero-title .gradient-text { display: block; margin-top: .12em; }
/* Latin script needs far less leading than Arabic's tall letterforms */
[lang="en"] .hero-title { line-height: 1.15; }

.hero-sub {
  min-height: 2.2em;
  font-size: clamp(1.02rem, 2.4vw, 1.4rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  vertical-align: -.16em;
  background: var(--accent);
  margin-inline-start: 3px;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  max-width: 520px;
  margin: 0 0 32px;
  color: #b3c2d8;
  font-size: 1.02rem;
  animation: fadeUp 1s .40s var(--ease) both;
}
.hero-desc strong { color: #fff; }

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  animation: fadeUp 1s .55s var(--ease) both;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  color: #90a2bd;
  font-size: .86rem;
  animation: fadeUp 1s .68s var(--ease) both;
}
.hero-trust strong {
  display: block;
  font-size: 1.1rem;
  color: #fff;
  line-height: 1.4;
}

/* ---------- 6b. HERO STAGE (the centrepiece) ---------- */
.stage {
  position: relative;
  animation: fadeUp 1s .80s var(--ease) both;
}

.stage-eyebrow {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--scene-a);
  margin-bottom: 14px;
  transition: color .8s var(--ease);
}

.stage-screen {
  position: relative;
  perspective: 1400px;
  /* reserve a stable box so the layout doesn't jump when a portrait
     (phone) capture replaces a landscape one */
  min-height: clamp(360px, 40vw, 580px);
  display: grid;
  align-items: center;
}

.stage-halo {
  position: absolute;
  inset: -14% -10%;
  border-radius: 50%;
  background: radial-gradient(closest-side,
              color-mix(in srgb, var(--scene-a) 42%, transparent), transparent 78%);
  filter: blur(38px);
  opacity: .8;
  transition: background 1.1s var(--ease);
  pointer-events: none;
}

.stage-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #070b14;
  border: 1px solid var(--border-strong);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .7),
    0 0 0 1px rgba(255, 255, 255, .04) inset,
    0 0 60px color-mix(in srgb, var(--scene-a) 22%, transparent);
  transform: rotateY(-9deg) rotateX(3deg) translateZ(0);
  transition: transform .9s var(--ease), box-shadow 1.1s var(--ease);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
}
[dir="rtl"] .stage-frame { transform: rotateY(9deg) rotateX(3deg); }
.stage:hover .stage-frame,
[dir="rtl"] .stage:hover .stage-frame { transform: rotateY(0) rotateX(0) scale(1.015); }

.stage-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid var(--border);
}
.stage-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  flex: 0 0 auto;
}
.stage-bar i:first-child { background: color-mix(in srgb, var(--scene-a) 80%, #fff); }

/* the project name rides in the window chrome instead of a caption below */
.stage-tab {
  margin-inline-start: 12px;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: .74rem;
  font-weight: 700;
  color: #cfe0f5;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* contain, never crop — each project screenshot has its own aspect ratio */
.stage-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
  background: #070b14;
}

/* portrait (phone) captures get a narrower window */
.stage-screen.is-phone .stage-frame {
  max-width: 330px;
  margin-inline: auto;
}
.stage-screen.is-phone .stage-frame img { aspect-ratio: 10 / 16; }

/* ---- swap animation: the frame flips on its Y axis ----
   (an animated blur() filter used to run alongside this flip — animating
   blur on a large image every few seconds is expensive to composite and
   was the actual source of the jank/hangs, so it's dropped here while the
   flip motion itself stays) */
.stage-frame.flip-out { animation: flipOut var(--flip-out, .40s) var(--ease) forwards; }
.stage-frame.flip-in  { animation: flipIn  var(--flip-in,  .52s) var(--ease); }

@keyframes flipOut {
  0%   { transform: rotateY(9deg) rotateX(3deg) scale(1); }
  100% { transform: rotateY(84deg) rotateX(3deg) scale(.88); }
}
@keyframes flipIn {
  0%   { transform: rotateY(-84deg) rotateX(3deg) scale(.88); }
  100% { transform: rotateY(9deg) rotateX(3deg) scale(1); }
}

/* in English the frame tilts the other way, so the flip mirrors too */
[dir="ltr"] .stage-frame.flip-out { animation-name: flipOutLtr; }
[dir="ltr"] .stage-frame.flip-in  { animation-name: flipInLtr; }

@keyframes flipOutLtr {
  0%   { transform: rotateY(-9deg) rotateX(3deg) scale(1); }
  100% { transform: rotateY(-84deg) rotateX(3deg) scale(.88); }
}
@keyframes flipInLtr {
  0%   { transform: rotateY(84deg) rotateX(3deg) scale(.88); }
  100% { transform: rotateY(-9deg) rotateX(3deg) scale(1); }
}

/* light sweeps across the glass as the new screen lands */
.stage-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(105deg,
              transparent 34%,
              rgba(255, 255, 255, .30) 50%,
              transparent 66%);
  transform: translateX(-130%);
  opacity: 0;
}
.stage-frame.flip-in::after { animation: sheen var(--flip-sheen, .85s) var(--ease); }
@keyframes sheen {
  0%   { transform: translateX(-130%); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: translateX(130%);  opacity: 0; }
}

.stage-reflection {
  position: absolute;
  inset-inline: 8%;
  top: 100%;
  height: 52px;
  background: linear-gradient(color-mix(in srgb, var(--scene-a) 26%, transparent), transparent);
  filter: blur(14px);
  opacity: .55;
  pointer-events: none;
  transition: background 1.1s var(--ease);
}

.stage-switch {
  display: flex;
  gap: 10px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.stage-dot {
  position: relative;
  width: 62px;
  height: 42px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b1020;
  opacity: .5;
  transition: opacity var(--t), transform var(--t), border-color var(--t), box-shadow var(--t);
}
.stage-dot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.stage-dot:hover { opacity: .85; transform: translateY(-3px); }
.stage-dot.active {
  opacity: 1;
  border-color: color-mix(in srgb, var(--scene-a) 70%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--scene-a) 55%, transparent),
              0 8px 22px color-mix(in srgb, var(--scene-a) 30%, transparent);
}

/* scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 26px;
  inset-inline-start: 50%;
  transform: translateX(50%);
  width: 26px;
  height: 42px;
  border-radius: 100px;
  border: 1.5px solid rgba(255, 255, 255, .22);
  display: grid;
  justify-items: center;
  padding-top: 8px;
}
[dir="ltr"] .scroll-cue { transform: translateX(-50%); }
.scroll-cue span {
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: var(--scene-a);
  animation: cue 1.7s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(0);    opacity: 1; }
  60%      { transform: translateY(14px); opacity: 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 7. STATS ---------- */
.stats {
  padding: 90px 0 40px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.stat {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.stat:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.stat-num {
  display: block;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.2;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 600;
}

/* ---------- 8. ABOUT ---------- */
.about { background: transparent; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 70px;
  align-items: center;
}

/* Grid items default to min-width:auto, so they refuse to shrink below the
   longest unbreakable line inside them — the <pre> of code here. Without
   this the column pushes past the viewport on narrow screens. */
.about-grid > * { min-width: 0; }

.about-card-stack { position: relative; padding: 26px; min-width: 0; }

.code-window {
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: transform var(--t);
}
.code-window:hover { transform: translateY(-6px) rotate(-.6deg); }

.code-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, .06);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.code-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}
.code-bar span:nth-child(2) { background: #febc2e; }
.code-bar span:nth-child(3) { background: #28c840; }
.code-bar em {
  margin-inline-start: auto;
  font-style: normal;
  font-size: .78rem;
  color: #8ea3c0;
}

.code-body {
  padding: 22px 20px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: .84rem;
  line-height: 1.9;
  color: #cbd5e1;
  overflow-x: auto;
  text-align: left;
  max-width: 100%;
}
.c-key { color: var(--gold); font-weight: 700; }
.c-cls { color: var(--cyan); }
.c-str { color: #4ade80; }
.c-var { color: #fbbf24; }
.c-fn  { color: var(--accent); }

.float-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: rgba(12,18,34,.9);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  box-shadow: var(--shadow-md);
  animation: bob 4s ease-in-out infinite;
}
.fb-1 { top: 0; inset-inline-end: 0; }
.fb-2 { bottom: 0; inset-inline-start: 0; animation-delay: 1.6s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.vision-box {
  margin: 26px 0;
  padding: 20px 24px;
  background: var(--surface);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius-sm);
}
.vision-box h3 { font-size: 1.05rem; color: var(--accent); margin-bottom: 6px; }
.vision-box p { color: var(--muted); font-size: .98rem; }

.feature-list { display: grid; gap: 18px; margin-bottom: 30px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list strong { display: block; color: #fff; font-size: 1rem; }
.feature-list p { color: var(--muted); font-size: .93rem; line-height: 1.7; }

.fl-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 5px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-100);
}
.fl-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 9. SERVICES ---------- */
.services { background: transparent; }

/* the cards run as an endless strip: the track holds two identical sets and
   slides by exactly one set (50%), so the loop restarts invisibly */
.marquee {
  --marquee-gap: 26px;
  --marquee-card: 360px;
  overflow: hidden;
  padding-block: 16px 34px;   /* room for the hover lift and shadow */
  margin-block: -16px -34px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeRtl 48s linear infinite;
}
[dir="ltr"] .marquee-track { animation-name: marqueeLtr; }

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track { animation-play-state: paused; }

.marquee-track > .card,
.marquee-track > .project {
  flex: 0 0 var(--marquee-card);
  margin-inline-end: var(--marquee-gap);   /* margin, not gap, so 50% is exact */
}

@keyframes marqueeRtl { to { transform: translateX(50%); } }
@keyframes marqueeLtr { to { transform: translateX(-50%); } }

/* phones: the services stand still, one under the other */
@media (max-width: 640px) {
  .services .marquee {
    overflow: visible;
    padding-block: 0;
    margin-block: 0;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .services .marquee-track {
    flex-direction: column;
    gap: 18px;
    width: auto;
    animation: none;
  }
  .services .marquee-track > .card { flex: none; margin: 0; }
  .services .marquee-track > [aria-hidden="true"] { display: none; }
}

.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
  background: var(--grad-btn);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--t);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.card:hover::before { transform: scaleX(1); }

.card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  margin-bottom: 20px;
  background: var(--accent-100);
  transition: background var(--t), transform var(--t);
}
.card-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--t);
}
.card:hover .card-icon {
  background: var(--grad-btn);
  transform: rotate(-8deg) scale(1.06);
}
.card:hover .card-icon svg { stroke: #fff; }

.card h3 { font-size: 1.22rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: .96rem; margin-bottom: 18px; }

.card-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.card-tags li {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 100px;
}

/* ---------- 10. PORTFOLIO ---------- */
.portfolio { background: transparent; }

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 46px;
}

.filter-btn {
  padding: 10px 24px;
  border-radius: 100px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color var(--t-fast), background var(--t-fast),
              border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.filter-btn.active {
  color: #fff;
  background: var(--grad-btn);
  border-color: transparent;
  box-shadow: var(--shadow-accent);
}

/* a still row (few projects, or reduced motion): cards keep their width and
   sit centred rather than one lone card stretching across the page */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 380px));
  justify-content: center;
  gap: 28px;
}

/* the moving strip (js/main.js) */
.portfolio-grid.is-strips {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.portfolio-grid .marquee { --marquee-card: 380px; --marquee-gap: 28px; }

/* no clones here: main.js moves each card on its own, wrapping it from one
   edge to the other (translate, so the hover lift's transform still works) */
.portfolio-grid .marquee-track { animation: none; }
.portfolio-grid .marquee-track.is-running { position: relative; width: auto; }
.portfolio-grid .marquee-track.is-running > .project {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--marquee-card);
  margin: 0;
}
.portfolio-grid .marquee.filtering-in { animation: popIn .45s var(--ease) both; }

.project {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), opacity .35s var(--ease);
}
.project:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

/* filtering states (JS toggles .hide) */
.project.hide {
  display: none;
}
.project.filtering-in {
  animation: popIn .45s var(--ease) both;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.94) translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.project-thumb {
  position: relative;
  aspect-ratio: 400 / 260;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb-1 { background: linear-gradient(135deg, #0B1D3A, #2b4a7d); }
.thumb-2 { background: linear-gradient(135deg, #3E8EED, #7C5CFC); }
.thumb-3 { background: linear-gradient(135deg, #12294f, #3E8EED); }
.thumb-4 { background: linear-gradient(135deg, #7C5CFC, #0B1D3A); }
.thumb-5 { background: linear-gradient(135deg, #1f3b6e, #7C5CFC); }
.thumb-6 { background: linear-gradient(135deg, #0B1D3A, #3E8EED); }
.thumb-7 { background: linear-gradient(135deg, #2e4d85, #12294f); }
.thumb-8 { background: linear-gradient(135deg, #5b46c9, #3E8EED); }

.thumb-art {
  width: 82%;
  transition: transform .5s var(--ease);
}
.thumb-art rect,
.thumb-art circle,
.thumb-art ellipse { fill: rgba(255, 255, 255, .92); }
.thumb-art .fill-2 { fill: rgba(255, 255, 255, .55); }
.thumb-art .fill-3 { fill: rgba(255, 255, 255, .35); }
.thumb-art .fill-4 { fill: rgba(255, 255, 255, .22); }
.thumb-art .stroke-only {
  fill: none;
  stroke: rgba(255, 255, 255, .4);
  stroke-width: 3;
}
.project:hover .thumb-art { transform: scale(1.07) rotate(1.5deg); }

.thumb-tag {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 2;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: .74rem;
  font-weight: 700;
  color: #fff;
  background: rgba(11, 29, 58, .55);
  border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(6px);
}

.project-body { padding: 24px 24px 26px; }
.project-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.project-body p { color: var(--muted); font-size: .93rem; margin-bottom: 16px; }

.tech { display: flex; flex-wrap: wrap; gap: 7px; }
.tech li {
  font-size: .76rem;
  font-weight: 700;
  color: #8fc0f8;
  background: rgba(62,142,237,.14);
  padding: 4px 11px;
  border-radius: 6px;
}

/* link out to the project itself — only present when the project is public */
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 9px 16px;
  border-radius: 100px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-size: .84rem;
  font-weight: 700;
  transition: border-color var(--t-fast), background-color var(--t-fast),
              color var(--t-fast), transform var(--t-fast);
}
.project-link svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--t-fast), transform var(--t-fast);
}
.project-link:hover {
  border-color: var(--accent);
  background: var(--accent-100);
  color: #fff;
  transform: translateY(-2px);
}
.project-link:hover svg { stroke: #fff; transform: translate(2px, -2px); }
[dir="rtl"] .project-link:hover svg { transform: translate(-2px, -2px); }

@media (prefers-reduced-motion: reduce) {
  .project-link, .project-link svg { transition: none; }
  .project-link:hover { transform: none; }
  .project-link:hover svg { transform: none; }
}

.no-results {
  text-align: center;
  color: var(--muted);
  padding: 46px 0 0;
  font-weight: 600;
}

/* --- real screenshot thumbnails (delivered projects) --- */
.project--featured {
  border-color: rgba(62, 142, 237, .4);
  cursor: pointer;
}

.project-thumb--shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-600) 100%);
}

.project-thumb--shot img {
  width: auto;
  height: 100%;
  max-width: 72%;
  margin-inline: auto;
  object-fit: contain;
  object-position: top center;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .38);
  transition: transform .5s var(--ease);
}
.project:hover .project-thumb--shot img { transform: translateY(-6px) scale(1.04); }

.thumb-badge {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 2;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  box-shadow: 0 6px 16px rgba(22, 163, 74, .4);
}

/* concept work, clearly distinguished from delivered client projects */
.thumb-badge--demo {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .38);
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.project--demo { cursor: pointer; }

/* landscape (desktop) captures fill more of the frame than phone shots */
.project-thumb--shot.wide img {
  width: 94%;
  max-width: 94%;
  height: auto;
  max-height: 100%;
  border-radius: 8px;
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(11, 29, 58, .55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--t);
}
.project-thumb--shot:hover .thumb-overlay,
.project-thumb--shot:focus-visible .thumb-overlay { opacity: 1; }

.thumb-overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 22px;
  border-radius: 100px;
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad-btn);
  box-shadow: var(--shadow-accent);
  transform: translateY(10px);
  transition: transform var(--t);
}
.project-thumb--shot:hover .thumb-overlay-btn { transform: none; }
.thumb-overlay-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px;
  background: rgba(6, 15, 31, .93);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.lightbox.show { opacity: 1; }

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-height: 100%;
}

.lb-figure img {
  max-height: 78vh;
  max-width: min(92vw, 460px);
  border-radius: 14px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .6);
  animation: lbIn .35s var(--ease);
}
@keyframes lbIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}

.lb-figure figcaption {
  max-width: 520px;
  text-align: center;
  color: #d6e2f2;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.7;
}

.lb-close,
.lb-arrow {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  transition: background var(--t-fast), transform var(--t-fast);
}
.lb-close svg,
.lb-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lb-close:hover,
.lb-arrow:hover { background: var(--accent); transform: scale(1.08); }

.lb-close {
  position: absolute;
  top: 22px;
  inset-inline-end: 22px;
  z-index: 4;
}

[dir="rtl"] .lb-arrow svg { transform: scaleX(-1); }

.lb-counter {
  position: absolute;
  bottom: 22px;
  inset-inline: 0;
  text-align: center;
  color: #9db4d2;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .05em;
}

/* ---------- 11. TESTIMONIALS ---------- */
.testimonials {
  background: radial-gradient(90% 70% at 50% 0%, #0d1830 0%, #05070E 70%);
  position: relative;
  overflow: hidden;
}
.testimonials .section-title { color: #fff; }
.testimonials .eyebrow {
  color: #cfe1fa;
  background: rgba(255, 255, 255, .1);
}

.slider {
  position: relative;
  max-width: 900px;
  margin-inline: auto;
  padding: 0 8px;
}

.slider-viewport { overflow: hidden; border-radius: var(--radius-lg); }

.slider-track {
  display: flex;
  transition: transform .6s var(--ease);
  will-change: transform;
}

.slide { flex: 0 0 100%; padding: 6px; }

.slide blockquote {
  position: relative;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-lg);
  padding: 44px 42px 34px;
  backdrop-filter: blur(8px);
}

.quote-mark {
  position: absolute;
  top: 4px;
  inset-inline-end: 32px;
  font-size: 5.5rem;
  line-height: 1;
  color: var(--accent);
  opacity: .35;
  font-family: Georgia, serif;
}

.slide p {
  color: #e2ebf7;
  font-size: 1.08rem;
  line-height: 2;
  margin-bottom: 26px;
}

.slide footer { display: flex; align-items: center; gap: 14px; }

.avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  border: 2px solid rgba(255, 255, 255, .25);
}

.who strong { display: block; color: #fff; font-size: 1rem; }
.who em { font-style: normal; color: #9db4d2; font-size: .86rem; }

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  transition: background var(--t-fast), transform var(--t-fast);
}
.slider-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.slider-arrow:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.09);
}
/* RTL-aware placement: prev sits on the right in RTL, left in LTR */
.slider-arrow.prev { inset-inline-start: -66px; }
.slider-arrow.next { inset-inline-end: -66px; }
[dir="rtl"] .slider-arrow.prev svg { transform: scaleX(-1); }
[dir="rtl"] .slider-arrow.next svg { transform: scaleX(-1); }

.dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 30px;
}
.dots button {
  width: 9px;
  height: 9px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .3);
  transition: width var(--t), background var(--t);
}
.dots button.active {
  width: 30px;
  background: var(--accent);
}

/* ---------- 12. CONTACT ---------- */
.contact { background: transparent; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 60px;
  align-items: start;
}

.info-list { display: grid; gap: 20px; margin: 30px 0; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; }
.info-list strong { display: block; color: #fff; font-size: .95rem; }
.info-list a, .info-list span { color: var(--muted); font-size: .95rem; }
.info-list a { transition: color var(--t-fast); }
.info-list a:hover { color: var(--accent); }

.info-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--t), transform var(--t);
}
.info-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent-600);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--t);
}
@media (hover: hover) {
  .info-list li:hover .info-icon {
    background: var(--grad-btn);
    transform: translateY(-3px);
  }
  .info-list li:hover .info-icon svg { stroke: #fff; }
}

.socials { display: flex; gap: 12px; margin-top: 8px; }
.socials a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.socials svg { width: 19px; height: 19px; fill: currentColor; }

/* Brand marks carry their own colours — they are only recognisable in them.
   No fill here: each glyph sets its own on the path, and a fill in CSS
   would override the attribute and wipe them out. */
.socials .is-brand svg { width: 21px; height: 21px; }
@media (hover: hover) {
  /* The tile lifts and brightens; the mark keeps its own colours, since
     painting the tile blue would bury LinkedIn and Facebook in it. */
  .socials a:hover {
    background: rgba(255, 255, 255, .10);
    border-color: var(--border-strong);
    transform: translateY(-4px);
  }
}

.contact-form {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  box-shadow: var(--shadow-md);
}

.field { margin-bottom: 20px; position: relative; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
}
.req { color: #e11d48; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,.04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.8; }

.field select option {
  background-color: #1a1c24;
  color: var(--text);
}

/* Custom project-type dropdown — a native <select> popup can't take a
   translucent/blurred background, so this reproduces the field's own
   glass look for the open list instead. The real <select> stays in the
   DOM (hidden) so the form still submits a normal "subject" value. */
.custom-select { position: relative; }

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, .04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  text-align: start;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.custom-select-trigger[aria-expanded="true"],
.custom-select-trigger:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, .07);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(62, 142, 237, .14);
}

.custom-select-value.is-placeholder { color: #9aa8bd; }

.custom-select-arrow {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t-fast);
}
.custom-select-trigger[aria-expanded="true"] .custom-select-arrow { transform: rotate(180deg); }

.custom-select-list {
  position: absolute;
  z-index: 20;
  inset-inline: 0;
  top: calc(100% + 8px);
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(20, 24, 36, .7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.custom-select-list li {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .93rem;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.custom-select-list li:hover,
.custom-select-list li.is-active {
  background: rgba(255, 255, 255, .08);
}
.custom-select-list li[aria-selected="true"] {
  color: #fff;
  background: var(--grad-btn);
}

.field input::placeholder,
.field textarea::placeholder { color: #9aa8bd; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: rgba(255,255,255,.07);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(62, 142, 237, .14);
}

.field.invalid input,
.field.invalid textarea {
  border-color: #e11d48;
  background: rgba(225,29,72,.09);
}
.field.invalid input:focus,
.field.invalid textarea:focus { box-shadow: 0 0 0 4px rgba(225, 29, 72, .12); }

.field.valid input,
.field.valid textarea { border-color: #16a34a; }

.error {
  display: none;
  margin-top: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: #e11d48;
}
.field.invalid .error { display: block; animation: shakeIn .3s var(--ease); }
@keyframes shakeIn {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

.counter {
  display: block;
  margin-top: 6px;
  text-align: end;
  font-size: .78rem;
  color: var(--muted);
}

#submitBtn { margin-top: 6px; }
#submitBtn.loading .btn-label { opacity: .45; }
#submitBtn.loading .spinner { display: block; }

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-success {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(22,163,74,.14);
  border: 1px solid rgba(34,197,94,.35);
  color: #6ee7a8;
  font-size: .92rem;
  font-weight: 700;
  animation: fadeUp .4s var(--ease);
}

.form-note {
  margin-top: 14px;
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- 13. FOOTER ---------- */
.footer {
  background: #070A12;
  border-top: 1px solid var(--border);
  color: #a9bcd4;
  padding: 70px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 46px;
}

.logo-light { color: #fff; margin-bottom: 16px; }
.footer-brand p { font-size: .93rem; line-height: 1.9; max-width: 320px; }

.footer-col h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 18px;
}
.footer-col ul { display: grid; gap: 11px; }
.footer-col a,
.footer-contact li {
  font-size: .92rem;
  color: #a9bcd4;
  transition: color var(--t-fast), padding-inline-start var(--t-fast);
}
.footer-col a:hover {
  color: var(--accent);
  padding-inline-start: 5px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 22px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .87rem;
}
.legal { display: flex; gap: 22px; }
.legal a { transition: color var(--t-fast); }
.legal a:hover { color: var(--accent); }

/* ---------- 14. BACK TO TOP ---------- */
.to-top {
  position: fixed;
  bottom: 26px;
  inset-inline-end: 26px;
  z-index: 80;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-btn);
  box-shadow: var(--shadow-accent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-4px); }
.to-top svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 15. SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity .75s var(--ease), transform .75s var(--ease);
}
.reveal[data-anim="left"]  { transform: translateX(-46px); }
.reveal[data-anim="right"] { transform: translateX(46px); }
.reveal[data-anim="zoom"]  { transform: scale(.9); }

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- 16. RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: 1fr; gap: 54px; text-align: center; }
  .hero-copy .hero-desc { margin-inline: auto; }
  .hero-actions, .hero-trust { justify-content: center; }
  .stage-switch { justify-content: center; }
  .stage-frame,
  [dir="rtl"] .stage-frame { transform: none; }
  .stage { width: 100%; max-width: 560px; margin-inline: auto; }

  .about-grid { grid-template-columns: 1fr; gap: 50px; }
  .contact-grid { grid-template-columns: 1fr; gap: 44px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 34px; }
  .slider-arrow.prev { inset-inline-start: -8px; }
  .slider-arrow.next { inset-inline-end: -8px; }
  .slide blockquote { padding: 40px 28px 30px; }
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .marquee { --marquee-card: 320px; --marquee-gap: 20px; }

  .hamburger { display: flex; }

  .nav-links {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 110;
    width: min(84vw, 330px);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 100px 26px 40px;
    background: #080C18;
    border-inline-start: 1px solid var(--border);
    box-shadow: -12px 0 44px rgba(0, 0, 0, .7);
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform .4s var(--ease), opacity .3s var(--ease), visibility .4s;
  }
  [dir="rtl"] .nav-links { transform: translateX(-100%); }

  .nav-links.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links .nav-link {
    color: var(--text) !important;
    padding: 14px 16px;
    font-size: 1.02rem;
    border-radius: 10px;
    opacity: 0;
    transform: translateY(12px);
  }
  .nav-links.open .nav-link {
    animation: menuItemIn .45s var(--ease) forwards;
  }
  .nav-links.open .nav-link:nth-child(1) { animation-delay: .06s; }
  .nav-links.open .nav-link:nth-child(2) { animation-delay: .12s; }
  .nav-links.open .nav-link:nth-child(3) { animation-delay: .18s; }
  .nav-links.open .nav-link:nth-child(4) { animation-delay: .24s; }
  .nav-links.open .nav-link:nth-child(5) { animation-delay: .30s; }
  .nav-links.open .nav-link:nth-child(6) { animation-delay: .36s; }

  @keyframes menuItemIn {
    to { opacity: 1; transform: none; }
  }

  .nav-links .nav-link:hover,
  .nav-links .nav-link.active {
    background: rgba(62, 142, 237, .14);
    color: var(--accent) !important;
  }
  .nav-link::after { display: none; }

  .nav-cta {
    margin: 14px 0 0;
    color: #fff !important;
    text-align: center;
    justify-content: center;
  }
  .nav-links .nav-cta:hover { color: #fff !important; background: var(--grad-btn); }
}

@media (max-width: 640px) {
  :root { --nav-h: 66px; }

  .section { padding: 76px 0; }
  .container { padding-inline: 18px; }

  /* ---- the top bar on a phone ----
     Hamburger, language control and logo have to share about 320px once the
     side padding is taken out. At full size they need closer to 390, so on a
     360px phone the control landed on top of the wordmark. Everything here
     shrinks to fit, and the logo is allowed to shrink too so the control can
     never sit over it again. */
  .nav-inner { gap: 10px; }

  .logo { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  .logo-mark { height: 32px; }
  .logo-wordmark { height: 15px; min-width: 0; }

  .nav-end { gap: 6px; }

  .lang-switch { padding: 2px; margin-inline-end: 0; }
  .lang-opt {
    min-width: 36px;
    height: 26px;
    padding: 0 8px;
    font-size: .72rem;
  }

  .hamburger { width: 40px; height: 40px; padding: 9px; }
}

/* Below this the wordmark cannot fit beside the control without being
   clipped mid-letter, which looks like a bug. The emblem carries the brand
   on its own at this size. */
@media (max-width: 345px) {
  .logo-wordmark { display: none; }
  .logo { overflow: visible; }
}

/* The legal pages carry a back button in the bar as well as the language
   control, so they run out of room sooner than the home page does. */
@media (max-width: 560px) {
  .navbar--compact .logo-wordmark { display: none; }
  .navbar--compact .logo { overflow: visible; }
  .navbar--compact .nav-end .btn-sm { padding: 8px 14px; font-size: .8rem; }

  /* ---- compact hero: it must land close to one screen ---- */
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-h) + 26px);
    padding-bottom: 46px;
  }
  .hero-inner { gap: 30px; }
  .hero-title { font-size: clamp(1.7rem, 8vw, 2.1rem); margin-bottom: 12px; }
  .hero-sub { min-height: 1.8em; font-size: .98rem; margin-bottom: 10px; }
  .hero-desc { font-size: .93rem; line-height: 1.75; margin-bottom: 22px; }

  /* the two CTAs share one row instead of stacking full-width */
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 0; min-width: 0; }
  .btn-lg { padding: 13px 16px; font-size: .92rem; }

  .hero-trust {
    gap: 10px 18px;
    margin-top: 24px;
    padding-top: 18px;
    font-size: .78rem;
  }
  .hero-trust strong { font-size: .9rem; }
  .hero-trust li { flex: 1 1 28%; }

  .scroll-cue { display: none; }

  /* one stable, shorter box for both landscape and portrait captures */
  .stage-screen { min-height: 300px; }
  .stage-eyebrow { margin-bottom: 10px; font-size: .88rem; }
  .stage-frame img { aspect-ratio: auto; height: 185px; }
  .stage-screen.is-phone .stage-frame { max-width: 168px; }
  .stage-screen.is-phone .stage-frame img { aspect-ratio: auto; height: 250px; }
  .stage-tab { font-size: .62rem; padding: 3px 9px; }
  .stage-switch { margin-top: 18px; gap: 8px; }
  .stage-dot { width: 50px; height: 34px; }

  /* ---- trim the expensive effects: they cost far more than they add
         on a phone, and the oversized blurred layers cause jank ---- */
  .hero-canvas { display: none; }
  .scene-beam { display: none; }
  .scene-glow { filter: blur(26px); opacity: .45; animation: none; }
  .scene-grid { background-size: 44px 44px; opacity: .35; }
  .stage-halo { filter: blur(24px); }

  .stats-grid { grid-template-columns: 1fr; }
  .stat { padding: 26px 18px; }

  .about-card-stack { padding: 18px 0; }
  /* small enough that the longest line fits without a sideways scroll */
  .code-body { font-size: .66rem; padding: 14px 12px; line-height: 1.75; }
  .code-bar { padding: 8px 12px; }
  .code-bar em { font-size: .68rem; }

  .float-badge { font-size: .7rem; padding: 7px 11px; }
  .fb-1 { inset-inline-end: 0; }
  .fb-2 { inset-inline-start: 0; }

  .marquee,
  .portfolio-grid .marquee { --marquee-card: min(290px, 80vw); --marquee-gap: 16px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-grid.is-strips { gap: 18px; }
  .card { padding: 28px 24px; }

  .filters { gap: 8px; }
  .filter-btn { padding: 8px 16px; font-size: .85rem; }

  .slider { padding: 0; }
  .slider-arrow { display: none; }
  .slide blockquote { padding: 34px 22px 26px; }
  .slide p { font-size: .98rem; line-height: 1.9; }
  .quote-mark { font-size: 4rem; inset-inline-end: 18px; }

  .contact-form { padding: 28px 22px; }

  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { justify-content: center; text-align: center; }

  .to-top { bottom: 18px; inset-inline-end: 18px; width: 44px; height: 44px; }
}

/* ---------- 17. MOTION PREFERENCES / PRINT ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .reveal { opacity: 1; transform: none; }

  /* no auto-motion: the strip becomes a plain swipeable row */
  .marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; }
  .marquee-track > [aria-hidden="true"] { display: none; }
}

@media print {
  .navbar, .to-top, .hero-canvas, .slider-arrow, .dots { display: none !important; }
  body { background: #fff; }
  .reveal { opacity: 1; transform: none; }
}




/* ---------- 18. REVIEWS: empty state, CTA, dialog ---------- */
.tm-state {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  padding: 40px 0;
}

.tm-cta {
  margin-top: 34px;
  text-align: center;
}
.tm-cta p {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 14px;
}

.tm-stars {
  display: block;
  margin-bottom: 12px;
  font-size: 1.05rem;
  letter-spacing: 2px;
  color: #f5b544;
}
.tm-stars i { font-style: normal; color: rgba(255, 255, 255, .22); }

/* dialog shell */
.modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 16, .82);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .28s var(--ease);
  overflow-y: auto;
}
.modal.show { opacity: 1; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: auto;
  background: #0b1020;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 34px 30px 30px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .34s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.modal-card h2 { font-size: 1.3rem; margin-bottom: 6px; }
.modal-sub {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 22px;
}

.modal-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  transition: background var(--t-fast), transform var(--t-fast);
}
.modal-close:hover { background: var(--accent); transform: rotate(90deg); }
.modal-close svg {
  width: 17px; height: 17px;
  fill: none; stroke: #fff; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* star picker */
.stars { display: flex; gap: 6px; }
.star {
  font-size: 1.6rem;
  line-height: 1;
  color: rgba(255, 255, 255, .2);
  transition: color var(--t-fast), transform var(--t-fast);
}
.star:hover { transform: scale(1.15); }
.star.on { color: #f5b544; }

/* honeypot — off-screen for bots, invisible to people and screen readers */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-error {
  margin-top: 16px;
  padding: 13px 17px;
  border-radius: var(--radius-sm);
  background: rgba(225, 29, 72, .12);
  border: 1px solid rgba(225, 29, 72, .35);
  color: #ff8fa6;
  font-size: .9rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .modal { padding: 14px; }
  .modal-card { padding: 28px 20px 24px; }
  .modal-card h2 { font-size: 1.12rem; }
}

/* social icons repeated in the footer sit on the darker footer ground */
.footer-socials { margin-top: 18px; }
.footer-socials a {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .1);
  color: #a9bcd4;
}

/* ---------- 17. LEGAL PAGES (privacy) ---------- */
.legal-page {
  padding-block: calc(var(--nav-h) + 54px) 90px;
  position: relative;
}
.legal-page::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 420px;
  background: radial-gradient(900px 340px at 50% -40px, rgba(0, 180, 255, .16), transparent 70%);
  pointer-events: none;
}

.legal-head {
  position: relative;
  text-align: center;
  margin-bottom: 46px;
}
.legal-head h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.8rem);
  margin-bottom: 12px;
}
.legal-updated {
  color: var(--muted);
  font-size: .9rem;
}

.legal-body {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 46px 44px;
  line-height: 2;
}
.legal-body > p { color: var(--muted); }
.legal-body section + section { margin-top: 36px; }
.legal-body > p + section { margin-top: 32px; }
.legal-body h2 {
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 12px;
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--accent);
}
.legal-body p { margin-bottom: 12px; color: var(--muted); }
.legal-body p:last-child { margin-bottom: 0; }
.legal-body ul {
  display: grid;
  gap: 9px;
  margin: 0 0 12px;
  padding-inline-start: 4px;
}
.legal-body li {
  color: var(--muted);
  position: relative;
  padding-inline-start: 20px;
}
.legal-body li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad-accent);
}
.legal-body strong { color: var(--text); }
.legal-body a { color: var(--accent); }
.legal-body a:hover { text-decoration: underline; }

.legal-back {
  position: relative;
  max-width: 760px;
  margin: 28px auto 0;
  text-align: center;
}

@media (max-width: 640px) {
  .legal-page { padding-block: calc(var(--nav-h) + 26px) 60px; }
  .legal-body { padding: 28px 20px; border-radius: var(--radius); }
  .legal-body h2 { font-size: 1.05rem; }
}
.legal-body code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: .85em;
  direction: ltr;
  display: inline-block;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  color: #8fc0f8;
}
