/* Maliki Encyclopedia landing — page-level styles. Consumes tokens from tokens.css */

/* ============================================================
   ZELLIJ PALETTE — Meknes (Place El-Hedim) reference palette
   Off-white field, deep cobalt, terracotta, viridian, warm black.
   These OVERRIDE the parent design system colors for this page so
   the whole UI breathes the zellij world, not just the ornaments.
   ============================================================ */
:root {
  /* True zellij tile colors (Meknes reference) */
  --zelij-field:   #F2EBDC; /* warm off-white ground */
  --zelij-cobalt:  #1F3D8C; /* dominant deep blue */
  --zelij-cobalt-deep: #14276B;
  --zelij-rust:    #A8542B; /* terracotta/rust */
  --zelij-rust-light: #C97A4A;
  --zelij-viridian:#2D6B5C; /* viridian green */
  --zelij-viridian-deep: #1E4A3F;
  --zelij-black:   #1B1A17; /* warm carved-line black */
  --zelij-line:    #2A1F12;
  --zelij-cream:   #EDE3CD;

  /* Re-map the page's semantic tokens onto the zellij palette */
  --canvas:        #F4EDDE;   /* warm cream page bg */
  --canvas-sunk:   #EAE0C9;   /* sunken */
  --surface-1:     #FBF7EA;   /* cards */
  --surface-2:     #FFFFFF;   /* search */

  --fg-1:          #1B1A17;   /* warm black body */
  --fg-2:          #44382A;   /* secondary */
  --fg-3:          #76685A;   /* tertiary */
  --fg-on-primary: #F4EDDE;

  --primary:       #1F3D8C;   /* cobalt — primary action */
  --primary-hover: #14276B;
  --secondary:     #2D6B5C;   /* viridian — secondary */
  --accent:        #A8542B;   /* rust — accent */

  --border-subtle: rgba(31, 61, 140, 0.14);
  --border-default:rgba(31, 61, 140, 0.28);

  /* keep some tokens used by existing classes */
  --color-primary-700: #1F3D8C;
  --color-primary-800: #14276B;
  --color-saffron-300: #C97A4A;
  --color-saffron-400: #A8542B;
  --color-saffron-600: #8A4220;
  --color-teal-300:    #4F9384;
  --color-teal-400:    #2D6B5C;
  --color-pomegranate-500: #A8542B;
  --color-success: #2D6B5C;
  --color-parchment: #F4EDDE;
  --color-ink: #14110B;

  /* Legacy aliases used by older zellij CSS */
  --zelij-ivory: var(--zelij-field);
  --zelij-saffron: var(--zelij-rust);
  --zelij-teal: var(--zelij-viridian);
  --zelij-pom: var(--zelij-rust);
}
[data-theme="dark"] {
  --zelij-field:   #1B1A17;
  --zelij-cobalt:  #4F71C8;
  --zelij-cobalt-deep: #2A4DA8;
  --zelij-rust:    #C97A4A;
  --zelij-rust-light: #E59867;
  --zelij-viridian:#4F9384;
  --zelij-viridian-deep: #2D6B5C;
  --zelij-black:   #0B0A08;
  --zelij-line:    rgba(244,237,222,0.18);
  --zelij-cream:   #2A241D;

  --canvas:        #14110B;
  --canvas-sunk:   #1F1A12;
  --surface-1:     #221C13;
  --surface-2:     #2A2419;
  --fg-1:          #F4EDDE;
  --fg-2:          #D6C9A8;
  --fg-3:          #8E7E62;
  --fg-on-primary: #14110B;
  --primary:       #6B8AD9;
  --primary-hover: #4F71C8;
  --secondary:     #4F9384;
  --accent:        #C97A4A;
  --border-subtle: rgba(244,237,222,0.12);
  --border-default:rgba(244,237,222,0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  background: transparent;
  color: var(--fg-1);
  font-family: var(--font-arabic);
  overflow-x: hidden;
  position: relative;
}
html { background: var(--canvas); }

/* Persistent zellij background — fixed photo + cream scrim layer.
   Lives behind everything; footer covers it with its own solid bg. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("./assets/zellij-meknes.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    /* gentle cobalt vignette at edges, ivory at center — matches the zellij ivory ground */
    radial-gradient(ellipse 100vw 80vh at 50% 50%,
      rgba(248, 242, 228, 0.86) 0%,
      rgba(245, 237, 220, 0.90) 55%,
      rgba(232, 222, 200, 0.93) 100%);
  pointer-events: none;
}
[data-theme="dark"] body::after {
  background:
    radial-gradient(ellipse 100vw 80vh at 50% 50%,
      rgba(14, 22, 38, 0.84) 0%,
      rgba(12, 18, 32, 0.90) 55%,
      rgba(8, 12, 24, 0.95) 100%);
}

/* Override the design-system body font for this Arabic-first product:
   IBM Plex Sans Arabic stays as the body, Aref Ruqaa for display */
html[dir="rtl"] body { font-family: "IBM Plex Sans Arabic", "Tajawal", sans-serif; }

a { color: inherit; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 18px 40px;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in oklab, var(--canvas) 86%, transparent);
  backdrop-filter: blur(10px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg-1); flex-shrink: 0; min-width: 0; }
.brand > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--border-default);
  background: var(--surface-1);
  border-radius: 8px;
  color: var(--primary);
  flex-shrink: 0;
}
.brand-name {
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--fg-1);
  letter-spacing: 0;
  white-space: nowrap;
  display: block;
  padding-bottom: 0.08em;
}
.brand-sub {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.08em;
  margin-top: 4px;
  display: block;
}

.topnav { display: flex; gap: 22px; flex: 1; justify-content: center; min-width: 0; flex-wrap: nowrap; }
.topnav a {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 15px;
  color: var(--fg-2);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color var(--duration-micro);
}
.topnav a:hover { color: var(--fg-1); }
.topnav a.active { color: var(--primary); }
.topnav a.active::after {
  content: ""; position: absolute; bottom: -4px; inset-inline: 25%;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.topnav a .soon {
  font-size: 10px; color: var(--fg-3);
  margin-inline-start: 4px;
  background: var(--canvas-sunk);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 500;
}

.topright { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; margin-inline-start: auto; }
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  transition: all var(--duration-micro);
}
.icon-btn:hover { background: var(--canvas-sunk); color: var(--fg-1); border-color: var(--border-default); }
.text-btn {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-1);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
}
.text-btn:hover { background: var(--canvas-sunk); }

.signup-btn {
  display: inline-flex; align-items: center;
  background: var(--primary);
  color: var(--fg-on-primary);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--duration-micro);
  white-space: nowrap;
}
.signup-btn:hover { background: var(--primary-hover); }
.signup-btn.block { display: flex; justify-content: center; padding: 14px 18px; font-size: 15px; }
.text-btn.block { display: flex; justify-content: center; }

.menu-btn { display: none; }

/* Mobile drawer */
.mobile-drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(14, 17, 23, 0.5);
  z-index: 100;
  animation: fade-in var(--duration-standard) var(--ease-standard);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.mobile-drawer {
  position: fixed; top: 0; bottom: 0;
  inset-inline-end: 0;
  width: min(360px, 88vw);
  background: var(--canvas);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: slide-in var(--duration-reveal) var(--ease-standard);
}
@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.mobile-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.mobile-drawer-nav {
  flex: 1;
  padding: 12px 16px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.mobile-drawer-nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 12px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 17px;
  color: var(--fg-1);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 500;
}
.mobile-drawer-nav a:hover { background: var(--canvas-sunk); }
.mobile-drawer-nav a.active { color: var(--primary); font-weight: 600; }
[data-theme="dark"] .mobile-drawer-nav a.active { color: var(--color-saffron-300); }
.mobile-drawer-nav a .soon {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--canvas-sunk); color: var(--fg-3); font-weight: 500;
}
.mobile-drawer-foot {
  padding: 20px 24px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 10px;
}
.mobile-drawer-note {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.7;
  margin: 8px 0 0;
  text-wrap: pretty;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 88px 56px 64px;
  overflow: hidden;
}
.hero-motif {
  position: absolute;
  inset-inline-start: -80px; top: 60px;
  width: 360px; height: 360px;
  color: var(--color-primary-800);
  opacity: 0.045;
  pointer-events: none;
}
.hero-motif-2 {
  position: absolute;
  inset-inline-end: -120px; bottom: -120px;
  width: 480px; height: 480px;
  color: var(--color-saffron-400);
  opacity: 0.06;
  pointer-events: none;
}
.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  display: inline-flex;
  gap: 10px; align-items: center;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  color: var(--fg-3);
  margin-bottom: 28px;
  padding: 6px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-1);
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--color-saffron-400);
}

.hero-title {
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: clamp(48px, 6.5vw, 88px);
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1.5;
  letter-spacing: 0;
  margin: 0;
  padding-bottom: 0.15em;
}
.hero-sub {
  font-family: "Amiri", "IBM Plex Sans Arabic", serif;
  font-size: clamp(20px, 2.2vw, 28px);
  color: var(--fg-2);
  line-height: 1.7;
  font-weight: 400;
  margin: 18px auto 0;
  max-width: 800px;
}
.hero-sub em {
  font-style: normal;
  color: var(--secondary);
  font-weight: 700;
}

/* Search input */
.search-wrap {
  position: relative;
  max-width: 720px;
  margin: 48px auto 0;
}
.search-box {
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 6px 8px 6px 20px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--duration-standard), box-shadow var(--duration-standard);
}
html[dir="rtl"] .search-box { padding: 6px 20px 6px 8px; }
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(217, 147, 63, 0.15);
}
.search-icon { color: var(--fg-3); flex-shrink: 0; }
.search-input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 18px;
  padding: 18px 16px;
  color: var(--fg-1);
  min-width: 0;
}
.search-input::placeholder { color: var(--fg-3); }
.search-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary);
  color: var(--fg-on-primary);
  border: none;
  padding: 12px 22px;
  border-radius: 12px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-micro);
}
.search-cta:hover { background: var(--primary-hover); }

.search-results {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 20;
  max-height: 420px;
  overflow-y: auto;
}
.search-result {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-micro);
}
.search-result:hover, .search-result.focused { background: var(--canvas-sunk); }
.search-result:last-child { border-bottom: none; }
.search-result-type {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--canvas-sunk);
  color: var(--fg-2);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 52px;
  text-align: center;
}
.search-result-type.مسألة { background: rgba(30, 42, 86, 0.08); color: var(--primary); }
.search-result-type.قاعدة { background: rgba(217, 147, 63, 0.18); color: var(--color-saffron-600); }
.search-result-type.فرق    { background: rgba(126, 47, 58, 0.10); color: var(--color-pomegranate-500); }
.search-result-type.كتاب   { background: rgba(15, 76, 92, 0.10); color: var(--secondary); }
.search-result-type.عالم   { background: rgba(48, 43, 32, 0.10); color: var(--fg-1); }
[data-theme="dark"] .search-result-type { background: rgba(255,255,255,0.08); }
.search-result-text { flex: 1; min-width: 0; }
.search-result-title {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 16px; font-weight: 600;
  color: var(--fg-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-subtitle {
  font-size: 13px; color: var(--fg-3);
  margin-top: 2px;
}
.search-result-arrow { color: var(--fg-3); flex-shrink: 0; }

.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--fg-3);
  font-size: 14px;
}

/* Stats strip */
.stats-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 56px auto 0;
  max-width: 1100px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.stat-cell {
  flex: 1 1 160px;
  padding: 22px 16px;
  text-align: center;
  border-inline-end: 1px solid var(--border-subtle);
}
.stat-cell:last-child { border-inline-end: none; }
.stat-value {
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  display: block;
  padding-bottom: 0.12em;
}
[data-theme="dark"] .stat-value { color: var(--color-saffron-300); }
.stat-label {
  font-size: 13px;
  color: var(--fg-2);
  margin-top: 8px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}

/* ============================================================
   GENERIC SECTION SCAFFOLDING
   ============================================================ */
.section {
  padding: 96px 56px;
  max-width: 1240px;
  margin: 0 auto;
}
.section-narrow { max-width: 1080px; }
.section-divider {
  border: 0;
  height: 1px;
  background: var(--border-subtle);
  max-width: 1240px;
  margin: 0 auto;
}
.section-head {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 48px;
  max-width: 760px;
}
.section-head.center { text-align: center; align-items: center; margin-inline: auto; }
.section-eyebrow {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-saffron-600);
  letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .section-eyebrow { color: var(--color-saffron-300); }
.section-eyebrow::before {
  content: ""; width: 24px; height: 1px;
  background: var(--color-saffron-400);
}
.section-title {
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1.4;
  margin: 0;
  padding-bottom: 0.1em;
}
.section-lead {
  font-family: "Amiri", "IBM Plex Sans Arabic", serif;
  font-size: 19px;
  color: var(--fg-2);
  line-height: 1.85;
  max-width: 720px;
  margin: 0;
}

/* ============================================================
   THREE-TIER CARDS
   ============================================================ */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tier {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 36px 32px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color var(--duration-standard), transform var(--duration-standard);
  overflow: hidden;
}
.tier:hover { border-color: var(--border-default); transform: translateY(-2px); }
.tier-rail {
  position: absolute;
  inset-inline-start: 0; inset-block: 0;
  width: 4px;
}
.tier[data-accent="sage"] .tier-rail { background: var(--color-teal-300); }
.tier[data-accent="gold"] .tier-rail { background: var(--color-saffron-400); }
.tier[data-accent="indigo"] .tier-rail { background: var(--color-primary-700); }
.tier-level {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-family: "Aref Ruqaa", serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--fg-1);
  padding-bottom: 0.1em;
}
.tier-level .latin {
  font-family: "Inter Tight", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tier-headline {
  font-family: "Amiri", serif;
  font-size: 20px;
  color: var(--secondary);
  line-height: 1.55;
  font-weight: 700;
  margin: 0;
}
[data-theme="dark"] .tier-headline { color: var(--color-teal-300); }
.tier-body {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 16px;
  color: var(--fg-2);
  line-height: 1.85;
  margin: 0;
}
.tier-cta {
  margin-top: 8px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
[data-theme="dark"] .tier-cta { color: var(--color-saffron-300); }
.tier-cta:hover { gap: 10px; }
.tier-cta::after { content: "←"; transition: margin var(--duration-micro); }
html[dir="ltr"] .tier-cta::after { content: "→"; }

/* ============================================================
   مسألة OF THE DAY
   ============================================================ */
.masala-card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.masala-head {
  padding: 32px 36px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background:
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  position: relative;
}
.masala-head::after {
  content: "";
  position: absolute;
  inset-inline-end: 24px; top: 24px;
  width: 80px; height: 80px;
  background-image: url("./assets/motifs/six-star.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.06;
  color: var(--primary);
}
.masala-pretitle {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-saffron-600);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
[data-theme="dark"] .masala-pretitle { color: var(--color-saffron-300); }
.masala-pretitle .badge-verified {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(46, 125, 94, 0.12);
  color: var(--color-success);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.masala-title {
  font-family: "Aref Ruqaa", "Amiri", serif;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1.4;
  margin: 0;
  padding-bottom: 0.1em;
}
.masala-intro {
  font-family: "Amiri", "IBM Plex Sans Arabic", serif;
  font-size: 18px;
  color: var(--fg-2);
  line-height: 1.95;
  margin-top: 16px;
  max-width: 720px;
}

/* Comparison table */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.compare-col {
  padding: 28px 24px;
  border-inline-end: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 12px;
  min-height: 280px;
  position: relative;
}
.compare-col:last-child { border-inline-end: none; }
.compare-col:nth-child(2n) { background: color-mix(in oklab, var(--canvas-sunk) 40%, var(--surface-1)); }

.compare-step {
  position: absolute;
  top: 16px; inset-inline-end: 16px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  font-family: "Aref Ruqaa", serif;
  font-size: 13px;
  color: var(--fg-3);
  background: var(--surface-2);
}

.compare-scholar {
  font-family: "Aref Ruqaa", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1.3;
  padding-bottom: 0.1em;
}
.compare-source {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  color: var(--fg-3);
  display: flex; flex-direction: column; gap: 2px;
}
.compare-source b { color: var(--secondary); font-weight: 600; }
[data-theme="dark"] .compare-source b { color: var(--color-teal-300); }
.compare-ruling {
  font-family: "Aref Ruqaa", serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  padding: 8px 0;
  border-block: 1px solid var(--border-subtle);
  text-align: center;
  letter-spacing: 0;
}
[data-theme="dark"] .compare-ruling { color: var(--color-saffron-300); }
.compare-verbatim {
  font-family: "Amiri", serif;
  font-size: 15px;
  color: var(--fg-2);
  line-height: 1.85;
  flex: 1;
}

.masala-foot {
  padding: 24px 36px;
  border-top: 1px solid var(--border-subtle);
  display: flex; flex-wrap: wrap; gap: 24px;
  align-items: center;
  justify-content: space-between;
  background: var(--canvas-sunk);
}
.qaida-tag {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 14px;
  color: var(--fg-1);
  text-decoration: none;
  cursor: pointer;
}
.qaida-tag .label { color: var(--color-saffron-600); font-size: 12px; font-weight: 600; }
[data-theme="dark"] .qaida-tag .label { color: var(--color-saffron-300); }
.qaida-tag b { font-weight: 700; }
.qaida-tag .ref { color: var(--fg-3); font-size: 12px; }

.cross-row {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.cross-label {
  font-size: 12px;
  color: var(--fg-3);
  font-family: "IBM Plex Sans Arabic", sans-serif;
}
.cross-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}
.cross-pill b { color: var(--fg-1); font-weight: 600; }
.cross-pill .v { color: var(--fg-3); font-size: 11px; }

.masala-cta-row {
  padding: 24px 36px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--primary);
  color: var(--fg-on-primary);
  border: none;
  padding: 14px 26px;
  border-radius: 12px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-micro);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-2);
  text-decoration: none;
  font-size: 14px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}
.btn-ghost:hover { color: var(--fg-1); }

/* ============================================================
   QAIDA OF THE DAY (smaller showcase)
   ============================================================ */
.qaida-card {
  background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.qaida-card::before {
  content: "";
  position: absolute;
  inset-inline-start: -40px; bottom: -40px;
  width: 240px; height: 240px;
  background-image: url("./assets/motifs/six-star.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.05;
  color: var(--color-saffron-400);
  pointer-events: none;
}
.qaida-pretitle {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  color: var(--color-saffron-600);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  font-weight: 600;
}
[data-theme="dark"] .qaida-pretitle { color: var(--color-saffron-300); }
.qaida-title {
  font-family: "Aref Ruqaa", serif;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1.4;
  padding-bottom: 0.1em;
  margin: 0;
}
.qaida-source {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 6px;
}
.qaida-body {
  font-family: "Amiri", serif;
  font-size: 17px;
  color: var(--fg-2);
  line-height: 1.95;
  margin-top: 16px;
  max-width: 640px;
}
.qaida-meta {
  display: flex; flex-direction: column;
  gap: 14px;
  border-inline-start: 1px solid var(--border-subtle);
  padding-inline-start: 32px;
  min-width: 200px;
}
.qaida-meta-item .k {
  font-size: 12px; color: var(--fg-3);
  font-family: "IBM Plex Sans Arabic", sans-serif;
  letter-spacing: 0.02em;
}
.qaida-meta-item .v {
  font-family: "Aref Ruqaa", serif;
  font-size: 22px;
  color: var(--primary);
  font-weight: 700;
  margin-top: 2px;
  padding-bottom: 0.1em;
}
[data-theme="dark"] .qaida-meta-item .v { color: var(--color-saffron-300); }

/* ============================================================
   FEATURES (six)
   ============================================================ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
}
.feature {
  background: var(--surface-1);
  padding: 36px 32px;
  display: flex; flex-direction: column; gap: 12px;
  transition: background var(--duration-standard);
}
.feature:hover { background: var(--surface-2); }
.feature-num {
  font-family: "Inter Tight", sans-serif;
  font-size: 12px;
  color: var(--fg-3);
  letter-spacing: 0.14em;
  font-weight: 600;
}
.feature-title {
  font-family: "Aref Ruqaa", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1.4;
  padding-bottom: 0.1em;
  margin: 0;
}
.feature-body {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 15px;
  color: var(--fg-2);
  line-height: 1.85;
  margin: 0;
  flex: 1;
}
.feature-meta {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 12px;
  color: var(--secondary);
  font-weight: 600;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  margin-top: 4px;
}
[data-theme="dark"] .feature-meta { color: var(--color-teal-300); }

/* ============================================================
   BOOKS SHOWCASE
   ============================================================ */
.books-section {
  position: relative;
  background: transparent;
}
.books-section::before {
  content: "";
  position: absolute;
  inset: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  width: 100vw;
  background: color-mix(in oklab, var(--canvas-sunk) 70%, transparent);
  z-index: -1;
  pointer-events: none;
}
.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.book {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  min-height: 200px;
  transition: border-color var(--duration-standard), transform var(--duration-standard);
  cursor: pointer;
}
.book:hover { border-color: var(--primary); transform: translateY(-2px); }
.book::before {
  content: "";
  position: absolute;
  inset-inline-start: 22px; top: 0;
  width: 3px; height: 32px;
  background: var(--color-saffron-400);
  border-radius: 0 0 2px 2px;
}
.book[data-tier="أصل"]::before { background: var(--primary); height: 40px; }
.book[data-tier="موسوعة"]::before { background: var(--secondary); height: 36px; }
.book[data-tier="أصول"]::before { background: var(--color-pomegranate-500); }

.book-tier {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  margin-top: 12px;
}
.book-title {
  font-family: "Aref Ruqaa", serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1.4;
  padding-bottom: 0.1em;
  margin: 0;
}
.book-author {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 14px;
  color: var(--fg-2);
}
.book-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 12px;
  color: var(--fg-3);
}
.book-foot b { color: var(--secondary); font-weight: 600; }
[data-theme="dark"] .book-foot b { color: var(--color-teal-300); }

.books-foot {
  margin-top: 28px;
  text-align: center;
}
.books-foot a {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
[data-theme="dark"] .books-foot a { color: var(--color-saffron-300); }

/* ============================================================
   LEARNING PATHS
   ============================================================ */
.paths-list {
  display: flex; flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border-subtle);
}
.path-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 28px;
  align-items: center;
  padding: 28px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-standard);
  text-decoration: none; color: inherit;
  cursor: pointer;
}
.path-row:hover { background: var(--surface-1); }
.path-row.disabled { opacity: 0.55; cursor: default; }
.path-row.disabled:hover { background: transparent; }
.path-num {
  font-family: "Aref Ruqaa", serif;
  font-size: 56px;
  font-weight: 700;
  color: var(--color-saffron-400);
  line-height: 1;
  text-align: center;
  padding-bottom: 0.05em;
}
.path-row.disabled .path-num { color: var(--fg-3); }
.path-title {
  font-family: "Aref Ruqaa", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1.4;
  padding-bottom: 0.1em;
}
.path-meta {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 4px;
}
.path-state {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(46, 125, 94, 0.12);
  color: var(--color-success);
}
.path-state.soon {
  background: var(--canvas-sunk);
  color: var(--fg-3);
}
.path-arrow { color: var(--fg-3); }

/* ============================================================
   منهجنا
   ============================================================ */
.approach-section {
  position: relative;
  background: transparent;
}
.approach-section::before {
  content: "";
  position: absolute;
  inset: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  width: 100vw;
  background: color-mix(in oklab, var(--canvas-sunk) 70%, transparent);
  z-index: -1;
  pointer-events: none;
}
.approach-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.approach-text p {
  font-family: "Amiri", serif;
  font-size: 19px;
  color: var(--fg-2);
  line-height: 2;
  margin: 0 0 18px;
}
.approach-text p:first-of-type::first-letter {
  font-family: "Aref Ruqaa", serif;
  font-size: 1.4em;
  color: var(--primary);
  font-weight: 700;
}
[data-theme="dark"] .approach-text p:first-of-type::first-letter { color: var(--color-saffron-300); }

.audit-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px;
}
.audit-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 16px;
}
.audit-row:last-child { border-bottom: none; }
.audit-k {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 14px;
  color: var(--fg-2);
}
.audit-v {
  font-family: "Aref Ruqaa", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-1);
  display: inline-flex; align-items: baseline; gap: 6px;
  padding-bottom: 0.1em;
}
.audit-v .unit {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
}
.audit-v.success { color: var(--color-success); }
.audit-v.warn { color: var(--color-saffron-600); }
[data-theme="dark"] .audit-v.warn { color: var(--color-saffron-300); }

.audit-legend {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}
.audit-legend-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  color: var(--fg-2);
}
.dot-success { width: 8px; height: 8px; border-radius: 999px; background: var(--color-success); }
.dot-warn    { width: 8px; height: 8px; border-radius: 999px; background: var(--color-saffron-400); }
.dot-danger  { width: 8px; height: 8px; border-radius: 999px; background: var(--color-pomegranate-500); }
.dot-pending { width: 8px; height: 8px; border-radius: 999px; background: var(--fg-3); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--color-ink);
  color: var(--color-parchment);
  padding: 64px 56px 28px;
}
[data-theme="dark"] .footer { background: #060810; }
.footer-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
}
.footer-brand-block { display: flex; flex-direction: column; gap: 18px; max-width: 480px; }
.footer-brand-block .brand-name { color: var(--color-parchment); }
.footer-brand-block p {
  font-family: "Amiri", serif;
  color: rgba(245, 239, 227, 0.7);
  font-size: 16px;
  line-height: 1.85;
  margin: 0;
}
.footer-newsletter { display: flex; gap: 0; margin-top: 8px; max-width: 420px; }
.footer-newsletter input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px 0 0 10px;
  border: 1px solid rgba(245, 239, 227, 0.18);
  background: rgba(245, 239, 227, 0.05);
  color: var(--color-parchment);
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 14px;
  outline: none;
}
html[dir="rtl"] .footer-newsletter input {
  border-radius: 0 10px 10px 0;
}
.footer-newsletter input::placeholder { color: rgba(245, 239, 227, 0.4); }
.footer-newsletter button {
  padding: 12px 22px;
  background: var(--color-saffron-400);
  color: var(--color-ink);
  border: none;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-radius: 0 10px 10px 0;
}
html[dir="rtl"] .footer-newsletter button { border-radius: 10px 0 0 10px; }
.footer-newsletter button:hover { background: var(--color-saffron-300); }

.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.footer-col h4 {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 13px;
  color: var(--color-saffron-300);
  margin: 0 0 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  color: rgba(245, 239, 227, 0.75);
  font-size: 14px;
  text-decoration: none;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}
.footer-col a:hover { color: var(--color-parchment); }
.footer-col .soon { color: rgba(245, 239, 227, 0.4); font-size: 11px; margin-inline-start: 4px; }

.footer-base {
  max-width: 1240px;
  margin: 56px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(245, 239, 227, 0.1);
  display: flex; justify-content: space-between; align-items: center;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 12px;
  color: rgba(245, 239, 227, 0.5);
  flex-wrap: wrap; gap: 12px;
}
.footer-base a { color: rgba(245, 239, 227, 0.75); text-decoration: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .books-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1180px) {
  .topnav { display: none; }
  .topbar { gap: 12px; padding: 14px 28px; }
  .menu-btn { display: grid; }
  .topright { gap: 8px; }
}
@media (max-width: 760px) {
  .signin-btn, .signup-btn { display: none; }
  .topbar { padding: 12px 20px; }
  .brand-name { font-size: 18px; }
  .brand-sub { font-size: 10px; }
  .brand-mark { width: 38px; height: 38px; }
}
@media (max-width: 900px) {
  .topbar { padding: 14px 24px; gap: 12px; }
  .hero, .section { padding: 56px 24px; }
  .footer { padding: 56px 24px 24px; }
  .tiers { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-col { border-inline-end: none; border-bottom: 1px solid var(--border-subtle); min-height: 0; }
  .compare-col:last-child { border-bottom: none; }
  .qaida-card { grid-template-columns: 1fr; gap: 24px; padding: 28px; }
  .qaida-meta { border-inline-start: none; border-top: 1px solid var(--border-subtle); padding-inline-start: 0; padding-top: 18px; flex-direction: row; flex-wrap: wrap; gap: 24px; }
  .feature-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .approach-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .path-row { grid-template-columns: 56px 1fr; gap: 16px; }
  .path-num { font-size: 40px; }
  .path-state, .path-arrow { grid-column: 2; justify-self: start; margin-top: 4px; }
  .stats-strip { border: none; }
  .stat-cell { flex: 1 1 33%; border-inline-end: none; }
}
@media (max-width: 480px) {
  .books-grid { grid-template-columns: 1fr; }
  .stats-strip { gap: 4px; }
  .stat-cell { flex: 1 1 50%; padding: 14px 8px; }
  .stat-value { font-size: 24px; }
  .search-input { font-size: 16px; padding: 14px 10px; }
  .search-cta { padding: 10px 16px; font-size: 13px; }
}

/* ============================================================
   ZELLIJ — Maghribi geometric ornament
   ============================================================ */

/* Hero — real Meknes zellij photograph as background.
   Strategy: image is rendered very large and centered; a layered radial+linear
   scrim of warm cream darkens edges and creates a soft halo around the
   title block so type stays maximally readable while the tilework shows
   through the gutters. */
/* Section content surfaces — semi-transparent so the fixed bg shows through subtly */
.section, .approach-section { position: relative; background: transparent; }
/* Hide synthetic SVG ribbons + per-section zellij panels (now redundant) */
.zelij-band { display: none; }
.zelij-hero-side { display: none; }
.approach-section .zelij-panel-bg { display: none; }

/* Constrain stray overflow on root containers */
section, header, footer, main { max-width: 100%; }
.hero, .section { overflow-x: clip; }

/* Hero side ornaments — small medallions in the gutters */
.zelij-hero-side {
  position: absolute;
  width: 220px; height: 220px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.zelij-hero-side.start { inset-inline-start: -64px; bottom: -40px; }
.zelij-hero-side.end   { inset-inline-end: -64px; top: 100px; }
[data-theme="dark"] .zelij-hero-side { opacity: 0.28; }

/* Repeating tile band — uses the real Meknes photograph cropped as a strip */
.zelij-band {
  position: relative;
  height: 84px;
  overflow: hidden;
  background-image:
    linear-gradient(to bottom,
      rgba(244,237,222,0.0) 0%,
      rgba(244,237,222,0.0) 100%),
    url("./assets/zellij-meknes.png");
  background-size: auto, 1600px auto;
  background-position: center, center 28%;
  background-repeat: no-repeat, repeat-x;
  border-top: 2px solid var(--zelij-cobalt-deep);
  border-bottom: 2px solid var(--zelij-cobalt-deep);
}
.zelij-band > svg, .zelij-band > .zelij-band-svg { display: none !important; }
[data-theme="dark"] .zelij-band {
  background: color-mix(in oklab, var(--canvas-sunk) 70%, var(--zelij-cobalt) 30%);
  border-color: rgba(245,239,227,0.20);
}
.zelij-band-svg { display: block; width: 100%; height: 100%; }

.zelij-band.tall { height: 72px; }
.zelij-band.tall .zelij-band-svg { transform: scale(1); transform-origin: center; }

/* Decorative corner tile on cards */
.zelij-corner {
  position: absolute;
  top: 0; inset-inline-end: 0;
  width: 64px; height: 64px;
  color: var(--zelij-saffron);
  pointer-events: none;
  opacity: 0.55;
}
.zelij-corner.bl { top: auto; bottom: 0; inset-inline-end: auto; inset-inline-start: 0; transform: rotate(180deg); }

/* Tile-pattern background panel — used for full-bleed sections */
.zelij-panel {
  position: relative;
  background: var(--zelij-ivory);
  overflow: hidden;
}
[data-theme="dark"] .zelij-panel { background: color-mix(in oklab, var(--canvas-sunk) 80%, var(--zelij-cobalt) 20%); }
.zelij-panel-tile {
  position: absolute; inset: 0;
  opacity: 0.16;
  pointer-events: none;
}
[data-theme="dark"] .zelij-panel-tile { opacity: 0.22; }

/* Geometric divider — single khatam star centered between sections */
.zelij-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 24px;
  padding: 32px 24px;
  position: relative;
}
.zelij-divider::before, .zelij-divider::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(to right, transparent, var(--border-default), transparent);
  max-width: 280px;
}
.zelij-divider-star {
  width: 56px; height: 56px;
  color: var(--zelij-saffron);
  flex-shrink: 0;
}
.zelij-divider-star svg { display: block; width: 100%; height: 100%; }

/* Brand mark variant — replace the simple polygon with a tile star */
.brand-mark.zelij {
  background: var(--zelij-cobalt);
  border-color: var(--zelij-line);
  color: var(--zelij-saffron);
}
.brand-mark.zelij svg { width: 100%; height: 100%; }

/* Hero zellij card — a small frame around hero stats showing tile work */
.hero-zelij-frame {
  position: relative;
  margin-top: 36px;
  padding: 4px;
  background:
    repeating-linear-gradient(45deg,
      var(--zelij-cobalt) 0 6px,
      var(--zelij-saffron) 6px 12px,
      var(--zelij-teal) 12px 18px,
      var(--zelij-pom) 18px 24px);
  border-radius: 4px;
}
.hero-zelij-frame > * {
  background: var(--canvas);
  border-radius: 2px;
}

/* Featured masala card — zellij ornament corners */
.masala-card.with-zelij {
  position: relative;
  isolation: isolate;
}
.masala-card.with-zelij::before, .masala-card.with-zelij::after {
  content: "";
  position: absolute;
  width: 80px; height: 80px;
  background-image:
    radial-gradient(circle at 50% 50%, var(--zelij-saffron) 0 6%, transparent 7%),
    repeating-conic-gradient(from 0deg,
      var(--zelij-cobalt) 0deg 22.5deg,
      var(--zelij-saffron) 22.5deg 45deg);
  -webkit-mask: radial-gradient(closest-side, black 60%, transparent 64%);
          mask: radial-gradient(closest-side, black 60%, transparent 64%);
  opacity: 0.16;
  pointer-events: none;
  z-index: -1;
}
.masala-card.with-zelij::before { top: -28px; inset-inline-start: -28px; }
.masala-card.with-zelij::after  { bottom: -28px; inset-inline-end: -28px; }
[data-theme="dark"] .masala-card.with-zelij::before,
[data-theme="dark"] .masala-card.with-zelij::after { opacity: 0.28; }

/* Tile-rail accent for tier/feature cards */
.tile-rail {
  display: flex;
  height: 6px;
  margin-bottom: 18px;
  border-radius: 1px;
  overflow: hidden;
  border: 1px solid var(--zelij-line);
}
.tile-rail span { flex: 1; }
.tile-rail span:nth-child(1) { background: var(--zelij-cobalt); }
.tile-rail span:nth-child(2) { background: var(--zelij-saffron); }
.tile-rail span:nth-child(3) { background: var(--zelij-teal); }
.tile-rail span:nth-child(4) { background: var(--zelij-pom); }
.tile-rail span:nth-child(5) { background: var(--zelij-cobalt); }
.tile-rail span:nth-child(6) { background: var(--zelij-saffron); }
.tile-rail span:nth-child(7) { background: var(--zelij-teal); }
.tile-rail span:nth-child(8) { background: var(--zelij-pom); }

/* Section headers with zellij eyebrow ornament */
.section-eyebrow.zelij::before {
  content: "";
  width: 28px; height: 16px;
  background:
    conic-gradient(from 22.5deg,
      var(--zelij-cobalt) 0 45deg,
      var(--zelij-saffron) 45deg 90deg,
      var(--zelij-teal) 90deg 135deg,
      var(--zelij-pom) 135deg 180deg,
      var(--zelij-cobalt) 180deg 225deg,
      var(--zelij-saffron) 225deg 270deg,
      var(--zelij-teal) 270deg 315deg,
      var(--zelij-pom) 315deg 360deg);
  -webkit-mask: radial-gradient(closest-side, black 70%, transparent 74%);
          mask: radial-gradient(closest-side, black 70%, transparent 74%);
  opacity: 0.85;
}

/* Approach section — full-bleed zellij panel behind */
.approach-section {
  position: relative;
}
.approach-section .zelij-panel-bg {
  position: absolute; inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("./assets/zellij-meknes.png");
  background-size: 800px auto;
  background-position: center;
  background-repeat: repeat;
  -webkit-mask: linear-gradient(to right,
    transparent 0%, black 30%, black 70%, transparent 100%);
          mask: linear-gradient(to right,
    transparent 0%, black 30%, black 70%, transparent 100%);
}
[data-theme="dark"] .approach-section .zelij-panel-bg { opacity: 0.13; }

/* Footer band — zellij strip above the footer base */
.footer-zelij {
  margin-top: 32px;
  border-top: 1px solid rgba(245,239,227,0.12);
  border-bottom: 1px solid rgba(245,239,227,0.12);
}
