/* BernMar Construction — site.css
   Direction: chandos.com mechanics — near-greyscale ground, statement type,
   letterbox photo bands, turquoise as accent only.
   Tokens: brand turquoise is GRAPHIC ONLY (fails AA as text);
   --accent is the AA-safe dark teal for text/hover states. */

/* ---------- fonts (self-hosted, latin) ---------- */
@font-face {
  font-family: "Work Sans";
  src: url("../fonts/WorkSans-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --ink: #161a1c;
  --body: #3d454b;
  --muted: #6c757c;
  --canvas: #ffffff;
  --surface: #f2f4f4;
  --hairline: #dfe4e5;
  --brand: #2ab3bb;        /* logo turquoise — graphic use only (2.5:1 on white) */
  --accent: #127076;       /* AA-safe teal for text/hover (5.8:1 on white) */
  --accent-ink: #0b565b;   /* hover deepen */
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --radius: 6px;           /* one radius scale */
  --shadow-soft: 0 10px 30px rgba(22, 26, 28, 0.10);  /* one shadow scale: none | soft */
  --container: 1120px;
  --section: clamp(64px, 9vw, 112px);
  --header-h: 96px;
  --header-h-shrunk: 74px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
::selection { background: var(--brand); color: #fff; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 5.4vw, 64px); }
h2 { font-size: clamp(32px, 4vw, 46px); }
h3 { font-size: clamp(22px, 2.6vw, 28px); }
p { margin: 0 0 1em; max-width: 68ch; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

.wrap { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: var(--section); }
.section--tint { background: var(--surface); }

/* ---------- header: sticky, two-threshold shrink (design-standards §13) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  overflow-anchor: none;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  transition: box-shadow 0.25s ease;
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  transition: height 0.25s ease;
}
.site-header.shrunk { box-shadow: var(--shadow-soft); }
.site-header.shrunk .bar { height: var(--header-h-shrunk); }
.brand-link { display: inline-flex; align-items: center; }
.brand-link img {
  height: 58px;
  width: auto;
  transition: height 0.25s ease;
}
.site-header.shrunk .brand-link img { height: 44px; }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 32px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  position: relative;
  display: inline-block;
  padding: 10px 2px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  min-height: 44px;
  line-height: 24px;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 100%;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav a[aria-current="page"] { color: var(--accent); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
  content: "";
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    box-shadow: var(--shadow-soft);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 16px;
  }
  .main-nav a { display: block; padding: 12px 2px; font-size: 17px; }
}

/* ---------- buttons (one primary, one secondary) ---------- */
.btn {
  display: inline-block;
  padding: 13px 26px;
  min-height: 44px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid var(--ink);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- statement type (the signature element) ---------- */
.statement {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: clamp(44px, 7.4vw, 96px);
  line-height: 1.02;
  letter-spacing: 0.005em;
  margin: 0;
}
.statement .st-line { display: block; }
.statement--mid { font-size: clamp(34px, 5.2vw, 68px); }

.statement-cta { margin-top: clamp(30px, 4vw, 48px); }

.hero-statement { padding: clamp(72px, 11vw, 140px) 0 clamp(48px, 7vw, 88px); }
.hero-statement .lede {
  margin-top: 28px;
  font-size: 18px;
  color: var(--muted);
  max-width: 60ch;
}
.hero-statement .actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }

/* diamond separator — the one recurring accent device */

/* ---------- letterbox photo bands ---------- */
.band { position: relative; background: var(--surface); }
.band img { display: block; width: 100%; height: auto; }

.band-phrase {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: clamp(52px, 9vw, 120px);
  line-height: 0.95;
  margin: 0 0 28px;
  padding-inline: 16px;
  pointer-events: none;
}
.band-phrase + .band { position: relative; }

/* page-head hero: full-bleed letterbox with title over (Morton pattern) */
.page-head {
  position: relative;
  background: var(--ink);
}
.page-head img {
  display: block;
  width: 100%;
  height: auto;
}
.page-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46%;
  background: linear-gradient(to bottom, rgba(20,24,26,0) 0%, rgba(20,24,26,0.66) 72%, rgba(20,24,26,0.78) 100%);
  pointer-events: none;
}
.page-title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  width: 100%;
  padding-bottom: clamp(20px, 3.4vw, 40px);
}
.page-head h1 { color: #fff; margin: 0; }
.page-head .town-line { color: rgba(255, 255, 255, 0.85); margin: 6px 0 0; font-size: 15px; }

/* ---------- fixed-aspect photo boxes (swap-ready: any proportion drops in) ---------- */
.ph {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}
.ph img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  /* bias cover-crops upward so rooflines survive (design-standards 14) */
  object-position: center 22%;
}
.ph--card { aspect-ratio: 4 / 3; }
.ph--wide { aspect-ratio: 3 / 2; }
.ph--panel { aspect-ratio: 3 / 4; }
.ph--small { aspect-ratio: 4 / 3; max-width: 420px; }

/* ---------- service board (Marawood four-panel) ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--hairline);
}
.board .panel {
  position: relative;
  display: block;
  text-decoration: none;
  background: var(--ink);
  overflow: hidden;
  aspect-ratio: 3 / 4.4;
}
.board .panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}
.board .panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 14, 15, 0.72), rgba(10, 14, 15, 0) 55%);
}
.board .panel .panel-copy {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 20px;
}
.board .panel h3 { color: #fff; margin: 0 0 4px; font-size: clamp(20px, 2vw, 26px); }
.board .panel p { color: rgba(255, 255, 255, 0.82); font-size: 14px; margin: 0; max-width: none; }
.board .panel .panel-more {
  display: inline-block;
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 2px;
  transition: border-color 0.25s ease, padding-left 0.25s ease;
}
.board .panel:hover .panel-more { padding-left: 6px; }
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(2, 1fr); }
  .board .panel { aspect-ratio: 4 / 3.6; }
}
@media (max-width: 520px) {
  .board { grid-template-columns: 1fr; }
  .board .panel { aspect-ratio: 16 / 9; }
}

/* ---------- project cards (repeating pattern: new project = one new block) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; }
.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card a:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.card .ph { border-radius: var(--radius) var(--radius) 0 0; }
.card .card-copy { padding: 18px 6px 20px; }
.card h3 { margin: 0 0 4px; font-size: 23px; }
.card .town { color: var(--muted); font-size: 14px; margin: 0; }
.card .sector-tag { color: var(--accent); font-size: 14px; font-weight: 600; margin: 8px 0 0; }

/* ---------- work pairs: always stacked, finished first (no slider) ---------- */
.ba { margin: 0; }
.ba .ba-item { margin: 0; }
.ba .ba-item + .ba-item { margin-top: 28px; }
.ba .ba-item img { display: block; width: 100%; height: auto; background: var(--surface); }
.ba figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}
.ba--small { max-width: 720px; margin-inline: auto; }

/* ---------- split rows (photo + copy) ---------- */
.split {
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.split--flip { grid-template-columns: 45fr 55fr; }
@media (max-width: 860px) {
  .split, .split--flip { grid-template-columns: 1fr; }
}

/* ---------- testimonial band (Frey pattern; renders only when content.js has quotes) ---------- */
.testimonials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(28px, 3.5vw, 48px);
  margin-top: 36px;
}
.testimonials--one { grid-template-columns: 1fr; max-width: 780px; }
.testimonials .testimonial { margin: 0; max-width: none; padding-top: 28px; }
.testimonials .testimonial blockquote { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.32; }
.testimonial-cite {
  margin-top: 18px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--muted);
}
@media (max-width: 820px) { .testimonials { grid-template-columns: 1fr; } }

.testimonial { border-top: 3px solid var(--brand); padding-top: 40px; max-width: 780px; }
.testimonial blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.2;
  color: var(--ink);
}
.testimonial cite {
  display: block;
  margin-top: 20px;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--muted);
}

/* ---------- CTA band ---------- */
.cta {
  background: var(--ink);
  color: #fff;
  text-align: center;
}
.cta h2 { color: #fff; margin-inline: auto; }
.cta p { color: rgba(255, 255, 255, 0.78); margin-inline: auto; }
.cta .btn--primary { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.cta .btn--primary:hover { background: #fff; border-color: #fff; color: var(--ink); }
.cta .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.cta .btn--ghost:hover { border-color: #fff; color: #fff; }
.cta .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  padding: 56px 0 32px;
}
.site-footer .foot-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 800px) { .site-footer .foot-grid { grid-template-columns: 1fr; } }
.site-footer img.foot-logo { width: 240px; height: auto; margin-bottom: 18px; }
.site-footer h2, .site-footer h3 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
}
.site-footer p, .site-footer li { font-size: 15px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--body); }
.site-footer a:hover { color: var(--accent); }
.foot-signoff { margin-top: 24px; color: var(--muted); font-size: 15px; }
.foot-legal {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}
.foot-legal a { color: var(--muted); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  min-height: 48px;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.hidden-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---------- contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 45fr 55fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 0 0 28px; padding: 0; }
.contact-list li { padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.contact-list .k { font-weight: 600; color: var(--ink); display: block; font-size: 14px; }
.contact-list .v { font-size: 17px; }
.map-embed {
  border: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  display: block;
}

/* ---------- reveal system (brief: quiet statement reveals + IO fades) ---------- */
/* ---------- misc ---------- */
.lede { font-size: 18px; color: var(--body); }
.small-note { font-size: 14px; color: var(--muted); }
.rule-top { border-top: 1px solid var(--hairline); padding-top: clamp(28px, 4vw, 44px); }
.stack > * + * { margin-top: 0; }
.center { text-align: center; }
.center p { margin-inline: auto; }
.two-col { columns: 2; column-gap: 48px; }
@media (max-width: 760px) { .two-col { columns: 1; } }

/* 404 */
.error-page { text-align: center; padding: clamp(80px, 14vw, 160px) 0; }
.error-page .big {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(90px, 18vw, 200px);
  line-height: 1;
  color: var(--ink);
  margin: 0;
}


/* ---------- full-size photo plates (home) ---------- */
.wrap--wide { max-width: 1600px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }
.plates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3vw, 40px);
}
.plates .plate { margin: 0; }
.plates .plate img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
}
.plates .plate figcaption {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
}
@media (max-width: 720px) {
  .plates { grid-template-columns: 1fr; }
}


/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0; margin-top: 8px; }
.faq-item { border-top: 1px solid var(--hairline); }
.faq-item:last-child { border-bottom: 1px solid var(--hairline); }

/* click the question to drop the answer down. Native details/summary, no JS. */
.faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 26px 44px 26px 0;
  position: relative;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary h3 { margin: 0; font-size: 21px; }
.faq-item > summary:hover h3 { color: var(--accent); }
.faq-item > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* chevron, rotates when open */
.faq-item > summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -7px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  transform-origin: center;
}
.faq-item[open] > summary::after { margin-top: -3px; transform: rotate(-135deg); }
.faq-a { padding: 0 44px 26px 0; }
.faq-item p { margin: 0; color: var(--body); max-width: 68ch; }

.lede-xl {
  font-size: clamp(22px, 2.3vw, 29px);
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 22px;
  max-width: 34ch;
}

.hero-statement--tight { padding: clamp(46px, 6vw, 80px) 0 clamp(24px, 3vw, 40px); }
.hero-statement--tight h1 { margin: 0; }
.town-line--dark { color: var(--muted); margin: 10px 0 0; font-size: 15px; }

/* single measured column for text-only intros (agricultural etc.) */
.intro-col { max-width: 58ch; }
/* inside the intro column every paragraph shares one measure, so the three
   statement paragraphs read as one block instead of three widths */
.intro-col .lede-xl { max-width: none; }
.intro-col .lede-xl + .lede-xl { margin-top: 26px; }

/* clickable picture plates */
.plate--link a { display: block; color: inherit; text-decoration: none; }
.plate--link img { transition: opacity 0.2s ease; }
.plate--link a:hover img,
.plate--link a:focus-visible img { opacity: 0.9; }
.plate--link figcaption { font-size: 19px; color: var(--ink); font-weight: 600; margin-top: 14px; }
.plate--link a:hover figcaption { color: var(--accent); }

/* overlay plates: white caption ON the photo over a bottom scrim */
.plate--overlay a { position: relative; display: block; }
.plate--overlay a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 52%;
  background: linear-gradient(to bottom, rgba(20,24,26,0) 0%, rgba(20,24,26,0.62) 68%, rgba(20,24,26,0.78) 100%);
  pointer-events: none;
}
.plate--overlay figcaption,
.plates .plate--overlay figcaption {
  color: #fff;
  margin-top: 0;
}
.plate--overlay figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 18px 20px;
  color: #fff;
}
.plate--overlay .plate-title { display: block; font-size: 21px; font-weight: 700; color: #fff; }
.plate--overlay .plate-desc { display: block; font-size: 14px; color: rgba(255, 255, 255, 0.85); margin-top: 4px; }
.plate--overlay a:hover figcaption, .plate--overlay a:hover .plate-title { color: #fff; }
