:root {
  --deep: #0b3550;
  --ink: #23455f;
  --muted: #5a7487;
  --river: #1d9fd1;
  --spray: #8fd8ef;
  --sky: #dff2fc;
  --mist: #f3f9fd;
  --line: #d5e8f3;
  --snow: #ffffff;
  --gold: #a8844f;
  --panel: #1f5f96;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --arabic: "Amiri", "Geeza Pro", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--snow); color: var(--ink); font: 400 17px/1.7 var(--sans); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--deep); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--snow); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--river); outline-offset: 3px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.header__in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header__logo img { height: 64px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 999px;
  font: 500 15px var(--sans); color: var(--deep); text-decoration: none; background: none; border: 0; cursor: pointer;
}
.nav__link:hover, .nav__link[aria-current="page"] { background: var(--mist); }
.nav__link svg { width: 12px; height: 12px; transition: transform .2s; }
.nav__sub {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; padding: 8px;
  background: var(--snow); border-radius: 14px; box-shadow: 0 18px 40px rgba(11,53,80,.14), 0 0 0 1px var(--line);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .18s ease;
}
.nav__item:hover .nav__sub, .nav__item:focus-within .nav__sub { opacity: 1; visibility: visible; transform: none; }
.nav__sub a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-size: 15px; color: var(--ink); }
.nav__sub a:hover { background: var(--mist); color: var(--deep); }
.nav__cta { margin-left: 8px; }
.burger { display: none; width: 46px; height: 46px; border: 0; background: none; color: var(--deep); cursor: pointer; }
.burger svg { width: 22px; height: 22px; }

/* Mobile slide-in panel: full height, lined rows, chevron toggles for sub-menus */
.drawer { position: fixed; inset: 0; z-index: 80; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer__shade { position: absolute; inset: 0; background: rgba(6,30,46,.45); opacity: 0; transition: opacity .3s; }
.drawer.open .drawer__shade { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(88vw, 400px);
  background: var(--panel); color: var(--snow); overflow-y: auto;
  transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.drawer.open .drawer__panel { transform: none; }
.drawer__close { margin: 18px 22px 10px; width: 44px; height: 44px; border: 0; background: none; color: var(--snow); cursor: pointer; }
.drawer__close svg { width: 24px; height: 24px; }
.drawer ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255,255,255,.14); }
.drawer li { border-bottom: 1px solid rgba(255,255,255,.14); }
.drawer__row { display: flex; align-items: stretch; }
.drawer__row > a { flex: 1; padding: 20px 28px; color: var(--snow); text-decoration: none; font: 500 18px var(--sans); }
.drawer__toggle { width: 76px; border: 0; background: rgba(255,255,255,.88); color: var(--panel); cursor: pointer; }
.drawer__toggle svg { width: 16px; height: 16px; transition: transform .25s; }
.drawer__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.drawer__sub { display: none; background: rgba(0,0,0,.12); border-top: 0 !important; }
.drawer__sub.open { display: block; }
.drawer__sub a { display: block; padding: 14px 28px 14px 44px; color: #dcecf7; text-decoration: none; font-size: 16px; }

/* ---------- Hero: the family's river, faded, with slow life in it ---------- */
.hero { position: relative; min-height: min(92vh, 900px); display: grid; align-items: start; justify-items: center; overflow: hidden; isolation: isolate; background: #cfeaf8; }
.hero__photo {
  position: absolute; inset: -2%; z-index: -4;
  background: url("/assets/hero/river-wide.jpg") center 58% / cover no-repeat;
  background-image: image-set(url("/assets/hero/river-wide.webp") type("image/webp"), url("/assets/hero/river-wide.jpg") type("image/jpeg"));
  animation: breathe 48s ease-in-out infinite alternate;
}
/* The river and the cascade flowing: a rippled copy of the photo, masked to the water only */
.hero__defs { position: absolute; width: 0; height: 0; }
.hero__flow { position: absolute; inset: 0; pointer-events: none; }
.hero__flow {
  background: inherit; animation: none;
  filter: url(#tw-flow);
  -webkit-mask-image: radial-gradient(ellipse 24% 24% at 53% 92%, #000 50%, transparent 100%);
          mask-image: radial-gradient(ellipse 24% 24% at 53% 92%, #000 50%, transparent 100%);
}
.hero.is-away .hero__flow { filter: none; }

/* The fade the family asked for: near-white sky behind the name, the river showing through below */
.hero__veil {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 60% 42% at 50% 28%, rgba(255,255,255,.72), rgba(255,255,255,0) 72%),
    linear-gradient(to bottom, rgba(255,255,255,.82) 0%, rgba(255,255,255,.55) 34%, rgba(255,255,255,.18) 60%, rgba(255,255,255,0) 80%, rgba(255,255,255,0) 94%, rgba(255,255,255,.85) 100%);
}
.hero__birds { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.bird { position: absolute; left: -60px; width: 26px; height: 12px; color: #2f5d7c; opacity: .55; animation: fly linear infinite; }
.bird svg { width: 100%; height: 100%; animation: flap .9s ease-in-out infinite alternate; transform-origin: 50% 60%; }
.bird:nth-child(1) { top: 14%; animation-duration: 46s; animation-delay: -6s; }
.bird:nth-child(2) { top: 17%; width: 20px; animation-duration: 52s; animation-delay: -9s; }
.bird:nth-child(3) { top: 11%; width: 16px; animation-duration: 58s; animation-delay: -14s; opacity: .4; }
.bird:nth-child(4) { top: 22%; width: 22px; animation-duration: 64s; animation-delay: -38s; }
.bird:nth-child(5) { top: 19%; width: 14px; animation-duration: 70s; animation-delay: -44s; opacity: .35; }
.bird:nth-child(2) svg { animation-duration: .75s; } .bird:nth-child(4) svg { animation-duration: 1.05s; }
@keyframes fly { from { transform: translate(0, 0); } 50% { transform: translate(55vw, -18px); } to { transform: translate(calc(100vw + 120px), 6px); } }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(.35); } }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.06) translateY(-1%); } }
@media (max-width: 700px) {
  .hero__photo { background-image: image-set(url("/assets/hero/river-tall.webp") type("image/webp"), url("/assets/hero/river-tall.jpg") type("image/jpeg")); background-position: center 60%; }
  .hero__flow { -webkit-mask-image: radial-gradient(ellipse 60% 32% at 50% 86%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 60% 32% at 50% 86%, #000 55%, transparent 100%); }
  .hero__veil { background: linear-gradient(to bottom, rgba(255,255,255,.8) 0%, rgba(255,255,255,.6) 45%, rgba(255,255,255,.5) 62%, rgba(255,255,255,0) 76%, rgba(255,255,255,0) 94%, rgba(255,255,255,.85) 100%); }
}

.hero__content { text-align: center; padding: clamp(28px, 7vh, 80px) 16px 30vh; width: 100%; max-width: 760px; animation: rise 1.4s ease-out both; }
.hero__logo { width: min(640px, 90vw); margin: 0 auto -5%; }
.hero__line { margin: 6px auto 0; max-width: 32ch; font: italic 500 clamp(20px, 2.6vw, 26px)/1.4 var(--serif); color: var(--deep); text-shadow: 0 1px 12px rgba(255,255,255,.9); }
.hero__actions { margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Side-scrolling section, synchronised with vertical scroll ---------- */
.hscroll { position: relative; background: var(--mist); }
.hscroll__sticky { position: sticky; top: var(--hdr, 74px); min-height: calc(100vh - var(--hdr, 74px)); display: flex; flex-direction: column; justify-content: center; padding: 40px 0; overflow: hidden; }
.hscroll__head { margin-bottom: clamp(14px, 3vh, 28px); }
.hscroll__head p:last-child { max-width: 60ch; margin: 0; }
.hscroll__viewport { overflow: hidden; }
.hscroll__track { display: flex; gap: 22px; margin: 0; padding: 6px max(16px, calc((100vw - 1080px) / 2 + 16px)); list-style: none; width: max-content; will-change: translate; }
.stop { position: relative; width: min(78vw, 360px); min-height: min(380px, 46vh); border-radius: 22px; color: var(--snow); display: flex; flex-direction: column; overflow: hidden;
  background: #0b3550 var(--img) center / cover no-repeat; box-shadow: 0 24px 50px rgba(11,53,80,.18); isolation: isolate; }
/* The photo shows clearly at the top and settles into deep water blue behind the words */
.stop::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(11,53,80,.05) 0%, rgba(11,53,80,.25) 38%, rgba(11,53,80,.82) 66%, rgba(8,40,62,.96) 100%); }
.stop__n { position: absolute; top: 18px; right: 22px; font: 600 46px/1 var(--serif); color: rgba(255,255,255,.85); text-shadow: 0 2px 14px rgba(0,0,0,.25); }
.stop__art { margin: 16px 0 0 18px; width: 104px; height: 70px; }
.stop__art svg { width: 100%; height: 100%; display: block; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(6,30,46,.55)) drop-shadow(0 0 8px rgba(6,30,46,.35)); }
.stop__text { margin-top: auto; padding: 0 26px 26px; }
.stop h3 { color: var(--snow); font-size: 28px; margin: 0 0 6px; }
.stop p { margin: 0; color: #e2f1fb; }
.hscroll__progress { height: 3px; border-radius: 3px; background: var(--line); margin-top: clamp(14px, 3vh, 28px); overflow: hidden; }
.hscroll__progress span { display: block; height: 100%; width: 100%; background: var(--river); transform-origin: left; transform: scaleX(0); }
/* Without JS, or with reduced motion: a plain wrapping grid */
.hscroll:not(.is-live) .hscroll__sticky { position: static; min-height: 0; padding: clamp(56px, 9vw, 100px) 0; }
.hscroll:not(.is-live) .hscroll__track { width: auto; flex-wrap: wrap; justify-content: center; padding: 6px 16px; }
.hscroll:not(.is-live) .hscroll__progress { display: none; }

/* ---------- Building blocks ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 26px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 15px var(--sans); text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.btn--primary { background: var(--deep); color: var(--snow); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(11,53,80,.22); }
.btn--river { background: var(--river); color: var(--snow); }
.btn--ghost { background: rgba(255,255,255,.75); color: var(--deep); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: var(--snow); }
.btn[disabled] { opacity: .6; cursor: wait; }

.section { padding: clamp(56px, 9vw, 100px) 0; }
.section--tint { background: var(--mist); }
.section--deep { background: var(--deep); color: #d7e9f5; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.eyebrow { font: 600 13px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--river); margin: 0 0 10px; }
h1, h2 { font-family: var(--serif); font-weight: 600; color: var(--deep); line-height: 1.12; margin: 0 0 18px; }
h1 { font-size: clamp(38px, 5.5vw, 58px); }
h2 { font-size: clamp(32px, 4.4vw, 44px); }
h3 { font: 600 23px/1.25 var(--serif); color: var(--deep); margin: 0 0 8px; }
.lead { font-size: 19px; }
.page-head { background: linear-gradient(to bottom, var(--sky), var(--snow)); padding: clamp(48px, 7vw, 80px) 0 24px; text-align: center; }
.page-head p { color: var(--muted); max-width: 60ch; margin: 0 auto; }

.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; }
.places li { display: flex; gap: 12px; align-items: center; background: var(--snow); border-radius: 14px; padding: 16px 18px; box-shadow: inset 0 3px 0 var(--river), 0 1px 0 var(--line); font-weight: 500; color: var(--deep); }
.places svg { width: 20px; height: 26px; flex: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.card { background: var(--snow); border-radius: 16px; padding: 28px; box-shadow: inset 0 3px 0 var(--river), 0 1px 0 var(--line); }
.card p { margin: 0; }

.hadith { text-align: center; }
.hadith__ar { font: 400 clamp(34px, 5vw, 52px)/1.6 var(--arabic); color: #f1e3c4; margin: 0; }
.hadith__en { font: italic 500 clamp(24px, 3vw, 32px)/1.35 var(--serif); color: var(--snow); margin: 6px 0 10px; }
.hadith__src { font-size: 14px; letter-spacing: .04em; color: var(--spray); margin: 0; }

/* ---------- Forms ---------- */
.form { background: var(--snow); border-radius: 20px; padding: clamp(22px, 4vw, 40px); box-shadow: 0 1px 0 var(--line), 0 20px 50px rgba(11,53,80,.08); }
.form fieldset { border: 0; padding: 0; margin: 0 0 26px; }
.form legend { font: 600 22px var(--serif); color: var(--deep); margin-bottom: 12px; padding: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font: 600 14px var(--sans); color: var(--deep); }
.req { color: var(--gold); }
.field input, .field select, .field textarea {
  font: 400 16px var(--sans); color: var(--ink); padding: 12px 14px; border-radius: 12px; border: 1px solid #c4dcea; background: var(--snow); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--river); box-shadow: 0 0 0 3px rgba(29,159,209,.18); }
.hint { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line); flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 10px 20px; border-radius: 999px; cursor: pointer; font: 600 15px var(--sans); color: var(--ink); }
.seg input:checked + label { background: var(--deep); color: var(--snow); }
.seg input:focus-visible + label { outline: 3px solid var(--river); }
.seg input:disabled + label { opacity: .5; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { padding: 10px 18px; border-radius: 12px; cursor: pointer; font: 600 16px var(--sans); color: var(--deep); background: var(--mist); box-shadow: inset 0 0 0 1px var(--line); }
.chips input:checked + label { background: var(--river); color: var(--snow); box-shadow: none; }
.pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.pay input { position: absolute; opacity: 0; pointer-events: none; }
.pay label { display: block; padding: 16px; border-radius: 14px; cursor: pointer; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; color: var(--deep); }
.pay label small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.pay input:checked + label { box-shadow: inset 0 0 0 2px var(--river); background: var(--snow); }
.hp { position: absolute; left: -9999px; }
.smallprint { margin-top: 18px; font-size: 13px; }
.notice { border-radius: 14px; padding: 18px 20px; background: var(--mist); box-shadow: inset 4px 0 0 var(--river); margin: 18px 0; }
.notice--error { box-shadow: inset 4px 0 0 #b54a3c; background: #fdf3f1; }
.bank { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 10px 0 0; }
.bank dt { color: var(--muted); } .bank dd { margin: 0; font-weight: 600; color: var(--deep); }
[hidden] { display: none !important; }

/* ---------- Announcement and projects ---------- */
.notice-bar { background: var(--deep); color: var(--snow); text-align: center; padding: 10px 16px; font: 500 15px/1.4 var(--sans); }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.project { background: var(--snow); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 0 var(--line), 0 16px 40px rgba(11,53,80,.08); }
.project__cover img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.project__gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 14px; }
.project__gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.project__video { position: relative; margin-top: 14px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--deep); }
.project__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.about-photo { margin: 22px 0 0; }
.about-photo img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 18px; }
.project__body { padding: 20px 22px 24px; }
.project__meta { margin: 0 0 4px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--river); font-weight: 600; }
.project__body p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.footer { background: var(--deep); color: #bcd6e8; padding: 56px 0 32px; }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.footer img { width: 220px; }
.footer h4 { font: 600 13px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--spray); margin: 0 0 12px; }
.footer a { color: #e2eff8; text-decoration: none; display: block; padding: 3px 0; }
.footer a:hover { text-decoration: underline; }
.footer__small { border-top: 1px solid rgba(255,255,255,.12); margin-top: 36px; padding-top: 18px; font-size: 13px; }

@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: inline-grid; place-items: center; }
  .header__logo img { height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .bird, .bird svg, .hero__photo, .hero__content { animation: none !important; }
  .hero__flow { filter: none; }
  .bird { display: none; }
  html { scroll-behavior: auto; }
}
