/* ====== الهيدر ====== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-gray-200);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-2);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 34px; width: auto; animation: brandPulse 3.2s ease-in-out infinite; }

@keyframes brandPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
@media (prefers-reduced-motion: reduce) {
  .brand img { animation: none; }
}

.main-nav { display: flex; align-items: center; gap: var(--space-4); }
.main-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}
.main-nav a {
  position: relative;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-gray-700);
  transition: color var(--duration-fast) var(--ease-standard);
  padding-bottom: 3px;
}
.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--color-primary-dark);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--duration-base) var(--ease-out);
}
.main-nav a:hover { color: var(--color-black); }
.main-nav a:hover::after { transform: scaleX(1); }

/* ====== القائمة الفرعية للخدمات ====== */
.nav-item-services { position: relative; }
.nav-services-trigger { display: flex; align-items: center; gap: 4px; }
.nav-caret {
  width: 13px;
  height: 13px;
  transition: transform var(--duration-fast) var(--ease-standard);
}
.nav-item-services:hover .nav-caret,
.nav-item-services:focus-within .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 16px);
  right: -14px;
  min-width: 240px;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard),
              visibility 0s linear var(--duration-base);
  z-index: 60;
}
.nav-item-services:hover .nav-dropdown,
.nav-item-services:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard),
              visibility 0s linear 0s;
}
.nav-dropdown li a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-700);
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.nav-dropdown li a::after { display: none; content: none; }
.nav-dropdown li a:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-gray-200);
  background: var(--color-white);
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-gray-900);
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ====== قسم Hero ====== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-7) var(--space-6);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--space-6);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: var(--space-3);
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.hero-title {
  font-family: var(--font-serif-display);
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.25;
  margin: 0 0 var(--space-3);
  color: var(--color-black);
}
.hero-title .highlight {
  color: var(--color-primary-dark);
  position: relative;
  white-space: nowrap;
}
.hero-title .highlight svg {
  position: absolute;
  bottom: -6px;
  right: 0;
  width: 100%;
  height: 10px;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.9;
  color: var(--color-gray-700);
  max-width: 560px;
  margin: 0 0 var(--space-4);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.hero-stats {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.hero-stats .stat-num {
  font-family: var(--font-serif-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--color-black);
  display: block;
}
.hero-stats .stat-label {
  font-size: 14px;
  color: var(--color-gray-500);
}

/* ====== العنصر البصري: رحلة بناء المنتج (هوية داش بوردز) ====== */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 460px;
}

.hero-stack {
  position: relative;
  width: 300px;
  height: 400px;
}

/* ====== بطاقة على شكل ورقة لعب حقيقية ====== */
.stack-panel {
  position: absolute;
  width: 220px;
  height: 320px;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: top var(--duration-slow) var(--ease-out),
              right var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out),
              box-shadow var(--duration-slow) var(--ease-out);
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 22px;
}
.card-corner-bottom { align-self: flex-end; transform: rotate(180deg); }
.card-corner .rank {
  font-family: var(--font-serif-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.card-corner .suit { width: 12px; height: 12px; }

.card-face {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}
.card-face .suit-watermark {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 90px;
  height: 90px;
  opacity: 0.08;
}
.stack-panel .panel-tag {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.65;
}
.stack-panel .panel-word {
  position: relative;
  font-family: var(--font-serif-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
}

/* ====== مواضع البطاقات الثلاث (Slots) ====== */
.stack-panel[data-slot="2"] {
  background: var(--color-gray-100);
  border: 1px solid var(--color-gray-200);
  color: var(--color-gray-900);
  top: 6%;
  right: 4%;
  transform: rotate(-7deg);
  z-index: 1;
}
.stack-panel[data-slot="1"] {
  background: var(--color-black);
  color: var(--color-white);
  top: 20%;
  right: 22%;
  transform: rotate(4deg);
  z-index: 2;
}
.stack-panel[data-slot="0"] {
  background: var(--color-primary);
  color: var(--color-black);
  top: 2%;
  right: 40%;
  transform: rotate(-3deg);
  z-index: 3;
  box-shadow: var(--shadow-lg);
  cursor: grab;
  touch-action: none;
}
.stack-panel[data-slot="0"]:active { cursor: grabbing; }

/* البطاقة الأقوى (الآس) — إطار مميز خفيف بدون كسر لغة الألوان */
.stack-panel.is-ace {
  box-shadow: var(--shadow-lg), 0 0 0 3px var(--color-white), 0 0 0 5px var(--color-primary);
}
.stack-panel.is-ace .card-corner .rank { font-size: 20px; }

.stack-panel.dragging {
  transition: none;
  cursor: grabbing;
}

/* دعوة خفيفة للتفاعل — تهتز مرة عند التحميل ثم تتوقف */
@keyframes cardNudge {
  0%, 100% { transform: rotate(-3deg) translateX(0); }
  20% { transform: rotate(-3deg) translateX(-10px) rotate(-8deg); }
  40% { transform: rotate(-3deg) translateX(6px) rotate(2deg); }
  60% { transform: rotate(-3deg) translateX(-4px); }
}
.stack-panel[data-slot="0"].nudge { animation: cardNudge 1.1s var(--ease-out) 900ms 1; }

.drag-hint {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-gray-500);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.drag-hint::before,
.drag-hint::after {
  content: "";
  width: 14px;
  height: 1.5px;
  background: var(--color-gray-300, var(--color-gray-200));
  animation: hintArrows 1.6s ease-in-out infinite;
}
.hero-stack.is-ready ~ .drag-hint { opacity: 1; }
@keyframes hintArrows { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .stack-panel[data-slot="0"].nudge { animation: none; }
}

.hero-flow {
  position: absolute;
  /* موضّعة بالنسبة لمركز .hero-visual (الذي تتمحور حوله .hero-stack دائماً)
     وليس بالنسبة لأسفله — لأن ارتفاع hero-visual أكبر من ارتفاع الكومة نفسها */
  top: calc(50% + 200px + 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-gray-700);
  white-space: nowrap;
}
.hero-flow .flow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}
.hero-flow span:not(.flow-dot) + .flow-dot { margin-inline-start: 2px; }

@media (max-width: 960px) {
  .hero-visual {
    min-height: 0;
    flex-direction: column;
    gap: var(--space-3);
  }
  .hero-stack { width: 260px; height: 340px; margin-top: var(--space-4); }
  .stack-panel { width: 190px; height: 270px; }
  .stack-panel .panel-word { font-size: 26px; }
  .card-face .suit-watermark { width: 70px; height: 70px; }

  .drag-hint { position: static; transform: none; order: -1; }

  .hero-flow {
    position: static;
    transform: none;
    margin: 0 auto;
  }
}

/* ====== شريط شعارات الثقة ====== */
.trust-bar {
  border-top: 1px solid var(--color-gray-200);
  padding-block: var(--space-3);
}
.trust-bar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  flex-wrap: wrap;
  color: var(--color-gray-500);
  font-size: 14px;
  font-weight: 600;
}

/* ====== استجابة الموبايل ====== */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-subtitle { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
}

@media (max-width: 480px) {
  .hero { padding-block: var(--space-5) var(--space-4); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { gap: var(--space-3); justify-content: space-between; width: 100%; }
}
