/* Salama Foundation — site styles. Hand-written; no framework. */
:root {
  --ink: #0B2A3C;
  --ink-soft: #35505F;
  --deep: #071B28;
  --sea: #0F6E7C;
  --leaf: #1F8A4C;
  --sun: #FFB81C;
  --sun-deep: #E9A000;
  --mist: #E9F1F0;
  --paper: #FAFCFB;
  --line: #CCDBD8;
  --danger: #B3261E;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), 100% - var(--gutter) * 2); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 252, 251, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled, .site-header.menu-open { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(11, 42, 60, .5); }
.header-row { display: flex; align-items: center; gap: 12px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-size: 1.25rem; line-height: 1; margin-right: auto; }
.brand img { height: 106px; width: auto; border-radius: 8px; }
.quick { display: none; gap: 2px; margin: 0 8px 0 auto; }
.quick a { padding: 9px 12px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .97rem; white-space: nowrap; transition: background .15s; }
.quick a:hover { background: var(--mist); }
.quick a[aria-current="page"] { background: var(--ink); color: #fff; }
@media (min-width: 1160px) { .quick { display: flex; } .brand { margin-right: 0; } }
.menu-btn { display: inline-flex; align-items: center; gap: 10px; background: none; border: 1.5px solid var(--ink); border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; color: inherit; cursor: pointer; transition: background .15s, color .15s; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--ink); color: #fff; }
.menu-icon { width: 18px; height: 12px; position: relative; display: inline-block; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, top .2s; }
.menu-icon::before { top: 1px; } .menu-icon::after { top: 9px; }
.menu-btn[aria-expanded="true"] .menu-icon::before { top: 5px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon::after { top: 5px; transform: rotate(-45deg); }
.give-btn { background: var(--sun); color: var(--ink); font-weight: 700; text-decoration: none; padding: 11px 22px; border-radius: 999px; transition: background .15s; }
.give-btn:hover { background: var(--sun-deep); }
.give-btn[aria-current="page"] { background: var(--ink); color: var(--sun); }
@media (max-width: 420px) { .brand span { display: none; } }

.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 30px 40px -30px rgba(11, 42, 60, .45); max-height: calc(100vh - 76px); overflow-y: auto; display: none; }
.mega.is-open { display: block; }
.mega-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 36px; padding: 32px 0 44px; }
@media (max-width: 1000px) { .mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mega-grid { grid-template-columns: 1fr; gap: 22px; padding-top: 22px; } }
.mega h2 { font-size: 1.1rem; margin-bottom: 8px; }
.mega h2 a { text-decoration: none; }
.mega h2 a:hover, .mega h2 a[aria-current="page"] { color: var(--sea); }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega li a { display: block; padding: 4px 0; text-decoration: none; color: var(--ink-soft); font-size: .97rem; }
.mega li a:hover { color: var(--sea); text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 28px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .15s, background .15s, color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: var(--sun-deep); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--sea); }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-line-light { border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-line-light:hover { background: #fff; color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---------- Image slots ----------
   Each slot shows a real photo when the file exists, otherwise the artwork behind it. */
.slot { background-size: cover; background-position: center; background-color: var(--sea); margin: 0; position: relative; overflow: hidden; }
.arch { border-radius: 999px 999px var(--radius) var(--radius); aspect-ratio: 4 / 5; }
.frame { border-radius: var(--radius); aspect-ratio: 4 / 3; width: 100%; }
.slot figcaption {
  position: absolute; left: 14px; bottom: 14px; right: 14px;
  background: rgba(7, 27, 40, .78); color: #fff; backdrop-filter: blur(6px);
  padding: 10px 14px; border-radius: 10px; font-size: .9rem; line-height: 1.35;
}

/* ---------- Pulse line (the one motif) ---------- */
.pulse { width: 100%; height: 56px; overflow: visible; }
.pulse path { fill: none; stroke: var(--sea); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pulse-sun path { stroke: var(--sun); }
.pulse-draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s .25s cubic-bezier(.6, .1, .2, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Home hero ---------- */
.hero { padding: clamp(36px, 6vw, 84px) 0 clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 5.4rem); line-height: 1.02; letter-spacing: -0.025em; max-width: 14ch; }
.hero .lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 36em; margin: 26px 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero .pulse { margin-top: 44px; max-width: 560px; }
.hero .slot { width: 100%; max-width: 460px; justify-self: end; aspect-ratio: 5 / 6; background-position: 60% center; box-shadow: 0 30px 60px -30px rgba(11, 42, 60, .55); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero .slot { justify-self: start; max-width: 360px; order: -1; aspect-ratio: 5 / 4; border-radius: var(--radius); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section-mist { background: var(--mist); }
.section-dark { background: var(--deep); color: #fff; }
.section-dark .muted { color: #B9CDD3; }
.muted { color: var(--ink-soft); }
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.split-even { grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 860px) { .split, .split-even { grid-template-columns: 1fr; } }
.h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.prose { max-width: 62ch; }
.sticky-head { position: sticky; top: 108px; }
@media (max-width: 860px) { .sticky-head { position: static; } }
.sticky-head p { margin-top: 18px; color: var(--ink-soft); }

/* Service rows */
.rows { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.rows li { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 12px 32px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.rows h3 { font-size: 1.45rem; }
.rows p { margin: 0; color: var(--ink-soft); }
@media (max-width: 640px) { .rows li { grid-template-columns: 1fr; padding: 22px 0; } }

/* Quote band */
.quote { font-family: var(--serif); font-size: clamp(1.7rem, 3.6vw, 2.8rem); line-height: 1.2; letter-spacing: -0.01em; max-width: 22em; }

/* Gift columns */
.gift { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: 48px; }
.gift > div { border-top: 4px solid var(--leaf); padding-top: 20px; }
.gift > div:nth-child(2) { border-top-color: var(--sea); }
.gift > div:nth-child(3) { border-top-color: var(--sun); }
.gift h3 { font-size: 1.5rem; margin-bottom: 8px; }
.gift p { color: var(--ink-soft); margin: 0; }
@media (max-width: 760px) { .gift { grid-template-columns: 1fr; gap: 28px; } }

/* Founder */
.portrait { aspect-ratio: 4 / 5; border-radius: var(--radius); background-position: center top; }
.link-arrow { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--sun); }
.link-arrow:hover { text-decoration-color: var(--sea); }

/* CTA band */
.cta { background: var(--ink); color: #fff; padding: clamp(56px, 8vw, 96px) 0; overflow: hidden; }
.cta h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); max-width: 18ch; }
.cta .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.cta .pulse { margin-bottom: 36px; }

/* ---------- Inner page header ---------- */
.page-head { padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 48px); }
.page-head h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); letter-spacing: -0.02em; max-width: 16ch; }
.page-head .lead { font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: var(--ink-soft); max-width: 40em; margin-top: 22px; }
.page-head .pulse { margin-top: 36px; max-width: 420px; }

/* Programs */
.program { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 88px); align-items: center; padding: clamp(36px, 5vw, 64px) 0; border-top: 1px solid var(--line); }
.program:nth-child(even) .slot { order: 2; }
.program .slot { aspect-ratio: 4 / 3; }
.program h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); margin-bottom: 14px; }
.program ul { padding-left: 1.1em; margin: 16px 0 0; color: var(--ink-soft); }
.program li { margin-bottom: 6px; }
@media (max-width: 860px) { .program { grid-template-columns: 1fr; } .program:nth-child(even) .slot { order: 0; } }

/* About */
.vm { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); }
.vm h2 { font-size: 1.9rem; margin-bottom: 12px; }
.vm > div { border-top: 4px solid var(--sea); padding-top: 22px; }
.vm > div + div { border-top-color: var(--sun); }
@media (max-width: 760px) { .vm { grid-template-columns: 1fr; } }
.focus { list-style: none; padding: 0; margin: 24px 0; border-left: 4px solid var(--leaf); }
.focus li { padding: 4px 0 14px 20px; }
.focus strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.25rem; }

/* Donate */
.give-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 4vw, 40px); box-shadow: 0 30px 60px -40px rgba(11, 42, 60, .45); }
.give-card h2 { font-size: 1.7rem; margin-bottom: 18px; }
.seg { display: inline-grid; grid-auto-flow: column; background: var(--mist); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 22px; border-radius: 999px; font-weight: 600; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--sea); outline-offset: 2px; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.amounts label { cursor: pointer; }
.amounts input { position: absolute; opacity: 0; pointer-events: none; }
.amounts span { display: block; text-align: center; padding: 14px 0; border: 2px solid var(--line); border-radius: 12px; font-weight: 700; font-size: 1.1rem; transition: border-color .15s, background .15s; }
.amounts label:hover span { border-color: var(--sea); }
.amounts input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.amounts input:focus-visible + span { outline: 3px solid var(--sea); outline-offset: 2px; }
.custom-amt { position: relative; margin-bottom: 22px; }
.custom-amt b { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-weight: 700; }
.custom-amt input { padding-left: 34px; }
.note { font-size: .95rem; color: var(--ink-soft); border-left: 4px solid var(--sun); padding: 4px 0 4px 16px; margin: 28px 0 0; }
.ways { list-style: none; margin: 24px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.ways li { padding: 16px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.ways span { display: block; font-weight: 400; color: var(--ink-soft); font-size: .98rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; gap: 0; } }
label.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
.req { color: var(--danger); }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1.5px solid #9FB6B3; border-radius: 12px; padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 170px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--sea); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px rgba(15, 110, 124, .18); }
.is-invalid { border-color: var(--danger) !important; }
.err { color: var(--danger); font-size: .92rem; margin-top: 6px; min-height: 0; }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { margin-top: 20px; padding: 16px 18px; border-radius: 12px; display: none; }
.status.is-ok { display: block; background: #E3F4E9; border: 1px solid #9ED3B0; color: #0F4D26; }
.status.is-bad { display: block; background: #FCE9E7; border: 1px solid #E8A9A4; color: #7A1B15; }
.status a { font-weight: 700; }
.fine { font-size: .9rem; color: var(--ink-soft); margin-top: 14px; }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(28px, 6vw, 88px); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.info { background: var(--ink); color: #fff; border-radius: 22px; padding: clamp(24px, 3vw, 36px); }
.info h2 { font-size: 1.6rem; margin-bottom: 20px; }
.info dl { margin: 0; }
.info dt { font-weight: 700; color: var(--sun); margin-top: 18px; font-size: .95rem; }
.info dd { margin: 2px 0 0; }
.info a { text-decoration-color: var(--sun); text-underline-offset: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--deep); color: #D5E3E7; padding: clamp(48px, 6vw, 80px) 0 28px; }
.foot-grid { display: grid; grid-template-columns: 1.3fr .7fr .7fr 1fr; gap: clamp(28px, 5vw, 72px); }
@media (max-width: 960px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: 1.15rem; color: #fff; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--sun); text-decoration: underline; }
.foot-brand { font-family: var(--serif); font-size: 1.5rem; color: #fff; margin-bottom: 12px; }
.legal { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .9rem; color: #9FB7BE; }

/* 404 */
.lost { min-height: 60vh; display: grid; align-content: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse-draw path { animation: none; stroke-dashoffset: 0; }
  .btn:hover { transform: none; }
}

/* ---------- Doc layout (pages with sub-sections) ---------- */
.doc { display: grid; grid-template-columns: minmax(220px, .34fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.toc { position: sticky; top: 108px; }
.toc h2 { font-family: var(--sans); font-weight: 700; font-size: 1rem; margin-bottom: 12px; letter-spacing: 0; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--ink-soft); font-size: .98rem; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.is-current { border-left-color: var(--sea); color: var(--ink); font-weight: 600; }
.doc-sec { scroll-margin-top: 100px; padding-bottom: clamp(32px, 5vw, 56px); margin-bottom: clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.doc-sec:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.doc-sec h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 14px; }
.doc-sec p, .doc-sec ul { max-width: 62ch; }
.doc-sec ul { padding-left: 1.2em; color: var(--ink-soft); }
.doc-sec li { margin-bottom: 6px; }
.doc-sec .slot { margin: 24px 0; aspect-ratio: 2 / 1; }
.doc-sec .btn { margin-top: 8px; }
@media (max-width: 860px) {
  .doc { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ul { border-left: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .toc a { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; margin: 0; font-size: .92rem; }
  .toc a.is-current { border-color: var(--sea); }
}
.pending { background: var(--mist); border-left: 4px solid var(--sun); padding: 14px 18px; border-radius: 0 12px 12px 0; max-width: 62ch; color: var(--ink-soft); }
.empty { border: 2px dashed #9FB6B3; border-radius: 18px; padding: clamp(24px, 4vw, 44px); max-width: 640px; }
.empty h2 { font-size: 1.7rem; margin-bottom: 10px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.inline-form input { flex: 1 1 240px; width: auto; }
.rows a { text-decoration: none; }
.rows a:hover { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.involve { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: 40px; }
.involve > div { border-top: 4px solid var(--leaf); padding-top: 18px; }
.involve > div:nth-child(2) { border-top-color: var(--sea); }
.involve > div:nth-child(3) { border-top-color: var(--sun); }
.involve h3 { font-size: 1.45rem; margin-bottom: 8px; }
.involve p { color: var(--ink-soft); }
@media (max-width: 760px) { .involve { grid-template-columns: 1fr; gap: 28px; } }
.feature-img { aspect-ratio: 2.1 / 1; border-radius: 22px; background-position: center 30%; }
.fund { margin-bottom: 18px; }
.doc-sec .slot.portrait { aspect-ratio: 4 / 5; }

.callout { font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.65rem); line-height: 1.3; max-width: 34em; border-left: 4px solid var(--sun); padding: 6px 0 6px 22px; margin: 22px 0; color: var(--ink); }
.sub { font-size: 1.35rem; margin: 28px 0 8px; }
.sub:first-child { margin-top: 0; }
.values { list-style: none; padding: 0 !important; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; max-width: none !important; }
.values li { margin: 0; padding: 10px 20px; border: 1.5px solid var(--ink); border-radius: 999px; font-weight: 600; color: var(--ink); }
.section-mist .callout, .doc-sec .callout { margin-left: 0; }
