:root {
  --color-bg: #ffffff;
  --color-bg-muted: #f2f5f8;
  --color-text: #1c232b;
  --color-text-muted: #57626d;
  --color-brand: #2b6cb0;       /* LEM hardhat blue */
  --color-brand-dark: #1d4a7d;
  --color-accent: #e8830e;      /* construction safety orange */
  --color-border: #e0e5eb;
  --radius: 8px;
  --wrap-width: 1160px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--color-brand); }

.wrap {
  max-width: var(--wrap-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  gap: 16px;
}

.brand__mark { height: 56px; width: auto; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text);
  white-space: nowrap;
}

.site-nav a:hover { color: var(--color-brand); }

.site-nav__cta {
  background: var(--color-accent);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
}

@media (max-width: 880px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 20px;
    gap: 14px;
  }

  .site-nav.is-open { display: flex; }

  .site-nav__cta { align-self: flex-start; }
}

/* ---------- Hero (homepage) ---------- */

.hero { display: grid; grid-template-columns: minmax(0, 1fr); color: #fff; }
.hero__media, .hero__content { grid-area: 1 / 1; }

.hero__media {
  aspect-ratio: 16 / 8;
  min-height: 340px;
  overflow: hidden;
  background: var(--color-brand-dark);
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.hero__content {
  position: relative;
  padding-top: 48px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(90deg, rgba(15,35,58,0.90) 0%, rgba(15,35,58,0.62) 55%, rgba(15,35,58,0.18) 100%);
  max-width: none;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 700;
  margin: 0 0 10px;
}

.hero__content h1 {
  max-width: 620px;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  margin: 0 0 16px;
}

.hero .lede {
  max-width: 540px;
  color: rgba(255,255,255,0.92);
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

@media (max-width: 640px) {
  .hero__media { aspect-ratio: auto; min-height: 0; }
  .hero__content {
    padding-top: 36px;
    padding-bottom: 36px;
    background: linear-gradient(0deg, rgba(15,35,58,0.88) 0%, rgba(15,35,58,0.72) 100%);
  }
  .hero__content h1 { font-size: 1.6rem; line-height: 1.25; }
  .hero__actions .button { text-align: center; }
}

/* ---------- Page hero (interior pages) ---------- */

.page-hero { display: grid; grid-template-columns: minmax(0, 1fr); color: #fff; }
.page-hero__media, .page-hero__content { grid-area: 1 / 1; }

.page-hero__media {
  aspect-ratio: 16 / 5;
  min-height: 200px;
  overflow: hidden;
  background: var(--color-brand-dark);
}

.page-hero--short .page-hero__media { aspect-ratio: 16 / 4; min-height: 160px; }

/* On phones the banner's height comes from its content. (An aspect ratio plus a min-height would force the
   banner wider than the screen: 160px x 4 = 640px.) Must stay after the base rules above. */
@media (max-width: 640px) {
  .page-hero__media, .page-hero--short .page-hero__media { aspect-ratio: auto; min-height: 120px; }
}

.page-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  filter: brightness(0.55);
}

.page-hero__content {
  position: relative;
  padding-top: 28px;
  padding-bottom: 28px;
  display: flex;
  align-items: center;
  max-width: none;
}

.page-hero h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* ---------- Buttons & links ---------- */

.button {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.button--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.6);
}

.link-arrow {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-brand);
}

/* ---------- Sections ---------- */

.section { padding-top: 64px; padding-bottom: 64px; }
.section--muted { background: var(--color-bg-muted); }
.section__heading { text-align: center; margin-bottom: 36px; }
.section__cta { text-align: center; margin-top: 32px; }

.prose { max-width: 780px; }
.prose h2 { margin-top: 40px; }
.lede { font-size: 1.1rem; color: var(--color-text-muted); }

.callout {
  border-left: 4px solid var(--color-accent);
  padding: 14px 20px;
  background: var(--color-bg-muted);
  font-weight: 600;
}

.checklist {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}

.checklist li {
  padding-left: 26px;
  position: relative;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 2px;
}

@media (max-width: 640px) {
  .checklist { grid-template-columns: 1fr; }
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split--top { align-items: start; }

.split--reverse { grid-template-columns: 1fr 1.1fr; }
.split--reverse .split__media { order: 2; }
.split--reverse .split__text { order: 1; }

.split__media, .split__media img {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.split__media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 800px) {
  .split, .split--reverse { grid-template-columns: 1fr; }
  .split--reverse .split__media, .split--reverse .split__text { order: initial; }
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-bg-muted); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card h3 { margin: 18px 20px 8px; }
.card p { margin: 0 20px 20px; color: var(--color-text-muted); }

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.gallery--projects { grid-template-columns: repeat(3, 1fr); }
.gallery--project { grid-template-columns: repeat(2, 1fr); margin-top: 40px; }

.breadcrumbs { font-size: 0.9rem; color: var(--color-text-muted); margin: 0 0 24px; }

@media (max-width: 700px) {
  .gallery, .gallery--projects { grid-template-columns: repeat(2, 1fr); }
  .gallery--project { grid-template-columns: 1fr; }
}

.gallery__item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.gallery__item img { width: 100%; height: 100%; object-fit: cover; }

.gallery__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 14px;
  background: linear-gradient(0deg, rgba(15,35,58,0.85), rgba(15,35,58,0));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Contact ---------- */

.contact-card {
  background: var(--color-bg-muted);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
}

.contact-card h2 { margin-top: 0; }

/* ---------- Contact form ---------- */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.92rem; }

.field input,
.field textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

/* Honeypot — hidden from real visitors, left in the tab/DOM flow for bots. */
.field--honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form__status { min-height: 1.2em; font-weight: 600; }
.contact-form__status[data-state="ok"] { color: #1a7f37; }
.contact-form__status[data-state="error"] { color: #c1121f; }

/* ---------- Current bids ---------- */

.bids { display: grid; gap: 20px; margin-top: 32px; }
.bids__status { color: var(--color-text-muted); }
.bid {
  display: grid; gap: 14px 32px;
  grid-template-columns: 1.4fr 1fr;
  padding: 24px 28px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-accent);
  border-radius: var(--radius);
}
.bid--closed { border-left-color: var(--color-border); opacity: .75; }
.bid .bid__title { grid-column: 1 / -1; margin: 0; font-size: 1.25rem; }
.bid__title a { color: var(--color-brand-dark); text-decoration: none; }
.bid__title a:hover { text-decoration: underline; }
.bid dl { margin: 0; display: grid; gap: 10px; align-content: start; }
.bid dt { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.bid dd { margin: 2px 0 0; }
.bid__badge { display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--color-bg-muted); color: var(--color-text-muted); border-radius: 999px; vertical-align: middle; }
.bid__cta { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 700px) { .bid { grid-template-columns: 1fr; padding: 20px; } }

/* ---------- Affiliations strip ---------- */

.section--dark {
  background: var(--color-brand-dark);
  color: rgba(255,255,255,0.9);
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.affiliations img {
  max-height: 56px;
  width: auto;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-brand-dark);
  color: rgba(255,255,255,0.85);
  padding: 48px 0 20px;
  margin-top: 40px;
}

.site-footer h3 { color: #fff; margin-top: 0; }
.site-footer a { color: #fff; }
.footer-logo { height: 56px; width: auto; margin-bottom: 12px; filter: brightness(0) invert(1); }

.footer-affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.footer-affiliations img {
  height: 34px;
  width: auto;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 800px) { .site-footer__grid { grid-template-columns: 1fr; } }

.site-footer__utility {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.85rem;
}

.site-footer__utility a { text-decoration: none; opacity: 0.85; }
.site-footer__utility a:hover { opacity: 1; }

.site-footer__legal {
  margin-top: 14px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

/* ---------- Hero motion: slow pan + zoom (parallax is in js/motion.js) ---------- */

.hero__media img,
.page-hero__media img {
  scale: 1.1;
  will-change: transform, scale, translate;
  animation: hero-pan 20s ease-in-out infinite alternate;
}

@keyframes hero-pan {
  from { scale: 1.1; translate: 3% 0; }
  to   { scale: 1.3; translate: -3% -1.5%; }
}

/* Narrow banners: the same percentages are only a few pixels, so push harder. */
@media (max-width: 640px) {
  .hero__media img,
  .page-hero__media img { scale: 1.15; animation-duration: 16s; }

  @keyframes hero-pan {
    from { scale: 1.15; translate: 6% 0; }
    to   { scale: 1.5;  translate: -6% -2%; }
  }
}

/* ---------- Gallery hover ---------- */

.gallery__item img { transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .4s; }
.gallery__item:hover img,
.gallery__item:focus-visible img { transform: scale(1.06); filter: brightness(1.05); }
.gallery--project .gallery__item,
.split__media { cursor: zoom-in; }
.gallery--project .gallery__item::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(15,35,58,.35), rgba(15,35,58,0) 45%);
  opacity: 0; transition: opacity .3s;
}
.gallery--project .gallery__item:hover::after { opacity: 1; }

/* ---------- Lightbox ---------- */

.lb { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; color: #fff; overflow: hidden; }
@supports (height: 100dvh) { .lb { height: 100dvh; } }
.lb[hidden] { display: none; }
body.lb-open { overflow: hidden; }

.lb__backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(20,42,70,.94), rgba(5,10,18,.98));
  backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .35s;
}
.lb.is-open .lb__backdrop { opacity: 1; }

.lb__stage {
  position: relative; flex: 1; min-height: 0;
  margin: 0; padding: 56px 72px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}

.lb__img {
  max-width: 100%; max-height: calc(100% - 40px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .25s;
}
.lb__img.is-leaving { opacity: 0; transform: translateX(calc(var(--lb-dir, 1) * 60px)); }

.lb__caption {
  font-weight: 600; letter-spacing: .02em; text-align: center;
  opacity: 0; transform: translateY(8px); transition: opacity .4s .15s, transform .4s .15s;
}
.lb.is-open .lb__caption { opacity: .92; transform: none; }

.lb__close, .lb__nav, .lb__rotate {
  position: absolute; z-index: 2;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff; cursor: pointer; line-height: 1;
  border-radius: 999px;
  transition: background .2s, transform .2s, opacity .35s;
  opacity: 0;
}
.lb.is-open .lb__close, .lb.is-open .lb__nav, .lb.is-open .lb__rotate { opacity: 1; }
.lb__close:hover, .lb__nav:hover, .lb__rotate:hover { background: var(--color-accent); border-color: var(--color-accent); transform: scale(1.08); }
.lb__close { top: 14px; right: 14px; width: 44px; height: 44px; font-size: 28px; }
.lb__rotate { display: none; top: 14px; left: 14px; width: 44px; height: 44px; padding: 0; }
.lb__rotate svg { display: block; margin: auto; }
.lb__rotate[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); }
.lb__nav { top: 50%; width: 48px; height: 48px; margin-top: -24px; font-size: 34px; padding-bottom: 4px; }
.lb__nav--prev { left: 14px; }
.lb__nav--next { right: 14px; }
.lb__close:focus-visible, .lb__nav:focus-visible, .lb__rotate:focus-visible, .lb__thumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.lb__bar {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 16px;
  padding: 8px 16px 16px;
  justify-content: center;
}
.lb__bar[hidden] { display: none; }
.lb__nav[hidden] { display: none; }
.lb__count { font-size: .85rem; opacity: .7; min-width: 3.5em; }
.lb__thumbs { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding: 4px; }
.lb__thumb {
  flex: none; width: 64px; height: 46px;
  background-size: cover; background-position: center;
  border: 2px solid transparent; border-radius: 5px;
  opacity: .5; cursor: pointer; transition: opacity .2s, border-color .2s, transform .2s;
}
.lb__thumb:hover { opacity: .85; }
.lb__thumb.is-current { opacity: 1; border-color: var(--color-accent); transform: translateY(-2px); }

@media (max-width: 640px) {
  .lb__stage { padding: 56px 8px 4px; }
  .lb__nav { top: auto; bottom: 84px; margin-top: 0; width: 42px; height: 42px; }
  .lb__nav--prev { left: 10px; }
  .lb__nav--next { right: 10px; }
}

/* Portrait phones/tablets: a button turns the photo 90deg so a landscape shot uses the full screen height. */
@media (max-width: 900px) and (orientation: portrait) {
  .lb__rotate { display: block; }
  .lb.is-rot .lb__stage { padding: 0; }
  .lb.is-rot .lb__img {
    position: absolute; left: 50%; top: 50%;
    translate: -50% -50%; rotate: 90deg;
    max-width: calc(100vh - 24px); max-height: calc(100vw - 24px);
    border-radius: 4px;
  }
  @supports (height: 100dvh) { .lb.is-rot .lb__img { max-width: calc(100dvh - 24px); } }
  .lb.is-rot .lb__caption, .lb.is-rot .lb__bar { display: none; }
  .lb.is-rot .lb__nav { top: 50%; bottom: auto; margin-top: -21px; width: 38px; height: 38px; background: rgba(0,0,0,.35); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__media img, .page-hero__media img { animation: none; scale: 1.05; }
  .lb *, .gallery__item img { transition: none !important; }
}

.contact-form__legal { font-size: .75rem; color: var(--color-text-muted); margin: 0; }
