/* Homepage built from real HTML/CSS — inspired by the reference, not a single background image */

.home-ref {
  font-family: "Tajawal", "Cairo", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Hero */
.coded-hero {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: min(calc(100dvh - 72px), calc(100vw * 9 / 16));
  overflow: hidden;
  isolation: isolate;
  background: transparent;
}

.coded-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.coded-hero-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 7, 6, 0.48) 0%, rgba(8, 7, 6, 0.18) 28%, transparent 52%, rgba(8, 7, 6, 0.22) 100%);
}

.coded-hero-inner {
  position: relative;
  z-index: 4;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  height: 100%;
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5% 0 50%;
  pointer-events: none;
}

.coded-hero-inner a {
  pointer-events: auto;
}

.hero-center {
  text-align: center;
  padding: 8px 16px 0;
  width: 100%;
}

html[dir="rtl"] .hero-center { direction: rtl; }
html[dir="ltr"] .hero-center { direction: ltr; }

.hero-center h1 {
  margin: 0;
  font-family: "Cairo", "Tajawal", sans-serif;
  font-size: clamp(1.85rem, 3.6vw, 3.15rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  background: linear-gradient(180deg, #fff1c4 0%, #e8c994 40%, #c98218 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.hero-center .tagline {
  margin: 8px 0 8px;
  color: #fff;
  font-size: clamp(1rem, 1.7vw, 1.38rem);
  font-weight: 800;
  text-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.hero-center .support {
  margin: 0 auto 14px;
  max-width: 640px;
  color: #f4f0e6;
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  font-weight: 700;
  line-height: 1.55;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  direction: ltr;
}

.btn-hero {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-hero-gold {
  background: linear-gradient(180deg, #f8e4b0, #d9a441 52%, #b87314);
  color: #1a1208;
  border: 1px solid #f3d58a;
  box-shadow: 0 10px 24px rgba(201, 130, 24, 0.28);
}

.btn-hero-dark {
  background: rgba(8, 7, 6, 0.78);
  color: #f3d58a;
  border: 1.5px solid #d9a441;
}

.btn-hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

/* Benefits */
.benefits-bar {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 22px 40px;
  position: relative;
}

.benefits-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.benefit {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  padding: 6px 12px;
  position: relative;
}

.benefit + .benefit::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 16%;
  bottom: 16%;
  width: 1px;
  background: #d9a441;
  opacity: 0.65;
}

.benefit-icon {
  width: 54px;
  height: 54px;
  border: 1.6px solid #d9a441;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #d9a441;
}

.benefit h3 { margin: 0; color: var(--gold); font-size: 0.95rem; }
.benefit p { margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; }

.benefits-leaf {
  position: absolute;
  top: 50%;
  color: #d9a441;
  transform: translateY(-50%);
}

.benefits-leaf.start { inset-inline-start: 12px; }
.benefits-leaf.end { inset-inline-end: 12px; transform: translateY(-50%) scaleX(-1); }

.home-ref .section { padding: 72px 0; }
.home-ref .section-header h2 { color: var(--gold); }
.home-ref .section-alt { background: var(--bg-2); }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.cat-card {
  position: relative;
  min-height: 240px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(217, 164, 65, 0.35);
}

.cat-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.cat-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(8,7,6,.88)); }
.cat-card div { position: relative; z-index: 1; padding: 22px; color: #f8f5ec; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }

html[data-theme="dark"] .home-ref,
html[data-theme="dark"] .benefits-bar {
  background: #080706;
}

html[data-theme="light"] .hero-veil {
  background:
    radial-gradient(ellipse at 50% 34%, rgba(248, 245, 236, 0.28) 0%, transparent 48%),
    linear-gradient(180deg, rgba(248, 245, 236, 0.62) 0%, rgba(248, 245, 236, 0.22) 26%, rgba(248, 245, 236, 0.12) 58%, var(--bg) 100%);
}

html[data-theme="light"] .hero-center .tagline {
  color: #1a1710;
  text-shadow: 0 2px 12px rgba(248, 245, 236, 0.7);
}

html[data-theme="light"] .hero-center .support {
  color: #3f382c;
  text-shadow: 0 2px 10px rgba(248, 245, 236, 0.65);
}

html[data-theme="light"] .btn-hero-dark {
  background: rgba(255, 253, 247, 0.9);
  color: #8a6910;
  border-color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  .btn-hero { animation: none; transform: none; }
}

body[data-page="home"] .about-story {
  margin: 18px 0 14px;
  max-width: 38em;
  font-family: "Tajawal", "Cairo", sans-serif;
  font-size: clamp(1.02rem, 1.6vw, 1.14rem);
  font-weight: 500;
  line-height: 2.05;
  letter-spacing: 0.01em;
  color: var(--text);
  text-align: start;
  unicode-bidi: isolate;
}

html[data-theme="light"] body[data-page="home"] .about-story {
  color: #3a2f22;
}

@media (max-width: 980px) {
  .coded-hero {
    height: min(calc(100svh - 64px), calc(100vw * 9 / 16));
  }
  .coded-hero-bg img { object-position: center center; }
  .coded-hero-inner {
    min-height: 100%;
    height: 100%;
    padding: 22px 0 46%;
    width: min(920px, calc(100% - 24px));
  }
  .benefits-inner, .cat-grid { grid-template-columns: 1fr 1fr; }
  .benefit + .benefit::before, .benefits-leaf { display: none; }
}

@media (max-width: 640px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .benefits-inner { grid-template-columns: 1fr; }
  .benefits-bar { padding: 18px 16px; }
  .hero-ctas { flex-direction: column; }
  .btn-hero { width: 100%; justify-content: center; }
  .coded-hero {
    height: calc(100svh - 64px);
    min-height: calc(100svh - 64px);
  }
  .coded-hero-bg img { object-position: center center; }
  .coded-hero-inner { padding: 20px 0 48%; }

  body[data-page="home"] .about-story {
    font-size: 1.02rem;
    line-height: 1.95;
    margin-top: 14px;
    margin-bottom: 12px;
  }
}

@media (max-width: 430px) {
  .cat-card { min-height: 180px; }
  .hero-center h1 { font-size: clamp(1.85rem, 9vw, 2.6rem); }
}
