/* ===========================================================
   MARGLIZ FOUNDATION — Design tokens
   Palette pulled directly from the org's own logo: orange +
   blue, on a clean white ground. Green is used sparingly and
   only for the three land/nature-facing focus areas
   (afforestation, agro-ecological agriculture, natural
   resources conservation) — everywhere else stays orange/blue.
   Signature motif: concentric "growth rings" — a tree's
   cross-section — standing in for years of impact since 2017.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,500;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --navy: #0F2A54;        /* deep brand blue — hero / footer bg */
  --navy-soft: #16386B;
  --blue: #1D5FC4;        /* logo blue — secondary accent */
  --blue-light: #EAF1FD;
  --orange: #E8630F;      /* logo orange — primary accent / CTAs */
  --orange-soft: #FDEDE1;
  --green: #2F8B57;       /* sparing accent — land/nature areas only */
  --green-light: #E7F4EC;
  --paper: #FFFFFF;       /* main bg */
  --paper-alt: #F5F8FC;   /* soft blue-tinted alt section bg */
  --ink: #16181D;
  --ink-soft: #57606E;
  --line: #E4E9F0;
  --white: #FFFFFF;

  --font-display: 'Fraunces', serif;
  --font-body: 'Work Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --radius: 14px;
  --container: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}
.eyebrow.on-dark { color: #FFB48A; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--navy);
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: var(--white); box-shadow: 0 8px 20px rgba(232,99,15,0.25); }
.btn-primary:hover { background: #cf560c; box-shadow: 0 10px 24px rgba(232,99,15,0.32); }
.btn-outline { border-color: currentColor; color: inherit; background: transparent; }
.btn-outline.on-dark:hover { background: rgba(255,255,255,0.1); }
.btn-outline.on-light:hover { background: rgba(29,95,196,0.06); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--blue));
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  max-width: var(--container);
  margin: 0 auto;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo img { height: 40px; width: auto; }
.nav-links {
  display: flex;
  gap: 32px;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a { position: relative; padding: 4px 0; color: var(--navy); }
.nav-links a.active,
.nav-links a:hover { color: var(--orange); }
.nav-cta { display: flex; align-items: center; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--navy);
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 16px 28px; border-top: 1px solid var(--line); }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
  padding: 90px 0 110px;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
.hero::before {
  width: 420px; height: 420px;
  background: var(--orange);
  top: -160px; right: -120px;
}
.hero::after {
  width: 360px; height: 360px;
  background: var(--blue);
  bottom: -180px; left: -100px;
  opacity: 0.45;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero h1 { color: var(--white); margin-top: 14px; }
.hero p.lead {
  color: rgba(255,255,255,0.82);
  font-size: 1.1rem;
  max-width: 46ch;
  margin-top: 18px;
}
.hero-ctas { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.hero-ctas .btn-outline { color: var(--white); border-color: rgba(255,255,255,0.5); }

/* Hero photo collage */
.photo-collage {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1.05;
  margin: 0 auto;
}
.photo-collage .photo {
  position: absolute;
  background: var(--paper);
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.4);
}
.photo-collage .frame {
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
}
.photo-collage .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-collage .photo-a {
  width: 76%;
  top: 6%;
  left: 0;
  transform: rotate(-5deg);
  z-index: 1;
}
.photo-collage .photo-b {
  width: 56%;
  bottom: 2%;
  right: 0;
  transform: rotate(4deg);
  z-index: 2;
}
.photo-collage .badge {
  position: absolute;
  top: -6px;
  right: 20%;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  border-radius: 999px;
  transform: rotate(-6deg);
  box-shadow: 0 10px 22px rgba(0,0,0,0.35);
  z-index: 3;
}

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-ctas { justify-content: center; }
  .photo-collage { order: -1; margin-bottom: 12px; }
}

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.bg-canopy { background: var(--navy); color: var(--white); }
.bg-canopy h2, .bg-canopy h3 { color: var(--white); }
.bg-canopy p { color: rgba(255,255,255,0.78); }
.bg-alt { background: var(--paper-alt); }

/* ---------- Focus area cards ---------- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.focus-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.focus-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(15,42,84,0.1); }
.focus-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--orange);
  margin-bottom: 16px;
}
.focus-icon svg { width: 24px; height: 24px; }
.focus-card h3 { margin-bottom: 8px; }
.focus-card p { margin-bottom: 0; font-size: 0.95rem; }
.focus-card.blue { border-top-color: var(--blue); }
.focus-card.blue .focus-icon { background: var(--blue-light); color: var(--blue); }
.focus-card.green { border-top-color: var(--green); }
.focus-card.green .focus-icon { background: var(--green-light); color: var(--green); }

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  text-align: center;
}
.stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: #FFB48A;
}
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.7); }

/* ---------- Cards / generic ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ---------- Objectives list (About) ---------- */
.objectives { display: grid; gap: 18px; }
.objective {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.objective:first-child { border-top: none; }
.objective .mark {
  font-family: var(--font-mono);
  color: var(--orange);
  font-size: 0.85rem;
  padding-top: 4px;
}
.objective h3 { margin-bottom: 6px; font-size: 1.1rem; }
.objective p { margin: 0; font-size: 0.95rem; }

/* ---------- Registration / documents ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}
.doc-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.doc-card .frame {
  aspect-ratio: 3 / 4.24;
  background: var(--paper-alt);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-card .frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.doc-card-body { padding: 18px 20px; }
.doc-card-body h3 { font-size: 1rem; margin-bottom: 4px; }
.doc-card-body p { font-size: 0.88rem; margin: 0; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(15,42,84,0.9);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 24px; right: 28px;
  background: none; border: none; color: var(--white);
  font-size: 2rem; cursor: pointer; line-height: 1;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-info-item {
  display: flex; gap: 14px; margin-bottom: 22px;
}
.contact-info-item .ic {
  width: 40px; height: 40px; flex: none;
  border-radius: 10px;
  background: var(--orange);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.contact-info-item .ic svg { width: 20px; height: 20px; }
.contact-info-item h4 { margin: 0 0 2px; font-family: var(--font-body); font-size: 0.95rem; color: var(--navy); }
.contact-info-item p { margin: 0; font-size: 0.95rem; }

form.contact-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.field input, .field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: 3px solid var(--blue-light);
  border-color: var(--blue);
}
.form-note { font-size: 0.82rem; color: var(--ink-soft); margin-top: -4px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: var(--white); font-family: var(--font-body); font-size: 0.95rem; margin-bottom: 14px; }
.footer-grid a { display: block; padding: 6px 0; font-size: 0.92rem; }
.footer-grid a:hover { color: var(--white); }
.footer-logo { height: 34px; margin-bottom: 14px; filter: brightness(0) invert(1); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding-top: 22px;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  background: var(--navy);
  color: var(--white);
  padding: 72px 0 64px;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: var(--orange);
  filter: blur(70px);
  opacity: 0.3;
  top: -140px; right: -80px;
  pointer-events: none;
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { color: var(--white); margin-top: 12px; }
.page-hero p { color: rgba(255,255,255,0.8); max-width: 60ch; margin-top: 14px; }

.breadcrumb { font-family: var(--font-mono); font-size: 0.78rem; color: #FFB48A; }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--blue));
  z-index: 999;
  transition: width 0.08s linear;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15,42,84,0.28);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
  z-index: 90;
}
.back-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { background: var(--orange); }
.back-to-top svg { width: 20px; height: 20px; }

/* ---------- Tilt-on-hover cards ---------- */
.focus-card, .doc-card, .card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---------- Magnetic buttons ---------- */
.btn-primary { will-change: transform; }

/* ---------- Stat count-up ---------- */
.stat-num { display: inline-block; }

/* ---------- Donate page ---------- */
.donate-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 24px 60px rgba(15,42,84,0.08);
}
.donate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.donate-head h3 { margin-bottom: 2px; }
.donate-sub { font-size: 0.88rem; color: var(--ink-soft); margin: 0; }

.currency-select-wrap {
  position: relative;
  flex: none;
  border-right: 1.5px solid var(--line);
}
.currency-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  background: transparent;
  border: none;
  padding: 12px 26px 12px 16px;
  cursor: pointer;
}
.currency-select:focus { outline: none; }
.currency-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink-soft);
  pointer-events: none;
}

/* ---------- Billing toggle (one-time / monthly) ---------- */
.billing-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--paper-alt);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}
.billing-opt {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.billing-opt.selected {
  background: var(--white);
  color: var(--orange);
  box-shadow: 0 2px 8px rgba(15,42,84,0.1);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.amount-option {
  position: relative;
  padding: 13px 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--navy);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .12s ease;
  text-align: center;
}
.amount-option:hover { border-color: var(--orange); transform: translateY(-1px); }
.amount-option .amt-check {
  display: none;
  width: 13px;
  height: 13px;
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}
.amount-option.selected {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange);
}
.amount-option.selected .amt-check { display: block; }

.custom-amount-field {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding-right: 6px;
  margin-bottom: 6px;
  transition: border-color .15s ease;
}
.custom-amount-field:focus-within { border-color: var(--orange); }
.custom-amount-field input {
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 14px 12px 4px;
  width: 100%;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.rate-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 20px 4px;
}

.donor-details {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}
.donor-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: var(--paper-alt);
  transition: border-color .15s ease, background .15s ease;
}
.donor-field:focus-within { border-color: var(--orange); background: var(--white); }
.donor-field svg { flex: none; width: 17px; height: 17px; color: var(--ink-soft); }
.donor-field input {
  border: none;
  outline: none;
  background: transparent;
  padding: 13px 0;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
}

.donate-submit {
  width: 100%;
  justify-content: center;
  gap: 8px;
}
.donate-submit svg { width: 17px; height: 17px; }

/* ---------- Trust strip ---------- */
.trust-strip-section { padding: 8px 0 64px; }
.trust-strip-label {
  text-align: center;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 720px) { .trust-strip { grid-template-columns: 1fr; } }
.trust-doc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.trust-doc:hover { border-color: var(--orange); box-shadow: 0 12px 24px rgba(15,42,84,0.08); }
.trust-doc img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex: none;
}
.trust-doc span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}
.trust-doc-text { cursor: default; }
.trust-doc-text:hover { border-color: var(--line); box-shadow: none; }
.trust-icon {
  width: 44px; height: 44px; flex: none;
  border-radius: 8px;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
}
.trust-icon svg { width: 22px; height: 22px; color: var(--green); }
.impact-list { display: grid; gap: 16px; margin-top: 24px; }
.impact-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px;
  background: var(--paper-alt);
  border-radius: 12px;
}
.impact-item .num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--orange);
  font-size: 0.85rem;
  flex: none;
  width: 28px;
}
.trust-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 18px;
}
.trust-note svg { width: 16px; height: 16px; flex: none; color: var(--green); }
