/* الهجده — الصفحة الرئيسية · تجربة المرحلة 2 */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Noto+Naskh+Arabic:wght@500;600;700&display=swap');
@import url('brand-tokens.css');

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.home-body {
  font-family: var(--h-font);
  background: var(--h-bg);
  color: var(--h-text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

.skip-link {
  position: absolute;
  top: -100px;
  right: 1rem;
  z-index: 10000;
  background: var(--h-gold);
  color: #1a140c;
  padding: 0.75rem 1.1rem;
  border-radius: var(--h-radius-sm);
  font-weight: 700;
  text-decoration: none;
  min-height: var(--h-touch);
  display: inline-flex;
  align-items: center;
}
.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--h-ink);
  outline-offset: 2px;
}

:focus-visible {
  outline: var(--h-focus);
  outline-offset: var(--h-focus-offset);
}

.paper-bloom {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 42% at 78% -8%, rgba(179, 147, 89, 0.11), transparent 60%),
    radial-gradient(ellipse 48% 36% at 8% 100%, rgba(179, 147, 89, 0.05), transparent 55%);
}
.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .paper-bloom {
  background:
    radial-gradient(ellipse 58% 40% at 82% -6%, rgba(92, 118, 168, 0.12), transparent 60%),
    radial-gradient(ellipse 42% 32% at 6% 104%, rgba(196, 164, 106, 0.05), transparent 55%);
}
html[data-theme="dark"] .paper-grain { opacity: 0.025; }

.page-wrap { position: relative; z-index: 10; }

/* —— Nav —— */
.home-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.1rem, 4vw, 2.5rem);
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background var(--h-duration-slow) var(--h-ease),
    border-color var(--h-duration-slow) var(--h-ease),
    backdrop-filter var(--h-duration-slow),
    padding var(--h-duration-slow) var(--h-ease);
}
.home-nav.is-scrolled {
  background: var(--h-nav);
  backdrop-filter: blur(20px) saturate(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.12);
  border-bottom-color: var(--h-line);
  padding: 0.7rem clamp(1.1rem, 4vw, 2.5rem);
  padding-top: max(0.7rem, env(safe-area-inset-top, 0px));
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-height: var(--h-touch);
}
.nav-brand svg {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.55rem;
  color: var(--h-mark);
  box-shadow: 0 0 0 1px rgba(179, 147, 89, 0.38);
  transition: box-shadow var(--h-duration) var(--h-ease), transform var(--h-duration) var(--h-ease);
}
.nav-brand:hover svg {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(179, 147, 89, 0.55), var(--h-glow-gold);
}
.nav-tools { display: flex; align-items: center; gap: 0.85rem; }
.theme-toggle {
  appearance: none;
  border: 1px solid var(--h-gold-line);
  background: rgba(255, 253, 248, 0.55);
  color: var(--h-gold-bright);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.38rem 0.9rem;
  border-radius: var(--h-radius-pill);
  cursor: pointer;
  letter-spacing: 0.04em;
  min-height: var(--h-touch);
  transition: border-color var(--h-duration), color var(--h-duration), background var(--h-duration);
}
html[data-theme="dark"] .theme-toggle { background: rgba(24, 30, 42, 0.7); }
.theme-toggle:hover { border-color: var(--h-gold); color: var(--h-text); }
.nav-brand-lockup { display: flex; flex-direction: column; gap: 0.04rem; line-height: 1.05; }
.nav-brand-name {
  font-family: var(--h-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--h-text);
}
.nav-brand-en {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--h-gold);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem 1.25rem;
  list-style: none;
}
.nav-links a {
  color: var(--h-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color var(--h-duration);
  min-height: var(--h-touch);
  display: inline-flex;
  align-items: center;
}
.nav-links a:hover { color: var(--h-text); }
.nav-link-quiet { opacity: 0.85; }

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--h-touch);
  padding: 0.7rem 1.35rem;
  border-radius: var(--h-radius-pill);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--h-duration) var(--h-ease), box-shadow var(--h-duration), background var(--h-duration), border-color var(--h-duration), color var(--h-duration);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, #d4b87a, #b39359 68%, #9a7a42);
  color: #1a140c;
  box-shadow: 0 8px 24px rgba(179, 147, 89, 0.28);
}
.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(179, 147, 89, 0.38);
  filter: brightness(1.03);
}
.btn-ghost {
  background: transparent;
  color: var(--h-text);
  border-color: var(--h-line);
}
.btn-ghost:hover {
  border-color: var(--h-gold-line);
  background: rgba(179, 147, 89, 0.06);
}

/* —— Hero —— */
.hero {
  min-height: 78dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7.5rem 1.5rem 3.5rem;
}
.hero-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--h-gold);
}
.hero-brand {
  font-family: var(--h-display);
  font-size: clamp(3.8rem, 13vw, 8rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 0.65rem;
  color: var(--h-text);
}
.hero-brand::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 2px;
  margin: 0.95rem auto 0;
  background: linear-gradient(90deg, transparent, var(--h-gold), transparent);
  border-radius: 2px;
}
.hero-en {
  font-size: 0.88rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--h-gold);
  font-weight: 700;
  margin: 0 0 1.25rem;
}
.hero-support {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: var(--h-text);
  font-weight: 600;
  max-width: 22ch;
  line-height: 1.55;
  margin: 0;
}
.hero-lead {
  margin: 0.75rem 0 0;
  font-size: clamp(0.95rem, 1.7vw, 1.08rem);
  color: var(--h-muted);
  max-width: 32ch;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

/* —— Sections —— */
.home-section {
  width: 100%;
  padding: 0 1.35rem 5rem;
}
.home-section--platform {
  padding-top: 0.5rem;
  padding-bottom: 4.5rem;
}
.home-section--cta {
  padding-bottom: 4rem;
}
.section-inner {
  max-width: 1040px;
  margin: 0 auto;
}
.section-head {
  text-align: center;
  margin-bottom: 2.25rem;
  max-width: 36rem;
  margin-inline: auto;
}
.section-eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--h-gold);
}
.section-title {
  margin: 0 0 0.55rem;
  font-family: var(--h-display);
  font-size: clamp(1.65rem, 3.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--h-text);
}
.section-lead {
  margin: 0;
  color: var(--h-muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* —— House cards —— */
.house-family {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.house-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.55rem 1.35rem 1.65rem;
  text-decoration: none;
  color: inherit;
  background: var(--h-surface);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  box-shadow: var(--h-shadow-sm);
  transition:
    transform var(--h-duration) var(--h-ease),
    box-shadow var(--h-duration) var(--h-ease),
    border-color var(--h-duration);
  min-height: 11.5rem;
}
.house-card:hover {
  transform: translateY(-4px);
  border-color: var(--h-gold-line);
  box-shadow: var(--h-shadow);
}
.house-card:focus-visible {
  border-color: var(--h-gold);
}
.house-card__mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.35rem;
  border-radius: 0.65rem;
  background: var(--h-mark);
  color: var(--h-gold);
}
.house-card__mark--quiet {
  background: rgba(179, 147, 89, 0.12);
  color: var(--h-gold-bright);
  font-size: 1.1rem;
}
html[data-theme="dark"] .house-card__mark--quiet {
  background: rgba(196, 164, 106, 0.12);
}
.house-card__name {
  margin: 0;
  font-family: var(--h-display);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 700;
  color: var(--h-text);
}
.house-card__desc {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--h-muted);
  flex: 1;
}
.house-card__tag {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--h-gold-bright);
  direction: ltr;
  unicode-bidi: isolate;
}
.house-card__go {
  position: absolute;
  left: 1.15rem;
  bottom: 1.35rem;
  color: var(--h-gold);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity var(--h-duration), transform var(--h-duration) var(--h-ease);
}
.house-card:hover .house-card__go {
  opacity: 1;
  transform: none;
}

/* —— Platform grid —— */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.platform-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.4rem 1.35rem 1.5rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--h-radius-lg);
  border: 1px solid var(--h-line);
  background:
    linear-gradient(165deg, rgba(179, 147, 89, 0.05), transparent 42%),
    var(--h-surface);
  transition:
    border-color var(--h-duration),
    transform var(--h-duration) var(--h-ease),
    box-shadow var(--h-duration);
}
.platform-card:hover {
  border-color: var(--h-gold-line);
  transform: translateY(-3px);
  box-shadow: var(--h-shadow);
}
.platform-card__kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--h-gold);
}
.platform-card h3 {
  margin: 0;
  font-family: var(--h-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--h-text);
}
.platform-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--h-muted);
}

/* —— CTA band —— */
.cta-band {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.75rem 1.75rem;
  border-radius: var(--h-radius-xl);
  border: 1px solid var(--h-gold-line);
  background:
    linear-gradient(135deg, rgba(179, 147, 89, 0.12), rgba(179, 147, 89, 0.03) 55%),
    var(--h-surface);
  box-shadow: var(--h-shadow-sm);
}
.cta-band__copy h2 {
  margin: 0 0 0.25rem;
  font-family: var(--h-display);
  font-size: 1.45rem;
  font-weight: 700;
}
.cta-band__copy p {
  margin: 0;
  color: var(--h-muted);
  font-size: 0.95rem;
}

/* —— Footer —— */
.home-footer {
  padding: 2.5rem 1.35rem max(3.25rem, env(safe-area-inset-bottom, 0px));
  max-width: 1040px;
  margin: 0 auto;
  border-top: 1px solid var(--h-line);
}
.home-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}
.home-footer__brand {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  color: var(--h-gold);
}
.home-footer__brand svg { width: 1.6rem; height: 1.6rem; flex-shrink: 0; margin-top: 0.15rem; }
.home-footer__brand strong {
  display: block;
  font-family: var(--h-display);
  font-size: 1.2rem;
  color: var(--h-text);
}
.home-footer__brand span {
  display: block;
  font-size: 0.8rem;
  color: var(--h-muted);
  margin-top: 0.15rem;
}
.home-footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 2.5rem;
}
.home-footer__cols > div {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 6.5rem;
}
.home-footer__col-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--h-gold);
  margin-bottom: 0.15rem;
}
.home-footer__cols a {
  color: var(--h-muted);
  text-decoration: none;
  font-size: 0.9rem;
  min-height: 1.75rem;
  display: inline-flex;
  align-items: center;
  transition: color var(--h-duration);
}
.home-footer__cols a:hover { color: var(--h-gold-bright); }
.home-footer__meta {
  color: var(--h-muted);
  font-size: 0.8rem;
  line-height: 1.7;
  padding-top: 1.25rem;
  border-top: 1px solid var(--h-line);
}

/* —— Reveal —— */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--h-ease), transform 0.7s var(--h-ease);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .house-family { grid-template-columns: 1fr; }
  .nav-brand-en { display: none; }
  .nav-link-quiet { display: none; }
}

@media (max-width: 720px) {
  .platform-grid { grid-template-columns: 1fr; }
  .cta-band {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .cta-band .btn { width: 100%; }
}

@media (max-width: 640px) {
  .hero {
    min-height: 70dvh;
    padding: 6.25rem 1.2rem 2.75rem;
  }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; min-width: 9rem; }
  .nav-links { gap: 0.15rem 0.85rem; }
  .nav-links a { font-size: 0.88rem; }
  .house-card__go { display: none; }
  .home-footer__top { flex-direction: column; gap: 1.5rem; }
}
