:root {
    --bg: #f3efe6;
    --text: #1c2430;
    --muted: #596270;
    --accent: #1f5f5b;
    --accent-text: #f3efe6;
    --rule: #d6cfbf;
    --hero-bg: #16262b;
    --hero-text: #f3efe6;
    --hero-accent: #d9a35b;
    --max: 960px;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="dark"] {
    --bg: #12181f;
    --text: #e8e4da;
    --muted: #98a2ad;
    --accent: #d9a35b;
    --accent-text: #12181f;
    --rule: #2b353f;
    --hero-bg: #0b1116;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #12181f;
        --text: #e8e4da;
        --muted: #98a2ad;
        --accent: #d9a35b;
        --accent-text: #12181f;
        --rule: #2b353f;
        --hero-bg: #0b1116;
    }
}

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

body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
header { border-bottom: 1px solid var(--rule); padding: 1.25rem 0; }
header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem 2rem;
}
header h1 {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.75rem; }
nav a { color: var(--text); text-decoration: none; font-size: 0.9375rem; }
nav a:hover { color: var(--accent); text-decoration: underline; }
#theme-toggle {
    font: inherit;
    font-size: 0.8125rem;
    color: var(--muted);
    background: none;
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 0.125rem 0.625rem;
    cursor: pointer;
}
#theme-toggle:hover { color: var(--text); border-color: var(--muted); }

/* Hero */
.hero {
    background-color: var(--hero-bg);
    background-image:
        linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    color: var(--hero-text);
    padding: 7rem 0 6rem;
}
.eyebrow {
    font-size: 0.8125rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hero-accent);
    margin-bottom: 1.5rem;
}
.hero h2 {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.015em;
    max-width: 13ch;
    margin-bottom: 1.5rem;
}
.hero .lede { font-size: 1.25rem; color: rgba(243,239,230,0.78); max-width: 38ch; margin-bottom: 2.25rem; }
.hero .btn { background: var(--hero-accent); color: #16262b; padding: 0.9rem 1.9rem; }

/* Facts strip */
.facts { border-bottom: 1px solid var(--rule); }
.facts dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.facts dl > div { padding: 1.75rem 1.5rem 1.75rem 0; }
.facts dl > div + div { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.facts dt { font-family: var(--serif); font-size: 2rem; font-weight: 600; color: var(--accent); line-height: 1.1; }
.facts dd { color: var(--muted); font-size: 0.9375rem; margin-top: 0.25rem; }

/* Closing band */
.band { background: var(--hero-bg); color: var(--hero-text); padding: 4rem 0; }
.band .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.band h2 { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; }
.band .btn { background: var(--hero-accent); color: #16262b; }

.btn {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-text);
    padding: 0.75rem 1.5rem;
    border-radius: 2px;
    font-weight: 600;
    text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: 0.88; }

/* Sections */
.services { padding: 3rem 0 5rem; }
.services > .container > h2 {
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 600;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--text);
}

/* Home: ruled grid of services, numbered */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    column-gap: 3rem;
    counter-reset: svc;
}
.grid .card {
    counter-increment: svc;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--rule);
}
.grid .card::before {
    content: counter(svc, decimal-leading-zero);
    display: block;
    font-family: var(--serif);
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}
.card h3 { font-family: var(--serif); font-size: 1.1875rem; font-weight: 600; margin-bottom: 0.375rem; }
.card p { color: var(--muted); }

/* Inner pages: ruled rows */
.stack { max-width: none; }
.stack > .card { padding: 1.75rem 0; border-bottom: 1px solid var(--rule); }
.service-detail { display: grid; grid-template-columns: 1fr 2fr; gap: 0.5rem 3rem; }
.service-detail ul { list-style: none; color: var(--muted); }
.service-detail li { padding-left: 1.25rem; position: relative; }
.service-detail li + li { margin-top: 0.375rem; }
.service-detail li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.8em;
    width: 0.5rem;
    height: 1px;
    background: var(--accent);
}
.service-detail .note { grid-column: 2; margin-top: 0.25rem; font-size: 0.875rem; font-style: italic; }
.cta { margin-top: 2.5rem; }

/* Contact */
.contact p + p { margin-top: 1rem; font-family: var(--serif); font-size: 1.375rem; }

/* Footer */
footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 1.5rem; color: var(--muted); font-size: 0.875rem; }
footer .container { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2rem; align-items: start; }
.foot-brand strong { display: block; font-family: var(--serif); font-size: 1.0625rem; color: var(--text); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.foot-nav a { color: var(--muted); }
.foot-nav a:hover { color: var(--accent); }
.copy { grid-column: 1 / -1; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: 0.8125rem; }

@media (max-width: 640px) {
    .hero { padding: 4rem 0 3.5rem; }
    footer .container { grid-template-columns: 1fr; }
    .facts dl > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
    .service-detail { grid-template-columns: 1fr; }
    .service-detail .note { grid-column: 1; }
}
