/* ============================================================
   مركز الأجيال التعليمي الرقمي — Production stylesheet
   Arabic / RTL first design system
   ============================================================ */

:root{
  --bg:#F4F8FB;
  --bg-alt:#EAF1F8;
  --surface:#FFFFFF;
  --surface-2:#F7FAFD;
  --ink:#10263F;
  --ink-soft:#1D3A5C;
  --muted:#445A72;
  --line:#D3DFEA;
  --brand:#0F3A63;
  --brand-2:#15507F;
  --brand-deep:#0A2540;
  --accent:#F2B01E;
  --accent-2:#FFC94D;
  --accent-ink:#10263F;
  --ok:#0E7C86;
  --ok-soft:#E4F4F5;
  --wa:#1FA855;
  --wa-dark:#17803F;
  --map-bg:#EAF1F8;
  --map-line:#D3DFEA;
  --map-road:#FFFFFF;

  --shadow-sm:0 1px 2px rgba(16,38,63,.06), 0 2px 6px rgba(16,38,63,.05);
  --shadow-md:0 4px 14px rgba(16,38,63,.08), 0 12px 30px rgba(16,38,63,.07);
  --shadow-lg:0 10px 30px rgba(10,37,64,.14), 0 26px 60px rgba(10,37,64,.12);
  --radius-sm:10px;
  --radius:16px;
  --radius-lg:22px;
  --ring:0 0 0 3px rgba(242,176,30,.55);
  --maxw:1140px;

  color-scheme:light;
  --header-h:70px;
}

@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0B1828;
    --bg-alt:#0E1E31;
    --surface:#12263D;
    --surface-2:#16304C;
    --ink:#EAF1F8;
    --ink-soft:#C6D6E6;
    --muted:#A9BBCE;
    --line:#254260;
    --brand:#123F66;
    --brand-2:#1A5686;
    --brand-deep:#0A2540;
    --accent:#F2B01E;
    --accent-2:#FFC94D;
    --accent-ink:#10263F;
    --ok:#56C6CF;
    --ok-soft:#123E49;
    --wa:#25BB60;
    --wa-dark:#1B964B;
    --map-bg:#0E1E31;
    --map-line:#254260;
    --map-road:#16304C;
    --shadow-sm:0 1px 2px rgba(0,0,0,.35);
    --shadow-md:0 6px 18px rgba(0,0,0,.4);
    --shadow-lg:0 14px 40px rgba(0,0,0,.5);
    color-scheme:dark;
  }
}

:root[data-theme="dark"]{
  --bg:#0B1828;
  --bg-alt:#0E1E31;
  --surface:#12263D;
  --surface-2:#16304C;
  --ink:#EAF1F8;
  --ink-soft:#C6D6E6;
  --muted:#A9BBCE;
  --line:#254260;
  --brand:#123F66;
  --brand-2:#1A5686;
  --brand-deep:#0A2540;
  --accent:#F2B01E;
  --accent-2:#FFC94D;
  --accent-ink:#10263F;
  --ok:#56C6CF;
  --ok-soft:#123E49;
  --wa:#25BB60;
  --wa-dark:#1B964B;
  --map-bg:#0E1E31;
  --map-line:#254260;
  --map-road:#16304C;
  --shadow-sm:0 1px 2px rgba(0,0,0,.35);
  --shadow-md:0 6px 18px rgba(0,0,0,.4);
  --shadow-lg:0 14px 40px rgba(0,0,0,.5);
  color-scheme:dark;
}

*,*::before,*::after{box-sizing:border-box}

html{
  scroll-behavior:smooth;
  scroll-padding-top:calc(var(--header-h) + 16px);
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:"Cairo","Segoe UI",Tahoma,"Noto Naskh Arabic",Arial,sans-serif;
  font-size:1.0625rem;
  line-height:1.9;
  font-weight:400;
  overflow-x:hidden;
  padding-bottom:env(safe-area-inset-bottom,0px);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

h1,h2,h3{margin:0;line-height:1.45;font-weight:800;color:var(--ink);letter-spacing:-.01em}
p{margin:0 0 1em}
img,svg{max-width:100%}
a{color:var(--brand-2);text-decoration:none}
a:hover{text-decoration:underline}
ul{margin:0;padding:0;list-style:none}

:focus-visible{outline:3px solid var(--accent);outline-offset:3px;border-radius:6px}

.container{
  width:100%;
  max-width:var(--maxw);
  margin-inline:auto;
  padding-inline:20px;
}

.skip-link{
  position:absolute;
  inset-inline-start:-9999px;
  top:0;
  z-index:999;
  background:var(--accent);
  color:var(--accent-ink);
  padding:12px 20px;
  border-radius:0 0 12px 12px;
  font-weight:700;
}
.skip-link:focus{inset-inline-start:16px;text-decoration:none}

/* ---------------- Header ---------------- */
.site-header{
  position:sticky;
  top:0;
  z-index:100;
  background:color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid var(--line);
  padding-top:env(safe-area-inset-top,0px);
}
.header-inner{
  display:flex;
  align-items:center;
  gap:18px;
  min-height:var(--header-h);
}
.brand{
  display:inline-flex;
  align-items:center;
  gap:11px;
  color:var(--ink);
  text-decoration:none;
  flex:none;
}
.brand:hover{text-decoration:none}
.brand-mark{
  width:42px;height:42px;
  display:grid;place-items:center;
  border-radius:12px;
  background:linear-gradient(145deg,var(--brand-2),var(--brand-deep));
  color:var(--accent);
  box-shadow:var(--shadow-sm);
  flex:none;
}
.brand-mark svg{width:26px;height:26px}
.brand-text{display:flex;flex-direction:column;line-height:1.25}
.brand-text strong{font-weight:800;font-size:1.06rem;letter-spacing:-.01em}
.brand-text small{font-size:.78rem;color:var(--muted);font-weight:600}

.primary-nav{
  display:flex;
  align-items:center;
  gap:22px;
  margin-inline-start:auto;
}
.nav-list{display:flex;align-items:center;gap:4px}
.nav-list a{
  display:block;
  padding:9px 14px;
  border-radius:10px;
  font-weight:600;
  color:var(--ink-soft);
  font-size:.97rem;
  transition:background .18s ease,color .18s ease;
}
.nav-list a:hover{background:var(--surface-2);color:var(--brand-2);text-decoration:none}
.nav-list a:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.nav-actions{display:flex;gap:10px;align-items:center}

.nav-toggle{
  display:none;
  margin-inline-start:auto;
  width:44px;height:44px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--surface);
  cursor:pointer;
  padding:0;
  place-items:center;
}
.nav-toggle-bars{display:grid;gap:5px;width:20px}
.nav-toggle-bars span{display:block;height:2px;border-radius:2px;background:var(--ink);transition:transform .25s ease,opacity .2s ease}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2){opacity:0}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* ---------------- Buttons ---------------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-height:52px;
  padding:0 26px;
  border-radius:12px;
  font:inherit;
  font-weight:700;
  text-decoration:none;
  border:2px solid transparent;
  cursor:pointer;
  transition:transform .16s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space:nowrap;
}
.btn:hover{text-decoration:none;transform:translateY(-2px)}
.btn:active{transform:translateY(0)}
.btn .ico{width:19px;height:19px;flex:none}
.btn-sm{min-height:42px;padding:0 16px;font-size:.92rem;border-radius:10px}
.btn-block{width:100%}

.btn-main{background:var(--accent);color:var(--accent-ink);box-shadow:0 6px 18px rgba(242,176,30,.34)}
.btn-main:hover{background:var(--accent-2);box-shadow:0 10px 24px rgba(242,176,30,.42)}
.btn-alt{background:rgba(255,255,255,.1);color:#fff;border-color:rgba(255,255,255,.7)}
.btn-alt:hover{background:#fff;color:var(--brand-deep)}
.btn-outline{background:transparent;color:var(--brand);border-color:var(--brand)}
.btn-outline:hover{background:var(--brand);color:#fff}
.btn-ghost{background:var(--surface);color:var(--ink);border-color:var(--line)}
.btn-ghost:hover{border-color:var(--brand-2);color:var(--brand-2)}
.btn-wa{background:var(--wa);color:#fff;box-shadow:0 6px 18px rgba(31,168,85,.28)}
.btn-wa:hover{background:var(--wa-dark);box-shadow:0 10px 24px rgba(31,168,85,.36)}

.actions{display:flex;flex-wrap:wrap;gap:12px}

/* ---------------- Hero ---------------- */
.hero{
  position:relative;
  isolation:isolate;
  background:linear-gradient(160deg,var(--brand-2) 0%, var(--brand) 45%, var(--brand-deep) 100%);
  color:#fff;
  padding-block:64px 76px;
  overflow:hidden;
}
.hero-bg{
  position:absolute;
  inset:0;
  z-index:-1;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(242,176,30,.30), transparent 62%),
    radial-gradient(700px 400px at 5% 110%, rgba(86,198,207,.22), transparent 60%);
}
.hero-bg::after{
  content:"";
  position:absolute;inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size:46px 46px;
  mask-image:linear-gradient(to bottom, rgba(0,0,0,.75), transparent 85%);
  -webkit-mask-image:linear-gradient(to bottom, rgba(0,0,0,.75), transparent 85%);
}
.hero-inner{max-width:860px}
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:9px;
  margin:0 0 18px;
  padding:7px 16px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.22);
  font-size:.88rem;
  font-weight:600;
  color:#EAF1F8;
}
.eyebrow .dot{
  width:8px;height:8px;border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 4px rgba(242,176,30,.25);
}
.hero h1{
  color:#fff;
  font-size:clamp(2.05rem,6.2vw,3.5rem);
  line-height:1.3;
  margin:0 0 18px;
  border-inline-start:8px solid var(--accent);
  padding-inline-start:18px;
}
.hero-lead{
  max-width:40em;
  font-size:clamp(1.05rem,2.4vw,1.2rem);
  color:#E3ECF5;
  margin:0 0 30px;
  line-height:1.95;
}
.hero .btn-alt{background:rgba(255,255,255,.08)}
.hero-points{
  display:flex;
  flex-wrap:wrap;
  gap:12px 26px;
  margin-top:34px;
  padding-top:26px;
  border-top:1px solid rgba(255,255,255,.16);
}
.hero-points li{
  display:flex;
  align-items:center;
  gap:9px;
  font-weight:600;
  font-size:.96rem;
  color:#DCE8F4;
}
.ico-check{width:19px;height:19px;color:var(--accent);flex:none}

/* ---------------- Sections ---------------- */
.section{padding-block:clamp(48px,7vw,80px)}
.section-alt{background:var(--bg-alt)}
.section-head{max-width:640px;margin-bottom:40px}
.section-tag{
  display:inline-block;
  margin:0 0 10px;
  font-size:.86rem;
  font-weight:700;
  letter-spacing:.04em;
  color:var(--ok);
  background:var(--ok-soft);
  padding:5px 14px;
  border-radius:999px;
}
.section-head h2{font-size:clamp(1.6rem,4.4vw,2.3rem);margin-bottom:12px}
.section-sub{color:var(--muted);font-size:1.03rem;margin:0}

/* ---------------- Cards ---------------- */
.card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));
  gap:20px;
}
.card{
  position:relative;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:26px 24px;
  box-shadow:var(--shadow-sm);
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  overflow:hidden;
}
.card::before{
  content:"";
  position:absolute;
  inset-block-start:0;
  inset-inline:0;
  height:4px;
  background:linear-gradient(90deg,var(--brand-2),var(--accent));
  transform:scaleX(0);
  transform-origin:inline-start;
  transition:transform .3s ease;
}
.card:hover{transform:translateY(-4px);box-shadow:var(--shadow-md);border-color:transparent}
.card:hover::before{transform:scaleX(1)}
.card-icon{
  width:52px;height:52px;
  display:grid;place-items:center;
  border-radius:14px;
  background:var(--ok-soft);
  color:var(--ok);
  margin-bottom:16px;
}
.card-icon svg{width:26px;height:26px}
.card h3{font-size:1.14rem;margin-bottom:6px}
.card p{margin:0;color:var(--muted);font-size:.98rem;line-height:1.85}

/* ---------------- About ---------------- */
.about-grid{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:36px;
  align-items:start;
}
.about-text h2{font-size:clamp(1.6rem,4vw,2.2rem);margin-bottom:14px}
.about-text .lead{font-size:1.06rem;color:var(--muted);margin-bottom:24px}
.feature-list{display:grid;gap:12px;margin-bottom:28px}
.feature-list li{display:flex;align-items:flex-start;gap:11px;line-height:1.75}
.tick{
  width:24px;height:24px;flex:none;
  display:grid;place-items:center;
  border-radius:50%;
  background:var(--ok-soft);
  color:var(--ok);
  margin-top:3px;
}
.tick svg{width:14px;height:14px}

.about-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:28px;
  box-shadow:var(--shadow-md);
  position:relative;
  overflow:hidden;
}
.about-card::after{
  content:"";
  position:absolute;
  inset-block-start:-60px;
  inset-inline-end:-60px;
  width:180px;height:180px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(242,176,30,.22),transparent 70%);
  pointer-events:none;
}
.about-card h3{font-size:1.22rem;margin-bottom:18px;position:relative}
.info-list{display:grid;gap:14px;margin:0 0 22px;position:relative}
.info-list > div{
  padding-block:12px;
  border-bottom:1px dashed var(--line);
}
.info-list > div:last-child{border-bottom:0;padding-bottom:0}
.info-list dt{font-size:.85rem;font-weight:700;color:var(--muted);margin-bottom:3px}
.info-list dd{margin:0;font-weight:600;color:var(--ink);line-height:1.75}
.phone{
  font-size:1.5rem;
  font-weight:800;
  direction:ltr;
  unicode-bidi:isolate;
  display:inline-block;
  color:var(--brand-2);
}
.phone:hover{color:var(--brand)}
.link-wa{color:var(--wa);font-weight:700;direction:ltr;unicode-bidi:isolate;display:inline-block}
.link-wa:hover{color:var(--wa-dark)}

/* ---------------- Contact ---------------- */
.contact-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:26px;
  align-items:stretch;
}
.contact-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:32px;
  box-shadow:var(--shadow-md);
}
.contact-card h3{font-size:1.3rem;margin-bottom:20px}
.contact-list{display:grid;gap:18px;margin-bottom:26px}
.contact-list li{display:flex;gap:14px;align-items:flex-start}
.contact-ico{
  width:46px;height:46px;flex:none;
  display:grid;place-items:center;
  border-radius:13px;
  background:var(--bg-alt);
  color:var(--brand-2);
}
.contact-ico svg{width:22px;height:22px}
.contact-ico.wa{background:var(--ok-soft);color:var(--wa)}
.contact-list .label{display:block;font-size:.84rem;font-weight:700;color:var(--muted);margin-bottom:2px}
.contact-list .value{display:block;font-weight:600;color:var(--ink);line-height:1.75}
.contact-list a.value{color:var(--brand-2)}
.contact-list a.value:hover{color:var(--brand)}
.contact-list .phone{font-size:1.32rem}

.map-card{
  display:flex;
  flex-direction:column;
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  overflow:hidden;
  box-shadow:var(--shadow-md);
  background:var(--surface);
}
.map-frame{
  flex:1;
  min-height:250px;
  position:relative;
  background:var(--map-bg);
}
.map-frame svg{width:100%;height:100%;display:block}
.map-caption{
  padding:20px 24px;
  border-top:1px solid var(--line);
  display:grid;
  gap:4px;
}
.map-caption strong{font-size:1.05rem}
.map-caption span{color:var(--muted);font-size:.95rem}

/* ---------------- Footer ---------------- */
.site-footer{
  background:var(--brand-deep);
  color:#CBD9E8;
  padding-top:44px;
}
:root[data-theme="dark"] .site-footer,
:root:not([data-theme="light"]) .site-footer{background:#071322}
.footer-inner{
  display:flex;
  flex-wrap:wrap;
  gap:26px;
  align-items:center;
  justify-content:space-between;
  padding-bottom:30px;
}
.footer-brand{display:flex;align-items:center;gap:13px;max-width:520px}
.footer-brand .brand-mark{background:rgba(255,255,255,.1);box-shadow:none}
.footer-brand strong{display:block;color:#fff;font-size:1.05rem;font-weight:800}
.footer-brand span{display:block;color:#9FB4C9;font-size:.94rem;line-height:1.7}
.footer-links{display:flex;flex-wrap:wrap;gap:10px 24px}
.footer-links a{
  color:#CBD9E8;
  font-weight:600;
  font-size:.96rem;
}
.footer-links a:hover{color:var(--accent)}
.footer-bottom{
  border-top:1px solid rgba(255,255,255,.12);
  padding-block:18px;
}
.footer-bottom p{margin:0;text-align:center;color:#8FA5BA;font-size:.9rem}

/* ---------------- Mobile action bar ---------------- */
.mobile-bar{
  position:fixed;
  inset-inline:0;
  bottom:0;
  z-index:90;
  display:none;
  gap:10px;
  padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));
  background:color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-top:1px solid var(--line);
}
.mobile-bar .btn{flex:1;min-height:50px}

/* ---------------- Reveal animation ----------------
   Progressive enhancement: content is visible by default.
   Only hidden when JS is confirmed active (.js class set inline in <head>),
   and a failsafe timer in main.js reveals everything regardless. */
.js .reveal{opacity:0;transform:translateY(18px);transition:opacity .6s ease,transform .6s ease}
.js .reveal.is-visible{opacity:1;transform:none}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
  .reveal{opacity:1;transform:none}
}

/* ---------------- Responsive ---------------- */
@media (max-width:960px){
  .about-grid{grid-template-columns:1fr;gap:26px}
  .contact-grid{grid-template-columns:1fr}
  .map-frame{min-height:210px}
}

@media (max-width:860px){
  .nav-toggle{display:grid}
  .primary-nav{
    position:absolute;
    inset-inline:0;
    top:100%;
    flex-direction:column;
    align-items:stretch;
    gap:14px;
    background:var(--surface);
    border-bottom:1px solid var(--line);
    box-shadow:var(--shadow-md);
    padding:18px 20px 22px;
    margin-inline-start:0;
    display:none;
  }
  .primary-nav.is-open{display:flex}
  .nav-list{flex-direction:column;align-items:stretch;gap:2px}
  .nav-list a{padding:12px 14px;font-size:1rem}
  .nav-actions{flex-direction:column;align-items:stretch}
  .nav-actions .btn{width:100%}
  .nav-actions .btn .ico{display:none}
}

@media (max-width:680px){
  body{font-size:1rem;padding-bottom:78px}
  .container{padding-inline:16px}
  .hero{padding-block:48px 56px}
  .hero h1{border-inline-start-width:6px;padding-inline-start:14px}
  .hero-points{gap:10px 18px;margin-top:26px;padding-top:20px}
  .hero-points li{font-size:.9rem}
  .section{padding-block:44px}
  .card{padding:22px 20px}
  .contact-card{padding:24px 20px}
  .about-card{padding:24px 20px}
  .phone{font-size:1.3rem}
  .contact-list .phone{font-size:1.2rem}
  .actions .btn{flex:1 1 100%}
  .mobile-bar{display:flex}
  .footer-inner{flex-direction:column;align-items:flex-start;gap:20px}
  .brand-text small{font-size:.74rem}
}

@media (max-width:380px){
  .container{padding-inline:14px}
  .brand-text strong{font-size:.98rem}
  .btn{padding:0 18px;font-size:.98rem}
  .nav-actions .btn .ico{display:block}
}

@media print{
  .site-header,.mobile-bar,.hero-bg,.footer-bottom{display:none}
  body{background:#fff;color:#000;padding:0}
  .hero{background:none;color:#000}
  .hero h1,.hero-lead{color:#000}
}
