/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #121820;
  --bg-card: #1a2230;
  --bg-card-hover: #1f2a3d;
  --text-primary: #ffffff;
  --text-secondary: #b0bec5;
  --text-muted: #78909c;
  --accent: #3498db;
  --accent-light: #00aaff;
  --accent-glow: rgba(52, 152, 219, 0.25);
  --border: rgba(255, 255, 255, 0.08);
  --star: #e74c3c;
  --font: 'Cairo', sans-serif;
  --header-height: 70px;
  --section-padding: 100px;
  --container-width: 1140px;
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  margin: 0 auto 40px;
  border-radius: 2px;
}

/* ===== Animated Background Shapes ===== */
.shapes-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 20s ease-in-out infinite;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: #6366f1;
  bottom: 20%;
  left: -8%;
  animation-delay: -5s;
  animation-duration: 25s;
}

.shape-3 {
  width: 250px;
  height: 250px;
  background: var(--accent-light);
  top: 40%;
  right: 10%;
  animation-delay: -10s;
  animation-duration: 18s;
}

.shape-4 {
  width: 350px;
  height: 350px;
  background: #2563eb;
  bottom: -5%;
  right: 30%;
  animation-delay: -7s;
  animation-duration: 22s;
}

.shape-5 {
  width: 200px;
  height: 200px;
  background: #0ea5e9;
  top: 60%;
  left: 20%;
  animation-delay: -3s;
  animation-duration: 16s;
}

.floating-ring {
  position: absolute;
  width: 300px;
  height: 300px;
  top: 25%;
  left: 5%;
  animation: spin 30s linear infinite;
  opacity: 0.2;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(40px, 20px) scale(1.02); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}

.header.scrolled {
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.logo:hover {
  color: var(--accent-light);
}

.nav-desktop {
  display: none;
  gap: 8px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-light);
  background: rgba(52, 152, 219, 0.1);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Mobile Menu ===== */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.menu-close {
  position: absolute;
  top: 20px;
  left: 24px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}

.menu-close:hover {
  color: var(--accent-light);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mobile-link {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 500;
  padding: 12px 32px;
  border-radius: 12px;
  transition: all var(--transition);
}

.mobile-link:hover,
.mobile-link.active {
  color: var(--accent-light);
  background: rgba(52, 152, 219, 0.1);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--header-height);
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 14, 20, 0.7) 0%,
    rgba(10, 14, 20, 0.85) 50%,
    rgba(10, 14, 20, 0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-icon {
  margin-bottom: 24px;
}

.brain-bulb {
  width: 80px;
  height: auto;
  margin: 0 auto;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(52, 152, 219, 0.4)); }
  50% { filter: drop-shadow(0 0 20px rgba(0, 170, 255, 0.6)); }
}

.hero-title {
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 32px;
  line-height: 1.9;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(52, 152, 219, 0.4);
}

.btn-full {
  width: 100%;
}

/* ===== About ===== */
.about {
  background: var(--bg-secondary);
}

.about-content {
  max-width: 900px;
  margin: 0 auto;
}

.about-content p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  text-align: center;
  line-height: 2.1;
}

/* ===== Value Proposition ===== */
.value {
  text-align: center;
  padding-top: 0;
}

.value-hero-image {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  margin-bottom: 60px;
}

.value-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.value-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--bg-primary) 100%);
}

.value-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ===== Services ===== */
.services {
  background: var(--bg-secondary);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.service-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-color: rgba(52, 152, 219, 0.2);
}

.service-image {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.service-card:hover .service-image img {
  transform: scale(1.08);
}

.service-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(26, 34, 48, 0.9) 100%);
}

.service-body {
  padding: 32px;
}

.service-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.service-body li {
  color: var(--text-secondary);
  padding: 8px 0;
  padding-right: 20px;
  position: relative;
  font-size: 0.95rem;
  transition: color var(--transition);
}

.service-body li::before {
  content: '*';
  position: absolute;
  right: 0;
  color: var(--accent);
  font-size: 1rem;
  top: 8px;
}

.service-card:hover .service-body li {
  color: var(--text-primary);
}

/* ===== Testimonials ===== */
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.testimonial-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  border-color: rgba(52, 152, 219, 0.2);
}

.testimonial-image {
  height: 280px;
  overflow: hidden;
}

.testimonial-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.6s ease;
}

.testimonial-card:hover .testimonial-image img {
  transform: scale(1.05);
}

.testimonial-body {
  padding: 28px 32px 32px;
}

.testimonial-role {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.testimonial-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 4px 0 16px;
}

.testimonial-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.9;
  margin-bottom: 16px;
}

.stars {
  color: var(--star);
  font-size: 1rem;
  letter-spacing: 2px;
}

/* ===== Contact ===== */
.contact {
  background: var(--bg-secondary);
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  transition: all var(--transition);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.error-msg {
  color: #e74c3c;
  font-size: 0.8rem;
  min-height: 18px;
}

.form-success {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: #2ecc71;
  padding: 14px 18px;
  border-radius: 12px;
  text-align: center;
  font-weight: 500;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.info-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 4px;
}

.info-item a {
  color: var(--accent-light);
}

/* ===== Footer ===== */
.footer {
  background: #060a10;
  padding: 48px 0 32px;
  text-align: center;
  border-top: 2px solid var(--accent);
  position: relative;
  z-index: 1;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 24px;
}

.footer-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--accent-light);
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 900;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-4px);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  :root {
    --section-padding: 120px;
  }

  .nav-desktop {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .services-grid {
    grid-template-columns: 1fr;
    max-width: 700px;
    margin: 0 auto;
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-wrapper {
    grid-template-columns: 1.2fr 0.8fr;
    max-width: 1000px;
  }
}

@media (min-width: 1024px) {
  .services-grid {
    max-width: var(--container-width);
  }

  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .service-image {
    height: 280px;
  }
}

@media (max-width: 480px) {
  .back-to-top {
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
  }
}
