/* ============================================================
   RootBudget — Sapling design system
   Tokens + base typography + components, used by every page.
   ============================================================ */

:root {
    /* color */
    --cream:        #edf1ea;   /* surface */
    --paper:        #faf8f3;   /* warmer paper, used for nav strip + cards */
    --leaf:         #2f9e5a;   /* primary green / link */
    --leaf-deep:    #1f7a42;   /* hover */
    --leaf-bright:  #7fd9a3;   /* on dark bg */
    --forest:       #1a3d2e;   /* reverse bg */
    --trunk:        #2a2018;   /* warm ink, buttons */
    --cream-stroke: #e8dfc8;   /* on dark bg */
    --ink:          #1a1a1a;   /* body text */
    --ink-soft:     rgba(0, 0, 0, 0.7);
    --ink-mute:     rgba(0, 0, 0, 0.55);
    --rule:         rgba(0, 0, 0, 0.08);
    --rule-strong:  rgba(0, 0, 0, 0.16);

    /* type */
    --font-display: 'Fraunces', 'Source Serif 4', Georgia, serif;
    --font-body:    'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-ui:      system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* radius */
    --r-input:      6px;
    --r-card:       8px;

    /* layout */
    --maxw:         1080px;
}

/* ----------------------------------------------------------------
   reset
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--leaf); text-decoration: none; transition: color .2s; }
a:hover { color: var(--leaf-deep); }
button { font: inherit; cursor: pointer; }
ul, ol { padding-left: 1.25rem; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}
body {
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------------------------------
   typography
   ---------------------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0 0 .6em;
}
h1 { font-size: clamp(2.25rem, 5vw + .5rem, 3.5rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 3vw + .4rem, 2.5rem); }
h3 { font-size: clamp(1.25rem, 1.4vw + .8rem, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1rem; color: var(--ink-soft); }
p.lead {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.15rem, 1.2vw + .75rem, 1.4rem);
    color: var(--ink-soft);
    line-height: 1.45;
    max-width: 38em;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    display: inline-block;
    margin-bottom: 1rem;
}

.accent { color: var(--leaf); }
.accent-italic { color: var(--leaf); font-style: italic; }

/* ----------------------------------------------------------------
   layout primitives
   ---------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }
.section-lg { padding: 5.5rem 0; }

.section-forest {
    background: var(--forest);
    color: var(--cream);
}
.section-forest h1, .section-forest h2, .section-forest h3, .section-forest h4 { color: var(--cream); }
.section-forest p { color: rgba(237, 241, 234, 0.78); }
.section-forest .eyebrow { color: rgba(237, 241, 234, 0.55); }
.section-forest .accent, .section-forest .accent-italic { color: var(--leaf-bright); }
.section-forest a { color: var(--leaf-bright); }
.section-forest a:hover { color: #a8e8c0; }

.section-paper { background: var(--paper); }

@media (min-width: 768px) {
    .section { padding: 5rem 0; }
    .section-lg { padding: 7rem 0; }
}

/* ----------------------------------------------------------------
   nav
   ---------------------------------------------------------------- */
.nav {
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    max-width: var(--maxw);
    margin: 0 auto;
    position: relative;
}
.lockup {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
}
.lockup img { width: 32px; height: 32px; }
.wordmark {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.01em;
    font-size: 1.2rem;
    line-height: 1;
    font-variation-settings: "opsz" 24;
    color: var(--ink);
}
.wordmark .heavy { font-weight: 600; }
.wordmark.lg { font-size: 2.4rem; font-variation-settings: "opsz" 60; }

.nav-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-family: var(--font-ui);
    font-size: .9rem;
}
.nav-links a {
    color: var(--ink-soft);
    text-decoration: none;
}
.nav-links a:hover { color: var(--leaf-deep); }

/* mobile nav toggle */
.nav-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-input);
    padding: .4rem .6rem;
    color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; display: block; }

@media (max-width: 720px) {
    .nav-toggle { display: inline-flex; align-items: center; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--rule);
        margin: 0;
        padding: .5rem 0;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        padding: .9rem 1.5rem;
        border-top: 1px solid var(--rule);
    }
    .nav-links .btn { margin: .75rem 1.5rem; }
}

/* ----------------------------------------------------------------
   buttons
   ---------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: .95rem;
    line-height: 1;
    padding: .8rem 1.4rem;
    border-radius: var(--r-input);
    border: 1px solid transparent;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary {
    background: var(--trunk);
    color: var(--cream);
}
.btn-primary:hover {
    background: #1a130d;
    color: var(--cream);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(42, 32, 24, 0.22);
}
.btn-leaf {
    background: var(--leaf);
    color: #fff;
}
.btn-leaf:hover {
    background: var(--leaf-deep);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(47, 158, 90, 0.28);
}
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--rule-strong);
}
.btn-ghost:hover {
    background: var(--paper);
    color: var(--ink);
}
.section-forest .btn-ghost {
    color: var(--cream);
    border-color: rgba(237, 241, 234, 0.35);
}
.section-forest .btn-ghost:hover {
    background: rgba(237, 241, 234, 0.08);
    color: var(--cream);
}
.btn-lg { padding: 1rem 1.7rem; font-size: 1rem; }
.btn-sm { padding: .55rem 1rem; font-size: .85rem; }

/* ----------------------------------------------------------------
   hero
   ---------------------------------------------------------------- */
.hero {
    background: var(--paper);
    padding: 4.5rem 0 5.5rem;
    border-bottom: 1px solid var(--rule);
}
.hero h1 { max-width: 14ch; }
.hero .lead { margin-top: .25rem; }
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.75rem;
}
.hero-meta {
    margin-top: 1.25rem;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .04em;
    color: var(--ink-mute);
}

.hero-figure {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--cream);
    border: 1px solid var(--rule);
    border-radius: var(--r-card);
    padding: 3rem 2rem;
    min-height: 220px;
}
.hero-figure img { width: 180px; height: 180px; }

@media (min-width: 900px) {
    .hero { padding: 6rem 0 7rem; }
    .hero-grid {
        display: grid;
        grid-template-columns: 1.1fr .9fr;
        gap: 3rem;
        align-items: center;
    }
    .hero-figure { margin-top: 0; min-height: 360px; padding: 4rem; }
    .hero-figure img { width: 240px; height: 240px; }
}

/* ----------------------------------------------------------------
   section heading block
   ---------------------------------------------------------------- */
.section-heading {
    text-align: center;
    margin: 0 auto 3rem;
    max-width: 36rem;
}
.section-heading p { color: var(--ink-mute); }
.section-heading--left { text-align: left; margin-left: 0; }

/* ----------------------------------------------------------------
   feature cards
   ---------------------------------------------------------------- */
.feature-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.feature-card {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-card);
    padding: 1.75rem;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .06);
    border-color: var(--rule-strong);
}
.feature-card h3 {
    font-size: 1.2rem;
    margin: .5rem 0 .5rem;
}
.feature-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: .98rem;
}
.feature-mark {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--leaf);
    margin-bottom: .5rem;
}
.feature-mark svg { width: 100%; height: 100%; }

.section-forest .feature-card {
    background: rgba(237, 241, 234, 0.04);
    border-color: rgba(237, 241, 234, 0.12);
}
.section-forest .feature-card:hover {
    background: rgba(237, 241, 234, 0.07);
    border-color: rgba(237, 241, 234, 0.22);
}
.section-forest .feature-mark { color: var(--leaf-bright); }

/* ----------------------------------------------------------------
   prose (legal pages, long-form)
   ---------------------------------------------------------------- */
.prose {
    max-width: 42rem;
    margin: 0 auto;
}
.prose h2 { margin-top: 2.5rem; font-size: 1.6rem; }
.prose h3 { margin-top: 2rem; font-size: 1.2rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.prose code {
    font-family: var(--font-mono);
    font-size: .9em;
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: 1px 6px;
    border-radius: 4px;
}

/* ----------------------------------------------------------------
   forms
   ---------------------------------------------------------------- */
.form-row { margin-bottom: 1.1rem; }
.form-row label {
    display: block;
    font-family: var(--font-ui);
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: .35rem;
    color: var(--ink);
}
.form-row input,
.form-row textarea {
    width: 100%;
    font: inherit;
    font-family: var(--font-ui);
    font-size: 1rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-input);
    padding: .7rem .85rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row textarea { min-height: 9rem; resize: vertical; }
.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--leaf);
    box-shadow: 0 0 0 3px rgba(47, 158, 90, 0.18);
}

/* ----------------------------------------------------------------
   contact card / mailto block
   ---------------------------------------------------------------- */
.contact-card {
    max-width: 36rem;
    margin: 0 auto;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-card);
    padding: 2rem;
}

/* ----------------------------------------------------------------
   error / status pages
   ---------------------------------------------------------------- */
.status-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
}
.status-card {
    text-align: center;
    max-width: 32rem;
}
.status-code {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(4rem, 12vw, 7rem);
    color: var(--leaf);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: .5rem;
    font-variation-settings: "opsz" 144;
}
.status-card h1 { font-size: clamp(1.6rem, 3vw + .5rem, 2.2rem); margin-top: .25rem; }
.status-card .lead { margin: 0 auto 1.5rem; }

/* ----------------------------------------------------------------
   footer
   ---------------------------------------------------------------- */
.footer {
    background: var(--forest);
    color: var(--cream);
    padding: 3.5rem 0 1.5rem;
}
.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) {
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer h4 {
    color: var(--cream);
    font-size: 1rem;
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .14em;
    margin: 0 0 1rem;
    opacity: .75;
}
.footer p { color: rgba(237, 241, 234, 0.7); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .5rem; }
.footer a {
    color: var(--cream);
    opacity: .82;
    text-decoration: none;
}
.footer a:hover { opacity: 1; color: var(--leaf-bright); }
.footer-brand .lockup,
.footer-brand .wordmark { color: var(--cream); }
.footer-bar {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(237, 241, 234, 0.12);
    font-family: var(--font-mono);
    font-size: .75rem;
    color: rgba(237, 241, 234, 0.55);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

/* ----------------------------------------------------------------
   utility
   ---------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
