/* =========================================================
   DirtWorks General Engineering — Site Styles
   Brand & Document Style Guide v5.0 compliant
   Palette: Navy #0A4861 / Red #BF2025 / Terracotta #B45A36 /
            Desert Sand #D4A05A / Warm Taupe #7A6A54 /
            Warm Parchment #F4EEE3 / Stone Gray #BFB8AE
   Type: Inter (web fallback for Aptos per guide §3)
   Feel: modern, high-tech, translucent (glassmorphism)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --navy: #0A4861;
    --navy-deep: #062F40;
    --navy-darker: #03161E;
    --red: #BF2025;
    --red-bright: #E63946;
    --terracotta: #B45A36;
    --sand: #D4A05A;
    --taupe: #7A6A54;
    --parchment: #F4EEE3;
    --stone: #BFB8AE;
    --white: #ffffff;
    --black: #000000;

    --glass-bg: rgba(10, 72, 97, 0.35);
    --glass-bg-light: rgba(244, 238, 227, 0.06);
    --glass-border: rgba(244, 238, 227, 0.15);
    --glass-border-strong: rgba(244, 238, 227, 0.25);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(191, 32, 37, 0.25);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --content-max: 1240px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', 'Aptos', 'Segoe UI', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--parchment);
    background: var(--navy-darker);
    overflow-x: hidden;
    min-height: 100vh;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Background system: layered tech grid + gradient mesh ---------- */
body::before, body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}
body::before {
    background:
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(191, 32, 37, 0.18), transparent 60%),
        radial-gradient(ellipse 70% 50% at 90% 30%, rgba(10, 72, 97, 0.55), transparent 60%),
        radial-gradient(ellipse 60% 70% at 50% 100%, rgba(180, 90, 54, 0.12), transparent 60%),
        linear-gradient(180deg, #03161E 0%, #062F40 50%, #03161E 100%);
}
body::after {
    background-image:
        linear-gradient(rgba(244, 238, 227, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 238, 227, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 0%, transparent 80%);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: 'Inter', 'Aptos Display', 'Segoe UI', sans-serif; line-height: 1.15; letter-spacing: -0.02em; color: var(--white); }
h1 { font-weight: 800; font-size: clamp(2.4rem, 5.5vw, 4.4rem); }
h2 { font-weight: 700; font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-weight: 600; font-size: 1.25rem; color: var(--white); }
h4 { font-weight: 600; font-size: 1rem; color: var(--sand); text-transform: uppercase; letter-spacing: 0.08em; }
p { color: rgba(244, 238, 227, 0.82); }
.eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--sand);
    padding: 6px 14px;
    border: 1px solid rgba(212, 160, 90, 0.3);
    border-radius: 999px;
    background: rgba(212, 160, 90, 0.08);
    backdrop-filter: blur(10px);
}

/* ---------- Layout ---------- */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.section + .section { border-top: 1px solid rgba(244, 238, 227, 0.06); }

/* ---------- Header / Nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(3, 22, 30, 0.65);
    backdrop-filter: saturate(140%) blur(18px);
    -webkit-backdrop-filter: saturate(140%) blur(18px);
    border-bottom: 1px solid var(--glass-border);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 24px;
    max-width: var(--content-max);
    margin: 0 auto;
}
.nav-brand { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.nav-brand .icon {
    width: 44px; height: 44px;
    padding: 5px;
    background: var(--parchment);
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(244, 238, 227, 0.2), 0 4px 14px rgba(0,0,0,0.25);
}
.nav-brand .wordmark { height: 28px; }
.nav-brand-text { font-weight: 700; color: var(--white); font-size: 0.95rem; letter-spacing: 0.02em; }
.nav-brand-text small { display: block; color: var(--taupe); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.06em; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(244, 238, 227, 0.78);
    transition: all 0.25s var(--ease-out);
    position: relative;
}
.nav-links a:hover { color: var(--white); background: var(--glass-bg-light); }
.nav-links a.active { color: var(--white); background: rgba(191, 32, 37, 0.15); border: 1px solid rgba(191, 32, 37, 0.35); }

.nav-cta {
    background: linear-gradient(135deg, var(--red) 0%, #8C171B 100%);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 14px rgba(191, 32, 37, 0.35);
    transition: transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(191, 32, 37, 0.5); }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: clamp(60px, 8vw, 110px) 0 clamp(60px, 9vw, 120px);
    text-align: center;
    overflow: hidden;
}
.hero-logo-wrap {
    margin: 0 auto clamp(28px, 4vw, 48px);
    max-width: min(720px, 80vw);
    padding: clamp(28px, 4vw, 48px) clamp(36px, 6vw, 72px);
    background: linear-gradient(135deg, var(--parchment) 0%, #ECE2CF 100%);
    border: 1px solid rgba(244, 238, 227, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 80px rgba(244, 238, 227, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
}
.hero-logo-wrap::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(191, 32, 37, 0.4), transparent 40%, rgba(10, 72, 97, 0.4));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.hero-logo-wrap img { width: 100%; }

.hero h1 {
    margin: 0 auto 20px;
    max-width: 920px;
}
.hero h1 .accent {
    background: linear-gradient(135deg, var(--red-bright) 0%, var(--sand) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-tagline {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    color: rgba(244, 238, 227, 0.75);
    max-width: 720px;
    margin: 0 auto 36px;
    font-style: italic;
    font-weight: 300;
}
.hero-tagline strong { color: var(--sand); font-style: normal; font-weight: 600; }

.btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out);
    border: 1px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--red) 0%, #8C171B 100%);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(191, 32, 37, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(191, 32, 37, 0.5); }
.btn-secondary {
    background: var(--glass-bg-light);
    color: var(--white);
    border-color: var(--glass-border-strong);
    backdrop-filter: blur(10px);
}
.btn-secondary:hover { background: rgba(244, 238, 227, 0.12); transform: translateY(-2px); }
.btn .arrow { transition: transform 0.2s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Subpage page-header (icon top right) ---------- */
.page-header {
    position: relative;
    padding: clamp(48px, 7vw, 88px) 0 clamp(40px, 6vw, 64px);
    border-bottom: 1px solid var(--glass-border);
}
.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}
.page-header-text { flex: 1; min-width: 0; }
.page-header h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); margin-bottom: 14px; }
.page-header .page-tagline { font-style: italic; color: var(--sand); font-size: 1.1rem; }
.page-header .icon-block {
    flex: 0 0 auto;
    width: 104px;
    height: 104px;
    padding: 16px;
    background: linear-gradient(135deg, var(--parchment) 0%, #ECE2CF 100%);
    border: 1px solid rgba(244, 238, 227, 0.4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---------- Card / Glass panel ---------- */
.glass {
    background: linear-gradient(135deg, rgba(244, 238, 227, 0.06) 0%, rgba(244, 238, 227, 0.015) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    padding: clamp(24px, 3vw, 36px);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    transition: transform 0.3s var(--ease-out), border-color 0.25s var(--ease-out);
}
.glass:hover { border-color: var(--glass-border-strong); }

/* Section header pattern */
.section-head {
    text-align: center;
    margin-bottom: clamp(40px, 5vw, 64px);
}
.section-head h2 { margin: 14px 0 10px; }
.section-head .lede { color: rgba(244, 238, 227, 0.7); max-width: 680px; margin: 0 auto; font-size: 1.05rem; }

/* ---------- Service grid ---------- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}
.service-card {
    background: linear-gradient(135deg, rgba(244, 238, 227, 0.06) 0%, rgba(244, 238, 227, 0.015) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 28px 26px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.3s var(--ease-out), border-color 0.25s var(--ease-out), box-shadow 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}
.service-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--red) 0%, var(--sand) 50%, var(--navy) 100%);
    opacity: 0.5;
    transition: opacity 0.25s;
}
.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 160, 90, 0.4);
    box-shadow: var(--shadow-lg);
}
.service-card:hover::before { opacity: 1; }
.service-card .num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--sand);
    letter-spacing: 0.08em;
}
.service-card h3 { margin: 12px 0 10px; }
.service-card p { font-size: 0.95rem; }
.service-card .icon-svg {
    width: 44px;
    height: 44px;
    margin-bottom: 18px;
    color: var(--sand);
}

/* ---------- Feature list (about) ---------- */
.feature-list { display: grid; gap: 18px; }
.feature {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 18px;
    align-items: start;
    padding: 22px;
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}
.feature-bullet {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(191, 32, 37, 0.25), rgba(10, 72, 97, 0.4));
    border: 1px solid rgba(191, 32, 37, 0.3);
    color: var(--sand);
    font-weight: 700;
}
.feature h3 { font-size: 1.1rem; margin-bottom: 6px; }
.feature p { font-size: 0.95rem; }

/* ---------- Two-column ---------- */
.two-col {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(28px, 4vw, 56px);
    align-items: center;
}
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Stats / KPI tiles (Pattern E vibe) ---------- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}
.kpi {
    padding: 22px;
    background: linear-gradient(135deg, rgba(191, 32, 37, 0.12), rgba(10, 72, 97, 0.25));
    border: 1px solid rgba(191, 32, 37, 0.25);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    text-align: center;
}
.kpi .num {
    font-family: 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--white);
    background: linear-gradient(135deg, var(--white), var(--sand));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.kpi .label { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--taupe); margin-top: 4px; }

/* ---------- Form ---------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sand);
}
.field input, .field textarea, .field select {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(3, 22, 30, 0.45);
    border: 1px solid var(--glass-border);
    color: var(--white);
    font: inherit;
    font-size: 0.98rem;
    transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.field input::placeholder, .field textarea::placeholder { color: rgba(244, 238, 227, 0.4); }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--sand);
    background: rgba(3, 22, 30, 0.65);
    box-shadow: 0 0 0 4px rgba(212, 160, 90, 0.12);
}
.field textarea { min-height: 140px; resize: vertical; }

.form-status {
    margin-top: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    display: none;
}
.form-status.success {
    display: block;
    background: rgba(60, 130, 80, 0.15);
    border: 1px solid rgba(60, 200, 100, 0.3);
    color: #b6f0c0;
}
.form-status.error {
    display: block;
    background: rgba(191, 32, 37, 0.15);
    border: 1px solid rgba(191, 32, 37, 0.4);
    color: #ffb6b8;
}

/* ---------- Contact column ---------- */
.contact-meta {
    display: grid;
    gap: 18px;
}
.contact-card {
    padding: 22px 22px;
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}
.contact-card h4 { color: var(--sand); margin-bottom: 6px; }
.contact-card p, .contact-card a { color: var(--white); font-size: 1rem; }
.contact-card a:hover { color: var(--sand); }

/* ---------- Footer ---------- */
.site-footer {
    background: rgba(3, 22, 30, 0.85);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--glass-border);
    padding: 48px 0 24px;
    margin-top: 64px;
}
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
@media (max-width: 800px) { .site-footer .container { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .site-footer .container { grid-template-columns: 1fr; } }

.foot-brand .icon {
    width: 56px; height: 56px;
    padding: 8px;
    background: var(--parchment);
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.foot-brand p { font-size: 0.9rem; max-width: 320px; }
.site-footer h4 { color: var(--white); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer ul { list-style: none; display: grid; gap: 10px; }
.site-footer a { color: rgba(244, 238, 227, 0.7); font-size: 0.92rem; transition: color 0.2s; }
.site-footer a:hover { color: var(--sand); }
.foot-bottom {
    border-top: 1px solid var(--glass-border);
    margin-top: 36px;
    padding: 20px 24px 0;
    color: var(--taupe);
    font-size: 0.82rem;
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.foot-bottom .pwby {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--parchment);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    opacity: 0.92;
}
.foot-bottom .pwby img { height: 18px; width: auto; display: block; }
.foot-bottom .copy { color: var(--taupe); }
@media (max-width: 520px) {
    .foot-bottom { justify-content: center; text-align: center; flex-direction: column-reverse; }
}

/* ---------- Mission ribbon (Red, Pattern E inspired) ---------- */
.mission-ribbon {
    background: linear-gradient(135deg, rgba(191, 32, 37, 0.85) 0%, rgba(140, 23, 27, 0.85) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 4vw, 48px);
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.mission-ribbon::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15), transparent 50%);
    pointer-events: none;
}
.mission-ribbon h2 { color: var(--white); }
.mission-ribbon p {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-style: italic;
    max-width: 760px;
    margin: 14px auto 0;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Mobile nav ---------- */
@media (max-width: 800px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 10px;
        border: 1px solid var(--glass-border);
        background: var(--glass-bg-light);
    }
    .nav-toggle svg { width: 22px; height: 22px; color: var(--white); }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 12px;
        right: 12px;
        margin-top: 6px;
        flex-direction: column;
        align-items: stretch;
        background: rgba(3, 22, 30, 0.92);
        backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-md);
        pad