/* Saad Web — RTL/LTR — ألوان مستلهمة من شعار سعد (أخضر السدم + كريم دافئ + ذهب جناح) */
:root {
  /* مرجع الشعار: أخضر الهيكل #1B4332، كريم الخلفية → نص على الغامق #F8F6F0، لمسات جناح ذهبية دافئة */
  --logo-green: #1b4332;
  --logo-green-deep: #0f1f1a;
  --logo-green-mid: #244d3e;
  --logo-green-bright: #3a8068;
  --ivory: #f8f6f0;
  --ivory-muted: rgba(248, 246, 240, 0.86);
  --wing-gold: #c4a574;
  --wing-gold-soft: rgba(196, 165, 116, 0.42);

  --heritage-green: var(--logo-green);
  --heritage-green-light: var(--logo-green-mid);
  --cream-mist: #f4f0e6;
  --gold-heritage: var(--wing-gold);
  --gold-heritage-soft: var(--wing-gold-soft);
  --bg-deep: var(--logo-green-deep);
  --bg-card: rgba(27, 67, 50, 0.55);
  --bg-card-solid: #152b24;
  --emerald: #2d6a52;
  --emerald-bright: #3d8f72;
  --gold: var(--gold-heritage);
  --gold-soft: var(--gold-heritage-soft);
  --text: var(--ivory);
  --text-muted: var(--ivory-muted);
  --border: rgba(196, 165, 116, 0.38);
  /* شعار الهيدر صغير جداً ومقارب لارتفاع سطر الاسم */
  --logo-tile-header: clamp(20px, 1.28rem, 26px);
  --logo-tile-footer: 40px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-glow: 0 0 100px rgba(61, 143, 114, 0.2), 0 0 48px rgba(196, 165, 116, 0.1);
  --font-display: "IBM Plex Sans Arabic", "Tajawal", "Segoe UI", system-ui, sans-serif;
  --font-crest: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Almarai", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.25, 0.64, 1);
}

/* خلفية أجواء سيادية خفيفة — بدون شعار مركزي (تناغم مع المشهد العام) */
body.page-heritage::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(ellipse 85% 55% at 48% 38%, rgba(61, 143, 114, 0.1), transparent 58%),
    radial-gradient(ellipse 50% 42% at 18% 72%, rgba(196, 165, 116, 0.07), transparent 52%),
    radial-gradient(ellipse 48% 38% at 88% 22%, rgba(27, 67, 50, 0.35), transparent 55%);
  opacity: 1;
  pointer-events: none;
  animation: saad-ambient-drift 96s ease-in-out infinite alternate;
}

@keyframes saad-ambient-drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-1.2%, 0.8%) scale(1.015);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.i18n-ready {
  opacity: 1;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 85% at 50% -25%, rgba(61, 143, 114, 0.32), transparent 58%),
    radial-gradient(ellipse 70% 55% at 100% 20%, rgba(196, 165, 116, 0.11), transparent 52%),
    radial-gradient(ellipse 55% 45% at 0% 85%, rgba(27, 67, 50, 0.55), transparent 48%),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(248, 246, 240, 0.05), transparent 50%),
    var(--bg-deep);
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.055;
  background-image:
    linear-gradient(rgba(196, 165, 116, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 165, 116, 0.32) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, black, transparent);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  background: linear-gradient(180deg, rgba(6, 13, 10, 0.88), rgba(6, 13, 10, 0.72));
  border-bottom: 1px solid var(--border);
  transition: padding 0.35s var(--ease-out), background 0.35s, box-shadow 0.35s, border-color 0.35s;
}

.site-header.is-scrolled {
  padding: 0.55rem 0;
  background: rgba(8, 20, 16, 0.92);
  border-bottom-color: rgba(196, 165, 116, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.locale-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.locale-wrap label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.locale-wrap select {
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand--crest {
  gap: 0.65rem;
  align-items: center;
}

.site-header .brand__logo-wrap {
  width: var(--logo-tile-header);
  height: var(--logo-tile-header);
}

.brand__logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  width: var(--logo-tile-header);
  height: var(--logo-tile-header);
  border-radius: 8px;
  background: linear-gradient(168deg, rgba(27, 67, 50, 0.98) 0%, rgba(8, 18, 14, 0.99) 100%);
  border: 1px solid rgba(196, 165, 116, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 18px rgba(0, 0, 0, 0.42);
}

.brand__logo-ring {
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: conic-gradient(from 210deg, transparent, rgba(196, 165, 116, 0.32), transparent 55%);
  animation: crest-ring-spin 14s linear infinite;
  opacity: 0.8;
  pointer-events: none;
}

@keyframes crest-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

.brand__logo-img {
  position: relative;
  z-index: 1;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  max-width: calc(100% - 8px);
  max-height: calc(100% - 8px);
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
  animation: crest-logo-in 1.15s var(--ease-out) both, crest-logo-glow 6s ease-in-out 1.2s infinite;
}

@keyframes crest-logo-in {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes crest-logo-glow {
  0%,
  100% {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 14px rgba(61, 143, 114, 0.12));
  }
  50% {
    filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 20px rgba(196, 165, 116, 0.18));
  }
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand__tag {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
}

.site-footer__crest {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.site-footer__logo {
  width: var(--logo-tile-footer);
  height: var(--logo-tile-footer);
  padding: 6px;
  object-fit: contain;
  object-position: center;
  border-radius: 16px;
  background: linear-gradient(168deg, rgba(27, 67, 50, 0.95), rgba(8, 18, 14, 0.98));
  border: 1px solid rgba(196, 165, 116, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 24px rgba(0, 0, 0, 0.35);
  opacity: 0.96;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.92rem;
  transition:
    color 0.35s var(--ease-out),
    background 0.35s var(--ease-out),
    transform 0.35s var(--ease-spring),
    box-shadow 0.35s var(--ease-out),
    border-color 0.35s ease;
  border: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(196, 165, 116, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  border-color: rgba(196, 165, 116, 0.2);
}

.nav-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.25rem;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.nav-toggle:hover {
  transform: scale(1.05);
  border-color: rgba(196, 165, 116, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .site-nav {
    position: fixed;
    top: 72px;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
    z-index: 99;
  }
  html[dir="rtl"] .site-nav {
    left: 1rem;
    right: auto;
  }
  html[dir="ltr"] .site-nav {
    right: 1rem;
    left: auto;
  }
  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.hero {
  padding: 2.5rem 0 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* إخفاء الشعار الضخم المركزي — يقلل التشتيت ويركّز على النص */
.hero__heritage-emblem {
  display: none;
}

.hero__heritage-emblem-img {
  width: 100%;
  height: 100%;
  padding: 12px;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
  filter: saturate(0.95) contrast(1.03) brightness(1.02);
  animation: hero-emblem-float 8s ease-in-out infinite;
}

.hero__heritage-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 65%
  );
  background-size: 200% 100%;
  animation: hero-emblem-shine 5s ease-in-out infinite;
  mix-blend-mode: overlay;
}

@keyframes hero-emblem-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.02);
  }
}

@keyframes hero-emblem-shine {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.5;
  transition: transform 0.1s linear;
}

.hero-orb--1 {
  width: min(90vw, 420px);
  height: min(90vw, 420px);
  background: var(--emerald);
  top: -80px;
}

html[dir="rtl"] .hero-orb--1 {
  right: 10%;
  left: auto;
}
html[dir="ltr"] .hero-orb--1 {
  left: 10%;
  right: auto;
}

.hero-orb--2 {
  width: min(70vw, 300px);
  height: min(70vw, 300px);
  background: var(--gold);
  bottom: 10%;
  opacity: 0.2;
}

html[dir="rtl"] .hero-orb--2 {
  left: 5%;
  right: auto;
}
html[dir="ltr"] .hero-orb--2 {
  right: 5%;
  left: auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(196, 165, 116, 0.14);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  animation: fadeUp 0.8s var(--ease-out) both;
  position: relative;
  z-index: 1;
}

.hero__title {
  font-family: var(--font-crest), var(--font-display);
  font-weight: 700;
  font-size: clamp(2.15rem, 5.8vw, 3.65rem);
  line-height: 1.12;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fffef8 0%, #d8efe4 38%, var(--gold) 92%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeUp 0.8s 0.1s var(--ease-out) both;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 40px rgba(196, 165, 116, 0.15);
}

.hero__lead {
  max-width: 40rem;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  font-size: 1.02rem;
  animation: fadeUp 0.8s 0.2s var(--ease-out) both;
  position: relative;
  z-index: 1;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  animation: fadeUp 0.8s 0.3s var(--ease-out) both;
  position: relative;
  z-index: 1;
}

.hero-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin-top: 1.1rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  animation: fadeUp 0.8s 0.35s var(--ease-out) both;
  position: relative;
  z-index: 1;
}

.hero-quick__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(248, 246, 240, 0.45);
  width: 100%;
  text-align: center;
}

.hero-quick a {
  font-size: 0.86rem;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(196, 165, 116, 0.35);
  padding-bottom: 0.08rem;
  transition: color 0.2s, border-color 0.2s;
}

.hero-quick a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.45);
}

.hero .stats {
  position: relative;
  z-index: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition:
    transform 0.38s var(--ease-spring),
    box-shadow 0.38s var(--ease-out),
    background 0.35s ease,
    border-color 0.35s ease,
    color 0.3s ease,
    filter 0.35s ease;
}

.btn--primary {
  background: linear-gradient(135deg, var(--emerald-bright), var(--emerald));
  color: #fff;
  box-shadow: 0 8px 32px rgba(45, 106, 82, 0.45);
}

.btn--primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 44px rgba(45, 106, 82, 0.55);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--gold-soft);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  padding: 4rem 0;
}

.section__head {
  text-align: center;
  margin-bottom: 3rem;
}

.section__kicker {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
}

.section__desc {
  max-width: 36rem;
  margin: 0.75rem auto 0;
  color: var(--text-muted);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition:
    transform 0.45s var(--ease-spring),
    border-color 0.35s ease,
    box-shadow 0.45s var(--ease-out),
    filter 0.35s ease;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.06), transparent 50%);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-7px) scale(1.01);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.38);
}

.card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(45, 106, 82, 0.4), rgba(15, 35, 28, 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat {
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(12, 28, 22, 0.5);
  border: 1px solid var(--border);
}

.stat__num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(180deg, #fff, var(--emerald-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.reveal {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  filter: blur(2px);
  transition:
    opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-spring),
    filter 0.65s var(--ease-out);
}

.reveal--in {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.cta-strip {
  margin: 3rem 0;
  padding: 3rem 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  background: linear-gradient(135deg, rgba(45, 106, 82, 0.35), rgba(12, 28, 22, 0.9));
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.cta-strip::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.12), transparent 60%);
  pointer-events: none;
}

.cta-strip h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.cta-strip p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  position: relative;
}

.site-footer {
  position: relative;
  z-index: 2;
  padding: 3rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer code,
.section code {
  font-size: 0.85em;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  direction: ltr;
  display: inline-block;
}

/* Support widget — RTL: left, LTR: right */
.support-fab {
  position: fixed;
  bottom: 1.5rem;
  z-index: 200;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--gold-soft);
  background: linear-gradient(145deg, var(--emerald-bright), #064428);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(45, 106, 82, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}

html[dir="rtl"] .support-fab {
  left: 1.5rem;
  right: auto;
}
html[dir="ltr"] .support-fab {
  right: 1.5rem;
  left: auto;
}

.support-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 16px 48px rgba(45, 106, 82, 0.65);
}

.support-panel {
  position: fixed;
  bottom: 5.5rem;
  z-index: 199;
  width: min(100vw - 2rem, 400px);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

html[dir="rtl"] .support-panel {
  left: 1.5rem;
  right: auto;
}
html[dir="ltr"] .support-panel {
  right: 1.5rem;
  left: auto;
}

.support-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.support-panel__head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: linear-gradient(180deg, rgba(196, 165, 116, 0.1), transparent);
}

.support-panel__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.support-panel__logo {
  width: 30px;
  height: 30px;
  padding: 4px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(8, 20, 16, 0.9);
  border: 1px solid rgba(196, 165, 116, 0.28);
  backface-visibility: hidden;
  transform: translateZ(0);
}

.support-panel__head h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.25rem;
  line-height: 1;
}

.support-config {
  padding: 0.75rem 1.25rem;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.support-config label {
  display: block;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.support-config input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  direction: ltr;
  text-align: left;
}

.support-config button {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  cursor: pointer;
}

#support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  min-height: 200px;
  max-height: 280px;
}

.support-msg {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

html[dir="rtl"] .support-msg--user {
  background: rgba(45, 106, 82, 0.35);
  margin-right: 2rem;
  margin-left: 0;
  border: 1px solid rgba(45, 106, 82, 0.4);
}
html[dir="ltr"] .support-msg--user {
  background: rgba(45, 106, 82, 0.35);
  margin-left: 2rem;
  margin-right: 0;
  border: 1px solid rgba(45, 106, 82, 0.4);
}

html[dir="rtl"] .support-msg--bot {
  background: rgba(255, 255, 255, 0.06);
  margin-left: 2rem;
  margin-right: 0;
  border: 1px solid var(--border);
}
html[dir="ltr"] .support-msg--bot {
  background: rgba(255, 255, 255, 0.06);
  margin-right: 2rem;
  margin-left: 0;
  border: 1px solid var(--border);
}

.support-msg--error {
  background: rgba(120, 30, 30, 0.35);
  border: 1px solid rgba(200, 80, 80, 0.4);
  font-size: 0.88rem;
}

.support-msg-small {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.support-msg--typing {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
}

.support-audio {
  width: 100%;
  margin-bottom: 0.75rem;
  border-radius: 8px;
}

.support-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.support-form input[type="text"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
}

.support-form button[type="submit"] {
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: none;
  background: var(--emerald-bright);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 480px) {
  html[dir="rtl"] .support-panel,
  html[dir="ltr"] .support-panel {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }
  .support-fab {
    bottom: 1rem;
  }
  html[dir="rtl"] .support-fab {
    left: 0.75rem;
  }
  html[dir="ltr"] .support-fab {
    right: 0.75rem;
  }
}

/* —— أقسام الوثائق / الفيديو / الأدوات —— */
.hero__actions--secondary {
  margin-top: 0.85rem;
}

.btn--sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
}

.section--hub {
  padding-top: 3.25rem;
  border-top: 1px solid rgba(196, 165, 116, 0.12);
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.section__cli,
.section__note {
  max-width: 44rem;
  margin: 2rem auto 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.section__cli code,
.section__note code {
  font-size: 0.82em;
}

.card__link {
  margin-top: 1rem;
  font-size: 0.86rem;
}

.card__link a {
  color: var(--gold);
  text-decoration: none;
}

.card__link a:hover {
  text-decoration: underline;
}

.inline-code {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
}

/* صفحات الاستوديو / المركز */
.subpage-hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
  max-width: 720px;
  margin: 0 auto;
  animation: subpage-hero-in 0.85s var(--ease-out) both;
}

@keyframes subpage-hero-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subpage-hero h1 {
  font-family: var(--font-crest), var(--font-display), serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 0.75rem;
}

.subpage-hero p {
  color: var(--text-muted);
  line-height: 1.75;
}

.studio-panel {
  max-width: 640px;
  margin: 0 auto 3rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.studio-field {
  margin-bottom: 1rem;
}

.studio-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.studio-field textarea,
.studio-field select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.studio-field textarea {
  min-height: 120px;
  resize: vertical;
}

.studio-log {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(3, 8, 6, 0.85);
  border: 1px solid rgba(46, 230, 200, 0.15);
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.55;
  direction: ltr;
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
  color: rgba(232, 244, 239, 0.85);
}

.studio-log .log-ok {
  color: var(--emerald-bright);
}

.studio-log .log-warn {
  color: #e6c82e;
}

.studio-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.doc-hub {
  max-width: 800px;
  margin: 0 auto 4rem;
  padding: 0 1.25rem;
}

.doc-hub-demo-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 2rem auto 0.5rem;
  text-align: center;
  color: var(--gold);
  max-width: 800px;
}

.doc-hub-demo-lead {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 720px;
  margin: 0 auto 0.5rem;
  line-height: 1.65;
}

.doc-hub h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  color: var(--gold);
}

.doc-hub p,
.doc-hub li {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

.doc-hub ul {
  padding-inline-start: 1.25rem;
  margin: 0.5rem 0 1rem;
}

.hub-toplinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin: 0 auto 2rem;
  max-width: 800px;
}

/* لوحة التجربة المباشرة — رقمنة / أرشفة / بصيرة الورق / خطة فيديو */
.experience-lab {
  max-width: 880px;
  margin: 1.5rem auto 0;
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
}

.experience-lab__row {
  margin-bottom: 1rem;
}

.experience-lab__row label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.experience-lab__row textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(4, 10, 8, 0.65);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  resize: vertical;
}

.experience-lab__row input[type="file"] {
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.experience-lab__row select {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(4, 10, 8, 0.65);
  color: var(--text);
}

.experience-lab__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.75rem;
}

.experience-lab__status {
  font-size: 0.82rem;
  color: var(--emerald-bright);
  margin-bottom: 0.5rem;
}

.experience-lab__out {
  margin: 0;
  padding: 1rem;
  max-height: 340px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(196, 165, 116, 0.2);
  border-radius: var(--radius-md);
  color: var(--cream-mist);
  white-space: pre-wrap;
  word-break: break-word;
}

/* فيديو تخيلي — مشهد متحرك يشرح التدفق (بدون ملف فيديو) */
.card .feature-reel {
  margin-top: 0.9rem;
}

.feature-reel {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 200px;
  margin-inline: auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(196, 165, 116, 0.28);
  background:
    radial-gradient(ellipse 90% 70% at 30% 20%, rgba(61, 143, 114, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 80%, rgba(196, 165, 116, 0.08), transparent 45%),
    linear-gradient(168deg, rgba(12, 28, 22, 0.97), rgba(4, 10, 8, 0.99));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.feature-reel--wide {
  max-height: 220px;
  max-width: 720px;
}

.feature-reel__grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.feature-reel__badge {
  position: absolute;
  top: 0.45rem;
  inset-inline-start: 0.45rem;
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-heritage);
  background: rgba(4, 10, 8, 0.75);
  border: 1px solid rgba(196, 165, 116, 0.35);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.feature-reel__scan {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(196, 165, 116, 0.06) 48%,
    transparent 52%
  );
  background-size: 100% 220%;
  animation: feature-reel-scan 6s ease-in-out infinite;
  opacity: 0.85;
}

@keyframes feature-reel-scan {
  0% {
    background-position: 0 -100%;
  }
  100% {
    background-position: 0 100%;
  }
}

.feature-reel__steps {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 0.75rem 0.65rem;
}

.feature-reel__step {
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  text-align: center;
  font-size: clamp(0.72rem, 2.1vw, 0.88rem);
  line-height: 1.45;
  color: var(--cream-mist);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.85);
  opacity: 0;
  transform: translateY(10px);
  animation: feature-reel-step 20s ease-in-out infinite;
}

.feature-reel__step:nth-child(1) {
  animation-delay: 0s;
}
.feature-reel__step:nth-child(2) {
  animation-delay: 5s;
}
.feature-reel__step:nth-child(3) {
  animation-delay: 10s;
}
.feature-reel__step:nth-child(4) {
  animation-delay: 15s;
}

@keyframes feature-reel-step {
  0%,
  1% {
    opacity: 0;
    transform: translateY(10px);
  }
  4%,
  20% {
    opacity: 1;
    transform: translateY(0);
  }
  23%,
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-heritage::before {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .subpage-hero {
    animation: none;
  }

  .card {
    transition: none;
  }

  .card:hover {
    transform: none;
    box-shadow: none;
  }

  .nav-toggle,
  .nav-toggle:hover {
    transition: none;
    transform: none;
  }

  .site-nav a,
  .site-nav a:hover {
    transition: none;
    transform: none;
    box-shadow: none;
  }

  .feature-reel__step {
    position: relative;
    left: auto;
    right: auto;
    animation: none;
    opacity: 1;
    transform: none;
    margin-bottom: 0.35rem;
    text-shadow: none;
    font-size: 0.72rem;
    color: var(--text-muted);
  }

  .feature-reel__steps {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding-top: 2rem;
  }

  .feature-reel__scan {
    animation: none;
    opacity: 0.3;
  }
}
