/*
 * Utmanz — public design system
 * Brand: "The Lineage Seal" — emerald, antique gold, parchment ivory.
 * Type: Cormorant Garamond (display) · Inter (interface) · Noto Nastaliq Urdu (Urdu)
 */
@import url('../fonts/fonts.css');

:root {
  /* Emerald — heritage, permanence */
  --em-950: #05221B;
  --em-900: #0A3128;
  --em-800: #0E4A3A;
  --em-700: #145C48;
  --em-600: #1B6E56;
  --em-200: #BFD8CC;
  --em-100: #E2EEE8;
  --em-50:  #F1F7F4;
  /* Antique gold — nobility of lineage (accent only; never body text) */
  --gold-700: #8A6420;   /* gold text on light: 5.0:1 */
  --gold-600: #A47A2E;
  --gold-500: #C9A25A;
  --gold-400: #D9B872;
  --gold-200: #EEDDB3;
  --gold-100: #F6EDD6;
  /* Parchment neutrals */
  --ivory: #FAF7F0;
  --parchment: #F3ECDD;
  --paper: #FFFFFF;
  --line: #E7E0D1;
  --line-strong: #D6CCB6;
  --ink: #15201B;
  --ink-2: #3D4943;
  --muted: #5F6A64;   /* 5.2:1 on ivory (WCAG AA) */
  /* Status */
  --success: #1E7B4F;
  --danger: #B42318;

  --f-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --f-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-ur: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Nafees Web Naskh', serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(10, 49, 40, .06), 0 1px 1px rgba(10, 49, 40, .04);
  --shadow-md: 0 10px 30px -12px rgba(10, 49, 40, .22), 0 2px 6px rgba(10, 49, 40, .06);
  --shadow-lg: 0 30px 60px -24px rgba(5, 34, 27, .45), 0 8px 20px -8px rgba(5, 34, 27, .18);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --container: 1200px;

  /* Eight-point star lattice (Islamic geometry), used as a quiet texture */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23C9A25A' stroke-width='1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 36h8M64 36h8M36 0v8M36 64v8'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--em-700); text-decoration: none; }
a:hover { color: var(--em-900); }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold-200); color: var(--em-950); }

.ur, [lang="ur"] { font-family: var(--f-ur); direction: rtl; line-height: 2.1; font-feature-settings: normal; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--em-900); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { left: 16px; color: #fff; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 12px/1 var(--f-ui); letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-700);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }
.on-dark .eyebrow { color: var(--gold-400); }
.display { font-family: var(--f-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.05; margin: 0; }
.h1 { font-size: clamp(40px, 5.4vw, 72px); }
.h2 { font-size: clamp(32px, 3.6vw, 48px); }
.h3 { font-size: clamp(24px, 2.4vw, 30px); }
.lead { font-size: 18px; color: var(--ink-2); max-width: 60ch; }
.on-dark .lead { color: rgba(255, 255, 255, .78); }
.gold-rule { width: 64px; height: 2px; background: linear-gradient(90deg, var(--gold-500), transparent); border: 0; margin: 20px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font: 600 15px/1 var(--f-ui); letter-spacing: .01em; cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--em-800); color: #fff; box-shadow: 0 8px 20px -10px rgba(14, 74, 58, .8); }
.btn-primary:hover { background: var(--em-900); color: #fff; transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--em-950); box-shadow: 0 10px 24px -12px rgba(164, 122, 46, .9); }
.btn-gold:hover { color: var(--em-950); transform: translateY(-1px); filter: brightness(1.04); }
.btn-ghost { background: transparent; color: var(--em-800); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--em-700); background: var(--em-50); }
.on-dark .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .28); }
.on-dark .btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .5); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 240, .86);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(214, 204, 182, .6);
}
.site-header .container { display: flex; align-items: center; gap: 28px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--em-900); }
.brand:hover { color: var(--em-900); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font: 600 25px/1 var(--f-display); letter-spacing: .22em; padding-left: .22em; margin-left: -.22em; }
.brand-sub { font: 400 13px/1.6 var(--f-ur); color: var(--gold-700); direction: rtl; text-align: left; margin-top: 4px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav > a, .nav-group > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  font: 500 14.5px/1 var(--f-ui); color: var(--ink-2); cursor: pointer; list-style: none;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav > a:hover, .nav-group > summary:hover, .nav > a[aria-current="page"] { background: var(--em-50); color: var(--em-900); }
.nav > a[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--em-100); }
.nav-group { position: relative; }
.nav-group > summary svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.nav-group[open] > summary svg { transform: rotate(180deg); }
.nav-menu {
  position: absolute; top: calc(100% + 10px); right: 0; width: 320px; padding: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
.nav-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; color: var(--ink); }
.nav-menu a:hover { background: var(--em-50); }
.nav-menu .ur { font-size: 17px; line-height: 2; }
.nav-menu small { font: 500 11px/1 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav .btn { min-height: 42px; padding: 0 20px; margin-left: 8px; font-size: 14px; }

.menu-toggle { display: none; margin-left: auto; }
.menu-toggle > summary { list-style: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-strong); cursor: pointer; }
.menu-toggle > summary::-webkit-details-marker { display: none; }
.menu-toggle svg { width: 22px; height: 22px; color: var(--em-900); }
.mobile-nav { position: absolute; left: 12px; right: 12px; top: 84px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 12px; display: grid; gap: 2px; }
.mobile-nav a { padding: 12px 14px; border-radius: 10px; color: var(--ink); font-weight: 500; }
.mobile-nav a:hover { background: var(--em-50); }
.mobile-nav .ur { font-size: 17px; }
.mobile-nav hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

@media (max-width: 980px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(201, 162, 90, .22), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(27, 110, 86, .55), transparent 60%),
    linear-gradient(160deg, var(--em-900) 0%, var(--em-950) 100%);
}
.hero::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); background-size: 72px; opacity: .09; pointer-events: none; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(217, 184, 114, .6), transparent); }
.hero .container { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; padding-top: 88px; padding-bottom: 104px; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: italic; color: var(--gold-400); font-weight: 500; }
.hero-ur { font: 400 30px/2 var(--f-ur); color: var(--gold-200); direction: rtl; margin: 18px 0 6px; text-align: left; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-seal { position: absolute; right: -120px; top: 50%; width: 560px; transform: translateY(-50%); opacity: .06; pointer-events: none; }

/* ---------- Search card ---------- */
.search-card {
  position: relative; background: var(--paper); color: var(--ink); border-radius: var(--r-lg);
  padding: 32px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .6);
}
.search-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: linear-gradient(90deg, var(--gold-600), var(--gold-400), var(--gold-600)); }
.search-card h2 { font: 600 28px/1.1 var(--f-display); margin: 0 0 4px; color: var(--em-900); }
.search-card .hint { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font: 600 12px/1 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); display: flex; justify-content: space-between; align-items: baseline; }
.field label .ur { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--gold-700); font-weight: 400; line-height: 1.4; }
.input, .select {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--ivory); font: 400 16px/1.2 var(--f-ui); color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.input::placeholder { color: #9AA39E; }
.input:focus, .select:focus { outline: none; border-color: var(--em-600); background: #fff; box-shadow: 0 0 0 4px rgba(27, 110, 86, .14); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E4A3A' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 44px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* ---------- Dropdowns (assets/js/choice.js) ---------- */
/* Without JavaScript the browser's own menu is used; give Urdu choices the Urdu font there too */
.select option[lang="ur"] { font-family: var(--f-ur); font-size: 18px; }
.choice { position: relative; }
.choice-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.choice-btn { display: flex; align-items: center; text-align: left; cursor: pointer; overflow: hidden; }
.choice-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-value.is-ur { font: 400 18px/52px var(--f-ur); text-align: right; direction: rtl; }
.choice.is-open > .choice-btn { border-color: var(--em-600); background-color: #fff; box-shadow: 0 0 0 4px rgba(27, 110, 86, .14); }
.choice-pop {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px);
  display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 8px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 18px 40px -12px rgba(8, 42, 34, .35), 0 2px 6px rgba(8, 42, 34, .08);
}
.choice-pop[hidden] { display: none; }
.choice.drop-up .choice-pop { top: auto; bottom: calc(100% + 6px); }
.choice-filter {
  width: 100%; height: 42px; margin-bottom: 6px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--ivory); font: 400 15px/1.2 var(--f-ui); color: var(--ink);
}
.choice-filter:focus { outline: none; border-color: var(--em-600); background: #fff; }
.choice-list { list-style: none; margin: 0; padding: 0; max-height: min(340px, 52vh); overflow-y: auto; overscroll-behavior: contain; outline: none; }
.choice-group { padding: 10px 12px 4px; font: 600 10.5px/1.4 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-700); }
.choice-group[hidden] { display: none; }
.choice-opt { position: relative; padding: 9px 12px 9px 34px; border-radius: 9px; font: 400 15.5px/1.35 var(--f-ui); color: var(--ink); cursor: pointer; }
.choice-opt.is-ur { padding: 2px 34px 2px 12px; font: 400 19px/2.25 var(--f-ur); text-align: right; }
.choice-opt[hidden] { display: none; }
.choice-opt.is-active { background: var(--em-50); color: var(--em-900); }
.choice-opt[aria-selected="true"] { font-weight: 600; color: var(--em-800); }
.choice-opt[aria-selected="true"]::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 12px; height: 7px; margin-top: -6px;
  border-left: 2px solid var(--gold-600); border-bottom: 2px solid var(--gold-600); transform: rotate(-45deg);
}
.choice-opt.is-ur[aria-selected="true"]::before { left: auto; right: 12px; }
.input.is-ur { font: 400 19px/1.3 var(--f-ur); }
.choice-empty { margin: 0; padding: 12px; font-size: 14px; color: var(--muted); }
/* Suggestions under a text box */
.choice-combo .choice-pop { grid-template-rows: minmax(0, 1fr); }
.choice-combo .choice-opt { padding-left: 12px; }
.choice-combo .choice-opt.is-ur { padding-right: 12px; }
.search-card .btn { margin-top: 6px; }
.search-note { display: flex; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line-strong); font-size: 13.5px; color: var(--muted); }
.search-note svg { width: 18px; height: 18px; flex: none; color: var(--gold-600); margin-top: 2px; }

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.section-tight { padding: 72px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 48px; flex-wrap: wrap; }
.section-head .lead { margin: 14px 0 0; }
.bg-parchment { background: var(--parchment); }
.bg-paper { background: var(--paper); }

/* Stats ribbon */
.stats { position: relative; margin-top: -48px; z-index: 2; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.stat { padding: 28px 32px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-value { font: 600 44px/1 var(--f-display); color: var(--em-800); }
.stat-label { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.stat-label .ur { display: block; font-size: 14px; color: var(--gold-700); line-height: 2; }

/* Lineage cards */
.lineage-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.lineage-card {
  grid-column: span 2; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  min-height: 250px; padding: 30px; border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line);
  color: var(--ink); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.lineage-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gold-200); color: var(--ink); }
.lineage-card.feature { grid-column: span 3; background: linear-gradient(160deg, var(--em-800), var(--em-950)); color: #fff; border-color: transparent; }
.lineage-card.feature:hover { color: #fff; }
.lineage-card.feature::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); background-size: 64px; opacity: .08; }
.lineage-card > * { position: relative; }
.lineage-card .kicker { font: 600 11px/1 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-700); }
.lineage-card.feature .kicker { color: var(--gold-400); }
.lineage-card .name { font: 400 30px/1.9 var(--f-ur); direction: rtl; text-align: right; margin: 0; }
.lineage-card.feature .name { color: var(--gold-200); }
.lineage-card p { margin: 0; font-size: 14.5px; color: var(--muted); }
.lineage-card.feature p { color: rgba(255, 255, 255, .72); }
.lineage-card .go { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--f-ui); color: var(--em-700); }
.lineage-card.feature .go { color: var(--gold-400); }
.lineage-card .go svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.lineage-card:hover .go svg { transform: translateX(4px); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.step { position: relative; padding: 36px 30px 30px; border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; top: -18px; left: 30px; padding: 6px 12px; border-radius: 999px;
  font: 600 13px/1 var(--f-ui); letter-spacing: .1em; color: var(--em-950);
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
}
.step h3 { font: 600 24px/1.2 var(--f-display); color: var(--em-900); margin: 4px 0 10px; }
.step p { margin: 0; color: var(--ink-2); font-size: 15px; }
.step .ur { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); color: var(--gold-700); font-size: 15px; text-align: right; }

/* Quote / about */
.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 72px; align-items: center; }
.about-figure { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-xl); overflow: hidden; background: linear-gradient(170deg, var(--em-800), var(--em-950)); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.about-figure::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); background-size: 72px; opacity: .12; }
.about-figure img { position: relative; width: 58%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35)); }
.about-figure figcaption { position: absolute; left: 24px; right: 24px; bottom: 24px; padding: 16px 18px; border-radius: var(--r-md); background: rgba(5, 34, 27, .55); backdrop-filter: blur(8px); color: rgba(255, 255, 255, .86); font-size: 13.5px; border: 1px solid rgba(217, 184, 114, .25); }
.about-figure figcaption strong { color: var(--gold-400); font-weight: 600; }
blockquote.ur-quote { margin: 28px 0; padding: 26px 30px; border-right: 3px solid var(--gold-500); background: var(--paper); border-radius: var(--r-md) 0 0 var(--r-md); font: 400 20px/2.2 var(--f-ur); direction: rtl; color: var(--ink); box-shadow: var(--shadow-sm); }
blockquote.ur-quote cite { display: block; margin-top: 8px; font-style: normal; font-size: 15px; color: var(--gold-700); }

/* ---------- Page header (inner pages) ---------- */
.page-hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(160deg, var(--em-900), var(--em-950)); }
.page-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); background-size: 72px; opacity: .08; }
.page-hero .container { position: relative; padding-top: 64px; padding-bottom: 72px; }
.page-hero .display { color: #fff; }
.page-hero .ur-title { font: 400 clamp(30px, 4vw, 46px)/2 var(--f-ur); color: var(--gold-200); direction: rtl; margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: rgba(255, 255, 255, .6); margin-bottom: 22px; }
.crumbs a { color: rgba(255, 255, 255, .8); }
.crumbs a:hover { color: var(--gold-400); }
.crumbs span[aria-hidden] { opacity: .5; }

/* ---------- Results ---------- */
.results-layout { display: grid; grid-template-columns: 340px 1fr; gap: 40px; align-items: start; margin-top: -40px; position: relative; z-index: 2; padding-bottom: 96px; }
.results-layout .search-card { position: sticky; top: 100px; padding: 26px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 26px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); margin-bottom: 18px; }
.results-head h2 { font: 600 26px/1.1 var(--f-display); margin: 0; color: var(--em-900); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--em-50); border: 1px solid var(--em-100); font-size: 13px; color: var(--em-800); }
.chip.gold { background: var(--gold-100); border-color: var(--gold-200); color: var(--gold-700); }
.result-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.result {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px;
  padding: 18px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--ink); transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.result:hover { border-color: var(--gold-200); box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--ink); }
.result-mark { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--em-50); color: var(--em-700); }
.result-mark svg { width: 22px; height: 22px; }
.result-main { min-width: 0; text-align: right; direction: rtl; }
.result-name { font: 400 24px/2 var(--f-ur); color: var(--em-900); }
.result-father { font: 400 16px/2 var(--f-ur); color: var(--ink-2); }
.result-father .rel { color: var(--gold-700); }
.result-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; direction: ltr; margin-top: 2px; }
.result-go { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--f-ui); color: var(--em-700); white-space: nowrap; }
.result-go svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.result:hover .result-go svg { transform: translateX(4px); }
.empty { text-align: center; padding: 64px 24px; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty img { width: 72px; margin: 0 auto 18px; opacity: .9; }
.empty h3 { font: 600 28px/1.2 var(--f-display); margin: 0 0 8px; color: var(--em-900); }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto; }

/* ---------- Article (Library, Journey) ---------- */
.article-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 48px; margin-top: -40px; position: relative; z-index: 2; padding-bottom: 96px; align-items: start; }
.article {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: 56px 64px; font: 400 19px/2.35 var(--f-ur); direction: rtl; text-align: right; color: var(--ink);
}
.article h2 { font: 700 24px/2 var(--f-ur); color: var(--em-800); margin: 44px 0 12px; padding-right: 18px; border-right: 3px solid var(--gold-500); }
.article h2:first-child { margin-top: 0; }
.article p { margin: 0 0 20px; text-align: justify; }
.article ul { margin: 0 0 20px; padding: 0 22px 0 0; }
.article li { margin-bottom: 8px; padding-right: 6px; }
.article li::marker { color: var(--gold-600); }
.article strong { color: var(--em-900); }
.article .bismillah { text-align: center; font-size: 30px; color: var(--em-800); margin-bottom: 28px; }
.article .signature { text-align: left; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--gold-700); }
.article hr { border: 0; height: 1px; margin: 36px 0; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.aside-card { position: sticky; top: 100px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.aside-card h3 { font: 600 22px/1.2 var(--f-display); margin: 0 0 14px; color: var(--em-900); }
.aside-card a.link { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 14.5px; }
.aside-card a.link:hover { color: var(--em-700); }
.aside-card .ur { font-size: 16px; }

/* ---------- Footer ---------- */
.site-footer { position: relative; color: rgba(255, 255, 255, .72); background: var(--em-950); overflow: hidden; }
.site-footer::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); background-size: 72px; opacity: .05; }
.site-footer .container { position: relative; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; padding: 80px 0 56px; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand-sub { color: var(--gold-400); }
.footer-brand p { margin: 20px 0 0; font-size: 14.5px; max-width: 38ch; }
.site-footer h4 { margin: 6px 0 18px; font: 600 12px/1 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-400); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; }
.site-footer a { color: rgba(255, 255, 255, .78); }
.site-footer a:hover { color: #fff; }
.site-footer .ur { font-size: 16px; line-height: 1.9; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 0 32px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: rgba(255, 255, 255, .5); }

/* ---------- Reveal on scroll (progressive enhancement) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero .container { grid-template-columns: 1fr; gap: 48px; padding-top: 64px; }
  .lineage-card, .lineage-card.feature { grid-column: span 3; }
  .about { grid-template-columns: 1fr; gap: 48px; }
  .about-figure { aspect-ratio: 16 / 10; }
  .results-layout, .article-wrap { grid-template-columns: 1fr; }
  .results-layout .search-card, .aside-card { position: static; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .section { padding: 72px 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 22px; border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .lineage-card, .lineage-card.feature { grid-column: span 6; min-height: 0; }
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .field-row { grid-template-columns: 1fr; }
  .search-card { padding: 24px; }
  .result { grid-template-columns: 1fr; gap: 10px; padding: 16px 18px; }
  .result-mark { display: none; }
  .result-go { justify-content: flex-end; }
  .article { padding: 32px 22px; font-size: 18px; }
  .footer-top { grid-template-columns: 1fr; gap: 36px; padding-top: 56px; }
  .brand-name { font-size: 21px; }
  .hero-ur { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  .site-header, .site-footer, .search-card, .tree-tools { display: none !important; }
  body { background: #fff; }
}

/* ---------- Spacing utilities ---------- */
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 22px; }
.lineage-card .go.mt-md { margin-top: 16px; }
.nav > a.btn-primary, .nav > a.btn-primary:hover { color: #fff; background: var(--em-800); }
.nav > a.btn-primary:hover { background: var(--em-900); }
.result-main > span { display: block; }
.chip svg { width: 13px; height: 13px; }
.steps-stack { grid-template-columns: 1fr; gap: 34px; margin-top: 34px; }
/* Result rows: compact Urdu lines, interface-font chips */
.result { padding: 14px 22px; }
.result-name { font-size: 23px; line-height: 1.75; }
.result-father { line-height: 1.7; margin-top: -2px; }
.result-meta { margin-top: 6px; }
.result-meta .chip { font-family: var(--f-ui); line-height: 1.2; padding: 5px 11px; font-size: 12.5px; }
.result-mark { background: var(--gold-100); color: var(--gold-700); }
.chip[lang="ur"], .result-meta .chip[lang="ur"] { font: 400 15px/1.9 var(--f-ur); padding: 0 12px; }
