/* =========================================================
   Diwan Al-Emaar — Portfolio Styles
   ========================================================= */
:root {
  --navy-900: #081a33;
  --navy-800: #0a1f3d;
  --navy-700: #12335e;
  --navy-600: #1b4479;
  --gold-500: #f5b942;
  --gold-600: #e08b1f;
  --text-main: #eaf1fb;
  --text-dim: #a9b8ce;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(245, 185, 66, 0.18);
  --radius: 16px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --font-ar: "Cairo", sans-serif;
  --font-en: "Poppins", "Cairo", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-ar);
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800) 40%, var(--navy-900));
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
}

body.en { font-family: var(--font-en); }
body.menu-open { overflow: hidden; }

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button, input, textarea { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

:where(a, button, input, textarea):focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 3px;
}

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

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
}
.navbar.scrolled {
  background: rgba(8, 26, 51, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.35);
  padding: 8px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 48px; height: 48px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1.1rem; font-weight: 900; }
.brand-text small { color: var(--gold-500); font-size: 0.75rem; letter-spacing: 1px; }

.nav-links { display: flex; gap: 26px; }
.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dim);
  position: relative;
  padding: 4px 0;
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-500);
  transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-500); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang-btn {
  border: 1.5px solid var(--gold-500);
  background: transparent;
  color: var(--gold-500);
  font-family: inherit;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.lang-btn:hover { background: var(--gold-500); color: var(--navy-900); }

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.menu-btn span {
  width: 24px;
  height: 2.5px;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 130px 0 80px;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 185, 66, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 185, 66, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 75%);
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 50px;
}
.hero-badge {
  display: inline-block;
  background: rgba(245, 185, 66, 0.12);
  border: 1px solid var(--card-border);
  color: var(--gold-500);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 7px 18px;
  border-radius: 30px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 20px;
}
.hero h1 span { display: block; }
.grad {
  background: linear-gradient(90deg, var(--gold-500), var(--gold-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-desc {
  color: var(--text-dim);
  font-size: 1.06rem;
  max-width: 560px;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 32px;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, color 0.25s;
}
.btn-primary {
  background: linear-gradient(120deg, var(--gold-500), var(--gold-600));
  color: var(--navy-900);
  box-shadow: 0 10px 30px rgba(245, 185, 66, 0.28);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 38px rgba(245, 185, 66, 0.4); }
.btn-ghost {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}
.btn-ghost:hover { border-color: var(--gold-500); color: var(--gold-500); transform: translateY(-3px); }
.btn-block { width: 100%; }

/* Hero visual */
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 380px;
}
.hero-logo {
  width: min(300px, 70%);
  filter: drop-shadow(0 20px 45px rgba(245, 185, 66, 0.25));
  animation: float 5s ease-in-out infinite;
}
.logo-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 185, 66, 0.18), transparent 65%);
  animation: pulse 4s ease-in-out infinite;
}
.orbit {
  position: absolute;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  backdrop-filter: blur(6px);
  animation: float 4s ease-in-out infinite;
}
.orbit-1 { top: 6%;  inset-inline-start: 12%; animation-delay: 0.2s; }
.orbit-2 { bottom: 10%; inset-inline-start: 6%; animation-delay: 1s; }
.orbit-3 { top: 14%; inset-inline-end: 8%; animation-delay: 1.6s; }
.orbit-4 { bottom: 5%; inset-inline-end: 14%; animation-delay: 2.3s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* ===== Stats ===== */
.stats {
  padding: 45px 0;
  background: linear-gradient(90deg, rgba(245, 185, 66, 0.07), rgba(245, 185, 66, 0.02));
  border-block: 1px solid var(--card-border);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat-num, .stat-plus {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--gold-500);
}
.stat p { color: var(--text-dim); font-weight: 600; margin-top: 4px; }

/* ===== Sections ===== */
.section {
  padding: 95px 0;
  scroll-margin-top: 80px;
}
.section-alt { background: rgba(255, 255, 255, 0.02); }
.section-head { text-align: center; margin-bottom: 55px; }
.section-tag {
  display: inline-block;
  color: var(--gold-500);
  background: rgba(245, 185, 66, 0.1);
  border: 1px solid var(--card-border);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 18px;
  border-radius: 30px;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 900;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 45px;
  align-items: start;
}
.about-text p { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 24px; }
.about-list li {
  font-weight: 600;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.about-cards { display: grid; gap: 20px; }
.mini-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.3s, border-color 0.3s;
}
.mini-card:hover { transform: translateY(-5px); border-color: var(--gold-500); }
.mini-card span { font-size: 1.9rem; }
.mini-card h3 { margin: 10px 0 8px; color: var(--gold-500); }
.mini-card p { color: var(--text-dim); font-size: 0.97rem; }

/* ===== Services ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.service-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s;
}
.service-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold-500);
  box-shadow: var(--shadow);
}
.service-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(245, 185, 66, 0.2), rgba(245, 185, 66, 0.06));
  border: 1px solid var(--card-border);
}
.service-card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.service-card p { color: var(--text-dim); font-size: 0.93rem; }

/* ===== Why Us ===== */
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.why-item {
  text-align: center;
  padding: 28px 18px;
  border-radius: var(--radius);
  transition: background 0.3s, transform 0.3s;
}
.why-item:hover { background: var(--card-bg); transform: translateY(-6px); }
.why-item span { font-size: 2.3rem; }
.why-item h3 { margin: 12px 0 8px; font-size: 1.05rem; color: var(--gold-500); }
.why-item p { color: var(--text-dim); font-size: 0.93rem; }

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: start;
}
.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.3s;
}
.contact-item:hover { border-color: var(--gold-500); }
.contact-item > span { font-size: 1.6rem; }
.contact-item h3 { font-size: 1rem; color: var(--gold-500); margin-bottom: 4px; }
.contact-item p { color: var(--text-dim); font-size: 0.95rem; }

.contact-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 30px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: rgba(8, 26, 51, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.97rem;
  padding: 13px 16px;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.15);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #7688a3; }
.form-note {
  margin-top: 12px;
  text-align: center;
  font-weight: 600;
  color: #7ce38b;
  min-height: 1.4em;
}
.form-helper {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 0.82rem;
  text-align: center;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 40px 0 28px;
  background: rgba(0, 0, 0, 0.25);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
}
.footer-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: 560px;
  text-align: start;
}
.footer-brand strong { font-size: 1.05rem; }
.footer-brand p { color: var(--text-dim); font-size: 0.88rem; margin-top: 4px; }
.copy { color: var(--text-dim); font-size: 0.85rem; }

/* ===== Back to top ===== */
.to-top {
  position: fixed;
  bottom: 26px;
  inset-inline-end: 26px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(120deg, var(--gold-500), var(--gold-600));
  color: var(--navy-900);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 10px 26px rgba(245, 185, 66, 0.35);
  z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ===== Reveal animation (content stays visible without JavaScript) ===== */
.reveal {
  opacity: 1;
  transform: translateY(0);
}
.reveal.reveal-pending {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.reveal-pending.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-desc { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { min-height: 320px; order: -1; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .services-grid, .why-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    inset-inline-end: -100%;
    width: min(280px, 78%);
    height: 100vh;
    background: rgba(8, 26, 51, 0.98);
    backdrop-filter: blur(14px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    transition: inset-inline-end 0.4s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  }
  .nav-links.open { inset-inline-end: 0; }
  .nav-links a { font-size: 1.1rem; }
  .menu-btn { display: flex; z-index: 110; }
}

@media (max-width: 560px) {
  .services-grid, .why-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding-top: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal.reveal-pending {
    opacity: 1;
    transform: none;
  }
}
