/* Dai Impact Fund — Design System */
/* Tone: warm family foundation. Editorial serif + clean sans. Illustrated accents. */

:root {
  /* Palette — paper, ink, sprout, sun (LIGHT) */
  --paper: #f7f3ea;        /* warm off-white background */
  --paper-2: #efe9db;      /* slightly deeper, for cards */
  --paper-3: #e6dfcc;      /* hairlines, dividers */
  --card-bg: #fffdf7;      /* card / input bg, slightly brighter than paper */
  --ink: #1c1c1a;          /* primary text */
  --ink-2: #4a4a45;        /* secondary text */
  --ink-3: #8a8478;        /* tertiary, captions */

  --sprout: #3d5a3d;       /* deep forest — primary accent */
  --sprout-2: #6a8868;     /* lighter sprout, for fills */
  --sprout-3: #c8d4be;     /* very pale, backgrounds */

  --sun: #c25a3a;          /* warm terracotta — secondary accent */
  --sun-2: #e8a374;        /* peach, soft */
  --sun-3: #f4dbc6;        /* very pale */

  --btn-fg: var(--paper);  /* button label color (paper on ink in light, ink on paper in dark) */
  color-scheme: light;
}

/* Dark theme — applied when html[data-theme="dark"] OR (no override AND system prefers dark) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17150f;
    --paper-2: #1f1c14;
    --paper-3: #2e2a20;
    --card-bg: #1c1a13;
    --ink: #f0ead8;
    --ink-2: #c5beac;
    --ink-3: #8a8474;

    --sprout: #9bbf97;
    --sprout-2: #b4cdab;
    --sprout-3: #2c3d2b;

    --sun: #e08a6a;
    --sun-2: #e8a374;
    --sun-3: #4a2e22;

    --btn-fg: #17150f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17150f;
  --paper-2: #1f1c14;
  --paper-3: #2e2a20;
  --card-bg: #1c1a13;
  --ink: #f0ead8;
  --ink-2: #c5beac;
  --ink-3: #8a8474;

  --sprout: #9bbf97;
  --sprout-2: #b4cdab;
  --sprout-3: #2c3d2b;

  --sun: #e08a6a;
  --sun-2: #e8a374;
  --sun-3: #4a2e22;

  --btn-fg: #17150f;
  color-scheme: dark;
}

:root, :root[data-theme="dark"] {
  /* Type */
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --hand: 'Caveat', 'Kalam', cursive;

  /* Scale */
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(28, 28, 26, 0.06);
  --shadow: 0 4px 18px rgba(28, 28, 26, 0.08);

  /* Fluid gutter — scales 16px (320vw) → 56px (1280vw+) */
  --gutter: clamp(16px, 4.5vw, 56px);
  /* Fluid section rhythm — scales between mobile and desktop */
  --section-y: clamp(48px, 8vw, 100px);
  --section-y-tight: clamp(40px, 6vw, 72px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
html, body { overflow-x: hidden; }
html { transition: background-color 0.2s ease; }
body { transition: background-color 0.2s ease, color 0.2s ease; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Typography — fully fluid, no discrete breakpoint jumps */
.h-display {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1.15; letter-spacing: -0.01em;
  padding-bottom: 0.22em; margin: 0;
  text-wrap: balance;
}
.h1, .h2 { text-wrap: balance; }
.h-display em { font-style: italic; color: var(--sprout); }
.h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.1; letter-spacing: -0.005em;
}
.h1 em { font-style: italic; color: var(--sprout); }
.h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
}
.h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.3;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-3);
}

.lead {
  font-family: var(--serif);
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.5; color: var(--ink-2); font-weight: 400;
}
.body {
  font-size: clamp(15px, 1.1vw, 16px);
  line-height: 1.65; color: var(--ink-2);
}
.small { font-size: 13px; line-height: 1.5; color: var(--ink-3); }

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--paper-3); transition: border-color 0.2s, color 0.2s; }
a:hover { border-bottom-color: var(--sprout); color: var(--sprout); }

.hand { font-family: var(--hand); font-weight: 500; }

/* Layout — fluid gutters, no breakpoint jumps */
.container { max-width: 1024px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container-narrow { max-width: 680px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 12px 22px; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--btn-fg);
  cursor: pointer; transition: transform 0.15s, background 0.15s, color 0.15s; text-decoration: none;
}
.btn:hover { background: var(--sprout); border-color: var(--sprout); color: var(--btn-fg); border-bottom-color: var(--sprout); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }

/* Hairline divider */
.hr { height: 1px; background: var(--paper-3); border: 0; margin: 0; }
.hr-dashed { border: 0; border-top: 1px dashed var(--paper-3); margin: 0; }

/* Cards */
.card { background: var(--card-bg); border: 1px solid var(--paper-3); border-radius: var(--r); padding: 24px; }

/* Tag chips */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--sprout-3); color: var(--sprout);
  font-size: 12px; font-weight: 500;
}
.tag-sun { background: var(--sun-3); color: var(--sun); }

/* Nav — horizontal padding inherited from .container */
nav.site {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px; padding-bottom: 24px;
}
nav.site .links { display: flex; gap: 28px; align-items: center; }
nav.site .links a { font-size: 14px; border-bottom: none; color: var(--ink-2); }
nav.site .links a:hover { color: var(--sprout); }

/* Footer */
footer.site {
  padding-top: 56px; padding-bottom: 40px;
  border-top: 1px solid var(--paper-3);
  margin-top: 80px;
  font-size: 13px; color: var(--ink-3);
}
footer.site .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }

/* Word-break safety on small viewports */
h1, h2, h3, p { overflow-wrap: break-word; }
img, svg { max-width: 100%; }


/* Form */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--ink-3); font-style: italic; line-height: 1.55; }
.field input, .field textarea {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--card-bg); border: 1px solid var(--paper-3); border-radius: var(--r-sm);
  padding: 12px 14px; outline: none; transition: border-color 0.15s;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--sprout); }
