/* hub.css — SARI Internal Hub shell styles
   @import brand tokens first; never hardcode hex/size/radius.
   All token references come from brand/colors_and_type.css.
   Principles cited inline: P1 Arabic-first, P2 calm+one-primary-action,
   P4 clarity, P5 state visible, P6 colour+label, P7 recognition, P9 honesty. */

@import url('../brand/colors_and_type.css');

/* =====================================================================
   Reset & base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* P1: Arabic is the source — default RTL */
  font-family: var(--font-arabic);
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

img, svg { display: block; }

/* =====================================================================
   Hub header — dark evergreen cover (P2: one primary identity zone)
   ===================================================================== */
.hub-header {
  background: var(--forest);
  padding: var(--space-2xl) var(--space-xl) var(--space-xl);
  position: relative;
  overflow: hidden;
}



/* SARI wordmark lockup styles.
   Horizontal block = the canonical "copy this" values from the sari-design README.
   Stacked block = the same values on the vertical axis, mark-to-wordmark gap raised to
   the §4 stacked multiple (1.5u vs 1.2u horizontal). Mark geometry and type sizes are
   unchanged. Depends on SARI tokens: @import "colors_and_type.css" (or load it first)
   so --logo-bar, --forest, --ink, --font-arabic, --font-latin resolve. */

.sari-lockup{ display:inline-flex; align-items:center; gap:12px; }     /* mark to wordmark (1.2u) */
.sari-lockup__mark{ height:34px; width:auto; flex:none; }              /* the mark sets the scale */
.sari-lockup__words{ display:flex; flex-direction:column; line-height:1; }
.sari-lockup__ar{ font-family:var(--font-arabic); font-weight:600; font-size:22px; color:var(--forest); line-height:1; }
.sari-lockup__lat{ font-family:var(--font-latin); font-weight:300; font-size:14px; letter-spacing:2.5px; color:var(--ink); margin-top:2px; }

/* Stacked: mark on top, wordmark centred beneath. Gap 15px ≈ 1.5u (the §4 stacked value). */
.sari-lockup--stacked{ flex-direction:column; gap:15px; }
.sari-lockup--stacked .sari-lockup__words{ align-items:center; text-align:center; }

/* On dark or accent surfaces: swap the mark file (sari-mark-dark.svg / sari-mark-on-accent.svg)
   and recolour the words — ساري to --green-mid or #FFFFFF, SARI to #FFFFFF.
   Apply .sari-lockup--on-dark / .sari-lockup--on-accent on the parent. */
.sari-lockup--on-dark .sari-lockup__ar,
.sari-lockup--on-accent .sari-lockup__ar{ color:var(--green-mid); }
.sari-lockup--on-dark .sari-lockup__lat,
.sari-lockup--on-accent .sari-lockup__lat{ color:#FFFFFF; }


/* =====================================================================
   UX Revamp: Topbar, Clock, Search, Animations, Breadcrumbs
   ===================================================================== */
.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: var(--space-lg);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Clock */
.hub-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  background: var(--forest-dark);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.1);
  direction: ltr; /* keep time LTR */
}
.clock-pulse {
  width: 6px;
  height: 6px;
  background: var(--green-mid);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green-mid);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* Search Bar */
.search-container {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 10px;
  animation: slideUpFade 0.6s ease forwards;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-family: var(--font-arabic);
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}
[dir="ltr"] .search-input {
  padding: 14px 48px 14px 20px;
  font-family: var(--font-latin);
}
.search-input::placeholder { color: var(--green-mid); }
.search-input:focus {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.05);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green-mid);
  width: 20px;
  height: 20px;
  pointer-events: none;
}
[dir="ltr"] .search-icon {
  left: auto;
  right: 18px;
}

.search-shortcut {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green-mid);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--forest-dark);
  pointer-events: none;
}
[dir="ltr"] .search-shortcut {
  right: auto;
  left: 18px;
}

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(14, 44, 29, 0.25);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
}
.search-dropdown.active { display: flex; }
.search-result {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-arabic);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}
[dir="ltr"] .search-result { font-family: var(--font-latin); }
.search-result:hover, .search-result.selected {
  background: var(--forest-soft);
}
.search-result:last-child { border-bottom: none; }
.search-result-icon {
  width: 18px; height: 18px; color: var(--forest);
}
.search-result-meta {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-inline-start: auto;
}

/* Breadcrumbs */
.hub-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-arabic);
  font-size: 14px;
  color: var(--green-mid);
  margin-bottom: var(--space-md);
  animation: slideUpFade 0.4s ease forwards;
}
[lang="en"] .hub-breadcrumb { font-family: var(--font-latin); }
.crumb-link {
  color: var(--green-mid);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.crumb-link:hover { color: #fff; }
.crumb-sep { font-family: var(--font-mono); color: var(--green-mid); opacity: 0.7; }
.crumb-current { color: #fff; font-weight: 500; }

/* Entry Animations */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-card {
  opacity: 0;
  animation: slideUpFade 0.6s ease forwards;
}
.anim-card:nth-child(1) { animation-delay: 0.05s; }
.anim-card:nth-child(2) { animation-delay: 0.10s; }
.anim-card:nth-child(3) { animation-delay: 0.15s; }
.anim-card:nth-child(4) { animation-delay: 0.20s; }
.anim-card:nth-child(5) { animation-delay: 0.25s; }
.anim-card:nth-child(6) { animation-delay: 0.30s; }
.anim-card:nth-child(7) { animation-delay: 0.35s; }
.anim-card:nth-child(8) { animation-delay: 0.40s; }

/* Alive Hover Physics */
.alive-hover {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.alive-hover:hover {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 12px 24px rgba(30, 77, 53, 0.12) !important;
  border-color: var(--forest-active) !important;
  z-index: 2;
}

/* ---- Language toggle ---- */

.lang-toggle {
  margin-inline-start: auto;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-full);
  color: rgba(255,255,255,.8);
  font-family: var(--font-latin);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  padding: var(--space-2xs) var(--space-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-entrance),
              border-color var(--dur-fast) var(--ease-entrance);
  white-space: nowrap;
}
.lang-toggle:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
}

/* ---- Hub headline in header ---- */
.hub-headline {
  font-family: var(--font-arabic);
  font-size: var(--text-ar-heading);
  font-weight: var(--weight-medium);
  color: rgba(255,255,255,.9);
  letter-spacing: 0;
  padding-bottom: 0.1em;
}
[lang="en"] .hub-headline {
  font-family: var(--font-latin);
  font-size: var(--text-h2);
  letter-spacing: var(--track-h2);
  padding-bottom: 0;
}

/* ---- Eyebrow (section meta) ---- */
.hub-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: var(--space-xs);
}

/* =====================================================================
   Main content area
   ===================================================================== */
.hub-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl) var(--space-3xl);
}

/* =====================================================================
   Quick-access row (P7: recognition — branded chip per tool)
   ===================================================================== */
.quick-access {
  margin-bottom: var(--space-2xl);
}

.quick-access-label {
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.quick-access-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Individual chip */
.qa-chip {
  opacity: 0;
  animation: slideUpFade 0.6s ease forwards;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-lg);
  min-width: 88px;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow var(--dur-fast) var(--ease-entrance),
              border-color var(--dur-fast) var(--ease-entrance),
              transform var(--dur-fast) var(--ease-entrance);
  box-shadow: var(--shadow-sm);
}
.qa-chip:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(30, 77, 53, 0.12);
  border-color: var(--forest-active);
  z-index: 2;
  /* old */
  box-shadow: var(--shadow-md);
  border-color: var(--line);
  transform: translateY(-2px);
}

.qa-chip-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Fallback icon for qa-chip when logo not yet placed */
.qa-chip-logo-fallback {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  background: var(--forest-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--forest);
}

.qa-chip-label {
  font-size: var(--text-caption);
  font-family: var(--font-latin);
  font-weight: var(--weight-medium);
  color: var(--ink-2);
  /* P4: bidi-isolate brand names so they never flip in RTL */
  unicode-bidi: isolate;
  direction: ltr;
  white-space: nowrap;
}

/* =====================================================================
   Section grid
   ===================================================================== */
.sections-label {
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* Section card */
.section-card {
  /* added by python script */
  opacity: 0;
  animation: slideUpFade 0.6s ease forwards;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  transition: box-shadow var(--dur-fast) var(--ease-entrance),
              border-color var(--dur-fast) var(--ease-entrance),
              transform var(--dur-fast) var(--ease-entrance);
  box-shadow: var(--shadow-sm);
  position: relative;
  cursor: pointer;
  min-height: 120px;
}
.section-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(30, 77, 53, 0.12);
  border-color: var(--forest-active);
  z-index: 2;
  /* old */
  box-shadow: var(--shadow-md);
  border-color: var(--forest-soft);
  transform: translateY(-2px);
}

.section-card-icon {
  width: 32px;
  height: 32px;
  color: var(--forest);
  flex-shrink: 0;
}

.section-card-label {
  font-family: var(--font-arabic);
  font-size: var(--text-ar-heading);
  font-weight: var(--weight-medium);
  color: var(--ink);
  letter-spacing: 0;
  padding-bottom: 0.1em;
  line-height: 1.1;
}
[lang="en"] .section-card-label {
  font-family: var(--font-latin);
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-h2);
  padding-bottom: 0;
  line-height: var(--leading-h2);
}

/* child count badge */
.section-card-children {
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
}

/* Gated affordance — P5 state visible, P6 colour+label */
.section-card-gated {
  position: absolute;
  top: var(--space-sm);
  /* RTL: inline-start = right */
  inset-inline-start: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--forest-soft);
  border: 1px solid rgba(30,77,53,.15);
  border-radius: var(--radius-full);
  padding: 2px var(--space-xs) 2px 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest);
}
[dir="ltr"] .section-card-gated {
  inset-inline-start: auto;
  inset-inline-end: var(--space-sm);
}

.gated-lock-icon {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* =====================================================================
   Members / directory row
   directory-card now uses .section-card base styles;
   Use a grid matching section-grid so the card is proportionally sized.
   ===================================================================== */
.directory-row {
  margin-top: var(--space-sm);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* directory-card inherits .section-card from hub.js render;
   no extra rules needed — it renders identically to a section card. */

/* =====================================================================
   Section page — document list
   ===================================================================== */
.section-header {
  background: var(--forest);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  margin-bottom: var(--space-md);
  transition: color var(--dur-fast) var(--ease-entrance);
}
.back-link:hover { color: var(--green-mid); }

.section-page-title {
  font-family: var(--font-arabic);
  font-size: var(--text-ar-display);
  font-weight: var(--weight-bold);
  color: var(--green-mid);
  letter-spacing: 0;
  padding-bottom: 0.1em;
}
[lang="en"] .section-page-title {
  font-family: var(--font-latin);
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  color: #fff;
  letter-spacing: var(--track-h1);
  padding-bottom: 0;
}

/* Document list (Grid Layout) */
.doc-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.doc-item {
  opacity: 0;
  animation: slideUpFade 0.6s ease forwards;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-fast) var(--ease-entrance),
              border-color var(--dur-fast) var(--ease-entrance),
              transform var(--dur-fast) var(--ease-entrance);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.doc-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(30, 77, 53, 0.12);
  border-color: var(--forest-active);
  z-index: 2;
  /* old */
  box-shadow: var(--shadow-md);
  border-color: var(--forest-soft);
  transform: translateY(-2px);
}

.doc-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  flex: 1;
}

/* Document Live Preview Thumbnail */
.doc-thumbnail-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.doc-thumbnail-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 400%; /* Render at 4x size then scale down */
  height: 400%;
  transform: scale(0.25);
  transform-origin: top left;
  border: none;
  pointer-events: none; /* Make un-clickable so the card link works */
}

/* Document Meta area */
.doc-meta {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  flex: 1;
}

.doc-title {
  flex: 1;
  font-family: var(--font-arabic);
  font-size: var(--text-ar-body);
  font-weight: var(--weight-medium);
  color: var(--ink);
  letter-spacing: 0;
}
[lang="en"] .doc-title {
  font-family: var(--font-latin);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
}

.doc-arrow {
  color: var(--muted);
  font-size: 16px;
}

/* ---- Empty / coming-soon placeholder ---- */
.placeholder-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--muted);
}
.placeholder-icon {
  width: 48px;
  height: 48px;
  color: var(--line);
  margin: 0 auto var(--space-md);
}
.placeholder-text {
  font-family: var(--font-arabic);
  font-size: var(--text-ar-body);
  color: var(--muted);
}
[lang="en"] .placeholder-text {
  font-family: var(--font-latin);
  font-size: var(--text-body);
}

/* ---- Parent landing child card grid ---- */
.child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.child-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  transition: box-shadow var(--dur-fast) var(--ease-entrance),
              border-color var(--dur-fast) var(--ease-entrance),
              transform var(--dur-fast) var(--ease-entrance);
  box-shadow: var(--shadow-sm);
  min-height: 100px;
}
.child-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--forest-soft);
  transform: translateY(-2px);
}

.child-card-label {
  font-family: var(--font-arabic);
  font-size: var(--text-ar-heading);
  font-weight: var(--weight-medium);
  color: var(--ink);
  letter-spacing: 0;
  padding-bottom: 0.1em;
}
[lang="en"] .child-card-label {
  font-family: var(--font-latin);
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-h2);
  padding-bottom: 0;
}

/* =====================================================================
   Members directory
   ===================================================================== */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

.member-card {
  opacity: 0;
  animation: slideUpFade 0.6s ease forwards;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  transition: box-shadow var(--dur-fast) var(--ease-entrance),
              border-color var(--dur-fast) var(--ease-entrance),
              transform var(--dur-fast) var(--ease-entrance);
  box-shadow: var(--shadow-sm);
}
.member-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(30, 77, 53, 0.12);
  border-color: var(--forest-active);
  z-index: 2;
  /* old */
  box-shadow: var(--shadow-md);
  border-color: var(--forest-soft);
  transform: translateY(-2px);
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--forest-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-latin);
  font-weight: var(--weight-bold);
  font-size: 18px;
  color: var(--forest);
  margin-bottom: var(--space-xs);
}

.member-name {
  font-family: var(--font-arabic);
  font-size: var(--text-ar-heading);
  font-weight: var(--weight-medium);
  color: var(--ink);
  letter-spacing: 0;
  padding-bottom: 0.1em;
}

.member-role {
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
}

/* =====================================================================
   Hub footer
   ===================================================================== */
.hub-footer {
  border-top: 1px solid var(--line-2);
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--faint);
}

/* =====================================================================
   404 page
   ===================================================================== */
.not-found-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl);
  background: var(--paper);
}
.not-found-code {
  font-family: var(--font-mono);
  font-size: 80px;
  font-weight: var(--weight-bold);
  color: var(--line);
  letter-spacing: -4px;
  line-height: 1;
  margin-bottom: var(--space-lg);
}
.not-found-title {
  font-family: var(--font-arabic);
  font-size: var(--text-ar-heading);
  color: var(--ink);
  margin-bottom: var(--space-sm);
}
[lang="en"] .not-found-title {
  font-family: var(--font-latin);
  font-size: var(--text-h2);
}
.not-found-body {
  font-family: var(--font-arabic);
  font-size: var(--text-ar-body);
  color: var(--muted);
  margin-bottom: var(--space-xl);
}
[lang="en"] .not-found-body {
  font-family: var(--font-latin);
  font-size: var(--text-body);
}
.not-found-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--forest);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-xl);
  font-family: var(--font-latin);
  font-weight: var(--weight-medium);
  font-size: var(--text-body);
  box-shadow: var(--shadow-cta);
  transition: background var(--dur-fast) var(--ease-entrance);
  text-decoration: none;
}
.not-found-cta:hover { background: var(--forest-active); }

/* =====================================================================
   Utility
   ===================================================================== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Honour reduced-motion (from brand tokens) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 600px) {
  .hub-main { padding: var(--space-xl) var(--space-md) var(--space-2xl); }
  .hub-header { padding: var(--space-xl) var(--space-md) var(--space-lg); }
  .section-grid { grid-template-columns: 1fr 1fr; }
  .child-grid { grid-template-columns: 1fr 1fr; }
  .member-grid { grid-template-columns: 1fr; }
}

.section-card:nth-child(1), .doc-item:nth-child(1), .qa-chip:nth-child(1), .member-card:nth-child(1) { animation-delay: 0.05s; }
.section-card:nth-child(2), .doc-item:nth-child(2), .qa-chip:nth-child(2), .member-card:nth-child(2) { animation-delay: 0.10s; }
.section-card:nth-child(3), .doc-item:nth-child(3), .qa-chip:nth-child(3), .member-card:nth-child(3) { animation-delay: 0.15s; }
.section-card:nth-child(4), .doc-item:nth-child(4), .qa-chip:nth-child(4), .member-card:nth-child(4) { animation-delay: 0.20s; }
.section-card:nth-child(5), .doc-item:nth-child(5), .qa-chip:nth-child(5), .member-card:nth-child(5) { animation-delay: 0.25s; }
.section-card:nth-child(6), .doc-item:nth-child(6), .qa-chip:nth-child(6), .member-card:nth-child(6) { animation-delay: 0.30s; }
.section-card:nth-child(7), .doc-item:nth-child(7), .qa-chip:nth-child(7), .member-card:nth-child(7) { animation-delay: 0.35s; }
.section-card:nth-child(8), .doc-item:nth-child(8), .qa-chip:nth-child(8), .member-card:nth-child(8) { animation-delay: 0.40s; }

/* Language visibility utilities */
[lang="ar"] .en-only { display: none !important; }
[lang="en"] .ar-only { display: none !important; }

/* Structural Numbering */
.section-number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
}
.section-card-icon {
  margin-bottom: 0 !important; /* override old margin if inside flex */
}
