/* ════════════════════════════════════════════════════════════
   هُنا ✦ Shell  v0.5
   topbar · drawer · bottom-nav · footer · banner · feature-grid
   يعتمد على /design/system.css
   ════════════════════════════════════════════════════════════ */

html, body { -webkit-tap-highlight-color: transparent; }

button, .huna-nav-item, .huna-tab {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Topbar ─────────────────────────────────────── */
.huna-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 0 var(--s-3);
  padding-top: env(safe-area-inset-top, 0);
  height: calc(60px + env(safe-area-inset-top, 0));
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(184, 115, 47, 0.10);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.theme-paper-warm .huna-topbar {
  background: rgba(242, 237, 229, 0.85);
}
.theme-dark .huna-topbar,
.theme-night .huna-topbar {
  background: rgba(15, 15, 15, 0.78);
  border-bottom-color: rgba(212, 165, 116, 0.12);
}

.huna-topbar-left,
.huna-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.huna-topbar-left  { justify-content: flex-start; }
.huna-topbar-right { justify-content: flex-end; }
.huna-topbar-center {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Icon button */
.huna-icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-deep);
  font-size: 17px;
  background: transparent;
  position: relative;
  transition: background var(--t-fast);
}
.theme-dark .huna-icon-btn,
.theme-night .huna-icon-btn { color: var(--paper); }
.huna-icon-btn:hover { background: var(--gold-tint); }
.huna-icon-btn:active { background: rgba(184, 115, 47, 0.18); }

.huna-icon-btn .huna-badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--gold-deep);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}
.huna-icon-btn .huna-badge:empty { display: none; }

/* ── Flame button (replaces bell in topbar) ── */
.huna-flame-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.18), rgba(184, 115, 47, 0.10));
  border: 1px solid rgba(184, 115, 47, 0.22);
  color: var(--ink-deep);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.huna-flame-btn:hover {
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.30), rgba(184, 115, 47, 0.16));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(184, 115, 47, 0.18);
}
.huna-flame-btn .huna-flame-icon {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(255, 130, 50, 0.45));
}
.theme-dark .huna-flame-btn,
.theme-night .huna-flame-btn { color: var(--paper); border-color: rgba(255, 200, 120, 0.28); }

/* ── v4.0: Topbar search button ── */
.huna-topbar-search {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  margin-inline-end: 8px;
  color: var(--ink-deep);
  text-decoration: none;
  border-radius: 999px;
  transition: background 180ms;
}
.huna-topbar-search:hover { background: rgba(0,0,0,0.04); }
.theme-dark .huna-topbar-search, .theme-night .huna-topbar-search { color: var(--paper); }

/* ── Topbar lantern (Mishkat) ── */
.huna-topbar-lantern {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  margin-inline-end: 8px;
  color: var(--ink-deep);
  text-decoration: none;
  position: relative;
  border-radius: 999px;
  transition: background 180ms;
}
.huna-topbar-lantern:hover { background: rgba(0,0,0,0.04); }
.huna-topbar-lantern .lantern-flame {
  animation: hunaLanternFlicker 3s ease-in-out infinite;
  transform-origin: center;
}
@keyframes hunaLanternFlicker {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.huna-topbar-lantern.is-active .lantern-flame {
  animation: hunaLanternBlaze 1.4s ease-in-out infinite;
  filter: drop-shadow(0 0 4px #E8B547);
}
@keyframes hunaLanternBlaze {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.18); }
}
.huna-topbar-lantern.is-dim .lantern-flame { opacity: 0.3; filter: none; animation: none; }
.theme-dark .huna-topbar-lantern, .theme-night .huna-topbar-lantern { color: var(--paper); }

/* ── Topbar notifications (Desktop only — bottom-nav holds it on mobile/tablet) ── */
.huna-topbar-notif {
  display: none;
  position: relative;
  width: 40px; height: 40px;
  border: 1px solid var(--paper-edge, #E8DFC8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-deep);
  cursor: pointer;
  align-items: center; justify-content: center;
  margin-inline-end: 10px;
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.huna-topbar-notif:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(40, 24, 8, 0.10);
}
.huna-topbar-notif-icon { display: inline-flex; line-height: 0; color: var(--ink-deep); }
.huna-topbar-notif-badge {
  position: absolute;
  top: 4px; inset-inline-end: 4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #C4523A;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 16px;
  text-align: center;
  border: 2px solid var(--paper-warm, #FBF7EF);
  box-sizing: content-box;
  display: none;
}
.huna-topbar-notif-badge.is-active { display: block; }
.huna-topbar-notif-badge:empty { display: none; }
@media (min-width: 1024px) {
  .huna-topbar-notif { display: inline-flex; }
}
.theme-dark .huna-topbar-notif,
.theme-night .huna-topbar-notif {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 200, 120, 0.22);
}

/* ── Flames modal ── */
.huna-flame-modal-bg {
  position: fixed; inset: 0;
  background: rgba(20, 14, 8, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: huna-flame-fade 220ms ease;
}
.huna-flame-modal-bg[hidden] { display: none; }
@keyframes huna-flame-fade { from { opacity: 0; } to { opacity: 1; } }
.huna-flame-modal {
  background: var(--paper-warm, #FAF7F2);
  border-radius: var(--r-xl, 18px);
  border: 1px solid var(--paper-edge, rgba(0,0,0,0.06));
  padding: 28px 22px 20px;
  max-width: 360px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 30px 80px rgba(40, 24, 8, 0.30);
  animation: huna-flame-pop 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes huna-flame-pop {
  from { transform: translateY(8px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.huna-flame-modal-x {
  position: absolute;
  top: 10px; inset-inline-end: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-mute);
  font-size: 16px;
  cursor: pointer;
  border: 0;
}
.huna-flame-modal-x:hover { background: rgba(0,0,0,0.05); color: var(--ink-deep); }
.huna-flame-modal-head { margin-bottom: 20px; }
.huna-flame-big {
  display: block;
  font-size: 56px;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 14px rgba(255, 140, 50, 0.55));
  animation: huna-flame-flicker 1.8s ease-in-out infinite alternate;
}
@keyframes huna-flame-flicker {
  from { filter: drop-shadow(0 0 8px rgba(255, 140, 50, 0.45)); }
  to   { filter: drop-shadow(0 0 18px rgba(255, 165, 80, 0.70)); }
}
.huna-flame-counter {
  font-family: var(--font-arabic-heading);
  font-size: 38px;
  font-weight: 400;
  color: var(--ink-deep);
  line-height: 1;
}
.huna-flame-counter .sep { opacity: 0.4; margin: 0 4px; }
.huna-flame-modal-sub {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.huna-flame-modal-body {
  border-top: 1px solid var(--paper-edge, rgba(0,0,0,0.06));
  padding-top: 18px;
}
.huna-rank-row {
  display: flex; align-items: baseline; justify-content: center;
  gap: 6px; flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-deep);
  margin-bottom: 12px;
}
.huna-rank-row .star { color: var(--gold-deep); }
.huna-rank-row .taqah { font-family: var(--font-mono); font-weight: 600; }
.huna-rank-row .taqah-lbl { color: var(--ink-mute); font-size: 12px; }
.huna-rank-row .sep { color: var(--ink-faint); }
.huna-rank-row .rank { color: var(--gold-deep); font-weight: 500; }
.huna-rank-progress {
  height: 6px;
  background: rgba(184, 115, 47, 0.10);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 6px;
}
.huna-rank-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), #d4a574);
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.huna-rank-progress-meta {
  font-size: 11px;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.huna-flame-modal-cta {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 999px;
  background: var(--ink-deep);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-fast);
}
.huna-flame-modal-cta:hover { background: var(--gold-deep); }

/* ── Sunset mode (v0.9 لمسة إبداعية) ── */
/* عند المغرب (5-7م مكة) → tint برتقالي خفيف على كامل الصفحة */
body.huna-sunset {
  background: linear-gradient(180deg, #FAF7F2 0%, #FAE8D8 70%, #F5D5B8 100%);
}
body.huna-sunset .huna-topbar { background: rgba(255, 240, 220, 0.92); }
body.huna-sunset::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 30% at 50% 100%, rgba(255, 140, 60, 0.18), transparent 70%);
  z-index: 0;
}

/* ── Welcome glow للمستخدم الجديد (أول 7 أيام) — موجود مسبقاً ── */

/* ── Easter egg: الضغط 5 مرات على ✦ في topbar → shimmer ── */
.huna-logo-link.huna-shimmer {
  animation: huna-shimmer-anim 1200ms ease-in-out;
}
@keyframes huna-shimmer-anim {
  0%, 100% { color: inherit; text-shadow: none; }
  50% { color: #d4a574; text-shadow: 0 0 18px rgba(212, 165, 116, 0.85), 0 0 40px rgba(212, 165, 116, 0.4); transform: scale(1.05); }
}

/* Logo */
.huna-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-family: var(--font-arabic-heading);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0;
}
html[dir="ltr"] .huna-logo-link {
  font-family: var(--font-latin-heading);
  font-weight: 400;
  letter-spacing: 0.01em;
}
.huna-logo-link .huna-logo-mark {
  color: var(--gold-deep);
  font-size: 15px;
  line-height: 1;
}

/* Avatar */
.huna-avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-deep), var(--rose-soft));
  color: var(--paper);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
  border: 0;
  cursor: pointer;
}
.huna-avatar-btn img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* Topbar pill CTAs (guest) */
.huna-topbar .huna-cta {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid rgba(184, 115, 47, 0.30);
  color: var(--ink-deep);
  background: transparent;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast);
  cursor: pointer;
  white-space: nowrap;
}
.theme-dark .huna-topbar .huna-cta,
.theme-night .huna-topbar .huna-cta {
  color: var(--paper);
  border-color: rgba(212, 165, 116, 0.40);
}
.huna-topbar .huna-cta:hover {
  background: var(--gold-tint);
  color: var(--gold-deep);
}
.huna-topbar .huna-cta-primary {
  background: var(--gold-deep);
  color: var(--paper);
  border-color: var(--gold-deep);
}
.huna-topbar .huna-cta-primary:hover {
  background: var(--ink-deep);
  border-color: var(--ink-deep);
  color: var(--paper);
}

/* ── Drawer ─────────────────────────────────────── */
.huna-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.50);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms cubic-bezier(.2, .7, .3, 1);
}
.huna-drawer-overlay.huna-open {
  opacity: 1;
  pointer-events: auto;
}

.huna-drawer {
  position: fixed;
  top: 0; bottom: 0;
  inset-inline-end: 0;
  width: 320px;
  max-width: 86vw;
  z-index: 210;
  background: var(--paper);
  color: var(--ink-deep);
  border-inline-start: 1px solid var(--paper-edge);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  visibility: hidden;
  transform: translateX(100%);
  transition: transform 360ms cubic-bezier(.2, .7, .3, 1),
              visibility 360ms;
}
html[dir="ltr"] .huna-drawer {
  inset-inline-end: auto;
  inset-inline-start: 0;
  border-inline-start: 0;
  border-inline-end: 1px solid var(--paper-edge);
  transform: translateX(-100%);
}
.huna-drawer.huna-open {
  transform: translateX(0);
  visibility: visible;
}

.huna-drawer-head {
  padding: var(--s-4);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--paper-edge);
}
.huna-drawer-head .huna-avatar-btn {
  width: 44px; height: 44px;
  font-size: 16px;
}
.huna-drawer-head .name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-deep);
}
.huna-drawer-head .handle {
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.huna-drawer-guest {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--paper-edge);
}
.huna-drawer-guest .btn { width: 100%; justify-content: center; }

.huna-drawer-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--s-2) 0 var(--s-3);
}

.huna-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  width: 100%;
  text-align: start;
  color: var(--ink-deep);
  background: transparent;
  border: 0;
  transition: background var(--t-fast);
}
.huna-nav-item:hover { background: var(--gold-tint); }
.huna-nav-item:active { background: rgba(184, 115, 47, 0.16); }

.huna-nav-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  border-radius: var(--r-sm);
  background: var(--gold-tint);
  color: var(--gold-deep);
}
.huna-nav-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.huna-nav-text .label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.huna-nav-text .desc {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.4;
}
.huna-nav-text .desc:empty { display: none; }

.huna-drawer-divider {
  height: 1px;
  background: var(--paper-edge);
  margin: var(--s-2) var(--s-4);
}

/* ── v4.0: Drawer section headers ── */
.huna-drawer-section {
  padding: var(--s-3) var(--s-4) 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  opacity: 0.75;
}
html[dir="rtl"] .huna-drawer-section {
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 12px;
}
.theme-dark .huna-drawer-section,
.theme-night .huna-drawer-section {
  color: rgba(232, 181, 71, 0.85);
}

.huna-drawer-foot {
  padding: var(--s-3) var(--s-4) var(--s-4);
  border-top: 1px solid var(--paper-edge);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.huna-drawer-foot .btn { width: 100%; justify-content: center; }

/* ── Lang toggle ────────────────────────────────── */
.huna-lang-toggle {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  padding: 3px;
  background: rgba(26, 22, 18, 0.04);
}
.theme-dark .huna-lang-toggle,
.theme-night .huna-lang-toggle {
  background: rgba(250, 247, 242, 0.06);
}
.huna-lang-toggle button {
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  background: transparent;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: background var(--t-fast), color var(--t-fast);
}
.theme-dark .huna-lang-toggle button,
.theme-night .huna-lang-toggle button { color: rgba(250, 247, 242, 0.62); }
.huna-lang-toggle button[aria-current="true"] {
  background: var(--gold-deep);
  color: var(--paper);
}

/* ── Bottom nav (mobile) ────────────────────────── */
.huna-bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 80;
  display: none;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(184, 115, 47, 0.12);
  height: calc(64px + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.theme-paper-warm .huna-bottom-nav {
  background: rgba(242, 237, 229, 0.92);
}
.theme-dark .huna-bottom-nav,
.theme-night .huna-bottom-nav {
  background: rgba(15, 15, 15, 0.85);
  border-top-color: rgba(212, 165, 116, 0.12);
}

.huna-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  background: transparent;
  color: var(--ink-mute);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
  transition: color var(--t-fast);
}
.theme-dark .huna-tab,
.theme-night .huna-tab { color: rgba(250, 247, 242, 0.55); }
.huna-tab .huna-tab-icon { font-size: 21px; line-height: 1; }
.huna-tab[aria-current="page"] { color: var(--gold-deep); }
.huna-tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  margin-left: -2px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-deep);
}

.huna-tab-fab {
  align-self: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--gold-deep);
  color: var(--paper);
  font-size: 24px;
  font-weight: 200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: -10px;
  box-shadow: 0 6px 16px rgba(184, 115, 47, 0.35);
  flex-shrink: 0;
  transition: transform var(--t-fast), background var(--t-fast);
}
.huna-tab-fab:active { transform: scale(0.94); }
.huna-tab-fab:hover { background: var(--ink-deep); }

@media (max-width: 1023px) {
  .huna-bottom-nav { display: flex; }
  body.huna-has-bottom-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0)); }
}

/* ── Floating Action Button (Desktop) ─────────────
   v0.9d — يحلّ محلّ FAB البوتم-ناف على الشاشات الكبيرة
   Mobile/tablet (<1024px): مخفي — موجود في bottom-nav بدلاً منه */
.huna-fab {
  display: none;
  position: fixed;
  bottom: 32px;
  inset-inline-start: 32px;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--gold-deep);
  color: var(--paper);
  cursor: pointer;
  z-index: 100;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 28px rgba(184, 115, 47, 0.36),
    0 4px 10px rgba(40, 24, 8, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.10);
  transition:
    transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 220ms ease,
    background 220ms ease,
    width 220ms ease,
    height 220ms ease;
  isolation: isolate;
}
.huna-fab:hover {
  transform: scale(1.06);
  background: linear-gradient(135deg, var(--gold-deep), #c98843);
  box-shadow:
    0 14px 36px rgba(184, 115, 47, 0.44),
    0 6px 14px rgba(40, 24, 8, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.huna-fab:active { transform: scale(0.96); }
.huna-fab:focus-visible {
  outline: 3px solid rgba(244, 228, 200, 0.8);
  outline-offset: 3px;
}
.huna-fab .huna-fab-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 2;
}
.huna-fab .huna-fab-icon svg { width: 100%; height: 100%; stroke: currentColor; }
/* glow: نبضة ذهبية خفيفة */
.huna-fab .huna-fab-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 228, 200, 0.45), transparent 65%);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}
.huna-fab:hover .huna-fab-glow { opacity: 1; }
/* عند الـscroll السريع: يصغر قليلاً (لا يختفي) */
.huna-fab.is-scrolling {
  width: 48px;
  height: 48px;
  box-shadow: 0 6px 18px rgba(184, 115, 47, 0.30);
}
.huna-fab.is-scrolling .huna-fab-icon { width: 22px; height: 22px; }

/* Dark themes */
.theme-dark .huna-fab,
.theme-night .huna-fab {
  background: linear-gradient(135deg, #d4a574, var(--gold-deep));
  box-shadow:
    0 12px 32px rgba(212, 165, 116, 0.30),
    0 4px 12px rgba(0, 0, 0, 0.40),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Show on Desktop only */
@media (min-width: 1024px) {
  .huna-fab { display: inline-flex; }
}

/* RTL: السيرفر RTL افتراضياً → bottom-left
   LTR override → bottom-right */
[dir="ltr"] .huna-fab {
  inset-inline-start: auto;
  inset-inline-end: 32px;
}

/* احترام prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .huna-fab,
  .huna-fab .huna-fab-glow {
    transition: none;
  }
  .huna-fab:hover { transform: none; }
}

/* ── Footer ─────────────────────────────────────── */
.huna-footer {
  padding: var(--s-7) var(--s-3) var(--s-5);
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
  border-top: 1px solid var(--paper-edge);
  margin-top: var(--s-7);
}
.theme-dark .huna-footer,
.theme-night .huna-footer {
  color: rgba(250, 247, 242, 0.55);
  border-top-color: rgba(212, 165, 116, 0.10);
}
.huna-footer-mark {
  color: var(--gold-deep);
  font-size: 16px;
  display: block;
  margin-bottom: var(--s-4);
}
.huna-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  margin-bottom: var(--s-4);
}
.huna-footer-links a {
  color: var(--ink-mute);
  transition: color var(--t-fast);
}
.theme-dark .huna-footer-links a,
.theme-night .huna-footer-links a { color: rgba(250, 247, 242, 0.55); }
.huna-footer-links a:hover { color: var(--gold-deep); }
.huna-footer-links .sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.30;
}
.huna-footer-bottom {
  margin-top: var(--s-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.huna-footer-copy {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  font-size: 11px;
  opacity: 0.6;
}

/* ── Banner ─────────────────────────────────────── */
.huna-banner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 14px 16px;
  border: 1px solid rgba(184, 115, 47, 0.18);
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.10) 0%, rgba(184, 115, 47, 0.06) 100%);
  border-radius: var(--r-md);
  margin-bottom: var(--s-3);
  transition: background var(--t-fast), transform var(--t-fast);
  text-decoration: none;
  color: inherit;
}
.huna-banner:hover {
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.18) 0%, rgba(184, 115, 47, 0.10) 100%);
}
.huna-banner-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: rgba(212, 165, 116, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.huna-banner-text { flex: 1; min-width: 0; }
.huna-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-deep);
  line-height: 1.4;
}
.theme-dark .huna-banner-title,
.theme-night .huna-banner-title { color: var(--paper); }
.huna-banner-cta {
  font-size: 18px;
  color: var(--gold-deep);
  flex-shrink: 0;
}
html[dir="rtl"] .huna-banner-cta { transform: scaleX(-1); }

/* ── Hero ───────────────────────────────────────── */
.huna-hero {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-8) var(--s-3) var(--s-7);
  text-align: center;
  background:
    radial-gradient(ellipse 50% 35% at 50% 25%, rgba(212, 165, 116, 0.10), transparent 70%),
    var(--paper);
  color: var(--ink-deep);
}
.huna-hero-mark {
  font-size: clamp(56px, 12vw, 96px);
  font-family: var(--font-arabic-heading);
  font-weight: 300;
  line-height: 1;
  margin-bottom: var(--s-3);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}
html[dir="ltr"] .huna-hero-mark { font-family: var(--font-latin-heading); }
.huna-hero-mark .star {
  color: var(--gold-deep);
  font-size: 0.55em;
  line-height: 1;
  position: relative;
  top: -0.1em;
}
.huna-hero-tagline {
  font-size: clamp(15px, 2.6vw, 18px);
  font-weight: 300;
  color: var(--ink-soft);
  margin-bottom: var(--s-7);
  max-width: 36ch;
  line-height: 1.7;
}
.huna-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
}
.huna-hero-actions .btn { width: 100%; }
.huna-hero-foot {
  margin-top: var(--s-7);
  font-size: 11px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  letter-spacing: 0.10em;
}

/* ── Feature cards (homepage explore) ───────────── */
.huna-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
}
.huna-feature {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  transition: border-color var(--t-fast), transform var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: inherit;
}
.huna-feature:hover {
  border-color: rgba(184, 115, 47, 0.45);
  transform: translateY(-2px);
}
.theme-dark .huna-feature,
.theme-night .huna-feature {
  background: rgba(250, 247, 242, 0.04);
  border-color: rgba(212, 165, 116, 0.10);
}
.huna-feature-icon {
  font-size: 28px;
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: var(--gold-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-2);
}
.huna-feature-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-deep);
}
.theme-dark .huna-feature-name,
.theme-night .huna-feature-name { color: var(--paper); }
.huna-feature-desc {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.6;
}
.theme-dark .huna-feature-desc,
.theme-night .huna-feature-desc { color: rgba(250, 247, 242, 0.62); }

/* ── helpers ────────────────────────────────────── */
@media (max-width: 768px) {
  .huna-desktop-only { display: none !important; }
  .huna-topbar .huna-cta:not(.huna-cta-primary) { display: none; }
  .huna-topbar .huna-cta-primary {
    padding: 6px 12px;
    font-size: 12px;
  }
}
@media (min-width: 769px) {
  .huna-mobile-only { display: none !important; }
}

/* ── Loading spinner ────────────────────────────── */
.huna-spinner {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--gold-deep);
  animation: huna-rotate 1.4s linear infinite;
}
@keyframes huna-rotate { to { transform: rotate(360deg); } }
