/* =========================================================
   Badrudduja Chishty — Official Website
   Sacred Editorial · Ajmer Sharif
   ========================================================= */

:root {
  /* Palette — deep night + warm gold + ivory */
  --night:        #0b1020;
  --night-2:      #121a2f;
  --night-3:      #1a2440;
  --ink:          #141820;
  --ink-soft:     #3a4254;
  --muted:        #6b7285;
  --line:         rgba(20, 24, 32, 0.08);
  --line-light:   rgba(255, 255, 255, 0.1);

  --gold:         #c4a35a;
  --gold-soft:    #e2c98a;
  --gold-deep:    #9a7b35;
  --ivory:        #f8f4ec;
  --ivory-2:      #efe8da;
  --white:        #ffffff;
  --cream:        #fbf9f5;
  --rose:         #8b3a4a;
  --emerald:      #1e4d3e;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-arabic:  'Noto Naskh Arabic', 'Amiri', serif;

  --nav-h: 76px;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 20px 60px rgba(11, 16, 32, 0.12);
  --shadow-card: 0 12px 40px rgba(11, 16, 32, 0.08);
  --radius: 18px;
  --radius-sm: 10px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
ul { list-style: none; }
::selection { background: rgba(196, 163, 90, 0.28); color: var(--ink); }

.container {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1.5px;
  background: currentColor;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 36rem;
}
.arabic {
  font-family: var(--font-arabic);
  direction: rtl;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
              color 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--night);
  box-shadow: 0 10px 30px rgba(196, 163, 90, 0.28);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(196, 163, 90, 0.38);
}
.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.28);
}
.btn-ghost:hover {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: rgba(20, 24, 32, 0.18);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
  transform: translateY(-2px);
}
.btn-dark {
  background: var(--night);
  color: var(--white);
}
.btn-dark:hover {
  background: var(--night-3);
  transform: translateY(-2px);
}

/* =========================================================
   NAVIGATION
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease),
              backdrop-filter 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(251, 249, 245, 0.88);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 8px 30px rgba(11, 16, 32, 0.06);
  border-bottom-color: var(--line);
}
.site-header.on-dark:not(.scrolled) .logo-text,
.site-header.on-dark:not(.scrolled) .nav-links a {
  color: var(--white);
}
.site-header.on-dark:not(.scrolled) .nav-links a:hover,
.site-header.on-dark:not(.scrolled) .nav-links a.active {
  color: var(--gold-soft);
}
.site-header.on-dark:not(.scrolled) .burger span {
  background: var(--white);
}
.site-header.on-dark:not(.scrolled) .nav-cta {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--white);
}
.site-header.on-dark:not(.scrolled) .nav-cta:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.nav-inner {
  width: min(100% - 40px, 1280px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}
.logo-mark::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(196, 163, 90, 0.35);
}
.logo-mark span {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  transition: color 0.3s;
}
.logo-text strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.logo-text small {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
  font-weight: 500;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  position: relative;
  padding: 10px 16px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.3s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after,
.nav-links a:hover::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px; bottom: 4px;
  height: 1.5px;
  background: var(--gold);
  border-radius: 2px;
}
.nav-cta {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(20, 24, 32, 0.15);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  transition: all 0.3s var(--ease);
}
.nav-cta:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
  background: rgba(196, 163, 90, 0.08);
}

.burger {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  place-items: center;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}
.burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.25s;
  border-radius: 2px;
}
.burger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: rgba(11, 16, 32, 0.97);
  backdrop-filter: blur(20px);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 40px 32px 48px;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: color 0.25s;
}
.mobile-menu a:hover,
.mobile-menu a.active { color: var(--gold-soft); }
.mobile-menu-footer {
  margin-top: auto;
  padding-top: 32px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  background: var(--night);
  color: var(--white);
  overflow: hidden;
  padding: calc(var(--nav-h) + 40px) 0 80px;
}

/* Atmospheric layers */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(30, 77, 62, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(139, 58, 74, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(196, 163, 90, 0.12) 0%, transparent 50%),
    linear-gradient(165deg, #0b1020 0%, #121a2f 45%, #0e1528 100%);
}
.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23c4a35a' stroke-width='0.6'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z'/%3E%3Cpath d='M40 16 L64 40 L40 64 L16 40 Z'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}
.hero-orb-1 {
  width: 420px; height: 420px;
  background: rgba(196, 163, 90, 0.18);
  top: -10%; right: 10%;
  animation: floatOrb 12s ease-in-out infinite;
}
.hero-orb-2 {
  width: 320px; height: 320px;
  background: rgba(30, 77, 62, 0.35);
  bottom: 5%; left: -5%;
  animation: floatOrb 15s ease-in-out infinite reverse;
}
@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -24px); }
}

.hero-grid {
  position: relative;
  z-index: 2;
  width: min(100% - 48px, 1280px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
}

.hero-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  color: var(--gold-soft);
  opacity: 0.92;
  margin-bottom: 28px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3.2rem, 7vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero-title em {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--gold-soft);
  margin-top: 4px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-meta .dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.7;
}
.hero-desc {
  max-width: 32rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 40px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Portrait card */
.hero-portrait {
  position: relative;
  justify-self: end;
  width: min(100%, 400px);
}
.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(160deg, var(--night-3) 0%, var(--night-2) 50%, #0f1c2e 100%);
  border: 1px solid rgba(196, 163, 90, 0.25);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.portrait-frame::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 16px;
  border: 1px solid rgba(196, 163, 90, 0.18);
  z-index: 2;
  pointer-events: none;
}
.portrait-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px;
  text-align: center;
}
.portrait-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(196, 163, 90, 0.4);
  display: grid;
  place-items: center;
  position: relative;
}
.portrait-ring::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px dashed rgba(196, 163, 90, 0.2);
  animation: spinSlow 40s linear infinite;
}
@keyframes spinSlow {
  to { transform: rotate(360deg); }
}
.portrait-mono {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 500;
  color: var(--gold-soft);
  line-height: 1;
}
.portrait-label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.portrait-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--white);
}
.portrait-role {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 14rem;
  line-height: 1.5;
}
.portrait-badge {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--night);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(196, 163, 90, 0.35);
  z-index: 3;
}

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.hero-scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, rgba(196, 163, 90, 0.7), transparent);
  animation: scrollPulse 2.2s ease infinite;
}
@keyframes scrollPulse {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* =========================================================
   MARQUEE STRIP
   ========================================================= */
.marquee {
  background: var(--night-2);
  border-block: 1px solid rgba(196, 163, 90, 0.15);
  overflow: hidden;
  padding: 18px 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
  gap: 0;
}
.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding-inline: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
.marquee-track span::after {
  content: '✦';
  color: var(--gold);
  font-size: 0.6rem;
  opacity: 0.7;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* =========================================================
   QUOTE BAND
   ========================================================= */
.quote-band {
  position: relative;
  background: var(--ivory);
  padding: 100px 0;
  overflow: hidden;
}
.quote-band::before {
  content: '“';
  position: absolute;
  top: 20px;
  left: 8%;
  font-family: var(--font-display);
  font-size: clamp(10rem, 20vw, 18rem);
  line-height: 1;
  color: rgba(196, 163, 90, 0.12);
  pointer-events: none;
}
.quote-inner {
  position: relative;
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
  padding-inline: 24px;
}
.quote-text {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 28px;
}
.quote-text strong {
  font-style: normal;
  font-weight: 600;
  color: var(--gold-deep);
}
.quote-source {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* =========================================================
   ABOUT PREVIEW
   ========================================================= */
.about-preview {
  padding: 120px 0;
  background: var(--cream);
}
.about-preview-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 72px;
  align-items: center;
}
.about-visual {
  position: relative;
}
.about-visual-card {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, var(--night-2), var(--emerald));
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.about-visual-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z' fill='none' stroke='%23c4a35a' stroke-width='0.4' opacity='0.25'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  opacity: 0.5;
}
.about-visual-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px;
  background: linear-gradient(to top, rgba(11, 16, 32, 0.85) 0%, transparent 55%);
  color: var(--white);
  z-index: 1;
}
.about-visual-content .arabic {
  font-size: 1.6rem;
  color: var(--gold-soft);
  margin-bottom: 10px;
}
.about-visual-content h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.about-visual-content p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}
.about-float {
  position: absolute;
  right: -20px;
  top: 12%;
  background: var(--white);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  max-width: 180px;
  z-index: 2;
}
.about-float strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--gold-deep);
  line-height: 1;
  margin-bottom: 4px;
}
.about-float span {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.about-copy .eyebrow { margin-bottom: 18px; }
.about-copy .section-title { margin-bottom: 24px; }
.about-copy p {
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 1.02rem;
  line-height: 1.85;
}
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 36px 0 40px;
  padding: 28px 0;
  border-block: 1px solid var(--line);
}
.stat-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat-item span {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* =========================================================
   PILLARS
   ========================================================= */
.pillars {
  padding: 120px 0;
  background: var(--night);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.pillars::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 90% 10%, rgba(196, 163, 90, 0.1) 0%, transparent 50%);
  pointer-events: none;
}
.pillars-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 64px;
  position: relative;
}
.pillars-head .section-title { color: var(--white); max-width: 14ch; }
.pillars-head .section-lead { color: rgba(255, 255, 255, 0.5); }

.pillars-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  position: relative;
}
.pillar-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 36px 32px;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease),
              transform 0.4s var(--ease);
}
.pillar-card:hover {
  border-color: rgba(196, 163, 90, 0.35);
  background: rgba(196, 163, 90, 0.05);
  transform: translateY(-4px);
}
.pillar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.pillar-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 500;
  color: rgba(196, 163, 90, 0.35);
  line-height: 1;
}
.pillar-ar {
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  color: var(--gold-soft);
}
.pillar-card h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--white);
}
.pillar-card p {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.95rem;
  line-height: 1.75;
}
.pillars-cta {
  margin-top: 48px;
  position: relative;
}

/* =========================================================
   ACADEMY
   ========================================================= */
.academy {
  padding: 120px 0;
  background: var(--ivory);
  position: relative;
}
.academy-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  border-radius: 28px;
  overflow: hidden;
  background: var(--night);
  box-shadow: var(--shadow-soft);
  min-height: 520px;
}
.academy-copy {
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
  position: relative;
  z-index: 1;
}
.academy-copy .section-title {
  color: var(--white);
  margin: 16px 0 20px;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
}
.academy-copy p {
  color: rgba(255, 255, 255, 0.58);
  margin-bottom: 14px;
  line-height: 1.8;
  font-size: 0.98rem;
}
.academy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 36px;
}
.academy-tags span {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}
.academy-side {
  position: relative;
  background:
    radial-gradient(circle at 60% 40%, rgba(196, 163, 90, 0.2) 0%, transparent 50%),
    linear-gradient(160deg, var(--emerald) 0%, var(--night-2) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 36px;
  text-align: center;
  overflow: hidden;
}
.academy-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23c4a35a' stroke-width='0.4' opacity='0.2'/%3E%3Ccircle cx='50' cy='50' r='25' fill='none' stroke='%23c4a35a' stroke-width='0.4' opacity='0.2'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  opacity: 0.6;
}
.academy-emblem {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1.5px solid rgba(196, 163, 90, 0.5);
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  background: rgba(11, 16, 32, 0.3);
}
.academy-emblem span {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold-soft);
  letter-spacing: 0.08em;
}
.academy-side h3 {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 10px;
}
.academy-side p {
  position: relative;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.95rem;
  max-width: 16rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* =========================================================
   CONTACT PREVIEW / PAGE
   ========================================================= */
.contact-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
}
.contact-info {
  background:
    radial-gradient(ellipse at 20% 80%, rgba(196, 163, 90, 0.25) 0%, transparent 50%),
    linear-gradient(145deg, #b8943f, var(--gold));
  padding: 72px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--night);
}
.contact-info .eyebrow {
  color: var(--night);
  opacity: 0.7;
  margin-bottom: 16px;
}
.contact-info .section-title {
  margin-bottom: 18px;
  max-width: 12ch;
}
.contact-info > p {
  color: rgba(11, 16, 32, 0.7);
  margin-bottom: 36px;
  max-width: 28rem;
  line-height: 1.8;
}
.contact-rows {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.95rem;
  color: var(--night);
  font-weight: 500;
}
.contact-row .icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(11, 16, 32, 0.1);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.contact-row .icon svg {
  width: 18px;
  height: 18px;
}
.contact-row a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.contact-row a:hover { border-bottom-color: var(--night); }
.contact-row small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 2px;
}

.contact-form-wrap {
  background: var(--white);
  padding: 72px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.form-group { margin-bottom: 22px; }
.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-bottom: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s;
  font-size: 1rem;
}
.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: var(--gold);
}
.form-group input.error,
.form-group textarea.error {
  border-bottom-color: #c62828;
}
.form-group textarea {
  min-height: 110px;
  resize: vertical;
}
.field-error {
  color: #c62828;
  font-size: 0.78rem;
  margin-top: 6px;
}
.form-submit {
  margin-top: 8px;
  width: 100%;
  max-width: 220px;
}
.form-success {
  display: none;
  text-align: center;
  padding: 48px 16px;
}
.form-success.active { display: block; }
.form-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(30, 77, 62, 0.1);
  color: var(--emerald);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}
.form-success-icon svg { width: 28px; height: 28px; }
.form-success h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.form-success p { color: var(--muted); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--night);
  color: var(--white);
  padding: 72px 0 0;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-brand .logo-mark {
  margin-bottom: 18px;
}
.footer-brand p {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 28rem;
  margin-top: 14px;
}
.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 20px;
}
.footer-col a,
.footer-col p {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.92rem;
  margin-bottom: 12px;
  transition: color 0.25s;
  line-height: 1.5;
}
.footer-col a:hover { color: var(--gold-soft); }
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s var(--ease);
  margin: 0;
}
.footer-social a:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(196, 163, 90, 0.08);
}
.footer-social svg { width: 16px; height: 16px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.32);
}

/* =========================================================
   PAGE BANNER (inner pages)
   ========================================================= */
.page-hero {
  position: relative;
  padding: calc(var(--nav-h) + 80px) 0 80px;
  background: var(--night);
  color: var(--white);
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(30, 77, 62, 0.3) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 10% 80%, rgba(196, 163, 90, 0.1) 0%, transparent 50%);
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23c4a35a' stroke-width='0.6'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero .eyebrow { margin-bottom: 16px; }
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.page-hero p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.08rem;
  max-width: 32rem;
  line-height: 1.7;
}

/* =========================================================
   ABOUT PAGE
   ========================================================= */
.bio-layout {
  padding: 100px 0;
}
.bio-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 72px;
  align-items: start;
}
.bio-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  background: var(--night);
  border-radius: 22px;
  overflow: hidden;
  color: var(--white);
  box-shadow: var(--shadow-card);
}
.bio-photo {
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 40%, rgba(196, 163, 90, 0.2), transparent 60%),
    linear-gradient(160deg, var(--night-3), var(--night-2));
  display: grid;
  place-items: center;
  position: relative;
}
.bio-photo-mono {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1.5px solid rgba(196, 163, 90, 0.4);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--gold-soft);
  font-weight: 500;
}
.bio-sidebar-body { padding: 28px 24px 32px; }
.bio-sidebar-body h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.bio-sidebar-body .role {
  color: var(--gold-soft);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  margin-bottom: 22px;
}
.bio-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bio-meta li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}
.bio-meta svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.bio-content .block { margin-bottom: 48px; }
.bio-content .block h3 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.bio-content .block h3::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--gold);
  flex-shrink: 0;
}
.bio-content .block p {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 1.02rem;
  line-height: 1.85;
}
.pull-quote {
  margin: 40px 0;
  padding: 28px 32px;
  border-left: 3px solid var(--gold);
  background: var(--ivory);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.pull-quote p {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
  margin: 0 !important;
}

/* =========================================================
   SUFI PATH PAGE
   ========================================================= */
.path-intro {
  padding: 100px 0 60px;
}
.path-intro-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 64px;
  align-items: center;
}
.path-big-ar {
  font-family: var(--font-arabic);
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  line-height: 1.7;
  color: var(--gold);
  opacity: 0.25;
  text-align: right;
}
.path-intro-copy .eyebrow { margin-bottom: 16px; }
.path-intro-copy .section-title { margin-bottom: 20px; }
.path-intro-copy p {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 1.02rem;
  line-height: 1.85;
}

.stations {
  padding: 40px 0 100px;
}
.stations .section-title {
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stations .section-title::before {
  content: '';
  width: 36px;
  height: 2px;
  background: var(--gold);
}
.station {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 28px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  transition: background 0.3s;
}
.station:last-child { border-bottom: 1px solid var(--line); }
.station-num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 500;
  color: rgba(196, 163, 90, 0.35);
  line-height: 1;
}
.station h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.station .ar {
  font-family: var(--font-arabic);
  color: var(--gold-deep);
  font-size: 1.15rem;
  display: block;
  margin-bottom: 12px;
}
.station p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.98rem;
  max-width: 48rem;
}

.path-cta {
  padding: 0 0 100px;
}
.path-cta-panel {
  background: var(--night);
  border-radius: 28px;
  padding: 64px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.path-cta-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(196, 163, 90, 0.15) 0%, transparent 55%);
}
.path-cta-panel .section-title {
  color: var(--white);
  margin: 14px 0 16px;
  position: relative;
}
.path-cta-panel p {
  color: rgba(255, 255, 255, 0.55);
  max-width: 32rem;
  margin: 0 auto 32px;
  position: relative;
  line-height: 1.75;
}
.path-cta-panel .btn { position: relative; }

/* =========================================================
   GALLERY
   ========================================================= */
.gallery-section {
  padding: 80px 0 100px;
}
.gallery-note {
  text-align: center;
  color: var(--muted);
  margin-bottom: 40px;
  font-size: 0.95rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 200px;
  gap: 14px;
}
.g-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--night-2);
  display: flex;
  align-items: flex-end;
  padding: 24px;
  border: 1px solid var(--line);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  cursor: default;
}
.g-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}
.g-card:nth-child(1) { grid-column: span 5; grid-row: span 2; }
.g-card:nth-child(2) { grid-column: span 4; grid-row: span 1; }
.g-card:nth-child(3) { grid-column: span 3; grid-row: span 1; }
.g-card:nth-child(4) { grid-column: span 3; grid-row: span 1; }
.g-card:nth-child(5) { grid-column: span 4; grid-row: span 1; }
.g-card:nth-child(6) { grid-column: span 5; grid-row: span 1; }

.g-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0 L40 20 L20 40 L0 20 Z' fill='none' stroke='%23c4a35a' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
  background-size: 40px 40px;
}
.g-card:nth-child(odd) {
  background: linear-gradient(145deg, var(--night-2), var(--night-3));
}
.g-card:nth-child(even) {
  background: linear-gradient(145deg, var(--emerald), var(--night-2));
}
.g-card:nth-child(3) {
  background: linear-gradient(145deg, #3a2030, var(--night-2));
}
.g-card-body {
  position: relative;
  z-index: 1;
}
.g-card-body span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 6px;
  font-weight: 600;
}
.g-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--white);
}
.gallery-cta {
  text-align: center;
  margin-top: 56px;
}
.gallery-cta p {
  color: var(--muted);
  margin-bottom: 18px;
}

/* =========================================================
   REVEAL ANIMATIONS
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.45s; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero-portrait {
    justify-self: center;
    width: min(100%, 360px);
  }
  .about-preview-grid,
  .academy-panel,
  .path-intro-grid,
  .bio-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-float { display: none; }
  .bio-sidebar { position: static; max-width: 360px; }
  .pillars-list { grid-template-columns: 1fr; }
  .pillars-head { flex-direction: column; align-items: flex-start; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 220px;
  }
  .g-card:nth-child(n) {
    grid-column: span 1;
    grid-row: span 1;
  }
  .g-card:nth-child(1) { grid-column: span 2; grid-row: span 1; }
}

@media (max-width: 820px) {
  .nav-links,
  .nav-cta { display: none; }
  .burger { display: flex; }
  .contact-block { grid-template-columns: 1fr; }
  .contact-info,
  .contact-form-wrap { padding: 36px 20px; }
  .academy-copy { padding: 36px 20px; }
  .path-cta-panel { padding: 36px 20px; }
  .about-stats { grid-template-columns: 1fr; gap: 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .station { grid-template-columns: 44px 1fr; gap: 14px; padding: 20px 16px; }
}

@media (max-width: 560px) {
  :root { --nav-h: 68px; }
  .container { width: min(100% - 28px, var(--max)); }
  .hero { padding-bottom: 72px; padding-top: calc(var(--nav-h) + 24px); min-height: auto; }
  .hero-title { font-size: clamp(2.1rem, 8vw, 3.2rem) !important; line-height: 1.15; }
  .hero-meta { flex-wrap: wrap; justify-content: center; gap: 6px 10px; font-size: 0.8rem; }
  .hero-meta .dot { opacity: 0.5; }
  .hero-desc { font-size: 0.95rem; margin-top: 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; width: 100%; gap: 10px; }
  .btn { width: 100%; justify-content: center; text-align: center; }
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }
  .g-card:nth-child(n) { grid-column: span 1; }
  .path-big-ar { text-align: center; font-size: 2rem; margin-bottom: 16px; }
  .about-preview,
  .pillars,
  .academy,
  .bio-layout,
  .path-intro { padding-top: 48px; padding-bottom: 48px; }
  input, select, textarea { font-size: 16px !important; } /* Prevents iOS auto-zoom on form inputs */
}

/* =========================================================
   FAMILY TREE (Shajra-e-Nasab) PAGE STYLES
   ========================================================= */
.ft-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 36px;
}
.ft-stat-badge {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-light);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
}
.ft-stat-badge strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-soft);
  line-height: 1.1;
}
.ft-stat-badge span {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.ft-controls-section {
  padding: 24px 0 0;
  position: sticky;
  top: var(--nav-h);
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(251, 249, 245, 0.92);
  border-bottom: 1px solid var(--line);
}
.ft-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 20px;
}
.ft-search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 480px;
}
.ft-search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.ft-search-box input {
  width: 100%;
  padding: 12px 40px 12px 46px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ft-search-box input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(196, 163, 90, 0.15);
}
.ft-search-box #clearSearch {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  display: none;
  line-height: 1;
}

.ft-tree-switcher {
  display: inline-flex;
  gap: 6px;
  background: rgba(20, 24, 32, 0.05);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  flex-wrap: wrap;
}
.ft-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.ft-tab-btn svg {
  width: 16px;
  height: 16px;
}
.ft-tab-btn:hover {
  color: var(--gold-deep);
}
.ft-tab-btn.active {
  background: var(--night);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(11, 16, 32, 0.12);
}

.ft-durood-banner {
  margin: 22px auto 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(196, 163, 90, 0.1), rgba(30, 77, 62, 0.06));
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  max-width: 620px;
}
.ft-durood-text {
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  color: var(--emerald);
  line-height: 1.75;
  direction: rtl;
  margin: 0;
}

.ft-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ft-pill {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}
.ft-pill:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
}
.ft-pill.active {
  background: var(--night);
  color: var(--white);
  border-color: var(--night);
}

.ft-tree-section {
  padding: 60px 0 100px;
  background: var(--cream);
}
.ft-wrap {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

/* Arch Card */
.ft-arch-card {
  position: relative;
  max-width: 580px;
  margin: 0 auto 50px;
  padding: 44px 36px 32px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-card);
}
.ft-arch-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  border: 1px solid rgba(196, 163, 90, 0.25);
  pointer-events: none;
}
.ft-bismillah {
  font-size: 2.2rem;
  color: var(--emerald);
  margin-bottom: 12px;
  line-height: 1.3;
}
.ft-kicker {
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: 6px;
}
.ft-title-ar {
  font-size: 2rem;
  color: var(--night);
  margin-bottom: 2px;
}
.ft-title-en {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 6px;
}
.ft-silsila {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--rose);
}
.ft-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 20px 0;
}
.ft-ornament .rule {
  height: 1px;
  width: 70px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.ft-ornament .rule.right {
  background: linear-gradient(90deg, var(--gold), transparent);
}
.ft-ornament .diamond {
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
}

.ft-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  font-size: 0.84rem;
  color: var(--muted);
}
.ft-legend span { display: inline-flex; align-items: center; gap: 8px; }
.ft-legend i { width: 10px; height: 10px; border-radius: 2px; }
.ft-legend i.t1 { background: var(--rose); }
.ft-legend i.t2 { background: var(--gold-deep); }
.ft-legend i.t3 { background: var(--emerald); }

/* Timeline */
.ft-timeline {
  position: relative;
  padding-top: 10px;
}
.ft-timeline::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    var(--gold) 0px,
    var(--gold) 4px,
    transparent 4px,
    transparent 10px
  );
}

/* ---------- Root Node (Prophet Muhammad - Center) ---------- */
.ft-root-wrap {
  text-align: center;
  position: relative;
  margin-bottom: 24px;
}
.ft-root-node {
  width: 100% !important;
  max-width: 320px;
  margin: 0 auto !important;
  text-align: center !important;
}
.ft-root-node .ft-card {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--white), #fbf5e6);
  box-shadow: 0 6px 24px rgba(196, 163, 90, 0.2);
}
.ft-root-node .ft-dot {
  left: 50% !important;
  right: auto !important;
  top: -10px !important;
  transform: translateX(-50%) rotate(45deg) !important;
  border-color: var(--gold-deep);
  background: var(--gold-soft);
}
.ft-root-node .ft-gen-idx {
  left: 50% !important;
  top: -30px !important;
  transform: translateX(-50%);
}
.ft-root-line {
  width: 2px;
  height: 32px;
  background: var(--gold);
  margin: 0 auto;
}

/* ---------- Couple Node (PC Desktop View: Imam Ali Left & Bibi Fatimah Right) ---------- */
.ft-couple-wrap {
  position: relative;
  margin-bottom: 36px;
}
.ft-couple-branch-line {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  height: 2px;
  background: var(--gold);
}
.ft-couple-branch-line::before,
.ft-couple-branch-line::after {
  content: "";
  position: absolute;
  top: 0;
  width: 2px;
  height: 20px;
  background: var(--gold);
}
.ft-couple-branch-line::before { left: 0; }
.ft-couple-branch-line::after { right: 0; }

.ft-couple-nodes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 760px;
  margin: 20px auto 0;
}

.ft-couple-left,
.ft-couple-right {
  flex: 1;
  width: auto !important;
  margin: 0 !important;
}
.ft-couple-left { text-align: right !important; }
.ft-couple-right { text-align: left !important; }

.ft-couple-left .ft-dot { right: -28px !important; left: auto !important; }
.ft-couple-right .ft-dot { left: -28px !important; right: auto !important; }

.ft-couple-left .ft-gen-idx { left: -36px !important; right: auto !important; }
.ft-couple-right .ft-gen-idx { right: -36px !important; left: auto !important; }

.ft-couple-stem {
  width: 2px;
  height: 32px;
  background: var(--gold);
  margin: 20px auto 0;
}

/* ---------- Couple Single Card (Mobile View: Maula Ali A.S. Top & Bibi Fatimah S.A. Below) ---------- */
.ft-couple-single-card {
  border-color: var(--gold) !important;
  background: linear-gradient(180deg, var(--white), #fdfaf3) !important;
  text-align: center;
}
.ft-couple-section {
  padding: 4px 0;
}
.ft-couple-divider {
  position: relative;
  text-align: center;
  margin: 12px 0;
}
.ft-couple-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.ft-couple-icon {
  position: relative;
  z-index: 1;
  background: var(--white);
  padding: 0 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--gold-deep);
  font-weight: 700;
}
[data-theme="dark"] .ft-couple-single-card {
  background: linear-gradient(180deg, #1d2538, #111827) !important;
  border-color: rgba(196, 163, 90, 0.6) !important;
}
[data-theme="dark"] .ft-couple-icon {
  background: #111827 !important;
  color: #e2c98a !important;
}

/* Desktop vs Mobile Couple Display Rules */
@media (min-width: 769px) {
  .ft-desktop-couple { display: block !important; }
  .ft-mobile-couple { display: none !important; }
}

@media (max-width: 768px) {
  .ft-desktop-couple { display: none !important; }
  .ft-mobile-couple { display: block !important; }
}

.ft-node {
  position: relative;
  width: calc(50% - 36px);
  margin-bottom: 28px;
  transition: opacity 0.4s, transform 0.4s;
}
.ft-node:nth-of-type(odd) { margin-right: auto; text-align: right; }
.ft-node:nth-of-type(even) { margin-left: auto; text-align: left; }

.ft-gen-idx {
  position: absolute;
  top: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.4;
  letter-spacing: 0.05em;
}
.ft-node:nth-of-type(odd) .ft-gen-idx { left: -42px; }
.ft-node:nth-of-type(even) .ft-gen-idx { right: -42px; }

.ft-dot {
  position: absolute;
  top: 20px;
  width: 14px;
  height: 14px;
  background: var(--white);
  border: 2.5px solid var(--gold);
  transform: rotate(45deg);
  z-index: 2;
  transition: transform 0.3s, background 0.3s;
}
.ft-node:nth-of-type(odd) .ft-dot { right: -43px; }
.ft-node:nth-of-type(even) .ft-dot { left: -43px; }

.ft-node.tier1 .ft-dot { border-color: var(--gold); background: #fdfaf2; }
.ft-node.tier2 .ft-dot { border-color: var(--gold-deep); background: #fdfaf2; }
.ft-node.tier3 .ft-dot { border-color: var(--emerald); background: #f3f8f5; }

.ft-card {
  display: inline-block;
  max-width: 100%;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 16px 22px;
  box-shadow: 0 4px 16px rgba(11, 16, 32, 0.04);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  text-align: inherit;
}
.ft-node:hover .ft-card {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(11, 16, 32, 0.08);
}
.ft-node.tier1 .ft-card { border-color: rgba(196, 163, 90, 0.4); background: linear-gradient(180deg, var(--white), #fdfaf3); }
.ft-node.tier2 .ft-card { border-color: rgba(194, 163, 90, 0.35); background: linear-gradient(180deg, var(--white), #fdfaf3); }
.ft-node.tier3 .ft-card { border-color: rgba(30, 77, 62, 0.3); background: linear-gradient(180deg, var(--white), #f4f8f6); }
.ft-node.highlight .ft-card {
  border-color: var(--gold);
  box-shadow: 0 8px 30px rgba(196, 163, 90, 0.22);
  background: linear-gradient(180deg, var(--white), #fbf5e6);
}

.ft-parent-node {
  width: 100% !important;
  max-width: 360px;
  margin: 0 auto 0 !important;
  text-align: center !important;
}
.ft-parent-node .ft-dot {
  top: -8px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) rotate(45deg) !important;
}
.ft-parent-node .ft-gen-idx {
  left: 50% !important;
  right: auto !important;
  top: -26px !important;
  transform: translateX(-50%);
}

.ft-honor {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: block;
  margin-bottom: 3px;
}
.ft-node.tier1 .ft-honor { color: var(--rose); }
.ft-node.tier3 .ft-honor { color: var(--emerald); }

.ft-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1.3;
}
.ft-node.tier1 .ft-name { font-size: 1.38rem; color: var(--night); }

.ft-salu {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}
.ft-urf {
  font-size: 0.85rem;
  color: var(--rose);
  font-style: italic;
  display: block;
  margin-top: 2px;
}

.ft-divider {
  position: relative;
  text-align: center;
  margin: 50px 0 36px;
}
.ft-divider span {
  position: relative;
  z-index: 2;
  background: var(--cream);
  padding: 0 20px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--night);
}
.ft-divider::before {
  content: "";
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--line);
}

/* Fork Wrap */
.ft-fork-wrap {
  position: relative;
  margin-top: 0;
  padding-top: 24px;
}
.ft-fork-wrap::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 2px; height: 24px;
  transform: translateX(-50%);
  background: var(--gold);
}
.ft-fork-line {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  height: 2px;
  background: var(--gold);
}
.ft-fork-line::before, .ft-fork-line::after {
  content: "";
  position: absolute;
  top: 0; width: 2px; height: 20px;
  background: var(--gold);
}
.ft-fork-line::before { left: 0; }
.ft-fork-line::after { right: 0; }

.ft-fork-cards {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 540px;
  margin: 20px auto 0;
}
.ft-fork-card {
  flex: 1;
  text-align: center;
  border-color: rgba(196, 163, 90, 0.4);
  background: linear-gradient(180deg, var(--white), #fbf5e8);
}

.ft-footer {
  text-align: center;
  margin-top: 72px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.ft-blessing {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
}
.ft-fname {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-top: 8px;
  font-weight: 600;
}

.ft-no-results {
  text-align: center;
  padding: 60px 0;
}
.ft-no-results p {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 18px;
}

@media (max-width: 768px) {
  /* Site Header Mobile */
  .site-header { padding: 0 16px !important; }
  .nav-inner { padding: 0 !important; }
  .logo-text strong { font-size: 0.9rem !important; }
  .logo-text small { font-size: 0.65rem !important; }
  .logo-mark { width: 34px !important; height: 34px !important; }
  .logo-mark span { font-size: 1rem !important; }
  .burger { display: flex !important; width: 44px; height: 44px; align-items: center; justify-content: center; background: transparent; border: none; }
  .burger span { width: 22px !important; height: 2px !important; }

  /* Mobile Drawer Menu */
  .mobile-menu {
    inset: 0 0 0 0 !important;
    top: var(--nav-h) !important;
    padding: 24px 20px 36px !important;
    gap: 4px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-menu a {
    font-size: 1.35rem !important;
    padding: 12px 14px !important;
    border-radius: 10px !important;
    border-bottom: 1px solid var(--line-light) !important;
  }
  .mobile-menu-footer {
    margin-top: auto;
    padding-top: 24px;
    font-size: 0.8rem !important;
    line-height: 1.5;
  }

  /* Sticky Controls & Switcher Section */
  .ft-controls-section {
    padding: 14px 0 10px !important;
    position: relative !important; /* Non-sticky on mobile to keep viewport open */
    top: 0 !important;
  }
  .ft-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding-bottom: 8px !important;
  }
  .ft-tree-switcher {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
    gap: 4px !important;
    padding: 4px !important;
    border-radius: 999px !important;
  }
  .ft-tab-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 8px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    white-space: nowrap !important;
    border-radius: 999px !important;
  }
  .ft-tab-btn svg { display: none !important; } /* Hide icon to save space */
  .ft-search-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .ft-search-box input {
    font-size: 0.85rem !important;
    padding: 10px 36px 10px 42px !important;
    height: 42px !important;
  }

  /* Durood Banner */
  .ft-durood-banner {
    margin: 14px auto 0 !important;
    padding: 14px 16px !important;
    border-radius: 12px !important;
  }
  .ft-durood-text {
    font-size: 1.15rem !important;
    line-height: 1.6 !important;
  }

  /* Shajra Arch Card */
  .ft-arch-card {
    padding: 24px 18px 20px !important;
    margin-bottom: 30px !important;
    border-radius: 16px !important;
  }
  .ft-bismillah { font-size: 1.6rem !important; margin-bottom: 8px !important; }
  .ft-title-ar { font-size: 1.5rem !important; }
  .ft-title-en { font-size: 1.3rem !important; }
  .ft-silsila { font-size: 0.95rem !important; }
  .ft-ornament .rule { width: 40px !important; }
  .ft-legend { gap: 10px 12px !important; font-size: 0.76rem !important; justify-content: center !important; }

  /* FAMILY TREE UNIFIED MOBILE TIMELINE */
  .ft-tree-section { padding: 24px 0 60px !important; }
  .ft-wrap { padding: 0 4px !important; }

  /* Single Continuous Left Timeline Line */
  .ft-timeline::before {
    left: 20px !important;
    width: 2px !important;
  }

  /* ALL Nodes aligned along the timeline */
  .ft-root-node,
  .ft-couple-left,
  .ft-couple-right,
  .ft-parent-node,
  .ft-mobile-couple,
  .ft-node,
  .ft-node:nth-of-type(odd),
  .ft-node:nth-of-type(even) {
    width: calc(100% - 46px) !important;
    max-width: none !important;
    margin-left: 46px !important;
    margin-right: 0 !important;
    margin-bottom: 32px !important; /* Explicit 32px gap between cards on mobile */
    text-align: left !important;
    position: relative !important;
  }

  /* Dots perfectly centered on timeline line at left: 20px (46px - 26px = 20px line center!) */
  .ft-root-node .ft-dot,
  .ft-couple-left .ft-dot,
  .ft-couple-right .ft-dot,
  .ft-parent-node .ft-dot,
  .ft-node .ft-dot,
  .ft-node:nth-of-type(odd) .ft-dot,
  .ft-node:nth-of-type(even) .ft-dot {
    top: 20px !important;
    left: -33px !important;
    right: auto !important;
    transform: rotate(45deg) !important;
    width: 14px !important;
    height: 14px !important;
  }

  /* Root Node Line Overrides */
  .ft-root-line { display: none !important; }
  .ft-root-wrap { margin-bottom: 24px !important; text-align: left !important; }

  /* Couple Nodes Stacking */
  .ft-couple-wrap { margin-bottom: 24px !important; }
  .ft-couple-branch-line,
  .ft-couple-stem { display: none !important; }
  .ft-couple-nodes {
    flex-direction: column !important;
    gap: 16px !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  /* Generation Badges Visible on Top-Right of Cards */
  .ft-gen-idx,
  .ft-node:nth-of-type(odd) .ft-gen-idx,
  .ft-node:nth-of-type(even) .ft-gen-idx,
  .ft-couple-left .ft-gen-idx,
  .ft-couple-right .ft-gen-idx,
  .ft-root-node .ft-gen-idx,
  .ft-parent-node .ft-gen-idx {
    display: inline-block !important;
    position: absolute !important;
    top: 12px !important;
    right: 14px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    opacity: 0.85 !important;
    background: rgba(196, 163, 90, 0.15);
    color: var(--gold-deep) !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(196, 163, 90, 0.3);
  }

  /* Cards Mobile Polish */
  .ft-card {
    display: block !important;
    width: 100% !important;
    padding: 14px 16px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }
  .ft-name { font-size: 1.08rem !important; line-height: 1.35 !important; padding-right: 48px; }
  .ft-root-node .ft-name { font-size: 1.18rem !important; }
  .ft-node.tier1 .ft-name { font-size: 1.1rem !important; }
  .ft-node.tier2 .ft-name,
  .ft-node.tier3 .ft-name { font-size: 1.02rem !important; }
  .ft-honor { font-size: 0.68rem !important; margin-bottom: 2px !important; }
  .ft-salu { font-size: 0.8rem !important; margin-top: 2px !important; }
  .ft-urf { font-size: 0.8rem !important; margin-top: 2px !important; }

  /* Fork wrap cards */
  .ft-fork-wrap { margin-top: 24px !important; padding-top: 16px !important; }
  .ft-fork-wrap::before { display: none !important; }
  .ft-fork-line { display: none !important; }
  .ft-fork-cards { flex-direction: column !important; gap: 14px !important; }
  .ft-fork-card {
    width: calc(100% - 46px) !important;
    margin-left: 46px !important;
    margin-right: 0 !important;
    text-align: left !important;
    padding: 14px 16px !important;
    border-radius: 12px !important;
  }

  /* Divider */
  .ft-divider { margin: 32px 0 24px !important; }
  .ft-divider span { font-size: 0.72rem !important; padding: 0 12px !important; }

  /* Page Hero on Mobile */
  .page-hero { padding: 64px 0 32px !important; text-align: center; }
  .page-hero h1 { font-size: 1.9rem !important; line-height: 1.25 !important; }
  .page-hero .eyebrow { font-size: 0.68rem !important; letter-spacing: 0.2em !important; }
  .page-hero p { font-size: 0.88rem !important; }

  /* Footer Mobile */
  .footer-top { grid-template-columns: 1fr !important; gap: 28px !important; }
  .footer-brand { text-align: center; }
  .footer-social { justify-content: center; }
  .footer-col { text-align: center; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .site-footer { padding: 36px 0 20px !important; }
  .site-footer .container { padding: 0 16px !important; }
}

@media (max-width: 480px) {
  :root { --nav-h: 64px; }
  .container { width: min(100% - 24px, var(--max)); }

  /* Extra small screens timeline line & padding tweak */
  .ft-timeline::before { left: 16px !important; }
  .ft-root-node,
  .ft-couple-left,
  .ft-couple-right,
  .ft-parent-node,
  .ft-mobile-couple,
  .ft-node,
  .ft-node:nth-of-type(odd),
  .ft-node:nth-of-type(even),
  .ft-fork-card {
    width: calc(100% - 38px) !important;
    margin-left: 38px !important;
    margin-bottom: 28px !important;
  }
  .ft-root-node .ft-dot,
  .ft-couple-left .ft-dot,
  .ft-couple-right .ft-dot,
  .ft-parent-node .ft-dot,
  .ft-node .ft-dot,
  .ft-node:nth-of-type(odd) .ft-dot,
  .ft-node:nth-of-type(even) .ft-dot {
    left: -29px !important;
  }
  .ft-name { font-size: 1rem !important; }
  .ft-tab-btn { font-size: 0.74rem !important; padding: 8px 6px !important; }
}

/* =========================================================
   EXPLICIT LIGHT & DARK MODE SYSTEM
   ========================================================= */

/* Light Mode Rules */
[data-theme="light"],
html:not([data-theme="dark"]) {
  --night:        #0b1020;
  --night-2:      #121a2f;
  --night-3:      #1a2440;
  --ink:          #141820;
  --ink-soft:     #3a4254;
  --muted:        #6b7285;
  --line:         rgba(20, 24, 32, 0.08);
  --line-light:   rgba(255, 255, 255, 0.1);
  --gold:         #c4a35a;
  --gold-soft:    #e2c98a;
  --gold-deep:    #9a7b35;
  --ivory:        #f8f4ec;
  --ivory-2:      #efe8da;
  --white:        #ffffff;
  --cream:        #fbf9f5;
  --rose:         #8b3a4a;
  --emerald:      #1e4d3e;
}

[data-theme="light"] body,
html:not([data-theme="dark"]) body {
  background: #fbf9f5 !important;
  color: #141820 !important;
}

[data-theme="light"] .ft-card,
html:not([data-theme="dark"]) .ft-card {
  background: #ffffff !important;
  border-color: rgba(20, 24, 32, 0.12) !important;
  color: #141820 !important;
  box-shadow: 0 12px 40px rgba(11, 16, 32, 0.08) !important;
}

[data-theme="light"] .ft-name,
html:not([data-theme="dark"]) .ft-name {
  color: #141820 !important;
}

[data-theme="light"] .ft-salu,
html:not([data-theme="dark"]) .ft-salu {
  color: #6b7285 !important;
}

[data-theme="light"] .ft-honor,
html:not([data-theme="dark"]) .ft-honor {
  color: #9a7b35 !important;
}

/* =========================================================
   UNIVERSAL DARK MODE OVERRIDES (PURE WHITE TEXT)
   ========================================================= */

[data-theme="dark"] {
  --night:        #070b14;
  --night-2:      #0d1322;
  --night-3:      #141d33;
  --ink:          #ffffff;
  --ink-soft:     #f3f4f6;
  --muted:        #d1d5db;
  --line:         rgba(255, 255, 255, 0.15);
  --line-light:   rgba(255, 255, 255, 0.2);
  --white:        #111827;
  --cream:        #070a12;
  --ivory:        #161f33;
  --ivory-2:      #1d2840;
  --rose:         #f472b6;
  --emerald:      #34d399;
  --gold-deep:    #e2c98a;
  --shadow-card:  0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-soft:  0 20px 60px rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] body,
[data-theme="dark"] main,
[data-theme="dark"] section,
[data-theme="dark"] .ft-tree-section,
[data-theme="dark"] .site-footer {
  background: #070a12 !important;
  color: #ffffff !important;
}

/* Headings, Titles & Strong Labels — Pure Crisp White */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] strong,
[data-theme="dark"] b,
[data-theme="dark"] label,
[data-theme="dark"] .ft-name,
[data-theme="dark"] .section-title,
[data-theme="dark"] .hero-title,
[data-theme="dark"] .page-hero h1,
[data-theme="dark"] .bio-name,
[data-theme="dark"] .station-title,
[data-theme="dark"] .pillar-title,
[data-theme="dark"] .academy-title,
[data-theme="dark"] .g-title,
[data-theme="dark"] .contact-title,
[data-theme="dark"] .footer-col h4,
[data-theme="dark"] .logo-text strong {
  color: #ffffff !important;
}

/* Paragraphs, Body Text, Links & List Items — Bright Light White/Gray */
[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] span,
[data-theme="dark"] a,
[data-theme="dark"] small,
[data-theme="dark"] div,
[data-theme="dark"] .hero-desc,
[data-theme="dark"] .section-lead,
[data-theme="dark"] .ft-honor,
[data-theme="dark"] .bio-body p,
[data-theme="dark"] .bio-role,
[data-theme="dark"] .station-desc,
[data-theme="dark"] .pillar-desc,
[data-theme="dark"] .academy-text,
[data-theme="dark"] .contact-item p,
[data-theme="dark"] .g-subtitle,
[data-theme="dark"] .footer-brand p,
[data-theme="dark"] .footer-col a,
[data-theme="dark"] .footer-bottom span {
  color: #e5e7eb !important;
}

/* Salawat, Accents & Gold Highlights */
[data-theme="dark"] .ft-salu,
[data-theme="dark"] .station-quote,
[data-theme="dark"] .quote-author,
[data-theme="dark"] .eyebrow,
[data-theme="dark"] .logo-text small,
[data-theme="dark"] .contact-item a,
[data-theme="dark"] .bio-meta-row strong {
  color: #e2c98a !important;
}

[data-theme="dark"] .ft-gen-idx,
[data-theme="dark"] .station-num {
  color: #c4a35a !important;
}

/* Cards & Container Panels in Dark Mode */
[data-theme="dark"] .about-preview,
[data-theme="dark"] .bio-layout,
[data-theme="dark"] .bio-sidebar,
[data-theme="dark"] .bio-content,
[data-theme="dark"] .pillar-card,
[data-theme="dark"] .academy-card,
[data-theme="dark"] .station,
[data-theme="dark"] .path-cta-panel,
[data-theme="dark"] .quote-band,
[data-theme="dark"] .g-card,
[data-theme="dark"] .contact-info,
[data-theme="dark"] .contact-form-wrap,
[data-theme="dark"] .ft-controls-section,
[data-theme="dark"] .ft-card,
[data-theme="dark"] .ft-fork-card {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Header & Navigation in Dark Mode */
[data-theme="dark"] .site-header,
[data-theme="dark"] .site-header.scrolled {
  background: rgba(7, 10, 18, 0.95) !important;
  border-bottom-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6) !important;
}
[data-theme="dark"] .site-header .nav-links a {
  color: #ffffff !important;
}
[data-theme="dark"] .site-header .nav-links a:hover,
[data-theme="dark"] .site-header .nav-links a.active {
  color: #e2c98a !important;
}
[data-theme="dark"] .site-header .burger span {
  background: #ffffff !important;
}

/* Mobile Drawer Menu in Dark Mode */
[data-theme="dark"] .mobile-menu {
  background: #0d1322 !important;
  color: #ffffff !important;
  border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
}
[data-theme="dark"] .mobile-menu a {
  color: #ffffff !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] .mobile-menu a:hover,
[data-theme="dark"] .mobile-menu a.active {
  color: #e2c98a !important;
  background: rgba(196, 163, 90, 0.15) !important;
}
[data-theme="dark"] .mobile-menu-footer {
  color: #d1d5db !important;
  border-top-color: rgba(255, 255, 255, 0.15) !important;
}

/* Form Inputs & Controls in Dark Mode */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #9ca3af !important;
}

/* Tree Controls in Dark Mode */
[data-theme="dark"] .ft-tree-switcher {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
[data-theme="dark"] .ft-tab-btn {
  color: #d1d5db !important;
}
[data-theme="dark"] .ft-tab-btn.active {
  background: #c4a35a !important;
  color: #070b14 !important;
  font-weight: 700 !important;
}

/* Family Tree Node Border Accent Overrides in Dark Mode */
[data-theme="dark"] .ft-node.tier1 .ft-card {
  background: linear-gradient(180deg, #1d2538, #111827) !important;
  border-color: rgba(196, 163, 90, 0.5) !important;
}
[data-theme="dark"] .ft-node.tier2 .ft-card {
  background: linear-gradient(180deg, #221c12, #111827) !important;
  border-color: rgba(226, 201, 138, 0.4) !important;
}
[data-theme="dark"] .ft-node.tier3 .ft-card {
  background: linear-gradient(180deg, #0e2019, #111827) !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
}
[data-theme="dark"] .ft-node.highlight .ft-card,
[data-theme="dark"] .ft-fork-card {
  background: linear-gradient(180deg, #261f13, #111827) !important;
  border-color: #c4a35a !important;
}
[data-theme="dark"] .ft-node.tier1 .ft-dot { background: #382b14 !important; border-color: #c4a35a !important; }
[data-theme="dark"] .ft-node.tier2 .ft-dot { background: #382b14 !important; }
[data-theme="dark"] .ft-node.tier3 .ft-dot { background: #0f3325 !important; }

/* Theme Toggle Button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--line-light);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
  transform: scale(1.05);
}
.site-header.scrolled .theme-toggle {
  border-color: var(--line);
  color: var(--ink);
  background: var(--white);
}
[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #e2c98a !important;
  background: rgba(255, 255, 255, 0.1) !important;
}
.theme-toggle .sun-icon { display: none; width: 18px; height: 18px; }
.theme-toggle .moon-icon { display: block; width: 18px; height: 18px; }

[data-theme="dark"] .theme-toggle .sun-icon { display: block !important; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none !important; }

.mobile-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--line-light);
  margin-top: 16px;
  color: #ffffff;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Button Overrides in Dark Mode */
[data-theme="dark"] .btn-dark,
[data-theme="dark"] button[type="submit"],
[data-theme="dark"] .form-submit {
  background: linear-gradient(135deg, #e2c98a, #c4a35a) !important;
  color: #070b14 !important;
  font-weight: 700 !important;
  border: 1px solid #c4a35a !important;
  box-shadow: 0 10px 30px rgba(196, 163, 90, 0.4) !important;
}

[data-theme="dark"] .btn-dark:hover,
[data-theme="dark"] button[type="submit"]:hover,
[data-theme="dark"] .form-submit:hover {
  background: linear-gradient(135deg, #ffffff, #e2c98a) !important;
  color: #070b14 !important;
  box-shadow: 0 14px 40px rgba(196, 163, 90, 0.6) !important;
  transform: translateY(-2px) !important;
}

[data-theme="dark"] .btn-outline {
  background: transparent !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] .btn-outline:hover {
  background: rgba(196, 163, 90, 0.15) !important;
  color: #e2c98a !important;
  border-color: #c4a35a !important;
}



/* Family tree responsive refinements */
.ft-tab-label-short {
  display: none;
}

.ft-search-hidden {
  display: none !important;
}

.ft-wrap.is-filtering .ft-footer,
.ft-wrap.is-empty .ft-timeline::before {
  display: none;
}

@media (max-width: 768px) {
  .ft-tree-section {
    scroll-margin-top: calc(var(--nav-h) + 12px);
  }

  .ft-tree-switcher,
  .ft-tab-btn {
    min-width: 0 !important;
  }

  .ft-tab-btn {
    min-height: 44px;
    overflow: hidden;
    white-space: normal !important;
    line-height: 1.15;
  }

  .ft-tab-label-full {
    display: none;
  }

  .ft-tab-label-short {
    display: inline;
  }

  .ft-node > .ft-card {
    padding-top: 42px !important;
  }

  .ft-name,
  .ft-couple-single-card .ft-name {
    padding-right: 0 !important;
    overflow-wrap: anywhere;
  }

  .ft-fork-wrap {
    margin-top: 0 !important;
    padding-top: 16px !important;
  }

  .ft-fork-wrap::before {
    display: block !important;
    top: -32px !important;
    bottom: 0 !important;
    left: 20px !important;
    width: 2px !important;
    height: auto !important;
    transform: translateX(-50%) !important;
    background: repeating-linear-gradient(
      to bottom,
      var(--gold) 0,
      var(--gold) 4px,
      transparent 4px,
      transparent 10px
    ) !important;
  }

  .ft-fork-cards {
    margin: 0 !important;
  }

  .ft-fork-card {
    position: relative;
  }

  .ft-fork-card::before {
    content: "";
    position: absolute;
    top: 20px;
    left: -33px;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    background: var(--white);
    border: 2.5px solid var(--emerald);
    transform: rotate(45deg);
    z-index: 2;
  }

  .page-hero {
    padding: calc(var(--nav-h) + 24px) 0 32px !important;
  }
}

@media (max-width: 480px) {
  .ft-fork-wrap::before {
    left: 16px !important;
  }

  .ft-fork-card::before {
    left: -29px;
  }
}
