/* =============================================
   SHARED CSS — jmillville.com
   Variables, resets, nav, footer, utilities
   ============================================= */

/* ─── LIGHT MODE (default) ─── */
:root {
    --bg:          #f6f3ee;
    --bg-warm:     #eee9e0;
    --bg-dark:     #1a1714;
    --bg-dark-2:   #242019;
    --text-dark:   #1a1714;
    --text-light:  #f6f3ee;
    --text-muted:  #5a534b;
    --accent:      #c45d3e;
    --accent-soft: rgba(196, 93, 62, 0.1);
    --accent-2:    #2d6a5e;
    --border:      rgba(26, 23, 20, 0.08);
    --border-dark: rgba(246, 243, 238, 0.1);
    --ff-display:  'Instrument Serif', Georgia, serif;
    --ff-body:     'Darker Grotesque', sans-serif;
}

/* ─── DARK MODE (auto) ─── */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --bg:          #141210;
        --bg-warm:     #1c1915;
        --bg-dark:     #0a0908;
        --bg-dark-2:   #111010;
        --text-dark:   #e8e4dd;
        --text-light:  #141210;
        --text-muted:  #b5ada5;
        --accent:      #d4714f;
        --accent-soft: rgba(212, 113, 79, 0.12);
        --border:      rgba(232, 228, 221, 0.08);
        --border-dark: rgba(232, 228, 221, 0.12);
    }
    html:not([data-theme="light"]) img { filter: brightness(0.88) contrast(1.05); }
}
html[data-theme="dark"] {
    --bg:          #141210;
    --bg-warm:     #1c1915;
    --bg-dark:     #0a0908;
    --bg-dark-2:   #111010;
    --text-dark:   #e8e4dd;
    --text-light:  #141210;
    --text-muted:  #b5ada5;
    --accent:      #d4714f;
    --accent-soft: rgba(212, 113, 79, 0.12);
    --border:      rgba(232, 228, 221, 0.08);
    --border-dark: rgba(232, 228, 221, 0.12);
}
html[data-theme="dark"] img { filter: brightness(0.88) contrast(1.05); }

/* ─── RESET ─── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--ff-body);
    background: var(--bg);
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ─── ACCESSIBILITY ─── */
.skip-link {
    position: absolute; left: 1rem; top: -48px;
    background: var(--text-dark); color: var(--text-light);
    padding: 0.55rem 0.9rem; border-radius: 8px;
    text-decoration: none; font-size: 0.9rem; font-weight: 600;
    z-index: 300; transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ─── UTILITIES ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.container--narrow { max-width: 780px; margin: 0 auto; padding: 0 2rem; }

/* ─── 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;
}
.nav.scrolled {
    background: rgba(246, 243, 238, 0.92);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 var(--border);
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .nav.scrolled { background: rgba(20, 18, 16, 0.92); }
}
html[data-theme="dark"] .nav.scrolled { background: rgba(20, 18, 16, 0.92); }

.nav-logo {
    font-family: var(--ff-display); font-size: 1.5rem;
    text-decoration: none; letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
    text-decoration: none; font-size: 0.85rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-muted); transition: color 0.3s;
}
.nav-links a:hover { color: var(--text-dark); }
.nav-links a.active { color: var(--accent); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-dark); margin: 5px 0; transition: 0.3s; }

@media (max-width: 768px) {
    .nav-toggle { display: block; z-index: 101; }
    .nav-links {
        position: fixed; inset: 0; background: var(--bg);
        flex-direction: column; align-items: center; justify-content: center;
        gap: 2.5rem; opacity: 0; pointer-events: none; transition: opacity 0.3s;
    }
    .nav-links.open { opacity: 1; pointer-events: all; }
    .nav-links a { font-size: 1.1rem; }
}

/* ─── SECTIONS ─── */
.section { padding: 6rem 0; }
.section-header { margin-bottom: 3.5rem; }
.section-eyebrow {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem;
}
.section-title {
    font-family: var(--ff-display); font-size: clamp(2.2rem, 4vw, 3.2rem);
    letter-spacing: -0.02em; line-height: 1.1;
}
.section-subtitle {
    margin-top: 1rem; font-size: 1.05rem; color: var(--text-muted);
    max-width: 550px; line-height: 1.6; font-weight: 400;
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.85rem 1.8rem; border-radius: 60px; text-decoration: none;
    font-family: var(--ff-body); font-size: 0.85rem; font-weight: 700;
    letter-spacing: 0.04em; text-transform: uppercase;
    transition: all 0.3s ease; cursor: pointer; border: none;
}
.btn--primary { background: var(--text-dark); color: var(--text-light); }
.btn--primary:hover {
    background: var(--accent);
    box-shadow: 0 8px 25px rgba(196, 93, 62, 0.3);
}

/* ─── FOOTER ─── */
.footer { padding: 3rem 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a {
    text-decoration: none; font-size: 0.8rem; color: var(--text-muted);
    font-weight: 600; transition: color 0.3s;
}
.footer-links a:hover { color: var(--text-dark); }

/* ─── THEME TOGGLE ─── */
.theme-toggle {
    background: none; border: 1px solid var(--border);
    border-radius: 50%; width: 36px; height: 36px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: all 0.3s ease;
    padding: 0; flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text-dark); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
