/* ==========================================================================
   HARBORLIGHT — charity & fundraising template
   Palette: deep pine ground, ember accent for giving, warm sand neutrals.
   Type: Fraunces (display, optical-size aware) + Public Sans (text) — both OFL.
   ========================================================================== */

:root {
  /* neutrals biased warm-green, never pure grey */
  --sand-50:  #faf7f2;
  --sand-100: #f3ede3;
  --sand-200: #e6ddcd;
  --sand-400: #a89e8c;
  --ink-700:  #2f3a34;
  --ink-900:  #16201b;

  /* brand */
  --pine-900: #0e2a22;
  --pine-700: #17453a;
  --pine-500: #276b58;
  --pine-100: #d8e7e0;

  /* ember = giving actions only */
  --ember-600: #c4471f;
  --ember-500: #e35c2b;
  --ember-100: #fbe3d8;

  --line: color-mix(in oklab, var(--ink-900) 12%, transparent);
  --shadow-sm: 0 1px 2px rgba(14, 42, 34, .06), 0 4px 12px rgba(14, 42, 34, .05);
  --shadow-lg: 0 24px 60px rgba(14, 42, 34, .16);

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

  /* type scale (1.25) */
  --step--1: clamp(.83rem, .8rem + .15vw, .92rem);
  --step-0:  clamp(1rem, .96rem + .2vw, 1.08rem);
  --step-1:  clamp(1.25rem, 1.15rem + .5vw, 1.5rem);
  --step-2:  clamp(1.6rem, 1.4rem + 1vw, 2.1rem);
  --step-3:  clamp(2.1rem, 1.7rem + 2vw, 3.1rem);
  --step-4:  clamp(2.7rem, 2rem + 3.4vw, 4.6rem);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--sand-50);
  color: var(--ink-700);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--pine-700); text-underline-offset: 3px; }
h1, h2, h3, h4 {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  color: var(--ink-900);
  line-height: 1.08;
  letter-spacing: -.015em;
  text-wrap: balance;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: var(--step-4); font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 120; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p  { margin: 0 0 1.1em; max-width: 68ch; }
:focus-visible { outline: 3px solid var(--ember-500); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.eyebrow {
  font-size: var(--step--1); font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--pine-500); margin: 0 0 .9rem;
}
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-700); }
.section { padding: clamp(3.5rem, 7vw, 7rem) 0; }
.section--tint { background: var(--sand-100); }
.section--deep { background: var(--pine-900); color: var(--sand-100); }
.section--deep h2, .section--deep h3 { color: #fff; }
.section--deep .eyebrow { color: #8fd3ba; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.5rem; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: var(--step-0); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--give { background: var(--ember-500); color: #fff; box-shadow: var(--shadow-sm); }
.btn--give:hover { background: var(--ember-600); }
.btn--ghost { border-color: var(--line); color: var(--ink-900); background: transparent; }
.btn--ghost:hover { border-color: var(--pine-500); }
.btn--onDark { background: #fff; color: var(--pine-900); }
.btn--lg { padding: 1.05rem 2rem; font-size: var(--step-1); }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--sand-50) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__bar { display: flex; align-items: center; gap: 1.5rem; padding: .9rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--ink-900); text-decoration: none; letter-spacing: -.01em; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.nav { display: flex; gap: 1.6rem; margin-left: auto; }
.nav a { color: var(--ink-700); text-decoration: none; font-weight: 600; font-size: var(--step--1); }
.nav a:hover { color: var(--pine-700); }
.header .btn { flex: none; }
.navToggle { display: none; background: none; border: 0; padding: .4rem; margin-left: auto; }
@media (max-width: 860px) {
  .nav { position: absolute; inset: 100% 0 auto; flex-direction: column; gap: 0;
    background: var(--sand-50); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1.25rem; display: none; }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .navToggle { display: block; }
  .header__bar .btn--give { margin-left: .5rem; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(3rem, 6vw, 6rem); overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto -10% -40% 55%; height: 70%;
  background: radial-gradient(60% 60% at 50% 50%, var(--pine-100), transparent 70%);
  opacity: .6; pointer-events: none;
}
.hero__grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: 1.05fr .95fr; align-items: center; }
@media (max-width: 960px) { .hero__grid { grid-template-columns: 1fr; } }
.hero__photo { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4/3; background: var(--pine-100); }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.hero__badge {
  position: absolute; left: 1rem; bottom: 1rem; background: #fff; border-radius: var(--radius);
  padding: .8rem 1.05rem; box-shadow: var(--shadow-sm); font-size: var(--step--1); font-weight: 600;
}
.hero__badge strong { display: block; font-size: var(--step-1); font-family: Fraunces, serif; color: var(--pine-700); }

/* quick-give card */
.give {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem); box-shadow: var(--shadow-sm);
}
.give__toggle { display: inline-flex; background: var(--sand-100); border-radius: 999px; padding: 4px; margin-bottom: 1rem; }
.give__toggle button {
  border: 0; background: none; border-radius: 999px; padding: .5rem 1.1rem;
  font: inherit; font-weight: 700; font-size: var(--step--1); color: var(--ink-700); cursor: pointer;
}
.give__toggle button[aria-pressed="true"] { background: #fff; color: var(--pine-900); box-shadow: var(--shadow-sm); }
.give__amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-bottom: .8rem; }
.amount {
  border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius);
  padding: .8rem .4rem; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink-900);
  transition: border-color .15s, background-color .15s;
}
.amount:hover { border-color: var(--pine-500); }
.amount[aria-pressed="true"] { border-color: var(--ember-500); background: var(--ember-100); }
.amount small { display: block; font-weight: 500; font-size: .72em; color: var(--sand-400); margin-top: .15rem; }
.give__custom { display: flex; align-items: center; gap: .5rem; border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: .55rem .8rem; margin-bottom: 1rem; }
.give__custom span { font-weight: 700; color: var(--sand-400); }
.give__custom input { border: 0; font: inherit; font-weight: 700; width: 100%; background: none; color: var(--ink-900); }
.give__custom input:focus { outline: none; }
.give__impact { font-size: var(--step--1); color: var(--ink-700); background: var(--sand-100);
  border-radius: var(--radius); padding: .7rem .9rem; margin-top: .9rem; }
.give .btn { width: 100%; justify-content: center; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stat { background: var(--sand-50); padding: clamp(1.2rem, 3vw, 2rem); }
.section--deep .stat { background: var(--pine-700); }
.stat__num { font-family: Fraunces, serif; font-size: var(--step-3); color: var(--pine-700); line-height: 1; font-variant-numeric: tabular-nums; }
.section--deep .stat__num { color: #fff; }
.stat__label { font-size: var(--step--1); color: var(--sand-400); margin-top: .45rem; }
.section--deep .stat__label { color: var(--pine-100); }

/* ---------- campaigns ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.card__media { aspect-ratio: 16/10; background: var(--pine-100); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.35rem; display: flex; flex-direction: column; flex: 1; }
.tag { align-self: flex-start; font-size: var(--step--1); font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--pine-700); background: var(--pine-100); border-radius: 999px; padding: .25rem .7rem; margin-bottom: .8rem; }
.card p { margin-bottom: 1.1rem; }
.progress { margin-top: auto; }
.progress__bar { height: 9px; border-radius: 999px; background: var(--sand-200); overflow: hidden; }
.progress__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pine-500), var(--ember-500)); }
.progress__meta { display: flex; justify-content: space-between; font-size: var(--step--1); font-weight: 700; margin-top: .55rem; }
.progress__meta span:last-child { color: var(--sand-400); font-weight: 600; }

/* ---------- story / split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.split__media { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 5/4; box-shadow: var(--shadow-lg); background: var(--pine-100); }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
.quote { border-left: 3px solid var(--ember-500); padding-left: 1.2rem; font-family: Fraunces, serif;
  font-size: var(--step-1); line-height: 1.45; color: var(--ink-900); margin: 1.5rem 0; }
.quote cite { display: block; font-family: "Public Sans", sans-serif; font-size: var(--step--1);
  font-style: normal; color: var(--sand-400); margin-top: .7rem; font-weight: 600; }

/* ---------- events ---------- */
.event { display: grid; grid-template-columns: 88px 1fr auto; gap: 1.25rem; align-items: center;
  padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.event__date { text-align: center; background: var(--pine-100); border-radius: var(--radius); padding: .6rem .3rem; }
.event__date .m { display: block; font-size: var(--step--1); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pine-700); }
.event__date .d { display: block; font-family: Fraunces, serif; font-size: var(--step-2); line-height: 1; color: var(--pine-900); }
.event h3 { margin-bottom: .2rem; }
.event__meta { font-size: var(--step--1); color: var(--sand-400); }
@media (max-width: 700px) { .event { grid-template-columns: 72px 1fr; } .event > .btn { grid-column: 2; justify-self: start; } }

/* ---------- transparency bars ---------- */
.allocation { display: grid; gap: 1rem; }
.alloc__row { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; }
.alloc__track { grid-column: 1 / -1; height: 10px; background: rgba(255,255,255,.16); border-radius: 999px; overflow: hidden; }
.alloc__fill { height: 100%; background: #8fd3ba; border-radius: 999px; }
.alloc__row strong { font-variant-numeric: tabular-nums; }

/* ---------- newsletter ---------- */
.signup { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.signup input {
  flex: 1 1 240px; padding: .9rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line);
  font: inherit; background: #fff; color: var(--ink-900);
}
.signup input:focus { outline: none; border-color: var(--pine-500); }

/* ---------- footer ---------- */
.footer { background: var(--pine-900); color: var(--pine-100); padding: clamp(3rem, 6vw, 4.5rem) 0 2rem; }
.footer a { color: var(--pine-100); text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 820px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
.footer h4 { color: #fff; font-family: "Public Sans", sans-serif; font-size: var(--step--1);
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: .9rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: var(--step--1); }
.footer__legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: var(--step--1); color: #9dbdb0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 1.25rem; }
.modal[data-open="true"] { display: grid; }
.modal__scrim { position: absolute; inset: 0; background: rgba(14, 42, 34, .55); backdrop-filter: blur(3px); }
.modal__panel { position: relative; background: var(--sand-50); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem); width: min(100%, 460px); box-shadow: var(--shadow-lg); }
.modal__close { position: absolute; top: .8rem; right: .8rem; background: none; border: 0; cursor: pointer; font-size: 1.4rem; color: var(--sand-400); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
