/* ============================================================
   SHARED CHROME STYLES — reset, design tokens, scroll reveal,
   the navbar and the footer. Linked by every page in the site
   root; posts get the same rules through posts/post.css.

   This is the styling half of partials.js: that file owns the
   nav and footer markup, this one owns how they look. Three
   hand-kept copies is how About and Blog ended up with a
   different footer link colour and a dimmer body text than the
   homepage.

   Page-specific CSS stays inline on each page, after this file,
   so it can still override anything here.
   ============================================================ */

/* ============ RESET & BASE ============ */
        * { margin: 0; padding: 0; box-sizing: border-box; }
        html { scroll-behavior: smooth; }
        body {
            font-family: 'Epilogue', sans-serif;
            color: #E8E4DB;
            line-height: 1.6;
            background: #0A0A0A;
            overflow-x: hidden;
        }

        /* ============ DESIGN TOKENS ============ */
        :root {
            --deep-green: #0A0A0A;
            --mid-green: #F7F4EE;
            --forest: #EDE9E0;
            --cream: #F0EBE0;
            --cream-muted: rgba(240, 235, 224, 0.6);
            --cream-faint: rgba(240, 235, 224, 0.12);
            --orange: #D8572A;
            --orange-glow: rgba(216, 87, 42, 0.15);
            --orange-hover: #E8633A;
            --text-primary: #F0EBE0;
            --text-secondary: rgba(240, 235, 224, 0.78);
            --text-muted: rgba(240, 235, 224, 0.45);
            --border: rgba(240, 235, 224, 0.1);
            --border-hover: rgba(240, 235, 224, 0.2);
            --card-bg: rgba(240, 235, 224, 0.04);
            --card-bg-hover: rgba(240, 235, 224, 0.07);
        }

        /* ============ SCROLL REVEAL ============ */
        .reveal {
            opacity: 0;
            transform: translateY(40px);
            transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .reveal.in-view {
            opacity: 1;
            transform: translateY(0);
        }
        .reveal-delay-1 { transition-delay: 0.1s; }
        .reveal-delay-2 { transition-delay: 0.2s; }
        .reveal-delay-3 { transition-delay: 0.3s; }

        /* ============ NAVBAR ============ */
        nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 100;
            padding: 20px 0;
            transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
        }
        nav.scrolled {
            background-color: rgba(10, 10, 10, 0.92);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--border);
        }
        nav .container {
            padding: 0 48px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        /* the wordmark is now the BB mark; the type rules stay so the alt text
           still reads as the brand if the SVG ever fails to load */
        .nav-brand {
            font-family: 'Anton', sans-serif;
            font-size: 22px;
            letter-spacing: 1.5px;
            color: var(--cream);
            text-transform: uppercase;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
        }
        .nav-logo {
            display: block;          /* no baseline gap under the image */
            height: 34px; width: auto;
        }
        .nav-links {
            display: flex;
            gap: 32px;
            align-items: center;
        }
        .nav-links a {
            text-decoration: none;
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 500;
            transition: color 0.3s ease;
            letter-spacing: 0.5px;
        }
        .nav-links a:hover { color: var(--cream); }
        .nav-cta {
            background-color: var(--orange) !important;
            color: var(--cream) !important;
            padding: 10px 24px;
            border-radius: 6px;
            font-weight: 600;
            font-size: 14px;
            transition: background-color 0.3s ease, transform 0.2s ease;
        }
        .nav-cta:hover {
            background-color: var(--orange-hover) !important;
            transform: translateY(-1px);
        }

        .hamburger {
            display: none;
            flex-direction: column;
            cursor: pointer;
            gap: 5px;
            background: none;
            border: 0;
            /* 44x44 hit area without shifting the layout */
            padding: 14px 10px;
            margin: -14px -10px;
            touch-action: manipulation;
        }
        .hamburger span {
            width: 24px;
            height: 2px;
            background-color: var(--cream);
            border-radius: 1px;
            transition: transform 0.3s ease, opacity 0.3s ease;
        }
        .hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
        .hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
        .hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
        @keyframes nav-menu-in {
            from { opacity: 0; transform: translateY(-6px); }
            to { opacity: 1; transform: translateY(0); }
        }@media (prefers-reduced-motion: reduce) {

            .nav-links.mobile-open { animation: none; }
            .hamburger span { transition: none; }
}


        /* ============ FOOTER ============ */
        .site-footer { padding: 60px 40px 30px; border-top: 1px solid var(--border); }
        .footer-grid {
            max-width: 1200px; margin: 0 auto;
            display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px;
        }
        .footer-brand {
            font-family: 'Anton', sans-serif; font-size: 20px;
            letter-spacing: 1px; color: var(--cream);
            text-transform: uppercase; margin-bottom: 12px;
        }
        .footer-tagline { font-size: 14px; color: var(--text-secondary); font-weight: 300; }
        .footer-role {
            font-size: 11px; font-weight: 600; letter-spacing: 2px;
            color: var(--text-muted); text-transform: uppercase; margin-top: 12px;
        }
        .footer-col h4 {
            font-size: 11px; font-weight: 600; letter-spacing: 2px;
            color: var(--text-muted); text-transform: uppercase; margin-bottom: 16px;
        }
        .footer-col a {
            /* flex, not block, so the Connect glyphs sit on the text's baseline
               row; the Navigate links have no icon and are unaffected */
            display: flex; align-items: center; gap: 8px;
            color: var(--text-secondary); text-decoration: none;
            font-size: 14px; margin-bottom: 10px; transition: color 0.3s ease;
        }
        .footer-icon {
            flex: none; width: 15px; height: 15px;
            color: var(--orange);          /* fill="currentColor" reads this */
            transition: color 0.3s ease;
        }
        .footer-col a:hover .footer-icon { color: var(--orange-hover); }
        .footer-col a:hover { color: var(--cream); }
        /* the Connect links are the ones carrying a glyph — both run orange */
        .footer-col a:has(.footer-icon),
        .footer-col a.footer-mail { color: var(--orange); }
        .footer-col a:has(.footer-icon):hover,
        .footer-col a.footer-mail:hover { color: var(--orange-hover); }
        .footer-bottom {
            max-width: 1200px; margin: 40px auto 0; padding-top: 20px;
            border-top: 1px solid var(--border);
            display: flex; justify-content: space-between;
            font-size: 13px; color: var(--text-muted);
        }
        .footer-bottom a { color: var(--text-muted); text-decoration: none; transition: color 0.3s ease; }
        .footer-bottom a:hover { color: var(--text-secondary); }

        /* ============ NEWSLETTER SIGNUP ============
           One component, two frames that ship:
             .nl--wide    light section immediately above the footer (every content page)
             .nl--inline  bordered card at the end of a post
           .nl--band, the centred arrangement, is no longer used by any page —
           blog.html carried it until the pre-footer section went beige and made
           it the same block twice. It stays because preview-newsletter-beige.html
           still draws variants B and C with it.
           Only the frame changes; .nl-* is shared. Behaviour lives in
           partials.js next to the nav, footer and contact modal, because the
           footer variant is on every page and a per-page copy would drift.

           Single opt-in: the POST to /api/subscribe *is* the subscription.
           Nothing here may tell the reader to go and click a confirmation
           link, because no confirmation mail is sent. */
        .nl { --nl-gap: 10px; }
        .nl-eyebrow {
            font-size: 11px; font-weight: 600; letter-spacing: 2px;
            text-transform: uppercase; color: var(--text-muted);
        }
        .nl-title {
            font-family: 'Anton', sans-serif; font-weight: 400;
            text-transform: uppercase; line-height: 1.08; color: var(--cream);
            letter-spacing: -.2px;
        }
        .nl-copy {
            font-size: 15px; font-weight: 300; line-height: 1.65; color: var(--text-secondary);
        }
        .nl-form { display: flex; gap: var(--nl-gap); flex-wrap: wrap; }
        .nl-input {
            flex: 1 1 220px; min-width: 0;
            font-family: 'Epilogue', sans-serif; font-size: 15px;
            padding: 13px 15px; border-radius: 6px;
            background: var(--card-bg); border: 1px solid var(--border);
            color: var(--text-primary);
            transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
        }
        .nl-input::placeholder { color: var(--text-muted); }
        .nl-input:focus {
            outline: none; background: var(--card-bg-hover);
            border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-glow);
        }
        .nl.is-error .nl-input { border-color: var(--orange); }
        .nl-btn {
            flex: none; font-family: 'Epilogue', sans-serif;
            font-size: 15px; font-weight: 600; padding: 13px 24px;
            border: 0; border-radius: 6px; cursor: pointer;
            background: var(--orange); color: #F0EBE0;
            transition: background-color .25s ease, transform .2s ease, opacity .2s ease;
        }
        .nl-btn:hover { background: var(--orange-hover); transform: translateY(-1px); }
        .nl-btn[disabled] { opacity: .55; cursor: default; transform: none; }
        /* Hidden while sending: there is no "one second" message any more, and a
           displayed-but-empty line would jump the layout the moment you submit. */
        .nl-status {
            font-size: 13.5px; font-weight: 500; margin-top: 10px;
            color: var(--orange); display: none;
        }
        .nl.is-error .nl-status { display: block; }
        /* Success replaces the form outright — the flow ends, it doesn't linger. */
        .nl-done { display: none; align-items: flex-start; gap: 11px; }
        .nl.is-done .nl-form, .nl.is-done .nl-status { display: none; }
        .nl.is-done .nl-done { display: flex; }
        .nl-check { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--orange); }
        .nl-done p { font-size: 15px; font-weight: 400; color: var(--text-primary); line-height: 1.6; }
        .nl-done p span { display: block; font-size: 13px; font-weight: 300; color: var(--text-muted); margin-top: 4px; }
        /* Visually-hidden label — a placeholder is not an accessible name. */
        .nl-vh {
            position: absolute; width: 1px; height: 1px; overflow: hidden;
            clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
        }

        /* ---- A. PRE-FOOTER BAND: its own light section, above the footer ---- */
        .nl--wide {
            max-width: 1200px; margin: 0 auto;
            display: grid; grid-template-columns: 1fr minmax(320px, 460px);
            gap: 56px; align-items: center;
        }
        .nl--wide .nl-title { font-size: clamp(19px, 1.6vw, 24px); margin: 10px 0 12px; }
        .nl--wide .nl-copy { font-size: 15.5px; max-width: 54ch; }
        .nl--wide .nl-input, .nl--wide .nl-btn { font-size: 15px; padding: 14px 18px; }
        .nl--wide .nl-btn { padding-inline: 26px; }
        @media (max-width: 1024px) {
            .nl--wide { grid-template-columns: 1fr; gap: 24px; }
        }
        /* The footer draws its own top rule. Where the light section butts
           straight into it, that rule sits a pixel below the colour change and
           reads as a seam rather than a divider. */
        .nl-section + .site-footer { border-top: 0; }

        /* ---- B. BLOG BAND: the front-door placement, so it gets the room ---- */
        .nl-section {
            padding: clamp(64px, 6vw, 96px) 40px;
            background: var(--mid-green);
            /* LIGHT SECTION OVERRIDES — same token-swap the rest of the site uses */
            --cream: #1A1A1A;
            --cream-faint: rgba(26,26,26,0.08);
            --text-primary: #1A1A1A;
            --text-secondary: #3D3D3D;
            --text-muted: #6B6B6B;
            --border: rgba(26,26,26,0.14);
            --border-hover: rgba(26,26,26,0.25);
            --card-bg: rgba(255,255,255,0.75);
            --card-bg-hover: #FFFFFF;
        }
        .nl--band { max-width: 640px; margin: 0 auto; }
        .nl--band .nl-title { font-size: clamp(28px, 3.2vw, 40px); margin: 14px 0 14px; }
        .nl--band .nl-copy { margin-bottom: 26px; }
        .nl--band .nl-input, .nl--band .nl-btn { font-size: 16px; padding: 15px 18px; }
        .nl--band .nl-btn { padding-inline: 28px; }

        /* ---- C. POST INLINE: a card at the end of the article ---- */
        .nl--inline {
            max-width: 720px; margin: 0 auto 40px;
            padding: 26px 28px; border-radius: 10px;
            border: 1px solid var(--border); border-left: 3px solid var(--orange);
            background: var(--card-bg);
        }
        .nl--inline .nl-title { font-size: 21px; margin: 8px 0 10px; }
        .nl--inline .nl-copy { font-size: 14.5px; margin-bottom: 18px; }

@media (min-width: 2200px) {

            nav .container { padding: 0 80px; }
            .nav-brand { font-size: 30px; }
            .nav-logo { height: 42px; }
}
@media (max-width: 768px) {

            /* footer links were 22px rows stacked 10px apart */
            .footer-col a { padding: 8px 0; margin-bottom: 2px; }
            nav .container { padding: 0 24px; }
            .nav-logo { height: 30px; }
            .nav-links { display: none; }
            .hamburger { display: flex; }
            nav.menu-open { background-color: rgba(10, 10, 10, 0.97); }
            .nav-links.mobile-open {
                display: flex;
                position: absolute;
                top: 100%; left: 0; right: 0;
                flex-direction: column;
                align-items: stretch;
                gap: 0;
                padding: 4px 24px 24px;
                background-color: rgba(10, 10, 10, 0.97);
                backdrop-filter: blur(20px);
                -webkit-backdrop-filter: blur(20px);
                border-bottom: 1px solid var(--border);
                max-height: calc(100vh - 64px);
                max-height: calc(100dvh - 64px);
                overflow-y: auto;
                animation: nav-menu-in 0.22s ease;
            }
            .nav-links.mobile-open a {
                font-size: 17px;
                padding: 16px 0;
                border-bottom: 1px solid var(--border);
            }
            .nav-links.mobile-open .nav-cta {
                margin-top: 20px;
                padding: 14px 24px;
                border-bottom: 0;
                text-align: center;
            }
            .footer-bottom { flex-direction: column; gap: 8px; }
}


/* Chrome rules that were still sitting in each page's own media blocks — the
   footer never collapsing on About is what surfaced them. */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (min-width: 1800px) {
    nav .container { padding: 0 64px; }
    .nav-brand { font-size: 26px; }
    .nav-logo { height: 38px; }
    .nav-links a { font-size: 16px; }
}
/* landscape phones: don't let the fixed bar eat the short viewport */
@media (max-height: 520px) {
    nav { padding: 12px 0; }
}

/* ---- section shell ----
   Every page lays its content out in these. About linked only site.css and
   so had neither: its container ran the full 2000px and the photo sat flush
   to the viewport edge. */
.section { padding: clamp(72px, 7vw, 120px) 40px; position: relative; }
.section .container { max-width: 1200px; margin: 0 auto; }
/* anchor jumps land clear of the fixed nav */
section[id] { scroll-margin-top: 88px; }
@media (max-width: 768px) {
    .section { padding: 80px 24px; }
}

/* ============ "LET'S TALK" MODAL ============
   Shared chrome, like the nav and footer: partials.js appends it to every page
   and the nav CTA opens it. Deliberately self-contained — the footer contact
   card it mirrors is styled inside index.html, so borrowing those class names
   would leave the modal unstyled on every other page. Native <dialog> for the
   focus trap, Escape, background inerting and backdrop. */
.cm {
    position: fixed;
    top: 50%; left: 50%;
    margin: 0;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    padding: 36px;
    border: 1px solid var(--border-hover);
    border-radius: 16px;
    /* solid rather than the card's translucent fill: over a blurred backdrop a
       see-through panel reads as smeared instead of layered */
    background: #121212;
    color: var(--cream);
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
    /* Closed state: below centre and transparent. display and overlay are
       transitioned with allow-discrete so the panel stays rendered through the
       exit — without them a closing dialog leaves the top layer at once and the
       slide-down never plays. translate carries the centring, which leaves
       transform free to carry the slide. */
    translate: -50% -50%;
    transform: translateY(28px);
    opacity: 0;
    transition: transform .34s cubic-bezier(.16, 1, .3, 1),
                opacity .28s ease,
                display .34s allow-discrete,
                overlay .34s allow-discrete;
}
.cm[open] { transform: translateY(0); opacity: 1; }
@starting-style { .cm[open] { transform: translateY(28px); opacity: 0; } }
.cm::backdrop {
    background: rgba(10, 10, 10, 0);
    backdrop-filter: blur(0px);
    transition: background-color .34s ease, backdrop-filter .34s ease,
                display .34s allow-discrete, overlay .34s allow-discrete;
}
.cm[open]::backdrop { background: rgba(10, 10, 10, .72); backdrop-filter: blur(6px); }
@starting-style { .cm[open]::backdrop { background: rgba(10, 10, 10, 0); backdrop-filter: blur(0px); } }

.cm-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.cm-head img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: block; }
.cm-name { font-weight: 600; font-size: 16px; color: var(--cream); }
.cm-role { font-size: 13px; color: var(--text-muted); font-weight: 300; margin-top: 2px; }
/* margin-left:auto rather than space-between, so the avatar and name stay
   tucked together and only the icons travel to the far edge */
.cm-social { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.cm-social a {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    color: var(--orange);
    transition: color .3s ease, background-color .3s ease;
}
.cm-social a:hover { color: var(--orange-hover); background: var(--cream-faint); }
.cm-social svg { width: 17px; height: 17px; fill: currentColor; }

.cm-field { margin-bottom: 18px; }
.cm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cm-field input, .cm-field textarea, .cm-field select {
    width: 100%; background: transparent; border: none;
    border-bottom: 1px solid var(--border-hover);
    padding: 12px 0; color: var(--cream);
    font-family: 'Epilogue', sans-serif; font-size: 15px; font-weight: 300;
    /* px, not a ratio: the select's label renders smaller than the inputs'
       typed text, so a font-relative line box would sit its underline higher
       than its row partner's */
    line-height: 22px;
    outline: none;
    transition: border-color .3s ease;
}
.cm-field textarea { resize: none; height: 96px; }
.cm-field input:focus, .cm-field textarea:focus, .cm-field select:focus { border-color: var(--orange); }
.cm-field input::placeholder, .cm-field textarea::placeholder {
    color: var(--text-muted);
    font-size: 11px; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase;
}
/* no text-transform on the select itself — native popups inherit it and would
   render every option in caps. Its placeholder option is written in caps. */
.cm-field select {
    appearance: none; -webkit-appearance: none; cursor: pointer;
    color: var(--text-muted);
    font-size: 11px; font-weight: 600; letter-spacing: 2px;
}
.cm-field select.filled { color: var(--cream); font-size: 15px; font-weight: 300; letter-spacing: normal; }
.cm-field select option { color: #1A1A1A; letter-spacing: normal; }
.cm-select { position: relative; }
.cm-select::after {
    content: ''; position: absolute; right: 2px; top: 20px;
    width: 7px; height: 7px; pointer-events: none;
    border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted);
    transform: rotate(45deg);
}
/* Autofill: the browser paints its own pale background and near-black text in,
   which on this dark panel lands as white boxes. The background can't be
   re-declared — the UA style wins — but it IS animated, so parking the
   transition years out means it never visibly arrives. */
.cm-field input:-webkit-autofill,
.cm-field input:-webkit-autofill:hover,
.cm-field input:-webkit-autofill:focus,
.cm-field textarea:-webkit-autofill {
    -webkit-text-fill-color: var(--cream);
    caret-color: var(--cream);
    transition: background-color 100000s ease 0s;
    font-family: 'Epilogue', sans-serif; font-size: 15px; font-weight: 300;
}
.cm-field input:autofill, .cm-field textarea:autofill {
    background-image: none; filter: none;
    -webkit-text-fill-color: var(--cream); caret-color: var(--cream);
}
.cm-send {
    background-color: var(--orange); color: var(--cream);
    padding: 16px 36px; border-radius: 8px; border: none;
    font-family: 'Epilogue', sans-serif; font-weight: 600; font-size: 16px;
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    transition: background-color .3s ease, transform .2s ease, box-shadow .3s ease;
}
.cm-send:hover { background-color: var(--orange-hover); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(216, 87, 42, .3); }
.cm-send[disabled] { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.cm-msg { font-size: 13px; margin-top: 12px; min-height: 18px; color: var(--orange); }
.cm-msg a { color: var(--orange); }
.cm-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.cm-sent { text-align: center; padding: 22px 0 6px; }
.cm-sent h3 { font-family: 'Anton', sans-serif; font-weight: 400; text-transform: uppercase; font-size: 22px; margin-bottom: 10px; color: var(--cream); }
.cm-sent p { color: var(--text-secondary); font-size: 15px; font-weight: 300; line-height: 1.6; }
@media (max-width: 768px) {
    .cm { padding: 28px 24px; }
    .cm-row2 { grid-template-columns: 1fr; gap: 0; }
    .cm-social a { width: 30px; height: 30px; }
    /* fields under 16px make iOS zoom the page on focus. The select is excluded
       on purpose: it opens a picker rather than a caret, so it never triggers
       the zoom, and 16px would blow its uppercase label past the placeholders
       beside it. */
    .cm-field input, .cm-field textarea { font-size: 16px; }
    .cm-send { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .cm { transition: opacity .2s ease, display .2s allow-discrete, overlay .2s allow-discrete; }
    .cm, .cm[open] { transform: none; }
}
