/* ═══════════════════════════════════════════════════════════════
   Tarek EL ESS — tarekeless.com
   Dark premium design system · 4 languages · RTL-ready
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ink:      #070D1A;
  --bg-alt:   #0A1226;
  --surface:  rgba(255, 255, 255, 0.04);
  --surface-2:rgba(255, 255, 255, 0.07);
  --border:   rgba(255, 255, 255, 0.09);
  --text:     #E8EDF7;
  --muted:    #9AA7C2;
  --primary:  #5B5FEF;
  --primary-2:#22D3EE;
  --gold:     #F5B942;
  --green:    #34D399;
  --grad:     linear-gradient(135deg, #5B5FEF 0%, #22D3EE 100%);
  --radius:   16px;
  --radius-lg:22px;
  --font-head:'Space Grotesk', 'Cairo', sans-serif;
  --font-body:'Inter', 'Cairo', sans-serif;
  --shadow-lg:0 24px 60px -18px rgba(0, 0, 0, 0.55);
  --header-h: 76px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Arabic gets Cairo everywhere */
.lang-ar body, body.lang-ar { --font-head: 'Cairo', sans-serif; --font-body: 'Cairo', sans-serif; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; letter-spacing: -0.015em; }
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3, body.lang-ar h4 { letter-spacing: 0; line-height: 1.35; }

.container { width: min(1180px, 92%); margin-inline: auto; }

::selection { background: rgba(91, 95, 239, 0.45); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex: none; }
[dir="rtl"] .btn svg { transform: scaleX(-1); }

.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 10px 30px -8px rgba(59, 130, 246, 0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -8px rgba(59, 130, 246, 0.7); }

.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }

.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-lg { padding: 16px 34px; font-size: 16px; }

.btn-whatsapp {
  background: rgba(37, 211, 102, 0.12); border-color: rgba(37, 211, 102, 0.4);
  color: #4ADE80; width: 100%; justify-content: center; margin-top: 20px;
}
.btn-whatsapp:hover { background: rgba(37, 211, 102, 0.2); }

/* ── Kicker / badges ─────────────────────────────────────────── */
.kicker {
  display: inline-block; font-family: var(--font-head); font-size: 13px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary-2);
  margin-bottom: 14px;
}
body.lang-ar .kicker { letter-spacing: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 18px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  backdrop-filter: blur(8px);
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

/* ═══════════ HEADER ═══════════ */
.site-header {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  background: rgba(7, 13, 26, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 20px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-head); font-size: 20px; font-weight: 500; white-space: nowrap; }
.brand-name b { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
body.lang-ar .brand-sub { letter-spacing: 0.04em; }

.main-nav { display: flex; gap: 22px; }
.main-nav a { font-size: 14px; font-weight: 500; color: var(--muted); transition: color 0.2s; position: relative; padding: 6px 0; white-space: nowrap; }
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.main-nav a::after {
  content: ''; position: absolute; bottom: 0; inset-inline-start: 0;
  width: 0; height: 2px; border-radius: 2px; background: var(--grad); transition: width 0.25s ease;
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 14px; }

/* Language switcher */
.lang-switch { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); padding: 9px 15px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: background 0.2s;
}
.lang-btn:hover { background: var(--surface-2); }
.lang-btn svg { width: 15px; height: 15px; color: var(--primary-2); }
.lang-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
  background: #0D1730; border: 1px solid var(--border); border-radius: 14px;
  padding: 8px; min-width: 150px; display: none; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-lg); z-index: 60;
}
.lang-switch.open .lang-menu { display: flex; }
.lang-menu a { padding: 9px 14px; border-radius: 9px; font-size: 14px; color: var(--muted); transition: background 0.15s, color 0.15s; }
.lang-menu a:hover { background: var(--surface-2); color: var(--text); }
.lang-menu a.active { color: var(--primary-2); font-weight: 700; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════ HERO ═══════════ */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: calc(var(--header-h) + 40px) 0 90px; overflow: hidden; }

.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; }
.orb-1 { width: 480px; height: 480px; background: rgba(91, 95, 239, 0.35); top: -140px; inset-inline-start: -120px; animation: drift 14s ease-in-out infinite alternate; }
.orb-2 { width: 420px; height: 420px; background: rgba(34, 211, 238, 0.22); bottom: -160px; inset-inline-end: -100px; animation: drift 18s ease-in-out infinite alternate-reverse; }
.orb-3 { width: 260px; height: 260px; background: rgba(245, 185, 66, 0.14); top: 40%; inset-inline-start: 55%; animation: drift 16s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(50px, 36px) scale(1.08); } }

.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 75%);
}

/* Slider */
.slider { position: relative; }
.slide {
  display: none; grid-template-columns: 1.05fr 0.95fr; gap: 50px; align-items: center;
}
.slide.active { display: grid; }
.slide-content > * { opacity: 0; transform: translateY(22px); animation: slideIn 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
.slide-content > *:nth-child(2) { animation-delay: 0.1s; }
.slide-content > *:nth-child(3) { animation-delay: 0.2s; }
.slide-content > *:nth-child(4) { animation-delay: 0.3s; }
@keyframes slideIn { to { opacity: 1; transform: translateY(0); } }

.slide-title {
  font-size: clamp(34px, 5vw, 58px); font-weight: 700; margin: 22px 0 18px;
  background: linear-gradient(120deg, #FFFFFF 30%, #A5B4FC 75%, #67E8F9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.slide-text { font-size: clamp(16px, 1.6vw, 18.5px); color: var(--muted); max-width: 540px; margin-bottom: 32px; }
.slide-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.slide-art { position: relative; }
.slide-art img { width: 100%; height: auto; animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

.slider-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 44px; }
.slider-arrow {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; font-size: 15px; transition: background 0.2s, transform 0.2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.slider-arrow:hover { background: var(--surface-2); transform: scale(1.08); }
.slider-dots { display: flex; gap: 9px; }
.dot { width: 9px; height: 9px; border-radius: 999px; border: 0; background: rgba(255,255,255,0.22); cursor: pointer; transition: width 0.3s, background 0.3s; padding: 0; }
.dot.active { width: 30px; background: var(--grad); }

.hero-scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
body.lang-ar .hero-scroll { letter-spacing: 0.02em; }
.scroll-line { width: 1.5px; height: 34px; background: linear-gradient(var(--primary-2), transparent); animation: scrollPulse 1.8s ease-in-out infinite; }
@keyframes scrollPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ═══════════ STATS ═══════════ */
.stats { border-block: 1px solid var(--border); background: var(--bg-alt); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 44px 0; }
.stat { text-align: center; }
.stat-num, .stat-plus {
  font-family: var(--font-head); font-size: clamp(32px, 4vw, 46px); font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }

/* ═══════════ SECTIONS ═══════════ */
.section { padding: 110px 0; position: relative; }
.section-dark { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section-head { max-width: 680px; margin: 0 auto 60px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 700; margin-bottom: 16px; }
.section-head p { color: var(--muted); font-size: 17px; }

/* Cards */
.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.industries-grid { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 26px; transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 3px;
  background: var(--grad); opacity: 0; transition: opacity 0.25s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(91, 95, 239, 0.45); background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card h3 { font-size: 18.5px; margin: 18px 0 10px; }
.card p { color: var(--muted); font-size: 14.5px; }

.card-icon {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: rgba(91, 95, 239, 0.14); color: #8B8FF7; flex: none;
}
.card-icon svg { width: 26px; height: 26px; }
.card-icon.gold { background: rgba(245, 185, 66, 0.12); color: var(--gold); }

/* Split (spotlight) sections */
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }
.split-text h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; margin-bottom: 16px; }
.split-text .lead { color: var(--muted); font-size: 17px; margin-bottom: 26px; }
.split-text > p { color: var(--muted); margin-bottom: 16px; }
.split-art img { width: 100%; height: auto; }
.kicker-light { color: var(--gold); }

.check-list { display: grid; gap: 13px; margin: 0 0 32px; }
.check-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 15.5px; }
.check-ic {
  width: 24px; height: 24px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: rgba(52, 211, 153, 0.14); color: var(--green); margin-top: 1px;
}
.check-ic svg { width: 13px; height: 13px; }

/* ═══════════ API SECTION ═══════════ */
.api-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.api-blocks { display: grid; gap: 22px; justify-items: start; }
.api-block {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; width: 100%;
  transition: transform 0.25s, border-color 0.25s;
}
.api-block:hover { transform: translateY(-4px); border-color: rgba(34, 211, 238, 0.4); }
.api-block h3 { font-size: 17.5px; margin-bottom: 8px; }
.api-block p { color: var(--muted); font-size: 14.5px; }

.code-window {
  background: #0A1122; border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.code-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.code-bar i { width: 11px; height: 11px; border-radius: 50%; background: #F87171; }
.code-bar i:nth-child(2) { background: var(--gold); }
.code-bar i:nth-child(3) { background: var(--green); }
.code-bar span { margin-inline-start: 10px; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.code-window pre { padding: 22px; overflow-x: auto; }
.code-window code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; line-height: 1.75; color: #C9D4EA; }
.c-k { color: #8B8FF7; } .c-s { color: #67E8F9; } .c-a { color: #A5B4FC; }
.c-g { color: #6EE7B7; } .c-n { color: #FBBF24; } .c-p { color: #64748B; }

.api-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.api-chips span {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 14px;
}

/* ═══════════ HOSTING ART ═══════════ */
.hosting-art { position: relative; display: grid; justify-items: center; }
.server-stack { display: grid; gap: 12px; width: min(360px, 100%); }
.server-unit {
  height: 64px; background: #0E1830; border: 1px solid var(--border); border-radius: 14px;
  display: flex; align-items: center; gap: 10px; padding: 0 22px; position: relative;
}
.server-unit i { position: absolute; inset-inline-end: 20px; width: 90px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); }
.led { width: 9px; height: 9px; border-radius: 50%; }
.led-g { background: var(--green); box-shadow: 0 0 9px var(--green); animation: blink 2.2s infinite; }
.led-b { background: var(--primary-2); box-shadow: 0 0 9px var(--primary-2); animation: blink 3.1s infinite 0.4s; }
.led-y { background: var(--gold); box-shadow: 0 0 9px var(--gold); animation: blink 2.7s infinite 0.9s; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.uptime-card {
  margin-top: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 28px; text-align: center; width: min(360px, 100%);
}
.uptime-card strong { font-family: var(--font-head); font-size: 30px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.uptime-card > span { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 2px; }
.uptime-bars { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.uptime-bars i { width: 14px; height: 26px; border-radius: 4px; background: rgba(52, 211, 153, 0.75); }
.uptime-bars i:nth-child(7) { background: rgba(245, 185, 66, 0.8); }

/* ═══════════ ABOUT / FAMILY ═══════════ */
.brand-family { display: grid; gap: 16px; }
.family-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 26px; transition: transform 0.22s, border-color 0.22s;
}
.family-card:hover { transform: translateX(6px); border-color: rgba(91, 95, 239, 0.45); }
[dir="rtl"] .family-card:hover { transform: translateX(-6px); }
.family-card strong { font-family: var(--font-head); font-size: 17px; }
.family-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--primary)); box-shadow: 0 0 12px var(--c, var(--primary)); }
.family-role { color: var(--muted); font-size: 13px; }
.family-card.is-current { border-style: dashed; border-color: rgba(245, 185, 66, 0.45); }

/* ═══════════ CONTACT ═══════════ */
.section-contact { background: var(--bg-alt); border-top: 1px solid var(--border); }
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }

.contact-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 38px; display: grid; gap: 20px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-form label { display: grid; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.contact-form input, .contact-form select, .contact-form textarea {
  background: rgba(7, 13, 26, 0.6); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 16px; color: var(--text); font-family: var(--font-body); font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 95, 239, 0.2);
}
.contact-form select option { background: #0D1730; }
.hp-field { position: absolute !important; opacity: 0; pointer-events: none; height: 0; }

.form-feedback { font-size: 14.5px; display: none; }
.form-feedback.ok { display: block; color: var(--green); }
.form-feedback.err { display: block; color: #F87171; }

.contact-aside {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 34px 30px; position: sticky; top: calc(var(--header-h) + 20px);
}
.contact-aside h3 { font-size: 19px; margin-bottom: 22px; }
.contact-list { display: grid; gap: 20px; }
.contact-list li { display: flex; gap: 15px; align-items: flex-start; }
.contact-list small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 2px; }
body.lang-ar .contact-list small { letter-spacing: 0.02em; }
.contact-list a, .contact-list div > span { font-size: 15px; font-weight: 500; }
.contact-list a:hover { color: var(--primary-2); }
.ci {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: rgba(34, 211, 238, 0.1); color: var(--primary-2);
  display: grid; place-items: center;
}
.ci svg { width: 20px; height: 20px; }
.aside-family { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.aside-family a { color: var(--muted); font-size: 14px; }
.aside-family a:hover { color: var(--primary-2); }

/* ═══════════ FOOTER ═══════════ */
.site-footer { border-top: 1px solid var(--border); background: #060B16; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding: 70px 0 50px; }
.footer-brand p { color: var(--muted); font-size: 14.5px; margin-top: 18px; max-width: 320px; }
.site-footer h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text); margin-bottom: 18px; }
body.lang-ar .site-footer h4 { letter-spacing: 0.02em; }
.site-footer ul { display: grid; gap: 11px; }
.site-footer ul a { color: var(--muted); font-size: 14.5px; transition: color 0.2s; }
.site-footer ul a:hover { color: var(--primary-2); }

.footer-bottom { border-top: 1px solid var(--border); padding: 22px 0; }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-bottom span { color: var(--muted); font-size: 13.5px; }
.footer-langs { display: flex; gap: 16px; }
.footer-langs a { color: var(--muted); font-size: 13.5px; }
.footer-langs a.active, .footer-langs a:hover { color: var(--text); }

/* ═══════════ AGENT WIDGET ═══════════ */
.agent { position: fixed; bottom: 26px; inset-inline-end: 26px; z-index: 200; }

.agent-toggle {
  width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; position: relative;
  box-shadow: 0 14px 34px -8px rgba(59, 130, 246, 0.65);
  display: grid; place-items: center; transition: transform 0.2s;
}
.agent-toggle:hover { transform: scale(1.07); }
.agent-toggle svg { width: 27px; height: 27px; }
.agent-ic-close { display: none; }
.agent.open .agent-ic-close { display: block; }
.agent.open .agent-ic-chat { display: none; }
.agent-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.6); animation: pulse 2.2s ease-out infinite;
}
.agent.open .agent-pulse { display: none; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.55); opacity: 0; } }

.agent-panel {
  position: absolute; bottom: 80px; inset-inline-end: 0;
  width: min(380px, calc(100vw - 40px)); height: 520px; max-height: calc(100vh - 140px);
  background: #0C1528; border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden;
  transform-origin: bottom right;
}
[dir="rtl"] .agent-panel { transform-origin: bottom left; }
.agent.open .agent-panel { display: flex; animation: panelIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes panelIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.agent-head {
  display: flex; align-items: center; gap: 13px; padding: 18px 20px;
  background: rgba(91, 95, 239, 0.1); border-bottom: 1px solid var(--border);
}
.agent-head img { width: 40px; height: 40px; border-radius: 12px; }
.agent-head strong { display: block; font-family: var(--font-head); font-size: 15.5px; }
.agent-head span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.agent-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.agent-body::-webkit-scrollbar { width: 5px; }
.agent-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.msg { max-width: 85%; padding: 11px 15px; border-radius: 16px; font-size: 14px; line-height: 1.55; animation: msgIn 0.25s ease; white-space: pre-wrap; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.msg-bot { background: var(--surface-2); border: 1px solid var(--border); border-start-start-radius: 4px; align-self: flex-start; }
.msg-user { background: var(--grad); color: #fff; border-start-end-radius: 4px; align-self: flex-end; }

.msg-options { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 100%; }
.msg-options button {
  background: rgba(91, 95, 239, 0.12); border: 1px solid rgba(91, 95, 239, 0.45); color: #B8BCFA;
  border-radius: 999px; padding: 8px 15px; font-size: 13px; cursor: pointer; font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}
.msg-options button:hover { background: rgba(91, 95, 239, 0.3); color: #fff; }

.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

.agent-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.agent-input input {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 12px 18px; color: var(--text); font-size: 14px; font-family: var(--font-body);
}
.agent-input input:focus { outline: none; border-color: var(--primary); }
.agent-input button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; display: grid; place-items: center; flex: none;
  transition: transform 0.15s;
}
.agent-input button:hover { transform: scale(1.08); }
.agent-input button svg { width: 18px; height: 18px; }
[dir="rtl"] .agent-input button svg { transform: scaleX(-1); }

/* ═══════════ REVEAL ANIMATIONS ═══════════ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ═══════════ RESPONSIVE ═══════════ */
/* Nav collapses earlier than the grids: FR/ES labels are long, and the
   header must never wrap. */
@media (max-width: 1140px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .main-nav.open {
    display: flex; position: fixed; inset: var(--header-h) 0 auto; flex-direction: column;
    background: rgba(7, 13, 26, 0.97); backdrop-filter: blur(18px);
    padding: 24px 6%; gap: 4px; border-bottom: 1px solid var(--border); z-index: 90;
  }
  .main-nav.open a { padding: 13px 4px; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,0.05); }
}

@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .industries-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .api-grid { grid-template-columns: 1fr; gap: 44px; }
  .split-reverse .split-art { order: 2; }
  .slide { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .slide-text { margin-inline: auto; }
  .slide-actions { justify-content: center; }
  .slide-art { max-width: 470px; margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .section { padding: 76px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 12px; padding: 36px 0; }
  .cards-grid, .industries-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-form { padding: 26px 20px; }
  .contact-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; padding: 50px 0 36px; }
  .header-cta { display: none; }
  .brand-sub { display: none; }
  .hero { padding-bottom: 70px; }
  .hero-scroll { display: none; }
  .agent { bottom: 18px; inset-inline-end: 18px; }
  .agent-panel { height: 480px; }
}
