/* ==========================================================================
   BWE Maryland — site stylesheet
   Visual system derived from the BWE logo: signal red + charcoal steel,
   angular geometry (gear teeth / chevron "W"), engineering-drawing linework.
   No external fonts, no third-party assets.
   ========================================================================== */

:root {
  /* Brand, sampled from the BWE logo */
  --red: #d31f2a;
  --red-deep: #a8151d;
  --steel: #4d4e52;
  --steel-deep: #2f3033;
  --steel-soft: #64656a;

  /* Neutrals */
  --ink: #1f2023;
  --body: #3a3b3f;
  --muted: #64656a;
  --line: #d9dadd;
  --line-soft: #e9eaec;
  --paper: #ffffff;
  --paper-tint: #f4f4f2;
  --paper-warm: #efeeea;

  /* Semantic */
  --focus: #0b5cd6;
  --error: #b3261e;
  --success: #1b6e3a;

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 4px;
  --shadow: 0 1px 2px rgba(31, 32, 35, 0.06), 0 8px 24px rgba(31, 32, 35, 0.06);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--body);
  background: var(--paper);
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--red-deep); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--red); }
ul, ol { padding-left: 1.25rem; }
strong { color: var(--ink); }
address { font-style: normal; }

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

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 0; top: 0; transform: translateY(-140%);
  background: var(--ink); color: #fff; padding: 0.75rem 1rem; z-index: 100;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.staging-banner {
  background: #ffe9a8; color: #4a3600; font-size: 0.875rem; text-align: center;
  padding: 0.5rem var(--gutter); border-bottom: 1px solid #e3c65a;
}

/* ---------- Engineering-drawing motif ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--steel); margin-bottom: 0.9rem;
}
.eyebrow::before { content: ""; width: 1.75rem; height: 2px; background: var(--red); }

.grid-bg {
  background-color: var(--paper-tint);
  background-image:
    linear-gradient(to right, rgba(77, 78, 82, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(77, 78, 82, 0.07) 1px, transparent 1px);
  background-size: 2rem 2rem;
}

.hatch {
  background-image: repeating-linear-gradient(135deg, rgba(77, 78, 82, 0.09) 0 1px, transparent 1px 9px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(6px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.75rem; }
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 3.5rem; width: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.25rem; }
.site-nav a:not(.button) {
  display: inline-block; padding: 0.6rem 0.85rem; color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: 0.95rem; border-bottom: 2px solid transparent; border-radius: 2px;
}
.site-nav a:not(.button):hover { color: var(--red-deep); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red); }
.nav-cta { margin-left: 0.5rem; }

.nav-toggle {
  display: none; align-items: center; gap: 0.6rem;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.55rem 0.8rem; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer;
}
.nav-toggle-bars { position: relative; width: 20px; height: 2px; background: var(--ink); }
.nav-toggle-bars::before, .nav-toggle-bars::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--ink);
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 47.99rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: 0.5rem var(--gutter) 1rem; gap: 0; }
  .site-nav a:not(.button) { display: block; padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--line-soft); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--red); }
  .nav-cta { margin: 0.75rem 0 0; }
  .nav-cta .button { width: 100%; }
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.35rem; border-radius: var(--radius); font-weight: 700; font-size: 0.95rem;
  text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.button-primary { background: var(--red); color: #fff; border-color: var(--red); }
.button-primary:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.button-secondary { background: transparent; color: var(--ink); border-color: var(--steel); }
.button-secondary:hover { background: var(--steel); color: #fff; }
.button-on-dark { background: #fff; color: var(--ink); border-color: #fff; }
.button-on-dark:hover { background: var(--paper-warm); color: var(--ink); }
.button-outline-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,0.7); }
.button-outline-dark:hover { border-color: #fff; background: rgba(255,255,255,0.1); color: #fff; }
.button-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-tint { background: var(--paper-tint); }
.section-dark { background: var(--steel-deep); color: #d9dadd; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: #b9babf; }
.section-head { max-width: 46rem; margin-bottom: 2.25rem; }
.section-head p.lead { font-size: 1.15rem; color: var(--muted); }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--body); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-inner { display: grid; gap: 2.5rem; align-items: center; padding-block: clamp(3rem, 8vw, 6.5rem); }
.hero h1 { max-width: 15ch; }
.hero .lead { max-width: 40rem; }
.hero-figure { position: relative; }
.hero-figure svg { width: 100%; height: auto; }
.hero-note { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel-soft); margin-top: 0.75rem; }
@media (min-width: 60rem) {
  .hero-inner { grid-template-columns: 1.15fr 1fr; }
}

/* ---------- Fact strip ---------- */
.fact-strip { border-block: 1px solid var(--line); background: var(--paper); }
.fact-strip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.fact-strip li { padding: 1.1rem 0; display: grid; gap: 0.15rem; }
.fact-strip .fact-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel-soft); }
.fact-strip .fact-value { font-weight: 700; color: var(--ink); }
@media (min-width: 48rem) {
  .fact-strip ul { grid-template-columns: repeat(3, 1fr); }
  .fact-strip li { padding: 1.35rem 1.5rem; border-left: 1px solid var(--line); }
  .fact-strip li:first-child { border-left: 0; padding-left: 0; }
}

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .card-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; position: relative; overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card-index { font-family: var(--font-mono); font-size: 0.75rem; color: var(--steel-soft); letter-spacing: 0.1em; margin-bottom: 0.5rem; display: block; }

/* ---------- Service groups ---------- */
.service-group { border-top: 2px solid var(--steel); padding-top: 1.25rem; }
.service-group h2 { display: flex; align-items: baseline; gap: 0.75rem; font-size: 1.25rem; }
.service-group h2 .card-index { margin: 0; }
.service-list { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.service-list li { padding-left: 1.25rem; position: relative; }
.service-list li::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 0.55rem; height: 0.55rem;
  background: var(--red); clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.service-list .svc-desc { color: var(--muted); font-size: 0.95rem; display: block; }

/* ---------- Experience ---------- */
.experience { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 56rem) { .experience { grid-template-columns: 1.2fr 0.8fr; } }
.experience-figure { margin: 0; background: var(--paper-warm); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.experience-figure img { border-radius: 2px; margin-inline: auto; max-height: 34rem; width: auto; }
.experience-figure figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; line-height: 1.45; }
.testimonial { border-left: 4px solid var(--red); padding: 0.25rem 0 0.25rem 1.25rem; margin: 1.5rem 0 0; }
.testimonial p { font-size: 1.1rem; color: var(--ink); font-style: italic; }
.testimonial footer { font-size: 0.9rem; color: var(--muted); }
.testimonial footer strong { display: block; color: var(--ink); font-style: normal; }
.recognition { font-family: var(--font-mono); font-size: 0.8rem; color: var(--steel); background: var(--paper-tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.recognition dt { font-weight: 700; color: var(--ink); }
.recognition dd { margin: 0 0 0.6rem; }
.recognition dd:last-child { margin-bottom: 0; }

/* ---------- Split / prose ---------- */
.split { display: grid; gap: 2.5rem; }
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1fr; } }
.prose { max-width: 42rem; }
.prose h2 { margin-top: 2rem; }
.prose h2:first-child { margin-top: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--red); color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band .cta-inner { display: grid; gap: 1.5rem; align-items: center; padding-block: clamp(2.5rem, 6vw, 4rem); }
.cta-band p { color: #fff; margin: 0; }
@media (min-width: 56rem) { .cta-band .cta-inner { grid-template-columns: 1fr auto; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .contact-grid { grid-template-columns: 0.85fr 1.15fr; } }
.contact-details { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.contact-details li { display: grid; gap: 0.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line-soft); }
.contact-details .label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel-soft); }
.contact-details .value { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.contact-details a.value { text-decoration: none; }
.contact-details a.value:hover { text-decoration: underline; }

/* ---------- Form ---------- */
.form { display: grid; gap: 1.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.form-row { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .form-row-2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 700; color: var(--ink); }
.field .hint { font-size: 0.875rem; color: var(--muted); }
.field .req { color: var(--red-deep); font-weight: 700; }
.field input, .field textarea, .field select {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--steel-soft); border-radius: var(--radius); padding: 0.7rem 0.85rem; width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--error); border-width: 2px; }
.field-error { color: var(--error); font-size: 0.9rem; font-weight: 600; min-height: 0; }
.field-error:empty { display: none; }
.form-legend { font-size: 0.9rem; color: var(--muted); }
.form-status { border-radius: var(--radius); padding: 1rem 1.1rem; font-weight: 600; }
.form-status:empty { display: none; }
.form-status.is-error { background: #fdecea; color: #7a1a13; border: 1px solid #f2b8b2; }
.form-status.is-success { background: #e6f4ea; color: #144d29; border: 1px solid #a7d7b6; }
.form-status.is-info { background: var(--paper-tint); color: var(--ink); border: 1px solid var(--line); }
.form-status p { margin: 0 0 0.5em; }
.form-status p:last-child { margin: 0; }
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-fallback { font-size: 0.9rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--steel-deep); color: #c9cacf; margin-top: 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 2rem; padding-block: 3rem 2rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-name { font-size: 1.25rem; font-weight: 800; color: #fff; margin: 0 0 0.15rem; letter-spacing: -0.01em; }
.footer-legal-name { font-size: 0.85rem; color: #a3a4aa; margin: 0 0 0.9rem; }
.footer-desc { font-size: 0.95rem; max-width: 34rem; }
.footer-heading { color: #fff; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; font-family: var(--font-mono); margin-bottom: 0.9rem; }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-block: 1.25rem; font-size: 0.85rem; color: #a3a4aa; }
.footer-bottom p { margin: 0; }

/* ---------- Utility pages ---------- */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem); }
.page-head h1 { max-width: 18ch; }
.page-head .lead { max-width: 44rem; }
.notice-list dt { font-weight: 700; color: var(--ink); margin-top: 1rem; }
.notice-list dd { margin: 0.25rem 0 0; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .nav-toggle, .cta-band, .staging-banner { display: none; }
  body { color: #000; }
  a { color: #000; text-decoration: none; }
}
