/* HAMOU MATH v56 — premium responsive refinement
   Additive visual layer only: preserves existing HTML IDs, routes, JS handlers,
   document-generation contracts, authentication and payment integration. */
:root {
  color-scheme: dark;
  --hm56-ink: #f5f8ff;
  --hm56-muted: #a8b8d1;
  --hm56-line: rgba(125, 190, 255, .18);
  --hm56-glass: rgba(8, 20, 40, .78);
  --hm56-panel: rgba(11, 28, 53, .86);
  --hm56-cyan: #61e7ff;
  --hm56-blue: #398dff;
  --hm56-violet: #9b8aff;
  --hm56-gold: #f2cc83;
  --hm56-radius: 24px;
}
html { scroll-behavior: smooth; scroll-padding-top: 92px; background: #060d1a; }
body.hm49-home {
  color: var(--hm56-ink);
  background:
    radial-gradient(70rem 42rem at 4% -18%, rgba(28, 119, 255, .20), transparent 62%),
    radial-gradient(58rem 38rem at 102% 4%, rgba(130, 83, 255, .16), transparent 64%),
    radial-gradient(38rem 30rem at 55% 105%, rgba(24, 197, 220, .08), transparent 70%),
    linear-gradient(180deg, #071225 0%, #07101f 52%, #050b16 100%) !important;
  font-family: "Tajawal", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.75;
}
body.hm49-home::before { opacity: .12; }
body.hm49-home a { text-underline-offset: 4px; }
body.hm49-home .container { width: min(1240px, calc(100% - 40px)); }
body.hm49-home .topbar {
  background: rgba(5, 13, 28, .82) !important;
  border-bottom: 1px solid var(--hm56-line) !important;
  box-shadow: 0 12px 42px rgba(0,0,0,.22) !important;
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}
body.hm49-home .navbar { min-height: 76px; gap: 18px; }
body.hm49-home .brand {
  color: #f8fbff;
  font-weight: 950;
  letter-spacing: -.035em;
  text-decoration: none;
}
body.hm49-home .brand-badge {
  border: 1px solid rgba(255,255,255,.24);
  background: linear-gradient(135deg, #1d7cff, #29d7ef 58%, #8b72ff) !important;
  box-shadow: 0 10px 32px rgba(34, 154, 255, .28), inset 0 1px rgba(255,255,255,.25);
}
body.hm49-home .nav-link,
body.hm49-home .nav-btn {
  border: 1px solid transparent;
  border-radius: 13px;
  color: #c8d5e8;
  font-weight: 750;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
body.hm49-home .nav-link:hover,
body.hm49-home .nav-btn:hover,
body.hm49-home .nav-link[aria-current="page"] {
  color: #fff;
  border-color: var(--hm56-line);
  background: rgba(65, 143, 255, .11);
}
body.hm49-home .nav-menu,
body.hm49-home .mobile-menu {
  border: 1px solid rgba(105, 188, 255, .24);
  border-radius: 18px;
  background: rgba(6, 17, 35, .97) !important;
  box-shadow: 0 28px 80px rgba(0,0,0,.42);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
body.hm49-home .hero {
  position: relative;
  isolation: isolate;
  padding: clamp(48px, 7vw, 92px) 0 clamp(36px, 5vw, 64px) !important;
}
body.hm49-home .hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2% -10% auto auto;
  width: min(70vw, 760px);
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(26, 127, 255, .13), transparent 68%);
  pointer-events: none;
}
body.hm49-home .hero-grid { align-items: center; gap: clamp(24px, 4vw, 52px) !important; }
body.hm49-home .hero h1 {
  max-width: 820px;
  color: #f7faff;
  font-size: clamp(2.35rem, 5.4vw, 4.65rem) !important;
  line-height: 1.13 !important;
  letter-spacing: -.045em;
  text-wrap: balance;
}
body.hm49-home .hero h1 strong,
body.hm49-home .hero h1 .accent {
  color: var(--hm56-cyan);
  background: linear-gradient(100deg, #f9fcff 0%, #71eaff 42%, #b6a5ff 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.hm49-home .hero p {
  max-width: 660px;
  color: var(--hm56-muted) !important;
  font-size: clamp(1rem, 1.5vw, 1.18rem) !important;
  line-height: 1.95;
}
body.hm49-home .hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(118, 197, 255, .22) !important;
  border-radius: 30px !important;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(39, 153, 255, .17), transparent 56%),
    linear-gradient(145deg, rgba(15, 35, 65, .94), rgba(7, 18, 37, .96)) !important;
  box-shadow: 0 32px 100px rgba(0,0,0,.30), inset 0 1px rgba(255,255,255,.06) !important;
}
body.hm49-home .hero-card::after {
  content: "∑";
  position: absolute;
  left: -10px;
  bottom: -80px;
  color: rgba(107, 218, 255, .055);
  font-size: clamp(150px, 22vw, 260px);
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
}
body.hm49-home .math-badge {
  border: 1px solid rgba(255,255,255,.22);
  background: linear-gradient(135deg, #147cff, #22d4ed 60%, #8e79ff) !important;
  box-shadow: 0 16px 40px rgba(36, 142, 255, .26), inset 0 1px rgba(255,255,255,.24);
}
body.hm49-home .hero-actions { gap: 12px; }
body.hm49-home .hero-actions a,
body.hm49-home .hero-actions button,
body.hm49-home .btn,
body.hm49-home button.btn {
  min-height: 46px;
  border-radius: 14px;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease;
}
body.hm49-home .hero-actions a:first-child,
body.hm49-home .hero-actions .primary-btn,
body.hm49-home .btn-primary {
  color: #041326 !important;
  border: 1px solid rgba(164, 243, 255, .42) !important;
  background: linear-gradient(120deg, #6ceaff, #76baff 55%, #b2a2ff) !important;
  box-shadow: 0 12px 34px rgba(41, 161, 255, .22), inset 0 1px rgba(255,255,255,.42);
}
body.hm49-home .hero-actions a:hover,
body.hm49-home .hero-actions button:hover,
body.hm49-home .btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
body.hm49-home .card,
body.hm49-home .banner,
body.hm49-home .function-card,
body.hm49-home .resource-card,
body.hm49-home .feature-card {
  border: 1px solid var(--hm56-line) !important;
  border-radius: var(--hm56-radius) !important;
  background: linear-gradient(145deg, rgba(13, 31, 58, .88), rgba(7, 18, 36, .93)) !important;
  box-shadow: 0 18px 56px rgba(0,0,0,.16), inset 0 1px rgba(255,255,255,.025) !important;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
body.hm49-home .card:hover,
body.hm49-home .function-card:hover,
body.hm49-home .resource-card:hover,
body.hm49-home .feature-card:hover {
  border-color: rgba(97, 231, 255, .38) !important;
  transform: translateY(-3px);
  box-shadow: 0 26px 68px rgba(0,0,0,.24), 0 0 32px rgba(42, 156, 255, .07) !important;
}
body.hm49-home section { scroll-margin-top: 94px; }
body.hm49-home .section-head { gap: 16px; }
body.hm49-home .section-head h2 {
  font-size: clamp(1.65rem, 3.2vw, 2.4rem);
  line-height: 1.3;
  text-wrap: balance;
}
body.hm49-home .section-head p { color: var(--hm56-muted); line-height: 1.8; }
body.hm49-home input,
body.hm49-home textarea,
body.hm49-home select {
  min-height: 46px;
  color: #f2f7ff;
  border: 1px solid rgba(115, 182, 255, .22);
  border-radius: 13px;
  background: rgba(4, 15, 31, .82);
}
body.hm49-home input::placeholder,
body.hm49-home textarea::placeholder { color: #8194b0; }
body.hm49-home :focus-visible {
  outline: 3px solid rgba(97, 231, 255, .78) !important;
  outline-offset: 3px;
}
body.hm49-home .hm49-trust-line { color: #9fb3ce; }
body.hm49-home footer,
body.hm49-home .footer {
  border-top: 1px solid rgba(115, 182, 255, .14);
  color: #8fa2bd;
}
@media (max-width: 1024px) {
  body.hm49-home .container { width: min(100% - 32px, 900px); }
  body.hm49-home .hero-grid { grid-template-columns: minmax(0, 1fr) !important; }
  body.hm49-home .hero-card { max-width: 720px; margin-inline: auto; }
  body.hm49-home .desktop-nav { display: none !important; }
  body.hm49-home .mobile-toggle { display: inline-grid !important; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 76px; }
  body.hm49-home .container { width: calc(100% - 28px); }
  body.hm49-home .navbar { min-height: 66px; }
  body.hm49-home .brand { font-size: 1rem; }
  body.hm49-home .hero { padding: 38px 0 28px !important; }
  body.hm49-home .hero h1 { font-size: clamp(2rem, 9vw, 3rem) !important; }
  body.hm49-home .hero p { font-size: 1rem !important; }
  body.hm49-home .hero-actions { display: grid !important; grid-template-columns: 1fr; }
  body.hm49-home .hero-actions > * { width: 100%; justify-content: center; }
  body.hm49-home .hero-card { padding: 18px !important; border-radius: 22px !important; }
  body.hm49-home .card,
  body.hm49-home .banner,
  body.hm49-home .function-card,
  body.hm49-home .resource-card,
  body.hm49-home .feature-card { border-radius: 19px !important; }
  body.hm49-home .section-head { align-items: start; flex-direction: column; }
  body.hm49-home .hm49-path-grid { grid-template-columns: 1fr !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.hm49-home *, body.hm49-home *::before, body.hm49-home *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
