@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&display=swap');

/* base.css — shared styles used by base.html on every page */


/* 1. Design Tokens  (palette unchanged — sage + clay) */
:root {
    /* Brand palette */
    --primary: #2f6e63;
    --primary-dark: #234f47;
    --primary-light: #3f8a7d;
    --accent: #c08a4a;

    /* Surfaces & text */
    --surface: #f6f8f7;
    --surface-raised: #ffffff;
    --text: #1f2a28;
    --text-muted: #5b6562;
    --border: #e5e9e7;

    /* Interactive */
    --btn: var(--primary);
    --btn-hover: var(--primary-dark);
    --focus: var(--accent);

    /* Type */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Shape & rhythm */
    --radius: 4px;
    --pad-x: clamp(22px, 5vw, 56px);
    --rule: 1px solid var(--border);
    --shadow: 0 12px 34px rgba(31, 42, 40, 0.12);
    --t: 0.2s ease;

    /* Recurring "clay rule" motif (short decorative bar under headings) */
    --bar-w: 46px;       /* standard length */
    --bar-w-sm: 16px;    /* nav active-link indicator */
    --bar-h: 2px;
    --dash-w: 6px;       /* dash bullet used by list patterns in pages.css */

    color-scheme: light dark;
}

/* @media (prefers-color-scheme: dark) {
    :root {
        --primary: #2f6e63;
        --primary-dark: #d2ddd8;
        --primary-light: #f2f6f4;
        --accent: #e0a766;
        --surface: #1b2321;
        --surface-raised: #232c2a;
        --text: #e9efed;
        --text-muted: #aab4b1;
        --border: #2d3633;
        --btn: #2f6e63;
        --btn-hover: #234f47;
        --focus: #eaf2ee;
        --shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
    }
} */


/* 2. Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-padding-top: 80px; }

body {
    font-family: var(--font-sans);
    background: var(--surface);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

img, picture, video, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
h1, h2, h3, h4, h5, h6, p { overflow-wrap: break-word; }


/* 3. Typography */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-optical-sizing: auto;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

/* In-content links (any page rendered inside <main>) */
main p a,
main li a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: color var(--t);
}
main p a:hover,
main li a:hover {
    color: var(--primary-dark);
    text-decoration-thickness: 2px;
}


/* 4. Accessibility — focus ring & skip link */
*:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 200;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: top var(--t);
}
.skip-link:focus { top: 0; }


/* 5. Reusable helpers */

/* Small uppercase label above a heading */
.eyebrow {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 10px;
}

/* Centered section header with the clay-rule motif underneath */
.section-head {
    max-width: 760px;
    margin: 0 auto 48px;
    text-align: center;
}
.section-head h2 {
    font-size: clamp(1.7rem, 3.2vw, 2.3rem);
    font-weight: 500;
}
.section-head h2::after {
    content: '';
    display: block;
    width: var(--bar-w);
    height: var(--bar-h);
    background: var(--primary);
    margin: 20px auto 0;
}

/* Generic content column used inside sections */
.section-content { max-width: 1040px; margin-top: 22px; }
.section-content h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); font-weight: 500; margin-bottom: 18px; }
.section-content h3 { font-weight: 500; margin-bottom: 10px; }
.section-content p  { color: var(--text-muted); font-size: 1.04rem; line-height: 1.8; }
.section-content p + p { margin-top: 16px; }
.section-content a  { font-weight: 600; }


/* 6. Buttons (component) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background var(--t), color var(--t), border-color var(--t), transform var(--t);
}
.btn:hover { transform: translateY(-1px); }

/* On light backgrounds */
.btn-primary { background: var(--btn); color: #fff; border-color: var(--btn); }
.btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }

/* On the colored hero / CTA bands */
.btn-light { background: #fff; color: var(--btn); border-color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, 0.88); }

.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.14); border-color: #fff; }


/* 7. Header & primary nav */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px var(--pad-x);
    background: var(--surface-raised);
    border-bottom: var(--rule);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-nav-panel { display: flex; align-items: center; gap: 36px; }
.mobile-nav-toggle, .mobile-nav-backdrop { display: none; }

header .logo { height: 38px; width: auto; transition: opacity var(--t); }
header .logo:hover { opacity: 0.82; }

/* Logo swaps with the color scheme */
@media (prefers-color-scheme: dark) {
    .logo-swap-dark .logo-normal { display: none; }
    .logo-swap-dark .logo-dark-mode { display: block; }
}
@media (prefers-color-scheme: light) {
    .logo-swap-dark .logo-normal { display: block; }
    .logo-swap-dark .logo-dark-mode { display: none; }
}

nav { display: flex; align-items: center; gap: 36px; }
.nav-list { display: flex; list-style: none; gap: 30px; }

.nav-list a,
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--t);
}
.nav-list a:hover,
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"] { color: var(--primary); }

/* Active link — short centered clay rule (the recurring motif) */
.nav-list a.is-current { position: relative; color: var(--primary); font-weight: 600; }
.nav-list a.is-current::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -8px;
    width: var(--bar-w-sm);
    height: var(--bar-h);
    background: var(--primary);
}

.nav-dropdown-caret { transition: transform var(--t); }
.nav-dropdown-toggle[aria-expanded="true"] .nav-dropdown-caret { transform: rotate(180deg); }

/* Ghost CTA — outline fills on hover */
.nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 22px;
    background: transparent;
    color: var(--btn);
    border: 1.5px solid var(--btn);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    transition: background var(--t), color var(--t);
}
.nav-cta:hover { background: var(--btn); color: #fff; }


/* 8. Nav dropdown  (disclosure; visibility via [hidden]) */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    min-width: 220px;
    list-style: none;
    background: var(--surface-raised);
    border: var(--rule);
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 200;
}
.nav-dropdown-menu a {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
    background: var(--surface);
    color: var(--primary);
    outline: none;
}


/* 9. Footer  (hairline-divided links, no glyph separators) */
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 28px var(--pad-x);
    border-top: var(--rule);
    color: var(--text-muted);
    font-size: 0.88rem;
}

footer a { color: inherit; text-decoration: none; cursor: pointer; transition: color var(--t); }
footer a:hover { color: var(--primary); }

footer .sitelist {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    gap: 0;
    margin: 6px 0;
}
/* Hairline dividers between items; JS adds .is-line-start to wrapped items */
footer .sitelist li + li {
    margin-left: 14px;
    padding-left: 14px;
    border-left: var(--rule);
}
footer .sitelist li.is-line-start { margin-left: 0; padding-left: 0; border-left: none; }

footer .sitelist--small { font-size: 0.8rem; opacity: 0.78; }
footer .footer-meta { margin-top: 14px; font-weight: 500; }
.footer-copyright { margin-top: 10px; font-size: 0.78rem; letter-spacing: 0.02em; opacity: 0.7; }


/* 10. Reveal-on-scroll  (JS toggles .revealed) */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
.hero .reveal { transform: translateY(14px); }


/* 11. Mobile nav drawer  (≤ 768px) */
@media (max-width: 768px) {
    header { padding: 14px 20px; }

    /* Hamburger toggle */
    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: var(--rule);
        border-radius: var(--radius);
        color: var(--text);
        cursor: pointer;
        transition: background var(--t), border-color var(--t);
    }
    .mobile-nav-toggle:hover { background: var(--surface); }

    .mobile-nav-toggle-bars { position: relative; display: block; width: 18px; height: 12px; }
    .mobile-nav-toggle-bars span {
        position: absolute; left: 0; right: 0; height: 2px;
        background: currentColor; border-radius: 2px;
        transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
    }
    .mobile-nav-toggle-bars span:nth-child(1) { top: 0; }
    .mobile-nav-toggle-bars span:nth-child(2) { top: 5px; }
    .mobile-nav-toggle-bars span:nth-child(3) { top: 10px; }
    .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
    .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-bars span:nth-child(2) { opacity: 0; }
    .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

    /* Backdrop */
    .mobile-nav-backdrop {
        display: block; position: fixed; inset: 0;
        background: rgba(0, 0, 0, 0.4); opacity: 0;
        transition: opacity 0.25s ease; z-index: 90;
    }
    .mobile-nav-backdrop[hidden] { display: none; }
    .mobile-nav-backdrop.is-visible { opacity: 1; }

    /* Slide-out panel */
    .site-nav-panel {
        position: fixed; inset: 0 0 0 auto;
        width: min(320px, 85vw);
        flex-direction: column; align-items: stretch; justify-content: flex-start;
        gap: 8px; padding: 80px 24px 32px;
        background: var(--surface-raised);
        border-left: var(--rule);
        box-shadow: var(--shadow);
        transform: translateX(100%);
        transition: transform 0.25s ease;
        z-index: 95; overflow-y: auto;
    }
    .site-nav-panel.is-open { transform: translateX(0); }
    .site-nav-panel nav { width: 100%; }

    .site-nav-panel .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav-panel .nav-list > li { border-bottom: var(--rule); }
    .site-nav-panel .nav-list > li:last-child { border-bottom: none; }
    .site-nav-panel .nav-list a,
    .site-nav-panel .nav-dropdown-toggle { width: 100%; padding: 14px 4px; font-size: 1rem; }
    .site-nav-panel .nav-list a.is-current::after { display: none; }
    .site-nav-panel .nav-dropdown-toggle { justify-content: space-between; }

    /* Submenu collapses inline inside the drawer */
    .site-nav-panel .nav-dropdown { position: static; }
    .site-nav-panel .nav-dropdown-menu {
        position: static; min-width: 0; margin: 0 0 8px;
        padding: 4px 0 8px 12px; background: transparent; border: none; box-shadow: none;
    }
    .site-nav-panel .nav-dropdown-menu a { padding: 10px 4px; font-size: 0.95rem; }
    .site-nav-panel .nav-cta { width: 100%; margin-top: 16px; padding: 12px 22px; font-size: 0.9rem; }

    body.nav-open { overflow: hidden; }

    /* Shared section header spacing tightens on mobile */
    .section-head { margin-bottom: 36px; }

    /* Footer reflow */
    footer { padding: 26px 20px 22px; }
    footer .sitelist { padding-bottom: 14px; border-bottom: var(--rule); width: 100%; }
    footer .sitelist:last-of-type { padding-bottom: 0; border-bottom: none; }
    footer .footer-meta { flex-direction: column; gap: 2px; }
    footer .footer-meta li + li { margin-left: 0; padding-left: 0; border-left: none; }
}


/* 12. Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 768px) {
    .site-nav-panel,
    .mobile-nav-backdrop,
    .mobile-nav-toggle-bars span { transition: none !important; }
}