:root {
  --purple-950: #16081f;
  --purple-900: #1f0b2e;
  --purple-800: #2d0f47;
  --purple-700: #3d1461;
  --purple-600: #5b1e8c;
  --purple-500: #7c2fb8;
  --purple-400: #9b4fd6;
  --purple-300: #c084f5;
  --accent: #ff6a3d;
  --ink: #0c0512;
  --white: #ffffff;
  --muted: #cbb8de;
  --muted-dark: #a58bc2;
  --border: rgba(255, 255, 255, 0.1);
  --font-ar: "Tajawal", "Segoe UI", sans-serif;
  --font-en: "Poppins", "Segoe UI", sans-serif;
  --container: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ar);
  background: var(--ink);
  color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

ul { list-style: none; }

button { font-family: inherit; cursor: pointer; border: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Photo background sections */
.photo-bg {
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  color: var(--white);
  box-shadow: 0 8px 30px rgba(124, 47, 184, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(124, 47, 184, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  border-color: var(--purple-300);
  background: rgba(255, 255, 255, 0.05);
}

.section {
  padding: 100px 0;
  position: relative;
}

.eyebrow {
  display: inline-block;
  color: var(--purple-300);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  margin-bottom: 18px;
}

.section-desc {
  color: var(--muted);
  font-size: 17px;
  max-width: 620px;
}

.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
  background: rgba(12, 5, 18, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--white);
}

.logo-icon { width: 34px; height: 34px; object-fit: contain; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-weight: 600;
  font-size: 15px;
}

.nav-links a { opacity: 0.85; transition: opacity 0.2s ease, color 0.2s ease; }
.nav-links a:hover { opacity: 1; color: var(--purple-300); }

.nav-cta { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
  display: none;
  background: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 24px;
}

/* Hero */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  background-image:
    linear-gradient(90deg, rgba(12,5,18,0.94) 0%, rgba(12,5,18,0.75) 45%, rgba(12,5,18,0.35) 100%),
    linear-gradient(0deg, var(--ink) 0%, transparent 25%),
    url("../images/hero-astronaut-mars.jpg");
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-text { max-width: 640px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(124, 47, 184, 0.15);
  border: 1px solid rgba(124, 47, 184, 0.4);
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-300);
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 60px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 22px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--purple-300), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: 18px;
  max-width: 520px;
  margin-bottom: 34px;
}

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

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

.hero-stats div strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--white);
}

.hero-stats div span {
  font-size: 13px;
  color: var(--muted-dark);
}

/* Marquee / trust bar */
.trust-bar {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--muted-dark);
  font-size: 14px;
  font-weight: 600;
}

/* About / story */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: center;
}

.about-visual {
  position: relative;
  border-radius: 24px;
  aspect-ratio: 4/5;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(91, 30, 140, 0.35);
}

.about-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline { margin-top: 30px; display: flex; flex-direction: column; gap: 22px; }

.timeline-item { display: flex; gap: 16px; align-items: flex-start; }

.timeline-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}

.timeline-item h4 { font-size: 17px; margin-bottom: 4px; font-weight: 700; }
.timeline-item p { color: var(--muted-dark); font-size: 14.5px; }

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 50px;
}

.service-card {
  padding: 34px 28px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(124,47,184,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124,47,184,0.5);
  background: linear-gradient(160deg, rgba(124,47,184,0.16), rgba(255,255,255,0.03));
}

.service-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  font-size: 24px;
}

.service-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.service-card p { color: var(--muted-dark); font-size: 14.5px; }

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 50px;
}

.project-card {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--purple-950);
}

.project-thumb {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--purple-700), var(--ink));
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}

.project-body { padding: 22px 24px; }
.project-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-300);
  background: rgba(124,47,184,0.15);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.project-body h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.project-body p { color: var(--muted-dark); font-size: 14px; }

/* CTA / idea section */
.idea-cta {
  border-radius: 28px;
  padding: 70px 50px;
  position: relative;
  overflow: hidden;
  text-align: center;
  background-image:
    linear-gradient(160deg, rgba(45,15,71,0.88), rgba(12,5,18,0.94)),
    url("../images/idea-bulb.jpg");
  background-size: cover;
  background-position: center 30%;
  border: 1px solid var(--border);
}

.idea-cta > * { position: relative; z-index: 1; }

.idea-cta h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; margin-bottom: 16px; }
.idea-cta p { color: var(--muted); max-width: 560px; margin: 0 auto 32px; }

/* FAQ */
.faq-list {
  max-width: 760px;
  margin: 50px auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  padding: 22px 26px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 16.5px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124,47,184,0.15);
  color: var(--purple-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform 0.25s ease;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item p {
  color: var(--muted-dark);
  font-size: 14.5px;
  margin-top: 14px;
  line-height: 1.8;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 50px;
}

.contact-visual {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 26px;
  aspect-ratio: 16/9;
}

.contact-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.contact-info-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.contact-info-item .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(124,47,184,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.contact-info-item h4 { font-size: 15px; margin-bottom: 4px; }
.contact-info-item p { color: var(--muted-dark); font-size: 14px; }

.form-card {
  padding: 36px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }

.field input, .field textarea, .field select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--white);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color 0.2s ease;
}

/* iOS Safari force-zooms the page whenever a focused field is under 16px.
   Bumping to 16px on touch widths keeps typing from hijacking the viewport. */
@media (max-width: 900px) {
  .field input, .field textarea, .field select,
  input[type="text"], input[type="email"], input[type="password"],
  input[type="tel"], input[type="number"], input[type="file"],
  textarea, select {
    font-size: 16px;
  }
}

.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-left: 44px; }
.toggle-password {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 15px;
  padding: 8px;
  opacity: 0.6;
  cursor: pointer;
}
.toggle-password:hover { opacity: 1; }

.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--purple-500);
}

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

.form-msg {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  display: none;
}
.form-msg.show { display: block; }
.form-msg.success { color: #4ade80; }
.form-msg.error { color: #f87171; }

/* Footer */
.footer {
  padding: 60px 0 30px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p { color: var(--muted-dark); font-size: 14px; margin-top: 14px; max-width: 300px; }

.footer h5 { font-size: 14px; margin-bottom: 16px; font-weight: 700; }
.footer ul { display: flex; flex-direction: column; gap: 10px; }
.footer ul a { color: var(--muted-dark); font-size: 14px; transition: color 0.2s ease; }
.footer ul a:hover { color: var(--purple-300); }

/* Footer links are only ~19px tall, well under the 44px touch target guideline.
   Padding on touch widths makes them reliably tappable without changing layout. */
@media (max-width: 900px) {
  .footer ul { gap: 4px; }
  .footer ul a {
    display: inline-block;
    padding: 11px 0;
    font-size: 15px;
  }
}

.social-row { display: flex; gap: 12px; margin-top: 18px; }
.social-row a {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.social-row a:hover { background: rgba(124,47,184,0.2); border-color: var(--purple-500); }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted-dark);
  font-size: 13px;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .nav-links, .nav-cta { display: none; }
  .menu-toggle { display: flex; }
  .services-grid, .projects-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 70px 0; }
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: rgba(12,5,18,0.98);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-size: 20px;
  font-weight: 700;
  transform: translateY(-100%);
  transition: transform 0.35s ease;
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav .close-btn {
  position: absolute; top: 24px; left: 24px;
  font-size: 28px; background: none; color: var(--white);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
