/* ==========================================================================
   SquareInch Contracting — site stylesheet
   Built from the SquareInch Brand & Design Guidelines 2026
   Type: Space Grotesk (headlines, numbers) · Inter (body, UI)
   High-Vis is the working accent: CTAs, key figures, the Unit Mark. Keep it ~10%.
   ========================================================================== */

:root {
  /* Primary */
  --bedrock: #16304A;
  --blue: #2E5A88;        /* SquareInch Blue */
  /* Secondary */
  --steel: #5B82A8;
  --blueprint: #DCE6F0;
  --sitecast: #F8F9FA;
  --highvis: #E8A33D;
  --ironwork: #22272C;

  /* Derived (tints of the palette, not new colours) */
  --tint: #EEF3F8;        /* Blueprint at ~50% on white */
  --body: #4A5560;        /* Ironwork softened for running text */
  --line: #DCE6F0;

  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1180px;
  --gutter: 24px;
  --radius: 2px;          /* measured, square-edged */
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ironwork);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); }
a:hover { color: var(--bedrock); }
:focus-visible { outline: 3px solid var(--highvis); outline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--bedrock);
  line-height: 1.15;
}
h1 { font-weight: 700; letter-spacing: -0.02em; font-size: clamp(2.3rem, 5.6vw, 4rem); }
h2 { font-weight: 500; letter-spacing: -0.01em; font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-weight: 500; letter-spacing: -0.005em; font-size: 1.25rem; margin-bottom: 10px; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 1; }

section { padding: 96px 0; position: relative; }
section.tint { background: var(--tint); }
section.dark { background: var(--bedrock); color: var(--sitecast); overflow: hidden; }
section.dark h2, section.dark h3 { color: var(--sitecast); }

/* Labels & eyebrows: Inter SemiBold, caps, wide tracking */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--highvis);
  margin-bottom: 18px;
}

/* ---------- Graphic devices ---------- */
/* The grid: fine 1px module grid at low opacity behind dark panels */
.grid-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(248,249,250,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248,249,250,.07) 1px, transparent 1px);
  background-size: 32px 32px;
}
/* The unit square: a single filled High-Vis square */
.unit-sq {
  position: absolute; z-index: 0; pointer-events: none;
  width: 96px; height: 96px; background: var(--highvis);
  right: 8%; bottom: 0;
}

/* Unit-square bullet lists */
ul.unit { list-style: none; }
ul.unit li { position: relative; padding-left: 26px; margin-bottom: 12px; }
ul.unit li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 9px; height: 9px; background: var(--highvis);
}

/* ---------- Buttons ---------- */
/* CTAs: filled High-Vis with Ironwork text, or outlined SquareInch Blue */
.btn {
  display: inline-block;
  font-family: var(--font-body); font-weight: 600; font-size: .98rem;
  letter-spacing: .01em; text-decoration: none; line-height: 1;
  padding: 16px 26px; border: 2px solid var(--highvis); border-radius: var(--radius);
  background: var(--highvis); color: var(--ironwork); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: #D4912C; border-color: #D4912C; color: var(--ironwork); }
.btn.ghost { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn.ghost:hover { background: var(--blue); color: var(--sitecast); }
.btn.ghost.light { border-color: rgba(248,249,250,.7); color: var(--sitecast); }
.btn.ghost.light:hover { background: var(--sitecast); border-color: var(--sitecast); color: var(--bedrock); }

/* ---------- Header ---------- */
.site-header {
  background: var(--bedrock);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(248,249,250,.08);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; }

.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--sitecast); }
.logo > span { display: flex; flex-direction: column; line-height: 1; }
.wordmark { font-family: var(--font-head); font-weight: 500; font-size: 1.45rem; letter-spacing: -0.02em; color: var(--sitecast); }
.wordmark span { font-weight: 700; }
.logo .sub { font-family: var(--font-body); font-weight: 600; font-size: .58rem; letter-spacing: .42em; color: rgba(248,249,250,.7); margin-top: 5px; }

.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a { color: rgba(248,249,250,.85); text-decoration: none; font-size: .95rem; font-weight: 500; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--sitecast); }
.main-nav a[aria-current="page"]:not(.btn) { box-shadow: inset 0 -2px 0 var(--highvis); padding-bottom: 4px; }
.main-nav .btn { padding: 12px 20px; color: var(--ironwork); }
.main-nav .btn:hover { color: var(--ironwork); }

.nav-toggle { display: none; background: none; border: 0; color: var(--sitecast); font-size: 1.6rem; cursor: pointer; padding: 6px 4px; }

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 76px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bedrock); padding: 8px var(--gutter) 22px;
    border-bottom: 1px solid rgba(248,249,250,.1);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid rgba(248,249,250,.08); }
  .main-nav a[aria-current="page"]:not(.btn) { box-shadow: none; color: var(--highvis); }
  .main-nav .btn { margin-top: 16px; text-align: center; border-bottom: 0; }
}

/* ---------- Hero ---------- */
.hero, .page-hero { background: var(--bedrock); color: var(--sitecast); overflow: hidden; position: relative; }
.hero .container { padding-top: 120px; padding-bottom: 128px; }
.hero h1 { color: var(--sitecast); max-width: 16ch; margin-bottom: 26px; }
.hero .lede { font-size: 1.18rem; color: rgba(248,249,250,.82); max-width: 640px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.page-hero .container { padding-top: 88px; padding-bottom: 88px; }
.page-hero h1 { color: var(--sitecast); font-size: clamp(2.1rem, 4.8vw, 3.4rem); max-width: 22ch; margin-bottom: 20px; }
.page-hero p:not(.eyebrow) { color: rgba(248,249,250,.82); font-size: 1.12rem; max-width: 720px; }

/* ---------- Section heads with the measure rule ---------- */
.section-head { max-width: 760px; margin-bottom: 52px; }
.section-head h2 { margin-bottom: 14px; }
.section-head h2::after {
  /* Measure rule: thin line with end ticks, like a tape measure */
  content: ""; display: block; width: 96px; height: 9px; margin-top: 18px;
  background:
    linear-gradient(var(--highvis), var(--highvis)) left center / 100% 2px no-repeat,
    linear-gradient(var(--highvis), var(--highvis)) left center / 2px 9px no-repeat,
    linear-gradient(var(--highvis), var(--highvis)) right center / 2px 9px no-repeat;
}
.section-head p { color: var(--body); font-size: 1.08rem; }
section.dark .section-head p { color: rgba(248,249,250,.78); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--steel); }
.card p { color: var(--body); font-size: .98rem; }
.card .icon {
  width: 48px; height: 48px; background: var(--blueprint);
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.card .icon svg { width: 24px; height: 24px; fill: var(--blue); }
.card .more { margin-top: auto; padding-top: 18px; font-weight: 600; font-size: .93rem; text-decoration: none; color: var(--blue); }
.card .more:hover { color: var(--bedrock); }
.card h3 a:hover { color: var(--blue) !important; }

/* ---------- Stat blocks ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 36px; }
.stat { border-top: 2px solid rgba(248,249,250,.2); padding-top: 22px; }
.stat .num { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.6rem, 5vw, 3.5rem); letter-spacing: -0.02em; color: var(--highvis); line-height: 1; margin-bottom: 12px; }
.stat .lbl { color: rgba(248,249,250,.8); font-size: .98rem; }

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; counter-reset: step; }
.step { background: #fff; border: 1px solid var(--line); padding: 26px 22px; position: relative; }
.step .n { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--highvis); margin-bottom: 14px; letter-spacing: .04em; }
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--body); font-size: .94rem; }
@media (max-width: 980px) { .process { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .process { grid-template-columns: 1fr; } }

/* ---------- Two-column + panels ---------- */
.twocol { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.panel {
  position: relative; overflow: hidden; background: var(--bedrock);
  aspect-ratio: 4 / 3; min-height: 260px; border-radius: var(--radius);
}
.panel.blue { background: var(--blue); }
.panel .unit-sq { width: 30%; height: auto; aspect-ratio: 1; right: 0; bottom: 0; }
@media (max-width: 880px) {
  .twocol { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Quote band ---------- */
.quoteband { background: var(--blue); color: var(--sitecast); padding: 64px var(--gutter); text-align: center; }
.quoteband blockquote {
  font-family: var(--font-head); font-weight: 500; font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  letter-spacing: -0.01em; line-height: 1.35; max-width: 860px; margin: 0 auto;
}
.quoteband p { margin: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--bedrock); color: var(--sitecast); text-align: center; padding: 88px 0; }
.cta-band h2 { color: var(--sitecast); margin-bottom: 14px; }
.cta-band p { color: rgba(248,249,250,.8); max-width: 600px; margin: 0 auto 30px; font-size: 1.08rem; }

/* ---------- Services ---------- */
.svc { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; padding: 64px 0; border-bottom: 1px solid var(--line); }
.svc:last-child { border-bottom: 0; }
.svc h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 16px; }
.svc p { color: var(--body); margin-bottom: 20px; }
@media (max-width: 880px) {
  .svc { grid-template-columns: 1fr; gap: 32px; padding: 48px 0; }
  .svc > .panel:first-child { order: 2; }   /* text first on mobile */
  .svc .panel { aspect-ratio: 16 / 9; min-height: 0; }
}

/* ---------- Team ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.member { background: #fff; border: 1px solid var(--line); padding: 34px 30px; }
.member .avatar {
  width: 72px; height: 72px; background: var(--bedrock); color: var(--sitecast);
  font-family: var(--font-head); font-weight: 700; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center; margin-bottom: 22px;
  position: relative;
}
.member .avatar::after { content: ""; position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; background: var(--highvis); }
.member h3 { font-size: 1.35rem; margin-bottom: 4px; }
.member .role { font-weight: 600; font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; color: var(--blue); margin-bottom: 16px; }
.member p:not(.role) { color: var(--body); font-size: .98rem; }

/* ---------- FAQ ---------- */
details { background: #fff; border: 1px solid var(--line); margin-bottom: 10px; max-width: 900px; }
summary {
  cursor: pointer; list-style: none; padding: 20px 56px 20px 24px; position: relative;
  font-family: var(--font-head); font-weight: 500; font-size: 1.08rem; color: var(--bedrock);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-head); font-size: 1.5rem; color: var(--highvis); line-height: 1;
}
details[open] summary::after { content: "\2212"; }
details p { padding: 0 24px 22px; color: var(--body); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }

form.contact { margin-top: 26px; }
form.contact label { display: block; font-weight: 600; font-size: .85rem; color: var(--bedrock); margin: 18px 0 7px; }
form.contact input, form.contact select, form.contact textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ironwork);
  background: #fff; border: 1px solid #B9C8D8; border-radius: var(--radius);
  padding: 13px 14px; transition: border-color .15s, box-shadow .15s;
}
form.contact input:focus, form.contact select:focus, form.contact textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,90,136,.18);
}
form.contact textarea { resize: vertical; min-height: 130px; }
form.contact .consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: .88rem; color: var(--body); }
form.contact .consent input { width: auto; margin-top: 4px; }
form.contact .hp { position: absolute; left: -9999px; }

.info-card { background: var(--sitecast); border: 1px solid var(--line); padding: 30px 28px; }
.info-card h3 { margin-bottom: 16px; }
.info-card p { margin-bottom: 16px; color: var(--body); font-size: .98rem; }
.info-card p:last-child { margin-bottom: 0; }
.info-card p strong { color: var(--bedrock); }
.info-card a { display: block; text-decoration: none; font-weight: 600; }
.info-card ul.unit li { margin-bottom: 10px; }

/* ---------- Footer ---------- */
footer { background: var(--ironwork); color: rgba(248,249,250,.7); padding: 72px 0 32px; font-size: .94rem; }
footer .cols { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 36px; }
footer .cols > div:first-child { grid-column: span 1; }
footer h4 { font-family: var(--font-body); font-weight: 600; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--sitecast); margin-bottom: 16px; }
footer .cols a:not(.logo) { display: block; color: rgba(248,249,250,.7); text-decoration: none; margin-bottom: 9px; }
footer .cols a:not(.logo):hover { color: var(--highvis); }
footer .logo { display: inline-flex; }
footer .legal {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(248,249,250,.12);
  font-size: .84rem; color: rgba(248,249,250,.5);
}
footer .legal a { color: rgba(248,249,250,.6); }
@media (max-width: 980px) {
  footer .cols { grid-template-columns: repeat(2, 1fr); }
  footer .cols > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  footer .cols { grid-template-columns: 1fr; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  section { padding: 64px 0; }
  .hero .container { padding-top: 76px; padding-bottom: 96px; }
  .page-hero .container { padding-top: 60px; padding-bottom: 60px; }
  .unit-sq { width: 56px; height: 56px; }
  .section-head { margin-bottom: 36px; }
  .quoteband { padding: 48px var(--gutter); }
  .cta-band { padding: 64px 0; }
  .btn { padding: 15px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Long-form text (privacy policy) ---------- */
.prose h2 { font-size: 1.4rem; margin: 40px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--body); margin-bottom: 14px; }
.prose ul.unit { color: var(--body); margin: 8px 0 18px; }

/* ---------- Figure panels (blueprint drawings, photo-ready) ----------
   Each panel shows a brand line drawing until a photo is added.
   To add a photo: put <img src="images/x.jpg" alt="..."> as the panel's first child. */
.fig-panel { margin: 0; }
.fig-panel .fig { position: absolute; inset: 6% 6% 16%; width: 88%; height: 78%; z-index: 1; overflow: visible; }
.fig .ln   { fill: none; stroke: rgba(248,249,250,.72); stroke-width: 2; stroke-linecap: square; }
.fig .lt   { fill: none; stroke: rgba(248,249,250,.32); stroke-width: 1.25; }
.fig .dim  { fill: none; stroke: var(--highvis); stroke-width: 1.5; }
.fig .acc  { fill: var(--highvis); }
.fig .zone { fill: rgba(232,163,61,.14); stroke: var(--highvis); stroke-width: 1.5; stroke-dasharray: 6 4; }
.fig text  { font-family: var(--font-body); font-weight: 600; font-size: 10px; letter-spacing: .16em; fill: rgba(248,249,250,.62); }
.fig text.a { fill: var(--highvis); }
.panel.blue .fig .lt { stroke: rgba(248,249,250,.38); }

.fig-panel .cap {
  position: absolute; left: 22px; right: 22px; bottom: 18px; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-body); font-weight: 600; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(248,249,250,.78);
  padding-top: 12px; border-top: 1px solid rgba(248,249,250,.16);
}
.fig-panel .cap span { color: var(--highvis); white-space: nowrap; }

/* A real photo, once added, covers the drawing and caption */
.panel > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 3; }
.panel > img ~ .fig, .panel > img ~ .cap, .panel > img ~ .grid-bg { display: none; }

@media (max-width: 880px) {
  .svc .fig-panel { aspect-ratio: 4 / 3; }
}
@media (max-width: 520px) {
  .fig-panel .cap { font-size: .62rem; letter-spacing: .14em; left: 16px; right: 16px; bottom: 14px; }
}

/* Team photos: same square + High-Vis unit corner as the initials avatar */
.member .avatar { width: 112px; height: 140px; font-size: 1.8rem; }
.member .avatar.photo { background: var(--blueprint); overflow: hidden; }
.member .avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member .avatar::after { z-index: 1; }

/* ---------- Project gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.gallery .shot { position: relative; display: block; overflow: hidden; background: var(--bedrock); aspect-ratio: 3 / 2; text-decoration: none; }
.gallery .shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.gallery .shot:hover img { transform: scale(1.03); }
.gallery .shot::after { content: ""; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; background: var(--highvis); }
.gallery .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 18px 14px;
  background: linear-gradient(transparent, rgba(22,48,74,.85));
  color: var(--sitecast); font-weight: 600; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
}
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(15,24,34,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox .lb-cap { color: rgba(248,249,250,.8); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; margin-top: 16px; }
.lightbox .lb-close { position: absolute; top: 14px; right: 20px; background: none; border: 0; color: #F8F9FA; font-size: 2.4rem; cursor: pointer; line-height: 1; }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }

/* ---------- Four-photo panel ---------- */
.panel.photo-quad { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; background: #fff; text-decoration: none; }
.panel.photo-quad img { position: static; width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.panel.photo-quad:hover img { opacity: .9; }
.panel.photo-quad::after { content: ""; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; background: var(--highvis); }
.panel.photo-quad img { min-height: 0; min-width: 0; }
@media (max-width: 880px) { .svc .panel.photo-quad { aspect-ratio: 4 / 3; } }

/* ---------- Contact us details ---------- */
.info-card.contact-us a.big { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--blue); }
.info-card.contact-us a.big:hover { color: var(--bedrock); }
.cta-band .cta-contact { margin: 26px auto 0; font-size: 1.02rem; color: rgba(248,249,250,.85); }
.cta-band .cta-contact span { font-weight: 600; font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: var(--highvis); margin-right: 10px; }
.cta-band .cta-contact a { color: var(--sitecast); text-decoration: none; font-weight: 600; }
.cta-band .cta-contact a:hover { color: var(--highvis); }
