/* ─────────────────────────────────────────────────────────────────────────
   page.css — chrome shared by every page: the call to action, the footer,
   generic page sections, and the "Start a project" brief form.

   The CTA is `Start a project` sitewide (3 Aug 2026). It is the one solid
   green surface on the site; everything else that is green is current.
   ───────────────────────────────────────────────────────────────────────── */

/* ── the call to action ────────────────────────────────────────────────── */

.cta {
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--leaf);
  border: 0;
  padding: 0 var(--s4);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.cta:hover { background: #17A857; }
.cta:active { transform: translateY(1px); }
.cta[disabled] { opacity: 0.55; cursor: default; }

.ghost-link {
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--graphite);
  padding-bottom: 3px;
  align-self: center;
}

.ghost-link:hover { border-bottom-color: var(--leaf-ink); color: var(--leaf-ink); }

.nav-link.is-here { border-bottom-color: var(--ink); }

/* ── generic page shell (the generated pages) ──────────────────────────── */

.page-main {
  position: relative;
  z-index: var(--z-content);
  padding: 0 var(--s5) var(--s7);
  max-width: 1560px;
  margin: 0 auto;
}

.page-head {
  padding-top: clamp(96px, 15vh, 168px);
  padding-bottom: var(--s6);
  border-bottom: var(--hairline);
}

.page-head .display {
  font-size: clamp(34px, 4.6vw, 76px);
  max-width: 16ch;
  margin: var(--s3) 0 var(--s4);
}

.page-lede { font-size: clamp(16px, 1.3vw, 20px); max-width: 54ch; color: var(--ink-60); }

.page-section { padding: var(--s6) 0; border-bottom: var(--hairline); }

.page-section > h2 {
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--ink-60);
  font-weight: 400;
  margin-bottom: var(--s4);
}

/* The services index row. Fixed rem columns overflowed a 360px phone, so
   the bay and name collapse onto one line below the breakpoint. */
.svc-row {
  display: grid;
  grid-template-columns: 3rem 12rem minmax(0, 1fr);
  gap: var(--s3);
  align-items: baseline;
}

.svc-row .svc-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--display-tracking);
}

.svc-row .svc-line { color: var(--ink-60); }

@media (max-width: 720px) {
  .svc-row {
    grid-template-columns: 2.6rem minmax(0, 1fr);
    grid-template-areas: 'bay name' '. line';
    gap: 2px var(--s3);
  }
  .svc-row .svc-bay { grid-area: bay; }
  .svc-row .svc-name { grid-area: name; }
  .svc-row .svc-line { grid-area: line; }
}

/* Hairline lists — the site's only list idiom. */
.rule-list { list-style: none; }

.rule-list li {
  border-top: var(--hairline);
  padding: var(--s3) 0;
  font-size: clamp(15px, 1.15vw, 17px);
  max-width: 62ch;
}

.rule-list li:last-child { border-bottom: var(--hairline); }

.note {
  border-left: 2px solid var(--leaf);
  padding: var(--s2) 0 var(--s2) var(--s3);
  margin: var(--s4) 0;
  max-width: 62ch;
  color: var(--ink-60);
}

.note strong { color: var(--ink); }

/* ── the footer ────────────────────────────────────────────────────────── */

/* A dark, quiet band (owner's reference, 19 Aug 2026): three plain columns
   — SERVICES, COMPANY, GET IN TOUCH — over a hairline bottom bar carrying
   the legal line and the tagline. No brand block, no numbers, no buttons.
   The markup lives twice: in site.js#footer() for the JS-built pages and
   baked into the 48 static shells; both carry these exact classes. */

.site-footer {
  margin-top: var(--s7);
  padding: var(--s5) var(--s5) var(--s3);
  background: var(--ink);
}

.foot-top,
.foot-bottom { max-width: 1560px; margin-inline: auto; }

.foot-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: var(--s4) clamp(var(--s5), 8vw, 160px);
  align-items: start;
  padding-bottom: var(--s4);
}

.foot-head {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--s2);
}

.foot-col ul { list-style: none; }

.foot-col li a {
  display: inline-flex;
  align-items: center;
  padding: 3px 0;
  font-size: 14px;
  color: #FFFFFF;
  transition: color 140ms var(--ease-out);
}

.foot-col li a:hover { color: var(--leaf); }

.foot-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: var(--s3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
  flex-wrap: wrap;
}

.foot-legal,
.foot-tag {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* ── Start a project ───────────────────────────────────────────────────── */

.start { max-width: 900px; }

.start-head { padding-top: clamp(96px, 15vh, 168px); padding-bottom: var(--s5); }

.start-head .display {
  font-size: clamp(34px, 4.6vw, 76px);
  max-width: 15ch;
  margin: var(--s3) 0 var(--s4);
}

.start-sub { font-size: clamp(16px, 1.3vw, 20px); color: var(--ink-60); max-width: 50ch; }

.field-group {
  border: 0;
  padding: var(--s5) 0;
  position: relative;
  /* A <fieldset> defaults to min-width: min-content and refuses to shrink
     below its widest child, which blows the page out sideways on a phone
     however narrow the grid inside it is told to be. */
  min-width: 0;
}

/* The rule is a pseudo-element, not the fieldset's own border: a <legend>
   notches a real border out around itself. Floating the legend hid that,
   but a float is not something a grid can sit beside — .field-rows
   collapsed to zero width and threw its inputs off the side of the phone. */
.field-group::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  border-top: var(--hairline);
}

.field-legend {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: var(--display-tracking);
  padding: 0;
}

.field-hint { color: var(--ink-60); font-size: 14px; margin-top: var(--s2); max-width: 54ch; }

/* Service chips — hairline, monospace, no badges (02 §7). */
.chip-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--s2);
  margin-top: var(--s4);
}

.chip-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chip {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 2px var(--s2);
  padding: var(--s3);
  border: 1px solid var(--graphite);
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out);
}

.chip:hover { border-color: var(--ink-60); }

.chip-bay { color: var(--ink-60); grid-row: span 2; }
.chip-name { font-family: var(--font-display); font-weight: 800; letter-spacing: var(--display-tracking); }
.chip-line { font-size: 13px; color: var(--ink-60); }

.chip-input:checked + .chip {
  border-color: var(--leaf);
  background: var(--leaf-08);
  box-shadow: inset 0 0 0 1px var(--leaf);
}

.chip-input:checked + .chip .chip-bay { color: var(--leaf-ink); }

.chip-input:focus-visible + .chip { outline: 1px solid var(--ink); outline-offset: 3px; }

/* Inputs */
.field-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); margin-top: var(--s4); }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.field-opt { color: var(--ink-60); text-transform: none; letter-spacing: 0.02em; }

.input {
  font: inherit;
  font-size: 16px;                 /* 16px: anything smaller zooms on iOS */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--graphite);
  border-radius: 8px;
  padding: 12px var(--s3);
  min-height: 48px;
  width: 100%;
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

textarea.input { resize: vertical; min-height: 140px; line-height: 1.5; margin-top: var(--s4); }

.input:hover { border-color: var(--ink-60); }

.input:focus {
  outline: none;
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px var(--leaf-14);
}

.input.is-invalid { border-color: #C2321F; }
.input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(194, 50, 31, 0.14); }

.field-error {
  color: #C2321F;
  font-size: 13px;
  min-height: 1.2em;
  display: block;
}

.field-error:empty { min-height: 0; }

.start-actions {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  padding-top: var(--s5);
  border-top: var(--hairline);
}

.start-note { color: var(--ink-60); }

.start-done { padding: var(--s6) 0 var(--s5); }
.start-done:focus { outline: none; }

.start-done-head {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 40px);
  letter-spacing: var(--display-tracking);
  margin: var(--s3) 0;
  max-width: 20ch;
}

.start-done-sub { color: var(--ink-60); max-width: 50ch; margin-bottom: var(--s4); }

.brief-text {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: #FAFBFA;
  border: 1px solid var(--graphite);
  border-radius: 10px;
  padding: var(--s4);
  margin-bottom: var(--s4);
  overflow-x: auto;
}

/* ── breakpoints ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  /* Services and company share the first row; contact takes its own. */
  .foot-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .page-main { padding: 0 var(--s3) var(--s6); }
  .chip-list { grid-template-columns: 1fr; }
  .start-actions .cta { width: 100%; }

  /* The same dark footer, compact: groups stack, the nine services split
     into two columns, and rows stay finger-sized without growing tall. */
  .site-footer {
    margin-top: var(--s6);
    padding: var(--s4) var(--s3) var(--s3);
  }

  .foot-top { grid-template-columns: 1fr; gap: var(--s3); padding-bottom: var(--s3); }

  /* Both link groups run two columns on a phone, so the whole footer stays
     well under one screen tall while rows keep a tappable height. */
  .foot-col ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--s3);
  }

  .foot-col li a {
    display: flex;
    min-height: 38px;
    padding: 0;
  }

  .foot-bottom { flex-direction: column; align-items: flex-start; gap: var(--s1); }
}

/* ── the workflow on a service page: step-through, never autoplay ──────── */

.page-flow-wrap { margin-top: var(--s3); }

.page-flow-controls {
  display: flex;
  align-items: center;
  gap: var(--s3);
  border-top: var(--hairline);
  padding-top: var(--s3);
  margin-top: var(--s3);
  flex-wrap: wrap;
}

.page-flow-step { color: var(--ink-60); flex: 1 1 auto; letter-spacing: 0.06em; }
.page-flow-step .n { color: var(--leaf-ink); }
.page-flow-step .s { color: var(--ink); text-transform: uppercase; margin-left: var(--s2); }

.page-flow-play { background: none; border: 0; cursor: pointer; font: inherit; }
