/* ──────────────────────────────────────────────────────────────
   Jidwal — styles

   1. Tokens        5. Hero
   2. Base          6. Sections (methodology · founder · support)
   3. Animations    7. Footer
   4. Components & header

   Logical properties (inline / block, start / end) are used
   throughout, so the layout mirrors automatically between
   LTR (English) and RTL (Arabic).
   ────────────────────────────────────────────────────────────── */

/* ── 1. Tokens ── */
:root {
  /* Brand palette */
  --color-brand-purple:   #6C4AB6;
  --color-brand-deep:     #4B2E83;
  --color-brand-bright:   #8B63D9;
  --color-brand-lavender: #C9B8F4;
  --color-brand-coral:    #FF7A70;
  --color-brand-yellow:   #FFD45A;
  --color-brand-mint:     #75D6B0;
  --color-brand-offwhite: #FCFBFF;

  --font-en: 'Quicksand', 'Cairo', sans-serif;
  --font-ar: 'Cairo', 'Quicksand', sans-serif;

  --section-pad: clamp(52px, 7.5vw, 72px);

  /* Semantic colours — light theme */
  --c-bg:           #FCFBFF;
  --c-bg-hero:      #F1EDFA;
  --c-surface:      #FFFFFF;
  --c-surface-alt2: #EDE5FA;
  --c-surface-card: #EDF9F4;
  --c-text:         #25213A;
  --c-muted:        #5A5070;
  --c-faint:        #706687;
  --c-accent:       var(--color-brand-purple);
  --c-border-soft:  #F1EDFA;
  --c-tag-bg:       #F1EDFA;
  --c-scroll-bg:    rgba(252, 251, 255, 0.86);
  --c-progress-bg:  #F1EDFA;

  /* Footer (same text opacities in both themes) */
  --c-footer-bg:    #25213A;
  --c-footer-text:  rgba(255, 255, 255, 0.65);
  --c-footer-dim:   rgba(255, 255, 255, 0.5);
  --c-footer-head:  #C9B8F4;
  --c-footer-rule:  #3A3356;
}

[data-theme="dark"] {
  --c-bg:           #100D1C;
  --c-bg-hero:      #1C1630;
  --c-surface:      #1C1830;
  --c-surface-alt2: #1E183A;
  --c-surface-card: #141E1A;
  --c-text:         #F0EAFF;
  --c-muted:        #A090C0;
  --c-faint:        #8E7EAE;
  --c-accent:       var(--color-brand-lavender);
  --c-border-soft:  #2A2448;
  --c-tag-bg:       #2A2060;
  --c-scroll-bg:    rgba(16, 13, 28, 0.86);
  --c-progress-bg:  #2A2448;

  --c-footer-bg:    #080612;
  --c-footer-head:  #8B63D9;
  --c-footer-rule:  #1E1A34;
}

/* ── 2. Base ── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px; /* keeps anchored sections clear of the sticky header */
}

body {
  margin: 0;
  font-family: var(--font-en);
  line-height: 1.55;
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}
html[lang="ar"] body { font-family: var(--font-ar); }

h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-brand-lavender); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-brand-bright); }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ── 3. Animations ── */
@keyframes floatSeed {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-12px) rotate(5deg); }
}
@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-deco > * { animation: none; }
}

/* ── 4. Components ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 14px 28px;
  border-radius: 100px;
  background: var(--color-brand-purple);
  color: var(--color-brand-offwhite);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover {
  background: var(--color-brand-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108, 74, 182, 0.4);
}
.btn-primary:active { transform: translateY(0); }

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-end: 16px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--c-tag-bg);
  color: var(--c-accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.3s;
}

.section-title {
  margin-block-end: 14px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.lede {
  color: var(--c-muted);
  text-wrap: pretty;
}

/* Header controls (language pill, theme + menu buttons) */
.pill-btn,
.icon-btn {
  border: none;
  background: var(--c-tag-bg);
  color: var(--c-accent);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.pill-btn:hover,
.icon-btn:hover {
  background: var(--c-surface-alt2);
  transform: translateY(-1px);
}

.pill-btn {
  padding: 9px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.icon-btn svg { width: 18px; height: 18px; }

.icon-sun,
.icon-close { display: none; }
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Mobile-only menu button (shown inside the breakpoint below) */
.icon-btn.nav-toggle-btn { display: none; }
.nav-toggle-btn[aria-expanded="true"] .icon-burger { display: none; }
.nav-toggle-btn[aria-expanded="true"] .icon-close  { display: block; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* nav stays truly centred */
  align-items: center;
  gap: 16px;
  padding-block: 16px;
  padding-inline: max(24px, calc(50% - 496px)); /* aligns with the 1040px content column */
  background: var(--c-scroll-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--c-border-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  color: var(--c-text);
  text-decoration: none;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.5vw, 28px);
}
.site-nav a {
  color: var(--c-muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--c-accent); }

.header-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

@media (max-width: 880px) {
  .site-header { grid-template-columns: 1fr auto; }

  .icon-btn.nav-toggle-btn { display: inline-flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 24px 12px;
    background: var(--c-surface);
    border-block-end: 1px solid var(--c-border-soft);
    box-shadow: 0 16px 30px rgba(37, 33, 58, 0.12);
  }
  .site-nav.nav-open { display: flex; }
  .site-nav a {
    padding: 14px 4px;
    border-block-start: 1px solid var(--c-border-soft);
    color: var(--c-text);
    font-size: 1rem;
  }
  .site-nav a:first-child { border-block-start: none; }
}

/* ── 5. Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 9vw, 88px) var(--section-pad);
  background: linear-gradient(180deg, var(--c-bg-hero) 0%, var(--c-bg) 78%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 24px;
  text-align: center;
}

.hero h1 {
  margin-block-end: 18px;
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

.hero .lede {
  max-width: 540px;
  margin: 0 auto 32px;
  font-size: 1.1rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-block-end: 14px;
}

.hero-hint {
  color: var(--c-faint);
  font-size: 0.85rem;
}

/* Countdown */
.countdown { margin-block-start: 48px; }

.countdown-label {
  margin-block-end: 14px;
  color: var(--c-accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.countdown-units {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 12px 10px;
  border: 1px solid var(--c-border-soft);
  border-radius: 16px;
  background: var(--c-surface);
  box-shadow: 0 6px 18px rgba(108, 74, 182, 0.08);
}

.countdown-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.countdown-caption {
  margin-block-start: 4px;
  color: var(--c-faint);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 420px) {
  .countdown-unit  { min-width: 56px; padding: 10px 6px; }
  .countdown-value { font-size: 1.3rem; }
}

/* Floating decoration */
.hero-deco {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero-deco > * { position: absolute; }

.deco-seed,
.deco-plant,
.deco-blossom,
.deco-fruit { animation: floatSeed 4s ease-in-out infinite; }

.deco-seed    { inset-block-start: 14%; inset-inline-start: 8%;  width: 20px; }
.deco-plant   { inset-block-end: 24%;   inset-inline-end: 12%;   width: 40px; animation-delay: -3.8s; }
.deco-blossom { inset-block-end: 10%;   inset-inline-start: 14%; width: 30px; animation-delay: -2.6s; }
.deco-fruit   { inset-block-start: 18%; inset-inline-end: 9%;    width: 30px; animation-delay: -1.4s; }

.deco-dot { border-radius: 50%; animation: sparkle 2s ease-in-out infinite; }
.deco-dot-bright { inset-block-start: 30%; inset-inline-end: 22%;  width: 14px; height: 14px; background: var(--color-brand-bright); }
.deco-dot-yellow { inset-block-start: 46%; inset-inline-start: 4%; width: 10px; height: 10px; background: var(--color-brand-yellow); animation-delay: 1.2s; }

@media (max-width: 640px) {
  .hero-deco { display: none; }
}

/* ── 6. Sections ── */
.stages,
.founder,
.cta { padding-block: var(--section-pad); }

/* Methodology */
.stages-head {
  max-width: 760px;
  margin: 0 auto 44px;
  text-align: center;
}

/* Dots sit above the centre of each column of the table below */
.stage-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  align-items: center;
  margin-block-end: 32px;
}
.stage-progress::before {
  content: "";
  position: absolute;
  inset-inline: 12.5%;
  top: 50%;
  height: 3px;
  border-radius: 3px;
  background: var(--c-progress-bg);
  transform: translateY(-50%);
}
.stage-progress span {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 3px solid var(--c-bg);
  border-radius: 50%;
}
.stage-progress span:nth-child(1) { background: var(--color-brand-yellow); }
.stage-progress span:nth-child(2) { background: var(--color-brand-mint); }
.stage-progress span:nth-child(3) { background: var(--color-brand-coral); }
.stage-progress span:nth-child(4) { background: var(--color-brand-deep); }

/* The "table": cells separated by 1px gaps that reveal the border colour */
.stages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--c-border-soft);
  border-radius: 20px;
  background: var(--c-border-soft);
}

.stage-cell {
  padding: 30px 20px;
  background: var(--c-surface);
  text-align: center;
  transition: background-color 0.25s ease;
}
.stage-cell:hover { background: var(--c-tag-bg); }

.stage-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
}

.stage-cell h3 {
  margin-block-end: 6px;
  font-size: 1.05rem;
  font-weight: 700;
}
.stage-cell p {
  color: var(--c-muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .stages-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .stages-grid { grid-template-columns: 1fr; }
  .stage-cell {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    text-align: start;
  }
  .stage-icon { flex-shrink: 0; margin: 0; }
}

/* Founder */
.founder-inner {
  max-width: 720px;
  margin-inline: auto;
}
.founder-inner .section-title { text-align: center; }

.founder-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-block-end: 32px;
}
.founder-badges span {
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--c-tag-bg);
  color: var(--c-accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.founder-inner p {
  color: var(--c-muted);
  line-height: 1.85;
  text-wrap: pretty;
}
.founder-inner p + p { margin-block-start: 1.1em; }

/* Support (call to action) */
.cta {
  background: var(--c-surface-card);
  transition: background-color 0.3s ease;
}

.cta-inner {
  max-width: 560px;
  margin-inline: auto;
  padding-inline: 24px;
  text-align: center;
}

.cta .lede { margin-block-end: 28px; }

.cta .btn-primary {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.cta-footnote {
  margin-block-start: 16px;
  color: var(--c-faint);
  font-size: 0.85rem;
}

/* ── 7. Footer ── */
.site-footer {
  padding-block: 44px 32px;
  background: var(--c-footer-bg);
  color: var(--c-footer-text);
  transition: background-color 0.3s ease;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px 24px;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: 24px;
}

.footer-about,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-contact { align-items: flex-end; }

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--c-footer-head);
  font-weight: 700;
}
.footer-brand .brand-mark { width: 26px; height: 26px; }

.footer-tagline,
.footer-label { font-size: 0.9rem; }

.footer-social { display: flex; gap: 10px; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-footer-text);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.footer-social a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--c-footer-head);
  transform: translateY(-2px);
}
.footer-social svg { width: 16px; height: 16px; }

.footer-meta {
  flex: 1 0 100%;
  padding-block-start: 20px;
  border-block-start: 1px solid var(--c-footer-rule);
  color: var(--c-footer-dim);
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 560px) {
  .footer-inner { justify-content: center; text-align: center; }
  .footer-about,
  .footer-contact { flex-basis: 100%; align-items: center; }
}
