@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Cairo:wght@400;600;700;800&display=swap');

:root {
  --bg: #050505;
  --bg-alt: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #18181b;
  --text-main: #fcfcfc;
  --text-muted: #a1a1aa;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-glow: rgba(14, 165, 233, .15);
  --accent-soft: rgba(14, 165, 233, .08);
  --border: #27272a;
  --border-light: #3f3f46;
  --nav-h: 80px;
  --radius: 16px;
  --radius-sm: 8px;
  --green: #22c55e;
  --yellow: #fbbf24;
  --blue: #0ea5e9;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: font-family .3s;
  position: relative;
}

body[dir="rtl"] {
  font-family: 'Cairo', sans-serif;
}

/* ── SCROLL PROGRESS BAR ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  transform-origin: left;
  transform: scaleX(var(--scroll-pct, 0));
  z-index: 1001;
  transition: transform .1s ease-out;
}

/* ── FLOATING PARTICLES ── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
}

.particle:nth-child(odd) {
  background: #38bdf8;
}

.particle.particle-sm {
  width: 2px;
  height: 2px;
  opacity: 0.25;
}

@keyframes particle-float {

  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(8px, -12px);
  }

  50% {
    transform: translate(-6px, 6px);
  }

  75% {
    transform: translate(10px, 8px);
  }
}

/* ── CONFETTI (surprise) ── */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10003;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confetti-fall 2.5s ease-out forwards;
}

.confetti.confetti-rect {
  width: 8px;
  height: 6px;
  border-radius: 1px;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* ── ANIMATED BACKGROUND ORBS ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform;
}

.bg-orb-1 {
  width: min(80vw, 600px);
  height: min(80vw, 600px);
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -20%;
  left: -10%;
  animation: orb-float 25s ease-in-out infinite;
}

.bg-orb-2 {
  width: min(60vw, 450px);
  height: min(60vw, 450px);
  background: radial-gradient(circle, rgba(14, 165, 233, 0.4) 0%, transparent 70%);
  top: 30%;
  right: -15%;
  animation: orb-float 30s ease-in-out infinite reverse;
}

.bg-orb-3 {
  width: min(50vw, 380px);
  height: min(50vw, 380px);
  background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, transparent 70%);
  bottom: -10%;
  left: 20%;
  animation: orb-float 22s ease-in-out infinite 2s;
}

.bg-orb-4 {
  width: min(40vw, 280px);
  height: min(40vw, 280px);
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
  top: 60%;
  left: 50%;
  animation: orb-float 28s ease-in-out infinite 1s reverse;
}

@keyframes orb-float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(5%, -8%) scale(1.05);
  }

  50% {
    transform: translate(-5%, 5%) scale(0.98);
  }

  75% {
    transform: translate(8%, 3%) scale(1.02);
  }
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img,
video,
iframe {
  max-width: 100%;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.125rem;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Reveal / scroll-in animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.fade-right {
  transform: translateX(-24px) translateY(0);
}

.reveal.fade-right.visible {
  transform: translateX(0) translateY(0);
}

.reveal.fade-left {
  transform: translateX(24px) translateY(0);
}

.reveal.fade-left.visible {
  transform: translateX(0) translateY(0);
}

.delay-100 {
  transition-delay: .1s;
}

.delay-200 {
  transition-delay: .2s;
}

.delay-300 {
  transition-delay: .3s;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all .3s ease;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, .05);
  transform: translateY(-2px);
}

.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(90deg, var(--accent), #38bdf8, var(--accent));
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: btn-shine 3s linear infinite;
}

.btn-shine:hover::before {
  animation-duration: 1.5s;
}

@keyframes btn-shine {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: rgba(14, 165, 233, .1);
  color: var(--accent);
  border: 1px solid rgba(14, 165, 233, .2);
}

/* Trust Strip */
.trust-strip {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 12px;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-h);
  background: rgba(5, 5, 5, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .2s;
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Language Toggle */
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ── HERO ── */
.hero {
  padding-top: calc(var(--nav-h) + 80px);
  padding-bottom: 80px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 64px;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 24px 0;
  background: linear-gradient(120deg, #fff 0%, #e0f2fe 30%, #fff 50%, #bae6fd 70%, #fff 100%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: hero-title-shine 8s ease-in-out infinite;
}

@keyframes hero-title-shine {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 600px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
  height: 500px;
  width: 100%;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--bg-card), var(--bg));
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .4);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: .5;
}

.hero-dashboard-mock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hero-mock-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  color: var(--accent);
  opacity: 0.9;
}

.hero-mock-bar,
.hero-mock-panel {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.5;
}

.hero-mock-bar {
  animation: mock-pulse 2.5s ease-in-out infinite;
}

.hero-mock-bar.hero-mock-delay-1 {
  animation-delay: 0.4s;
}

.hero-mock-bar.hero-mock-delay-2 {
  animation-delay: 0.8s;
}

.hero-mock-panel {
  animation: mock-glow 3s ease-in-out infinite;
}

.hero-mock-panel.hero-mock-delay-1 {
  animation-delay: 0.5s;
}

.hero-mock-dot {
  fill: var(--accent);
  opacity: 0.8;
  animation: mock-blink 1.2s ease-in-out infinite;
}

.hero-mock-dot.hero-mock-delay-1 {
  animation-delay: 0.3s;
}

.hero-mock-dot.hero-mock-delay-2 {
  animation-delay: 0.6s;
}

@keyframes mock-pulse {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.8;
  }
}

@keyframes mock-glow {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.6;
  }
}

@keyframes mock-blink {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.floating-info {
  position: absolute;
  bottom: -20px;
  left: -20px;
  background: rgba(17, 17, 17, .6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  max-width: 320px;
  animation: float 6s ease-in-out infinite;
}

.floating-info h4 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--accent);
}

.floating-info p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

@keyframes drift {

  0%,
  100% {
    transform: translate(0, 0) rotate(var(--rot));
  }

  50% {
    transform: translate(10px, -15px) rotate(calc(var(--rot) + 5deg));
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.hero-line {
  position: absolute;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  border-radius: 2px;
}

.hero-line-1 {
  --rot: 45deg;
  width: 200px;
  top: 30%;
  left: 20%;
  animation: drift 8s ease-in-out infinite;
}

.hero-line-2 {
  --rot: -30deg;
  width: 150px;
  background: #fff;
  opacity: 0.2;
  bottom: 40%;
  right: 20%;
  animation: drift 10s ease-in-out infinite reverse;
}

.hero-circle {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  top: 20%;
  right: 30%;
  animation: pulse 6s ease-in-out infinite;
}

.hero-illustration {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 0 32px rgba(14, 165, 233, .25));
  transition: filter .3s;
}

.hero-illustration:hover {
  filter: drop-shadow(0 0 48px rgba(14, 165, 233, .45));
}

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-text h2 {
  font-size: 2.5rem;
  margin-bottom: 24px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.about-text p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 24px;
}

.about-highlights {
  display: grid;
  gap: 16px;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.highlight-icon {
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
}

.highlight-content h4 {
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.highlight-content p {
  font-size: .875rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── SERVICES ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px 24px;
  border-radius: var(--radius);
  transition: transform .4s ease, box-shadow .4s ease, border-color .3s;
  transform-style: preserve-3d;
}

.service-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-6px) perspective(800px) rotateX(2deg) rotateY(var(--card-tilt-y, 0deg));
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}

.service-icon {
  width: 48px;
  height: 48px;
  background: rgba(14, 165, 233, .1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-muted);
  font-size: .9375rem;
}

.service-img-wrap {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
  background: rgba(14, 165, 233, .05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-img-wrap.service-motion-wrap {
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg-card) 100%);
}

.service-motion {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.service-motion svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 140px;
}

.service-motion-website .motion-bar {
  fill: var(--accent);
  opacity: 0.5;
  animation: svc-fade 2s ease-in-out infinite;
}

.service-motion-website .motion-block {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.6;
}

.service-motion-website .motion-block.motion-d1 {
  animation: svc-pulse 2.2s ease-in-out infinite;
}

.service-motion-website .motion-block.motion-d2 {
  animation: svc-pulse 2.2s ease-in-out infinite 0.3s;
}

.service-motion-website .motion-block.motion-d3 {
  animation: svc-pulse 2.2s ease-in-out infinite 0.6s;
}

.service-motion-website .motion-footer {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.4;
  animation: svc-fade 2.5s ease-in-out infinite 0.5s;
}

.service-motion-apps .motion-bar,
.service-motion-apps .motion-footer {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.5;
}

.service-motion-apps .motion-icon {
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
  animation: svc-pulse 2s ease-in-out infinite;
}

.service-motion-apps .motion-block {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.5;
}

.service-motion-apps .motion-block.motion-d2 {
  animation: svc-slide 2.5s ease-in-out infinite;
}

.service-motion-apps .motion-block.motion-d3 {
  animation: svc-slide 2.5s ease-in-out infinite 0.4s;
}

.service-motion-store .motion-cart {
  animation: svc-float 4s ease-in-out infinite;
}

.service-motion-store .motion-dot {
  fill: var(--accent);
  opacity: 0.7;
}

.service-motion-store .motion-dot.motion-d1 {
  animation: svc-bounce 1.5s ease-in-out infinite;
}

.service-motion-store .motion-dot.motion-d2 {
  animation: svc-bounce 1.5s ease-in-out infinite 0.2s;
}

.service-motion-store .motion-dot.motion-d3 {
  animation: svc-bounce 1.5s ease-in-out infinite 0.4s;
}

.service-motion-store .motion-box {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.5;
}

.service-motion-store .motion-box.motion-d2 {
  animation: svc-pulse 2s ease-in-out infinite 0.2s;
}

.service-motion-store .motion-box.motion-d3 {
  animation: svc-pulse 2s ease-in-out infinite 0.5s;
}

.service-motion-inventory .motion-crate {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.6;
}

.service-motion-inventory .motion-crate.motion-d1 {
  animation: svc-stack 2.5s ease-in-out infinite;
}

.service-motion-inventory .motion-crate.motion-d2 {
  animation: svc-stack 2.5s ease-in-out infinite 0.25s;
}

.service-motion-inventory .motion-crate.motion-d3 {
  animation: svc-stack 2.5s ease-in-out infinite 0.5s;
}

.service-motion-inventory .motion-line {
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.5;
  stroke-dasharray: 4 4;
  animation: svc-line 1.5s linear infinite;
}

.service-motion-inventory .motion-line.motion-d1 {
  animation-delay: 0s;
}

.service-motion-inventory .motion-line.motion-d2 {
  animation-delay: 0.3s;
}

.service-motion-inventory .motion-line.motion-d3 {
  animation-delay: 0.6s;
}

.service-motion-inventory .motion-scan {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.8;
  animation: svc-scan 2s ease-in-out infinite;
}

@keyframes svc-fade {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.8;
  }
}

@keyframes svc-pulse {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.02);
  }
}

@keyframes svc-slide {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.8;
  }
}

@keyframes svc-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes svc-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes svc-stack {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.9;
  }
}

@keyframes svc-line {
  0% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: 16;
  }
}

@keyframes svc-scan {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.service-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.service-card:hover .service-card-img {
  transform: scale(1.05);
}

/* ── PROJECTS ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .4s ease, box-shadow .4s ease, border-color .3s;
  transform-style: preserve-3d;
}

.project-card:hover {
  border-color: var(--border-light);
  transform: translateY(-6px) perspective(800px) rotateX(2deg) rotateY(var(--card-tilt-y, 0deg));
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}

.project-card-media {
  position: relative;
  height: 200px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(5, 5, 5, .7) 100%);
  pointer-events: none;
}

.project-card-media-1 {
  background: linear-gradient(135deg, var(--bg-alt) 0%, rgba(14, 165, 233, .12) 100%);
}

.project-card-media-2 {
  background: linear-gradient(135deg, var(--bg-alt) 0%, rgba(14, 165, 233, .08) 100%);
}

.project-card-media-3 {
  background: linear-gradient(135deg, var(--bg-alt) 0%, rgba(14, 165, 233, .1) 100%);
}

.project-card-media-4 {
  background: linear-gradient(135deg, var(--bg-alt) 0%, rgba(14, 165, 233, .06) 100%);
}

.project-motion {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.project-motion svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 180px;
  color: var(--accent);
}

.project-motion svg path,
.project-motion svg polygon {
  transform-box: fill-box;
  transform-origin: center;
}

.proj-robot {
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
  opacity: 0.7;
  animation: proj-rotate 8s linear infinite;
}

.proj-dot {
  fill: var(--accent);
  opacity: 0.9;
  animation: proj-blink 1.5s ease-in-out infinite;
}

.proj-path {
  stroke-dasharray: 8 8;
  animation: proj-dash 4s linear infinite;
}

.proj-sync-a,
.proj-sync-b {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.6;
}

.proj-sync-a {
  animation: proj-rotate 6s linear infinite;
}

.proj-sync-b {
  animation: proj-rotate 6s linear infinite reverse;
}

.proj-arrow {
  stroke: var(--accent);
  stroke-width: 1;
  fill: var(--accent);
  opacity: 0.7;
  animation: proj-flow 2s ease-in-out infinite;
}

.proj-pin {
  animation: proj-pulse 2s ease-in-out infinite;
}

.proj-pulse {
  stroke: var(--accent);
  animation: proj-ring 2s ease-out infinite;
}

.proj-route {
  stroke-dasharray: 6 6;
  animation: proj-dash 3s linear infinite;
}

.proj-cloud {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.5;
}

.proj-cloud-2 {
  animation: proj-float 5s ease-in-out infinite 0.5s;
}

.proj-cloud-3 {
  animation: proj-float 5s ease-in-out infinite 1s;
}

.proj-node {
  fill: var(--accent);
  opacity: 0.8;
}

.proj-node-d1 {
  animation: proj-blink 1.2s ease-in-out infinite;
}

.proj-node-d2 {
  animation: proj-blink 1.2s ease-in-out infinite 0.4s;
}

.proj-conn {
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.5;
  stroke-dasharray: 4 4;
  animation: proj-dash 2s linear infinite;
}

@keyframes proj-rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes proj-dash {
  0% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: 32;
  }
}

@keyframes proj-blink {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

@keyframes proj-flow {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

@keyframes proj-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

@keyframes proj-ring {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes proj-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.project-card-body {
  padding: 28px 32px;
}

.project-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.project-card-h3 {
  font-size: 1.35rem;
  margin: 0 0 12px;
  line-height: 1.3;
}

.project-card-p {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.6;
  margin: 0;
}

.project-content {
  padding: 32px;
}

/* ── TRUST ── */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.trust-card {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .3s ease;
}

.trust-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
}

.trust-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 12px;
}

.trust-card h4 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.trust-card p {
  color: var(--text-muted);
  font-size: .9375rem;
}

/* ── CODE BG SECTION ── */
#code-bg-section {
  padding: 0;
  position: relative;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030303;
}

#code-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  font-size: .85rem;
  color: rgba(14, 165, 233, .5);
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  z-index: 1;
  padding: 30px;
  user-select: none;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 90%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 90%);
}

.code-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(5, 5, 5, .7) 0%, rgba(5, 5, 5, .95) 100%);
  z-index: 2;
  pointer-events: none;
}

.code-content {
  position: relative;
  z-index: 3;
  text-align: center;
}

/* ── REVIEWS ── */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color .3s;
}

.review-card:hover {
  border-color: var(--border-light);
}

.review-stars-display {
  color: var(--yellow);
  font-size: 1.125rem;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.review-text {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
  font-style: italic;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.review-avatar {
  width: 48px;
  height: 48px;
  background: var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.125rem;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: 1rem;
  margin: 0;
}

.author-info p {
  color: var(--text-muted);
  font-size: .8125rem;
  margin: 0;
}

/* ── OVERALL RATING BAR ── */
.overall-rating {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-bottom: 48px;
}

.overall-rating .big-score {
  font-size: 5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.overall-rating .big-stars {
  font-size: 2rem;
  color: var(--yellow);
  letter-spacing: 4px;
  margin: 12px 0;
}

.overall-rating .score-label {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── REVIEW FORM ── */
.review-form-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 700px;
  margin: 0 auto;
}

.review-form-box h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.review-form-box p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.star-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.star-picker span {
  font-size: 2rem;
  cursor: pointer;
  color: var(--border-light);
  transition: color .15s, transform .15s;
}

.star-picker span:hover,
.star-picker span.active {
  color: var(--yellow);
  transform: scale(1.2);
}

.form-group {
  margin-bottom: 20px;
}

.form-control {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color .3s;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

.submit-btn-full {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
}

/* ── CONTACT ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: stretch;
}

.contact-info {
  padding-right: 32px;
}

.contact-info h2 {
  font-size: 2.5rem;
  margin-bottom: 24px;
  letter-spacing: -.02em;
}

.contact-info p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 40px;
}

.contact-details {
  margin-bottom: 48px;
}

.contact-detail-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, .05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.detail-text h4 {
  font-size: 1rem;
  margin: 0 0 4px 0;
}

.detail-text p {
  margin: 0;
  font-size: .9375rem;
  color: var(--text-muted);
}

.contact-form-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-alt);
  font-size: .875rem;
}

.footer-logo {
  justify-content: center;
  margin-bottom: 24px;
  color: var(--text-main);
}

/* ── CHAT WIDGET ── */
#chat-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border: none;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(14, 165, 233, .5), inset 0 0 10px rgba(255, 255, 255, .3);
  transition: transform .4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .4s;
}

#chat-toggle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  z-index: -1;
  filter: blur(10px);
  opacity: 0.6;
  animation: spin 4s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

#chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(14, 165, 233, .8), inset 0 0 15px rgba(255, 255, 255, .5);
}

#chat-toggle svg {
  width: 32px;
  height: 32px;
  fill: #fff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#chat-window {
  position: fixed;
  bottom: 110px;
  right: 32px;
  width: 380px;
  height: 550px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px rgba(14, 165, 233, 0.2) inset;
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  transform: scale(.8) translateY(40px);
  opacity: 0;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), opacity .3s;
}

#chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.chat-header {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(3, 105, 161, 0.15));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
}

.chat-avatar::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), transparent);
  animation: spin 3s linear infinite;
}

.chat-avatar svg {
  position: relative;
  z-index: 2;
  width: 24px;
  height: 24px;
  fill: var(--accent);
}

.chat-header-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0.5px;
}

.chat-header-info p {
  font-size: .75rem;
  color: rgba(255, 255, 255, .6);
  margin: 2px 0 0 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chat-header .online-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  animation: pulse-dot 2s infinite;
  box-shadow: 0 0 8px #10b981;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .3;
  }
}

.chat-close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.05);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.msg {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: .95rem;
  line-height: 1.5;
  animation: msg-in .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: none scale(1);
  }
}

.msg.bot {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-top-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.msg.user {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #fff;
  border-top-right-radius: 4px;
  align-self: flex-end;
}

.chat-typing {
  display: none;
  align-self: flex-start;
}

.chat-typing.show {
  display: flex;
}

.typing-bubble {
  background: rgba(255, 255, 255, 0.05);
  padding: 14px 18px;
  border-radius: 18px;
  border-top-left-radius: 4px;
  display: flex;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce .9s infinite;
}

.typing-bubble span:nth-child(2) {
  animation-delay: .15s;
}

.typing-bubble span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.chat-input-row {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 14px 18px;
  border-radius: 24px;
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .3s, background .3s;
}

.chat-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.chat-send {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.chat-send:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.6);
}

.chat-send svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/* RTL fixes */
body[dir="rtl"] .floating-info {
  left: auto;
  right: -20px;
}

body[dir="rtl"] .contact-info {
  padding-right: 0;
  padding-left: 32px;
}

body[dir="rtl"] #chat-toggle,
body[dir="rtl"] #chat-window {
  right: auto;
  left: 32px;
}

body[dir="rtl"] .msg.user {
  align-self: flex-start;
  border-bottom-right-radius: 18px;
  border-bottom-left-radius: 4px;
}

body[dir="rtl"] .msg.bot {
  align-self: flex-end;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 4px;
}

/* ── MINI GAME ── */
.game-launcher {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 9996;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-alt));
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.game-launcher:hover {
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(14, 165, 233, .25);
}

.game-launcher-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.game-launcher-label {
  letter-spacing: .02em;
}

body[dir="rtl"] .game-launcher {
  left: auto;
  right: 32px;
}

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

.game-modal.open {
  opacity: 1;
  visibility: visible;
}

.game-modal-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
  overflow: hidden;
  max-width: 520px;
  width: 100%;
  transform: scale(0.95);
  transition: transform .3s;
}

.game-modal.open .game-modal-inner {
  transform: scale(1);
}

.game-header {
  position: relative;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.game-title {
  font-size: 1.5rem;
  margin: 0 0 6px 0;
  color: var(--text-main);
}

.game-tagline {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0 0 14px 0;
}

.game-stats {
  display: flex;
  gap: 24px;
}

.game-score,
.game-lives {
  font-size: .9rem;
  color: var(--text-muted);
}

.game-score strong,
.game-lives strong {
  color: var(--accent);
}

.game-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color .2s, background .2s;
}

.game-close:hover {
  color: var(--text-main);
  background: var(--border);
}

.game-canvas-wrap {
  position: relative;
  padding: 16px;
  background: var(--bg);
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
}

.game-overlay {
  position: absolute;
  inset: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(5, 5, 5, .9);
  border-radius: var(--radius-sm);
  color: var(--text-main);
}

.game-overlay p {
  margin: 0;
  font-size: 1.25rem;
}

.game-overlay.hidden {
  display: none;
}

.game-over-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.game-over-score {
  font-size: 1.1rem;
}

.game-start-btn {
  min-width: 160px;
}

body[dir="rtl"] .game-close {
  right: auto;
  left: 16px;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--accent);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 9996;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s, visibility .3s, background .2s;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body[dir="rtl"] .back-to-top {
  right: auto;
  left: 32px;
}

/* Notification Toast */
.toast {
  position: fixed;
  bottom: 110px;
  right: 32px;
  background: var(--bg-card);
  border: 1px solid var(--green);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: .9rem;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
  transform: translateY(20px);
  opacity: 0;
  transition: all .4s;
  pointer-events: none;
}

.toast.show {
  transform: none;
  opacity: 1;
}

.toast.error {
  border-color: #ef4444;
}

/* Responsive */
@media(max-width:1024px) {

  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-content {
    text-align: center;
    margin: 0 auto;
  }

  .hero-actions,
  .hero-stats {
    justify-content: center;
  }

  .floating-info {
    left: 20px;
    right: 20px;
    bottom: 20px;
    max-width: none;
  }

  .contact-info {
    padding-right: 0;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .logo {
    font-size: 1.2rem;
    gap: 8px;
  }

  .lang-btn {
    padding: 6px 10px;
    font-size: .75rem;
  }

  .nav-right {
    gap: 10px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px;
    gap: 18px;
    text-align: center;
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .floating-ad,
  .game-launcher {
    display: none !important;
  }
}

@media(max-width:768px) {
  .section {
    padding: 64px 0;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .contact-form-box {
    padding: 32px 24px;
  }

  #chat-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 88px;
  }

  body[dir="rtl"] #chat-window {
    left: 16px;
    right: auto;
  }

  #chat-toggle {
    right: 16px;
    bottom: 16px;
  }

  body[dir="rtl"] #chat-toggle {
    left: 16px;
    right: auto;
  }

  .back-to-top {
    right: 16px;
    bottom: 92px;
    width: 42px;
    height: 42px;
  }

  body[dir="rtl"] .back-to-top {
    left: 16px;
    right: auto;
  }

  .hero-visual {
    height: 380px;
  }

  .project-card-media {
    height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition-duration: .2s;
  }

  .bg-orb,
  .hero-mock-svg *,
  .service-motion *,
  .project-motion *,
  .floating-info {
    animation: none !important;
  }

  .hero-content h1 {
    animation: none;
    color: var(--text-main);
    background: none;
  }

  .btn-shine::before {
    animation: none;
  }

  .bg-orbs {
    opacity: 0.5;
  }
}

/* ── FLOATING AD FLYER ── */
.floating-ad {
  position: fixed;
  top: 100px;
  right: 32px;
  z-index: 10001;
  width: 340px;
  opacity: 0;
  transform: translateY(-50px) scale(0.9);
  animation: ad-slide-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 2s;
}

@keyframes ad-slide-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ad-inner {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(14, 165, 233, 0.1);
  overflow: hidden;
}

.ad-inner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(14, 165, 233, 0.2), transparent 30%);
  animation: spin 10s linear infinite;
  z-index: -1;
}

.ad-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.ad-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ad-content {
  display: flex;
  gap: 16px;
  align-items: center;
}

.ad-logo-wrap {
  width: 60px;
  height: 60px;
  background: #0f172a;
  border: 2px solid var(--accent);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 15px var(--accent-glow);
}

.ad-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.ad-text h4 {
  font-size: 1.1rem;
  margin: 4px 0;
  color: #fff;
}

.ad-text p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 12px;
  line-height: 1.4;
}

.ad-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@media(max-width: 768px) {
  .floating-ad {
    display: none !important;
  }
}

/* ── Mascot v3 additions ── */

/* Hide / show button */
.kt-hide-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid rgba(14, 165, 233, .4);
  color: var(--text-muted);
  font-size: .8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
  padding: 0;
}

.kt-hide-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* Bubble flips BELOW mascot when mascot is near top of screen */
.kt-mascot.kt-bubble-flip .kt-bubble {
  bottom: auto;
  top: 115px;
  transform-origin: top left;
}

.kt-mascot.kt-bubble-flip .kt-bubble::after {
  bottom: auto;
  top: -8px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* Sign prop — shown on contact section */
.kt-sign {
  position: absolute;
  bottom: 105px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  transform-origin: bottom center;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(14, 165, 233, .5);
  letter-spacing: .04em;
}

.kt-sign::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--accent);
  border-bottom: none;
}

/* Box prop — shown on projects section */
.kt-box {
  position: absolute;
  bottom: 105px;
  right: -18px;
  background: #0f172a;
  border: 1px solid rgba(14, 165, 233, .4);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: .9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: scale(0);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
}

.kt-box span {
  font-size: .6rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Mobile: mascot sits fixed in corner, no roaming */
@media (max-width: 767px) {
  .kt-mascot {
    position: fixed !important;
    bottom: 16px !important;
    left: 12px !important;
    top: auto !important;
    transform: scale(0.85);
    transform-origin: bottom left;
  }
}
