/* Stonecreek — public site stylesheet.
   Loaded only by apps/web. Depends on tokens.css, which owns the palette.
   This file owns the section grammar:

     eyebrow → headline → lede → statement → substance → process (01/02/03) → call to action

   Nothing here introduces a colour. If a layout seems to need a colour that is not a
   token, the problem is proportion, not palette — change the proportion.
   Rules this file enforces mechanically: Cedar and Granite never carry a word; large
   surfaces are square; there are no shadows; focus is always visible. Rules it cannot
   enforce (one dark band per screen, one Cedar element per section, the 9% Spruce
   budget) belong to whoever composes the page. See docs/brand-build-standard.md. */

:root {
  /* Display scale — larger than the portal scale in tokens.css, which is app chrome. */
  --fs-display: clamp(38px, 5.4vw, 64px);
  --fs-section: clamp(26px, 3vw, 36px);
  --fs-lead: clamp(17px, 1.6vw, 19px);
  --fs-quote: clamp(20px, 2.4vw, 28px);
  --fs-numeral: clamp(34px, 4vw, 52px);
  --shell: 1180px;
  --measure-lede: 62ch;
  --step: clamp(56px, 8vw, 104px);
}

/* ---------- Reset and ground ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color: var(--body); }

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font: 400 var(--fs-body)/var(--lh-body) var(--sc-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

:where(a) { color: var(--primary); text-underline-offset: .18em; text-decoration-thickness: 1px; }
:where(a):hover { color: var(--primary-hv); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

::selection { background: var(--sc-silt); color: var(--ink); }

/* ---------- Skip link ---------- */

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--primary); color: var(--on-primary);
  padding: 12px 18px; font: 600 var(--fs-button)/1 var(--sc-sans);
  letter-spacing: var(--ls-button); text-transform: uppercase; text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- Shell ---------- */

.wrap { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--pad); }
.wrap--narrow { max-width: 820px; }

/* A section is a horizontal band. Bands alternate ground and field; they are never
   separated by shadows or rounded cards. */
.band { padding-block: var(--step); }
.band + .band { border-top: 1px solid var(--sc-hair); }
.band--field { background: var(--band); border-top-color: transparent; }
.band--ink { background: var(--ink); color: var(--sc-granite); border-top-color: transparent; }
.band--dark { background: var(--primary); color: var(--on-primary); border-top-color: transparent; }

/* Rule 5: Spruce and Basalt never appear as two adjacent blocks. Caught here so a
   composition mistake is visible in the browser rather than only in review. */
.band--dark + .band--ink,
.band--ink + .band--dark,
.band--dark + .band--dark,
.band--ink + .band--ink,
main:has(> .band--dark:last-child) + .site-foot,
main:has(> .band--ink:last-child) + .site-foot {
  outline: 4px dashed #C4453A;
  outline-offset: -4px;
}

.band--ink :where(h1, h2, h3, .statement), .band--dark :where(h1, h2, h3, .statement) { color: var(--on-primary); }
.band--ink :where(a), .band--dark :where(a) { color: var(--on-primary); }

/* ---------- Section grammar ---------- */

/* 1 — Eyebrow. Names the department or topic. Uppercase is allowed here and on
   buttons, and nowhere else. */
.eyebrow {
  margin: 0 0 14px;
  font: 600 var(--fs-eyebrow)/1 var(--sc-sans);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--body);
}
.band--ink .eyebrow, .band--dark .eyebrow { color: var(--sc-granite); }

/* 2 — Headline. Lora 500, sentence case, one idea, under twelve words. */
h1, h2, h3 {
  font-family: var(--sc-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .004em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-display); line-height: 1.08; }
h2 { font-size: var(--fs-section); line-height: 1.15; }
h3 { font-size: 1.125rem; line-height: 1.3; }

/* 3 — Lede. Two or three sentences of plain explanation. */
.lede {
  max-width: var(--measure-lede);
  font-size: var(--fs-lead);
  margin: 0 0 1.4em;
}

p { max-width: var(--measure); margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* 4 — Statement band. One sentence, larger, often with one italic phrase. */
.statement {
  max-width: 26ch;
  font: 400 var(--fs-quote)/1.35 var(--sc-serif);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.statement em { font-style: italic; }

/* 5 — Substance. Whatever proves the claim: a table, a count grid, a spec list. */
/* Hairlines are drawn by each cell, not by a background showing through the gaps.
   A row that does not fill (seven cards in four columns) then leaves nothing behind —
   the old gap-as-rule trick painted a solid Granite block in the empty track, and
   Granite is a rule colour, never a surface. */
.grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}
.grid > * { box-shadow: 0 0 0 1px var(--rule); padding: clamp(20px, 2.6vw, 30px); }

/* A card is a cell of the grid, not a floating object: square, no shadow. */
a.card { text-decoration: none; color: var(--body); display: block; }
a.card:hover { background: var(--band); }
.band--field a.card:hover { background: var(--ground); }
a.card:hover h3 { text-decoration: underline; text-underline-offset: .18em; }
.card p { font-size: var(--fs-caption); margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: var(--fs-caption); }
th {
  text-align: left; padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--rule);
  font: 600 var(--fs-eyebrow)/1 var(--sc-sans);
  letter-spacing: var(--ls-button); text-transform: uppercase; color: var(--body);
}
td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--sc-hair); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

.specs { list-style: none; margin: 0; padding: 0; }
.specs li { padding: 11px 0; border-bottom: 1px solid var(--sc-hair); }
.specs li:last-child { border-bottom: 0; }

/* 6 — Process. Three numbered steps: displayed numeral, one-word label. */
.process { display: grid; gap: clamp(28px, 4vw, 52px); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.process .num {
  display: block;
  font: 500 var(--fs-numeral)/1 var(--sc-serif);
  color: var(--ink);           /* Basalt. Never Cedar — a numeral is a word. */
  margin-bottom: 10px;
}
.band--ink .process .num, .band--dark .process .num { color: var(--on-primary); }
.process h3 { margin-bottom: .4em; }

/* 7 — Call to action. One sentence, one button. Never two competing buttons. */
.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--on-primary);
  padding: 15px 30px;
  border: 1px solid var(--primary);
  font: 600 var(--fs-button)/1 var(--sc-sans);
  letter-spacing: var(--ls-button);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--primary-hv); border-color: var(--primary-hv); color: var(--on-primary); }
.band--dark .btn, .band--ink .btn { background: var(--on-primary); border-color: var(--on-primary); color: var(--ink); }
.band--dark .btn:hover, .band--ink .btn:hover { background: var(--sc-silt); border-color: var(--sc-silt); }

/* ---------- Rules and dividers ---------- */

hr { border: 0; border-top: 1px solid var(--rule); margin: var(--step) 0; }

/* The one Cedar element a section is allowed. Decorative only — Cedar never
   carries a word (3.58:1 on Snowfield, below the 4.5:1 minimum). */
.rule-cedar { width: 64px; height: 2px; background: var(--accent-rule); border: 0; margin: 0 0 22px; }

/* Cedar Dark is the only warm colour permitted on type, and only on small text. */
.accent { color: var(--accent-type); font-size: var(--fs-caption); }
.band--ink .accent, .band--dark .accent { color: var(--sc-granite); }

/* ---------- Header and footer ---------- */

.site-head {
  border-bottom: 1px solid var(--sc-hair);
  background: var(--ground);
  position: sticky; top: 0; z-index: 20;
}
.site-head .wrap { display: flex; align-items: center; gap: 28px; min-height: 74px; }

/* The wordmark is the word "Stonecreek" set in Lora. There is no image logo,
   no monogram, no badge, no oval. */
.wordmark {
  font: 500 25px/1 var(--sc-serif);
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark small {
  display: block;
  margin-top: 5px;
  font: 600 var(--fs-eyebrow)/1 var(--sc-sans);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--body);
}

.site-nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: clamp(14px, 1.8vw, 26px); align-items: center; }
.site-nav a {
  font: 400 15px/1 var(--sc-sans);
  color: var(--body);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent-rule); }

.site-foot { background: var(--ink); color: var(--sc-granite); padding-block: var(--step) 40px; }
.site-foot a { color: var(--sc-granite); }
.site-foot a:hover { color: var(--on-primary); }
.site-foot h2 { color: var(--on-primary); font-size: var(--fs-section); }
.site-foot .cols { display: grid; gap: 34px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { padding: 4px 0; font-size: var(--fs-caption); }
.site-foot .legal {
  margin-top: 44px; padding-top: 20px;
  border-top: 1px solid rgba(237, 239, 238, .16);
  font-size: 13px;
}

/* ---------- Forms ---------- */

.form { max-width: 620px; display: grid; gap: 20px; }
.field { display: grid; gap: 7px; }
.field > label {
  font: 600 var(--fs-eyebrow)/1 var(--sc-sans);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--body);
}
.field input, .field select, .field textarea {
  font: 400 var(--fs-body)/1.5 var(--sc-sans);
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 12px 14px;
  width: 100%;
}
.field textarea { min-height: 148px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field .hint { font-size: 13px; color: var(--body); }

/* Honeypot. Hidden from people, reachable by bots. Never `display:none` — some
   bots skip those; this is off-screen but focusable-safe via tabindex="-1". */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { font-size: var(--fs-caption); }
.form-status[data-state="error"] { color: #9A3A31; }
.form-status[data-state="ok"] { color: var(--primary); }

/* ---------- Motion ---------- */

/* Every animation must be disabled here and the page must still deliver its full
   content statically. Do not break this. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print ---------- */

@media print {
  .site-head, .site-nav, .btn, .skip { display: none; }
  body { background: #fff; color: #000; }
}
