/* Structure: the measure, section rhythm, full-bleed bands and modular grids.
   Load after base.css. */

.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Section rhythm from the approved design: 110px of top padding, sections
   butted together so the dividing rules do the separating. */
.section { padding-block: var(--space-14) 0; }
.section--tight { padding-block: var(--space-12) 0; }
.section--last { padding-block: var(--space-14); }
.section--flush { padding-block: 0; }

/* ── Full-bleed colour bands ─────────────────────────────────────────────
   .band--ink is a context class: components recolour themselves inside it
   rather than needing dark-mode variants of their own. */
.band { background: var(--concrete); }

.band--ink {
  background: var(--ink);
  color: var(--paper);
}

.band--ink h1,
.band--ink h2,
.band--ink h3,
.band--ink h4 { color: var(--paper); }

.band--ink .eyebrow { color: var(--label-on-ink); }
.band--ink .text-muted { color: var(--muted-on-ink); }
/* :not(.btn) matters — this selector out-specifies .btn--primary, so without
   it every button inside a dark band loses its own label colour. */
.band--ink a:not(.btn):not(.contact-row) { color: var(--ocean-300); }
.band--ink hr { background: var(--rule-on-ink); }

/* ── Section headers ─────────────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-9);
  flex-wrap: wrap;
  border-bottom: 2px solid var(--ink);
  padding-bottom: var(--space-6);
}

.band--ink .section-head { border-bottom-color: var(--rule-on-ink); }

.section-head__title { margin-top: var(--space-4); }

.section-head__lede {
  max-width: 40ch;
  font-size: var(--size-body);
  line-height: 1.55;
  color: var(--muted);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--size-eyebrow);
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
}

.text-muted { color: var(--muted); }

.text-lede {
  font-size: var(--size-body-l);
  line-height: 1.55;
}

.measure-prose { max-width: 62ch; }

/* ── Modular grids ───────────────────────────────────────────────────────
   Cells are divided by hairlines rather than gaps: the 1px background shows
   through the gap between children, which is how the approved design draws
   its structure. */
.grid {
  display: grid;
  gap: var(--hairline);
  background: var(--rule);
  border: var(--hairline) solid var(--rule);
}

.grid > * { background: var(--concrete); }

.band--ink .grid {
  background: var(--rule-on-ink);
  border-color: var(--rule-on-ink);
}

.band--ink .grid > * { background: var(--ink); }

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Gapped grid, for figures that should not share an edge. */
.grid-loose {
  display: grid;
  gap: var(--space-5);
}

.grid-loose-4 { grid-template-columns: repeat(4, 1fr); }
.grid-loose-3 { grid-template-columns: repeat(3, 1fr); }

/* Split layouts — image beside copy. */
.split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: stretch;
}

/* Grid items default to min-width:auto, which lets a wide child push a column
   past its track. Zero it so the track sizing actually holds. */
.split > * { min-width: 0; }

.split--wide-left { grid-template-columns: 1.55fr 1fr; }
.split--wide-right { grid-template-columns: 0.85fr 1.15fr; }

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1360px) {
  :root { --gutter: 28px; }
}

@media (max-width: 1100px) {
  .grid-loose-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .grid-4,
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .section { padding-block: var(--space-12) 0; }
  .section--last { padding-block: var(--space-12); }

  .split,
  .split--wide-left,
  .split--wide-right { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --gutter: 20px; }

  .grid-loose-4,
  .grid-loose-3 { grid-template-columns: repeat(2, 1fr); }

  .section-head {
    border-bottom-width: var(--hairline);
    gap: var(--space-5);
  }

  .section { padding-block: var(--space-11) 0; }
  .section--last { padding-block: var(--space-11); }
}

@media (max-width: 560px) {
  .grid-4,
  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }

  .grid-loose-4,
  .grid-loose-3 { grid-template-columns: 1fr; }
}
