/* ==========================================================================
   Ismaili Scouts — ismailiscout.com
   Palette anchored on the badge purple (#6d1f9f) with warm gold accents.
   ========================================================================== */

:root {
  --purple: #6d1f9f;
  --purple-deep: #4a1370;
  --purple-ink: #2b0d42;
  --purple-soft: #efe6f7;
  --gold: #c9a227;
  --gold-deep: #a5841a;
  --gold-soft: #f6efd6;
  --cream: #faf7f2;
  --paper: #ffffff;
  --ink: #221a2a;
  --ink-soft: #5b5263;
  --line: #e6dfee;
  --shadow: 0 10px 30px rgba(43, 13, 66, 0.10);
  --shadow-lg: 0 24px 60px rgba(43, 13, 66, 0.18);
  --radius: 14px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
}
img { max-width: 100%; display: block; }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-deep); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--purple-ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }
.lead { font-size: 1.18rem; color: var(--ink-soft); }
.wrap { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--tint { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--purple { background: linear-gradient(160deg, var(--purple-deep), var(--purple)); color: #fff; }
.section--purple h2, .section--purple h3 { color: #fff; }
.section--purple .lead { color: rgba(255,255,255,.82); }
.eyebrow {
  display: inline-block; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-deep); font-weight: 700; margin-bottom: .8rem;
}
.section--purple .eyebrow { color: var(--gold); }
.center { text-align: center; }
.grid { display: grid; gap: 1.6rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.rule { width: 72px; height: 3px; background: var(--gold); border-radius: 2px; margin: 1rem 0 1.6rem; }
.center .rule { margin-inline: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.5rem; border-radius: 999px; font-weight: 700; font-size: .98rem;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--primary { background: var(--gold); color: var(--purple-ink); }
.btn--primary:hover { background: #d9b53a; color: var(--purple-ink); }
.btn--ghost { border-color: rgba(255,255,255,.7); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--outline { border-color: var(--purple); color: var(--purple); }
.btn--outline:hover { background: var(--purple); color: #fff; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 242, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; }
.brand { display: flex; align-items: center; gap: .8rem; color: var(--purple-ink); }
.brand img { width: 44px; height: 44px; }
.brand__name { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; line-height: 1.05; }
.brand__tag { display: block; font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; }
.nav__links { display: flex; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.nav__links a { display: block; padding: .55rem .9rem; border-radius: 8px; font-weight: 600; color: var(--ink); }
.nav__links a:hover, .nav__links a[aria-current="page"] { background: var(--purple-soft); color: var(--purple-deep); }
.nav__toggle { display: none; background: none; border: 0; padding: .4rem; cursor: pointer; color: var(--purple-ink); }
.nav__toggle svg { width: 28px; height: 28px; }
@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 74px; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: .6rem 1.25rem 1rem;
    box-shadow: var(--shadow); display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .8rem .6rem; }
}

/* Hero */
.hero {
  position: relative; color: #fff; min-height: min(82vh, 720px); display: grid; align-items: end;
  background: var(--purple-ink);
  isolation: isolate; overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(43,13,66,.25) 0%, rgba(43,13,66,.55) 45%, rgba(43,13,66,.92) 100%);
}
.hero__inner { padding-block: clamp(4rem, 10vw, 7rem) clamp(3rem, 6vw, 5rem); max-width: 760px; }
.hero h1 { color: #fff; margin-bottom: .6rem; }
.hero .lead { color: rgba(255,255,255,.88); font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 620px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero__credit { position: absolute; right: 1rem; bottom: .6rem; font-size: .7rem; color: rgba(255,255,255,.6); }
.hero__credit a { color: rgba(255,255,255,.75); text-decoration: underline; }

/* Page hero (inner pages) */
.page-hero { background: linear-gradient(160deg, var(--purple-deep), var(--purple)); color: #fff; padding-block: clamp(3rem, 7vw, 5rem); position: relative; overflow: hidden; }
.page-hero h1 { color: #fff; }
.page-hero .lead { color: rgba(255,255,255,.85); max-width: 720px; }
.page-hero::before {
  content: ""; position: absolute; right: -8%; top: -30%; width: 46vw; max-width: 560px; aspect-ratio: 1;
  background: url("../icons/badge.png") center/contain no-repeat; opacity: .07; pointer-events: none;
}

/* Cards */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--purple-soft); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card__body h3 { margin-bottom: .2rem; }
.card__meta { font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; }
.card__body p { color: var(--ink-soft); margin: 0; }
.card__link { margin-top: auto; padding-top: .8rem; font-weight: 700; }

/* Pillars */
.pillar { padding: 1.8rem 1.6rem; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); }
.pillar__icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1rem;
  background: var(--purple-soft); color: var(--purple);
}
.pillar__icon svg { width: 28px; height: 28px; }
.pillar p { color: var(--ink-soft); margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 1.2rem; }
.stat { text-align: center; padding: 1.4rem 1rem; border-radius: var(--radius); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.stat__num { font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.8rem); color: var(--gold); font-weight: 700; line-height: 1; }
.stat__label { font-size: .9rem; color: rgba(255,255,255,.82); margin-top: .4rem; }

/* Split feature */
.split { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.split__media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); position: relative; }
.split__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }
.figcredit { font-size: .74rem; color: var(--ink-soft); margin-top: .5rem; }
.figcredit a { text-decoration: underline; color: var(--ink-soft); }

.portraits { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.portraits .split__media img { aspect-ratio: 3 / 4; }

/* Quote */
.quote { position: relative; padding: 2.2rem 2.2rem 2.2rem 3.4rem; background: var(--paper); border-left: 5px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); font-family: var(--serif); font-size: 1.25rem; color: var(--purple-ink); }
.quote::before { content: "\201C"; position: absolute; left: 1.1rem; top: .6rem; font-size: 3.6rem; color: var(--gold); line-height: 1; }
.quote cite { display: block; font-family: var(--sans); font-style: normal; font-size: .9rem; color: var(--ink-soft); margin-top: .8rem; }

/* Timeline */
.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 1.6rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 2.2rem 1.6rem; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.6rem - 9px); top: .35rem; width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--cream); box-shadow: 0 0 0 2px var(--gold);
}
.timeline__year { font-family: var(--serif); font-size: 1.5rem; color: var(--purple); font-weight: 700; display: block; margin-bottom: .2rem; }
.timeline h3 { font-size: 1.15rem; margin-bottom: .3rem; }
.timeline p { color: var(--ink-soft); margin: 0; }

/* Gallery */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.8rem; }
.chip { border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); padding: .45rem 1rem; border-radius: 999px; font-weight: 600; cursor: pointer; font-size: .92rem; }
.chip:hover { border-color: var(--purple); color: var(--purple); }
.chip.is-active { background: var(--purple); border-color: var(--purple); color: #fff; }
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; background: var(--purple-soft); cursor: zoom-in; border: 0; padding: 0; text-align: left; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tile:hover img { transform: scale(1.05); }
.tile__cap {
  position: absolute; inset: auto 0 0 0; padding: 2.2rem 1rem .9rem; color: #fff; font-size: .92rem; font-weight: 600;
  background: linear-gradient(180deg, transparent, rgba(43,13,66,.85));
}
.tile__cap small { display: block; font-weight: 400; opacity: .8; font-size: .78rem; }
.tile--placeholder { display: grid; place-items: center; color: var(--purple); font-weight: 600; text-align: center; padding: 1.5rem; cursor: default; border: 2px dashed #cdb9e3; }
.tile--placeholder img { width: 56px; height: 56px; object-fit: contain; opacity: .5; margin-bottom: .5rem; }
.empty { text-align: center; color: var(--ink-soft); padding: 3rem 1rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20, 8, 32, .92); display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox__cap { color: #fff; text-align: center; margin-top: 1rem; font-size: .95rem; }
.lightbox__cap small { display: block; opacity: .7; }
.lightbox__close, .lightbox__nav { position: absolute; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; font-size: 1.4rem; display: grid; place-items: center; }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 1rem; } .lightbox__nav--next { right: 1rem; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.22); }

/* Books */
.book { display: grid; grid-template-columns: 120px 1fr; gap: 1.2rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.book__cover { aspect-ratio: 2/3; border-radius: 6px; overflow: hidden; background: linear-gradient(160deg, var(--purple-deep), var(--purple)); display: grid; place-items: center; color: #fff; text-align: center; padding: .6rem; font-family: var(--serif); font-size: .85rem; line-height: 1.25; box-shadow: 0 6px 16px rgba(43,13,66,.25); }
.book__cover img { width: 100%; height: 100%; object-fit: cover; }
.book__body h3 { font-size: 1.15rem; margin-bottom: .15rem; }
.book__author { color: var(--gold-deep); font-weight: 700; font-size: .9rem; margin-bottom: .5rem; }
.book__author a { color: inherit; text-decoration: underline; }
.book__note { font-size: .86rem; color: var(--ink-soft); font-style: italic; margin: -.3rem 0 .6rem; }
.book__body p { color: var(--ink-soft); font-size: .96rem; margin-bottom: .8rem; }
.book__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.tag { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; background: var(--purple-soft); color: var(--purple-deep); padding: .2rem .6rem; border-radius: 999px; font-weight: 700; }
.book__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.book__actions .btn { padding: .5rem 1rem; font-size: .88rem; }
.badge-soon { color: var(--ink-soft); font-size: .85rem; font-style: italic; }
@media (max-width: 480px) { .book { grid-template-columns: 1fr; } .book__cover { max-width: 140px; } }

/* Contact */
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.contact-card dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; }
.contact-card dt { color: var(--gold-deep); font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.contact-card dd { margin: 0; }
.form { display: grid; gap: 1rem; }
.form label { font-weight: 700; font-size: .92rem; display: grid; gap: .35rem; }
.form input, .form textarea, .form select {
  font: inherit; padding: .75rem .9rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); width: 100%;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--purple); border-color: var(--purple); }
.form__row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form__note { font-size: .86rem; color: var(--ink-soft); }

/* CTA band */
.cta { border-radius: 22px; padding: clamp(2rem, 5vw, 3.5rem); background: linear-gradient(135deg, var(--purple-deep), var(--purple) 60%, #8a3bc0); color: #fff; display: grid; gap: 1rem; grid-template-columns: 1fr auto; align-items: center; box-shadow: var(--shadow-lg); }
.cta h2 { color: #fff; margin: 0 0 .3rem; }
.cta p { margin: 0; color: rgba(255,255,255,.85); }
@media (max-width: 720px) { .cta { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--purple-ink); color: rgba(255,255,255,.8); padding-block: 3rem 1.6rem; margin-top: 0; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.footer-grid h4 { color: var(--gold); font-family: var(--sans); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .8rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.2rem; padding-top: 1.2rem; font-size: .84rem; color: rgba(255,255,255,.6); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; }
.footer-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.footer-brand img { width: 46px; height: 46px; }
.footer-brand strong { font-family: var(--serif); font-size: 1.15rem; color: #fff; }

/* Motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Utilities */
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--purple-ink); padding: .6rem 1rem; z-index: 200; }
.skip:focus { left: 1rem; top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-2 { margin-top: 2rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
