/* HAMOU MATH — reference-inspired visual rebuild v57
   Additive presentation layer. Keeps existing markup, links, handlers and document workflows intact. */
:root{--hm57-night:#061226;--hm57-panel:#0a1b34;--hm57-blue:#0877ef;--hm57-cyan:#42d8ff;--hm57-gold:#ffc344;--hm57-white:#f7faff;--hm57-muted:#b8c6dc;--hm57-line:rgba(100,177,255,.28)}
html{background:#061226}
body.hm49-home{background:#f5f7fb;color:#101d35;font-family:"Tajawal","Noto Sans Arabic",system-ui,sans-serif}
body.hm49-home main{overflow:hidden}
body.hm49-home .topbar,body.hm49-home header,body.hm49-home .navbar{background:rgba(5,15,33,.97)!important;color:#f8fbff;border-bottom:1px solid rgba(255,195,68,.28);box-shadow:0 8px 28px #02091455}
body.hm49-home .topbar a,body.hm49-home header a,body.hm49-home .navbar a{color:#f2f6ff}
body.hm49-home .hero{position:relative;isolation:isolate;min-height:430px;padding:36px 0 28px;color:#fff;background:radial-gradient(ellipse at 64% 40%,#1256a6 0,transparent 34%),radial-gradient(ellipse at 75% 0,#354f8b 0,transparent 34%),linear-gradient(115deg,#031020 0%,#0a2141 53%,#030d1b 100%);border-bottom:3px solid #e6b54e}
body.hm49-home .hero:before{content:"";position:absolute;inset:0;z-index:-1;opacity:.28;background-image:linear-gradient(115deg,transparent 0 47%,#62caff20 48%,transparent 49%),radial-gradient(circle at 70% 45%,#59c8ff 0 1px,transparent 2px);background-size:100% 100%,32px 32px;mask-image:linear-gradient(90deg,transparent,#000)}
body.hm49-home .hero .container{width:min(1380px,calc(100% - 48px))}
body.hm49-home .hero-grid{grid-template-columns:minmax(0,1fr) minmax(320px,1.08fr);gap:30px;align-items:center}
body.hm49-home .hero-copy{position:relative;z-index:2;text-align:right}
body.hm49-home .hero .eyebrow{display:inline-flex;align-items:center;border:1px solid #e8b442;border-radius:999px;padding:5px 15px;color:#ffd36c;background:#07172bc9;font-size:13px;font-weight:800}
body.hm49-home .hero h1{font-size:clamp(36px,4.2vw,58px);line-height:1.16;letter-spacing:-1px;margin:17px 0 12px;color:#fff;text-shadow:0 4px 20px #0007}
body.hm49-home .hero h1 em{font-style:normal;color:var(--hm57-gold)}
body.hm49-home .hero p{max-width:590px;font-size:16px;line-height:1.9;color:#d6e4f8}
body.hm49-home .hero-actions{gap:12px;margin-top:22px}
body.hm49-home .hero .primary-btn,body.hm49-home .hero .secondary-btn{min-width:160px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;font-weight:900;text-decoration:none}
body.hm49-home .hero .primary-btn{color:#171d2a;background:linear-gradient(135deg,#ffe08a,#ffb91f);border:1px solid #ffe18a;box-shadow:0 6px 20px #ffbd3540}
body.hm49-home .hero .secondary-btn{color:#f6faff;background:#062d59;border:1px solid #3988e8}
body.hm49-home .micro-proof{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
body.hm49-home .micro-proof span{font-size:11px;color:#d8e8ff;border:1px solid #5b94c955;border-radius:999px;padding:4px 9px;background:#06172c99}
body.hm49-home .hero-card.hm49-visual{position:relative;min-height:330px;overflow:hidden;border:1px solid #65caff8c;border-radius:25px;padding:22px;background:linear-gradient(145deg,#0b2c55dd,#06172eea 65%,#071024);box-shadow:0 22px 65px #0008,inset 0 0 36px #228aff1c}
body.hm49-home .hm49-visual-head{position:relative;z-index:1}
body.hm49-home .math-badge{background:linear-gradient(145deg,#ffc94f,#f59c19);color:#071329;border-radius:17px;box-shadow:0 0 30px #ffc34445}
body.hm49-home .hero-mini-kicker{color:#ffcf62}
body.hm49-home .hm49-math-stage{min-height:220px;display:grid;place-items:center;position:relative;margin:8px 0}
body.hm49-home .hm49-equation{position:relative;z-index:2;padding:20px 28px;border:1px solid #59d7ff;border-radius:18px;background:linear-gradient(135deg,#0875c9e8,#06315de8);box-shadow:0 0 32px #19baff4f,inset 0 0 24px #a8f2ff16;transform:rotate(-2deg);text-align:center}
body.hm49-home .hm49-equation small,body.hm49-home .hm49-equation span{display:block;color:#d5f2ff}
body.hm49-home .hm49-equation strong{display:block;font-size:clamp(22px,3vw,34px);color:#fff;text-shadow:0 0 15px #55d9ff}
body.hm49-home .hm49-orbit{position:absolute;border:1px solid #4ccfff7a;border-radius:50%;width:86%;height:64%;transform:rotate(-17deg);box-shadow:0 0 25px #147cff24}
body.hm49-home .hm49-orbit-two{width:75%;height:80%;transform:rotate(34deg);border-color:#ffc34e7d}
body.hm49-home .hm49-symbol{position:absolute;color:#ffcf62;font-size:30px;text-shadow:0 0 18px #5dcaff}
body.hm49-home .hm49-symbol-a{top:10%;right:15%}body.hm49-home .hm49-symbol-b{bottom:10%;left:17%}body.hm49-home .hm49-symbol-c{top:22%;left:12%}
body.hm49-home .hm49-graph{position:absolute;left:5%;bottom:0;width:28%;opacity:.72}
body.hm49-home .hm49-visual-bottom{border-top:1px solid #7abfff33;padding-top:14px}
body.hm49-home .hero-card-footer{color:#c6d9f1;border-color:#7abfff22}
body.hm49-home .hm49-pathways,body.hm49-home main>section:not(.hero){background:#f7f9fd;color:#12213a}
body.hm49-home .hm49-pathways{padding:28px 0 24px}
body.hm49-home .hm49-section-heading{margin-bottom:17px}
body.hm49-home .hm49-section-heading h2,body.hm49-home .section-head h2{font-size:clamp(22px,2.2vw,29px);color:#0a1830}
body.hm49-home .hm49-section-heading p,body.hm49-home .section-head p{color:#61708b}
body.hm49-home .hm49-kicker{color:#a56a00;font-weight:900}
body.hm49-home .hm49-path-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
body.hm49-home .hm49-path{min-height:180px;border-radius:13px;padding:18px 15px;background:linear-gradient(150deg,#fff,#f0f5fc);border:1px solid #c8d9ed;box-shadow:0 5px 18px #152c4b0b;transition:transform .2s,box-shadow .2s}
body.hm49-home .hm49-path:hover{transform:translateY(-4px);box-shadow:0 14px 28px #17345b18}
body.hm49-home .hm49-path-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(145deg,#167cf3,#04b9d1);color:white;box-shadow:0 7px 18px #168df02e}
body.hm49-home .hm49-path-student .hm49-path-icon{background:linear-gradient(145deg,#00bba7,#087c73)}
body.hm49-home .hm49-path-teacher .hm49-path-icon{background:linear-gradient(145deg,#1e88ff,#1450d2)}
body.hm49-home .hm49-path-library .hm49-path-icon{background:linear-gradient(145deg,#08b6a0,#08775f)}
body.hm49-home .hm49-path-ai .hm49-path-icon{background:linear-gradient(145deg,#a632ff,#5e25d8)}
body.hm49-home .hm49-path-bac .hm49-path-icon{background:linear-gradient(145deg,#ff9c36,#e56a15)}
body.hm49-home .hm49-path strong{color:#10223f;font-size:16px}
body.hm49-home .hm49-path p{color:#63728c;font-size:12px;line-height:1.65}
body.hm49-home .hm49-path-label{color:#64748b}
body.hm49-home .hm49-path-go{color:#135bc3;font-size:12px;font-weight:900}
body.hm49-home .hm49-trust-line{color:#65738a;font-size:12px}
body.hm49-home main>section:not(.hero):not(.hm49-pathways) .container{position:relative}
body.hm49-home .card,body.hm49-home .education-card,body.hm49-home .banner{background:#fff!important;color:#17243b;border:1px solid #dce5f0;box-shadow:0 8px 25px #0a1c3510;border-radius:16px}
body.hm49-home .card h3{color:#132440}
body.hm49-home .muted{color:#66758d}
body.hm49-home .stat-number{color:#0875e8}
body.hm49-home footer{background:#06142a;color:#dce8f8;border-top:2px solid #e7b642}
body.hm49-home footer a{color:#f7ce68}
body.hm49-home button,body.hm49-home a{transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease}
@media(max-width:980px){body.hm49-home .hero-grid{grid-template-columns:1fr;gap:18px}body.hm49-home .hero{padding:28px 0 22px}body.hm49-home .hero-card.hm49-visual{min-height:280px}body.hm49-home .hm49-path-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){body.hm49-home .hero .container{width:min(100% - 28px,560px)}body.hm49-home .hero h1{font-size:36px}body.hm49-home .hero-card.hm49-visual{padding:16px;min-height:260px;border-radius:19px}body.hm49-home .hm49-path-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}body.hm49-home .hm49-path{padding:13px;min-height:170px}body.hm49-home .hm49-path strong{font-size:14px}body.hm49-home .hm49-path p{font-size:11px}body.hm49-home .hero .primary-btn,body.hm49-home .hero .secondary-btn{min-width:0;flex:1}body.hm49-home .micro-proof span{font-size:10px}}
@media(max-width:380px){body.hm49-home .hm49-path-grid{grid-template-columns:1fr}body.hm49-home .hero h1{font-size:31px}}
@media(prefers-reduced-motion:reduce){body.hm49-home *,body.hm49-home *:before,body.hm49-home *:after{transition:none!important;scroll-behavior:auto!important}}


/* v58 — stronger reference direction: obsidian, liquid silver, cinematic mathematical core */
:root{--hm57-night:#05070d;--hm57-panel:#0b101b;--hm57-blue:#4c8dff;--hm57-cyan:#9deaff;--hm57-gold:#d7dce7;--hm57-white:#f8fbff;--hm57-muted:#a8b4c9;--hm57-line:rgba(180,207,255,.2)}
html,body.hm49-home{background:#05070d!important;color:#f5f7fb}
body.hm49-home .hero{min-height:600px;padding:68px 0 54px;background:radial-gradient(ellipse at 72% 42%,#243d6d55 0,transparent 28%),radial-gradient(ellipse at 18% 8%,#5b4da522 0,transparent 32%),linear-gradient(125deg,#03050a 0%,#080d18 48%,#05070d 100%);border-bottom:1px solid #a6bce633}
body.hm49-home .hero:before{opacity:.2;background-image:linear-gradient(90deg,transparent 49.8%,#a8c6ff14 50%,transparent 50.2%),linear-gradient(0deg,transparent 49.8%,#a8c6ff12 50%,transparent 50.2%),radial-gradient(circle at 50% 50%,#d8eaff 0 1px,transparent 1.5px);background-size:64px 64px,64px 64px,29px 29px;mask-image:radial-gradient(ellipse at 65% 50%,#000,transparent 72%)}
body.hm49-home .hero-grid{grid-template-columns:minmax(0,.92fr) minmax(360px,1.08fr);gap:clamp(24px,5vw,72px)}
body.hm49-home .hero h1{font-size:clamp(40px,5.1vw,72px);line-height:1.12;letter-spacing:-1.5px}
body.hm49-home .hero h1 em{background:linear-gradient(100deg,#fff 0%,#c9d5e8 38%,#8eacff 72%,#e2e8f0 100%);-webkit-background-clip:text;background-clip:text;color:transparent}
body.hm49-home .hero .eyebrow{border-color:#b9c9e34d;background:#ffffff08;color:#dce8fa;backdrop-filter:blur(12px)}
body.hm49-home .hero-card.hm49-visual{min-height:430px;border-radius:30px;border-color:#d7e7ff30;padding:28px;background:radial-gradient(ellipse at 50% 45%,#243a5c66,transparent 56%),linear-gradient(145deg,#111827eF,#080c15f5 70%,#101729);box-shadow:0 35px 100px #000b,inset 0 1px #ffffff18;isolation:isolate}
body.hm49-home .hm49-math-stage{min-height:290px;perspective:900px}
body.hm49-home .hm49-math-stage:before{content:"";position:absolute;width:210px;height:210px;left:50%;top:50%;transform:translate(-50%,-50%) rotateX(18deg) rotateY(-22deg);border-radius:43% 57% 60% 40%/45% 43% 57% 55%;background:radial-gradient(circle at 32% 25%,#ffffff 0,#dfe7f2 4%,#8998ad 13%,#343f53 27%,#0d1421 47%,#8ba7d7 54%,#222e43 64%,#080d16 76%);box-shadow:inset -20px -25px 35px #000c,inset 10px 9px 18px #fff8,0 0 42px #76a7ff25,0 0 100px #5777bb20;opacity:.95;animation:hm57-float 9s ease-in-out infinite;z-index:0}
body.hm49-home .hm49-math-stage:after{content:"∑  π  ∫  √  ∞";position:absolute;inset:8% 0 auto;text-align:center;letter-spacing:clamp(12px,3vw,32px);font-size:clamp(16px,2.2vw,26px);color:#dce8ff65;text-shadow:0 0 20px #88aaff3b;z-index:1}
body.hm49-home .hm49-equation{z-index:3;background:linear-gradient(135deg,#080d18dc,#18243bcb);border-color:#c6d8f544;box-shadow:0 20px 55px #0009,inset 0 1px #fff2;backdrop-filter:blur(16px);transform:rotate(-3deg) translateY(30px)}
body.hm49-home .hm49-equation strong{color:#f8fbff;text-shadow:0 0 20px #7ca8ff55}
body.hm49-home .hm49-orbit{z-index:1;border-color:#c3d7f74d;width:83%;height:72%;box-shadow:0 0 32px #7ca8ff12}
body.hm49-home .hm49-orbit-two{border-color:#8ea8e34a}
body.hm49-home .hm49-symbol{z-index:2;color:#e3eaf8;text-shadow:0 0 24px #8aaeff66}
body.hm49-home .hm49-graph{z-index:3;filter:drop-shadow(0 0 10px #7be8db55)}
body.hm49-home .hm49-visual-head{display:flex;align-items:center;gap:14px}
body.hm49-home .hm49-visual-head strong{color:#f5f7fc}
body.hm49-home .math-badge{background:linear-gradient(145deg,#f4f7fc,#8392aa);color:#080d17;box-shadow:0 0 38px #a9c5ff22}
body.hm49-home .hero-mini-kicker{color:#a9c8ff}
body.hm49-home .hm49-visual-bottom{border-color:#dce8ff1e}
body.hm49-home .hero-card-footer{color:#aebbd0;border-color:#dce8ff1c}
body.hm49-home .hm49-pathways,body.hm49-home main>section:not(.hero){background:#070a12!important;color:#edf2fb}
body.hm49-home .hm49-section-heading h2,body.hm49-home .section-head h2{color:#f1f5fc}
body.hm49-home .hm49-section-heading p,body.hm49-home .section-head p{color:#a0aec4}
body.hm49-home .hm49-kicker{color:#a8c2ff}
body.hm49-home .hm49-path{background:linear-gradient(145deg,#111827,#0b111d);border-color:#c4d6f51f;box-shadow:inset 0 1px #fff08,0 15px 40px #0003}
body.hm49-home .hm49-path:hover{border-color:#94b7ff66;box-shadow:0 18px 45px #0006,0 0 28px #729cff13}
body.hm49-home .hm49-path strong{color:#f2f6ff}
body.hm49-home .hm49-path p,body.hm49-home .hm49-path-label,body.hm49-home .hm49-trust-line{color:#a6b4ca}
body.hm49-home .hm49-path-go{color:#a9c7ff}
body.hm49-home .hm49-path-icon,body.hm49-home .hm49-path-student .hm49-path-icon,body.hm49-home .hm49-path-teacher .hm49-path-icon,body.hm49-home .hm49-path-library .hm49-path-icon,body.hm49-home .hm49-path-ai .hm49-path-icon,body.hm49-home .hm49-path-bac .hm49-path-icon{background:linear-gradient(145deg,#dce6f7,#7789aa);color:#07101e;box-shadow:0 8px 28px #9bb8f31c}
body.hm49-home .card,body.hm49-home .education-card,body.hm49-home .banner{background:linear-gradient(145deg,#111827,#0a101b)!important;color:#eaf0fa;border-color:#dce8ff1a;box-shadow:0 14px 40px #0004}
body.hm49-home .card h3{color:#f1f5fc}
body.hm49-home .muted{color:#a2b0c6}
body.hm49-home .stat-number{color:#b8d0ff}
body.hm49-home footer{background:#03050a;border-top:1px solid #dce8ff24}
body.hm49-home footer a{color:#c8d9ff}
@keyframes hm57-float{0%,100%{transform:translate(-50%,-50%) rotateX(18deg) rotateY(-22deg) translateY(0)}50%{transform:translate(-50%,-53%) rotateX(22deg) rotateY(5deg) translateY(-7px)}}
@media(max-width:980px){body.hm49-home .hero{min-height:auto;padding:42px 0 34px}body.hm49-home .hero-grid{grid-template-columns:1fr;gap:24px}body.hm49-home .hero-card.hm49-visual{min-height:390px}}
@media(max-width:640px){body.hm49-home .hero{padding:30px 0 26px}body.hm49-home .hero h1{font-size:clamp(34px,9vw,46px)}body.hm49-home .hero-card.hm49-visual{min-height:350px;padding:17px}body.hm49-home .hm49-math-stage{min-height:245px}body.hm49-home .hm49-math-stage:before{width:165px;height:165px}body.hm49-home .hm49-equation{padding:15px 18px;transform:rotate(-2deg) translateY(25px)}body.hm49-home .hm49-path-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){body.hm49-home .hm49-math-stage:before{animation:none}}


/* v58.2 — final cascade repair: older v49/v56 !important rules were overriding
   the premium reference layer. Scoped visual overrides only; app contracts untouched. */
html:has(body.hm49-home), body.hm49-home { background:#05070d !important; color:#f5f7fb !important; }
body.hm49-home .hero {
  min-height:600px !important; padding:68px 0 54px !important; color:#f8fbff !important;
  background:radial-gradient(ellipse at 72% 42%,#243d6d55 0,transparent 28%),radial-gradient(ellipse at 18% 8%,#5b4da522 0,transparent 32%),linear-gradient(125deg,#03050a 0%,#080d18 48%,#05070d 100%) !important;
  border-bottom:1px solid #a6bce633 !important;
}
body.hm49-home .hero-grid { display:grid !important; grid-template-columns:minmax(0,.92fr) minmax(360px,1.08fr) !important; gap:clamp(24px,5vw,72px) !important; align-items:center !important; }
body.hm49-home .hero-copy { color:#f5f7fb !important; }
body.hm49-home .hero h1 { color:#f8fbff !important; font-size:clamp(40px,5.1vw,72px) !important; line-height:1.12 !important; }
body.hm49-home .hero p { color:#c1ccdf !important; }
body.hm49-home .hero-card.hm49-visual {
  min-height:430px !important; border:1px solid #d7e7ff30 !important; border-radius:30px !important; padding:28px !important;
  background:radial-gradient(ellipse at 50% 45%,#243a5c66,transparent 56%),linear-gradient(145deg,#111827ef,#080c15f5 70%,#101729) !important;
  box-shadow:0 35px 100px #000b,inset 0 1px #ffffff18 !important;
}
body.hm49-home .hm49-pathways, body.hm49-home main>section:not(.hero) { background:#070a12 !important; color:#edf2fb !important; }
body.hm49-home .hm49-path { background:linear-gradient(145deg,#111827,#0b111d) !important; border-color:#c4d6f51f !important; color:#edf2fb !important; }
body.hm49-home .hm49-path strong, body.hm49-home .card h3, body.hm49-home .hm49-section-heading h2, body.hm49-home .section-head h2 { color:#f2f6ff !important; }
body.hm49-home .hm49-path p, body.hm49-home .hm49-path-label, body.hm49-home .hm49-trust-line, body.hm49-home .section-head p { color:#a6b4ca !important; }
@media(max-width:980px) {
  body.hm49-home .hero { min-height:auto !important; padding:42px 0 34px !important; }
  body.hm49-home .hero-grid { grid-template-columns:minmax(0,1fr) !important; gap:24px !important; }
  body.hm49-home .hero-card.hm49-visual { min-height:390px !important; }
}
@media(max-width:640px) {
  body.hm49-home .hero { padding:30px 0 26px !important; }
  body.hm49-home .hero h1 { font-size:clamp(34px,9vw,46px) !important; }
  body.hm49-home .hero-card.hm49-visual { min-height:350px !important; padding:17px !important; }
  body.hm49-home .hm49-math-stage { min-height:245px !important; }
}
@media(prefers-reduced-motion:reduce) { body.hm49-home .hm49-math-stage:before { animation:none !important; } }
