/* ==========================================================================
   UNDERSTORY — a nature-themed CSS template
   Single file. Light by default, dark via .theme-dark on <html> or <body>.
   --------------------------------------------------------------------------
   CONTENTS
     01. Design tokens (light)
     02. Dark theme
     03. Reset
     04. Base typography
     05. Layout: container, section, grid, stack
     06. Headings
     07. Text: paragraphs, links, lists, inline
     08. Quotes
     09. Rules & dividers
     10. Buttons
     11. Cards
     12. Badges & tags
     13. Callouts / alerts
     14. Forms
     15. Tables
     16. Code
     17. Nav, hero, footer
     18. Utilities
     19. Responsive
     20. Accessibility, motion, print

   QUICK START
     <html class="theme-dark">      turn on dark mode
     <html class="theme-light">     force light even if the OS prefers dark
     (no class)                     light, but follows the OS preference

   FONTS — paste this in <head>, above the link to this stylesheet:

     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..800,0..100,0..1&family=Literata:opsz,wght@7..72,400..700&family=Instrument+Sans:wght@400..600&display=swap">

     Fraunces        headings — an organic old-style serif with soft, slightly
                     irregular letterforms. The SOFT and WONK axes are what
                     give it the hand-cut quality this template wants.
     Literata        body — designed for long-form reading on screen, warmer
                     and less austere than Georgia.
     Instrument Sans UI — buttons, labels, nav, tables. Neutral enough to stay
                     out of the way of the two serifs.

     Everything falls back to system serifs if the fonts don't load, so the
     page still works offline.
   ========================================================================== */


/* 01. DESIGN TOKENS ======================================================= */

:root {
    /* --- Palette: greens (the backbone) --- */
    --clr-forest-900: #16281d;
    --clr-forest-800: #1e3a29;
    --clr-forest-700: #234f32;
    --clr-forest-600: #2f6b43;
    --clr-forest-500: #3f8455;
    --clr-moss-600:   #567134;   /* AA on every light surface — safe for small text */
    --clr-moss-500:   #6f8f4a;
    --clr-moss-400:   #8aa860;
    --clr-fern-300:   #a8c686;
    --clr-fern-200:   #c9dcae;
    --clr-sage-100:   #e9efdd;

    /* --- Palette: earth --- */
    --clr-bark-700:   #5a4230;
    --clr-bark-500:   #6b4f3a;
    --clr-sand-200:   #ece5d4;
    --clr-paper:      #fbfaf4;
    --clr-birch:      #ffffff;

    /* --- Palette: occasional accents --- */
    --clr-berry:      #b23a2f;   /* rowan berry red   */
    --clr-berry-soft: #f4dedb;
    --clr-sky:        #2f6f9e;   /* river blue        */
    --clr-sky-soft:   #dce8f2;
    --clr-amber:      #96530f;   /* autumn / clay     */
    --clr-amber-soft: #f6e6d4;
    --clr-heather:    #6f5490;   /* wildflower purple */
    --clr-heather-soft:#e8e1f1;

    /* --- Semantic roles --- */
    --bg:            var(--clr-paper);
    --bg-sunken:     #f2f1e8;
    --surface:       var(--clr-birch);
    --surface-alt:   var(--clr-sage-100);
    --border:        #e2e0cd;
    --border-strong: #c7c8b1;

    --text:          #1c2a21;
    --text-muted:    #56655a;
    --text-faint:    #5f6d63;
    --text-invert:   #f4f7f0;

    --primary:       var(--clr-forest-600);
    --primary-hover: var(--clr-forest-700);
    --primary-press: var(--clr-forest-800);
    --primary-soft:  var(--clr-sage-100);
    --on-primary:    #f6faf3;

    --accent:        var(--clr-berry);
    --link:          var(--clr-forest-700);
    --link-hover:    var(--clr-berry);
    --focus:         var(--clr-moss-500);

    /* Text-only greens and browns. These swap in dark mode so the .text-*
       utilities stay legible without the author picking a value per theme. */
    --text-forest:   var(--clr-forest-800);
    --text-moss:     var(--clr-moss-600);
    --text-bark:     var(--clr-bark-700);

    /* Tints used by .lighter / .darker. A step that reads as one notch on
       a pale surface is far too big on a near-black one, so the two themes
       carry different strengths. */
    --tint-up:       rgba(255, 255, 255, 0.45);
    --tint-up-2:     rgba(255, 255, 255, 0.70);
    --tint-down:     rgba(22, 40, 29, 0.07);
    --tint-down-2:   rgba(22, 40, 29, 0.15);

    /* --- Typography (see FONTS at the top of this file for the embed) --- */
    --font-head: "Fraunces", "Iowan Old Style", ui-serif, Georgia, serif;
    --font-body: "Literata", ui-serif, Georgia, "Book Antiqua", serif;
    --font-sans: "Instrument Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

    --fs-xs:   0.78rem;
    --fs-sm:   0.885rem;
    --fs-base: 1.0625rem;
    --fs-md:   1.2rem;
    --fs-lg:   1.45rem;
    --fs-xl:   1.85rem;
    --fs-2xl:  2.35rem;
    --fs-3xl:  3rem;
    --fs-4xl:  3.9rem;

    --lh-tight: 1.15;
    --lh-snug:  1.35;
    --lh-body:  1.7;

    --ls-tight: -0.015em;
    --ls-wide:  0.08em;

    /* --- Space (a rough 1.5 scale) --- */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4.5rem;
    --sp-9: 6.5rem;

    /* --- Shape --- */
    --radius-sm:   4px;
    --radius:      8px;
    --radius-lg:   14px;
    --radius-pill: 999px;
    --radius-leaf: 0 1.4rem 0 1.4rem;   /* the signature leaf corner */

    /* --- Depth (green-tinted, never pure black) --- */
    --shadow-sm: 0 1px 2px rgba(28, 42, 33, 0.07);
    --shadow:    0 2px 4px rgba(28, 42, 33, 0.06),
    0 8px 20px -8px rgba(28, 42, 33, 0.16);
    --shadow-lg: 0 4px 10px rgba(28, 42, 33, 0.07),
    0 22px 44px -16px rgba(28, 42, 33, 0.24);

    --ring: 0 0 0 3px color-mix(in srgb, var(--focus) 45%, transparent);

    /* --- Motion --- */
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --dur:  180ms;

    /* --- Layout --- */
    --measure: 68ch;
    --container: 1120px;
    --container-narrow: 720px;
}


/* 02. DARK THEME ========================================================== */

.theme-dark {
    --bg:            #101710;
    --bg-sunken:     #0b110c;
    --surface:       #18211a;
    --surface-alt:   #202c22;
    --border:        #2f4030;
    --border-strong: #43593f;

    --text:          #e6efe3;
    --text-muted:    #a3b6a1;
    --text-faint:    #829581;
    --text-invert:   #10170f;

    --primary:       #6cbd80;
    --primary-hover: #85cf96;
    --primary-press: #a0dcaf;
    --primary-soft:  #223226;
    --on-primary:    #0d1a10;

    --clr-berry:      #e8837a;
    --clr-berry-soft: #3a221f;
    --clr-sky:        #7ab6e0;
    --clr-sky-soft:   #1b2c38;
    --clr-amber:      #dfa05a;
    --clr-amber-soft: #35281a;
    --clr-heather:    #b8a0dc;
    --clr-heather-soft:#2a2338;

    --accent:     var(--clr-berry);
    --link:       #8ccb9b;
    --link-hover: var(--clr-berry);
    --focus:      #8aa860;

    --text-forest: #dcebd7;
    --text-moss:   var(--clr-moss-400);
    --text-bark:   #cfae94;

    --tint-up:     rgba(255, 255, 255, 0.06);
    --tint-up-2:   rgba(255, 255, 255, 0.12);
    --tint-down:   rgba(0, 0, 0, 0.35);
    --tint-down-2: rgba(0, 0, 0, 0.55);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:    0 2px 4px rgba(0, 0, 0, 0.35),
    0 8px 20px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.4),
    0 22px 44px -16px rgba(0, 0, 0, 0.7);

    color-scheme: dark;
}

/* Follow the OS when the author hasn't picked a theme.
   .theme-light on the root opts out of this. */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light):not(.theme-dark) {
        --bg:            #101710;
        --bg-sunken:     #0b110c;
        --surface:       #18211a;
        --surface-alt:   #202c22;
        --border:        #2f4030;
        --border-strong: #43593f;

        --text:          #e6efe3;
        --text-muted:    #a3b6a1;
        --text-faint:    #829581;
        --text-invert:   #10170f;

        --primary:       #6cbd80;
        --primary-hover: #85cf96;
        --primary-press: #a0dcaf;
        --primary-soft:  #223226;
        --on-primary:    #0d1a10;

        --clr-berry:      #e8837a;
        --clr-berry-soft: #3a221f;
        --clr-sky:        #7ab6e0;
        --clr-sky-soft:   #1b2c38;
        --clr-amber:      #dfa05a;
        --clr-amber-soft: #35281a;
        --clr-heather:    #b8a0dc;
        --clr-heather-soft:#2a2338;

        --accent:     var(--clr-berry);
        --link:       #8ccb9b;
        --link-hover: var(--clr-berry);
        --focus:      #8aa860;

        --text-forest: #dcebd7;
        --text-moss:   var(--clr-moss-400);
        --text-bark:   #cfae94;

        --tint-up:     rgba(255, 255, 255, 0.06);
        --tint-up-2:   rgba(255, 255, 255, 0.12);
        --tint-down:   rgba(0, 0, 0, 0.35);
        --tint-down-2: rgba(0, 0, 0, 0.55);

        color-scheme: dark;
    }
}


/* 03. RESET =============================================================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--sp-7);
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Literata and Fraunces both carry an optical-size axis — let the browser
       drive it so small text opens up and large text tightens. */
    font-optical-sizing: auto;

    /* A faint dappled-light wash. Delete these three lines for a flat page. */
    background-image:
            radial-gradient(60rem 40rem at 12% -8%,
            color-mix(in srgb, var(--clr-fern-300) 15%, transparent), transparent 70%),
            radial-gradient(48rem 34rem at 105% 4%,
            color-mix(in srgb, var(--clr-sky) 7%, transparent), transparent 70%);
    background-attachment: fixed;
}

img, svg, video, canvas, picture {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

ul[class], ol[class] { list-style: none; padding: 0; }


/* 04. BASE TYPOGRAPHY ===================================================== */

::selection {
    background: color-mix(in srgb, var(--clr-fern-300) 60%, transparent);
    color: var(--text);
}

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--sp-4); }
.prose > h2 { margin-top: var(--sp-7); }
.prose > h3 { margin-top: var(--sp-6); }


/* 05. LAYOUT ============================================================== */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--sp-5);
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--sp-8); }
.section--tight { padding-block: var(--sp-6); }
.section--tall  { padding-block: var(--sp-9); }

/* --- Section bands -------------------------------------------------------
   Full-width colour bands. Each one is a fill plus hairlines top and bottom,
   so stacked sections read as distinct strata rather than one long page.
   The fills track the theme tokens, so they all flip in dark mode.      */

.section--sunken { background-color: var(--bg-sunken); }

.section--moss,
.section--berry,
.section--sky,
.section--amber,
.section--heather {
    border-block: 1px solid var(--border);
}

.section--moss    { background-color: var(--surface-alt); }
.section--primary { background-color: var(--primary); color: var(--on-primary); }
.section--berry   { background-color: var(--clr-berry-soft); }
.section--sky     { background-color: var(--clr-sky-soft); }
.section--amber   { background-color: var(--clr-amber-soft); }
.section--heather { background-color: var(--clr-heather-soft); }

/* Gradient bands — no hairline, they fade into the page on their own */
.section--mist {
    background-image: linear-gradient(180deg, var(--surface-alt), transparent);
}
.section--dawn {
    background-image: linear-gradient(150deg, var(--clr-amber-soft), var(--clr-berry-soft));
    border-block: 1px solid var(--border);
}

/* Dark bands. These stay dark in both themes — see section 18, where the
   same four names re-point headings, links and muted text so anything you
   drop inside stays readable. */
.section--forest { background-color: var(--clr-forest-800); }
.section--night  { background-color: var(--clr-forest-900); }
.section--bark   { background-color: var(--clr-bark-700); }
.section--canopy {
    background-image: linear-gradient(155deg, var(--clr-forest-700), var(--clr-forest-900));
}
.section--forest,
.section--night,
.section--bark,
.section--canopy {
    border-block: 1px solid rgba(255, 255, 255, 0.10);
}

/* Vertical rhythm helper: .stack > child + child gets a gap */
.stack > * + * { margin-top: var(--sp-4); }
.stack--sm > * + * { margin-top: var(--sp-2); }
.stack--lg > * + * { margin-top: var(--sp-6); }

.grid {
    display: grid;
    gap: var(--sp-5);
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    align-items: center;
}


/* 06. HEADINGS ============================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 600;
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--clr-forest-800);
    text-wrap: balance;
    /* Fraunces' two custom axes. SOFT rounds the terminals; WONK swaps in the
       splayed, slightly off-kilter alternates. Both are ignored by the
       fallback serifs. Dial SOFT to 0 for a crisper, more formal page. */
    font-variation-settings: "SOFT" 35, "WONK" 1;
}

.theme-dark h1, .theme-dark h2, .theme-dark h3,
.theme-dark h4, .theme-dark h5, .theme-dark h6 { color: #dcebd7; }

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light):not(.theme-dark) h1,
    :root:not(.theme-light):not(.theme-dark) h2,
    :root:not(.theme-light):not(.theme-dark) h3,
    :root:not(.theme-light):not(.theme-dark) h4,
    :root:not(.theme-light):not(.theme-dark) h5,
    :root:not(.theme-light):not(.theme-dark) h6 { color: #dcebd7; }
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 {
    font-size: var(--fs-sm);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    color: var(--text-muted);
}

.display {
    font-size: var(--fs-4xl);
    line-height: 1.03;
    letter-spacing: -0.03em;
    font-weight: 500;                              /* Fraunces runs dark */
    font-variation-settings: "SOFT" 60, "WONK" 1;  /* softer at large sizes */
}

/* Heading with a small leaf-stem rule underneath */
.heading-stem { position: relative; padding-bottom: var(--sp-3); }
.heading-stem::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 3.5rem;
    height: 3px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--primary), var(--clr-fern-300));
}

/* Small label that sits above a heading */
.eyebrow {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--clr-moss-600);
    margin-bottom: var(--sp-2);
}
.theme-dark .eyebrow { color: var(--clr-moss-400); }
.eyebrow--berry  { color: var(--clr-berry); }
.eyebrow--sky    { color: var(--clr-sky); }
.eyebrow--amber  { color: var(--clr-amber); }


/* 07. TEXT ================================================================ */

p { max-width: var(--measure); }

.lead {
    font-size: var(--fs-md);
    line-height: 1.6;
    color: var(--text-muted);
}

.small  { font-size: var(--fs-sm); }
.caption {
    font-size: var(--fs-sm);
    color: var(--text-faint);
    font-style: italic;
}
.muted  { color: var(--text-muted); }

/* First-letter drop cap, for essay-style intros */
.dropcap::first-letter {
    float: left;
    font-family: var(--font-head);
    font-size: 3.6em;
    line-height: 0.82;
    padding: 0.06em 0.1em 0 0;
    color: var(--primary);
}

/* --- Links --- */

a {
    color: var(--link);
    text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
    transition: color var(--dur) var(--ease),
    text-decoration-color var(--dur) var(--ease);
}
a:hover {
    color: var(--link-hover);
    text-decoration-color: currentColor;
}

.link-quiet { text-decoration: none; }
.link-quiet:hover { text-decoration: underline; }

.link-arrow {
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-decoration: none;
}
.link-arrow::after {
    content: " \2192";
    display: inline-block;
    transition: transform var(--dur) var(--ease);
}
.link-arrow:hover::after { transform: translateX(3px); }

/* Bordered link — quieter than a .btn, more present than a plain link.
   Pairs with .link-arrow:  <a class="link-outline link-arrow">Read on</a>  */
.link-outline {
    --lo-color: var(--link);
    --lo-accent: var(--primary);

    display: inline-flex;
    align-items: center;
    gap: 0.45em;

    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;

    padding: 0.6em 1.15em;
    color: var(--lo-color);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);

    transition: color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.link-outline:hover {
    color: var(--lo-accent);
    border-color: var(--lo-accent);
    /* 6% keeps the label above 4.5:1 even for the lightest accent (sky) */
    background: color-mix(in srgb, var(--lo-accent) 6%, transparent);
    text-decoration: none;
}

/* With .link-arrow the arrow is a flex child, so the leading space
   in that rule's content would double up on the gap. Drop it. */
.link-outline.link-arrow::after { content: "\2192"; }

.link-outline--berry { --lo-color: var(--clr-berry);   --lo-accent: var(--clr-berry); }
.link-outline--sky   { --lo-color: var(--clr-sky);     --lo-accent: var(--clr-sky); }
.link-outline--amber { --lo-color: var(--clr-amber);   --lo-accent: var(--clr-amber); }
.link-outline--muted { --lo-color: var(--text-muted);  --lo-accent: var(--text); }

.link-outline--sm   { font-size: var(--fs-xs); padding: 0.5em 0.95em; }
.link-outline--leaf { border-radius: var(--radius-leaf); }

/* --- Lists --- */

ul:not([class]), ol:not([class]) {
    max-width: var(--measure);
    padding-left: 1.35em;
}
ul:not([class]) > li, ol:not([class]) > li { margin-block: var(--sp-2); }
ul:not([class]) > li::marker { color: var(--clr-moss-500); }
ol:not([class]) > li::marker { color: var(--clr-moss-500); font-weight: 600; }

li > ul, li > ol { margin-top: var(--sp-2); }

dl { max-width: var(--measure); }
dt {
    font-weight: 600;
    color: var(--clr-forest-700);
    margin-top: var(--sp-4);
}
.theme-dark dt { color: var(--primary); }
dd { margin-left: 0; color: var(--text-muted); }

/* Checklist with leaf bullets */
.list-leaf { list-style: none; padding-left: 0; max-width: var(--measure); }
.list-leaf li {
    position: relative;
    padding-left: 1.75rem;
    margin-block: var(--sp-2);
}
.list-leaf li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.7rem;
    height: 0.7rem;
    background: var(--clr-moss-400);
    border-radius: 0 100% 0 100%;
    transform: rotate(-20deg);
}

/* --- Inline --- */

strong, b { font-weight: 700; color: var(--clr-forest-800); }
.theme-dark strong, .theme-dark b { color: #eaf3e7; }

em, i { font-style: italic; }

small { font-size: var(--fs-sm); color: var(--text-muted); }

mark {
    background: color-mix(in srgb, var(--clr-fern-200) 75%, transparent);
    color: var(--text);
    padding: 0.05em 0.25em;
    border-radius: var(--radius-sm);
}
.theme-dark mark { background: color-mix(in srgb, var(--clr-moss-500) 40%, transparent); }

abbr[title] {
    text-decoration: underline dotted;
    text-underline-offset: 0.2em;
    cursor: help;
}

kbd {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    padding: 0.1em 0.4em;
}


/* 08. QUOTES ============================================================== */

blockquote {
    max-width: var(--measure);
    margin-block: var(--sp-6);
    padding: var(--sp-4) var(--sp-5);
    border-left: 3px solid var(--primary);
    background: color-mix(in srgb, var(--surface-alt) 60%, transparent);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: var(--fs-md);
    line-height: 1.6;
    color: var(--text);
}
blockquote p + p { margin-top: var(--sp-3); }

blockquote cite,
.quote-cite {
    display: block;
    margin-top: var(--sp-3);
    font-size: var(--fs-sm);
    font-style: normal;
    font-family: var(--font-sans);
    color: var(--text-muted);
}
blockquote cite::before,
.quote-cite::before { content: "— "; }

/* Accent variants — use these sparingly */
blockquote.is-berry { border-left-color: var(--clr-berry); }
blockquote.is-sky   { border-left-color: var(--clr-sky); }
blockquote.is-amber { border-left-color: var(--clr-amber); }

/* Big centred pull quote with an open-quote glyph */
.quote-pull {
    max-width: 34ch;
    margin: var(--sp-7) auto;
    padding: 0;
    border: 0;
    background: none;
    text-align: center;
    font-family: var(--font-head);
    font-size: var(--fs-xl);
    line-height: 1.35;
    letter-spacing: var(--ls-tight);
    color: var(--clr-forest-700);
    position: relative;
    font-weight: 400;
    font-variation-settings: "SOFT" 60, "WONK" 1;
}
.theme-dark .quote-pull { color: #cfe4ca; }
.quote-pull::before {
    content: "\201C";
    display: block;
    font-size: 3.5rem;
    line-height: 0.6;
    color: var(--clr-fern-300);
    margin-bottom: var(--sp-3);
}

/* Quote laid on a card, e.g. a testimonial */
.quote-card {
    max-width: none;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: var(--sp-5);
}


/* 09. RULES & DIVIDERS ==================================================== */

hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin-block: var(--sp-6);
}

/* Centred sprig ornament */
.rule-sprig {
    border: 0;
    height: auto;
    overflow: visible;
    text-align: center;
    margin-block: var(--sp-7);
    background: none;
}
.rule-sprig::before {
    content: "\2766";              /* floral heart */
    color: var(--clr-moss-400);
    font-size: 1.4rem;
}

.rule-soft {
    background: linear-gradient(90deg,
    transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
}


/* 10. BUTTONS ============================================================= */

.btn {
    --btn-bg: var(--primary);
    --btn-fg: var(--on-primary);
    --btn-bd: var(--primary);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);

    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;

    padding: 0.75em 1.4em;
    border: 1px solid var(--btn-bd);
    border-radius: var(--radius-pill);
    background: var(--btn-bg);
    color: var(--btn-fg);

    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.btn:hover {
    --btn-bg: var(--primary-hover);
    --btn-bd: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: var(--btn-fg);
}
.btn:active {
    --btn-bg: var(--primary-press);
    --btn-bd: var(--primary-press);
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* --- Variants --- */

.btn--outline {
    --btn-bg: transparent;
    --btn-fg: var(--primary);
    --btn-bd: var(--border-strong);
    box-shadow: none;
}
.btn--outline:hover {
    --btn-bg: var(--primary-soft);
    --btn-fg: var(--primary-hover);
    --btn-bd: var(--primary);
}

.btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--text-muted);
    --btn-bd: transparent;
    box-shadow: none;
}
.btn--ghost:hover {
    --btn-bg: var(--surface-alt);
    --btn-fg: var(--text);
    --btn-bd: transparent;
}

.btn--bark {
    --btn-bg: var(--clr-bark-500);
    --btn-fg: #fdf8f1;
    --btn-bd: var(--clr-bark-500);
}
.btn--bark:hover {
    --btn-bg: var(--clr-bark-700);
    --btn-bd: var(--clr-bark-700);
}

.btn--berry {
    --btn-bg: var(--clr-berry);
    --btn-fg: #fff6f4;
    --btn-bd: var(--clr-berry);
}
.btn--berry:hover {
    --btn-bg: color-mix(in srgb, var(--clr-berry) 85%, #000);
    --btn-bd: color-mix(in srgb, var(--clr-berry) 85%, #000);
}

.btn--sky {
    --btn-bg: var(--clr-sky);
    --btn-fg: #f4faff;
    --btn-bd: var(--clr-sky);
}
.btn--sky:hover {
    --btn-bg: color-mix(in srgb, var(--clr-sky) 85%, #000);
    --btn-bd: color-mix(in srgb, var(--clr-sky) 85%, #000);
}

.btn--amber {
    --btn-bg: var(--clr-amber);
    --btn-fg: #fff9f2;
    --btn-bd: var(--clr-amber);
}
.btn--amber:hover {
    --btn-bg: color-mix(in srgb, var(--clr-amber) 85%, #000);
    --btn-bd: color-mix(in srgb, var(--clr-amber) 85%, #000);
}

/* Dark mode: bright accent fills need dark text on them */
.theme-dark .btn--berry,
.theme-dark .btn--sky,
.theme-dark .btn--amber { --btn-fg: #16210f; }

/* Text-only button that still lines up with the others */
.btn--link {
    --btn-bg: transparent;
    --btn-fg: var(--link);
    --btn-bd: transparent;
    padding-inline: 0.35em;
    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 0.25em;
}
.btn--link:hover {
    --btn-bg: transparent;
    --btn-fg: var(--link-hover);
    transform: none;
    box-shadow: none;
}

/* --- Sizes & shapes --- */

.btn--sm { font-size: var(--fs-xs); padding: 0.6em 1.05em; }
.btn--lg { font-size: var(--fs-base); padding: 0.85em 1.8em; }
.btn--block { display: flex; width: 100%; }
.btn--square { border-radius: var(--radius); }
.btn--leaf   { border-radius: var(--radius-leaf); }

.btn[disabled],
.btn.is-disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.btn-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
}


/* 11. CARDS =============================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.card > * + * { margin-top: var(--sp-3); }

.card__title {
    font-size: var(--fs-lg);
    margin: 0;
}
.card__meta {
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--text-faint);
}
.card__body { color: var(--text-muted); }
.card__footer {
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
}
.card__media {
    margin: calc(var(--sp-5) * -1) calc(var(--sp-5) * -1) 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}
.card__media img { width: 100%; object-fit: cover; }

.card--hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.card--leaf { border-radius: var(--radius-leaf); }

.card--moss {
    background: var(--surface-alt);
    border-color: color-mix(in srgb, var(--primary) 25%, transparent);
}

/* A thin coloured spine on the left */
.card--spine { border-left: 4px solid var(--primary); }
.card--spine.is-berry { border-left-color: var(--clr-berry); }
.card--spine.is-sky   { border-left-color: var(--clr-sky); }
.card--spine.is-amber { border-left-color: var(--clr-amber); }


/* --- Text over images ----------------------------------------------------
   A photograph has no fixed contrast, so text laid straight on one is a
   gamble. .media puts a dark green scrim between the two. The gradient is
   tuned so that anywhere below 68% of the height, white text clears 4.5:1
   even over a pure-white photo — the worst case there is.

     <figure class="media media--16x9">
       <img src="fern.jpg" alt="">
       <figcaption class="media__content">
         <p class="eyebrow">Trail 4</p>
         <h3>Into the ferns</h3>
       </figcaption>
     </figure>
   -------------------------------------------------------------------- */

.media {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--clr-forest-900);   /* shows while the image loads */
}

.media > img,
.media > picture img,
.media > video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* the scrim */
.media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
            180deg,
            color-mix(in srgb, var(--clr-forest-900)  6%, transparent)   0%,
            color-mix(in srgb, var(--clr-forest-900) 30%, transparent)  40%,
            color-mix(in srgb, var(--clr-forest-900) 70%, transparent)  68%,
            color-mix(in srgb, var(--clr-forest-900) 92%, transparent) 100%
    );
}

/* Even wash instead of a gradient — for text placed anywhere on the image */
.media--flat::after {
    background: color-mix(in srgb, var(--clr-forest-900) 72%, transparent);
}

/* Darker still, for long paragraphs or busy photographs */
.media--strong::after {
    background: linear-gradient(
            180deg,
            color-mix(in srgb, var(--clr-forest-900) 35%, transparent)   0%,
            color-mix(in srgb, var(--clr-forest-900) 70%, transparent)  50%,
            color-mix(in srgb, var(--clr-forest-900) 95%, transparent) 100%
    );
}

/* Text on the left half instead of the bottom */
.media--side::after {
    background: linear-gradient(
            90deg,
            color-mix(in srgb, var(--clr-forest-900) 92%, transparent)   0%,
            color-mix(in srgb, var(--clr-forest-900) 72%, transparent)  45%,
            color-mix(in srgb, var(--clr-forest-900) 15%, transparent) 100%
    );
}
.media--side .media__content {
    inset: 0 auto 0 0;
    max-width: 60%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.media__content {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: var(--sp-5);
    color: #ffffff;
    /* a whisper of shadow for the odd bright pixel that survives the scrim */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.media__content > * + * { margin-top: var(--sp-2); }
.media__content :is(h1, h2, h3, h4, h5, h6) { color: #ffffff; }
/* These are lighter than the usual fern accents on purpose — over a scrim
   the darker ones drop below 4.5:1 when the photo underneath is bright. */
.media__content :is(p, .lead) { color: #eaf1e6; }
.media__content .eyebrow { color: #dcebc7; }
.media__content a:not(.btn) { color: #e8f3db; }

/* Aspect ratios, so the box is reserved before the image lands */
.media--16x9   { aspect-ratio: 16 / 9; }
.media--4x3    { aspect-ratio: 4 / 3; }
.media--square { aspect-ratio: 1 / 1; }
.media--tall   { aspect-ratio: 3 / 4; }

.media--leaf { border-radius: var(--radius-leaf); }

/* Slow zoom on hover — pairs with .card--hover */
.media--zoom > img { transition: transform 600ms var(--ease); }
.media--zoom:hover > img { transform: scale(1.04); }


/* 12. BADGES & TAGS ======================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.3em 0.75em;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    color: var(--clr-forest-700);
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}
.theme-dark .badge { color: var(--primary); }

.badge--berry {
    background: var(--clr-berry-soft);
    color: color-mix(in srgb, var(--clr-berry) 80%, #000);
    border-color: color-mix(in srgb, var(--clr-berry) 35%, transparent);
}
.badge--sky {
    background: var(--clr-sky-soft);
    color: color-mix(in srgb, var(--clr-sky) 80%, #000);
    border-color: color-mix(in srgb, var(--clr-sky) 35%, transparent);
}
.badge--amber {
    background: var(--clr-amber-soft);
    color: color-mix(in srgb, var(--clr-amber) 80%, #000);
    border-color: color-mix(in srgb, var(--clr-amber) 35%, transparent);
}
.badge--heather {
    background: var(--clr-heather-soft);
    color: color-mix(in srgb, var(--clr-heather) 80%, #000);
    border-color: color-mix(in srgb, var(--clr-heather) 35%, transparent);
}

.theme-dark .badge--berry   { color: var(--clr-berry); }
.theme-dark .badge--sky     { color: var(--clr-sky); }
.theme-dark .badge--amber   { color: var(--clr-amber); }
.theme-dark .badge--heather { color: var(--clr-heather); }

.badge--solid {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
}

/* Little status dot */
.badge--dot::before {
    content: "";
    width: 0.45em;
    height: 0.45em;
    border-radius: 50%;
    background: currentColor;
}


/* 13. CALLOUTS / ALERTS =================================================== */

.callout {
    max-width: var(--measure);
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
    border-left-width: 4px;
    background: var(--primary-soft);
    color: var(--text);
}
.callout__title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: var(--fs-sm);
    letter-spacing: 0.01em;
    margin-bottom: var(--sp-1);
}
.callout p { font-size: var(--fs-sm); color: var(--text-muted); }

.callout--note {
    background: var(--clr-sky-soft);
    border-color: color-mix(in srgb, var(--clr-sky) 35%, transparent);
}
.callout--warn {
    background: var(--clr-amber-soft);
    border-color: color-mix(in srgb, var(--clr-amber) 40%, transparent);
}
.callout--alert {
    background: var(--clr-berry-soft);
    border-color: color-mix(in srgb, var(--clr-berry) 40%, transparent);
}


/* 14. FORMS =============================================================== */

.field { display: block; margin-bottom: var(--sp-4); max-width: 34rem; }

.label {
    display: block;
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 600;
    margin-bottom: var(--sp-2);
    color: var(--text);
}
.label .req { color: var(--clr-berry); }

.input,
.textarea,
.select {
    width: 100%;
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    padding: 0.7em 0.9em;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.input:hover, .textarea:hover, .select:hover { border-color: var(--clr-moss-400); }

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.textarea { min-height: 8rem; resize: vertical; line-height: 1.6; }

.select {
    appearance: none;
    padding-right: 2.4em;
    background-image:
            linear-gradient(45deg, transparent 50%, currentColor 50%),
            linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
            calc(100% - 1.15em) 55%,
            calc(100% - 0.75em) 55%;
    background-size: 0.4em 0.4em, 0.4em 0.4em;
    background-repeat: no-repeat;
}

.input:disabled, .textarea:disabled, .select:disabled {
    background: var(--bg-sunken);
    color: var(--text-faint);
    cursor: not-allowed;
}

.input.is-invalid, .textarea.is-invalid {
    border-color: var(--clr-berry);
}
.field__hint  { font-size: var(--fs-xs); color: var(--text-faint); margin-top: var(--sp-2); }
.field__error { font-size: var(--fs-xs); color: var(--clr-berry); margin-top: var(--sp-2); }

.check {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-2);
    cursor: pointer;
}
.check input[type="checkbox"],
.check input[type="radio"] {
    accent-color: var(--primary);
    width: 1.05em;
    height: 1.05em;
    margin-top: 0.28em;
    flex: none;
}

/* Inline search / signup row */
.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: stretch;
}
.form-inline .input { flex: 1 1 14rem; width: auto; }


/* 15. TABLES ============================================================== */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
    font-family: var(--font-sans);
}

caption {
    caption-side: bottom;
    padding: var(--sp-3);
    font-size: var(--fs-xs);
    color: var(--text-faint);
    text-align: left;
}

thead th {
    text-align: left;
    font-weight: 700;
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface-alt);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}

tbody td, tbody th {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
tbody th { font-weight: 600; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }

.table--zebra tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--surface-alt) 45%, transparent);
}
.table--hover tbody tr {
    transition: background-color var(--dur) var(--ease);
}
.table--hover tbody tr:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.num { text-align: right; font-variant-numeric: tabular-nums; }


/* 16. CODE ================================================================ */

code, samp {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: var(--surface-alt);
    color: var(--clr-forest-700);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.theme-dark code, .theme-dark samp { color: var(--clr-fern-300); }

pre {
    overflow-x: auto;
    background: var(--clr-forest-900);
    color: #d8e6d2;
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    line-height: 1.55;
    font-size: var(--fs-sm);
}
pre code {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font-size: 1em;
}


/* 17. NAV, HERO, FOOTER =================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-5);
    padding-block: var(--sp-3);
}

.nav__brand {
    font-family: var(--font-head);
    font-size: var(--fs-md);
    font-weight: 700;
    letter-spacing: var(--ls-tight);
    color: var(--clr-forest-800);
    text-decoration: none;
    font-variation-settings: "SOFT" 35, "WONK" 1;
}
.theme-dark .nav__brand { color: #dcebd7; }

.nav__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav__link {
    display: block;
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 500;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.45em 0.85em;
    border-radius: var(--radius-pill);
    transition: background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.nav__link:hover {
    background: var(--surface-alt);
    color: var(--text);
}
.nav__link[aria-current="page"],
.nav__link.is-active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.hero {
    padding-block: var(--sp-9) var(--sp-8);
    text-align: left;
}
.hero__title {
    font-size: var(--fs-4xl);
    line-height: 1.03;
    letter-spacing: -0.03em;
    font-weight: 500;
    font-variation-settings: "SOFT" 60, "WONK" 1;
}
.hero__sub {
    font-size: var(--fs-md);
    color: var(--text-muted);
    max-width: 52ch;
    margin-top: var(--sp-4);
}
.hero__actions { margin-top: var(--sp-6); }
.hero--center { text-align: center; }
.hero--center .hero__sub { margin-inline: auto; }
.hero--center .hero__actions { justify-content: center; display: flex; }

.site-footer {
    margin-top: var(--sp-8);
    padding-block: var(--sp-6);
    border-top: 1px solid var(--border);
    background: var(--bg-sunken);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--link-hover); }


/* 18. UTILITIES =========================================================== */

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-balance { text-wrap: balance; }

/* --- Text colour ---------------------------------------------------------
   Named to mirror the .bg-* fills. Every one of these is theme-aware: the
   greens and browns darken for light mode and lighten for dark, so a
   .text-moss heading reads at 4.5:1 or better either way. No .text-fern —
   fern is a decorative green that sits at 1.8:1 on paper.

   (.text-center / .text-right above are alignment, not colour.)       */

.text-default { color: var(--text); }
.text-muted   { color: var(--text-muted); }
.text-faint   { color: var(--text-faint); }
.text-invert  { color: var(--text-invert); }

.text-primary { color: var(--primary); }
.text-forest  { color: var(--text-forest); }
.text-moss    { color: var(--text-moss); }
.text-bark    { color: var(--text-bark); }

.text-berry   { color: var(--clr-berry); }
.text-sky     { color: var(--clr-sky); }
.text-amber   { color: var(--clr-amber); }
.text-heather { color: var(--clr-heather); }

.text-link    { color: var(--link); }
.text-inherit { color: inherit; }

/* Older aliases, kept so existing markup doesn't break */
.u-primary { color: var(--primary); }
.u-berry   { color: var(--clr-berry); }
.u-sky     { color: var(--clr-sky); }
.u-amber   { color: var(--clr-amber); }
.u-heather { color: var(--clr-heather); }

/* --- Backgrounds ---------------------------------------------------------
   Theme-aware fills. These follow the light/dark tokens, so text laid on
   them keeps working in both themes without any extra rules.            */

.bg-page    { background: var(--bg); }
.bg-sunken  { background: var(--bg-sunken); }
.bg-surface { background: var(--surface); }
.bg-moss    { background: var(--surface-alt); }

/* The one solid brand fill. Unlike the inverted panels below it flips with
   the theme — dark green with pale text in light mode, pale green with dark
   text in dark mode — so everything inside just inherits. */
.bg-primary {
    background-color: var(--primary);
    color: var(--on-primary);
}
:is(.bg-primary, .section--primary) :is(h1, h2, h3, h4, h5, h6, strong, b, dt) { color: inherit; }
:is(.bg-primary, .section--primary) a:not(.btn) { color: inherit; }
:is(.bg-primary, .section--primary) :is(.muted, .lead, .caption, .card__body, small, .eyebrow) {
    color: color-mix(in srgb, currentColor 85%, transparent);
}

/* Accent washes — pale tints of the four accent hues */
.bg-berry   { background: var(--clr-berry-soft); }
.bg-sky     { background: var(--clr-sky-soft); }
.bg-amber   { background: var(--clr-amber-soft); }
.bg-heather { background: var(--clr-heather-soft); }

/* Gradients */
.bg-mist {
    background: linear-gradient(180deg, var(--surface-alt), transparent);
}
.bg-dawn {
    background: linear-gradient(150deg, var(--clr-amber-soft), var(--clr-berry-soft));
}

/* --- Shade steps ---------------------------------------------------------
   Chain onto anything with a background — a section, a card, a badge — to
   nudge it one step lighter or darker than whatever it already is:

     <section class="section bg-moss darker">
     <div class="card lighter">

   Note that repeating a class does nothing (the DOM keeps one copy), so the
   second step has its own name: .lighter-2 / .darker-2.

   These paint a flat gradient over the element's background-COLOR, which is
   why they compose with every fill above — but they will replace a
   background-IMAGE, so they don't combine with .bg-mist, .bg-dawn or
   .bg-canopy.                                                            */

.lighter   { background-image: linear-gradient(var(--tint-up),     var(--tint-up)); }
.lighter-2 { background-image: linear-gradient(var(--tint-up-2),   var(--tint-up-2)); }
.darker    { background-image: linear-gradient(var(--tint-down),   var(--tint-down)); }
.darker-2  { background-image: linear-gradient(var(--tint-down-2), var(--tint-down-2)); }

/* Darkening a pale surface eats into the contrast of the faintest text, so
   the shade step darkens that text by the same amount it darkens the panel. */
.darker   { --text-faint: #525e54; }
.darker-2 { --text-faint: #46524a; --text-muted: #48554b; }

/* In dark mode the risk runs the other way — lightening is what closes the
   gap — so the repair swaps ends. */
.theme-dark .darker,
.theme-dark .darker-2 {
    --text-faint: #829581;
    --text-muted: #a3b6a1;
}
.theme-dark .lighter   { --text-faint: #95a794; }
.theme-dark .lighter-2 { --text-faint: #aebcac; }

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light):not(.theme-dark) :is(.darker, .darker-2) {
        --text-faint: #829581;
        --text-muted: #a3b6a1;
    }
    :root:not(.theme-light):not(.theme-dark) .lighter   { --text-faint: #95a794; }
    :root:not(.theme-light):not(.theme-dark) .lighter-2 { --text-faint: #aebcac; }
}


/* --- Inverted panels -----------------------------------------------------
   Dark fills that stay dark in both themes. Headings, links and .muted are
   coloured explicitly elsewhere in this file, so they're re-pointed here —
   otherwise dark green type would land on a dark green panel.
   The matching .section--* bands share these rules.                     */

.bg-forest { background: var(--clr-forest-800); }
.bg-night  { background: var(--clr-forest-900); }
.bg-bark   { background: var(--clr-bark-700); }
.bg-canopy {
    background: linear-gradient(155deg, var(--clr-forest-700), var(--clr-forest-900));
}

:is(.bg-forest, .bg-night, .bg-bark, .bg-canopy,
    .section--forest, .section--night, .section--bark, .section--canopy) { color: #eef3ea; }

:is(.bg-forest, .bg-night, .bg-bark, .bg-canopy,
    .section--forest, .section--night, .section--bark, .section--canopy)
:is(h1, h2, h3, h4, h5, h6, strong, b, dt) { color: #ffffff; }

:is(.bg-forest, .bg-night, .bg-bark, .bg-canopy,
    .section--forest, .section--night, .section--bark, .section--canopy)
:is(.muted, .lead, .caption, .card__body, small) { color: #c2d2bd; }

:is(.bg-forest, .bg-night, .bg-bark, .bg-canopy,
    .section--forest, .section--night, .section--bark, .section--canopy)
:is(a, .eyebrow) { color: var(--clr-fern-300); }

:is(.bg-forest, .bg-night, .bg-bark, .bg-canopy,
    .section--forest, .section--night, .section--bark, .section--canopy) hr { background: rgba(255, 255, 255, 0.18); }

/* An outline button needs a visible edge on a dark panel */
:is(.bg-forest, .bg-night, .bg-bark, .bg-canopy,
    .section--forest, .section--night, .section--bark, .section--canopy) .btn--outline {
    --btn-fg: #eef3ea;
    --btn-bd: rgba(255, 255, 255, 0.35);
}
:is(.bg-forest, .bg-night, .bg-bark, .bg-canopy,
    .section--forest, .section--night, .section--bark, .section--canopy) .btn--outline:hover {
    --btn-bg: rgba(255, 255, 255, 0.12);
    --btn-fg: #ffffff;
    --btn-bd: rgba(255, 255, 255, 0.6);
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }

.mx-auto { margin-inline: auto; }
.measure { max-width: var(--measure); }
.full-bleed { width: 100%; max-width: none; }

.round      { border-radius: var(--radius-lg); }
.round-leaf { border-radius: var(--radius-leaf); overflow: hidden; }
.shadow     { box-shadow: var(--shadow); }
.shadow-lg  { box-shadow: var(--shadow-lg); }

.hidden { display: none !important; }

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


/* 19. RESPONSIVE ========================================================== */

@media (max-width: 60rem) {
    :root {
        --fs-3xl: 2.4rem;
        --fs-4xl: 2.9rem;
        --sp-8: 3.5rem;
        --sp-9: 4.5rem;
    }
    .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 40rem) {
    :root {
        --fs-2xl: 1.95rem;
        --fs-3xl: 2.1rem;
        --fs-4xl: 2.4rem;
        --sp-8: 3rem;
        --sp-9: 3.5rem;
    }
    .container { padding-inline: var(--sp-4); }
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .nav { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
    .btn-group { width: 100%; }
    .btn-group .btn { flex: 1 1 auto; }
    .quote-pull { font-size: var(--fs-lg); }
}


/* 20. ACCESSIBILITY, MOTION, PRINT ======================================== */

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
.btn:focus-visible { outline-offset: 3px; }

.skip-link {
    position: absolute;
    left: var(--sp-4);
    top: -4rem;
    z-index: 100;
    background: var(--primary);
    color: var(--on-primary);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--radius);
    text-decoration: none;
    transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .btn:hover, .card--hover:hover { transform: none; }
}

@media (prefers-contrast: more) {
    :root {
        --text-muted: var(--text);
        --border: var(--border-strong);
    }
}

@media print {
    body { background: #fff; color: #000; }
    .site-header, .site-footer, .btn, .skip-link { display: none !important; }
    a { text-decoration: underline; color: #000; }
    .card, .table-wrap { box-shadow: none; border: 1px solid #999; }
    pre { background: #f2f2f2; color: #000; }
}