/* ===================================================================
   الموقع الرسميّ · آل فُهَيد وقرية العَمَار التراثيّة
   Lighter cream background + 14 subtle motions
   =================================================================== */

:root {
  /* Lighter background palette */
  --c-bg:      #FCF7EC;   /* lighter cream — main background */
  --c-bg-soft: #FDFAF2;   /* even lighter — surfaces */
  --c-surface: #FFFFFF;   /* pure white — top surfaces */
  --c-peach:   #ECCFAE;
  --c-peach-2: #E2B98C;
  --c-gold:    #D9A24A;
  --c-gold-2:  #B8842E;
  --c-olive:   #5F6F3C;
  --c-olive-2: #44512A;
  --c-ink:     #1A3140;
  --c-ink-2:   #0F1F2A;

  --c-line:    rgba(26, 49, 64, 0.10);
  --c-line-2:  rgba(26, 49, 64, 0.05);
  --c-muted:   #6B7A82;
  --c-muted-2: #8E9CA4;

  --ff-display: 'Reem Kufi', 'Cairo', system-ui, sans-serif;
  --ff-body:    'Cairo', 'Tajawal', system-ui, sans-serif;
  --ff-quote:   'Amiri', 'Cairo', serif;

  --container: 1240px;
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(26, 49, 64, 0.05);
  --shadow:    0 8px 28px rgba(26, 49, 64, 0.08);
  --shadow-lg: 0 24px 60px rgba(26, 49, 64, 0.12);

  --t-fast: 160ms cubic-bezier(.2,.8,.2,1);
  --t-base: 320ms cubic-bezier(.2,.8,.2,1);
  --t-slow: 540ms cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--ff-body);
  background: var(--c-bg);
  color: var(--c-ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-ink); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--c-gold); color: var(--c-surface); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ===== Motion 1: Scroll progress bar ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--c-olive), var(--c-gold));
  z-index: 999;
  transition: width 50ms linear;
  border-radius: 0 0 3px 3px;
}

/* ===== Motion 2: Cursor spotlight (desktop only) ===== */
.cursor-spot {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 162, 74, 0.10) 0%, transparent 65%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 800ms ease;
  mix-blend-mode: multiply;
}
@media (hover: hover) and (pointer: fine) {
  .cursor-spot.is-active { opacity: 1; }
}

/* ===== Motion 3: Reveal-on-scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 720ms cubic-bezier(.2,.8,.2,1),
    transform 720ms cubic-bezier(.2,.8,.2,1);
  transition-delay: 0ms;
  will-change: opacity, transform;
}
.reveal[data-reveal="left"]  { transform: translateX(-28px); }
.reveal[data-reveal="right"] { transform: translateX(28px); }
.reveal[data-reveal="zoom"]  { transform: scale(.96); }
.reveal.is-visible {
  opacity: 1;
  transform: translate(0,0) scale(1);
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 247, 236, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
.site-header.is-scrolled {
  background: rgba(252, 247, 236, 0.96);
  border-bottom-color: var(--c-line);
  box-shadow: 0 4px 24px rgba(26, 49, 64, 0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  transition: transform var(--t-base);
}
.brand-logo {
  width: 56px;
  height: 36px;
  filter: brightness(0) saturate(100%) invert(13%) sepia(28%) saturate(913%) hue-rotate(166deg) brightness(96%) contrast(89%);
  transition: transform var(--t-base), filter var(--t-base);
}
/* Motion 4: Logo hover wobble */
.brand:hover .brand-logo {
  transform: rotate(-3deg) scale(1.06);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-ar { font-family: var(--ff-display); font-weight: 700; font-size: 19px; color: var(--c-ink); }
.brand-en { font-size: 11px; letter-spacing: 0.5px; color: var(--c-muted); font-weight: 500; }

.primary-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.primary-nav a {
  position: relative;
  padding: 10px 16px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--c-ink);
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}
.primary-nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  inset-inline-start: 50%;
  width: 0;
  height: 2px;
  background: var(--c-gold);
  border-radius: 2px;
  transition: width var(--t-base), inset-inline-start var(--t-base);
}
/* Motion 5: Nav underline glide */
.primary-nav a:hover {
  color: var(--c-olive);
}
.primary-nav a:hover::after,
.primary-nav a.active::after {
  width: calc(100% - 32px);
  inset-inline-start: 16px;
}
.primary-nav a.active {
  color: var(--c-olive-2);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-line);
  padding: 10px;
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--c-ink);
  border-radius: 1px;
}

/* ===== PAGE ===== */
.page {
  display: none;
  padding: 72px 0 96px;
  min-height: 70vh;
  animation: pageFade 480ms ease-out;
}
.page.is-active { display: block; }
@keyframes pageFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 32px 0 56px;
  overflow: hidden;
}
/* Motion 6: Pattern slow drift */
.hero-pattern {
  position: absolute;
  inset: -30px;
  background-image: url("assets/icons/pattern-11.svg");
  background-repeat: repeat;
  background-size: 300px;
  opacity: 0.035;
  z-index: 0;
  pointer-events: none;
  animation: patternDrift 60s linear infinite;
}
@keyframes patternDrift {
  from { background-position: 0 0; }
  to   { background-position: 300px 300px; }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-content { max-width: 620px; }
.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(217, 162, 74, 0.16);
  color: var(--c-gold-2);
  font-size: 13px;
  font-weight: 700;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.2px;
}
.hero-title {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1.15;
  margin: 0 0 24px;
  color: var(--c-ink);
  letter-spacing: -0.5px;
}
/* Motion 7: Title words slide-in */
.title-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: wordIn 720ms cubic-bezier(.2,.8,.2,1) forwards;
}
.title-word:nth-child(1) { animation-delay: 180ms; }
.title-word:nth-child(2) { animation-delay: 280ms; }
.hero-title em {
  font-style: normal;
  font-weight: 400;
  color: var(--c-olive);
  font-family: var(--ff-quote);
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: wordIn 800ms cubic-bezier(.2,.8,.2,1) 540ms forwards;
}
@keyframes wordIn {
  to { opacity: 1; transform: translateY(0); }
}
.title-dash {
  color: var(--c-gold);
  font-weight: 300;
  margin: 0 8px;
  display: inline-block;
  opacity: 0;
  animation: wordIn 600ms 380ms forwards;
}
.title-and {
  color: var(--c-gold);
  font-family: var(--ff-quote);
  font-weight: 400;
  margin: 0 12px;
  display: inline-block;
  opacity: 0;
  animation: wordIn 600ms 380ms forwards;
  font-size: 0.85em;
}
.hero-lede {
  font-size: 18px;
  line-height: 1.85;
  color: var(--c-ink);
  margin: 0 0 32px;
  opacity: 0.92;
}
.hero-lede strong { color: var(--c-olive-2); font-weight: 700; }

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--t-base);
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
/* Motion 8: Button shimmer on hover */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: inset-inline-start 700ms ease;
}
.btn:hover::before { inset-inline-start: 100%; }
.btn-primary { background: var(--c-ink); color: var(--c-bg); }
.btn-primary:hover { background: var(--c-olive-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary svg { transition: transform var(--t-base); }
.btn-primary:hover svg { transform: translateX(-4px); }
.btn-ghost { background: transparent; border: 1.5px solid var(--c-ink); color: var(--c-ink); }
.btn-ghost:hover { background: var(--c-ink); color: var(--c-bg); }
.btn-text {
  background: transparent;
  color: var(--c-olive-2);
  padding: 8px 0;
  font-weight: 600;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
}
.btn-text:hover { color: var(--c-gold-2); }
.btn-text svg { transition: transform var(--t-base); }
.btn-text:hover svg { transform: translateX(-4px); }

/* ===== Hero meta with count-up ===== */
.hero-meta {
  display: flex;
  gap: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--c-line);
}
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-num {
  font-family: var(--ff-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--c-olive);
  line-height: 1;
}
.meta-lab { font-size: 12px; color: var(--c-muted); font-weight: 500; }

/* Hero visual */
.hero-visual {
  position: relative;
  perspective: 1200px;
}
.hero-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  filter: saturate(108%) contrast(102%);
  transition: transform var(--t-slow);
  will-change: transform;
}
/* Motion 9: Tilt on mouse move (data-tilt) — JS-driven */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 380ms cubic-bezier(.2,.8,.2,1);
}
.hero-img-caption {
  position: absolute;
  bottom: 20px;
  inset-inline-start: 20px;
  background: rgba(26, 49, 64, 0.88);
  color: var(--c-bg);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

/* ===== Featured (replaces book card position) ===== */
.featured-section {
  margin-top: 56px;
  padding: 56px 48px;
  background: linear-gradient(135deg, var(--c-bg-soft) 0%, rgba(217, 162, 74, 0.05) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-line);
  position: relative;
  overflow: hidden;
}
.featured-section::before {
  content: '';
  position: absolute;
  top: -80px;
  inset-inline-end: -80px;
  width: 320px;
  height: 320px;
  background-image: url("assets/icons/pattern-11.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.04;
  animation: slowRotate 80s linear infinite;
}
/* Motion 10: Slow rotate for ornament */
@keyframes slowRotate {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}
.featured-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--c-olive);
  background: rgba(95, 111, 60, 0.1);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.featured-title {
  font-family: var(--ff-display);
  font-size: clamp(28px, 3.4vw, 40px);
  margin: 0 0 14px;
  color: var(--c-ink);
}
.featured-lede {
  font-size: 17px;
  color: var(--c-muted);
  max-width: 640px;
  margin: 0 0 36px;
  line-height: 1.7;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  position: relative;
}
.featured-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--c-line);
  display: flex;
  flex-direction: column;
  transition: all var(--t-base);
  cursor: pointer;
}
.featured-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--c-gold);
}
.featured-card-img {
  height: 140px;
  overflow: hidden;
  background: var(--c-ink);
}
.featured-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.featured-card:hover .featured-card-img img { transform: scale(1.08); }
.featured-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.featured-card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-gold-2);
  background: rgba(217, 162, 74, 0.12);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  align-self: flex-start;
}
.featured-card h3 {
  font-family: var(--ff-display);
  font-size: 17px;
  margin: 0 0 8px;
  color: var(--c-ink);
  line-height: 1.35;
}
.featured-card p {
  font-size: 13.5px;
  margin: 0;
  color: var(--c-muted);
  line-height: 1.65;
}

/* ===== Book Card (now at bottom) ===== */
.book-card {
  margin-top: 80px;
  background: var(--c-bg-soft);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--c-line);
}
.book-card::before {
  content: '';
  position: absolute;
  top: -100px;
  inset-inline-start: -100px;
  width: 360px;
  height: 360px;
  background-image: url("assets/icons/pattern-11.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.05;
  pointer-events: none;
  animation: slowRotate 100s linear infinite reverse;
}
.book-card-body { position: relative; z-index: 1; }
.book-card-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-olive);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.book-card-title {
  font-family: var(--ff-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--c-ink);
  line-height: 1.25;
}
.book-card-meta {
  font-size: 14px;
  color: var(--c-muted);
  margin: 0 0 16px;
  line-height: 1.8;
}
.book-card-desc {
  font-size: 16px;
  color: var(--c-ink);
  margin: 0 0 24px;
  line-height: 1.85;
  opacity: 0.88;
}
.book-card-visual { position: relative; z-index: 1; }
.book-card-img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--t-slow);
}
.book-card-img:hover { transform: scale(1.02) rotate(-1deg); }

/* ===== Section heads ===== */
.section-head {
  text-align: center;
  margin: 96px auto 48px;
  max-width: 700px;
}
.section-title {
  font-family: var(--ff-display);
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--c-ink);
  letter-spacing: -0.3px;
}
.section-sub {
  font-size: 16px;
  color: var(--c-muted);
  margin: 0;
  line-height: 1.7;
}

/* ===== Gallery ===== */
.gallery-section { padding-bottom: 24px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  grid-auto-rows: 220px;
}
.gallery-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--c-ink);
}
.gallery-item.gi-large { grid-column: span 2; grid-row: span 2; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow), filter var(--t-base);
}
.gallery-item:hover img {
  transform: scale(1.07);
  filter: brightness(1.05) saturate(110%);
}
.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  padding: 24px 18px 14px;
  background: linear-gradient(to top, rgba(26, 49, 64, 0.92), transparent);
  color: var(--c-bg);
  font-size: 13px;
  font-weight: 600;
  transform: translateY(100%);
  transition: transform var(--t-base);
}
.gallery-item:hover figcaption { transform: translateY(0); }

/* ===== PAGE HEAD ===== */
.page-head {
  text-align: center;
  margin-bottom: 48px;
  padding: 32px 24px 0;
  max-width: 880px;
}
.page-eyebrow {
  display: inline-block;
  font-family: var(--ff-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--c-gold-2);
  background: rgba(217, 162, 74, 0.12);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 18px;
}
.page-title {
  font-family: var(--ff-display);
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--c-ink);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.page-lede {
  font-size: 18px;
  color: var(--c-muted);
  line-height: 1.8;
  margin: 0;
}
.page-lede .note { display: block; margin-top: 12px; font-size: 14px; color: var(--c-olive); }
.page-lede a { color: var(--c-gold-2); font-weight: 700; border-bottom: 1px dashed currentColor; }
.page-lede strong { color: var(--c-ink); }

/* ===== LINEAGE PAGE ===== */
.lineage-tree {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.lineage-tree::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("assets/icons/pattern-11.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 600px;
  opacity: 0.025;
  pointer-events: none;
}
.lt-eyebrow {
  position: relative;
  z-index: 1;
  font-family: var(--ff-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--c-gold-2);
  margin-bottom: 24px;
  text-transform: uppercase;
}
.lt-chain {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.lt-node {
  font-family: var(--ff-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--c-ink);
  padding: 14px 28px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-line);
  border-radius: 100px;
  position: relative;
  opacity: 0;
  transform: translateY(-10px);
  animation: chainIn 600ms cubic-bezier(.2,.8,.2,1) forwards;
  transition: all var(--t-base);
  cursor: default;
}
.is-visible .lt-node:nth-child(1) { animation-delay: 100ms; }
.is-visible .lt-node:nth-child(2) { animation-delay: 200ms; }
.is-visible .lt-node:nth-child(3) { animation-delay: 300ms; }
.is-visible .lt-node:nth-child(4) { animation-delay: 400ms; }
.is-visible .lt-node:nth-child(5) { animation-delay: 500ms; }
.is-visible .lt-node:nth-child(6) { animation-delay: 600ms; }
.is-visible .lt-node:nth-child(7) { animation-delay: 700ms; }
.is-visible .lt-node:nth-child(8) { animation-delay: 800ms; }
@keyframes chainIn {
  to { opacity: 1; transform: translateY(0); }
}
.lt-node.lt-highlight {
  background: linear-gradient(135deg, var(--c-gold) 0%, var(--c-gold-2) 100%);
  color: var(--c-bg);
  border-color: var(--c-gold-2);
  box-shadow: 0 6px 18px rgba(217, 162, 74, 0.3);
}
.lt-node.lt-ancient {
  background: var(--c-ink);
  color: var(--c-bg);
  border-color: var(--c-ink);
}
.lt-node:hover { transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow); }
.lt-arrow {
  font-size: 18px;
  color: var(--c-gold);
  line-height: 1;
}

.lineage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.lineage-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 32px 28px;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}
.lineage-card::before {
  content: '';
  position: absolute;
  bottom: -50px;
  inset-inline-start: -50px;
  width: 140px;
  height: 140px;
  background-image: url("assets/icons/pattern-11.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.05;
  transition: all var(--t-base);
}
.lineage-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--c-gold);
}
.lineage-card:hover::before {
  opacity: 0.12;
  transform: rotate(30deg) scale(1.2);
}
.lineage-card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-olive);
  background: rgba(95, 111, 60, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.lineage-card h3 {
  font-family: var(--ff-display);
  font-size: 22px;
  margin: 0 0 12px;
  color: var(--c-ink);
}
.lineage-card p {
  font-size: 15px;
  margin: 0 0 16px;
  color: var(--c-ink);
  opacity: 0.85;
  line-height: 1.75;
}
.lineage-card-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-gold-2);
  padding-top: 12px;
  border-top: 1px solid var(--c-line);
}

/* Sons grid */
.sons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.son-card {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all var(--t-base);
}
.son-card:hover {
  border-color: var(--c-gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.son-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--c-gold);
  color: var(--c-bg);
  border-radius: 50%;
  font-family: var(--ff-display);
  font-weight: 700;
  margin-bottom: 12px;
}
.son-name {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--c-ink);
}
.son-branch {
  font-size: 13px;
  color: var(--c-olive);
  font-weight: 600;
  margin: 0 0 14px;
}
.son-desc {
  font-size: 14px;
  color: var(--c-muted);
  line-height: 1.65;
  margin: 0;
}

/* ===== TOPICS ===== */
.topic-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 48px;
}
.filter-chip {
  background: transparent;
  border: 1.5px solid var(--c-line);
  color: var(--c-ink);
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 100px;
  transition: all var(--t-fast);
}
.filter-chip:hover {
  border-color: var(--c-olive);
  color: var(--c-olive);
  transform: translateY(-2px);
}
.filter-chip.is-active {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-bg);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.topic-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: all var(--t-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 600ms ease forwards;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.topic-card::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--c-gold);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--t-base);
}
.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--c-peach-2);
}
.topic-card:hover::after { transform: scaleY(1); }
.topic-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--c-olive);
  background: rgba(95, 111, 60, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.topic-title {
  font-family: var(--ff-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--c-ink);
  margin: 0 0 12px;
  line-height: 1.4;
}
.topic-excerpt {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--c-ink);
  opacity: 0.84;
  margin: 0 0 16px;
}
.topic-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--c-muted);
  padding-top: 12px;
  border-top: 1px solid var(--c-line);
}
.topic-page { font-weight: 700; color: var(--c-gold-2); }
.topic-read {
  color: var(--c-ink);
  font-weight: 600;
  transition: transform var(--t-base);
}
.topic-card:hover .topic-read { transform: translateX(-4px); }

/* ===== SCHOLARS ===== */
.scholar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
  padding: 20px 24px;
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-line);
  border-radius: 100px;
  padding: 8px 18px;
  flex: 1;
  max-width: 340px;
  color: var(--c-muted);
  transition: all var(--t-base);
}
.search-box:focus-within {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 4px rgba(217, 162, 74, 0.12);
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--c-ink);
}
.sort-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sort-label { font-size: 13px; color: var(--c-muted); margin-left: 6px; }
.sort-btn {
  background: transparent;
  border: 1px solid var(--c-line);
  color: var(--c-ink);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}
.sort-btn:hover { border-color: var(--c-olive); }
.sort-btn.is-active {
  background: var(--c-olive);
  border-color: var(--c-olive);
  color: var(--c-bg);
}

.scholar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.scholar-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  cursor: pointer;
  transition: all var(--t-base);
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 500ms ease forwards;
}
.scholar-card.is-fuhayd {
  background: linear-gradient(135deg, var(--c-surface) 0%, rgba(217, 162, 74, 0.05) 100%);
  border-color: rgba(217, 162, 74, 0.4);
}
.scholar-card::before {
  content: '';
  position: absolute;
  top: -40px;
  inset-inline-end: -40px;
  width: 140px;
  height: 140px;
  background-image: url("assets/icons/pattern-11.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.06;
  transition: opacity var(--t-base), transform var(--t-base);
}
.scholar-card:hover::before { opacity: 0.16; transform: rotate(45deg) scale(1.15); }
.scholar-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--c-gold);
}
.scholar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-gold-2);
  background: rgba(217, 162, 74, 0.16);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}
.scholar-badge.badge-other {
  color: var(--c-olive);
  background: rgba(95, 111, 60, 0.12);
}
.scholar-name {
  font-family: var(--ff-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--c-ink);
  margin: 0 0 6px;
  line-height: 1.35;
}
.scholar-years {
  font-size: 13px;
  color: var(--c-muted);
  margin: 0 0 16px;
}
.scholar-brief {
  font-size: 14px;
  color: var(--c-ink);
  opacity: 0;
  line-height: 1.7;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-base), opacity var(--t-base), margin var(--t-base);
}
.scholar-card:hover .scholar-brief {
  max-height: 200px;
  opacity: 0.84;
  margin-bottom: 14px;
}
.scholar-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-olive);
  transition: transform var(--t-base);
}
.scholar-card:hover .scholar-cta { transform: translateX(-4px); }

/* ===== TIMELINE ===== */
.timeline-sections { padding-top: 24px; }
.tl-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--c-line);
}
.tl-section:last-child { border-bottom: none; }
.tl-section.alt { background: var(--c-bg-soft); }
.tl-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.tl-section.alt .tl-inner { direction: ltr; }
.tl-section.alt .tl-text { direction: rtl; text-align: right; }
.tl-eyebrow {
  display: inline-block;
  font-family: var(--ff-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--c-olive);
  background: rgba(95, 111, 60, 0.1);
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 14px;
}
.tl-title {
  font-family: var(--ff-display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  color: var(--c-ink);
  margin: 0 0 18px;
  line-height: 1.3;
}
.tl-body {
  font-size: 16px;
  color: var(--c-ink);
  line-height: 1.85;
  opacity: 0.9;
}
.tl-body p { margin: 0 0 14px; }
.tl-body ul { padding-inline-start: 22px; margin: 0; }
.tl-body li { margin-bottom: 6px; }
.tl-page-ref {
  font-size: 12px;
  color: var(--c-gold-2);
  font-weight: 700;
  margin-top: 14px;
  display: inline-block;
}
.tl-visual { position: relative; }
.tl-visual img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.tl-visual:hover img { transform: scale(1.02); }
.tl-visual-caption {
  font-size: 13px;
  color: var(--c-muted);
  margin-top: 10px;
  text-align: center;
}

.tl-list { display: grid; gap: 16px; }
.tl-item {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  transition: all var(--t-fast);
}
.tl-section.alt .tl-item { background: var(--c-bg); }
.tl-item:hover {
  border-color: var(--c-gold);
  transform: translateX(-4px);
}
.tl-item-year {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-gold-2);
  white-space: nowrap;
  padding-top: 2px;
}
.tl-item-body h4 {
  font-family: var(--ff-display);
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--c-ink);
}
.tl-item-body p {
  font-size: 14px;
  margin: 0;
  color: var(--c-ink);
  opacity: 0.84;
  line-height: 1.7;
}

/* ===== FOOTER ===== */
.site-footer {
  position: relative;
  background: var(--c-ink);
  color: var(--c-bg);
  padding: 72px 0 24px;
  overflow: hidden;
}
.footer-pattern {
  position: absolute;
  inset: 0;
  background-image: url("assets/icons/pattern-11.svg");
  background-repeat: repeat;
  background-size: 280px;
  opacity: 0.04;
  filter: invert(1);
  pointer-events: none;
  animation: patternDrift 80s linear infinite reverse;
}
.footer-inner { position: relative; z-index: 1; }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(252, 247, 236, 0.12);
  margin-bottom: 36px;
}
.footer-logo { width: 72px; height: 46px; filter: brightness(0) invert(1); }
.footer-title {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}
.footer-sub { font-size: 13px; opacity: 0.7; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 36px;
}
.footer-col h4 {
  font-family: var(--ff-display);
  font-size: 15px;
  margin: 0 0 16px;
  color: var(--c-gold);
  letter-spacing: 0.3px;
}
.footer-col a {
  display: block;
  color: var(--c-bg);
  font-size: 14px;
  padding: 6px 0;
  opacity: 0.78;
  transition: opacity var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.footer-col a:hover {
  opacity: 1;
  color: var(--c-gold);
  transform: translateX(-4px);
}
.footer-text { font-size: 14px; opacity: 0.78; margin: 0; }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(252, 247, 236, 0.12);
  text-align: center;
  font-size: 13px;
  opacity: 0.6;
}
.footer-bottom p { margin: 0; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.is-open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 31, 42, 0.75);
  backdrop-filter: blur(6px);
  animation: fadeIn 200ms;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-dialog {
  position: relative;
  background: var(--c-bg);
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalPop 320ms cubic-bezier(.2,.8,.2,1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: sticky;
  top: 16px;
  margin-inline-start: auto;
  margin-inline-end: 16px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 50%;
  color: var(--c-ink);
  z-index: 10;
  float: left;
  transition: all var(--t-base);
}
.modal-close:hover {
  background: var(--c-ink);
  color: var(--c-bg);
  border-color: var(--c-ink);
  transform: rotate(90deg);
}
.modal-content { padding: 8px 48px 48px; }
.modal-content h2 {
  font-family: var(--ff-display);
  font-size: clamp(24px, 3vw, 32px);
  margin: 0 0 8px;
  color: var(--c-ink);
}
.modal-content .modal-years {
  color: var(--c-gold-2);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 24px;
  font-family: var(--ff-display);
}
.modal-content p {
  font-size: 16px;
  line-height: 1.85;
  margin: 0 0 16px;
  color: var(--c-ink);
}
.modal-content .modal-source {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--c-line);
  font-size: 13px;
  color: var(--c-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 200px; }
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-grid, .scholar-grid, .lineage-grid, .sons-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .book-card { grid-template-columns: 1fr; gap: 32px; padding: 36px; }
  .tl-inner { grid-template-columns: 1fr; gap: 32px; }
  .featured-section { padding: 40px 28px; }
}

@media (max-width: 768px) {
  html { scroll-padding-top: 72px; }
  .header-inner { height: 70px; }
  .brand-logo { width: 44px; height: 28px; }
  .brand-ar { font-size: 17px; }
  .brand-en { font-size: 10px; }
  .primary-nav { display: none; }
  .primary-nav.is-open {
    display: flex;
    position: fixed;
    top: 70px;
    inset-inline-start: 0;
    inset-inline-end: 0;
    flex-direction: column;
    background: var(--c-bg);
    padding: 20px;
    border-bottom: 1px solid var(--c-line);
    box-shadow: var(--shadow);
  }
  .primary-nav.is-open a { padding: 14px 16px; font-size: 17px; border-radius: var(--radius-sm); }
  .nav-toggle { display: flex; }
  .page { padding: 40px 0 64px; }
  .section-head { margin: 56px auto 32px; }
  .hero-meta { flex-wrap: wrap; gap: 20px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .gallery-item.gi-large { grid-column: span 2; grid-row: span 1; }
  .featured-grid, .topic-grid, .scholar-grid, .lineage-grid, .sons-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: 28px; }
  .footer-brand { flex-direction: column; align-items: flex-start; }
  .modal-content { padding: 8px 24px 32px; }
  .cursor-spot { display: none; }
}

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