/* Afaq Al-Noor public site. Brand palette only: navy #0b2545, teal #13807a, sky #80deea, terracotta #c8553d, white, tan #c8a07a (sparingly). */
:root {
  --navy: #0b2545;
  --navy-deep: #071a33;
  --navy-soft: #13325a;
  --teal: #13807a;
  --teal-dark: #0e6762;
  --sky: #80deea;
  --terra: #c8553d;
  --tan: #c8a07a;
  --white: #ffffff;
  --paper: #f4f7f9;
  --line: #dbe4ea;
  --ink: #0b2545;
  --muted: #3f5670;
  --on-dark: #e8f4f7;
  --on-dark-muted: #b8cfdb;
  --radius: 14px;
  --gutter: 16px;
  --max: 1160px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
picture { display: contents; }
a { color: var(--teal); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
[lang="ar"] { font-family: var(--font-ar); letter-spacing: 0; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 900; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--white); color: var(--navy); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease), transform .4s var(--ease);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.topbar.scrolled { background: rgba(7, 26, 51, .92); box-shadow: 0 1px 0 rgba(128, 222, 234, .12); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.brand img { height: 34px; width: auto; transition: opacity .4s var(--ease); }
.topbar:not(.scrolled) .brand img { opacity: 0; pointer-events: none; }
.topbar:not(.scrolled) .brand { pointer-events: none; }
.topbar .brand:focus-visible img { opacity: 1; }

.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  color: var(--on-dark); text-decoration: none; font-weight: 700; font-size: .95rem; letter-spacing: .02em;
  padding: 8px 14px; border-radius: 999px; position: relative; transition: color .25s, background-color .25s;
}
.nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--sky); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a.nav-cta { border: 1.5px solid rgba(128, 222, 234, .55); }
.nav a.nav-cta::after { display: none; }
.nav a.nav-cta:hover { background: var(--sky); color: var(--navy); }

.menu-btn { display: none; }
@media (max-width: 760px) {
  .menu-btn {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; margin-right: -10px; background: none; border: 0; cursor: pointer;
  }
  .menu-btn span { display: block; height: 2px; background: var(--white); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s; }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(7, 26, 51, .97); padding: 8px var(--gutter) 18px;
    clip-path: inset(0 0 100% 0); visibility: hidden; transition: clip-path .4s var(--ease), visibility 0s .4s;
  }
  .nav.open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .4s var(--ease); }
  .nav a { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid rgba(128, 222, 234, .12); font-size: 1.05rem; }
  .nav a::after { display: none; }
  .nav a.nav-cta { border: 0; color: var(--sky); }
  .topbar.menu-open { background: rgba(7, 26, 51, .97); }
  .topbar.menu-open .brand img { opacity: 1; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; letter-spacing: .02em; text-decoration: none;
  transition: transform .25s var(--ease), background-color .25s, color .25s, box-shadow .25s, border-color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-sky { background: var(--sky); color: var(--navy); }
.btn-sky:hover { background: var(--white); box-shadow: 0 10px 30px rgba(128, 222, 234, .25); }
.btn-ghost { color: var(--white); border: 1.5px solid rgba(255, 255, 255, .5); }
.btn-ghost:hover { border-color: var(--white); background: rgba(255, 255, 255, .08); }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--navy); box-shadow: 0 12px 30px rgba(11, 37, 69, .25); }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 1.08rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center;
  color: var(--white); background: var(--navy-deep); overflow: hidden; isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -3; }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.hero-media video { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero-media video.ready { opacity: 1; }
.hero-img { animation: heroZoom 30s ease-in-out infinite alternate; }
@keyframes heroZoom { from { transform: scale(1.02); } to { transform: scale(1.1); } }
.hero-shade {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(7, 26, 51, .35), rgba(7, 26, 51, .78) 70%),
    linear-gradient(180deg, rgba(7, 26, 51, .55) 0%, rgba(7, 26, 51, .2) 40%, rgba(7, 26, 51, .85) 100%);
}
.hero-arcs { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-in { text-align: center; padding-top: 96px; padding-bottom: 120px; }
.hero-logo { margin: 0 auto 32px; width: min(520px, 88vw); }
.hero-logo img { width: 100%; height: auto; filter: drop-shadow(0 6px 28px rgba(7, 26, 51, .6)); }
.hero-line {
  font-size: clamp(1.35rem, 1rem + 1.8vw, 2.1rem); font-weight: 300; line-height: 1.35;
  max-width: 30ch; margin: 0 auto 18px; text-wrap: balance;
}
.hero-sub { color: var(--on-dark); max-width: 60ch; margin: 0 auto 34px; font-size: 1rem; opacity: .92; text-wrap: balance; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-in > * { opacity: 0; transform: translateY(18px); animation: rise 1.1s var(--ease) forwards; }
.hero-in > :nth-child(1) { animation-delay: .15s; }
.hero-in > :nth-child(2) { animation-delay: .55s; }
.hero-in > :nth-child(3) { animation-delay: .75s; }
.hero-in > :nth-child(4) { animation-delay: .95s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.scroll-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: 28px; height: 46px; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 16px; }
.scroll-cue span { position: absolute; left: 50%; top: 9px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--sky); animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 80% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }
@media (max-height: 640px) { .scroll-cue { display: none; } }

/* ---------- Sections ---------- */
.section { padding: 88px 0; position: relative; scroll-margin-top: 60px; }
@media (min-width: 900px) { .section { padding: 128px 0; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--terra); border-radius: 2px; }
.eyebrow [lang="ar"] { font-size: .95rem; letter-spacing: 0; text-transform: none; font-weight: 700; opacity: .85; }
.eyebrow-sky { color: var(--sky); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 { margin-bottom: 14px; }
.section-intro { color: var(--muted); font-size: 1.08rem; }

/* About */
.about { background: var(--white); }
.about-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1fr 1fr; gap: 72px; } }
.about-text h2 { margin-bottom: 22px; }
.lead { font-size: 1.22rem; color: var(--ink); font-weight: 400; }
.about-text p:not(.lead):not(.eyebrow) { color: var(--muted); }
.text-link { display: inline-flex; gap: 8px; font-weight: 700; text-decoration: none; color: var(--teal); }
.text-link span { transition: transform .25s var(--ease); }
.text-link:hover span { transform: translateX(5px); }
.about-fig { margin: 0; border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 3 / 2; box-shadow: 0 30px 60px -30px rgba(11, 37, 69, .45); }
.about-fig img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.about-fig:hover img { transform: scale(1.04); }
.about-fig::after { content: ""; position: absolute; left: 0; bottom: 0; width: 38%; height: 5px; background: linear-gradient(90deg, var(--terra), var(--teal)); }

/* Services */
.services { background: var(--paper); }
.services::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--line); }
.cards { display: grid; gap: 20px; }
@media (min-width: 700px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px 28px; overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--sky)); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -24px rgba(11, 37, 69, .35); border-color: transparent; }
.card:hover::before { transform: scaleX(1); }
.card h3 { margin: 20px 0 12px; color: var(--navy); }
.card p { color: var(--muted); font-size: .98rem; margin: 0; }
.card-icon {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  background: var(--navy); transition: background-color .35s var(--ease), transform .35s var(--ease);
}
.card-icon svg { width: 34px; height: 34px; fill: none; stroke: var(--sky); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.card-icon .accent { stroke: var(--terra); }
.card-icon circle.accent { fill: var(--terra); }
.card:hover .card-icon { background: var(--teal); transform: rotate(-4deg); }
.card:hover .card-icon svg { stroke: var(--white); }
.band { margin: 56px 0 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 7; position: relative; }
.band img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); will-change: transform; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(11, 37, 69, .35)); }
@media (max-width: 700px) { .band { aspect-ratio: 4 / 3; } }

/* Approach */
.approach { background: var(--navy); color: var(--white); overflow: hidden; isolation: isolate; }
.approach-bg { position: absolute; inset: 0; z-index: -1; }
.approach-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.approach-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 37, 69, .95) 0%, rgba(11, 37, 69, .75) 55%, rgba(11, 37, 69, .55) 100%); }
.approach h2 { color: var(--white); }
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: p; }
@media (min-width: 700px) { .principles { grid-template-columns: 1fr 1fr; gap: 22px; } }
@media (min-width: 1100px) { .principles { grid-template-columns: repeat(4, 1fr); } }
.principles li {
  padding: 28px 24px; border-radius: var(--radius);
  background: rgba(7, 26, 51, .5); border: 1px solid rgba(128, 222, 234, .18);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: border-color .35s, background-color .35s, transform .35s var(--ease);
}
.principles li:hover { border-color: rgba(128, 222, 234, .6); background: rgba(7, 26, 51, .7); transform: translateY(-4px); }
.num { display: block; font-size: 2.2rem; font-weight: 300; color: var(--sky); line-height: 1; margin-bottom: 18px; letter-spacing: .02em; }
.principles h3 { margin-bottom: 10px; }
.principles p { color: var(--on-dark-muted); margin: 0; font-size: .98rem; }

/* Contact */
.contact { background: var(--white); }
.contact-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.1fr .9fr; gap: 72px; } }
.contact h2 { margin-bottom: 14px; }
.contact .section-intro { margin-bottom: 30px; }
.address-card {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 30px; overflow: hidden;
}
.address-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--teal), var(--sky)); }
.address-mark { width: 56px; height: 56px; margin-bottom: 18px; }
address { font-style: normal; line-height: 1.8; color: var(--muted); }
address strong { color: var(--navy); font-size: 1.1rem; }
.address-mail { margin: 16px 0 0; font-weight: 700; }
.address-mail a { text-decoration: none; border-bottom: 1.5px solid rgba(19, 128, 122, .35); transition: border-color .25s; }
.address-mail a:hover { border-color: var(--teal); }

/* Footer */
.footer { background: var(--navy-deep); color: var(--on-dark-muted); padding: 48px 0 40px; font-size: .92rem; }
.footer-in { display: grid; gap: 24px; }
@media (min-width: 800px) { .footer-in { grid-template-columns: auto 1fr; align-items: center; gap: 48px; } .footer-meta { text-align: right; } }
.footer-brand img { width: 206px; height: auto; }
.footer-meta p { margin: 0 0 6px; }
.footer a { color: var(--sky); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.copy { opacity: .85; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .cards .reveal:nth-child(2), .js .principles .reveal:nth-child(2) { transition-delay: .08s; }
.js .cards .reveal:nth-child(3), .js .principles .reveal:nth-child(3) { transition-delay: .16s; }
.js .cards .reveal:nth-child(4), .js .principles .reveal:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .hero-in > * { opacity: 1; transform: none; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-media video { display: none; }
}
