/* ==========================================================================
   A Well Watered Garden — site styles
   Design tokens are locked (see README). Change values here, not in the HTML.
   ========================================================================== */

:root {
  /* Colour */
  --blue:        #1C5A80;  /* brand blue: headings, active nav, stat numbers */
  --terracotta:  #B5532E;  /* Donate button, default link colour */
  --cream:       #F7F3EC;  /* header + page background */
  --ink:         #2A2A2A;  /* body text */
  --muted:       #6B6B6B;  /* secondary text, labels */
  --hairline:    #E5E1D8;  /* 1px borders */
  --placeholder-bg:     #E2DCCB;
  --placeholder-stroke: #A89F88;
  --white:       #FFFFFF;

  /* Type */
  --font-head: 'Fustat', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout */
  --gutter: 24px;
  --radius-card: 10px;
  --radius-button: 6px;

  /* Measured at runtime by site.js — drives the content spacer and anchor offsets */
  --header-offset: 150px;
}

/* --------------------------------------------------------------- base --- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
}

a { color: var(--terracotta); }
a:hover { color: var(--blue); }

/* Any anchor target clears the fixed header when jumped to. */
[id] { scroll-margin-top: calc(var(--header-offset) + 16px); }

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

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

/* ------------------------------------------------------------- header --- */

/* Reserves the space the fixed header occupies. Height set by site.js. */
.header-spacer { height: var(--header-offset); }

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 52;
  background: var(--cream);
  padding: 16px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 1px solid var(--hairline);
}

.nav__logo-link { display: flex; align-items: center; text-decoration: none; }
.nav__logo { height: 60px; width: auto; display: block; }

.nav__right {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.nav__links {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
}

.nav__link {
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.nav__link:hover { color: var(--blue); }
.nav__link.is-active { color: var(--blue); font-weight: 600; }

.donate {
  background: var(--terracotta);
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius-button);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.donate:hover { color: var(--white); background: #a04a29; }

.hamburger {
  display: none;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  left: 0; right: 0;
  top: var(--nav-height, 92px);
  z-index: 53;
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
  padding: 8px 16px 4px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}
.mobile-menu.is-open { display: flex; }

.mobile-menu a {
  padding: 14px 4px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
.mobile-menu a:last-child { border-bottom: none; }

/* ---------------------------------------------------------- stats bar --- */

.stats {
  position: fixed;
  left: 0; right: 0;
  top: var(--nav-height, 92px);
  z-index: 51;
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
  padding: 10px var(--gutter);
  transition: transform 0.3s ease;
}
.stats.is-hidden { transform: translateY(-100%); }

.stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 12px;
  padding: 0 var(--gutter);
}

.stat { text-align: center; }

.stat__value {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 600;
  color: var(--blue);
}

.stat__label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------- hero --- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.parallax-bg {
  position: absolute;
  top: -15%;
  left: 0;
  width: 100%;
  height: 130%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 90, 128, 0.6);
}

.hero__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px var(--gutter);
  color: var(--white);
  width: 100%;
}

.hero__title {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
}

.hero__text {
  line-height: 1.7;
  opacity: 0.95;
  max-width: 660px;
}

/* --- Home hero --- */
.hero--home { min-height: 62vh; align-items: flex-end; }
.hero--home .hero__overlay { background: rgba(28, 90, 128, 0.57); }
.hero--home .hero__inner { padding: 48px var(--gutter) 56px; }
.hero--home .hero__title {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 16px;
}
.hero--home .hero__text {
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 18px;
  max-width: 560px;
}
.hero--home .hero__callout {
  font-size: 19px;
  line-height: 1.5;
  opacity: 0.95;
  margin-bottom: 24px;
  max-width: 480px;
  font-weight: 600;
}
.hero__cta {
  display: inline-block;
  background: var(--terracotta);
  color: var(--white);
  padding: 12px 26px;
  border-radius: var(--radius-button);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.hero__cta:hover { color: var(--white); background: #a04a29; }

/* --- Who we are hero --- */
.hero--who { min-height: 480px; }
.hero--who .hero__title {
  font-size: clamp(34px, 5vw, 48px);
  margin-bottom: 18px;
}
.hero--who .hero__text { font-size: 15px; margin-bottom: 16px; }
.hero--who .hero__text:last-child { margin-bottom: 0; }

/* --- What we do hero --- */
.hero--work { min-height: 520px; }
.hero--work .parallax-bg { background-position: center bottom; }
.hero__eyebrow {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  font-weight: 600;
  margin-bottom: 12px;
}
.hero--work .hero__title {
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.3;
  margin-bottom: 24px;
  max-width: 760px;
}
.hero__quote {
  border-left: 3px solid var(--terracotta);
  padding-left: 18px;
  max-width: 560px;
}
.hero__quote p {
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.95;
  font-style: italic;
  margin: 0 0 10px;
}
.hero__quote cite {
  font-size: 14px;
  opacity: 0.85;
  font-style: normal;
}

/* --- Contact hero --- */
.hero--contact { min-height: 560px; }
.hero--contact .hero__title {
  font-size: clamp(26px, 3.5vw, 36px);
  margin-bottom: 16px;
}
.hero--contact .hero__text {
  font-size: 15px;
  line-height: 1.65;
  max-width: 620px;
  margin-bottom: 0;
}
.hero--contact .hero__text + .hero__text { margin-top: 12px; }

/* ------------------------------------------------------------ sections --- */

.section { padding: 44px var(--gutter); }
.section--tight  { padding: 36px var(--gutter) 8px; }
.section--first  { padding: 44px var(--gutter) 8px; }
.section--last   { padding: 36px var(--gutter) 48px; }
.section--join   { padding: 64px var(--gutter); text-align: center; }

.section__heading {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
}
.section__subhead {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 22px;
}

/* --- Home: join our team --- */
.join__heading {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 20px;
}
.join__body {
  max-width: 660px;
  margin: 0 auto;
  text-align: left;
}
.join__body p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 16px;
}
.join__body p:last-child { margin-bottom: 0; }
.join__body a { font-weight: 600; text-decoration: underline; }

/* --- Who we are: placeholder cards --- */
.placeholder-card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 40px var(--gutter);
  text-align: center;
}
.placeholder-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--placeholder-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.placeholder-card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.placeholder-card__note {
  font-size: 13px;
  color: var(--muted);
}

/* --- Contact: email cards --- */
.contact-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.contact-card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 26px;
}
.contact-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 10px;
}
.contact-card__body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 14px;
}
.contact-card a {
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

/* --- What we do: pillars --- */
.pillar-nav {
  padding: 56px var(--gutter) 16px;
  text-align: center;
}
.pillar-nav__heading {
  font-family: var(--font-head);
  font-size: 52px;
  font-weight: 700;
  margin: 0 0 24px;
}
.pillar-nav__pills {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  background: var(--blue);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
}
.pill:hover { color: var(--white); background: #164a6b; }
.pill svg { flex-shrink: 0; }

.pillar {
  background: var(--cream);
  padding: 56px var(--gutter);
  border-top: 1px solid var(--hairline);
  scroll-margin-top: calc(var(--header-offset) + 16px);
}
.pillar:first-of-type { border-top-color: transparent; }

.pillar__inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  padding-left: 36px;
  border-left: 2px solid var(--placeholder-bg);
}
.pillar__marker {
  position: absolute;
  left: -13px;
  top: 0;
  width: 26px;
  height: 26px;
  color: var(--blue); /* the <use> glyph is fill:currentColor */
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pillar__title {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 10px;
}
.pillar__intro {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 10px;
}
.pillar__intro:last-of-type { margin-bottom: 28px; }

/* The "cutout" panel: the tree photo shows through a near-opaque cream wash. */
.cutout {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-top: 24px;
}
.cutout__wash {
  position: absolute;
  inset: 0;
  background: rgba(247, 243, 236, 0.96);
}
.cutout__content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 32px;
}

.pillar-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 8px;
}
.pillar-card p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 12px;
}
.pillar-card p:last-child { margin-bottom: 0; }
.pillar-card a { font-weight: 600; text-decoration: underline; }

/* ------------------------------------------------------------- footer --- */

.footer {
  padding: 0 var(--gutter) 48px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------- 404 page --- */

.error-page {
  padding: 80px var(--gutter);
  text-align: center;
}
.error-page h1 {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 12px;
}
.error-page p {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 24px;
}

/* --------------------------------------------------------- responsive --- */

@keyframes parallaxDrift {
  from { transform: translateY(-6%); }
  to   { transform: translateY(6%); }
}

@media (max-width: 640px) {
  .nav__links { display: none !important; }
  .hamburger { display: flex; }
  .nav__logo { height: 44px; }
  .donate { padding: 13px 18px; font-size: 14px; }

  .stats__grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 22px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }
  .stats__grid > .stat {
    flex: 0 0 auto;
    min-width: 112px;
    scroll-snap-align: start;
  }

  /* background-attachment:fixed is unreliable on mobile — use a scroll-driven
     CSS animation instead. No JavaScript involved. */
  .parallax-bg {
    background-attachment: scroll;
    animation: parallaxDrift linear;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }

  .hero--home    { min-height: 48vh; }
  .hero--who     { min-height: 56vh; }
  .hero--work    { min-height: 56vh; }
  .hero--contact { min-height: 52vh; }

  .pillar-nav__heading { font-size: 36px; }
  .pillar__title { font-size: 26px; }
  .cutout__content { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .parallax-bg { animation: none; background-attachment: scroll; }
  .stats { transition: none; }
}
