:root {
  color-scheme: light;
  --bg: #fefcf8;
  --surface: #ffffff;
  --surface-soft: #fffaf3;
  --text: #1e1e1e;
  --muted: #6d6d6d;
  --accent: #f6c144;
  --accent-strong: #ffc838;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  --border: rgba(243, 183, 57, 0.16);
  --transition: all 0.3s ease-in-out;
}

.dark-mode {
  color-scheme: dark;
  --bg: #1a1a1a;
  --surface: #2a2a2a;
  --surface-soft: #333333;
  --text: #f5f5f5;
  --muted: #cccccc;
  --accent: #f6c144;
  --accent-strong: #ffc838;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  --border: rgba(246, 193, 68, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface-soft) 100%);
  color: var(--text);
  direction: rtl;
  overflow-x: hidden;
  transition: var(--transition);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.container {
  max-width: 1200px;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 228, 169, 0.18);
  transition: padding 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled {
  padding: 0.2rem 0;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
  border-color: rgba(243, 183, 57, 0.24);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ffc844, #f6c144);
  color: #fff;
  font-weight: 700;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  padding-bottom: 0.15rem;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, #f6c144, #ffdb6e);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-inline-start: 1rem;
}

.theme-toggle .icon {
  font-size: 1.5rem;
  transition: var(--transition);
  display: block;
}

.theme-toggle .sun {
  opacity: 1;
  transform: rotate(0deg);
}

.dark-mode .theme-toggle .sun {
  opacity: 0;
  transform: rotate(180deg);
}

.theme-toggle .moon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(180deg);
  opacity: 0;
}

.dark-mode .theme-toggle .moon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn:active {
  transform: translateY(0px) scale(0.98);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  opacity: 0;
  box-shadow: 0 0 0 rgba(255, 211, 90, 0.25);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn:hover::after {
  opacity: 0.2;
  transform: scale(1.05);
}

.btn-primary {
  background: linear-gradient(135deg, #f6c144, #ffdb6e);
  color: #1f1f1f;
  box-shadow: 0 14px 30px rgba(246, 193, 68, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 20px 45px rgba(246, 193, 68, 0.32), 0 0 18px rgba(255, 219, 110, 0.22);
  background: linear-gradient(135deg, #ffdd68, #ffd563);
}

.btn-secondary,
.btn-small {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border: 1px solid rgba(243, 183, 57, 0.28);
}

.btn-secondary:hover,
.btn-small:hover {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 32px rgba(246, 193, 68, 0.12);
}

.section {
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
}

.section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(246, 193, 68, 0.08), transparent 22%),
    radial-gradient(circle at 80% 80%, rgba(255, 219, 110, 0.06), transparent 18%);
  opacity: 0.75;
  pointer-events: none;
  transform: translate3d(0, var(--section-bg-offset, 0), 0);
  transition: transform 0.2s ease-out;
}

.section-heading {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.1;
}

h3 {
  font-size: 1.2rem;
}

p {
  color: var(--muted);
  line-height: 1.8;
}

.section-hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 6rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(246, 193, 68, 0.18), transparent 24%),
    radial-gradient(circle at 80% 80%, rgba(255, 219, 110, 0.18), transparent 22%);
  background-size: 180% 180%, 180% 180%;
  pointer-events: none;
  animation: gradientFlow 18s ease-in-out infinite;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.65;
  animation: float 12s ease-in-out infinite;
}

.bubble-1 {
  width: 220px;
  height: 220px;
  right: 2%;
  top: 25%;
  background: rgba(255, 220, 88, 0.18);
}

.bubble-2 {
  width: 160px;
  height: 160px;
  left: 10%;
  top: 40%;
  background: rgba(246, 193, 68, 0.16);
  animation-duration: 15s;
}

.bubble-3 {
  width: 100px;
  height: 100px;
  left: 30%;
  bottom: 10%;
  background: rgba(255, 244, 214, 0.3);
  animation-duration: 10s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.05); }
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 1;
  transform: translate3d(var(--hero-move-x, 0), var(--hero-move-y, 0), 0);
  transition: transform 0.2s ease-out;
}

.hero-copy {
  max-width: 620px;
}

.hero-text {
  margin: 1.5rem 0;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.floating-card {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  border: 1px solid rgba(243, 183, 57, 0.12);
  padding: 1.35rem;
  border-radius: 1.5rem;
  text-align: center;
  transform: translate3d(0, var(--card-translate-y, 0px), 0) rotateX(var(--hover-rotateX, 0deg)) rotateY(var(--hover-rotateY, 0deg)) scale(var(--hover-scale, 1));
  transform-style: preserve-3d;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
  will-change: transform, box-shadow;
}

.floating-card:hover {
  --hover-scale: 1.02;
  box-shadow: 0 30px 70px rgba(246, 193, 68, 0.22);
  border-color: rgba(246, 193, 68, 0.4);
}

.icon {
  font-size: 2.2rem;
  margin-bottom: 0.85rem;
  animation: floatIcon 6s ease-in-out infinite alternate;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.card,
.why-card,
.testimonial-slide {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.75rem;
  box-shadow: var(--shadow);
  padding: 1.8rem;
}

.card {
  background: var(--surface);
  transform: translate3d(0, var(--card-translate-y, 0px), 0) rotateX(var(--hover-rotateX, 0deg)) rotateY(var(--hover-rotateY, 0deg)) scale(var(--hover-scale, 1));
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
  will-change: transform, box-shadow;
}

.card:hover {
  --hover-scale: 1.06;
  box-shadow: 0 30px 70px rgba(246, 193, 68, 0.18);
  border-color: rgba(246, 193, 68, 0.3);
  background: var(--surface);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: floatIcon 7s ease-in-out infinite alternate;
}

.hero-cards .floating-card:nth-child(1) .icon { animation-delay: 0.1s; }
.hero-cards .floating-card:nth-child(2) .icon { animation-delay: 0.35s; }
.hero-cards .floating-card:nth-child(3) .icon { animation-delay: 0.65s; }
.hero-cards .floating-card:nth-child(4) .icon { animation-delay: 0.2s; }
.hero-cards .floating-card:nth-child(5) .icon { animation-delay: 0.5s; }

.service-grid article:nth-child(1) .card-icon { animation-delay: 0.05s; }
.service-grid article:nth-child(2) .card-icon { animation-delay: 0.3s; }
.service-grid article:nth-child(3) .card-icon { animation-delay: 0.15s; }
.service-grid article:nth-child(4) .card-icon { animation-delay: 0.55s; }
.service-grid article:nth-child(5) .card-icon { animation-delay: 0.4s; }

.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.why-card {
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(0);
  transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.35s ease;
}

.why-card:nth-child(1),
.why-card:nth-child(3) {
  animation: slideInFromRight 0.6s ease-out forwards;
}

.why-card:nth-child(2),
.why-card:nth-child(4) {
  animation: slideInFromLeft 0.6s ease-out forwards;
}

.why-card.visible:nth-child(1) { animation-delay: 0.2s; }
.why-card.visible:nth-child(2) { animation-delay: 0.3s; }
.why-card.visible:nth-child(3) { animation-delay: 0.4s; }
.why-card.visible:nth-child(4) { animation-delay: 0.5s; }

.why-card:hover {
  transform: scale(1.05);
  box-shadow: 0 32px 60px rgba(246, 193, 68, 0.24);
}

.why-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #f6c144, #ffdb6e);
  color: #1f1f1f;
  font-weight: 700;
  margin-bottom: 1rem;
  transition: filter 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
  box-shadow: 0 8px 16px rgba(246, 193, 68, 0.16);
}

.why-card:hover .why-number {
  animation: goldenPulse 0.6s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 237, 74, 0.4));
}

.why-card h3 {
  transition: transform 0.35s ease, color 0.35s ease;
}

.why-card:hover h3 {
  transform: translateY(-3px);
}

.why-card p {
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.why-card:hover p {
  transform: translateY(-2px);
  filter: blur(0px);
}

.testimonials {
  padding-top: 1rem;
}

.testimonial-slider {
  position: relative;
  min-height: 200px;
}

.testimonial-slide {
  display: none;
  gap: 1rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.testimonial-slide.active {
  display: grid;
  opacity: 1;
  transform: translateY(0);
}

.testimonial-slide p {
  font-size: 1.05rem;
  color: var(--text);
}

.testimonial-slide span {
  color: var(--muted);
}

.testimonial-controls {
  display: inline-flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.dot {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 1px solid rgba(243, 183, 57, 0.6);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.dot.active,
.dot:hover {
  background: linear-gradient(135deg, #f6c144, #ffdb6e);
  transform: scale(1.05);
}

.cta-banner {
  background: linear-gradient(135deg, rgba(246, 193, 68, 0.16), rgba(255, 255, 255, 0.8));
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 2rem;
  border-radius: 2rem;
  border: 1px solid rgba(243, 183, 57, 0.16);
}

.site-footer {
  padding: 2.5rem 0 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.footer-grid h3,
.footer-grid h4 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-grid a {
  display: block;
  margin-top: 0.6rem;
  color: var(--muted);
}

.footer-note {
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes floatIcon {
  from { transform: translateY(0px) rotate(0deg); }
  to { transform: translateY(-10px) rotate(4deg); }
}

@keyframes gradientFlow {
  0%, 100% {
    background-position: 10% 10%, 90% 90%;
  }
  50% {
    background-position: 5% 15%, 95% 85%;
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(48px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-48px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes goldenPulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(255, 237, 74, 0.4)) drop-shadow(0 0 0px rgba(255, 237, 74, 0));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(255, 237, 74, 0.6)) drop-shadow(0 0 24px rgba(255, 237, 74, 0.2));
  }
}

.delay-1 {
  transition-delay: 0.15s;
}

.delay-2 {
  transition-delay: 0.25s;
}

.delay-3 {
  transition-delay: 0.35s;
}

.delay-4 {
  transition-delay: 0.45s;
}

@media (max-width: 960px) {
  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-grid,
  .why-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .nav-links {
    justify-content: center;
    width: 100%;
  }

  .hero-cards {
    grid-template-columns: 1fr 1fr;
  }

  .service-grid,
  .why-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .cta-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .hero-cards {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

.progress-widget {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 4.6rem;
  height: 4.6rem;
  display: grid;
  place-items: center;
  z-index: 1000;
  pointer-events: none;
}

.scroll-progress-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#f0c419 0deg, #f0c419 calc(var(--progress-deg, 0) * 1deg), rgba(240, 196, 25, 0.16) calc(var(--progress-deg, 0) * 1deg));
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.95), 0 18px 30px rgba(240, 196, 25, 0.25);
  position: relative;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.scroll-progress-ring::before {
  content: '';
  position: absolute;
  inset: 0.75rem;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(92, 180, 184, 0.08);
}

.scroll-progress-ring.complete {
  animation: progressPulse 1s ease-out 1;
}

.scroll-progress-ring:hover {
  transform: scale(1.02) rotate(4deg);
}

@keyframes progressPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

#back-to-top {
  position: absolute;
  inset: 0;
  width: 2.4rem;
  height: 2.4rem;
  margin: auto;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #f0c419, #ffd66b);
  color: #1d1a00;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  box-shadow: 0 8px 24px rgba(240, 196, 25, 0.28);
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  pointer-events: auto;
  display: grid;
  place-items: center;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#back-to-top:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 32px rgba(240, 196, 25, 0.42);
  background: linear-gradient(135deg, #ffd66b, #f8d650);
}

#back-to-top:active {
  transform: translateY(0) scale(0.95);
}

#back-to-top:active {
  transform: translateY(0) scale(0.95);
}

@media (max-width: 680px) {
  .progress-widget {
    right: 1rem;
    bottom: 1rem;
    width: 4rem;
    height: 4rem;
  }

  #back-to-top {
    width: 2rem;
    height: 2rem;
    font-size: 1.15rem;
  }
}
