/* ============================================================
   THEME TOKENS
   Swap these when the brand's visual identity file is applied.
   Colors, fonts, radius and spacing all live here.
   ============================================================ */
:root {
  /* Brand palette (placeholder — replace with visual identity) */
  --brand:        #6366f1;   /* primary (brighter indigo) */
  --brand-2:      #06b6d4;   /* secondary / gradient end */
  --brand-ink:    #0b1020;   /* deep background */
  --accent:       #22d3ee;

  /* vivid accent palette — used for glows, icons, highlights */
  --violet: #8b5cf6;
  --pink:   #ec4899;
  --amber:  #f59e0b;
  --teal:   #14b8a6;
  --sky:    #38bdf8;
  --lime:   #22c55e;

  /* Surfaces & text */
  --bg:           #0b1020;
  --bg-elev:      #121a33;
  --bg-alt:       #0e1530;
  --surface:      #141d3a;
  --text:         #eaf0ff;
  --text-muted:   #a9b4d0;
  --border:       rgba(255, 255, 255, 0.09);

  /* Typography */
  --font-body: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-head: "Sora", var(--font-body);
  --font-ar:   "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  /* Shape */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow:    0 20px 50px -20px rgba(0, 0, 0, 0.6);

  /* Layout */
  --maxw: 1140px;
  --gutter: 22px;
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(50% 40% at 85% 8%, rgba(139,92,246,.12), transparent 70%),
    radial-gradient(45% 35% at 8% 42%, rgba(6,182,212,.10), transparent 70%),
    radial-gradient(45% 40% at 92% 78%, rgba(236,72,153,.10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem;
  padding: .7em 1.3em; border-radius: 999px; border: 1px solid transparent;
  background: linear-gradient(135deg, var(--violet), var(--brand) 55%, var(--brand-2));
  color: #fff; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
  box-shadow: 0 12px 30px -12px var(--violet);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px var(--brand); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: .85em 1.6em; font-size: 1rem; }
.btn-sm { padding: .5em 1.1em; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border); box-shadow: none;
}
.btn-ghost:hover { background: rgba(255,255,255,.04); box-shadow: none; }

.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700;
  color: var(--accent); margin: 0 0 .8em;
}
/* signature { } code-brace motif.
   Flexbox places the braces by layout order (start = right in RTL), so they land
   on the correct sides regardless of text direction; direction:ltr stops the
   browser from mirroring the { } glyphs. */
.eyebrow { display: inline-flex; align-items: baseline; gap: .35em; direction: ltr; }
.eyebrow::before { content: "{"; opacity: .7; }
.eyebrow::after  { content: "}"; opacity: .7; }

/* bilingual (Arabic) type */
.lead-ar {
  font-family: var(--font-ar); font-weight: 500;
  color: var(--text-muted); font-size: 1.05rem; max-width: 40ch; margin: -.4em 0 0;
}
.footer-ar { font-family: var(--font-ar); margin-top: 4px; }

/* Apply the Arabic font to all Arabic (RTL) text; English keeps Sora/Manrope */
[dir="rtl"] body { font-family: var(--font-ar); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] .btn, [dir="rtl"] .value strong, [dir="rtl"] .about-panel h3 { font-family: var(--font-ar); }
[dir="rtl"] h1 { font-weight: 700; }
/* Latin brand wordmark & the code snippet stay in their own fonts */
[dir="rtl"] .brand-name { font-family: var(--font-head); }
[dir="rtl"] .glass-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ============================================================ HEADER */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 16, 32, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6em; }
.brand-svg { flex: 0 0 auto; border-radius: 12px; box-shadow: 0 6px 18px -8px var(--brand); }
.brand-text { display: flex; flex-direction: column; line-height: 1.04; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; }
.brand-ar { font-family: var(--font-ar); font-weight: 600; font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.brand-accent { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.lang-btn {
  font-family: var(--font-head); font-weight: 700; font-size: .85rem; color: var(--text);
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  padding: .45em 1em; cursor: pointer; display: inline-flex; align-items: center; gap: .4em;
  white-space: nowrap; transition: background .15s;
}
.lang-btn::before { content: "🌐"; font-size: .9em; }
.lang-btn:hover { background: rgba(255, 255, 255, .05); }
.nav-links a { color: var(--text-muted); font-weight: 600; font-size: .95rem; transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-links .btn { color: #fff; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* ============================================================ HERO */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 7vw, 80px); }
.hero::before {
  content: ""; position: absolute; inset: -25% -10% auto -10%; height: 620px;
  background: radial-gradient(55% 55% at 22% 12%, rgba(139,92,246,.45), transparent 70%),
              radial-gradient(50% 50% at 82% 6%,  rgba(6,182,212,.40), transparent 70%),
              radial-gradient(45% 45% at 60% 58%, rgba(236,72,153,.28), transparent 70%),
              radial-gradient(40% 40% at 12% 60%, rgba(56,189,248,.24), transparent 70%);
  filter: blur(4px); z-index: 0; pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 60px); align-items: center; }
.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.7rem); font-weight: 800;
  background: linear-gradient(100deg, #ffffff 0%, #c7d2fe 45%, #5eead4 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--text-muted); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 2.2rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--font-head); font-size: 1rem; }
.hero-stats span { color: var(--text-muted); font-size: .88rem; }

/* Hero art */
.hero-art { position: relative; min-height: 380px; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .95; animation: orbfloat 10s ease-in-out infinite; }
.orb-1 { width: 230px; height: 230px; right: 4%; top: 2%; background: radial-gradient(circle at 30% 30%, var(--violet), transparent 70%); }
.orb-2 { width: 170px; height: 170px; left: 2%; bottom: 4%; background: radial-gradient(circle at 30% 30%, var(--brand-2), transparent 70%); animation-delay: 2.5s; animation-duration: 12s; }
.orb-3 { width: 130px; height: 130px; right: 34%; bottom: 12%; background: radial-gradient(circle at 30% 30%, var(--pink), transparent 70%); opacity: .8; animation-delay: 1.2s; animation-duration: 9s; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.dot:nth-child(1){ background:#ff5f56; } .dot:nth-child(2){ background:#ffbd2e; } .dot:nth-child(3){ background:#27c93f; }

/* Animated code editor */
.code-window {
  position: absolute; inset: 8% 3% 8% 6%;
  background: linear-gradient(160deg, rgba(20,29,58,.94), rgba(15,21,44,.94));
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 40px 80px -34px rgba(0,0,0,.75);
  backdrop-filter: blur(8px); overflow: hidden; display: flex; flex-direction: column;
  animation: floaty 7s ease-in-out infinite;
}
.code-window::before { /* animated gradient border */
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: 18px; pointer-events: none;
  background: linear-gradient(120deg, var(--violet), var(--brand-2), var(--pink), var(--violet));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .6;
  animation: borderflow 6s linear infinite;
}
.cw-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.03); }
.cw-file { margin-inline-start: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; color: var(--text-muted); }
.cw-body { padding: 16px 18px; overflow: hidden; }
.cw-code {
  margin: 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .92rem; line-height: 1.75; white-space: pre; color: #cdd6f4;
  direction: ltr; text-align: left; min-height: 11em;
}
.cw-k  { color: #c4b5fd; }
.cw-p  { color: #f0abfc; }
.cw-s  { color: #86efac; }
.cw-f  { color: #67e8f9; }
.cw-b  { color: var(--accent); font-weight: 700; }
.cw-c  { color: #6b7a99; font-style: italic; }
.cw-pl { color: #cdd6f4; }
.caret {
  display: inline-block; width: 8px; height: 1.05em; background: var(--accent);
  margin-inline-start: 2px; vertical-align: -2px; border-radius: 1px;
  animation: blink 1s steps(1) infinite;
}
/* floating code tokens */
.float-token {
  position: absolute; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700;
  font-size: 1.5rem; opacity: .28; pointer-events: none; animation: drift 9s ease-in-out infinite;
  direction: ltr; /* keep </>, ( ), => from mirroring in RTL */
}
.ft-1 { top: 1%;  left: 1%;   color: var(--violet); animation-delay: 0s; }
.ft-2 { bottom: 5%; right: 3%; color: var(--brand-2); animation-delay: 1.5s; font-size: 1.7rem; }
.ft-3 { top: 42%; right: -1%;  color: var(--pink);   animation-delay: 3s; }
.ft-4 { bottom: 28%; left: -1%; color: var(--sky);   animation-delay: 2.2s; }

@keyframes blink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes borderflow { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
@keyframes drift { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(6deg); } }
@keyframes orbfloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(6px,-12px); } }

/* ============================================================ TRUST STRIP */
.strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.strip-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.6rem; padding: 18px 0; color: var(--text-muted); font-size: .9rem; }
.strip-tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.strip-tags span { padding: .35em .9em; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; color: var(--text); transition: border-color .15s, color .15s, background .15s; }
.strip-tags span:hover { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--violet), var(--brand-2)); }

/* ============================================================ SECTIONS */
.section { padding: clamp(56px, 9vw, 100px) 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  background: linear-gradient(100deg, #eaf0ff 0%, #a5b4fc 55%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.section-sub { color: var(--text-muted); font-size: 1.05rem; }

/* ============================================================ SERVICE CARDS */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: linear-gradient(160deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .18s ease, border-color .18s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(139,92,246,.6); box-shadow: 0 22px 50px -26px var(--violet); }
.card-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 14px; margin-bottom: 16px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px -12px var(--brand);
}
.card-icon svg { width: 26px; height: 26px; }
/* one vivid hue per service */
.cards .card:nth-child(1) .card-icon { background: linear-gradient(135deg, #6366f1, #22d3ee); box-shadow: 0 10px 24px -12px #6366f1; }
.cards .card:nth-child(2) .card-icon { background: linear-gradient(135deg, #ec4899, #f59e0b); box-shadow: 0 10px 24px -12px #ec4899; }
.cards .card:nth-child(3) .card-icon { background: linear-gradient(135deg, #06b6d4, #22c55e); box-shadow: 0 10px 24px -12px #06b6d4; }
.cards .card:nth-child(4) .card-icon { background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 10px 24px -12px #8b5cf6; }
.cards .card:nth-child(5) .card-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); box-shadow: 0 10px 24px -12px #f59e0b; }
.cards .card:nth-child(6) .card-icon { background: linear-gradient(135deg, #14b8a6, #38bdf8); box-shadow: 0 10px 24px -12px #14b8a6; }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--text-muted); font-size: .96rem; }
.card-list { margin-top: 14px; display: grid; gap: 8px; }
.card-list li { position: relative; padding-left: 22px; color: var(--text-muted); font-size: .92rem; }
.card-list li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ============================================================ STEPS */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.steps li {
  background: linear-gradient(160deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.step-num { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.steps h3 { font-size: 1.12rem; margin-top: 8px; }
.steps p { color: var(--text-muted); font-size: .93rem; margin: 0; }

/* ============================================================ ABOUT */
.about-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.about-grid h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.value { display: flex; flex-direction: column; }
.value strong { font-family: var(--font-head); }
.value span { color: var(--text-muted); font-size: .92rem; }
.about-panel {
  background: linear-gradient(160deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow);
}
.about-panel h3 { font-size: 1.25rem; }
.check-list { display: grid; gap: 12px; margin: 16px 0 22px; }
.check-list li { position: relative; padding-left: 30px; color: var(--text-muted); }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem; color: #04121a; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--brand-2));
}

/* ============================================================ CLIENTS */
.clients-panel {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 56px); align-items: center;
  background: linear-gradient(160deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow);
}
.clients-panel h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
.clients-art { display: flex; flex-direction: column; gap: 12px; }
.tk { background: rgba(0,0,0,.22); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.tk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tk-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; color: var(--text-muted); direction: ltr; }
.tk-subj { font-family: var(--font-head); font-weight: 700; font-size: .98rem; margin: 8px 0; }
.tk-badge { font-size: .7rem; font-weight: 700; padding: .25em .7em; border-radius: 999px; white-space: nowrap; }
.tk-open { background: rgba(56,189,248,.18); color: #7dd3fc; }
.tk-prog { background: rgba(245,158,11,.18); color: #fbbf24; }
.tk-done { background: rgba(52,211,153,.18); color: #34d399; }
.tk-line { height: 8px; border-radius: 5px; background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,.04)); margin-top: 7px; }
.tk-line.w70 { width: 70%; } .tk-line.w60 { width: 60%; }
@media (max-width: 820px) { .clients-panel { grid-template-columns: 1fr; } }

/* ============================================================ CONTACT */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.contact-grid h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
.contact-list { display: grid; gap: 12px; margin-top: 18px; }
.contact-list li { display: flex; align-items: center; gap: .6em; color: var(--text-muted); }
.contact-list a:hover { color: var(--text); }
.contact-form {
  background: linear-gradient(160deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: .8em .95em; font: inherit; color: var(--text);
  background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s; resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.25);
}
.form-status { margin: 12px 0 0; font-size: .92rem; min-height: 1.2em; }
.form-status.ok { color: #34d399; }
.form-status.err { color: #f87171; }

/* ============================================================ FOOTER */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 48px 0 28px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-tag { color: var(--text-muted); margin-top: 10px; max-width: 30ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-links a { color: var(--text-muted); font-weight: 600; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .88rem; }

/* ============================================================ RESPONSIVE */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--bg-elev); border-bottom: 1px solid var(--border); padding: 12px var(--gutter) 20px;
    transform: translateY(-120%); transition: transform .25s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links .btn { margin-top: 10px; }
  .nav-toggle { display: flex; }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .values { grid-template-columns: 1fr; }
}

/* ============================================================ RTL (Arabic) */
[dir="rtl"] .card-list li { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .card-list li::before { left: auto; right: 0; content: "←"; }
[dir="rtl"] .check-list li { padding-left: 0; padding-right: 30px; }
[dir="rtl"] .check-list li::before { left: auto; right: 0; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
