/* ==========================================================================
   ICONMA
   Cool white and thin line. The hierarchy comes from scale and weight, one tinted stage with the
   dome drawn large behind the ayah, the mark's base line running on as a horizon, and one deep
   green block at the foot of the page. Read DESIGN.md before changing it.
   ========================================================================== */

:root {
  --bg: #F6F8FC;          /* cool white: a touch cooler than the logo's plain white ground */
  --tint: #E9EFF6;        /* the one tinted band, behind the ayah */
  --paper: #FFFFFF;
  --ink: #063909;         /* the logo's caption green, 12.4:1 on --bg */
  --ink-soft: #2F5E36;    /* 7:1 on --bg */
  --green: #025107;       /* the mark's green */
  --gold: #CA9703;        /* 2.5:1 on --bg: decoration only, never text on light */
  --deep: #014405;        /* the wordmark's green */
  --pale: #F6F8FC;
  --pale-soft: #C9DCCB;
  --gold-lit: #E3B72C;    /* gold that is allowed to carry text on deep green */
  --hair: rgba(2, 81, 7, .22);
  --hair-strong: rgba(2, 81, 7, .4);

  --font: "Jost", system-ui, sans-serif;
  --font-arabic: "Amiri Quran", "Scheherazade New", "Geeza Pro", "Noto Naskh Arabic", serif;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --wrap: 70rem;
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* the logo symbols read these, so any region can recolour them (the footer does) */
  --mk-green: var(--green);
  --mk-gold: var(--gold);
  --wm: #014405;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
svg { display: block; }
address { font-style: normal; }
h2 { font-size: clamp(2.2rem, 1.3rem + 3.2vw, 3.75rem); font-weight: 300; line-height: 1.05; letter-spacing: -.005em; text-wrap: balance; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 3px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(3.5rem, 9vw, 7rem); }

.skip { position: absolute; left: -999px; top: 0; z-index: 20; }
.skip:focus { left: 1rem; top: 1rem; padding: .65rem 1rem; background: var(--paper); color: var(--ink); border-radius: 8px; }

.notice { padding: .7rem var(--gutter); background: var(--green); color: #fff; text-align: center; font-size: 1rem; }

/* ---------- Nav ---------- */

.nav { position: relative; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--hair); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; text-decoration: none; }
.brand__mark { height: 1.9rem; width: auto; aspect-ratio: 589 / 426; }
.brand__word { height: 1.05rem; width: auto; aspect-ratio: 854 / 225; }
.nav__links { display: flex; gap: .1rem; }
.nav__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: .6rem;
  font-size: .95rem; text-decoration: none; border-radius: 999px;
  transition: background-color .2s, color .2s;
}
.nav__links a:hover { background: rgba(2, 81, 7, .08); }
.nav__links a[aria-current="page"] { font-weight: 600; }

/* ---------- Home: hero ---------- */
/* The mark is the largest thing on the page, its base line runs on as a horizon,
   and everything else sits on or below that line. */

.hero {
  position: relative; isolation: isolate; overflow: hidden; text-align: center;
  padding-block: clamp(1.5rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5.5rem);
}
.hero__stage { position: relative; display: grid; justify-items: center; gap: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.25rem, 3vw, 2rem); }
.hero__figure { position: relative; }
.hero__mark { width: min(84vw, 36rem); height: auto; aspect-ratio: 589 / 426; overflow: visible; }
.hero__figure::after {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 97.6%; width: 100vw; height: 1px;
  transform: translate(-50%, -50%); background: var(--hair-strong);
}
.hero__name { display: grid; justify-items: center; gap: 1rem; font-weight: inherit; }
.hero__word { width: min(60vw, 22rem); height: auto; aspect-ratio: 854 / 225; }
.hero__full { font-size: clamp(.82rem, .7rem + .55vw, 1.05rem); font-weight: 400; line-height: 1.2; letter-spacing: .26em; text-transform: uppercase; }
.hero__meta { display: grid; gap: .1rem; font-size: 1rem; font-weight: 500; color: var(--ink-soft); }
@media (min-width: 48rem) {
  .hero__stage { grid-template-columns: 1fr minmax(0, 36rem) 1fr; }
  .hero__figure { grid-column: 2; grid-row: 1; }
  .hero__name { grid-column: 1 / -1; grid-row: 2; }
  /* the two facts sit on the horizon, one at each end of it */
  .hero__meta { display: contents; }
  .hero__meta span { grid-row: 1; align-self: end; margin-bottom: 1rem; }
  .hero__meta span:first-child { grid-column: 1; justify-self: start; }
  .hero__meta span:last-child { grid-column: 3; justify-self: end; }
}

/* the one orchestrated moment: the mark draws itself, then its solid parts fill in */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__mark use { animation: mark-draw 2.6s var(--ease) .15s backwards, mark-fill .9s ease 1.6s backwards; }
}
@keyframes mark-draw {
  from { stroke-dasharray: 1 2; stroke-dashoffset: 1; }
  to   { stroke-dasharray: 1 2; stroke-dashoffset: 0; }
}
@keyframes mark-fill { from { fill-opacity: 0; } to { fill-opacity: 1; } }

/* ---------- Home: ayah ---------- */
/* A tinted stage, the dome drawn large behind the verse, the page's base line at its foot. */

.ayah {
  position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: end;
  min-height: clamp(31rem, 54vw, 38rem); padding-block: 0 clamp(2.75rem, 5.5vw, 4rem);
  background: var(--tint); border-bottom: 1px solid var(--hair-strong);
}
.ayah__arcs { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.ayah__arc { fill: none; vector-effect: non-scaling-stroke; }
.ayah__arc--outer { stroke: var(--hair-strong); stroke-width: 1.5px; }
.ayah__arc--inner { stroke: var(--gold); stroke-width: 2px; }
.ayah__fig { display: grid; justify-items: center; gap: .75rem; text-align: center; }
.ayah__crescent { width: clamp(2.6rem, 6vw, 3.5rem); height: auto; aspect-ratio: 114 / 112; margin-bottom: .5rem; }
.ayah__ar { font-family: var(--font-arabic); font-size: clamp(2.4rem, 1rem + 4.6vw, 4.75rem); font-weight: 400; line-height: 2; }
.ayah__en { max-width: 30ch; font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); line-height: 1.4; text-wrap: balance; }
.ayah__ref { font-size: 1rem; font-weight: 500; color: var(--ink-soft); }

/* ---------- Mission ---------- */
/* The statement is the biggest type below the hero; the label stays put while you read it. */

.mission { padding-block: clamp(4rem, 10vw, 8rem); }
.mission__grid, .stub__grid, .contact__grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
@media (min-width: 56rem) {
  .mission__grid, .stub__grid, .contact__grid { grid-template-columns: minmax(14rem, 1fr) 2fr; align-items: start; }
  .mission__intro { position: sticky; top: 2rem; }
}
.mission__intro p { margin-top: 1rem; max-width: 26ch; font-size: 1.2rem; line-height: 1.45; color: var(--ink-soft); }
.mission__list li { border-top: 1px solid var(--hair); }
.mission__list li:last-child { border-bottom: 1px solid var(--hair); }
.mission__list a {
  display: flex; gap: 1.25rem; align-items: flex-start; padding-block: 1.4rem; text-decoration: none;
  font-size: clamp(1.55rem, 1rem + 2.1vw, 2.75rem); font-weight: 300; line-height: 1.15;
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 2px no-repeat;
  transition: background-size .55s var(--ease), color .2s;
}
.mission__list a:hover { background-size: 100% 2px; color: var(--green); }
/* a small gold arch before each line: the logo's inner arc as a bullet */
.mission__list a::before,
.mission__list--full li::before {
  content: ""; flex: none; width: 1.5rem; height: .75rem; border: 1.5px solid var(--gold); border-bottom: 0; border-radius: 1.5rem 1.5rem 0 0;
}
.mission__list a::before { margin-top: .5em; }
.mission__list--full li { display: flex; gap: 1.25rem; align-items: flex-start; padding-block: 1.6rem; }
.mission__list--full li::before { margin-top: .95rem; }
.mission__list--full p { max-width: 38rem; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 300; line-height: 1.4; }
.mission__more { margin-top: 1.25rem; font-size: 1rem; font-weight: 500; }
.mission__more a, .contact a { display: inline-block; padding-block: .7rem; text-underline-offset: .25em; text-decoration-thickness: .08em; }

/* ---------- Placeholders ---------- */
/* Quiet on purpose: a slim strip, not a section. */

.soon { padding-block: clamp(1.75rem, 4vw, 2.5rem); border-block: 1px solid var(--hair); }
.soon__wrap { display: grid; justify-items: center; }
.soon__text { text-align: center; font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); line-height: 1.35; color: var(--ink-soft); text-wrap: balance; }
.stub { padding-block: clamp(2rem, 5vw, 3.25rem); border-top: 1px solid var(--hair); }
.stub h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
.stub__text { color: var(--ink-soft); }

/* ---------- About: page head ---------- */
/* A very large title standing on a rule. */

.page-head { padding-block: clamp(2rem, 6vw, 4.5rem) 0; border-bottom: 1px solid var(--hair-strong); }
.page-head__stage { display: grid; justify-items: start; gap: .5rem; text-align: left; padding-bottom: 1.4rem; }
.page-head__mark { width: 4rem; height: auto; aspect-ratio: 114 / 112; margin-bottom: .75rem; }
.page-head h1 { font-size: clamp(3.75rem, 1.5rem + 11vw, 9rem); font-weight: 300; line-height: .92; letter-spacing: -.025em; padding-bottom: .1em; /* room for descenders such as the g in "Page" */ }
.page-head p { font-size: 1.05rem; font-weight: 500; color: var(--ink-soft); }

/* ---------- Contact ---------- */
/* The email is the action, so it is the large thing. */

.contact { padding-block: clamp(4rem, 9vw, 7rem); }
.contact__list { display: grid; border-bottom: 1px solid var(--hair); }
.contact__row { display: grid; gap: .25rem; padding-block: 1.4rem; border-top: 1px solid var(--hair); }
.contact__row--email { order: -1; }
.contact__row dt { font-size: .95rem; font-weight: 500; color: var(--ink-soft); }
.contact__row dd { font-size: 1.3rem; line-height: 1.4; }
.contact__row--email a {
  padding-block: .45rem; font-size: clamp(1.8rem, 1rem + 3.4vw, 3.5rem); font-weight: 300; line-height: 1.1; overflow-wrap: anywhere;
  text-decoration: none; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 2px no-repeat; transition: color .2s;
}
.contact__row--email a:hover { color: var(--green); }

/* ---------- Footer ---------- */
/* One deep green block, so the page ends on something solid. */

.footer {
  padding-block: clamp(3rem, 7vw, 5rem); background: var(--deep); color: var(--pale-soft); font-size: .95rem;
  --wm: var(--pale); --mk-green: #B9DBB0; --mk-gold: var(--gold-lit);
}
.footer :focus-visible { outline-color: var(--gold-lit); }
.footer__inner { display: grid; justify-items: center; gap: 1.5rem 3rem; text-align: center; }
.footer__mark { height: clamp(3.25rem, 7vw, 4.75rem); width: auto; aspect-ratio: 589 / 426; }
.footer__legal { max-width: 36rem; font-size: 1rem; line-height: 1.55; }
@media (min-width: 48rem) {
  .footer__inner { grid-template-columns: auto 1fr; justify-items: start; align-items: center; text-align: left; }
}

/* ---------- Lower-section fade ---------- */
/* .pre is added by app.js only, so nothing is hidden without the script. */

[data-reveal] { transition: opacity .9s var(--ease); }
.pre { opacity: 0; }

/* ---------- Small screens ---------- */

@media (max-width: 26rem) {
  .brand { gap: .5rem; }
  .brand__mark { height: 1.7rem; }
  .brand__word { height: .9rem; }
  .nav__links a { padding-inline: .45rem; font-size: .92rem; }
}
