/* Precision Molds — site styles. Mobile first; light and dark themes via prefers-color-scheme. */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #eceff3;
    --text: #1b2330;
    --muted: #5a6475;
    --border: #d6dbe3;
    --brand: #1f3a5f;
    --brand-contrast: #ffffff;
    --accent: #f2a900;
    --link: #1d5fa8;
    --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 4px 12px rgb(16 24 40 / 8%);
    --radius: 10px;
    --max: 72rem;
    --gutter: clamp(1rem, 4vw, 2rem);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f141b;
        --surface: #171e28;
        --surface-2: #1f2835;
        --text: #e6eaf0;
        --muted: #9aa5b5;
        --border: #2c3747;
        --brand: #14263d;
        --link: #7ab4f5;
        --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 12px rgb(0 0 0 / 30%);
    }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
}

main { flex: 1; }
main:focus { outline: none; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 5vw, 2.75rem); margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin: 2.5rem 0 0.75rem; }
p { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(2rem, 6vw, 4rem); }
.prose { max-width: calc(var(--max) - 8rem); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 45rem; }
.muted { color: var(--muted); }
.rounded { border-radius: var(--radius); box-shadow: var(--shadow); }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #000;
    border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* Header and navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--brand);
    color: var(--brand-contrast);
    box-shadow: 0 2px 8px rgb(0 0 0 / 20%);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }

.brand { display: flex; align-items: center; gap: 0.75rem; color: inherit; text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding-inline: 0.45rem;
    font-size: 0.95rem;
    border-radius: 8px;
    background: var(--accent);
    color: #111;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-tagline { font-size: 0.8rem; opacity: 0.8; }

.nav-toggle {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    cursor: pointer;
}
.nav-toggle:hover { background: rgb(255 255 255 / 10%); }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    display: block;
    width: 1.4rem;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
}
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }

/* Mobile: the nav is a popover dropping down under the header. */
.site-nav {
    position: fixed;
    inset: 4rem 0 auto 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.5rem var(--gutter) 1rem;
    border: 0;
    border-top: 1px solid rgb(255 255 255 / 12%);
    background: var(--brand);
    color: var(--brand-contrast);
    box-shadow: 0 8px 16px rgb(0 0 0 / 30%);
}
.site-nav::backdrop { background: rgb(0 0 0 / 35%); }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
    display: block;
    padding: 0.7rem 0.75rem;
    color: var(--brand-contrast);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
}
.nav-list a:hover { background: rgb(255 255 255 / 10%); }
.nav-list a.active { box-shadow: inset 3px 0 0 var(--accent); background: rgb(255 255 255 / 8%); }

/* Desktop: show the nav inline whether or not the popover is open. */
@media (min-width: 52rem) {
    .nav-toggle { display: none; }
    .site-nav, .site-nav:popover-open {
        display: block;
        position: static;
        inset: auto;
        width: auto;
        padding: 0;
        border: 0;
        background: none;
        box-shadow: none;
        overflow: visible;
    }
    .nav-list { display: flex; gap: 0.25rem; }
    .nav-list a { padding: 0.5rem 0.8rem; }
    .nav-list a.active { box-shadow: inset 0 -3px 0 var(--accent); }
}

/* Hero */
.hero { position: relative; isolation: isolate; background: #111; min-height: clamp(22rem, 60vh, 36rem); display: grid; }
.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.55;
}
.hero-overlay {
    display: flex;
    align-items: flex-end;
    background: linear-gradient(to top, rgb(10 18 30 / 85%) 0%, rgb(10 18 30 / 20%) 70%);
}
.hero-content { padding-block: clamp(2rem, 8vw, 4.5rem); color: #fff; }
.hero-content .lead { color: rgb(255 255 255 / 88%); }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.button {
    display: inline-block;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    background: var(--accent);
    color: #111;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid var(--accent);
}
.button:hover { filter: brightness(1.08); }
.button-ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / 70%); }
.button-ghost:hover { background: rgb(255 255 255 / 10%); }

/* Cards */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card {
    display: block;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s;
}
.card:hover { transform: translateY(-2px); }
.card h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.card p { margin: 0; color: var(--muted); }

/* Layout helpers */
.split { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 48rem) {
    .split { grid-template-columns: 3fr 2fr; }
}
.stack { display: grid; gap: 1rem; justify-items: start; }

.tags { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.95rem;
}

.columns { columns: 16rem auto; column-gap: 2rem; padding-left: 1.2rem; }
.columns li { break-inside: avoid; margin-bottom: 0.35rem; }

/* Services */
.services { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); margin-top: 1.5rem; }
.service {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.service img { flex: none; width: 96px; height: auto; align-self: flex-start; border-radius: 6px; }
.service h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.service p:last-child, .service .tags { margin-bottom: 0; }

/* Contact */
.contact-card {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.contact-card h2 { margin-top: 0; }
.contact-name { font-weight: 700; font-size: 1.15rem; }
.contact-name span { font-weight: 400; color: var(--muted); font-size: 1rem; }
address { font-style: normal; margin-bottom: 1rem; }

.map { margin: 0; }
.map iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 18rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.map figcaption { margin-top: 0.5rem; font-size: 0.95rem; }

/* Gallery */
.gallery {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}
.gallery a {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-2);
    box-shadow: var(--shadow);
}
.gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.25s;
}
.gallery a:hover img { transform: scale(1.04); }

.lightbox {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgb(5 8 12 / 94%);
    color: #fff;
}
.lightbox::backdrop { background: rgb(0 0 0 / 60%); }
.lightbox figure {
    margin: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 1fr auto;
    place-items: center;
    padding: 3.5rem 1rem 1rem;
}
.lightbox img { max-width: 100%; max-height: calc(100dvh - 7rem); width: auto; height: auto; object-fit: contain; }
.lightbox figcaption { padding-top: 0.75rem; text-align: center; color: rgb(255 255 255 / 85%); }
.lightbox-btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / 12%);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}
.lightbox-btn:hover { background: rgb(255 255 255 / 24%); }
.lightbox-close { top: 0.75rem; right: 0.75rem; }
.lightbox-prev { left: 0.75rem; top: 50%; translate: 0 -50%; }
.lightbox-next { right: 0.75rem; top: 50%; translate: 0 -50%; }

/* Footer */
.site-footer { background: var(--brand); color: rgb(255 255 255 / 85%); margin-top: 2rem; }
.site-footer a { color: #fff; }
.footer-inner {
    display: grid;
    gap: 1.25rem;
    padding-block: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    align-items: start;
}
.footer-inner p { margin: 0 0 0.35rem; }
.footer-name { font-weight: 700; color: #fff; }
.footer-copy { font-size: 0.9rem; opacity: 0.75; align-self: end; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
