/* Big Horn Masonry — Concept 01
   Commercial masonry aesthetic (BSM / DM Construction reference)
*/

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap');

:root {
  --ink: #141414;
  --ink-soft: #2a2a2a;
  --slate: #4a4a4a;
  --muted: #6b6b6b;
  --line: #e2e2e2;
  --bg: #fafafa;
  --white: #ffffff;
  --brick: #9c3d2e;
  --brick-dark: #7a2f23;
  --accent: var(--brick);
  --header-h: 72px;
  --font: 'Barlow', system-ui, sans-serif;
  --font-display: 'Barlow Condensed', 'Barlow', sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

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

a {
  color: var(--brick);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover { color: var(--brick-dark); }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--ink);
  border-bottom: 3px solid var(--brick);
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}

.logo:hover {
  color: #fff;
  opacity: 0.92;
}

.logo-mark {
  background: #f4efe6;
  border-radius: 3px;
  padding: 3px 5px;
  line-height: 0;
  flex-shrink: 0;
}

.logo img {
  height: 46px;
  width: auto;
  display: block;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

@media (max-width: 520px) {
  .logo-text { display: none; }
  .logo img { height: 44px; }
}

.nav-links {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: rgba(255,255,255,0.88);
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.nav-cta {
  background: var(--brick);
  color: var(--white) !important;
  padding: 10px 20px;
  border-radius: 2px;
}

.nav-cta:hover {
  background: var(--brick-dark);
  color: var(--white) !important;
}

.mobile-menu {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: flex-end;
  background: var(--ink-soft) center/cover no-repeat;
  color: var(--white);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.25) 55%, rgba(0,0,0,0.35) 100%);
}

.hero .container {
  position: relative;
  z-index: 1;
  padding-top: 120px;
  padding-bottom: 64px;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 20px;
  max-width: 14ch;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 560px;
  margin: 0 0 32px;
  color: rgba(255,255,255,0.9);
}

.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--brick);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--brick-dark);
  color: var(--white);
}

.btn-outline {
  border: 2px solid var(--white);
  color: var(--white);
  margin-left: 12px;
}

.btn-outline:hover {
  background: var(--white);
  color: var(--ink);
}

.btn-dark {
  background: var(--ink);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--ink-soft);
  color: var(--white);
}

/* Page header (inner pages) */
.page-hero {
  background: var(--ink);
  color: var(--white);
  padding: 56px 0 48px;
  border-bottom: 3px solid var(--brick);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 12px;
}

.page-hero p {
  margin: 0;
  color: rgba(255,255,255,0.8);
  max-width: 640px;
}

/* Sections */
.section { padding: clamp(56px, 8vw, 96px) 0; }

.section-dark {
  background: var(--ink);
  color: var(--white);
}

.section-white { background: var(--white); }

.section-header {
  margin-bottom: 40px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
  color: var(--ink);
}

.section-dark .section-header h2 { color: var(--white); }

.section-intro {
  color: var(--muted);
  max-width: 640px;
  margin: 0;
  font-size: 1.1rem;
}

.section-dark .section-intro {
  color: rgba(255, 255, 255, 0.72);
}

/* Stats bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: -48px;
  position: relative;
  z-index: 2;
}

.stat-item {
  background: var(--white);
  padding: 28px 24px;
  text-align: center;
}

.stat-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--brick);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-item span {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Value props */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.value-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--ink);
}

.value-card p { margin: 0; color: var(--slate); }

/* Project filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.filter-btn {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--slate);
  padding: 8px 18px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.project-count-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  text-align: left;
  width: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
}

.project-card--clickable {
  cursor: pointer;
  border: none;
  appearance: none;
  -webkit-appearance: none;
}

.project-card--clickable:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.project-card--clickable img {
  pointer-events: none;
}

.project-photo-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(20, 20, 20, 0.82);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 1;
}

.project-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #ddd;
}

.project-card-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card .category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brick);
  margin-bottom: 6px;
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  line-height: 1.25;
}

.project-card .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.portfolio-group {
  margin-bottom: 56px;
}

.portfolio-group-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brick);
}

.home-categories {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.home-category-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  gap: 16px;
}

.home-category-head h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 0.04em;
}

.home-category-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.home-type-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.home-type-card:hover {
  border-color: var(--brick);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  text-decoration: none;
}

.home-type-card h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.home-type-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.88);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  background: var(--white);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}

.lightbox-stage {
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-caption {
  padding: 28px 32px;
  overflow-y: auto;
}

.lightbox-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brick);
  margin: 0 0 8px;
}

.lightbox-caption h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  text-transform: uppercase;
  margin: 0 0 12px;
  line-height: 1.15;
}

.lightbox-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 16px;
}

.lightbox-desc {
  margin: 0 0 12px;
  color: var(--slate);
  line-height: 1.6;
}

.lightbox-photo-caption {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--slate);
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.lightbox-counter {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 2;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255,255,255,0.92);
  border: none;
  width: 44px;
  height: 56px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink);
}

.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

@media (max-width: 900px) {
  .lightbox-dialog {
    grid-template-columns: 1fr;
    max-height: 95vh;
  }
  .lightbox-nav { top: 40%; }
}

/* Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.team-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 28px;
}

.team-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.team-card .role {
  color: var(--brick);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.team-card p { margin: 0; color: var(--slate); font-size: 0.98rem; }

/* Team → Legacy (in memory) */
.legacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.legacy-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
}

.legacy-card-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}

.legacy-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.legacy-card-photo--placeholder {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.1) 100%);
}

.legacy-card-body {
  padding: 24px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.legacy-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  text-transform: uppercase;
  margin: 0 0 4px;
  color: var(--white);
}

.legacy-card-role {
  color: #e0a894;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 12px;
}

.legacy-card-body > p:last-of-type {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
  line-height: 1.55;
  flex: 1;
}

.legacy-card-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.legacy-card-link:hover {
  color: #e0a894;
  border-bottom-color: currentColor;
}

.team-photo-band {
  background: var(--bg);
}

.team-photo-band-inner {
  display: flex;
  justify-content: center;
  padding: 48px clamp(20px, 4vw, 48px);
}

.team-photo-band img {
  display: block;
  max-width: min(960px, 100%);
  width: 100%;
  height: auto;
  margin: 0 auto;
}

/* About timeline */
.prose { max-width: 720px; }
.prose p { color: var(--slate); }

.about-logo {
  float: left;
  margin: 0 28px 16px 0;
  max-width: 140px;
}

.about-logo img {
  width: 100%;
  height: auto;
  filter: none;
}
.prose h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.5rem;
  margin-top: 40px;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-block h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  margin: 0 0 16px;
}

.contact-block p { margin: 0 0 8px; color: var(--slate); }

.contact-block a { font-weight: 600; font-size: 1.1rem; }

.map-wrap {
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

#serviceMap {
  width: 100%;
  height: 420px;
  min-height: 320px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--slate);
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-legend-swatch--hq {
  background: var(--brick);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--brick);
}

.map-legend-swatch--primary {
  background: rgba(156, 61, 46, 0.35);
  border: 2px solid var(--brick);
}

.map-legend-swatch--extended {
  background: rgba(107, 107, 107, 0.2);
  border: 1px dashed var(--slate);
}

/* Leaflet overrides */
.bhm-map-pin span {
  display: block;
  width: 28px;
  height: 28px;
  background: var(--brick);
  border: 3px solid var(--white);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  margin-left: 2px;
}

.bhm-state-label span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  opacity: 0.65;
  white-space: nowrap;
  pointer-events: none;
}

.leaflet-container {
  font-family: var(--font);
}

/* Keep tiles/markers inside the map box; header stays above Leaflet panes */
.map-wrap .leaflet-pane {
  z-index: 1 !important;
}

.map-wrap .leaflet-top,
.map-wrap .leaflet-bottom {
  z-index: 2 !important;
}

.map-wrap .leaflet-popup-pane {
  z-index: 3 !important;
}

/* CTA band */
.cta-band {
  background: var(--brick);
  color: var(--white);
  text-align: center;
  padding: 56px 24px;
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.cta-band p { margin: 0 0 24px; opacity: 0.95; }

.cta-band .btn-primary {
  background: var(--white);
  color: var(--brick);
}

.cta-band .btn-primary:hover {
  background: #f0f0f0;
  color: var(--brick-dark);
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.75);
  padding: 48px 0 32px;
  font-size: 0.92rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}

.site-footer strong {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: var(--white); }

.concept-tag {
  font-size: 0.8rem;
  opacity: 0.5;
  margin-top: 24px;
  width: 100%;
}

/* Randy Carey memorial */
.page-hero--memorial {
  background: linear-gradient(135deg, var(--ink) 0%, #2c2420 100%);
  color: var(--white);
}

.page-hero--memorial .eyebrow { color: rgba(255,255,255,0.65); }
.page-hero--memorial h1,
.page-hero--memorial .lead { color: var(--white); }

.memorial-banner {
  min-height: 220px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.memorial-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
}

.memorial-banner-inner {
  position: relative;
  z-index: 1;
  padding: 80px 0;
  text-align: center;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content-narrow {
  max-width: 720px;
}

.memorial-prose {
  overflow: hidden;
}

.memorial-figure {
  margin: 0 0 24px;
  max-width: 280px;
}

.memorial-figure--left {
  float: left;
  margin-right: 28px;
}

.memorial-figure--right {
  float: right;
  margin-left: 28px;
}

.memorial-figure img {
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

@media (max-width: 640px) {
  .memorial-figure--left,
  .memorial-figure--right {
    float: none;
    margin: 0 auto 24px;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--ink);
    padding: 20px 24px 24px;
    border-bottom: 3px solid var(--brick);
    gap: 16px;
  }

  .nav-links.open { display: flex; }
  .mobile-menu { display: block; }
  .btn-outline { margin-left: 0; margin-top: 12px; display: inline-block; }
  .hero .container { padding-bottom: 48px; }
}
