/* =========================================================================
   542 Tree Bed — minimal black & white
   One typeface, tight scale, plenty of whitespace, no ornament.
   ========================================================================= */

:root,
[data-theme='light'] {
  --ink: #111110;
  --ink-2: #2a2a28;
  --ink-3: #57574f;
  --ink-4: #8a8a80;
  --paper: #ffffff;
  --paper-2: #f5f4f0;
  --hairline: #e4e2dc;
  --hairline-strong: #c9c6bd;

  --color-text: var(--ink);
  --color-text-muted: var(--ink-3);
  --color-bg: var(--paper);
  --color-border: var(--hairline);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', system-ui,
    sans-serif;

  /* Restrained type scale */
  --text-xs: 0.75rem; /* 12px */
  --text-sm: 0.875rem; /* 14px */
  --text-base: 1rem; /* 16px */
  --text-md: 1.0625rem; /* 17px */
  --text-lg: 1.25rem; /* 20px */
  --text-xl: clamp(1.5rem, 1.2rem + 0.8vw, 1.875rem); /* 24-30px */
  --text-2xl: clamp(2rem, 1.4rem + 2vw, 2.75rem); /* 32-44px */

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --content: 880px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --transition: 180ms ease;
}

[data-theme='dark'] {
  --ink: #f2efe7;
  --ink-2: #d8d4ca;
  --ink-3: #a19d92;
  --ink-4: #77746a;
  --paper: #0d0d0c;
  --paper-2: #17161382;
  --hairline: #26251f;
  --hairline-strong: #3a3830;

  --color-text: var(--ink);
  --color-text-muted: var(--ink-3);
  --color-bg: var(--paper);
  --color-border: var(--hairline);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ink: #f2efe7;
    --ink-2: #d8d4ca;
    --ink-3: #a19d92;
    --ink-4: #77746a;
    --paper: #0d0d0c;
    --paper-2: #17161382;
    --hairline: #26251f;
    --hairline-strong: #3a3830;
    --color-text: var(--ink);
    --color-text-muted: var(--ink-3);
    --color-bg: var(--paper);
    --color-border: var(--hairline);
  }
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}
body {
  min-height: 100dvh;
  line-height: 1.55;
  font-family: var(--font);
  font-size: var(--text-md);
  color: var(--color-text);
  background: var(--color-bg);
}
img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
  font-weight: 500;
  letter-spacing: -0.01em;
}
p {
  text-wrap: pretty;
  max-width: 68ch;
}
::selection {
  background: var(--ink);
  color: var(--paper);
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
a,
button,
[role='button'] {
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    opacity var(--transition);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Type helpers */
.eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  font-weight: 500;
}
.dim {
  color: var(--color-text-muted);
}
.h {
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
  font-weight: 500;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--gutter);
  background: color-mix(in oklab, var(--paper) 90%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.brand-mark {
  width: 22px;
  height: 22px;
}
.nav-cta {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--paper);
  background: var(--ink);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
}
.nav-cta:hover {
  background: transparent;
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: transparent;
  color: var(--ink);
}
.btn-ghost {
  border-color: var(--hairline-strong);
  color: var(--color-text);
}
.btn-ghost:hover {
  border-color: var(--ink);
}
.btn-full {
  width: 100%;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--hairline);
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    min-height: min(720px, calc(100dvh - 4rem));
  }
}
.hero-media {
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 4 / 5;
}
@media (min-width: 900px) {
  .hero-media {
    aspect-ratio: auto;
    height: 100%;
  }
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero-copy {
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-5);
  border-left: 1px solid var(--hairline);
}
@media (max-width: 899px) {
  .hero-copy {
    border-left: none;
    border-top: 1px solid var(--hairline);
  }
}
.hero-copy h1 {
  font-size: var(--text-2xl);
  max-width: 22ch;
  font-weight: 500;
}
.lede {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  max-width: 42ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* Section shell */
.section {
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) var(--gutter);
  border-bottom: 1px solid var(--hairline);
}
.section:last-of-type {
  border-bottom: none;
}

/* Tree card */
.tree-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
@media (max-width: 720px) {
  .tree-card {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 420px) {
  .tree-card {
    grid-template-columns: 1fr;
  }
}
.tree-card > div {
  padding: var(--space-5);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: grid;
  gap: var(--space-2);
  align-content: start;
}
.tree-card dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  font-weight: 500;
}
.tree-card dd {
  font-size: var(--text-md);
  line-height: 1.35;
}
.tree-card dd em {
  font-style: italic;
  color: var(--color-text-muted);
}
.tree-card a {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* Facts — simple bulleted list, no numerals */
.facts {
  list-style: none;
  display: grid;
  gap: 0;
}
.facts li {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--text-md);
  max-width: 70ch;
}
.facts li:first-child {
  border-top: 1px solid var(--hairline);
}

/* Project */
.project-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 820px) {
  .project-grid {
    grid-template-columns: 1fr minmax(260px, 320px);
  }
}
.project-copy p {
  margin-bottom: var(--space-4);
  color: var(--ink-2);
}
[data-theme='dark'] .project-copy p {
  color: var(--ink);
}
.project-facts {
  display: grid;
  gap: 0;
  margin-top: var(--space-6);
  border-top: 1px solid var(--hairline);
}
.project-facts > div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: var(--space-5);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--hairline);
}
@media (max-width: 560px) {
  .project-facts > div {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}
.project-facts dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  font-weight: 500;
  padding-top: 3px;
}
.project-facts dd {
  font-size: var(--text-md);
}
.project-facts dd a {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.project-facts dd a:hover {
  color: var(--color-text-muted);
}

.fundraise {
  border: 1px solid var(--hairline-strong);
  padding: var(--space-6);
  display: grid;
  gap: var(--space-4);
  background: var(--paper);
}
.goal {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.goal-total {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}
.goal-of {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.fine-print {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Gallery */
.gallery-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.gallery-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--paper-2);
}

/* Timeline */
.timeline {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .timeline {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
}
.timeline h3 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.timeline ul {
  list-style: none;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--hairline);
}
.timeline li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--text-sm);
}

/* Get involved */
.section-involve {
  text-align: left;
}
.involve-copy {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 60ch;
}
.cta-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Resources */
.resource-list {
  list-style: none;
  border-top: 1px solid var(--hairline);
}
.resource-list li {
  border-bottom: 1px solid var(--hairline);
}
.resource-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  align-items: baseline;
  font-size: var(--text-md);
}
.resource-list a:hover span:first-child {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.resource-list a .dim {
  font-size: var(--text-sm);
}

/* Footer */
.site-footer {
  padding: var(--space-8) var(--gutter);
  max-width: var(--content);
  margin: 0 auto;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-top: 1px solid var(--hairline);
}
.site-footer a {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.site-footer a:hover {
  color: var(--color-text);
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 30;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
}
.theme-toggle:hover {
  background: transparent;
  color: var(--ink);
}
