/* ==========================================================================
   Dovetailed — shared foundation
   --------------------------------------------------------------------------
   Palette, reset, nav, buttons, footer, animations and section primitives.
   Everything here is identical on every page; page-specific sections stay in
   that page's own inline <style>.

   Why this file exists: the site was ten self-contained HTML files each
   carrying its own copy of the palette, nav and footer. CLAUDE.md said to
   extract "once we're at 4+ pages with churn" — we passed that some time ago,
   and a revamp that edits nav or palette by hand across ten files will drift.

   MIGRATION STATUS (2026-07-29): index.html uses this file. work.html,
   about.html, contact.html, privacy.html and writing/index.html still carry
   their own inline copies — visually identical, so nothing is broken, but
   they are a second source of truth until migrated. Do that next; it is
   mechanical (delete the shared rules, add the <link>).
   ========================================================================== */

:root {
    --color-walnut: #3D2B1F;
    --color-walnut-light: #5C4033;
    --color-teal: #2A9D8F;
    --color-teal-dark: #238379;
    --color-teal-light: #E6F5F3;
    --color-cream: #FAF7F2;
    --color-warm-white: #FFFDF9;
    --color-sand: #E8DFD0;
    --color-sand-light: #F2EDE4;
    --color-text: #2C2420;
    --color-text-muted: #7A6E65;
    --color-gold: #C49A3C;
    --color-gold-light: #F5EDD8;
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-warm-white);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ========== NAV ========== */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
    background: transparent;
}

nav.scrolled {
    background: rgba(250, 247, 242, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(61, 43, 31, 0.06);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--color-walnut);
}

.nav-logo svg { width: 32px; height: 28px; }

.nav-logo-text {
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: -0.01em;
}

.nav-logo-text .ai-highlight,
.ai-highlight { color: var(--color-teal); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-walnut-light);
    text-decoration: none;
    transition: color 0.25s ease;
}

.nav-link:hover { color: var(--color-teal); }

/* Current-page marker. The unmigrated pages define this in their own inline
   CSS; it belongs here so migrated pages don't silently lose the highlight —
   which is exactly what happened when index.html and work.html moved to this
   stylesheet and the nav appeared to "go off" between pages. */
.nav-link.active,
.nav-cta.active { color: var(--color-teal); font-weight: 600; }

.nav-cta {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-teal-dark);
    text-decoration: none;
    padding: 0.6rem 1.4rem;
    border: 1.5px solid var(--color-teal);
    border-radius: 100px;
    transition: all 0.3s ease;
    letter-spacing: 0.01em;
}

.nav-cta:hover {
    background: var(--color-teal);
    color: white;
    transform: translateY(-1px);
}

/* ========== BUTTONS ========== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: var(--color-teal);
    padding: 0.85rem 2rem;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    background: var(--color-teal-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(42, 157, 143, 0.25);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-walnut);
    background: transparent;
    padding: 0.85rem 1.75rem;
    border-radius: 100px;
    text-decoration: none;
    border: 1.5px solid var(--color-sand);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--color-walnut-light);
    transform: translateY(-2px);
}

/* ========== SECTION PRIMITIVES ========== */
.section-label {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-teal);
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.2;
    color: var(--color-walnut);
    margin-bottom: 1rem;
}

/* Decorative dovetail joint — the joinery metaphor, made visible */
.dovetail-divider {
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0 2rem;
}

.dovetail-divider .tooth {
    width: 24px;
    height: 16px;
    background: var(--color-sand);
    clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
}

/* ========== FOOTER ========== */
footer {
    padding: 3rem 2rem 2.5rem;
    background: var(--color-walnut);
    color: rgba(255, 255, 255, 0.5);
}

.footer-cta {
    max-width: 1100px;
    margin: 0 auto 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-cta a {
    color: var(--color-teal);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1.5px solid rgba(42, 157, 143, 0.5);
    padding-bottom: 1px;
    margin-left: 0.4rem;
    transition: border-color 0.25s ease;
}

.footer-cta a:hover { border-bottom-color: var(--color-teal); }

.footer-cta .footer-email {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-cta .footer-email a {
    margin-left: 0;
    color: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.25);
    font-weight: 500;
}

.footer-cta .footer-email a:hover { border-bottom-color: rgba(255, 255, 255, 0.6); }

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-brand .ai-highlight { color: var(--color-teal); }

.footer-tagline {
    font-size: 0.8rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.3);
}

.footer-right { font-size: 0.8rem; }

.footer-links { margin-bottom: 0.4rem; }

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.8rem;
}

.footer-links a:hover { color: rgba(255, 255, 255, 0.75); }

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Respect a user's reduced-motion preference — the reveal animation hides
   content until it fires, so it must never be the reason content is invisible. */
@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;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    nav { padding: 1rem 1.25rem; }
    .nav-right { gap: 0.9rem; }
    .nav-link { font-size: 0.82rem; }
    .nav-cta { padding: 0.5rem 1rem; font-size: 0.8rem; }
    .footer-inner { flex-direction: column; text-align: center; }
}

/* Below ~480px the wordmark + three links + CTA no longer fit on one line —
   measured at 392px of content in a 375px viewport, which clipped the right
   edge of the "Get in touch" button. Drop the wordmark and keep the ///
   mark: it's distinctive on its own, and every nav destination stays
   reachable, which hiding the links would not have preserved. */
@media (max-width: 480px) {
    .nav-logo-text { display: none; }
    .nav-right { gap: 0.75rem; }
    .nav-link { font-size: 0.8rem; }
    .nav-cta { padding: 0.45rem 0.9rem; font-size: 0.78rem; }
}
