/* Project Midad (مداد): one-page site. Ink and gold: midad is the scholar's ink. */
:root {
  --ink: #0f1a2b;
  --ink-2: #16243a;
  --ink-3: #213453;
  --gold: #c9a227;
  --gold-deep: #a8851a;
  --gold-soft: #f3e7bf;
  --parchment: #f7f2e8;
  --paper: #fffdf8;
  --text: #1c2433;
  --muted: #5b6474;
  --line: #e6dccb;
  --teal: #1f6f6b;
  --red: #b4362a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 26, 43, .08);
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --arabic: 'Aref Ruqaa', 'Amiri', 'Traditional Arabic', serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--body); color: var(--text); background: var(--paper); line-height: 1.65; font-size: 16.5px; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--teal); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; color: var(--ink); margin: 0 0 .5em; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { width: min(1140px, 100%); margin: 0 auto; padding-inline: 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1.5px solid transparent; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; white-space: nowrap; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 6px 18px rgba(201, 162, 39, .35); }
.btn-gold:hover { background: #d8b23a; transform: translateY(-1px); }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: #fff; }
.btn-outline { color: var(--ink); border-color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(15, 26, 43, .96); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(201, 162, 39, .25); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-ar { font-family: var(--arabic); font-size: 2rem; color: var(--gold); line-height: 1; transform: translateY(-2px); }
.brand-en { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: .01em; }
.brand-en span { color: rgba(255, 255, 255, .7); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { color: rgba(255, 255, 255, .82); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .93rem; font-weight: 500; }
.nav a:not(.btn):hover, .nav a.active { color: #fff; background: rgba(255, 255, 255, .07); }
.nav a.active { box-shadow: inset 0 -2px 0 var(--gold); border-radius: 8px 8px 0 0; }
.nav-cta { margin-left: 8px; }
.menu-btn { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; }
.menu-btn span { display: block; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 920px) {
  .menu-btn { display: block; }
  .nav { position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 20px 22px; background: var(--ink); border-bottom: 1px solid rgba(201, 162, 39, .25); transform: translateY(-120%); transition: transform .25s ease; visibility: hidden; }
  .nav.open { transform: none; visibility: visible; }
  .nav a:not(.btn) { padding: 12px; font-size: 1rem; }
  .nav a.active { box-shadow: inset 3px 0 0 var(--gold); border-radius: 8px; }
  .nav-cta { margin: 10px 0 0; }
}

/* Hero */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 85% -10%, #2a426a 0%, transparent 60%), linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 55%, #0b1422 100%); color: #e9edf5; padding: clamp(72px, 12vw, 140px) 0 clamp(64px, 10vw, 120px); }
.hero-ink { position: absolute; inset: 0; background:
  radial-gradient(circle at 12% 80%, rgba(201, 162, 39, .14) 0, transparent 28%),
  radial-gradient(circle at 92% 70%, rgba(31, 111, 107, .22) 0, transparent 30%); pointer-events: none; }
.hero-inner { position: relative; max-width: 980px; }
.badge { display: inline-block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--gold); border: 1px solid rgba(201, 162, 39, .5); padding: 6px 14px; border-radius: 999px; margin-bottom: 22px; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5.4vw, 3.9rem); font-weight: 600; max-width: 18ch; margin-bottom: 22px; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: rgba(233, 237, 245, .86); max-width: 62ch; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-ar { position: absolute; right: 20px; bottom: -60px; font-family: var(--arabic); font-size: clamp(7rem, 20vw, 15rem); color: rgba(201, 162, 39, .09); margin: 0; line-height: 1; pointer-events: none; user-select: none; }

/* Sections */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section-parchment { background: var(--parchment); }
.section-ink { background: var(--ink); color: #dfe5ef; }
.section-ink h2, .section-ink h3 { color: #fff; }
.eyebrow { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--teal); margin-bottom: 10px; }
.eyebrow-gold { color: var(--gold); }
.section-lead { max-width: 70ch; color: rgba(223, 229, 239, .82); font-size: 1.06rem; margin-bottom: 36px; }
.name-note { color: var(--muted); max-width: 70ch; margin-bottom: 32px; }
.name-note span { font-family: var(--arabic); color: var(--gold-deep); font-size: 1.3em; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 30px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); min-width: 0; }
.card p:last-child { margin-bottom: 0; }
.card-ink { border-top: 4px solid var(--gold); }
.icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); margin-bottom: 16px; }
.icon svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.purpose { margin-top: 28px; padding: 28px; border-radius: var(--radius); background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%); color: #dfe5ef; }
.purpose h3 { color: var(--gold); }
.purpose p { margin: 0; max-width: 80ch; }

/* Values */
.values { list-style: none; counter-reset: v; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.values li { counter-increment: v; position: relative; padding: 24px 24px 24px 76px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.values li::before { content: counter(v); position: absolute; left: 22px; top: 22px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--gold); font-family: var(--display); font-weight: 700; }
.values p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .values { grid-template-columns: 1fr; } }

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pillar { background: var(--ink-2); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--radius); padding: 24px; transition: border-color .2s, transform .2s; }
.pillar:hover { border-color: rgba(201, 162, 39, .55); transform: translateY(-2px); }
.pillar .num { font-family: var(--display); font-size: 1.6rem; color: var(--gold); font-weight: 700; display: block; margin-bottom: 8px; }
.pillar p { color: rgba(223, 229, 239, .8); margin: 0; font-size: .97rem; }
@media (max-width: 960px) { .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .pillars { grid-template-columns: 1fr; } }
.capital { margin-top: 36px; padding: 26px 28px; border: 1px solid rgba(201, 162, 39, .35); border-radius: var(--radius); }
.capital h3 { color: var(--gold); }
.capital ul { margin: 0; padding-left: 20px; }
.capital li { margin-bottom: 8px; color: rgba(223, 229, 239, .86); }
.capital strong { color: #fff; }

/* Campaign */
.campaign { margin-top: 30px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 4vw, 38px); box-shadow: var(--shadow); }
.campaign-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.urgent { background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; }
.campaign-end { font-size: .9rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.campaign h3 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); margin-bottom: 4px; }
.campaign-sub { color: var(--muted); margin-bottom: 22px; }
.progress { height: 14px; background: #efe8da; border-radius: 999px; overflow: hidden; }
.progress .bar { min-width: 14px; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); border-radius: 999px; }
.progress-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 10px 0 26px; font-variant-numeric: tabular-nums; }
.progress-text span { color: var(--muted); }
.updates { margin-bottom: 26px; }
.update { border-left: 3px solid var(--gold); padding: 4px 0 4px 18px; }
.update p { margin: 0; color: var(--muted); }
.donate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; border-radius: var(--radius); background: var(--parchment); }
.donate p { margin: 0; color: var(--muted); max-width: 52ch; }
.donate-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Quotes */
.quote { margin: 0; background: #fff; border-radius: var(--radius); padding: 30px 28px; border: 1px solid var(--line); position: relative; }
.quote::before { content: "“"; position: absolute; top: -6px; left: 18px; font-family: var(--display); font-size: 5rem; color: var(--gold); opacity: .35; line-height: 1; }
.quote blockquote { margin: 0 0 18px; font-family: var(--display); font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.5; color: var(--ink); position: relative; }
.quote figcaption { font-weight: 600; color: var(--teal); }
.quote figcaption span { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; }

/* Governance */
.table-wrap { overflow-x: auto; margin-top: 28px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.gov { width: 100%; border-collapse: collapse; background: #fff; min-width: 560px; }
.gov th, .gov td { text-align: left; padding: 18px 20px; vertical-align: top; border-bottom: 1px solid var(--line); }
.gov thead th { background: var(--ink); color: #fff; font-family: var(--display); font-weight: 600; font-size: 1rem; }
.gov tbody th { font-family: var(--display); color: var(--ink); font-weight: 600; white-space: nowrap; }
.gov tbody td:nth-child(2) { white-space: nowrap; color: var(--gold-deep); font-weight: 600; }
.gov tbody tr:last-child th, .gov tbody tr:last-child td { border-bottom: 0; }

/* Footer */
.site-footer { background: var(--ink); color: #cfd7e4; padding: 64px 0 24px; }
.site-footer h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: end; }
.footer-ar { font-family: var(--arabic); font-size: 3.4rem; color: var(--gold); margin: 0 0 6px; line-height: 1; }
.contact p { margin: 0 0 14px; display: flex; flex-direction: column; }
.contact span { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.contact a:not(.btn) { color: #fff; font-size: 1.08rem; text-decoration: none; word-break: break-word; }
.contact a:not(.btn):hover { text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 44px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .88rem; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: rgba(255, 255, 255, .7); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.progress-text em { font-style: normal; font-weight: 500; color: var(--muted); }
.progress .bar-56 { width: 5.6%; }
.progress .bar-77 { width: 7.7%; }

/* Phones: the governance table becomes stacked cards (no sideways scrolling). */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; }
  .gov { min-width: 0; }
  .gov thead { display: none; }
  .gov, .gov tbody, .gov tr, .gov th, .gov td { display: block; width: 100%; }
  .gov tr { padding: 20px; border-bottom: 1px solid var(--line); }
  .gov tbody tr:last-child { border-bottom: 0; }
  .gov th, .gov td { padding: 0; border: 0; }
  .gov tbody th { font-size: 1.15rem; white-space: normal; margin-bottom: 4px; }
  .gov tbody td:nth-child(2) { margin-bottom: 10px; }
}
.footer-ar { text-align: left; }

/* Logo (2026-10-28): the official mark + wordmark, white on the dark header/footer. */
.brand { gap: 12px; }
.brand-mark { height: 40px; width: auto; display: block; }
.brand-word { height: 17px; width: auto; display: block; margin-top: 6px; }
.footer-logo { width: 170px; height: auto; display: block; margin-bottom: 18px; }
@media (max-width: 380px) { .brand-mark { height: 34px; } .brand-word { height: 15px; } }
