/* =========================================================
   AL ANSAAR — DESIGN SYSTEM v2
   Palette, type and layout are all driven from the variables
   below — change a value once here and it updates everywhere.
   ========================================================= */

:root {
  --midnight:   #071F1B;
  --emerald:    #0B3D35;
  --emerald-2:  #114A40;
  --gold:       #D4AF37;
  --gold-soft:  #EFD98A;
  --ivory:      #FBF7EE;
  --ink:        #221E17;

  /* one accent per programme */
  --acc-masjid:    #D4AF37;
  --acc-feeding:   #C1502E;
  --acc-childcare: #2F6690;
  --acc-school:    #5B3A6E;

  --font-display: 'Amiri', Georgia, serif;
  --font-body: 'Outfit', 'Segoe UI', Arial, sans-serif;

  --max: 1180px;
  --radius: 14px;
  --ease: cubic-bezier(.22,.9,.32,1);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0 0 .4em; line-height: 1.15; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: .28em; font-size: .72rem; font-weight: 600; color: var(--gold-soft); }

/* =========================================================
   REVEAL ON SCROLL
   ========================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* =========================================================
   NAV
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7,31,27,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212,175,55,0.25);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ivory); }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-size: 1.25rem; color: var(--ivory); }
.brand-name small { display: block; font-family: var(--font-body); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-soft); font-weight: 600; }

.nav-toggle { display: none; background: none; border: 0; color: var(--ivory); font-size: 1.6rem; cursor: pointer; }

.main-nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.main-nav a {
  position: relative; display: inline-block; padding: 8px 14px; text-decoration: none;
  font-size: .88rem; font-weight: 600; color: rgba(251,247,238,0.82); border-radius: 8px;
  transition: color .2s ease;
}
.main-nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--gold-soft); }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: 66px 0 0 0; background: var(--midnight);
    transform: translateX(100%); transition: transform .35s var(--ease); overflow-y: auto;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; padding: 20px 28px; gap: 4px; }
  .main-nav a { display: block; padding: 14px 6px; font-size: 1.05rem; }
}

/* =========================================================
   HERO with self-drawing khatam star
   ========================================================= */
.hero {
  position: relative;
  background: radial-gradient(120% 140% at 50% 0%, var(--emerald-2) 0%, var(--emerald) 45%, var(--midnight) 100%);
  color: var(--ivory);
  padding: 110px 0 130px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.hero--sub { padding: 80px 0 90px; }

.hero-starfield {
  position: absolute; inset: 0; z-index: 0; opacity: .35;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, var(--gold-soft) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 75% 15%, var(--gold-soft) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 60%, var(--gold-soft) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 70%, var(--gold-soft) 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 80%, var(--gold-soft) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 35% 85%, var(--gold-soft) 50%, transparent 51%);
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .18; } to { opacity: .4; } }

.hero-star {
  position: relative; z-index: 1;
  width: min(340px, 60vw); margin: 0 auto 18px;
}
.hero-star path, .hero-star circle {
  fill: none; stroke: var(--gold); stroke-width: 1.4;
  stroke-dasharray: 340; stroke-dashoffset: 340;
  animation: draw 2.6s var(--ease) forwards;
}
.hero-star circle { stroke: var(--gold-soft); stroke-dasharray: 220; stroke-dashoffset: 220; animation-delay: .3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero h1 { position: relative; z-index: 1; font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: .25em; }
.hero p.lead { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; font-size: 1.15rem; color: rgba(251,247,238,0.88); }
.hero .eyebrow { position: relative; z-index: 1; display: block; margin-bottom: 16px; }

.athaan-btn {
  position: relative; z-index: 1; margin-top: 30px;
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(212,175,55,0.12); border: 1px solid rgba(212,175,55,0.5);
  color: var(--gold-soft); padding: 12px 24px; border-radius: 999px;
  font-family: var(--font-body); font-size: .88rem; font-weight: 600; letter-spacing: .02em;
  cursor: pointer; transition: background .25s ease, transform .2s ease, border-color .25s ease;
  animation: athaan-pulse 2.4s ease-in-out infinite;
}
.athaan-btn:hover { background: rgba(212,175,55,0.2); transform: translateY(-2px); }
.athaan-btn svg { width: 18px; height: 18px; }
.athaan-btn.is-playing { animation: none; background: rgba(212,175,55,0.22); border-color: var(--gold); }
@keyframes athaan-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.35); }
  50% { box-shadow: 0 0 0 10px rgba(212,175,55,0); }
}

.scroll-cue {
  position: relative; z-index: 1; margin-top: 46px; display: inline-flex; flex-direction: column; align-items: center;
  gap: 6px; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-soft); opacity: .8;
}
.scroll-cue span { width: 1px; height: 26px; background: linear-gradient(var(--gold), transparent); animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(6px); opacity: 1; } }

.star-divider {
  height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='22' viewBox='0 0 44 22'%3E%3Cpath fill='%23D4AF37' d='M11 0 L13.5 7.5 21 10 13.5 12.5 11 20 8.5 12.5 1 10 8.5 7.5Z'/%3E%3Cpath fill='%23D4AF37' d='M33 0 L35.5 7.5 43 10 35.5 12.5 33 20 30.5 12.5 23 10 30.5 7.5Z'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: 44px 22px; background-position: center;
}

/* =========================================================
   PROGRAMME PORTALS (interactive tilt cards)
   ========================================================= */
.portals {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px;
  margin: -64px 0 70px; position: relative; z-index: 2;
}
@media (max-width: 760px) { .portals { grid-template-columns: 1fr; } }

.portal {
  --accent: var(--gold);
  background: #fff; border-radius: var(--radius); padding: 34px 30px; text-decoration: none; color: var(--ink);
  box-shadow: 0 18px 40px rgba(7,31,27,.18); border-top: 5px solid var(--accent);
  position: relative; overflow: hidden; will-change: transform;
  transition: box-shadow .3s ease;
  transform-style: preserve-3d; transform: perspective(800px);
}
.portal:hover { box-shadow: 0 26px 54px rgba(7,31,27,.26); }
.portal::before {
  content: ""; position: absolute; top: -40%; right: -30%; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: .12; transition: opacity .3s ease;
}
.portal:hover::before { opacity: .22; }
.portal .portal-icon { width: 46px; height: 46px; color: var(--accent); margin-bottom: 6px; }
.portal h2 { font-size: 1.4rem; color: var(--accent); }
.portal .portal-address { font-size: .9rem; color: #746b5c; font-weight: 500; }
.portal .portal-cta {
  margin-top: 14px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.portal .portal-cta svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.portal:hover .portal-cta svg { transform: translateX(5px); }

.portal.p-masjid    { --accent: var(--acc-masjid); }
.portal.p-feeding   { --accent: var(--acc-feeding); }
.portal.p-childcare { --accent: var(--acc-childcare); }
.portal.p-school    { --accent: var(--acc-school); }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: 78px 0; }
.section--tint { background: #F1EADB; }
.section--dark { background: var(--midnight); color: var(--ivory); }
.section--dark h2 { color: var(--ivory); }
.section h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--emerald); }
.section .kicker { color: var(--page-accent, var(--gold)); }

.two-col { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: start; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* Stat counters */
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; margin-top: 10px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }
.stat { text-align: center; padding: 26px 14px; background: rgba(255,255,255,.06); border-radius: var(--radius); }
.section:not(.section--dark) .stat { background: #fff; box-shadow: 0 8px 24px rgba(7,31,27,.08); }
.stat .num { font-family: var(--font-display); font-size: 2.4rem; color: var(--page-accent, var(--gold)); display: block; }
.stat .label { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }

/* Info list */
.info-list { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 12px; }
.info-list li {
  display: flex; gap: 12px; background: #fff; padding: 15px 18px; border-radius: 10px;
  border-left: 4px solid var(--page-accent, var(--gold)); box-shadow: 0 4px 14px rgba(7,31,27,.06);
}
.info-list .label { font-weight: 700; display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--page-accent, var(--emerald)); }

.map-frame { width: 100%; height: 320px; border: 0; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.15); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--page-accent, var(--emerald)); color: #fff;
  padding: 13px 28px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .92rem;
  border: 0; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.btn--ghost { background: transparent; border: 2px solid var(--page-accent, var(--emerald)); color: var(--page-accent, var(--emerald)); padding: 11px 26px; }

/* =========================================================
   PHOTO GALLERY (frames ready for real photos)
   ========================================================= */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .gallery { grid-template-columns: 1fr; } }

.frame {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: linear-gradient(135deg, var(--page-accent, var(--emerald)) 0%, var(--midnight) 100%);
  box-shadow: 0 12px 30px rgba(7,31,27,.18);
}
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.frame:hover img { transform: scale(1.06); }
.frame .frame-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: rgba(255,255,255,.85); text-align: center; padding: 16px;
}
.frame .frame-placeholder svg { width: 34px; height: 34px; opacity: .8; }
.frame .frame-placeholder span { font-size: .78rem; letter-spacing: .04em; }
.frame .frame-tag {
  position: absolute; left: 12px; bottom: 12px; background: rgba(7,31,27,.65); color: var(--gold-soft);
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; padding: 5px 10px; border-radius: 999px;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(7,31,27,.92); z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: 30px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 80vh; border-radius: 10px; }
.lightbox-close {
  position: absolute; top: 24px; right: 28px; background: none; border: 0; color: var(--ivory);
  font-size: 2rem; cursor: pointer; line-height: 1;
}

/* =========================================================
   ACCORDION (FAQ)
   ========================================================= */
.accordion { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.acc-item { background: #fff; border-radius: 10px; box-shadow: 0 4px 14px rgba(7,31,27,.06); overflow: hidden; }
.acc-trigger {
  width: 100%; text-align: left; background: none; border: 0; padding: 18px 22px; font-family: var(--font-body);
  font-size: 1rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; color: var(--ink);
}
.acc-trigger .plus { font-size: 1.3rem; color: var(--page-accent, var(--gold)); transition: transform .3s var(--ease); flex-shrink: 0; }
.acc-item.is-open .plus { transform: rotate(45deg); }
.acc-panel { max-height: 0; overflow: hidden; transition: max-height .35s var(--ease); }
.acc-panel-inner { padding: 0 22px 20px; color: #5a5347; font-size: .95rem; }

/* =========================================================
   QUOTE / CTA BAND
   ========================================================= */
.cta-band {
  background: linear-gradient(120deg, var(--emerald) 0%, var(--midnight) 100%);
  color: var(--ivory); text-align: center; padding: 70px 0; position: relative; overflow: hidden;
}
.cta-band h2 { color: var(--ivory); }
.cta-band p { max-width: 560px; margin: 0 auto 26px; color: rgba(251,247,238,.85); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--midnight); color: rgba(251,247,238,.85); padding: 46px 0 30px; }
.site-footer .container { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; }
@media (max-width: 700px) { .site-footer .container { grid-template-columns: 1fr; } }
.site-footer h3 { color: var(--gold-soft); font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-body); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 7px; font-size: .92rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--gold-soft); }
.footer-bottom { text-align: center; font-size: .78rem; color: rgba(251,247,238,.45); margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }

/* Page accents */
.page--masjid    { --page-accent: var(--acc-masjid); }
.page--feeding   { --page-accent: var(--acc-feeding); }
.page--childcare { --page-accent: var(--acc-childcare); }
.page--school    { --page-accent: var(--acc-school); }

/* =========================================================
   WIRELESS THEME
   ========================================================= */
.theme-wireless {
  --emerald: #0C3244; --emerald-2: #124A63; --midnight: #06202C;
  --gold: #35C4B8; --gold-soft: #A9EDE6; --page-accent: #35C4B8;
}
.theme-wireless .hero-star path, .theme-wireless .hero-star circle { stroke: #35C4B8; }
.theme-wireless .hero-star circle { stroke: #A9EDE6; }

/* Focus visibility */
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
