/* ====================================
   THETA TECH — Dimensional Drift v4
   Responsive + Spacing & Reviews
   + Multi-theme + Bilingual RTL/LTR
   ==================================== */

/* ══════ DARK THEME (DEFAULT) ══════ */
:root,
[data-theme="dark"] {
  --bg-primary: #050d1f;
  --bg-secondary: #0a1628;
  --bg-card: rgba(10, 22, 50, 0.6);
  --blue-deep: #2541f5;
  --blue-mid: #1a6cf5;
  --cyan-accent: #00c8f0;
  --gradient-main: linear-gradient(135deg, #2541f5 0%, #00c8f0 100%);
  --text-primary: #ffffff;
  --text-secondary: #8da4cc;
  --text-muted: #4a6080;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --neon-glow: rgba(0, 200, 240, 0.6);
  --neon-color: #00c8f0;
  --modal-bg: rgba(5, 13, 31, 0.92);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus-border: rgba(0, 200, 240, 0.5);
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ══════ LIGHT THEME ══════ */
[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.7);
  --blue-deep: #2541f5;
  --blue-mid: #1a6cf5;
  --cyan-accent: #0891b2;
  --gradient-main: linear-gradient(135deg, #2541f5 0%, #0891b2 100%);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-bg-hover: rgba(255, 255, 255, 0.8);
  --neon-glow: rgba(37, 65, 245, 0.5);
  --neon-color: #2541f5;
  --modal-bg: rgba(240, 244, 248, 0.95);
  --input-bg: rgba(0, 0, 0, 0.03);
  --input-border: rgba(0, 0, 0, 0.12);
  --input-focus-border: rgba(37, 65, 245, 0.5);
}

[data-theme="light"] body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

[data-theme="light"] #three-canvas {
  opacity: 0.3;
}

[data-theme="light"] #loader {
  background: var(--bg-primary);
}

[data-theme="light"] .loader-text {
  color: var(--text-muted);
}

[data-theme="light"] #navbar.scrolled {
  background: rgba(240, 244, 248, 0.9);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .nav-links a {
  color: var(--text-secondary);
}

[data-theme="light"] .nav-links a:hover {
  color: var(--text-primary);
}

[data-theme="light"] .code-body {
  color: var(--text-secondary);
}

[data-theme="light"] .footer-bottom {
  color: var(--text-muted);
}

[data-theme="light"] .avatar {
  border-color: var(--bg-primary);
}

[data-theme="light"] ::selection {
  background: rgba(37, 65, 245, 0.25);
  color: #0f172a;
}

/* ══════ RTL SUPPORT ══════ */
[dir="rtl"] {
  --font-heading: 'Noto Kufi Arabic', 'Space Grotesk', sans-serif;
  --font-body: 'Noto Kufi Arabic', 'Inter', sans-serif;
}

[dir="rtl"] .nav-logo {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-links {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-content {
  text-align: center;
}

[dir="rtl"] .service-card,
[dir="rtl"] .project-info {
  text-align: right;
}

[dir="rtl"] .svc-tags {
  justify-content: flex-end;
}

[dir="rtl"] .code-filename {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .code-header {
  direction: ltr;
}

[dir="rtl"] .code-body {
  direction: ltr;
  text-align: left;
}

[dir="rtl"] .review-bubble,
[dir="rtl"] .floating-review {
  text-align: right;
}

[dir="rtl"] .floating-review::after {
  left: auto;
  right: 30px;
}

[dir="rtl"] .path-dot::after {
  right: auto;
  left: 20px;
  transform: translateY(-50%) translateX(-5px);
}

[dir="rtl"] .path-dot:hover::after,
[dir="rtl"] .path-dot.active::after {
  transform: translateY(-50%) translateX(0);
}

[dir="rtl"] #scroll-path {
  right: auto;
  left: 32px;
}

[dir="rtl"] .footer-inner {
  direction: rtl;
}

[dir="rtl"] .footer-links {
  text-align: right;
}

[dir="rtl"] .brand-slogan {
  text-align: right;
}

[dir="rtl"] .brand-top {
  flex-direction: row-reverse;
}

[dir="rtl"] .cta-trust {
  flex-direction: row-reverse;
}

[dir="rtl"] .trust-avatars {
  flex-direction: row-reverse;
}

[dir="rtl"] .avatar {
  margin-left: 0;
  margin-right: -8px;
}

[dir="rtl"] .avatar:first-child {
  margin-right: 0;
}

[dir="rtl"] .btn svg {
  transform: scaleX(-1);
}

[dir="rtl"] .hero-cta-group {
  flex-direction: row-reverse;
}

[dir="rtl"] .corner-bracket.tl { left: auto; right: 32px; border-left-width: 0; border-right-width: 1.5px; }
[dir="rtl"] .corner-bracket.tr { right: auto; left: 32px; border-right-width: 0; border-left-width: 1.5px; }
[dir="rtl"] .corner-bracket.bl { left: auto; right: 32px; border-left-width: 0; border-right-width: 1.5px; }
[dir="rtl"] .corner-bracket.br { right: auto; left: 32px; border-right-width: 0; border-left-width: 1.5px; }

[dir="rtl"] .direction-hint.right-hint {
  right: auto;
  left: 30px;
  transform: translateY(-50%) scaleX(-1);
}

[dir="rtl"] .modal-content {
  text-align: right;
}

[dir="rtl"] .modal-close {
  right: auto;
  left: 20px;
}

[dir="rtl"] .form-group label {
  text-align: right;
}

[dir="rtl"] .form-group input,
[dir="rtl"] .form-group textarea {
  text-align: right;
}

[dir="rtl"] .btn-send {
  flex-direction: row-reverse;
}

/* ══════ BASE RESETS ══════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; }
html { transition: background-color 0.4s ease; }
body { font-family: var(--font-body); background: var(--bg-primary); color: var(--text-primary); cursor: none; -webkit-font-smoothing: antialiased; transition: background-color 0.4s ease, color 0.4s ease; }
a { text-decoration: none; color: inherit; }
::selection { background: rgba(37,65,245,0.4); color: #fff; }

/* ── LOADER ── */
#loader { position: fixed; inset: 0; z-index: 10000; background: var(--bg-primary); display: flex; align-items: center; justify-content: center; transition: opacity 0.8s var(--ease-expo), visibility 0.8s; }
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-content { text-align: center; }
.loader-logo-img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 24px; animation: loader-pulse 1.5s ease-in-out infinite; }
@keyframes loader-pulse { 0%, 100% { opacity: 0.5; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } }
.loader-bar { width: 200px; height: 3px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; margin: 0 auto 16px; }
.loader-bar-fill { width: 0%; height: 100%; background: var(--gradient-main); border-radius: 4px; animation: loader-fill 2s var(--ease-expo) forwards; }
@keyframes loader-fill { to { width: 100%; } }
.loader-text { font-family: var(--font-heading); font-size: 12px; color: var(--text-muted); letter-spacing: 3px; text-transform: uppercase; }

/* ── CANVAS ── */
#three-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; transition: opacity 0.5s ease; }

/* ── CURSOR ── */
#cursor-dot { position: fixed; width: 6px; height: 6px; background: var(--cyan-accent); border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); box-shadow: 0 0 12px rgba(0,200,240,0.6); transition: width 0.3s, height 0.3s; }
#cursor-ring { position: fixed; width: 36px; height: 36px; border: 1.5px solid rgba(0,200,240,0.3); border-radius: 50%; pointer-events: none; z-index: 9998; transform: translate(-50%, -50%); transition: width 0.4s var(--ease-expo), height 0.4s var(--ease-expo), border-color 0.3s; }
body:has(a:hover) #cursor-ring, body:has(.btn:hover) #cursor-ring, body:has(.logo-3d:hover) #cursor-ring, body:has(.nav-action-btn:hover) #cursor-ring { width: 60px; height: 60px; border-color: rgba(0,200,240,0.5); background: rgba(0,200,240,0.04); }

/* ── SCROLL PROGRESS ── */
#scroll-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 1000; }
#scroll-fill { height: 100%; width: 0%; background: var(--gradient-main); box-shadow: 0 0 20px rgba(0,200,240,0.4); }

/* ── SCROLL PATH ── */
#scroll-path { position: fixed; right: 32px; top: 50%; transform: translateY(-50%); z-index: 900; display: flex; flex-direction: column; align-items: center; }
.path-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text-muted); background: transparent; transition: all 0.4s var(--ease-expo); position: relative; cursor: pointer; }
.path-dot.active { border-color: var(--cyan-accent); background: var(--cyan-accent); box-shadow: 0 0 12px rgba(0,200,240,0.5); }
.path-dot::after { content: attr(data-label); position: absolute; right: 20px; top: 50%; transform: translateY(-50%) translateX(5px); font-size: 10px; font-family: var(--font-heading); color: var(--text-muted); white-space: nowrap; opacity: 0; transition: opacity 0.3s, transform 0.3s; letter-spacing: 1.5px; text-transform: uppercase; }
.path-dot:hover::after, .path-dot.active::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.path-line { width: 1.5px; height: 36px; background: rgba(255,255,255,0.05); }

/* ── NAV ── */
#navbar { position: fixed; top: 0; left: 0; right: 0; height: 72px; z-index: 950; display: flex; align-items: center; justify-content: space-between; padding: 0 48px; background: rgba(5,13,31,0); backdrop-filter: blur(0px); border-bottom: 1px solid transparent; transition: all 0.4s; }
#navbar.scrolled { background: rgba(5,13,31,0.88); backdrop-filter: blur(20px); border-bottom-color: var(--glass-border); }
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 700; font-size: 17px; letter-spacing: 1px; }
.logo-3d-wrap { perspective: 600px; display: inline-flex; }
.nav-logo-img { width: 38px; height: 38px; object-fit: contain; transition: transform 0.6s var(--ease-expo); transform-style: preserve-3d; }
.nav-logo-img:hover { transform: rotateY(360deg); }
.nav-links { display: flex; gap: 36px; }
.nav-links a { font-family: var(--font-heading); font-size: 13px; font-weight: 400; color: var(--text-secondary); letter-spacing: 0.5px; position: relative; transition: color 0.3s; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0%; height: 2px; background: var(--gradient-main); border-radius: 2px; transition: width 0.3s var(--ease-expo); }
.nav-links a:hover::after { width: 100%; }

/* ── NAV ACTION BUTTONS (Theme + Language) ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-action-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s var(--ease-expo);
  overflow: hidden;
}

.nav-action-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: var(--gradient-main);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
  filter: blur(8px);
}

.nav-action-btn:hover {
  color: var(--neon-color);
  border-color: var(--neon-color);
  box-shadow:
    0 0 15px var(--neon-glow),
    0 0 30px rgba(0, 200, 240, 0.15),
    inset 0 0 15px rgba(0, 200, 240, 0.05);
  transform: translateY(-2px);
  background: rgba(0, 200, 240, 0.06);
}

.nav-action-btn:hover::before {
  opacity: 0.4;
}

.nav-action-btn:active {
  transform: translateY(0) scale(0.95);
}

.lang-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  pointer-events: none;
}

#theme-toggle svg {
  transition: transform 0.4s var(--ease-expo), opacity 0.3s;
}

#theme-toggle:hover svg {
  transform: rotate(20deg) scale(1.1);
}

/* ── UTILITIES ── */
.gradient-text { background: var(--gradient-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.section-label { font-family: var(--font-heading); font-size: 12px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--cyan-accent); margin-bottom: 14px; }
.section-title { font-family: var(--font-heading); font-size: clamp(36px,5vw,56px); font-weight: 700; line-height: 1.15; margin-bottom: 18px; }
.section-desc { font-size: 16px; color: var(--text-secondary); line-height: 1.7; max-width: 500px; margin-left: auto; margin-right: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-heading); font-size: 15px; font-weight: 600; padding: 14px 32px; border-radius: 12px; transition: all 0.4s var(--ease-expo); position: relative; overflow: hidden; cursor: pointer; }
.btn-primary { background: var(--gradient-main); color: #fff; box-shadow: 0 4px 20px rgba(37,65,245,0.25); border: none; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 35px rgba(37,65,245,0.4); }
.btn-glass { background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-secondary); backdrop-filter: blur(10px); }
.btn-glass:hover { background: var(--glass-bg-hover); border-color: rgba(255,255,255,0.12); color: #fff; transform: translateY(-3px); }
.btn-large { padding: 18px 44px; font-size: 17px; border-radius: 14px; }

/* ── CORNER BRACKETS ── */
.corner-bracket { position: absolute; width: 40px; height: 40px; z-index: 3; pointer-events: none; border-color: rgba(0,200,240,0.12); border-style: solid; border-width: 0; }
.corner-bracket.tl { top: 80px; left: 32px; border-top-width: 1.5px; border-left-width: 1.5px; }
.corner-bracket.tr { top: 80px; right: 32px; border-top-width: 1.5px; border-right-width: 1.5px; }
.corner-bracket.bl { bottom: 32px; left: 32px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.corner-bracket.br { bottom: 32px; right: 32px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* ══════ MAZE 2D GRID SCROLL SYSTEM ══════ */
#maze-container { position: relative; overflow: hidden; width: 100vw; height: 100vh; z-index: 1; }
#world-map { position: absolute; top: 0; left: 0; width: 200vw; will-change: transform; }
.maze-panel { position: absolute; width: 100vw; display: flex; align-items: center; justify-content: center; }

#services { top: 0; left: 0; height: 100vh; }
#hero { top: 0; left: 100vw; height: 100vh; }
#portfolio { top: 100vh; left: 0; height: 100vh; }
#cta { top: 100vh; left: 100vw; height: 100vh; }
#footer { top: 200vh; left: 100vw; width: 100vw; background: rgba(5,13,31,0.7); border-top: 1px solid var(--glass-border); padding: 60px 48px; display: block; align-items: stretch; justify-content: flex-start; }

[data-theme="light"] #footer {
  background: rgba(240, 244, 248, 0.8);
}

/* ── HERO ── */
.hero-bg-glow { position: absolute; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(circle, rgba(37,65,245,0.15) 0%, rgba(0,200,240,0.04) 40%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; animation: glow-breathe 6s ease-in-out infinite; }
@keyframes glow-breathe { 0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } }
.hero-content { text-align: center; position: relative; z-index: 2; max-width: 800px; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-size: 12px; font-weight: 500; color: var(--text-secondary); background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 100px; padding: 7px 18px; margin-bottom: 28px; letter-spacing: 1.5px; backdrop-filter: blur(10px); text-transform: uppercase; }
.badge-dot { width: 7px; height: 7px; background: #00e676; border-radius: 50%; animation: badge-pulse 2s ease-in-out infinite; }
@keyframes badge-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; box-shadow: 0 0 8px rgba(0,230,118,0.6); } }

.hero-logo-container { perspective: 1000px; margin: 0 auto 28px; width: 160px; height: 160px; display: flex; align-items: center; justify-content: center; }
.hero-logo { width: 150px; height: 150px; object-fit: contain; transform-style: preserve-3d; transition: transform 0.1s ease-out; filter: drop-shadow(0 0 30px rgba(37,65,245,0.4)); will-change: transform; }
.hero-logo:hover { filter: drop-shadow(0 0 50px rgba(0,200,240,0.6)); }

.hero-title { font-family: var(--font-heading); font-size: clamp(48px,7vw,82px); font-weight: 700; line-height: 1.08; margin-bottom: 20px; letter-spacing: -1px; }
.title-line { display: block; }
.title-word { display: inline-block; }
.hero-subtitle { font-size: 17px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 36px; max-width: 540px; margin-left: auto; margin-right: auto; }
.hero-cta-group { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── GLASS CARDS ── */
.glass-card { position: absolute; background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 14px; padding: 18px 22px; z-index: 5; box-shadow: 0 8px 40px rgba(0,0,0,0.3); }
.card-stats { bottom: 14%; left: 5%; display: flex; align-items: center; gap: 18px; }
.card-stat { text-align: center; }
.stat-number { display: block; font-family: var(--font-heading); font-size: 26px; font-weight: 700; background: var(--gradient-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
.card-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.07); }

.card-code { bottom: 14%; right: 5%; width: 260px; }
.code-header { display: flex; align-items: center; gap: 5px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.code-dot { width: 7px; height: 7px; border-radius: 50%; }
.code-dot.red { background: #ff5f57; } .code-dot.yellow { background: #ffbd2e; } .code-dot.green { background: #28ca42; }
.code-filename { margin-left: auto; font-size: 10px; color: var(--text-muted); font-family: 'Courier New', monospace; }
.code-body { font-size: 11px; line-height: 1.7; font-family: 'Courier New', monospace; color: var(--text-secondary); }
.code-keyword { color: #c792ea; } .code-var { color: #82aaff; } .code-prop { color: var(--cyan-accent); } .code-string { color: #c3e88d; }

.scroll-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 5; }
.scroll-hint span { font-size: 10px; color: var(--text-muted); letter-spacing: 2.5px; text-transform: uppercase; font-family: var(--font-heading); }
.scroll-mouse { width: 22px; height: 36px; border: 2px solid rgba(255,255,255,0.15); border-radius: 14px; position: relative; }
.scroll-wheel { width: 3px; height: 7px; background: var(--cyan-accent); border-radius: 3px; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); animation: scroll-anim 2s ease-in-out infinite; }
@keyframes scroll-anim { 0% { opacity: 1; top: 6px; } 100% { opacity: 0; top: 20px; } }

/* ── DIRECTION HINTS ── */
.direction-hint { position: absolute; color: var(--text-muted); opacity: 0.5; animation: dir-pulse 2s infinite; }
.direction-hint svg { stroke: var(--cyan-accent); }
.down-hint { bottom: 30px; left: 50%; transform: translateX(-50%); }
.right-hint { right: 30px; top: 50%; transform: translateY(-50%); }
@keyframes dir-pulse { 0%, 100% { opacity: 0.3; transform: scale(0.9); } 50% { opacity: 0.8; transform: scale(1.1); } }

/* ══════ REVIEWS / COMIC CHAT ══════ */
.floating-review { position: absolute; z-index: 10; background: var(--bg-card); backdrop-filter: blur(12px); border: 1px solid rgba(0, 200, 240, 0.2); border-radius: 18px; padding: 18px 24px; box-shadow: 0 16px 40px rgba(0,0,0,0.4); max-width: 250px; animation: float-review 4s ease-in-out infinite; text-align: left; }
.floating-review::after { content: ''; position: absolute; bottom: -10px; left: 30px; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid rgba(0, 200, 240, 0.2); }
.review-stars { color: #ffbd2e; font-size: 12px; margin-bottom: 6px; letter-spacing: 2px; }
.review-bubble { font-size: 13px; font-weight: 500; font-style: italic; color: var(--text-primary); margin-bottom: 10px; line-height: 1.5; }
.review-author { font-size: 10px; font-family: var(--font-heading); color: var(--cyan-accent); text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; }
.fr-1 { top: 12%; right: 10%; animation-delay: 0s; transform-origin: bottom left; }
.fr-2 { bottom: 20%; left: 8%; animation-delay: 1.5s; }
.fr-3 { top: 15%; left: 8%; animation-delay: 0.5s; border-color: rgba(37,65,245,0.3); } .fr-3::after { border-top-color: rgba(37,65,245,0.3); }
@keyframes float-review { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-12px) scale(1.02); } }

/* ══════ SERVICES (ALL AT ONCE GRID) ══════ */
.services-inner { width: 100%; max-width: 1100px; padding: 0 40px; text-align: center; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; text-align: left; }
.service-card { background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 16px; padding: 24px 20px; transition: all 0.5s var(--ease-expo); position: relative; overflow: hidden; }
.service-card::before { content: ''; position: absolute; inset: 0; border-radius: 16px; padding: 1px; background: var(--gradient-main); mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; -webkit-mask-composite: xor; opacity: 0; transition: opacity 0.4s; }
.service-card:hover::before { opacity: 1; }
.service-card:hover { background: var(--glass-bg-hover); transform: translateY(-4px) scale(1.02); box-shadow: 0 15px 40px rgba(37,65,245,0.1); }
.svc-icon { width: 38px; height: 38px; margin-bottom: 14px; }
.svc-icon svg { width: 100%; height: 100%; }
.service-card h3 { font-family: var(--font-heading); font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.service-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.svc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-tags span { font-size: 9px; font-family: var(--font-heading); color: var(--cyan-accent); padding: 3px 8px; background: rgba(0,200,240,0.07); border: 1px solid rgba(0,200,240,0.12); border-radius: 4px; letter-spacing: 0.5px; }

[dir="rtl"] .services-grid {
  text-align: right;
}

/* ══════ PORTFOLIO ══════ */
.portfolio-inner { width: 100%; max-width: 1200px; padding: 0 48px; text-align: center; }
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 40px; }
.project-card { background: var(--bg-card); backdrop-filter: blur(15px); border: 1px solid var(--glass-border); border-radius: 18px; overflow: hidden; transition: all 0.6s var(--ease-expo); transform-style: preserve-3d; }
.project-card:hover { transform: translateY(-10px) rotateX(2deg) rotateY(-2deg) !important; box-shadow: 0 24px 60px rgba(37,65,245,0.18); border-color: rgba(37,65,245,0.2); }
.project-mockup { border-bottom: 1px solid var(--glass-border); overflow: hidden; }
.mockup-bar { display: flex; align-items: center; gap: 5px; padding: 8px 12px; background: rgba(0,0,0,0.3); }
.mockup-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.12); }
.mockup-url { margin-left: auto; font-size: 10px; color: var(--text-muted); font-family: 'Courier New', monospace; }
.mockup-screen { height: 170px; padding: 14px; position: relative; }
.gradient-screen-1 { background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 100%); }
.gradient-screen-2 { background: linear-gradient(135deg, #0f1f3d 0%, #162850 100%); display: flex; align-items: center; justify-content: center; }
.gradient-screen-3 { background: linear-gradient(135deg, #0a1930 0%, #152240 100%); }
.mock-widget { border-radius: 6px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.03); }
.mock-widget.w1 { width: 60%; height: 20px; margin-bottom: 6px; }
.mock-widget.w2 { width: 40%; height: 14px; margin-bottom: 10px; }
.mock-widget.w3 { width: 100%; height: 18px; margin-bottom: 10px; }
.mock-chart { width: 100%; height: 55px; background: linear-gradient(90deg, rgba(37,65,245,0.3), rgba(0,200,240,0.3), rgba(37,65,245,0.2), rgba(0,200,240,0.4)); border-radius: 6px; }
.mock-phone { width: 65px; height: 120px; border: 2px solid rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; background: rgba(0,0,0,0.3); }
.mock-phone-header { height: 20%; background: rgba(37,65,245,0.2); }
.mock-phone-content { height: 65%; background: rgba(255,255,255,0.02); }
.mock-phone-nav { height: 15%; background: rgba(255,255,255,0.03); border-top: 1px solid rgba(255,255,255,0.04); }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; height: 100%; }
.mock-product { border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.03); }
.project-info { padding: 18px 20px; text-align: left; }
.project-tag { font-size: 10px; color: var(--cyan-accent); font-family: var(--font-heading); letter-spacing: 0.5px; margin-bottom: 6px; display: block; }
.project-info h3 { font-family: var(--font-heading); font-size: 17px; font-weight: 600; margin-bottom: 5px; }
.project-info p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ══════ CTA ══════ */
.cta-glow { position: absolute; width: 800px; height: 800px; border-radius: 50%; background: radial-gradient(circle, rgba(37,65,245,0.18) 0%, rgba(0,200,240,0.05) 35%, transparent 65%); top: 50%; left: 50%; transform: translate(-50%, -50%); animation: glow-breathe 5s ease-in-out infinite; pointer-events: none; }
.cta-content { text-align: center; position: relative; z-index: 2; padding: 40px; }
.cta-title { font-family: var(--font-heading); font-size: clamp(38px,5.5vw,68px); font-weight: 700; line-height: 1.1; margin-bottom: 24px; }
.cta-desc { font-size: 17px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 48px; max-width: 600px; margin-left: auto; margin-right: auto; }
.cta-buttons-wrapper { margin-bottom: 48px; display: flex; justify-content: center; gap: 20px; }
.cta-trust { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.trust-avatars { display: flex; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--bg-primary); margin-left: -8px; }
.avatar:first-child { margin-left: 0; }
.avatar.a1 { background: linear-gradient(135deg, #2541f5, #00c8f0); }
.avatar.a2 { background: linear-gradient(135deg, #00c8f0, #2541f5); }
.avatar.a3 { background: linear-gradient(135deg, #1a6cf5, #00c8f0); }
.avatar.a4 { background: linear-gradient(135deg, #00c8f0, #1a6cf5); }
.cta-trust span { font-size: 13px; color: var(--text-muted); }
.cta-trust strong { color: var(--text-primary); font-size: 14px; }
.cta-watermark-logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.03; pointer-events: none; animation: wm-rotate 40s linear infinite; }
.cta-wm-img { width: 600px; height: 600px; object-fit: contain; filter: grayscale(100%) brightness(200%); }
@keyframes wm-rotate { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ══════ CONTACT MODAL ══════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 520px;
  background: var(--modal-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 48px 40px;
  backdrop-filter: blur(30px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.5s var(--ease-expo), opacity 0.4s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
  border-color: rgba(255,255,255,0.15);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

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

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 20px rgba(0, 200, 240, 0.1);
}

.form-group textarea {
  min-height: 100px;
}

.btn-send {
  width: 100%;
  margin-top: 8px;
}

.form-status {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 13px;
  margin-top: 16px;
  min-height: 20px;
  letter-spacing: 0.5px;
}

.form-status.success {
  color: #00e676;
}

.form-status.error {
  color: #ff5f57;
}

.form-status.sending {
  color: var(--cyan-accent);
}

/* ══════ FOOTER ══════ */
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; max-width: 1200px; width: 100%; margin: 0 auto; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.footer-brand { flex: 0 0 35%; display: flex; flex-direction: column; gap: 16px; }
.brand-top { display: flex; align-items: center; gap: 12px; }
.brand-top h2 { font-family: var(--font-heading); font-weight: 700; font-size: 20px; letter-spacing: 1px; color: var(--text-primary); }
.footer-logo-img { width: 36px; height: 36px; object-fit: contain; }
.brand-slogan { font-size: 14px; color: var(--text-secondary); max-width: 250px; line-height: 1.6; }

.footer-menu-group { flex: 0 0 30%; }
.menu-title { font-family: var(--font-heading); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--cyan-accent); margin-bottom: 24px; }
.footer-links { display: flex; flex-direction: column; gap: 16px; }
.footer-links a { font-size: 14px; color: var(--text-secondary); transition: color 0.3s; font-family: var(--font-body); }
.footer-links a:hover { color: var(--text-primary); }

.footer-social-wrapper { flex: 0 0 30%; }
.footer-socials { display: flex; gap: 16px; }
.footer-socials a { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); color: var(--text-secondary); transition: all 0.3s; }
.footer-socials a:hover { color: var(--cyan-accent); border-color: rgba(0,200,240,0.2); background: rgba(0,200,240,0.05); transform: translateY(-3px); }

.footer-bottom { text-align: center; padding-top: 30px; font-size: 13px; color: var(--text-muted); }

[data-theme="light"] .footer-inner {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* ── RESPONSIVE: 1280px (Small Laptops) ── */
@media (max-width: 1280px) {
  .services-grid { gap: 20px; }
  .projects-grid { gap: 22px; }
  .floating-review { max-width: 220px; padding: 14px 18px; }
  .review-bubble { font-size: 12px; }
  .cta-wm-img { width: 450px; height: 450px; }
}

/* ── RESPONSIVE: 1024px (Tablets landscape) ── */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .card-stats, .card-code { display: none; }

  /* Reposition reviews so they don't overlap content */
  .floating-review { max-width: 200px; padding: 12px 16px; font-size: 12px; }
  .fr-1 { top: 6%; right: 4%; }
  .fr-2 { bottom: 10%; left: 4%; }
  .fr-3 { top: 8%; left: 4%; }
  .review-bubble { font-size: 11px; }
  .review-author { font-size: 9px; }

  .hero-logo-container { width: 130px; height: 130px; }
  .hero-logo { width: 120px; height: 120px; }
  .cta-wm-img { width: 350px; height: 350px; }
  
  .footer-inner { flex-wrap: wrap; gap: 30px; }
  .footer-brand, .footer-menu-group, .footer-social-wrapper { flex: 0 0 auto; }
}

/* ── RESPONSIVE: 768px (Tablets portrait / MAZE → VERTICAL) ── */
@media (max-width: 768px) {
  /* Break the Maze Matrix -> Stack Vertically */
  body, html { overflow-x: hidden; overflow-y: auto; }
  
  #maze-container { width: 100%; height: auto !important; overflow: visible; display: block; position: relative; }
  #world-map { position: relative; width: 100%; height: auto !important; display: flex; flex-direction: column; transform: none !important; will-change: auto; overflow: hidden; }
  .maze-panel { position: relative !important; width: 100% !important; height: auto !important; min-height: 100vh; top: auto !important; left: auto !important; padding: 100px 20px 60px; align-items: center; justify-content: center; }
  
  #hero { order: 1; min-height: 100vh; }
  #services { order: 2; min-height: auto; padding-top: 80px; padding-bottom: 80px; }
  #portfolio { order: 3; min-height: auto; padding-top: 80px; padding-bottom: 80px; }
  #cta { order: 4; min-height: 80vh; }
  #footer { order: 5; padding: 50px 20px 30px; height: auto !important; min-height: unset; }

  /* UI Adjustments */
  #navbar { padding: 0 16px; height: 60px; }
  .nav-links { display: none; }
  .nav-logo span { font-size: 15px; }
  .nav-logo-img { width: 32px; height: 32px; }

  .nav-actions {
    gap: 8px;
  }

  .nav-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .lang-label {
    font-size: 10px;
  }

  .hero-title { font-size: clamp(36px, 10vw, 48px); }
  .hero-subtitle { font-size: 14px; margin-bottom: 28px; padding: 0 10px; }
  .hero-badge { font-size: 10px; padding: 5px 14px; }
  .hero-logo-container { width: 120px; height: 120px; margin-bottom: 20px; }
  .hero-logo { width: 110px; height: 110px; }
  .hero-cta-group { gap: 12px; }
  .btn { padding: 12px 24px; font-size: 14px; border-radius: 10px; }
  .btn-large { padding: 14px 32px; font-size: 15px; }

  /* REVIEWS: Switch from absolute floating to inline flow on mobile */
  .floating-review {
    position: relative !important;
    top: auto !important; bottom: auto !important;
    left: auto !important; right: auto !important;
    max-width: 100%; width: 100%;
    margin: 12px auto; padding: 14px 18px;
    animation: none; /* No floating on mobile — stays clean */
    border-radius: 14px;
  }
  .floating-review::after { display: none; }

  /* Stack reviews before the grid in their sections */
  #services { flex-direction: column; flex-wrap: nowrap; }
  #portfolio { flex-direction: column; flex-wrap: nowrap; }

  .services-inner, .portfolio-inner { padding: 0 10px; width: 100%; }
  .services-grid { grid-template-columns: 1fr; max-width: 100%; gap: 14px; margin-top: 24px; }
  .projects-grid { grid-template-columns: 1fr; max-width: 100%; gap: 16px; margin-top: 24px; }
  
  .section-title { font-size: clamp(28px, 7vw, 40px); margin-bottom: 12px; }
  .section-desc { font-size: 14px; }
  .section-label { font-size: 10px; letter-spacing: 2px; }

  .cta-content { padding: 20px 10px; }
  .cta-title { font-size: clamp(30px, 8vw, 48px); margin-bottom: 16px; }
  .cta-desc { font-size: 14px; margin-bottom: 32px; }
  .cta-buttons-wrapper { margin-bottom: 32px; }
  .cta-wm-img { width: 250px; height: 250px; }

  .mockup-screen { height: 140px; }

  #scroll-path, #cursor-dot, #cursor-ring, .direction-hint, .scroll-hint { display: none; }
  body { cursor: auto; }
  .corner-bracket { display: none; }
  
  .footer-inner { flex-direction: column; gap: 32px; text-align: center; align-items: center; }
  .footer-brand { align-items: center; }
  .footer-links { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px; }
  .footer-socials { justify-content: center; }
  .menu-title { margin-bottom: 16px; }
  .footer-bottom { padding-top: 20px; font-size: 12px; }

  /* Modal mobile adjustments */
  .modal-content {
    padding: 36px 24px;
    border-radius: 20px;
    width: 94%;
  }
  .modal-title { font-size: 24px; }
  .modal-subtitle { font-size: 13px; margin-bottom: 24px; }

  /* RTL mobile fixes */
  [dir="rtl"] .footer-inner { align-items: center; text-align: center; }
  [dir="rtl"] .footer-links { justify-content: center; }
  [dir="rtl"] .brand-top { flex-direction: row-reverse; }
  [dir="rtl"] .brand-slogan { text-align: center; }
}

/* ── RESPONSIVE: 480px (Small phones) ── */
@media (max-width: 480px) {
  .maze-panel { padding: 80px 14px 50px; }
  #hero { padding-top: 90px; }
  #navbar { height: 56px; padding: 0 12px; }
  .nav-logo span { font-size: 14px; }
  .nav-logo-img { width: 28px; height: 28px; }

  .nav-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .lang-label { font-size: 9px; }

  .hero-title { font-size: clamp(30px, 10vw, 40px); letter-spacing: -0.5px; }
  .hero-subtitle { font-size: 13px; }
  .hero-logo-container { width: 100px; height: 100px; margin-bottom: 16px; }
  .hero-logo { width: 90px; height: 90px; }
  .hero-badge { font-size: 9px; padding: 4px 12px; letter-spacing: 1px; }
  .hero-cta-group { flex-direction: column; align-items: center; gap: 10px; }
  .btn { width: 100%; max-width: 280px; justify-content: center; }

  .floating-review { padding: 12px 14px; border-radius: 12px; }
  .review-bubble { font-size: 12px; line-height: 1.4; }
  .review-stars { font-size: 11px; }
  .review-author { font-size: 9px; }

  .service-card { padding: 18px 16px; border-radius: 12px; }
  .service-card h3 { font-size: 15px; }
  .service-card p { font-size: 12px; }

  .project-card { border-radius: 14px; }
  .project-info h3 { font-size: 15px; }
  .project-info p { font-size: 11px; }
  .mockup-screen { height: 120px; }

  .cta-title { font-size: clamp(26px, 9vw, 36px); }
  .cta-desc { font-size: 13px; padding: 0 5px; }
  .cta-wm-img { width: 200px; height: 200px; }

  .footer-inner { gap: 24px; }
  .brand-top h2 { font-size: 16px; }
  .brand-slogan { font-size: 12px; }
  .footer-links a { font-size: 13px; }
  .footer-socials a { width: 38px; height: 38px; border-radius: 8px; }

  .modal-content { padding: 28px 18px; }
  .modal-title { font-size: 22px; }

  [dir="rtl"] .hero-cta-group { flex-direction: column; }
}

/* ── RESPONSIVE: 360px (Very small phones) ── */
@media (max-width: 360px) {
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 12px; }
  .hero-logo-container { width: 80px; height: 80px; }
  .hero-logo { width: 75px; height: 75px; }
  .section-title { font-size: 24px; }
  .cta-title { font-size: 24px; }
  .btn { padding: 10px 20px; font-size: 13px; }
  .btn-large { padding: 12px 24px; font-size: 14px; }
}
