/* Anthony Sutter, P.E. site styles: BRANDING_GUIDE v3.4 (shared by every page) */

/* Self-hosted brand fonts (SIL OFL, see /fonts): Latin subsets, variable weight */
@font-face { font-family: 'Gelasio'; src: url('/fonts/gelasio-latin.woff2') format('woff2'); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Arimo'; src: url('/fonts/arimo-latin.woff2') format('woff2'); font-weight: 400 600; font-style: normal; font-display: swap; }

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

/* Brand palette — BRANDING_GUIDE.md v3.4 §5 and §10.1 */
:root {
    --navy-primary: #1F4E79;
    --navy-light: #2B579A;
    --navy-dark: #163A5C;
    --text-dark: #333333;
    --text-medium: #666666;
    --text-light: #999999;
    --border-light: #D6D0C4;
    --bg-page: #F8F3EA;      /* warm ivory page background */
    --bg-light: #EFE7D8;     /* alternating section bands */
    --bg-white: #FFFFFF;     /* cards and form fields, so they lift off the page */
    --font-heading: 'Gelasio', Georgia, 'Times New Roman', serif;
    --font-body: 'Arimo', Arial, Helvetica, sans-serif;
    --section-padding: 80px;
    --container-max: 1200px;
}

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--bg-page);
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; line-height: 1.2; color: var(--navy-primary); }
h1 { font-size: clamp(2.1rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.25rem); margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.6rem; }

p { margin-bottom: 1rem; }
a { color: var(--navy-light); }

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

/* Blueprint grid texture for navy sections (per brand OG/banner treatment) */
.navy-section {
    background-color: var(--navy-primary);
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--bg-white);
}
.navy-section h2, .navy-section h3 { color: var(--bg-white); }

/* ============ Header ============ */
.header {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: var(--bg-page);
    border-bottom: 1.5px solid var(--navy-primary);
}
.nav {
    max-width: var(--container-max); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.7rem 1.25rem; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand img { width: 52px; height: 52px; display: block; }
.brand-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; color: var(--navy-primary); line-height: 1.1; }
.brand-title { font-size: 0.72rem; color: var(--text-medium); letter-spacing: 0.02em; }

.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a { color: var(--text-dark); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--navy-light); }
.nav-links a.nav-cta {
    border: 1.5px solid var(--navy-primary); border-radius: 4px;
    padding: 0.3rem 0.8rem; color: var(--navy-primary); font-weight: 600;
}
.nav-links a.nav-cta:hover { background: var(--bg-light); }
.nav-links a[aria-current="page"] { color: var(--navy-primary); text-decoration: underline; text-underline-offset: 4px; }
.license-badge {
    background: var(--navy-primary); color: var(--bg-white);
    padding: 0.3rem 0.75rem; border-radius: 3px;
    font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}

.menu-toggle { display: none; background: none; border: 1.5px solid var(--navy-primary); border-radius: 4px; padding: 0.4rem 0.55rem; cursor: pointer; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--navy-primary); margin: 4px 0; }

/* ============ Hero ============ */
.hero {
    padding-top: calc(84px + var(--section-padding));
    text-align: center;
}
.hero img.mark { width: 130px; height: 130px; margin-bottom: 1.5rem; }
.hero .tagline { font-size: 1.2rem; color: var(--text-medium); max-width: 46rem; margin: 0.75rem auto 2rem; }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-block; text-decoration: none; font-weight: 600; font-size: 1rem;
    padding: 0.85rem 1.8rem; border-radius: 4px; border: 1.5px solid var(--navy-primary);
    transition: background-color 0.2s, color 0.2s;
}
.btn-solid { background: var(--navy-primary); color: var(--bg-white); }
.btn-solid:hover { background: var(--navy-light); border-color: var(--navy-light); }
.btn-outline { background: transparent; color: var(--navy-primary); }
.btn-outline:hover { background: var(--bg-light); }
.navy-section .btn-solid { background: var(--bg-white); color: var(--navy-primary); border-color: var(--bg-white); }
.navy-section .btn-solid:hover { background: var(--bg-light); }

/* ============ Featured Service (navy) ============ */
.featured .container { display: grid; grid-template-columns: auto 1fr; gap: 3rem; align-items: center; }
.featured img.mark { width: 140px; height: 140px; }
.featured-scope { list-style: none; margin: 1rem 0 1.5rem; columns: 2; column-gap: 2.5rem; }
.featured-scope li { padding: 0.3rem 0; break-inside: avoid; }
.featured-scope li::before { content: "— "; opacity: 0.6; }

/* ============ About ============ */
.about { background: var(--bg-light); }
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }
.credentials {
    background: var(--bg-white); border-top: 4px solid var(--navy-primary);
    padding: 1.75rem; box-shadow: 0 2px 8px rgba(22, 58, 92, 0.08);
}
.credentials dl { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; }
.credentials dt { font-weight: 600; color: var(--navy-dark); }
.credentials dd { color: var(--text-dark); }

/* ============ Recent Projects ============ */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.project-card {
    border: 1px solid var(--border-light); border-left: 4px solid var(--navy-primary);
    padding: 1.5rem; background: var(--bg-white);
}
.project-card h3 { font-size: 1.3rem; }
.project-meta { font-size: 0.88rem; color: var(--text-medium); margin-bottom: 0.6rem; }
.project-card p:last-child { margin-bottom: 0; }
.projects-more { margin-top: 2rem; text-align: center; }

/* Case-study cards (BRANDING_GUIDE §10.4: title, location, role, scope, codes, outcome, year) */
.case-card { display: flex; flex-direction: column; }
.case-card .project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; }
.case-role { font-weight: 600; color: var(--navy-dark); font-size: 0.95rem; margin-bottom: 0.5rem; }
.case-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.9rem; font-size: 0.92rem; margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--border-light); }
.case-facts dt { font-weight: 600; color: var(--navy-dark); }
.case-facts .nw { white-space: nowrap; }
.status-tag {
    display: inline-block; border: 1px solid var(--navy-primary); color: var(--navy-primary);
    border-radius: 3px; padding: 0.05rem 0.5rem; font-size: 0.74rem; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
}

/* Projects page */
.page-hero { padding-top: calc(84px + var(--section-padding)); padding-bottom: 2rem; }
.page-hero .lead { font-size: 1.15rem; color: var(--text-medium); max-width: 48rem; }
.page-hero + section { padding-top: 1rem; }
.areas-worked { background: var(--bg-light); }
.city-list { list-style: none; columns: 4 11rem; column-gap: 2rem; margin-top: 1rem; }
.city-list li { padding: 0.2rem 0; break-inside: avoid; }

/* ============ Services ============ */
.services { background: var(--bg-light); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.service-card {
    background: var(--bg-white); padding: 1.75rem;
    border-top: 4px solid var(--navy-primary);
    box-shadow: 0 2px 8px rgba(22, 58, 92, 0.08);
}
.service-card h3 { font-size: 1.3rem; }
.service-card p:last-child { margin-bottom: 0; }

/* ============ Service Areas ============ */
.areas { text-align: center; }
.areas p { max-width: 44rem; margin-left: auto; margin-right: auto; }

/* FAQ */
.faq { background: var(--bg-light); }

/* ============ Contact (navy) ============ */
.contact { text-align: center; }
.contact img.mark { width: 96px; height: 96px; margin-bottom: 1.25rem; }
.contact-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 2rem; max-width: 56rem; margin: 2rem auto 0;
}
.contact-item .label { font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; margin-bottom: 0.3rem; }
.contact-item a { color: var(--bg-white); text-decoration: none; font-size: 1.1rem; }
.contact-item a:hover { text-decoration: underline; }
.contact-item p { margin: 0; font-size: 1.05rem; }
.contact-cta { margin-top: 2.25rem; margin-bottom: 0; }

/* ============ Footer ============ */
.footer { background: var(--navy-dark); color: var(--bg-white); padding: 3rem 0 1.5rem; font-size: 0.92rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 2rem; }
.footer img.monogram { display: block; width: 44px; height: 44px; margin-bottom: 0.9rem; }
.footer p { margin-bottom: 0.3rem; opacity: 0.9; }
.footer-name { font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; }
.footer-head { font-family: var(--font-heading); font-weight: 600; font-size: 1.05rem; margin-bottom: 0.6rem !important; }
.footer ul { list-style: none; }
.footer li { padding: 0.15rem 0; }
.footer a { color: var(--bg-white); opacity: 0.9; }
.footer a:hover { opacity: 1; }
.footer-legal { margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.15); text-align: center; font-size: 0.85rem; }

/* ============ Service pages ============ */
.eyebrow { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-medium); margin-bottom: 0.5rem; }
.eyebrow a { color: inherit; }
.page-hero .hero-ctas { justify-content: flex-start; margin-top: 1.5rem; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem; align-items: start; }
.prose h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); margin-top: 2.25rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1rem 1.3rem; }
.prose li { margin-bottom: 0.45rem; }
.prose ol li::marker { font-weight: 600; color: var(--navy-primary); }
.prose ol strong { color: var(--navy-dark); }
.credentials .verify { font-size: 0.88rem; }

/* Guides */
.byline { font-size: 0.92rem; color: var(--text-medium); margin-top: 1rem; margin-bottom: 0; }
.prose ul strong { color: var(--navy-dark); }
.guide-note { font-size: 0.9rem; color: var(--text-medium); border-top: 1px solid var(--border-light); padding-top: 1rem; margin-top: 2rem; }
.aside-link { margin-top: 1.25rem; margin-bottom: 0; font-weight: 600; }
.aside-link a { text-decoration: none; }
.aside-link + .aside-link { margin-top: 0.6rem; }
.service-card .card-title { font-size: 1.3rem; }
.service-card .card-title a { text-decoration: none; }
.service-card .more { font-weight: 600; text-decoration: none; }
.service-card .more:hover { text-decoration: underline; }
.related { background: var(--bg-light); }

/* ============ Quote form ============ */
.quote-form { max-width: 46rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.5rem; }
.quote-form .full { grid-column: 1 / -1; }
.quote-form label { display: block; font-weight: 600; color: var(--navy-dark); margin-bottom: 0.3rem; }
.quote-form .req { color: var(--navy-light); }
.quote-form input, .quote-form select, .quote-form textarea {
    width: 100%; font: inherit; color: var(--text-dark); background: var(--bg-white);
    border: 1px solid var(--border-light); border-radius: 4px; padding: 0.6rem 0.75rem;
}
.quote-form textarea { min-height: 9rem; resize: vertical; }
.quote-form input:focus, .quote-form select:focus, .quote-form textarea:focus { outline: 2.5px solid var(--navy-light); outline-offset: 1px; border-color: var(--navy-light); }
.quote-form .hint { font-size: 0.85rem; color: var(--text-medium); margin: 0.3rem 0 0; }
.quote-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.quote-form button { cursor: pointer; font-family: inherit; }
.quote-form button[disabled] { opacity: 0.6; cursor: wait; }
.form-status { grid-column: 1 / -1; padding: 0.9rem 1rem; border-left: 4px solid var(--navy-primary); background: var(--bg-light); margin: 0; }
.form-status[hidden] { display: none; }

/* ============ 404 ============ */
.notfound { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; text-align: center; }
.notfound main { max-width: 34rem; }
.notfound img { display: block; width: 96px; height: 96px; margin: 0 auto 1.5rem; }
.notfound h1 { margin-bottom: 0.75rem; }
.notfound p { color: var(--text-medium); margin-bottom: 1.5rem; }
.notfound .contact-line { margin-top: 1.5rem; font-size: 0.95rem; }

/* ============ Accessibility ============ */
a:focus-visible, button:focus-visible { outline: 2.5px solid var(--navy-light); outline-offset: 2px; }
.navy-section a:focus-visible, .footer a:focus-visible { outline-color: var(--bg-white); }
.skip-link {
    position: absolute; top: -48px; left: 0; z-index: 2000;
    background: var(--navy-primary); color: var(--bg-white);
    padding: 0.5rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .featured .container { grid-template-columns: 1fr; text-align: center; }
    .featured img.mark { margin: 0 auto; }
    .featured-scope { columns: 1; text-align: left; max-width: 22rem; margin-left: auto; margin-right: auto; }
    .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; width: 100%;
        background: var(--bg-page); flex-direction: column; align-items: flex-start;
        padding: 1rem 1.25rem; gap: 1rem; border-bottom: 1.5px solid var(--navy-primary);
    }
    .nav-links.open { display: flex; }
}
@media (max-width: 768px) { :root { --section-padding: 56px; } }
@media (max-width: 560px) { .quote-form { grid-template-columns: 1fr; } .footer-grid { grid-template-columns: 1fr; } }

@media (max-width: 768px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .contact-grid { grid-template-columns: 1fr; } }
.navy-section .btn-outline-light { background: transparent; color: var(--bg-white); border-color: var(--bg-white); margin-left: 0.5rem; }
.navy-section .btn-outline-light:hover { background: rgba(255,255,255,0.1); }
