*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 92px; font-size: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: var(--step-0); font-weight: 400; line-height: 1.65; letter-spacing: 0; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { margin: 0; color: inherit; font-weight: 600; text-wrap: balance; letter-spacing: 0; }
h1, h2 { font-family: var(--serif); font-optical-sizing: auto; }
h1 { font-size: var(--step-4); line-height: 1.05; }
h2 { font-size: var(--step-3); line-height: 1.12; }
h3 { font-family: var(--sans); font-size: var(--step-2); line-height: 1.3; }
h4, h5, h6 { font-family: var(--sans); font-size: 1.0625rem; line-height: 1.35; }
p { margin: 0; text-wrap: pretty; }
small, figcaption { font-size: var(--step--1); line-height: 1.5; }
figure { margin: 0; }
figure img { border-radius: 0; box-shadow: none; }
.image-native-small { max-width: 320px; }
figure.image-budgeted-800 { max-width: 800px; }
figcaption { color: var(--muted); }
.lead { max-width: var(--measure); font-size: var(--step-1); line-height: 1.5; }
.explorer-tool-chrome { padding-block: var(--space-2); }
.explorer-tool-title { font-size: var(--step-3); line-height: 1.15; overflow-wrap: break-word; }
/* Preserve the presentation viewport after extracting its former inline layout. */
.r3-page-building-explorer #main-content:not(:has(.be-detail-active)) { display: flex; flex-direction: column; height: calc(100svh - 76px); min-height: 640px; }
.r3-page-building-explorer .explorer-tool-chrome { flex: 0 0 auto; }
.r3-page-building-explorer .building-explorer-section:not(.be-detail-active) { flex: 1 1 0; min-height: 0; }
.r3-page-building-explorer .building-explorer-section:not(.be-detail-active) .be-canvas-wrap { flex: 1 1 0; min-height: 0; }
/* These existing overlays must not add their height to the measured canvas. */
.r3-page-building-explorer .bx-tourbar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100% - 32px); padding: 8px; background: var(--harbor); }
.r3-page-building-explorer .bx-tour-toggle { min-height: 44px; padding: 8px 16px; border: 0; border-radius: var(--r-control); background: var(--blue); color: var(--paper); font-size: 1rem; font-weight: 600; }
.r3-page-building-explorer .bx-tour-toggle:focus-visible { outline-color: var(--signal); }
.r3-page-building-explorer .bx-finale:not([hidden]) { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: var(--space-4); background: var(--harbor); color: var(--paper); }
.r3-page-building-explorer .bx-finale-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.r3-page-building-explorer .bx-finale :is(.bx-cta-primary, .bx-cta-secondary) { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border: 1.5px solid var(--paper); border-radius: var(--r-control); background: transparent; color: var(--paper); font-size: 1.0625rem; font-weight: 600; line-height: 1.2; text-decoration: none; }
.r3-page-building-explorer .bx-finale :is(a, button):focus-visible { outline-color: var(--signal); }
/* Keep the existing tour label readable before the Explorer UI restyle. */
.building-explorer-section .bx-tour-label { color: var(--paper); background: var(--harbor); font-family: var(--sans); font-size: 1rem; }
.wrap, .container { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-4); }
.grid > *, .footer-grid > * { min-width: 0; }
.sr-only, .skip-link { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 0.75rem; left: 0.75rem; z-index: 10001; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; padding: 0.75rem 1rem; background: var(--paper); color: var(--ink); font-size: 1rem; font-weight: 600; outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: none; border-radius: 0; }
[hidden], .hidden, .hp { display: none; }

/* Existing button names remain usable while templates move to the shared system. */
.btn, .btn-primary, .btn-quiet, .btn-outline, .btn-navy, .cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 0.75rem 1.4rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  box-shadow: none;
  transform: none;
  cursor: pointer;
  transition: border-color 150ms var(--ease);
}
.btn:hover, .btn-quiet:hover, .btn-outline:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: none; transform: none; }
.btn-primary, .btn-navy, .cta-button { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.btn-primary:hover, .btn-navy:hover, .cta-button:hover { background: var(--harbor); border-color: var(--harbor); color: var(--paper); box-shadow: none; transform: none; }
.text-link { display: inline-block; min-height: 44px; padding-block: 0.55rem; font-weight: 600; line-height: 1.6; }
.cta-phone-link, .source-note a, .prose figcaption a { display: inline-block; min-height: 44px; padding-block: 0.55rem; }

/* Unified header, with compact gaps to fit at the single 1100px breakpoint. */
.site-header { position: sticky; top: 0; z-index: 50; padding: 0; background: var(--paper); border-bottom: 1px solid var(--paper); box-shadow: none; }
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 76px; }
.site-header .logo { display: inline-flex; align-items: center; flex: none; min-height: 44px; padding: 0; }
.site-header .logo img { width: 92px; height: auto; filter: none; border-radius: 0; }
.site-header :is(.nav, .nav-links) { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; flex-shrink: 1; }
.site-header :is(.nav, .nav-links) :is(a, .dropdown-toggle) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}
.site-header :is(.nav, .nav-links) :is(a, .dropdown-toggle):hover,
.site-header :is(.nav, .nav-links) [aria-current="page"] { text-decoration-line: underline; }
.site-header .dropdown { position: relative; }
.site-header .dropdown-toggle::after { content: none; }
.site-header .dropdown-menu { display: none; position: absolute; top: 100%; left: 0; width: max-content; max-width: min(30rem, calc(100vw - 2 * var(--gutter))); margin: 0; padding: var(--space-2); background: var(--paper); color: var(--ink); border: 0; border-radius: var(--r-panel); box-shadow: var(--shadow-overlay); opacity: 1; visibility: visible; transform: none; }
.site-header .dropdown.active .dropdown-menu { display: grid; }
.site-header .dropdown-menu a { width: 100%; padding-inline: var(--space-1); }
.site-header .header-phone { display: inline-flex; align-items: center; min-height: 44px; flex: none; color: var(--ink); font-size: 1rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-header .header-cta { display: flex; flex: none; }
.site-header .header-cta .btn-primary { white-space: nowrap; }
.site-header .menu-btn { display: none; min-height: 44px; min-width: 44px; padding: 0 1rem; border: 1.5px solid var(--ink); background: none; color: var(--ink); border-radius: var(--r-control); font-size: 1rem; font-weight: 600; line-height: 1.35; }
.site-header .mobile-nav-contact { display: none; }
body.nav-open { overflow: hidden; }

.section, .closing { padding-block: var(--section); }
.section.concrete, .section-light, .section-navy { background: var(--concrete); }
.section-dark, .section-accent { background: var(--paper); }
.section.flush { padding-top: 0; }
.section-head { grid-column: 1 / span 4; display: grid; gap: var(--space-3); align-content: start; }
.stack-head { grid-column: 1 / span 8; display: grid; gap: var(--space-3); align-content: start; margin-bottom: var(--space-5); }
.section-head p, .stack-head p { color: var(--muted); max-width: var(--measure); }
.closing-text { grid-column: 1 / span 6; display: grid; gap: var(--space-3); align-content: start; }
.closing-text p { max-width: var(--measure); }
.closing-action { grid-column: 8 / span 5; display: grid; gap: var(--space-3); align-content: start; justify-items: start; }
.phone-big { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--serif); font-size: var(--step-3); line-height: 1.1; color: var(--ink); text-decoration: none; font-weight: 600; font-variant-numeric: lining-nums; }
.phone-big:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 2px; }
.page-header { background: var(--paper); padding-block: clamp(1rem, 0.25rem + 2vw, 2rem) var(--space-5); }
.breadcrumb ol { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: flex; flex-wrap: wrap; align-items: center; font-size: var(--step--1); color: var(--muted); }
.breadcrumb li, .breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
.breadcrumb a { min-width: 44px; }
.breadcrumb li + li::before { content: "/"; margin-inline: 0.6rem; color: var(--muted); }

/* Form names, values and hidden fields remain owned by the existing markup. */
.form { display: grid; gap: var(--space-3); align-content: start; }
.field { display: grid; gap: 0.4rem; }
.form-group { margin-bottom: var(--space-3); }
.field label, .form-group label { display: block; font-size: 1rem; font-weight: 600; line-height: 1.35; }
.field label .opt { font-weight: 400; color: var(--muted); }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea { min-width: 0; max-width: 100%; min-height: 48px; padding: 0.75rem 0.9rem; border: 1.5px solid var(--control); border-radius: var(--r-control); background-color: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.3; }
.field :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.form-group :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { width: 100%; }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); flex: none; }
.choice { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; cursor: pointer; }
[aria-invalid="true"] { border-color: var(--ink); }
.field-error, .form-status.error { color: #B83A3A; font-size: 1rem; line-height: 1.5; }
.field :focus-visible, .form-group :focus-visible { border-color: var(--ink); }
.select { position: relative; display: block; }
.select select { appearance: none; padding-right: 2.75rem; cursor: pointer; }
.select::after { content: ""; position: absolute; right: 1.1rem; top: 50%; width: 8px; height: 8px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }

.faq { border-top: 1px solid var(--rule); }
.faq details, .accordion details { border-bottom: 1px solid var(--rule); }
.faq summary, .accordion summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); min-height: 44px; padding-block: 1.25rem; font-weight: 600; font-size: 1.125rem; line-height: 1.45; }
.faq summary::-webkit-details-marker, .accordion summary::-webkit-details-marker { display: none; }
.faq summary::after, .accordion summary::after { content: "+"; flex: none; width: 1.5rem; text-align: center; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--ink); }
.faq details[open] summary::after, .accordion details[open] summary::after { content: "\2212"; }
.faq .ans, .accordion .ans { padding-bottom: var(--space-3); color: var(--muted); max-width: var(--measure); }
blockquote { margin: 0; font-family: var(--serif); font-size: 1.3125rem; line-height: 1.45; }
.quote-attribution, .testimonial-author, .testimonial-role { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--muted); }
.plain-list { list-style: none; padding-left: 1.5rem; }
.plain-list > li { position: relative; }
.plain-list > li::before { content: ""; position: absolute; left: -1.3rem; top: 0.72em; width: 6px; height: 6px; background: var(--muted); }
dialog { max-width: min(48rem, calc(100% - 2 * var(--gutter))); max-height: calc(100dvh - 2 * var(--gutter)); padding: var(--space-4); border: 0; border-radius: var(--r-panel); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-overlay); }
dialog::backdrop { background: rgba(11, 43, 54, 0.72); }
.dialog-close { position: sticky; top: 0; margin-left: auto; display: block; min-height: 44px; min-width: 44px; padding: 0.5rem 1rem; border: 1.5px solid var(--ink); border-radius: var(--r-control); background: var(--paper); color: var(--ink); font-size: 1rem; font-weight: 600; }

.site-footer { background: var(--harbor); color: var(--harbor-text); padding-block: var(--space-6) var(--space-4); font-size: var(--step--1); line-height: 1.65; }
.site-footer a { color: var(--paper); text-decoration: none; display: inline-block; min-height: 44px; padding-block: 9px; background: transparent; }
.site-footer nav a { color: var(--paper); }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: var(--space-4); }
.footer-grid h2, .footer-grid h3, .footer-grid h4, .footer-heading { font-family: var(--sans); font-size: var(--step--1); font-weight: 700; color: var(--paper); margin-bottom: 0.35rem; line-height: 1.35; letter-spacing: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.footer-grid li:not(:has(a)), .footer-contact-item { padding-block: 9px; }
.site-footer .footer-contact-item { display: block; }
.footer-logo img, .footer-about > img { width: 120px; height: auto; margin-bottom: var(--space-3); }
.footer-base, .footer-bottom { margin-top: var(--space-6); padding-top: var(--space-2); border-top: 1px solid var(--muted); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: center; font-size: var(--step--1); }
.footer-base nav { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.footer-service-areas, .footer-credentials { color: var(--harbor-text); font-size: var(--step--1); }
.social-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.callbar { display: none; }
.harbor, .site-header.harbor { background: var(--harbor); color: var(--paper); }
.harbor p { color: var(--harbor-text); }
.harbor a:not(.btn), .site-header.harbor :is(.header-phone, .nav a, .nav-links a, .dropdown-toggle) { color: var(--paper); }
.harbor .btn, .harbor .btn-primary, .harbor .btn-quiet, .harbor .btn-outline { background: transparent; border-color: var(--paper); color: var(--paper); }
.harbor .btn:hover, .harbor .btn-primary:hover, .harbor .btn-quiet:hover, .harbor .btn-outline:hover { background: var(--paper); color: var(--harbor); }
.site-footer :focus-visible, .callbar :focus-visible, .harbor :focus-visible { outline-color: var(--signal); }
.site-header.harbor { border-bottom-color: var(--harbor); }
.site-header.harbor.is-scrolled { border-bottom-color: var(--muted); }
.site-header.harbor .menu-btn { border-color: var(--paper); color: var(--paper); }
.site-header.harbor .dropdown-menu :is(a, .dropdown-toggle) { color: var(--ink); }
.site-header.harbor .dropdown-menu :focus-visible { outline-color: var(--ink); }

/* Temporary utilities. Final template styles own their page layouts. */
.mx-auto { margin-inline: auto; }
.text-center { text-align: center; }
.services-grid, .portfolio-grid, .service-intent__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.contact-grid, .split-content, .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.service-card, .portfolio-card, .team-card, .blog-card, .testimonial-card { min-width: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.content-block { max-width: var(--measure); }
.content-block > * + * { margin-top: var(--space-3); }

@media (max-width: 1100px) {
  .site-header :is(.nav, .nav-links) { display: none; }
  .site-header .header-phone { margin-left: auto; }
  .site-header .menu-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; }
  .site-header.nav-open :is(.nav, .nav-links) { position: fixed; inset: 0; z-index: 51; display: flex; flex-direction: column; align-items: stretch; gap: var(--space-1); height: 100dvh; margin: 0; padding: calc(76px + var(--space-3)) var(--gutter) calc(var(--space-4) + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; background: var(--paper); color: var(--ink); }
  .site-header.nav-open .menu-btn { position: relative; z-index: 52; margin-left: auto; background: var(--paper); color: var(--ink); border-color: var(--ink); }
  .site-header.nav-open :is(.nav, .nav-links) :is(a, .dropdown-toggle) { color: var(--ink); font-size: 1.3125rem; line-height: 1.3; flex-shrink: 0; }
  .site-header.nav-open .dropdown-menu { display: grid; position: static; width: auto; max-width: none; padding: 0 0 0 var(--space-2); border-radius: 0; background: none; box-shadow: none; }
  .site-header.nav-open .dropdown-menu a { padding-inline: 0; }
  .site-header.nav-open .mobile-nav-contact { display: grid; gap: var(--space-2); margin-top: auto; padding-top: var(--space-4); flex-shrink: 0; }
  .site-header.nav-open .mobile-nav-contact .header-phone { display: inline-flex; margin-left: 0; }
  .site-header.nav-open .mobile-nav-contact .btn-primary { display: inline-flex; width: 100%; padding: 0.75rem 1.4rem; background: var(--blue); border: 1.5px solid var(--blue); border-radius: var(--r-control); color: var(--paper); font-size: 1.0625rem; font-weight: 600; text-align: center; justify-content: center; }
  .site-header.nav-open .mobile-nav-contact .btn-primary:hover { background: var(--harbor); border-color: var(--harbor); color: var(--paper); }
  .site-header.nav-open :focus-visible { outline-color: var(--ink); }
  .section-head, .stack-head { grid-column: 1 / -1; margin-bottom: var(--space-4); }
  .closing-text { grid-column: 1 / span 7; }
  .closing-action { grid-column: 9 / span 4; }
  .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .services-grid, .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 80px; }
  .r3-page-building-explorer #main-content:not(:has(.be-detail-active)) { height: calc(100svh - 64px - 48px - 1.2rem - env(safe-area-inset-bottom)); min-height: 520px; }
  .r3-page-building-explorer .bx-tourbar { flex-wrap: wrap; justify-content: center; }
  .r3-page-building-explorer .bx-finale:not([hidden]) { justify-content: flex-start; gap: 12px; padding: 16px; overflow-y: auto; }
  .r3-page-building-explorer .bx-finale > * { flex-shrink: 0; }
  .r3-page-building-explorer .bx-finale h2 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
  .r3-page-building-explorer .bx-finale p { margin: 0; font-size: 1rem; line-height: 1.5; }
  .r3-page-building-explorer .bx-finale-actions { justify-content: center; gap: 8px; }
  .r3-page-building-explorer .bx-finale :is(.bx-cta-primary, .bx-cta-secondary) { padding: 12px 16px; font-size: 1rem; }
  .grid { column-gap: var(--space-2); }
  .site-header .wrap { min-height: 64px; gap: var(--space-2); }
  .site-header .logo img { width: 76px; }
  .site-header .wrap > .header-phone, .site-header .wrap > .header-cta,
  .site-header .wrap > .btn-primary, .site-header .wrap > .cta-button { display: none; }
  .site-header .menu-btn { margin-left: auto; }
  .site-header.nav-open :is(.nav, .nav-links) { padding-top: calc(64px + var(--space-3)); }
  .closing-text, .closing-action { grid-column: 1 / -1; }
  .closing-action { margin-top: var(--space-4); }
  .closing-action .btn { width: 100%; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .breadcrumb ol { margin-bottom: var(--space-2); }
  .breadcrumb li[aria-current] { display: none; }
  .services-grid, .portfolio-grid, .service-intent__grid, .contact-grid, .split-content, .form-row { grid-template-columns: minmax(0, 1fr); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .callbar { display: flex; position: sticky; bottom: 0; z-index: 40; background: var(--harbor); padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom)); }
  .callbar a { flex: 1; min-height: 48px; display: grid; place-items: center; padding-inline: var(--space-1); color: var(--paper); font-size: 1rem; line-height: 1.35; font-weight: 700; text-decoration: none; border: 1.5px solid var(--harbor-text); border-radius: var(--r-control); }
}
@media (max-width: 380px) {
  .site-header .wrap { gap: var(--space-1); }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .btn-primary, .btn-quiet, .btn-outline, .btn-navy, .cta-button { transition: none; }
}
