/* ============================================================
     MIEDRA — "Neon Nexus" design system
     ============================================================ */
  :root {
    --bg-0: #070912;
    --bg-1: #0B0E1A;
    --bg-2: #11152a;
    --violet: #3B5BDB;
    --violet-2: #5B7CFF;
    --cyan: #5B8DEF;
    --cyan-2: #3B5BDB;
    --magenta: #F87171;
    --text: #E5E7EB;
    --muted: #94A3B8;
    --line: rgba(148, 163, 184, 0.14);
    --glass: rgba(255, 255, 255, 0.035);
    --glass-strong: rgba(255, 255, 255, 0.06);
    --grad-main: linear-gradient(120deg, #7BA3F7 0%, #3B5BDB 55%, #1E3A8A 100%);
    --grad-soft: linear-gradient(120deg, #5B8DEF, #3B5BDB);
    --glow-violet: 0 0 40px rgba(59, 91, 219, 0.4);
    --glow-cyan: 0 0 40px rgba(91, 141, 239, 0.35);
    --radius: 18px;
    --maxw: 1180px;
    --nav-h: 72px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

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

  body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-0);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  /* ambient background layers */
  .bg-wrap {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
      radial-gradient(1200px 800px at 80% -10%, rgba(59, 91, 219, 0.18), transparent 60%),
      radial-gradient(1000px 700px at 0% 30%, rgba(91, 141, 239, 0.12), transparent 55%),
      radial-gradient(900px 700px at 60% 110%, rgba(30, 58, 138, 0.16), transparent 55%),
      var(--bg-0);
  }
  .grid-overlay {
    position: absolute;
    inset: -2px;
    background-image:
      linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
  }
  .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    will-change: transform;
  }
  .orb.o1 { width: 520px; height: 520px; top: -160px; left: -120px;
    background: radial-gradient(circle at 30% 30%, #3B5BDB, transparent 70%);
    animation: drift1 22s var(--ease) infinite alternate; }
  .orb.o2 { width: 460px; height: 460px; top: 30%; right: -140px;
    background: radial-gradient(circle at 60% 40%, #5B8DEF, transparent 70%);
    animation: drift2 26s var(--ease) infinite alternate; }
  .orb.o3 { width: 480px; height: 480px; bottom: -180px; left: 25%;
    background: radial-gradient(circle at 50% 50%, #1E3A8A, transparent 70%);
    animation: drift3 30s var(--ease) infinite alternate; }
  @keyframes drift1 { to { transform: translate(120px, 80px) scale(1.12); } }
  @keyframes drift2 { to { transform: translate(-100px, 60px) scale(1.08); } }
  @keyframes drift3 { to { transform: translate(80px, -90px) scale(1.14); } }

  /* ============================================================
     Layout helpers
     ============================================================ */
  .wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
  section { position: relative; padding: 110px 0; }
  .eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--cyan); font-weight: 600;
    padding: 7px 15px; border-radius: 999px;
    border: 1px solid rgba(91, 141, 239, 0.3);
    background: rgba(91, 141, 239, 0.06);
  }
  .eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
  h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
  .section-head { max-width: 720px; margin-bottom: 56px; }
  .section-head h2 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin: 18px 0 14px; }
  .section-head p { color: var(--muted); font-size: 1.08rem; }
  .gradient-text {
    background: var(--grad-main);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }

  /* ============================================================
     Buttons
     ============================================================ */
  .btn {
    --b: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.98rem;
    padding: 14px 26px; border-radius: 12px; cursor: pointer;
    text-decoration: none; border: 1px solid transparent;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
    position: relative; white-space: nowrap;
  }
  .btn-primary { color: #07070d; background: var(--grad-main); background-size: 180% 180%; box-shadow: 0 8px 30px rgba(59, 91, 219, 0.35); animation: btnShift 6s ease infinite; }
  @keyframes btnShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
  .btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 42px rgba(59, 91, 219, 0.55), 0 0 28px rgba(91, 141, 239, 0.4); }
  .btn-ghost { color: var(--text); background: var(--glass); border-color: var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .btn-ghost:hover { transform: translateY(-3px); border-color: rgba(91, 141, 239, 0.5); box-shadow: var(--glow-cyan); }
  .btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 10px;
  }

  /* ============================================================
     Scroll progress + Nav
     ============================================================ */
  #progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 200;
    background: var(--grad-main); box-shadow: 0 0 12px rgba(59,91,219,0.7); transition: width 0.1s linear; }

  header.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-h);
    display: flex; align-items: center;
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
    border-bottom: 1px solid transparent;
  }
  header.nav.scrolled {
    background: rgba(8, 10, 20, 0.72);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  }
  .nav-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
  .logo { display: inline-flex; align-items: center; text-decoration: none; }
  .logo-img {
    height: 44px;
    width: auto;
    display: block;
    background: transparent;
    filter: drop-shadow(0 0 12px rgba(91, 141, 239, 0.3));
  }
  footer .logo-img { height: 50px; }

  .nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
  .nav-links a {
    color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500;
    padding: 9px 14px; border-radius: 10px; position: relative; transition: color 0.25s, background 0.25s;
  }
  .nav-links a::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
    background: var(--grad-main); border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
  }
  .nav-links a:hover { color: var(--text); }
  .nav-links a.active { color: var(--text); }
  .nav-links a.active::after { transform: scaleX(1); }
  .nav-cta { margin-left: 8px; }
  .nav-actions { display: flex; align-items: center; gap: 12px; }

  .hamburger { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--glass); border-radius: 12px; cursor: pointer; position: relative; }
  .hamburger span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s; }
  .hamburger span:nth-child(1) { top: 15px; }
  .hamburger span:nth-child(2) { top: 21px; }
  .hamburger span:nth-child(3) { top: 27px; }
  .hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .mobile-menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 99;
    background: rgba(8, 10, 20, 0.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform 0.45s var(--ease); padding: 16px 24px 26px;
  }
  .mobile-menu.open { transform: translateY(0); }
  .mobile-menu a { display: block; color: var(--text); text-decoration: none; font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; padding: 14px 6px; border-bottom: 1px solid var(--line); }
  .mobile-menu a:last-of-type { border-bottom: none; }
  .mobile-menu .btn { width: 100%; margin-top: 16px; }

  /* ============================================================
     Glass card base
     ============================================================ */
  .glass {
    background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    position: relative; overflow: hidden;
  }
  .glass::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(140deg, rgba(91,141,239,0.5), transparent 35%, transparent 65%, rgba(59,91,219,0.45));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity 0.4s; pointer-events: none;
  }
  .glass:hover::before { opacity: 1; }

  /* ============================================================
     HERO
     ============================================================ */
  #home { padding-top: calc(var(--nav-h) + 70px); min-height: 100vh; display: flex; align-items: center; }
  #hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
  .hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
  .hero-copy h1 { font-size: clamp(2.5rem, 6vw, 4.3rem); margin: 22px 0 20px; }
  .hero-copy p.lead { font-size: 1.18rem; color: var(--muted); max-width: 540px; margin-bottom: 34px; }
  .hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
  .hero-trust { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 26px; color: var(--muted); font-size: 0.88rem; }
  .hero-trust div { display: flex; align-items: center; gap: 8px; }
  .hero-trust .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

  /* Floating AI core SVG visual */
  .hero-visual { display: grid; place-items: center; position: relative; }
  .core-card { width: min(100%, 420px); aspect-ratio: 1 / 1; border-radius: 28px; padding: 26px; display: grid; place-items: center; animation: floaty 7s ease-in-out infinite; }
  @keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
  .core-card svg { width: 100%; height: 100%; overflow: visible; }
  .ring { transform-origin: 200px 200px; }
  .spin-slow { animation: spin 26s linear infinite; transform-origin: 200px 200px; }
  .spin-rev { animation: spin 20s linear infinite reverse; transform-origin: 200px 200px; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .node-pulse { animation: nodePulse 3s ease-in-out infinite; }
  @keyframes nodePulse { 0%,100% { opacity: 0.55; r: 5; } 50% { opacity: 1; r: 7; } }
  .core-glow { animation: coreGlow 4s ease-in-out infinite; transform-origin: 200px 200px; }
  @keyframes coreGlow { 0%,100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
  .badge-float { position: absolute; padding: 10px 16px; border-radius: 14px; font-family: 'Space Grotesk', sans-serif; font-size: 0.82rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
  .badge-float .d { width: 8px; height: 8px; border-radius: 50%; }
  .badge-ai { top: 6%; right: -6%; animation: floaty 6s ease-in-out infinite; }
  .badge-cloud { bottom: 10%; left: -8%; animation: floaty 6s ease-in-out 1.2s infinite; }

  /* ============================================================
     SERVICES
     ============================================================ */
  .cluster { margin-bottom: 56px; }
  .cluster:last-child { margin-bottom: 0; }
  .cluster-title { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
  .cluster-title .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
  .cluster-title h3 { font-size: 1.55rem; }
  .cluster-title .sub { color: var(--muted); font-size: 0.92rem; }
  .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .card { padding: 28px 24px; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease); }
  .card:hover { transform: translateY(-6px); border-color: rgba(59,91,219,0.4); box-shadow: 0 18px 50px rgba(0,0,0,0.4), 0 0 30px rgba(59,91,219,0.18); }
  .card .icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px; background: rgba(59,91,219,0.12); border: 1px solid rgba(59,91,219,0.25); transition: box-shadow 0.4s, transform 0.4s; }
  .card:hover .icon { box-shadow: var(--glow-violet); transform: scale(1.05); }
  .card.cy .icon { background: rgba(91,141,239,0.1); border-color: rgba(91,141,239,0.25); }
  .card.cy:hover .icon { box-shadow: var(--glow-cyan); }
  .card h4 { font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; margin-bottom: 8px; }
  .card p { color: var(--muted); font-size: 0.93rem; }

  /* ============================================================
     SOLUTIONS / WHY
     ============================================================ */
  .why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .why-card { padding: 30px 24px; }
  .why-card .icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 20px; background: var(--glass-strong); border: 1px solid var(--line); }
  .why-card h4 { font-family: 'Space Grotesk', sans-serif; font-size: 1.18rem; margin-bottom: 10px; }
  .why-card p { color: var(--muted); font-size: 0.93rem; }

  /* ============================================================
     STATS
     ============================================================ */
  .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 44px; }
  .stat { text-align: center; }
  .stat .num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1; background: var(--grad-main); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
  .stat .label { color: var(--muted); margin-top: 10px; font-size: 0.92rem; letter-spacing: 0.02em; }
  .stat + .stat { border-left: 1px solid var(--line); }

  /* ============================================================
     ABOUT
     ============================================================ */
  .about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
  .about-copy p { color: var(--muted); margin-bottom: 18px; font-size: 1.04rem; }
  .about-copy p strong { color: var(--text); }
  .hubs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .hub { padding: 26px 22px; }
  .hub .city { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
  .hub .flag { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
  .hub .role { color: var(--cyan); font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 12px; }
  .hub p { color: var(--muted); font-size: 0.92rem; }

  /* ============================================================
     CONTACT
     ============================================================ */
  .contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 28px; align-items: start; }
  .offices { display: grid; gap: 18px; }
  .office { padding: 26px 24px; }
  .office .head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
  .office .head .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--line); }
  .office .head h4 { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; }
  .office .head .tag { color: var(--muted); font-size: 0.8rem; }
  .office ul { list-style: none; display: grid; gap: 11px; }
  .office li { display: flex; align-items: center; gap: 12px; font-size: 0.93rem; }
  .office li svg { flex: none; opacity: 0.8; }
  .office a, .office span.addr { color: var(--text); text-decoration: none; transition: color 0.2s; }
  .office a:hover { color: var(--cyan); }

  form.contact-form { padding: 32px; }
  .field { margin-bottom: 18px; }
  .field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
  .field label .req { color: var(--magenta); }
  .field input, .field textarea {
    width: 100%; padding: 13px 15px; font-family: inherit; font-size: 0.96rem; color: var(--text);
    background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 12px; transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  }
  .field input::placeholder, .field textarea::placeholder { color: #5b647a; }
  .field input:focus, .field textarea:focus { outline: none; border-color: rgba(91,141,239,0.6); background: rgba(255,255,255,0.06); box-shadow: 0 0 0 3px rgba(91,141,239,0.12); }
  .field textarea { resize: vertical; min-height: 120px; }
  .field.invalid input, .field.invalid textarea { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(248,113,113,0.18); }
  .field .err { color: var(--magenta); font-size: 0.78rem; margin-top: 6px; display: none; }
  .field.invalid .err { display: block; }
  /* intl-tel-input: dark "Neon Nexus" theme */
  .iti { width: 100%; }
  .iti__selected-dial-code { font-family: inherit; color: var(--text); }
  .iti--separate-dial-code .iti__selected-flag { background-color: rgba(255,255,255,0.06); border-radius: 12px 0 0 12px; }
  .iti__selected-flag:hover, .iti--separate-dial-code .iti__selected-flag:hover { background-color: rgba(255,255,255,0.1); }
  .iti__dropdown-content { background: #11152a; border: 1px solid var(--line); color: var(--text); box-shadow: 0 18px 50px rgba(0,0,0,0.6); border-radius: 12px; overflow: hidden; }
  .iti__search-input { background: #0b0e1a; color: var(--text); border: none; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .iti__search-input::placeholder { color: #5b647a; }
  .iti__country-list { background: transparent; color: var(--text); }
  .iti__country { color: var(--text); }
  .iti__country.iti__highlight, .iti__country:hover { background-color: rgba(59,91,219,0.35); }
  .iti__dial-code { color: var(--muted); }
  .iti__divider { border-bottom-color: var(--line); }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .form-success {
    display: none; align-items: center; gap: 10px; margin-top: 8px; padding: 14px 16px; border-radius: 12px;
    background: rgba(91,141,239,0.08); border: 1px solid rgba(91,141,239,0.4); color: var(--text); font-size: 0.92rem;
    box-shadow: var(--glow-cyan);
  }
  .form-success.show { display: flex; animation: popIn 0.5s var(--ease); }
  @keyframes popIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

  /* ============================================================
     FOOTER
     ============================================================ */
  footer { border-top: 1px solid var(--line); padding: 64px 0 30px; position: relative; }
  .foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 44px; }
  .foot-brand p { color: var(--muted); font-size: 0.93rem; margin-top: 16px; max-width: 320px; }
  .foot-col h5 { font-family: 'Space Grotesk', sans-serif; font-size: 0.92rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); margin-bottom: 16px; }
  .foot-col ul { list-style: none; display: grid; gap: 10px; }
  .foot-col a, .foot-col span { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
  .foot-col a:hover { color: var(--cyan); }
  .foot-bottom { border-top: 1px solid var(--line); padding-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 0.85rem; }

  /* ============================================================
     Scroll reveal (base visible if no JS)
     ============================================================ */
  html.js .reveal { opacity: 0; transform: translateY(28px) scale(0.985); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
  html.js .reveal.in { opacity: 1; transform: none; }
  html.js .reveal.d1 { transition-delay: 0.08s; }
  html.js .reveal.d2 { transition-delay: 0.16s; }
  html.js .reveal.d3 { transition-delay: 0.24s; }

  /* ============================================================
     Responsive
     ============================================================ */
  @media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .hero-visual { order: -1; max-width: 380px; margin: 0 auto; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .why-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .contact-grid { grid-template-columns: 1fr; }
    .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  }
  @media (max-width: 760px) {
    .nav-links, .nav-cta { display: none; }
    .hamburger { display: block; }
    section { padding: 80px 0; }
    .stats { grid-template-columns: 1fr 1fr; gap: 28px; padding: 32px 20px; }
    .stat + .stat { border-left: none; }
    .stat:nth-child(n+3) { padding-top: 22px; border-top: 1px solid var(--line); }
    .form-row { grid-template-columns: 1fr; }
  }
  @media (max-width: 460px) {
    .wrap { padding: 0 18px; }
    .nav-inner { padding: 0 18px; }
    .cards, .why-grid { grid-template-columns: 1fr; }
    .hubs { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
    .stat + .stat { border-top: 1px solid var(--line); padding-top: 22px; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
    .hero-copy h1 { font-size: 2.4rem; }
    .badge-float { display: none; }
    form.contact-form { padding: 24px 20px; }
  }

  /* ============================================================
     Language switcher
     ============================================================ */
  .lang-switch {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 4px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--glass);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .lang-switch button {
    font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.82rem;
    letter-spacing: 0.04em; color: var(--muted);
    background: transparent; border: none; cursor: pointer;
    padding: 6px 11px; border-radius: 9px;
    transition: color 0.25s, background 0.25s, box-shadow 0.25s;
  }
  .lang-switch button:hover { color: var(--text); }
  .lang-switch button.active {
    color: #07070d; background: var(--grad-soft);
    box-shadow: 0 0 16px rgba(91, 141, 239, 0.5);
  }
  .lang-switch button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
  .mobile-menu .lang-switch { display: flex; margin-top: 18px; width: 100%; justify-content: center; }
  .mobile-menu .lang-switch button { font-size: 0.95rem; padding: 9px 18px; }
  @media (max-width: 760px) {
    .nav-actions .lang-switch { display: none; }
  }

  /* ============================================================
     RTL (Arabic)
     ============================================================ */
  [dir="rtl"] body,
  [dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5,
  [dir="rtl"] .btn, [dir="rtl"] .eyebrow,
  [dir="rtl"] .stat .num, [dir="rtl"] .cluster-title h3, [dir="rtl"] .card h4,
  [dir="rtl"] .why-card h4, [dir="rtl"] .hub .city, [dir="rtl"] .office .head h4,
  [dir="rtl"] .foot-col h5 {
    font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
  }
  [dir="rtl"] body { text-align: right; }
  [dir="rtl"] .eyebrow { letter-spacing: 0; }
  [dir="rtl"] .hero-trust .dot,
  [dir="rtl"] .eyebrow::before { box-shadow: 0 0 8px var(--cyan); }
  /* nav */
  [dir="rtl"] .nav-links { flex-direction: row-reverse; }
  [dir="rtl"] .nav-cta { margin-left: 0; margin-right: 8px; }
  [dir="rtl"] .nav-actions { flex-direction: row-reverse; }
  [dir="rtl"] .nav-links a::after { transform-origin: right; }
  /* hero */
  [dir="rtl"] .hero-grid { direction: rtl; }
  [dir="rtl"] .hero-copy p.lead { margin-left: 0; }
  [dir="rtl"] .hero-cta, [dir="rtl"] .hero-trust { flex-direction: row-reverse; justify-content: flex-end; }
  [dir="rtl"] .hero-trust div, [dir="rtl"] .btn { flex-direction: row-reverse; }
  [dir="rtl"] .badge-ai { right: auto; left: -6%; }
  [dir="rtl"] .badge-cloud { left: auto; right: -8%; }
  [dir="rtl"] .badge-float { flex-direction: row-reverse; }
  /* services / why */
  [dir="rtl"] .cluster-title { flex-direction: row-reverse; }
  [dir="rtl"] .section-head { margin-left: auto; }
  /* about */
  [dir="rtl"] .hub .city { flex-direction: row-reverse; }
  [dir="rtl"] .hub .role { letter-spacing: 0; }
  /* contact */
  [dir="rtl"] .office .head { flex-direction: row-reverse; }
  [dir="rtl"] .office li { flex-direction: row-reverse; }
  [dir="rtl"] .field label { text-align: right; }
  /* keep phone input strictly LTR (flag + number must not mirror) */
  [dir="rtl"] .iti, [dir="rtl"] #phone { direction: ltr; text-align: left; }
  /* footer */
  [dir="rtl"] .foot-bottom { flex-direction: row-reverse; }

/* multipage: content below fixed nav */
main.page { min-height: 60vh; }
main.page > section:first-child { padding-top: calc(var(--nav-h) + 70px); }
#home { padding-top: calc(var(--nav-h) + 70px); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { transform: scaleX(1); }
