@font-face {
  font-family: 'RabieW05';
  src: url('../assets/fonts/RabieW05-Regular.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'RabieW05';
  src: url('../assets/fonts/RabieW05-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --sky: #4eb5f5;
  --sky-deep: #3aa3e6;
  --green: #74c61e;
  --green-dark: #5ea316;
  --navy: #202859;
  --orange: #f97000;
  --yellow: #fccc00;
  --white: #ffffff;
  --text: #1f2433;
  --text-muted: #4a5163;
  --grey: #667085;
  --shadow: 0 10px 30px rgba(32, 40, 89, 0.12);
  --radius-btn: 999px;
  --header-h: 88px;
  --font-display: 'RabieW05', 'Tajawal', sans-serif;
  --font-body: 'Tajawal', 'RabieW05', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

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

/* ========== Header ========== */
.site-header {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
  padding: 16px clamp(16px, 4vw, 40px);
  /* ترتيب مطابق للتصميم: الشارات يسار، الشعار وسط، القائمة يمين */
  direction: ltr;
}

.header-stores {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}

.store-badge {
  display: inline-flex;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.store-badge:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

.store-badge img,
.store-badge svg {
  height: 40px;
  width: auto;
}

.header-logo {
  justify-self: center;
  width: min(200px, 46vw);
  transition: transform 0.35s ease;
}

.header-logo:hover {
  transform: scale(1.04);
}

.header-logo img {
  width: 100%;
  height: auto;
}

.header-menu-wrap {
  justify-self: end;
  display: flex;
  justify-content: flex-end;
}

.menu-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

.menu-btn:hover {
  transform: scale(1.05);
}

.menu-btn span,
.menu-btn span::before,
.menu-btn span::after {
  display: block;
  width: 22px;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-btn span::before,
.menu-btn span::after {
  content: '';
  position: absolute;
  left: 0;
}

.menu-btn span::before {
  top: -7px;
}

.menu-btn span::after {
  top: 7px;
}

.menu-btn.is-open span {
  background: transparent;
}

.menu-btn.is-open span::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-btn.is-open span::after {
  top: 0;
  transform: rotate(-45deg);
}

.page-landing .menu-btn {
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
}

.page-landing .menu-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.page-privacy .menu-btn {
  color: #111;
  background: rgba(0, 0, 0, 0.04);
}

.page-privacy .menu-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* ========== Nav drawer ========== */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 60, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 50;
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 86vw);
  height: 100%;
  background: var(--white);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
  transform: translateX(105%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 60;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-drawer.is-open {
  transform: translateX(0);
}

.nav-drawer a {
  display: block;
  padding: 14px 12px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--navy);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-drawer a:hover {
  background: rgba(116, 198, 30, 0.12);
  color: var(--green-dark);
}

/* ========== Landing page ========== */
.page-landing {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--sky) 0%, #5fc0f8 55%, var(--sky-deep) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.landing-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.clouds-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.cloud-svg {
  position: absolute;
  width: min(320px, 48vw);
  height: auto;
  opacity: 0.95;
  animation: drift 28s ease-in-out infinite;
  user-select: none;
}

.cloud-svg-1 {
  top: 8%;
  right: 4%;
  width: min(280px, 42vw);
  animation-duration: 32s;
}

.cloud-svg-2 {
  top: 26%;
  left: -4%;
  width: min(340px, 52vw);
  animation-duration: 36s;
  animation-delay: -6s;
  opacity: 0.85;
}

.cloud-svg-3 {
  bottom: 22%;
  right: 12%;
  width: min(260px, 40vw);
  animation-duration: 30s;
  animation-delay: -12s;
  opacity: 0.8;
}

.cloud-svg-4 {
  top: 46%;
  left: 18%;
  width: min(220px, 34vw);
  animation-duration: 40s;
  animation-delay: -18s;
  opacity: 0.7;
}

@keyframes drift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(28px);
  }
}

@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px clamp(18px, 5vw, 48px) 120px;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 4.2vw, 2.75rem);
  line-height: 1.45;
  letter-spacing: 0;
  text-shadow: 0 2px 16px rgba(20, 60, 110, 0.18);
  animation: riseIn 0.8s ease both 0.15s;
}

.hero-text {
  margin: 0 auto 32px;
  max-width: 640px;
  font-size: clamp(0.95rem, 2.1vw, 1.15rem);
  line-height: 1.9;
  font-weight: 400;
  animation: riseIn 0.8s ease both 0.32s;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  animation: riseIn 0.8s ease both 0.48s;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  box-shadow: 0 8px 0 var(--green-dark), 0 14px 24px rgba(76, 137, 13, 0.28);
}

.btn-primary:hover {
  background: #7fd124;
  box-shadow: 0 8px 0 var(--green-dark), 0 18px 28px rgba(76, 137, 13, 0.34);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 8px 24px rgba(20, 50, 90, 0.12);
}

.btn-secondary:hover {
  box-shadow: 0 12px 28px rgba(20, 50, 90, 0.18);
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.landing-footer {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: clamp(28px, 8vw, 64px);
  padding: 0 20px 28px;
}

.landing-footer a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  opacity: 0.95;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.landing-footer a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.mascot {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  animation: bob 5.5s ease-in-out infinite;
  will-change: transform;
  line-height: 0;
}

/* نجمة/شمس — خلف النصوص، جزء مختفي في الزاوية */
.mascot-star {
  left: -8%;
  bottom: -8%;
  width: min(340px, 50vw);
  animation-delay: -1.2s;
}

/* قمر — خلف النصوص، جزء مختفي في الزاوية */
.mascot-moon {
  right: -8%;
  bottom: -8%;
  width: min(300px, 44vw);
}

.mascot-img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(1.5deg);
  }
}

/* ========== Privacy page ========== */
.page-privacy {
  min-height: 100vh;
  background: var(--white);
  position: relative;
  overflow-x: hidden;
}

.privacy-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.privacy-main {
  flex: 1;
  width: min(720px, 100%);
  margin-inline: 0 auto;
  padding: 12px clamp(20px, 6vw, 80px) 160px;
  animation: riseIn 0.75s ease both 0.1s;
  position: relative;
  z-index: 5;
}

.privacy-title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  color: var(--text);
  line-height: 1.35;
}

.privacy-section {
  margin-bottom: 28px;
}

.privacy-section h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--navy);
}

.privacy-section p,
.privacy-intro,
.privacy-note {
  margin: 0;
  font-size: 1rem;
  line-height: 1.95;
  color: var(--text-muted);
  white-space: pre-line;
}

.privacy-intro {
  margin-bottom: 28px;
  color: var(--text);
}

.usage-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0 16px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #e8ebf2;
}

.usage-table th,
.usage-table td {
  padding: 12px 14px;
  text-align: start;
  font-size: 0.95rem;
  line-height: 1.6;
  border-bottom: 1px solid #eef1f6;
}

.usage-table th {
  background: rgba(116, 198, 30, 0.1);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 500;
}

.usage-table tr:last-child td {
  border-bottom: 0;
}

.privacy-note {
  margin-top: 8px;
  color: var(--navy);
  font-weight: 500;
}

.page-privacy .mascot {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.08));
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
  :root {
    --header-h: 76px;
  }

  .site-header {
    gap: 10px;
  }

  .header-logo {
    width: min(130px, 34vw);
  }

  .store-badge svg,
  .store-badge img {
    height: 34px;
  }

  .privacy-main {
    margin-inline: auto;
    padding-bottom: 140px;
  }

  .mascot-star {
    left: -10%;
    bottom: -8%;
    width: min(250px, 56vw);
  }

  .mascot-moon {
    right: -10%;
    bottom: -8%;
    width: min(230px, 50vw);
  }
}

@media (max-width: 640px) {
  .header-stores {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .store-badge svg,
  .store-badge img {
    height: 30px;
  }

  .hero {
    padding-bottom: 120px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }

  .btn {
    width: 100%;
  }

  .landing-footer {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-bottom: 22px;
  }

  .mascot-star {
    left: -12%;
    bottom: -10%;
    width: min(210px, 60vw);
  }

  .mascot-moon {
    right: -12%;
    bottom: -10%;
    width: min(190px, 54vw);
  }

  .cloud-svg-2,
  .cloud-svg-4 {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
