/* Modern Tile Company, option C "The prequal sheet"
   Look: Takeoff pad. Quadrille ground, graphite ink, tile-green accent, mono figures.
   Tokens live here; components reference variables only. */

:root {
  --sheet: #ECEFEB;      /* pale mineral grey-green paper */
  --sheet-2: #E1E6E1;    /* field tint, row tint */
  --paper: #FFFFFF;      /* cards and rows that must read as a form */
  --rule: #B4BFB7;       /* light rule */
  --ink: #1B2420;        /* graphite ink, text and heavy rules */
  --ink-2: #4E5A54;      /* muted text, 6.2:1 on --sheet */
  --tile: #1F6F4A;       /* tile green accent, 5.3:1 on --sheet, white on it 6.1:1 */
  --tile-deep: #175539;  /* hover and active */
  --grid: rgba(27, 36, 32, 0.075);

  --font-display: "Big Shoulders Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Trebuchet MS", "Verdana", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", "Menlo", monospace;

  --radius: 3px;
  --bar-h: 56px;
  --pad: 20px;
  --max: 1200px;
}

/* Reset, minimal */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  padding-bottom: 84px; /* room for the fixed mobile action bar */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tile); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--tile-deep); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 0.98; margin: 0; letter-spacing: 0.005em; }
p { margin: 0; }
ul, ol, dl { margin: 0; padding: 0; }
li { list-style: none; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn:focus-visible, .chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.foot :focus-visible { outline-color: var(--sheet); } /* light ring on the ink footer, 13.7:1 */

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  padding: 10px 14px; background: var(--ink); color: var(--paper); border-radius: var(--radius);
}
.skip:focus { top: 8px; }

/* Wordmark and the twin-squares mark */
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: 0.04em; line-height: 1; }
.wordmark-sub { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-2); letter-spacing: 0.02em; }
.mark { display: inline-flex; align-items: baseline; gap: 8px; padding: 12px 4px; margin-left: -4px; color: var(--ink); text-decoration: none; } /* 21.6px wordmark + 24px padding: 45.6px target */
.mark-icon { width: 18px; height: 18px; align-self: center; flex: none; }
.sq-grey { fill: var(--ink-2); }
.sq-green { fill: var(--tile); }

/* Sticky top bar */
.bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  min-height: var(--bar-h);
  padding: 0 var(--pad);
  background: var(--sheet);
  border-bottom: 2px solid var(--ink);
}
.bar-nav { display: none; }
.bar-actions { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 16px;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1.2;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: var(--radius);
  text-decoration: none; text-align: center;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--sheet-2); color: var(--ink); }
.btn-primary { background: var(--tile); border-color: var(--tile); color: var(--paper); }
.btn-primary:hover { background: var(--tile-deep); border-color: var(--tile-deep); color: var(--paper); }
.btn-quiet { background: transparent; border-color: var(--rule); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink); }

/* Text roles */
.label { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-2); letter-spacing: 0.02em; }
.muted { color: var(--ink-2); }
.fine { font-size: 0.82rem; color: var(--ink-2); line-height: 1.4; }
.code { font-family: var(--font-mono); font-size: 0.92em; white-space: nowrap; }
.figure { font-family: var(--font-mono); font-weight: 500; }
.todo {
  font-family: var(--font-mono); font-size: 0.85em;
  color: var(--ink); background: #FFF3B0; /* single-use marker tint so pending items are impossible to miss in review */
  padding: 0 4px; border-radius: 2px;
}
.sep { color: var(--rule); padding: 0 6px; }

/* Hero, the sheet header */
.hero { padding-top: 28px; padding-bottom: 8px; display: grid; gap: 24px; }
.eyebrow { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 0; margin-bottom: 14px; }
.eyebrow span + span::before { content: "\00b7"; padding: 0 8px; color: var(--rule); }
h1 { font-size: clamp(2.35rem, 8.2vw, 3.8rem); max-width: 18ch; }
.lede { margin-top: 16px; font-size: 1.05rem; max-width: 52ch; }

/* Project history in figures: the totals line of the takeoff pad */
.tally {
  margin-top: 22px; max-width: 52ch;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.tally div { padding: 10px 0; }
.tally dt { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); }
.tally dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.tally-link { margin-top: 8px; font-size: 0.95rem; max-width: 52ch; }

.contact-card {
  margin-top: 22px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px 14px;
  align-items: start;
}
.contact-photo { width: 72px; height: 72px; border-radius: var(--radius); object-fit: cover; }
.contact-name { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1; margin-top: 2px; }
.contact-title { color: var(--ink-2); margin-bottom: 4px; }
.contact-line { font-size: 0.95rem; }
.contact-ctas { grid-column: 1 / -1; display: grid; gap: 8px; border-top: 1px solid var(--rule); padding-top: 12px; }
.contact-ctas .fine { margin-top: -2px; }

/* Hero photographs: one 700 px frame and a two-by-two strip of four more, all company project photographs.
   Widths are capped at each file's native width (700, 620, 399) so nothing is enlarged at any viewport. */
.hero-photos { display: grid; gap: 14px; align-content: start; }
.hero-art { margin: 0; }
.hero-art img { width: 100%; max-width: 700px; height: auto; border: 2px solid var(--ink); border-radius: var(--radius); }
.hero-art figcaption, .trophy-cap { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }
.trophies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; max-width: 700px; }
.trophies img { width: 100%; max-width: 399px; height: auto; border: 1px solid var(--ink); border-radius: var(--radius); }
.trophy-cap { display: block; margin-top: 4px; }
.hero-photos .fine { margin: 0; }

/* Sections */
.section { padding-top: 40px; padding-bottom: 12px; }
.section-head {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: baseline;
  border-top: 3px solid var(--ink); padding-top: 12px; margin-bottom: 18px;
}
.section-code {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem;
  color: var(--paper); background: var(--ink);
  padding: 2px 7px; border-radius: 2px; align-self: center;
}
h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.section-note { grid-column: 1 / -1; color: var(--ink-2); max-width: 70ch; }

/* A. Prequal sheet */
.sheet { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--rule); }
.sheet-row {
  display: grid; grid-template-columns: 1fr; gap: 2px;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.sheet-row dt { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); }
.sheet-row dd { margin: 0; }

/* B. Scope rows */
.scope { border-top: 1px solid var(--rule); }
.scope-row { display: grid; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.scope-row h3 { font-size: 1.5rem; font-weight: 700; }
.scope-sub { color: var(--ink-2); font-size: 0.92rem; margin-top: 4px; }
.terms { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.terms li {
  font-size: 0.92rem; line-height: 1.3;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px;
  padding: 5px 8px 5px 22px; position: relative;
}
.terms li::before {
  content: ""; position: absolute; left: 8px; top: 10px;
  width: 8px; height: 8px; background: var(--tile);
  box-shadow: -3px 3px 0 0 var(--ink-2);
}

/* B. Project history */
.history { border-top: 1px solid var(--rule); margin-bottom: 22px; }
.history div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.history dt { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); }
.history dd { margin: 0; }

.controls { display: grid; gap: 10px; margin-bottom: 14px; }
.control-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.control-label { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); margin-right: 4px; }
.chip {
  min-height: 44px; padding: 6px 12px;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink); border-radius: var(--radius);
  cursor: pointer;
}
.chip:hover { background: var(--sheet-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.control-status { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); }

.projects-head { display: none; }
.projects { border-top: 2px solid var(--ink); }
.projects li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  grid-template-areas: "thumb name val" "thumb loc loc" "thumb sector sector";
  gap: 2px 12px;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.projects li[hidden] { display: none; }
/* Row thumbnail: the 160 by 107 grid crop shown at 48 by 32, a downscale. Rows without a photo keep the empty cell. */
.p-thumb { grid-area: thumb; width: 48px; height: 32px; align-self: start; }
.p-thumb img { width: 48px; height: 32px; object-fit: cover; border: 1px solid var(--rule); }
.p-name { grid-area: name; font-weight: 700; }
.p-val { grid-area: val; font-family: var(--font-mono); font-weight: 500; text-align: right; white-space: nowrap; }
.p-np { color: var(--ink-2); font-weight: 400; font-size: 0.85rem; }
.p-loc { grid-area: loc; font-size: 0.9rem; color: var(--ink-2); }
.p-sector { grid-area: sector; font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); }

.press { margin-top: 16px; font-size: 0.95rem; }

/* Project photo grid: 45 cells in list order, one per named project. Each image file is a 160 by 107 crop and
   is displayed at 160 px or narrower (three per row below 700 px), never wider. Placeholders hold the 17 gaps. */
.pgrid-block { margin-top: 24px; }
.pgrid { margin-top: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
.pgrid li[hidden] { display: none; }
.pgrid img, .pgrid-box { display: block; width: 100%; max-width: 160px; height: auto; border: 1px solid var(--rule); }
.pgrid-box {
  aspect-ratio: 160 / 107; border-style: dashed; background: var(--sheet-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2);
}
.pgrid-cap { display: block; max-width: 160px; font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.25; color: var(--ink-2); padding-top: 4px; }
.pgrid-block .fine { margin-top: 10px; }

/* D. References */
.refs { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.ref { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 8px; }
.ref blockquote { margin: 0; }
.ref blockquote p { font-size: 1.02rem; }
.ref figcaption { display: grid; gap: 1px; }
.ref-name { font-weight: 700; }
.ref-firm { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); }

/* E. Counties */
.counties { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.counties li {
  background: var(--paper); border: 1px solid var(--ink); border-radius: var(--radius);
  padding: 10px 12px; font-weight: 700; font-size: 0.95rem;
}

/* F. Contact */
.contact { padding-bottom: 40px; }
.contact-grid { display: grid; gap: 16px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px; }
.contact-photo-lg { width: 140px; height: 140px; object-fit: cover; border-radius: var(--radius); }
.contact-list { display: grid; gap: 6px; margin: 12px 0 16px; }
.contact-list div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; }
.contact-list dt { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); padding-top: 3px; }
.contact-list dd { margin: 0; }

/* Footer */
.foot { background: var(--ink); color: var(--sheet); padding: 28px 0; }
.foot a { color: var(--sheet); }
.foot .wordmark-sub { color: var(--rule); }
.foot-inner { display: grid; gap: 10px; font-size: 0.92rem; }

/* Fixed mobile action bar */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom));
  background: var(--sheet); border-top: 2px solid var(--ink);
}
.mobile-bar .btn { padding-left: 8px; padding-right: 8px; font-size: 0.95rem; }

/* The one motion moment: the prequal rows settle in as the sheet enters the viewport. Transform and opacity only.
   Rows are visible by default. script.js adds .stagger only when the reduced-motion query does not match, then
   .ready releases the rows; without the script nothing here applies. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .stagger .sheet-row { opacity: 0; transform: translateY(6px); }
  .stagger.ready .sheet-row {
    opacity: 1; transform: none;
    transition: opacity 360ms ease-out, transform 360ms ease-out;
    transition-delay: calc(var(--i, 0) * 45ms);
  }
}

/* Tablet and up */
@media (min-width: 700px) {
  :root { --pad: 32px; }
  .sheet { grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .sheet-row { grid-template-columns: 150px 1fr; gap: 12px; }
  .history div { grid-template-columns: 150px 1fr; gap: 12px; }
  .tally { grid-template-columns: repeat(4, auto); justify-content: start; gap: 0 32px; max-width: none; }
  .scope-row { grid-template-columns: minmax(200px, 1fr) 2.4fr; gap: 24px; }
  .counties { grid-template-columns: repeat(4, 1fr); }
  .contact-grid { grid-template-columns: 140px 1fr; }
  .contact-ctas { grid-template-columns: auto auto 1fr; align-items: center; }
  .contact-ctas .fine { grid-column: 1 / -1; }

  .projects-head, .projects li {
    display: grid;
    grid-template-columns: 48px 170px minmax(0, 2.2fr) minmax(0, 1fr) 150px;
    grid-template-areas: "thumb sector name loc val";
    gap: 16px; align-items: baseline;
  }
  .pgrid { grid-template-columns: repeat(auto-fill, 160px); gap: 14px 12px; }
  .projects-head {
    font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-2);
    padding: 6px 0;
  }
  .projects-head .num { text-align: right; }
  .projects li[hidden] { display: none; }
  .chip { min-height: 36px; }
}

/* Desktop */
@media (min-width: 900px) {
  body { padding-bottom: 0; font-size: 1.04rem; }
  .mobile-bar { display: none; }
  .bar { gap: 28px; }
  .bar-nav { display: flex; gap: 18px; margin-left: 8px; }
  .bar-nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
  .bar-nav a:hover { border-bottom-color: var(--tile); }
  .bar-actions { display: flex; gap: 8px; margin-left: auto; }
  .bar-actions .btn { min-height: 38px; padding: 6px 14px; font-size: 0.95rem; }

  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 40px; align-items: start; padding-top: 44px; }
  .hero-photos { position: sticky; top: calc(var(--bar-h) + 24px); }
  .contact-card { grid-template-columns: 88px 1fr; }
  .contact-photo { width: 88px; height: 88px; }

  .section { padding-top: 56px; }
  .section-head { grid-template-columns: auto auto 1fr; }
  .section-note { grid-column: 3; justify-self: end; text-align: right; max-width: 48ch; }
  .contact-grid { grid-template-columns: 200px 1fr; padding: 24px; }
  .contact-photo-lg { width: 200px; height: 200px; }
}

@media (min-width: 1200px) {
  :root { --pad: 40px; }
}

/* Print: the page is a prequal sheet, so it prints as one */
@media print {
  body { background: #fff; padding: 0; }
  .bar, .mobile-bar, .controls, .hero-photos { display: none; }
  .todo { background: none; border: 1px solid #000; }
  a { color: #000; text-decoration: none; }
}
