/* ============================================================
   Casa Scolarisation — design system
   Mood: cour d'école casablancaise au matin — lumière blanche,
   tableau vert profond, craie, cartables.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:           oklch(1 0 0);
  --surface:      oklch(0.965 0.008 132);
  --ink:          oklch(0.235 0.018 135);
  --muted:        oklch(0.445 0.02 135);

  /* Brand */
  --green:        oklch(0.43 0.11 133);
  --green-hover:  oklch(0.38 0.105 133);
  --green-deep:   oklch(0.32 0.085 134);
  --green-soft:   oklch(0.94 0.03 133);
  --saffron:      oklch(0.8 0.14 80);
  --saffron-deep: oklch(0.6 0.135 65);
  --saffron-text: oklch(0.55 0.13 65);
  --chalk:        oklch(0.975 0.012 110);
  --chalk-muted:  oklch(0.86 0.025 120);

  /* Type */
  --font-display: "Young Serif", "Georgia", serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;

  --step--1: clamp(0.85rem, 0.81rem + 0.2vw, 0.95rem);
  --step-0:  clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --step-1:  clamp(1.25rem, 1.16rem + 0.45vw, 1.5rem);
  --step-2:  clamp(1.6rem, 1.42rem + 0.85vw, 2.05rem);
  --step-3:  clamp(2rem, 1.7rem + 1.5vw, 2.85rem);
  --step-4:  clamp(2.5rem, 1.95rem + 2.7vw, 4rem);
  --step-5:  clamp(3rem, 2.2rem + 4vw, 5.25rem);

  /* Space */
  --space-section: clamp(5rem, 3.5rem + 7vw, 10rem);
  --space-fold: clamp(3rem, 2rem + 4vw, 6rem);
  --gutter: clamp(1.25rem, 0.8rem + 2.2vw, 2.5rem);
  --content: 1200px;
  --prose: 68ch;

  --radius: 14px;
  --radius-lg: 22px;

  /* z-scale */
  --z-header: 50;
  --z-skip: 100;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--green); text-underline-offset: 0.2em; }
a:hover { color: var(--green-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { text-wrap: pretty; max-width: var(--prose); }

::selection { background: var(--saffron); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--saffron-deep);
  outline-offset: 3px;
  border-radius: 2px;
}
.band :focus-visible, .rib-block :focus-visible,
.site-footer :focus-visible, .skip-link:focus-visible {
  outline-color: var(--chalk);
}

/* ---------- Utilities ---------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--content));
  margin-inline: auto;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: var(--z-skip);
  background: var(--green-deep);
  color: var(--chalk);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  transition: top 0.2s ease-out;
}
.skip-link:focus-visible { top: 1rem; color: var(--chalk); }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: var(--step-0);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease-out, border-color 0.2s ease-out,
    transform 0.15s ease-out;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--green); color: var(--chalk); }
.btn-primary:hover { background: var(--green-hover); color: var(--chalk); }
.btn-chalk { background: var(--chalk); color: var(--green-deep); }
.btn-chalk:hover { background: #fff; color: var(--green-deep); }
.btn-outline {
  border-color: oklch(0.43 0.11 133 / 0.45);
  color: var(--green);
  background: transparent;
}
.btn-outline:hover { border-color: var(--green); background: var(--green-soft); }
.btn-outline-chalk {
  border-color: oklch(0.975 0.012 110 / 0.5);
  color: var(--chalk);
  background: transparent;
}
.btn-outline-chalk:hover { border-color: var(--chalk); color: var(--chalk); background: oklch(1 0 0 / 0.08); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--saffron);
  padding-bottom: 2px;
}
.arrow-link svg { transition: transform 0.2s ease-out; }
.arrow-link:hover svg { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: oklch(1 0 0 / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease-out;
}
.site-header.is-scrolled { border-bottom-color: oklch(0.235 0.018 135 / 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.85rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-star { width: 30px; height: 30px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1.1;
}
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.2rem); }
.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding-block: 0.4rem;
}
.site-nav a:not(.btn):hover { color: var(--green); }
.site-nav a[aria-current="page"]:not(.btn) {
  color: var(--green);
  box-shadow: inset 0 -2px 0 var(--saffron);
}
.site-nav .btn { min-height: 44px; padding-block: 0.5rem; }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.6rem;
  margin: -0.6rem;
  cursor: pointer;
  color: var(--ink);
}
.btn-donate-mobile { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: grid; place-items: center; }
  .btn-donate-mobile {
    display: inline-flex;
    min-height: 44px;
    padding-inline: 1.1rem;
    margin-left: auto;
  }
  .header-inner { gap: 1rem; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid oklch(0.235 0.018 135 / 0.12);
    padding: 0.5rem var(--gutter) 1.25rem;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding-block: 0.85rem; font-size: 1.1rem; }
  .site-nav .btn { margin-top: 0.75rem; }
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-fold) var(--space-section); overflow: clip; }
.hero-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; }
}
.hero h1 { margin-bottom: 1.4rem; max-width: 14ch; }
.hero .lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 2.2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem; }

.chalk-word { position: relative; white-space: nowrap; }
.chalk-word .chalk-stroke {
  position: absolute;
  left: -2%;
  bottom: -0.12em;
  width: 104%;
  height: 0.28em;
  overflow: visible;
  pointer-events: none;
}
.chalk-stroke path {
  fill: none;
  stroke: var(--saffron);
  stroke-width: 7;
  stroke-linecap: round;
}

.hero-figure { position: relative; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
  border-radius: var(--radius-lg);
}
@media (max-width: 879px) {
  .hero-figure img { aspect-ratio: 16 / 11; }
}
.hero-figure .star-badge {
  position: absolute;
  width: clamp(64px, 9vw, 96px);
  height: clamp(64px, 9vw, 96px);
  right: -14px;
  bottom: -18px;
  color: var(--saffron);
  filter: drop-shadow(0 4px 14px oklch(0.235 0.018 135 / 0.18));
}
.hero-figure figcaption {
  margin-top: 0.8rem;
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------- Section scaffolding ---------- */
.section { padding-block: var(--space-section); }
.section-head { max-width: 40ch; margin-bottom: clamp(2.2rem, 4vw, 3.6rem); }
.section-head h2 { margin-bottom: 1rem; }
.section-head p { color: var(--muted); font-size: var(--step-1); line-height: 1.5; }

/* Green drench band */
.band {
  background: var(--green-deep);
  color: var(--chalk);
  padding-block: var(--space-section);
  position: relative;
  isolation: isolate;
}
.band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'%3E%3Cpolygon points='50.0,2.0 59.9,26.0 83.9,16.1 74.0,40.1 98.0,50.0 74.0,59.9 83.9,83.9 59.9,74.0 50.0,98.0 40.1,74.0 16.1,83.9 26.0,59.9 2.0,50.0 26.0,40.1 16.1,16.1 40.1,26.0' fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}
.band h2, .band h3 { color: var(--chalk); }
.band .section-head p { color: var(--chalk-muted); }
.band a:not(.btn) { color: var(--chalk); }
.band p { line-height: 1.72; }

/* Mission list inside band */
.mission-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: clamp(1.8rem, 3vw, 2.6rem);
  max-width: 60ch;
}
.mission-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 1.1rem;
  align-items: start;
}
.mission-list .star { color: var(--saffron); width: 26px; height: 26px; margin-top: 0.35rem; }
.mission-list strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-1);
  margin-bottom: 0.3rem;
}
.mission-list p { color: var(--chalk-muted); }

/* ---------- Split folds ---------- */
.split {
  display: grid;
  gap: clamp(2rem, 4.5vw, 5rem);
  align-items: center;
}
@media (min-width: 880px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split.split-flip > .split-media { order: 2; }
}
.split-media img {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  border-radius: var(--radius-lg);
}
.split-body h2 { margin-bottom: 1.1rem; }
.split-body > p { color: var(--ink); margin-bottom: 1.1rem; }
.split-body .muted { color: var(--muted); }
.band .split-body > p, .band .split-body .muted { color: var(--chalk-muted); }
.split-body .actions { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; }

/* ---------- Zakat panel ---------- */
.zakat-panel {
  background: var(--green-soft);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 4rem);
  display: grid;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
}
@media (min-width: 880px) {
  .zakat-panel { grid-template-columns: 1.2fr 0.8fr; }
}
.zakat-panel h2 { margin-bottom: 1rem; }
.zakat-panel .ar {
  font-size: var(--step-2);
  line-height: 1.4;
  color: var(--green);
  font-family: var(--font-display);
}
.zakat-panel .ar-source { color: var(--muted); font-size: var(--step--1); margin-top: 0.5rem; }

/* ---------- Story / real moments ---------- */
.moments {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
@media (min-width: 880px) {
  .moments { grid-template-columns: 1fr 1fr; }
}
.moment {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.moment img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.moment-body { padding: clamp(1.4rem, 2.5vw, 2.2rem); }
.moment-body h3 { margin-bottom: 0.6rem; font-size: var(--step-2); }
.moment-body p { color: var(--muted); }

/* ---------- Quote ---------- */
.quote {
  max-width: 52ch;
  margin-inline: auto;
  text-align: center;
}
.quote .star { width: 34px; height: 34px; color: var(--saffron); margin: 0 auto 1.6rem; }
.quote blockquote p {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.3;
  color: var(--ink);
  max-width: none;
}
.quote figcaption { margin-top: 1.4rem; color: var(--muted); font-weight: 500; }

/* ---------- RIB block ---------- */
.rib-block {
  background: var(--green-deep);
  color: var(--chalk);
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 3.5vw, 3rem);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.rib-block::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'%3E%3Cpolygon points='50.0,2.0 59.9,26.0 83.9,16.1 74.0,40.1 98.0,50.0 74.0,59.9 83.9,83.9 59.9,74.0 50.0,98.0 40.1,74.0 16.1,83.9 26.0,59.9 2.0,50.0 26.0,40.1 16.1,16.1 40.1,26.0' fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 110px 110px;
}
.rib-block .rib-label {
  color: var(--chalk-muted);
  font-weight: 500;
  margin-bottom: 0.7rem;
}
.rib-number {
  font-weight: 700;
  font-size: clamp(1.15rem, 0.7rem + 2.2vw, 1.9rem);
  letter-spacing: 0.04em;
  word-spacing: 0.35em;
  overflow-wrap: anywhere;
  margin-bottom: 1.4rem;
}
.rib-lede {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.18;
  max-width: 16ch;
  margin-bottom: 1.6rem;
  text-wrap: balance;
}
.rib-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.rib-email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1rem;
  margin-top: 1.4rem;
}
.rib-email {
  user-select: all;
  -webkit-user-select: all;
  font-weight: 700;
  font-size: var(--step-1);
  overflow-wrap: anywhere;
}
.rib-bank { color: var(--chalk-muted); font-size: var(--step--1); margin-top: 1.2rem; }
.page-hero.compact h1 { font-size: var(--step-3); }

.photo-note { color: var(--muted); font-size: var(--step--1); margin-top: 0.8rem; }

/* ---------- Don types ---------- */
.don-types { list-style: none; padding: 0; display: grid; gap: 1px; background: oklch(0.235 0.018 135 / 0.12); border-radius: var(--radius-lg); overflow: hidden; }
.don-type { background: var(--bg); padding: clamp(1.4rem, 2.5vw, 2rem) clamp(1.4rem, 2.5vw, 2.4rem); display: grid; gap: 0.4rem; }
.don-type strong { font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); }
.don-type p { color: var(--muted); }
.don-type .mention { color: var(--saffron-text); font-weight: 700; font-size: var(--step--1); }

/* ---------- Steps (parrainage) ---------- */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: clamp(1.6rem, 3vw, 2.4rem); max-width: 62ch; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; gap: 1.2rem; align-items: start; }
.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-size: 1.5rem;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}
.steps strong { display: block; font-size: var(--step-1); font-family: var(--font-display); font-weight: 400; margin-bottom: 0.3rem; }
.steps p { color: var(--muted); }
.band .steps p { color: var(--chalk-muted); }
.band .steps li::before { background: oklch(1 0 0 / 0.12); color: var(--chalk); }

/* ---------- FAQ ---------- */
.faq { max-width: 70ch; display: grid; gap: 0.8rem; }
.faq details {
  border: 1px solid oklch(0.235 0.018 135 / 0.14);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  background: var(--bg);
}
.faq details[open] { background: var(--surface); }
.faq summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--green);
  flex: none;
  transition: transform 0.2s ease-out;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 0.8rem; color: var(--muted); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: clamp(2rem, 4vw, 4rem); }
@media (min-width: 880px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 3vw, 2.4rem);
}
.contact-card h3 { font-size: var(--step-2); margin-bottom: 0.7rem; }
.contact-card p { color: var(--muted); margin-bottom: 1.3rem; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 22ch; margin-inline: auto; margin-bottom: 1.2rem; }
.cta-band p { max-width: 48ch; margin-inline: auto; color: var(--chalk-muted); margin-bottom: 2.2rem; }
.cta-band .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-block: var(--space-fold); }
.page-hero h1 { max-width: 16ch; margin-bottom: 1.2rem; font-size: var(--step-4); }
.page-hero .lede { font-size: var(--step-1); color: var(--muted); max-width: 52ch; line-height: 1.55; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-deep);
  color: var(--chalk-muted);
  padding-block: var(--space-fold) 2.5rem;
  margin-top: var(--space-section);
  border-top: 2px solid var(--saffron);
}
.band + .site-footer, .cta-band + .site-footer { margin-top: 0; }
.footer-grid {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid oklch(1 0 0 / 0.14);
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer .brand { color: var(--chalk); margin-bottom: 1rem; }
.site-footer .brand-star { color: var(--saffron); }
.site-footer p { font-size: var(--step--1); }
.site-footer h3 {
  color: var(--chalk);
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: 1rem;
}
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 0.65rem; }
.site-footer a { color: var(--chalk-muted); text-decoration: none; }
.site-footer a:hover { color: var(--chalk); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 2rem;
  font-size: var(--step--1);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
