/* ==========================================================================
   BC Metalworks — FORGE design system (forge spec §2)
   Dark-first, tempering-palette accents.
   Fonts: Fraunces variable (display), Archivo variable (body/UI),
   IBM Plex Mono (notation). All subsets produced by tools/subset-fonts.js —
   @font-face unicode-range below must match that script's KEEP_TEXT.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/fraunces-latin-var.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A9, U+00B7, U+2013-2014, U+2018-2019, U+201C-201D, U+2026;
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/fraunces-italic-var.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A9, U+00B7, U+2013-2014, U+2018-2019, U+201C-201D, U+2026;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/archivo-latin-var.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A9, U+00B7, U+2013-2014, U+2018-2019, U+201C-201D, U+2026;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plex-mono-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/plex-mono-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Design tokens — the Coldwork palette (coldwork spec §2). Cool grays +
   arc blue; steel genuinely blues, so the accent stays true to the material.
   Final values converged against tools/contrast-check.js (all floors pass);
   see that tool for the binding pairs. ------------------------------------- */

:root {
  --graphite:   #17181B; /* default page ground (cool near-black) */
  --gunmetal:   #212327; /* raised surfaces, cards, title blocks on dark */
  --zinc:       #E4E6E8; /* interludes + primary text on dark (cool, not beige) */
  --ink:        #191B1E; /* text on zinc sections */
  --steel:      #9AA0A7; /* quiet notation: indexes on dark, metadata, spec lines — ≥4.5:1 on graphite AND gunmetal */
  --blued:      #3E6B96; /* mid emphasis: selected borders, tabs, secondary accents — graphic/large only on dark */
  --blued-deep: #2E5175; /* hover/active fills carrying zinc labels — ≥4.5:1 vs zinc */
  --arc:        #6EA8DC; /* THE hot accent: draw glow, builder selections, CTA hover — rationed to ~3/viewport, large/graphic only */
  --rule-d: rgba(228, 230, 232, 0.14);
  --rule-l: rgba(25, 27, 30, 0.18);

  /* contextual: dark ground is the default; zinc interludes flip these */
  --rule: var(--rule-d);
  --index-accent: var(--steel);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Archivo", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --grid-max: 1360px;
  --gutter: clamp(1rem, 2.5vw, 2rem);
  --section-pad: clamp(4rem, 9vw, 9rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset -------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0; /* machined edges — spec §2.3 */
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 430;
  line-height: 1.65;
  color: var(--zinc);
  /* mill-scale noise (spec §2.3): one tiny tiled SVG asset, ≤3% alpha,
     painted on the coal ground only — bone interludes cover it */
  background-color: var(--graphite);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 .03'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='128' height='128' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
}

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

svg {
  display: block;
}

/* Typography (spec §2.2) — Fraunces display, Archivo body, Plex notation ---- */

h1, h2, h3 {
  margin: 0 0 1rem;
}

/* Display — Fraunces, H1/H2 only. Large optical size, 560–640 weight,
   tight leading, slight negative tracking. */
h1, h2 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
}

h1 {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 620;
  line-height: 1.0;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.75rem);
  font-weight: 590;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* One emphasized phrase inside a headline may take Fraunces true italic
   (max one per page) */
h1 em, h2 em, .display-italic {
  font-style: italic;
  font-weight: inherit;
}

/* H3 — Archivo 700: the display face is used with restraint */
h3 {
  font-family: var(--font-body);
  font-size: clamp(1.375rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

p {
  margin: 0 0 1rem;
}

/* Notation — all indexes, spec lines, metadata, labels */
.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
}

/* Stat numerals — Fraunces at H1 scale, tabular where available */
.stat-num {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Links — straw hover underlines (temper stage 1) ---------------------------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--steel);
  text-decoration-thickness: 2px;
}

/* §2 amendment: straw outlines on dark grounds; ink on bone interludes so
   the outline computes ≥3:1 against its actual background everywhere */
:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
}

.section--zinc :focus-visible {
  outline-color: var(--ink);
}

/* Layout (spec §2.3) --------------------------------------------------------- */

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

.container--narrow {
  max-width: 52rem;
}

main {
  min-height: 60vh;
}

.section {
  padding-block: var(--section-pad);
  position: relative;
}

/* section-top hairline as a pseudo so §9.3 can scale it in from the left */
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--rule);
}

.section:first-child::before {
  content: none;
}

/* Bone interludes — deliberate light sections on the dark default ground
   (roughly one per page, two on the homepage). Flips the contextual vars. */
.section--zinc {
  background: var(--zinc);
  color: var(--ink);
  --rule: var(--rule-l);
  --index-accent: var(--blued);
}

/* the ground change is its own edge — no hairline on interlude boundaries */
.section--zinc::before {
  content: none;
}

/* Raised dark surface (char) — cards, panels, and the v2 dark bands
   pending their §4 restyle */
.section--dark {
  background: var(--gunmetal);
  color: var(--zinc);
}

.section--dark::before {
  content: none;
}

/* Section index label — (n.0) in straw on dark / oxide on bone (§2.3),
   middle-dot separated from the section name. */
.sec-index {
  display: flex;
  align-items: baseline;
  gap: 0.75em;
  margin: 0 0 clamp(2rem, 4vw, 3.5rem);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
}

.sec-index__num {
  color: var(--index-accent);
}

.sec-index__name::before {
  content: "\00B7\0020";
}

/* Buttons (spec §2.4) — v2 anatomy, Forge recolor. Dark ground is the
   default: bone border/text, hover fills ember (150ms). Primary: bone fill,
   ink text, hover ember. ---------------------------------------------------- */

.button {
  display: inline-block;
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: 1px solid var(--zinc);
  color: var(--zinc);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.button:hover,
.button:active {
  background: var(--blued-deep);
  border-color: var(--blued-deep);
  color: var(--zinc);
}

.button--primary {
  background: var(--zinc);
  border-color: var(--zinc);
  color: var(--ink);
}

.button--primary:hover,
.button--primary:active {
  background: var(--blued-deep);
  border-color: var(--blued-deep);
  color: var(--zinc);
}

/* On bone interludes the anatomy holds; ink replaces bone as the quiet pair */
.section--zinc .button {
  border-color: var(--ink);
  color: var(--ink);
}

.section--zinc .button:hover,
.section--zinc .button:active {
  background: var(--blued-deep);
  border-color: var(--blued-deep);
  color: var(--zinc);
}

.section--zinc .button--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--zinc);
}

.section--zinc .button--primary:hover,
.section--zinc .button--primary:active {
  background: var(--blued-deep);
  border-color: var(--blued-deep);
  color: var(--zinc);
}

/* Brand mark (spec §2.4) — currentColor throughout: inverts automatically --- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand:hover .brand__mark {
  color: var(--steel);
}

.brand__mark {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}

/* Form fields ------------------------------------------------------------------ */

.field {
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.field__optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* item-(b)/A2: quiet helper line under a field (e.g. opening width) */
.field__hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--steel);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
}

.section--zinc .field input:focus-visible,
.section--zinc .field textarea:focus-visible {
  outline-color: var(--ink);
}

/* ==========================================================================
   Sitewide application (restyle spec §3)
   ========================================================================== */

/* Header / nav (spec §3.1) --------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--graphite) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule-d);
  color: var(--zinc);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 0.875rem;
  position: relative;
  z-index: 41;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem clamp(1rem, 2.5vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a:not(.button) {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  position: relative;
  padding-block: 0.25rem;
}

.site-nav a:not(.button)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--steel);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--ease-out);
}

.site-nav a:not(.button):hover::after,
.site-nav a:not(.button):focus-visible::after,
.site-nav a[aria-current="page"]:not(.button)::after {
  transform: scaleX(1);
}

.site-nav .button {
  padding: 0.625rem 1rem;
  font-size: 0.75rem;
}

.nav-toggle {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
}

@media (min-width: 60rem) {
  .nav-toggle {
    display: none !important;
  }
}

@media (max-width: 59.9375rem) {
  /* JS present: list collapses behind the toggle; no-JS keeps the plain list */
  .js .site-nav {
    display: none;
  }

  /* full-screen coal overlay, H2-scale links (§3.1) */
  .site-header[data-nav-open="true"] .site-nav {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: var(--graphite);
    padding: 7rem var(--gutter) 2.5rem;
    overflow-y: auto;
  }

  .site-header[data-nav-open="true"] .site-nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
  }

  .site-header[data-nav-open="true"] .site-nav a:not(.button) {
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    font-weight: 700;
    line-height: 1.05;
  }

  .site-header[data-nav-open="true"] .site-nav__cta {
    margin-top: 1rem;
  }
}

html.nav-locked,
html.nav-locked body {
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .site-header[data-nav-open="true"] .site-nav {
    animation: nav-fade 200ms ease;
  }

  @keyframes nav-fade {
    from { opacity: 0; }
  }
}

/* Footer — the indexed document (spec §3.2) ----------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.site-footer__col {
  padding: 0.25rem clamp(1rem, 2vw, 2rem) 0.5rem;
  border-left: 1px solid var(--rule);
}

.site-footer__col:first-child {
  padding-left: 0;
  border-left: none;
}

@media (max-width: 59.9375rem) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .site-footer__col {
    border-left: none;
    border-top: 1px solid var(--rule);
    padding: 1.5rem 0;
  }

  .site-footer__col:first-child {
    border-top: none;
    padding-top: 0;
  }
}

.site-footer .sec-index {
  margin-bottom: 1.25rem;
}

.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 2.2;
}

.site-footer__list a {
  text-decoration: none;
}

.site-footer__list a:hover,
.site-footer__list a:focus-visible {
  color: var(--blued);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* (3.0) swagger line — Fraunces italic (§3.2) */
.site-footer__line {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 560;
  line-height: 1.05;
  margin: 0 0 1.5rem;
}

.site-footer__copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.sound-toggle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.sound-toggle:hover,
.sound-toggle:active {
  background: var(--blued-deep);
  border-color: var(--blued-deep);
  color: var(--zinc);
}

/* Hero (spec §3.3.1) ----------------------------------------------------------- */

.hero {
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  padding-left: max(var(--gutter), calc((100vw - var(--grid-max)) / 2 + var(--gutter)));
}

.hero__copy {
  position: relative;
  z-index: 1;
  padding-right: var(--gutter);
}

.hero__title {
  margin: 0 0 1.5rem;
  /* headline crosses the image boundary by ~1 column (spec §2.3 asymmetry rule) */
  margin-right: -14%;
}

.hero__lede {
  font-size: 1.1875rem;
  max-width: 34rem;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__media {
  align-self: stretch;
}

/* Photo hero (when a real photograph exists): full-bleed behind a scrim */
.hero__media img {
  width: 100%;
  height: 100%;
  min-height: clamp(320px, 44vw, 560px);
  object-fit: cover;
}

/* No-photo hero (§3.4.1): large ember-stroked fragment of the Swept-Top
   elevation — the full asset CSS-cropped to the left leaf + sweep */
.hero__linework {
  position: relative;
  overflow: hidden;
  min-height: clamp(320px, 44vw, 560px);
  color: var(--arc);
}

.hero__linework svg {
  position: absolute;
  width: 240%;
  height: auto;
  left: -31%;
  top: 0;
}

/* §9.2 hero scribe-in: a 1px rule scribes under the headline as it appears.
   Coldwork (§2): it draws hot (arc), cools through blued, settles to zinc.
   The element always occupies its 1px — zero CLS; CSS-only, runs once per
   load. Static settled state is zinc (no-JS / reduced motion). */
.hero__scribe {
  height: 1px;
  background: var(--zinc);
  margin: 0 0 1.5rem;
  transform-origin: left;
}

@media (prefers-reduced-motion: no-preference) {
  .js .hero__scribe {
    animation: scribe-in 700ms var(--ease-out) both;
  }

  .js .hero__title {
    animation: hero-appear 400ms var(--ease-out) both;
  }

  @keyframes scribe-in {
    from { transform: scaleX(0); background-color: var(--arc); }
    60% { background-color: var(--blued); }
    to { transform: scaleX(1); background-color: var(--zinc); }
  }

  @keyframes hero-appear {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

.hero__intro {
  max-width: 44rem;
  margin: clamp(3rem, 6vw, 5rem) 0 0;
}

@media (max-width: 59.9375rem) {
  .hero__grid {
    display: block;
    padding-left: 0;
  }

  .hero__copy {
    padding-inline: var(--gutter);
    margin-bottom: 2.5rem;
  }

  .hero__title {
    margin-right: 0;
  }

  .hero__media img {
    min-height: 0;
  }
}

/* Services rows (spec §3.3.2) --------------------------------------------------- */

.svc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.svc-list li {
  border-bottom: 1px solid var(--rule);
}

.svc-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 4fr) minmax(0, 6fr);
  gap: 0.25rem var(--gutter);
  align-items: baseline;
  padding-block: clamp(1.25rem, 2.5vw, 2rem);
  text-decoration: none;
  color: inherit;
}

.svc-row__num {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blued);
}

.svc-row__title {
  font-size: clamp(1.375rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  transition: color 150ms ease;
}

.svc-row__desc {
  line-height: 1.5;
}

.svc-row:hover .svc-row__title,
.svc-row:focus-visible .svc-row__title {
  color: var(--blued);
}

@media (max-width: 47.9375rem) {
  .svc-row {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .svc-row__desc {
    grid-column: 2;
  }
}

/* Work cards + grid (basic; full anatomy in spec §4) ----------------------------- */

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}

@media (min-width: 40rem) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* char cards, straw spec lines (forge §3.4.3 / §4) */
.work-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--gunmetal);
  border: 1px solid var(--rule);
}

.work-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Typographic fallback — no photo required, no fake photo shipped.
   Coal base so the tile reads against the char card surface. */
.work-card__media--type {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    repeating-linear-gradient(105deg,
      color-mix(in srgb, var(--zinc) 6%, transparent) 0px,
      color-mix(in srgb, var(--zinc) 6%, transparent) 2px,
      transparent 2px,
      transparent 9px),
    var(--graphite);
}

.work-card__media--type p {
  font-size: clamp(1.375rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--zinc);
  margin: 0;
}

.work-card__text {
  padding: 1.125rem 1.25rem 1.25rem;
}

.work-card__name {
  font-size: clamp(1.375rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.5rem;
  transition: color 150ms ease;
}

.work-card:hover .work-card__name,
.work-card:focus-visible .work-card__name {
  color: var(--blued);
}

.work-card__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.work-feature__more {
  margin: 2rem 0 0;
}

.work-feature__more a {
  text-decoration: none;
}

.work-feature__more a:hover,
.work-feature__more a:focus-visible {
  color: var(--blued);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* (4.0) DESIGN YOUR GATE — builder teaser (§3.4.4): the homepage's hot
   moment; ember lives here. Preview markup + cycling wired in §6. ----------- */

.teaser__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.teaser__line {
  font-size: 1.1875rem;
  max-width: 30rem;
  margin-bottom: 2rem;
}

@media (max-width: 59.9375rem) {
  .teaser__grid {
    grid-template-columns: 1fr;
  }
}

/* (5.0) PROCESS — five-stage strip (§3.4.5) --------------------------------- */

.proc-strip__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gutter);
  border-top: 1px solid var(--rule);
}

.proc-strip__item {
  padding-top: 1.25rem;
}

.proc-strip__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--steel);
  margin-bottom: 0.75rem;
}

.proc-strip__title {
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.proc-strip__desc {
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: 0;
}

.proc-strip__more {
  margin: 2rem 0 0;
}

.proc-strip__more a,
.work-feature__more a {
  text-decoration: none;
}

@media (max-width: 59.9375rem) {
  .proc-strip__list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 39.9375rem) {
  .proc-strip__list {
    grid-template-columns: 1fr;
  }
}

/* CTA band (spec §3.3.5) ---------------------------------------------------------- */

.cta-band__line {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.02;
  margin: 0 0 2rem;
  max-width: 24ch;
}

/* Interior pages (spec §3.4) -------------------------------------------------------- */

.page__lede {
  font-size: 1.1875rem;
  max-width: 44rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* A3: free-estimate line — reuses the §2 steel "quiet notation" supporting-text
   idiom at base scale (no new color/treatment). Shared: hero, contact, services. */
.estimate-line {
  color: var(--steel);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 1.5rem;
  max-width: 38rem;
}

.service {
  padding-block: 2rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 5rem;
}

.service:last-of-type {
  border-bottom: none;
}

.service p {
  max-width: 38rem;
  margin-bottom: 0;
}

.contact-form {
  margin-block: 2.5rem;
  max-width: 34rem;
}

/* ==========================================================================
   Card grammar & project metadata (restyle spec §4)
   ========================================================================== */

.work-card__spec {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 0.625rem;
}

.work-card__stat {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blued);
  margin: 0.625rem 0 0;
}

/* Case-study title block — char panel, straw labels (forge §4) */
.title-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--gunmetal);
  border: 1px solid var(--rule);
  margin: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.title-block__cell {
  padding: 0.875rem 1rem 1rem;
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
}

.title-block__cell:nth-child(-n+3) {
  border-top: none;
}

.title-block__cell:nth-child(3n+1) {
  border-left: none;
}

.title-block dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 0.375rem;
}

.title-block dd {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 47.9375rem) {
  .title-block {
    grid-template-columns: 1fr;
  }

  .title-block__cell,
  .title-block__cell:nth-child(-n+3) {
    border-left: none;
    border-top: 1px solid var(--rule);
  }

  .title-block__cell:first-child {
    border-top: none;
  }
}

/* Case-study page */
/* Track C: the hero box is a FIXED height, not a max-height. The real photos
   are portrait as often as landscape, and `object-fit: cover` only crops when
   the image has a height to fill — with max-height + an auto-height img, a
   portrait shot rendered ~2200px tall and the hero showed nothing but its top
   edge (sky). Height here, height:100% on the img, so cover actually covers. */
.project__hero {
  height: clamp(22rem, 60vh, 40rem);
  overflow: hidden;
  background: var(--gunmetal);
}

.project__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* focal point is per-project: a center crop of a tall shot can land on the
     house and cut the steelwork out of frame. hero_position in the front matter
     moves the crop to the work. */
  object-position: var(--hero-pos, center);
}

/* T7: the pipeline wraps every photo in <picture>; the existing `img` rules
   still apply inside it, but the wrapper itself needs to be a block so it
   fills the hero/card box rather than sitting on a text baseline. */
.project__hero picture,
.work-card__media picture {
  display: block;
  height: 100%;
}

/* Track C: drawing hero — a project with no photograph leads with its shop
   drawing (genuine work product) instead. Same plate as the typographic
   fallback; the elevation inherits the draw color. */
.project__hero--drawing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  color: var(--zinc);
  background: var(--gunmetal);
}

.project__hero--drawing svg {
  width: 100%;
  height: auto;
  max-height: 52vh;
}

.work-card__media--drawing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  color: var(--steel);
  background: var(--gunmetal);
}

.work-card__media--drawing svg {
  width: 100%;
  height: auto;
}

/* customer-facing photo caption — authorship IS claimed on /work/ */
.project__caption {
  color: var(--steel);
  margin-top: 0.5rem;
}

.project__hero--type {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background:
    repeating-linear-gradient(105deg,
      color-mix(in srgb, var(--zinc) 6%, transparent) 0px,
      color-mix(in srgb, var(--zinc) 6%, transparent) 2px,
      transparent 2px,
      transparent 9px),
    var(--gunmetal);
}

.project__hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--zinc);
  margin: 0;
}

.project__summary {
  font-size: 1.1875rem;
  max-width: 44rem;
}

.project__gallery {
  display: grid;
  gap: var(--gutter);
  margin-block: clamp(1.5rem, 3vw, 2.5rem);
}

@media (min-width: 40rem) {
  .project__gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project__back {
  margin-top: 2.5rem;
}

/* ==========================================================================
   /ideas/ — reference gallery + minimal lightbox (forge spec §5)
   ========================================================================== */

.ideas-disclaimer {
  color: var(--steel);
  margin: 0 0 1.5rem;
}

.ideas-disclaimer a {
  color: inherit;
}

.ideas-cat {
  margin-top: clamp(3rem, 6vw, 5rem);
}

/* 1 / 2 / 3 columns at 375 / 768 / desktop */
.ideas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}

@media (min-width: 48rem) {
  .ideas-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .ideas-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ideas-item {
  display: block;
  background: var(--gunmetal);
  border: 1px solid var(--rule);
}

.ideas-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 3rem);
}

.lightbox__scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--graphite) 92%, transparent);
}

.lightbox__inner {
  position: relative;
  margin: 0;
  max-width: min(72rem, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--zinc);
}

.lightbox__img {
  min-height: 0;
  max-height: 70vh;
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  border: 1px solid var(--rule-d);
}

.lightbox__caption {
  color: var(--steel);
}

.lightbox__disclaimer {
  margin: 0;
}

.lightbox__disclaimer a {
  color: inherit;
}

.lightbox__controls {
  display: flex;
  gap: 0.5rem;
}

.lightbox__btn {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--zinc);
  color: var(--zinc);
  padding: 0.5rem 0.875rem;
  cursor: pointer;
}

.lightbox__btn:hover,
.lightbox__btn:active {
  background: var(--blued-deep);
  border-color: var(--blued-deep);
}

/* /manifesto/ — four declarations, large Fraunces (forge spec §8) ------------ */

.manifesto__list {
  list-style: none;
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
  padding: 0;
}

.manifesto__item {
  padding-block: clamp(2rem, 4vw, 3.5rem);
  border-top: 1px solid var(--rule);
}

.manifesto__index {
  margin: 0 0 1rem;
  font-weight: 700;
}

.manifesto__decl {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  font-weight: 590;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 22ch;
}

.manifesto__decl em {
  font-style: italic;
  font-weight: inherit;
}

/* /process/ — five indexed stages (forge spec §7) ---------------------------- */

.proc-stages {
  list-style: none;
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
  padding: 0;
}

.proc-stage {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 0.5rem var(--gutter);
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--rule);
}

.proc-stage__index {
  margin: 0;
  font-weight: 700;
}

.proc-stage__title {
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.625rem;
}

.proc-stage p:last-child {
  margin-bottom: 0;
  max-width: 38rem;
}

.proc-cta {
  margin-top: clamp(2rem, 4vw, 3rem);
}

@media (max-width: 39.9375rem) {
  .proc-stage {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Gate Style Builder (forge spec §6) — one SVG, layers keyed by the svg
   root's data attributes. The markup defaults ARE the no-JS static figure.
   ========================================================================== */

/* §6.7: the drawing renders in the selected finish color; --gate-finish is
   set inline (server default) and by JS on change */
.gate-svg {
  width: 100%;
  height: auto;
  color: var(--gate-finish, var(--zinc));
}

/* §6.7 backdrop plate — bone or coal by finish luminance, chosen in the
   builder data at build time and by JS on change */
.gate-plate {
  padding: clamp(1rem, 3vw, 2rem);
}

.gate-plate[data-plate="zinc"] {
  background: var(--zinc);
}

.gate-plate[data-plate="graphite"] {
  background: var(--graphite);
  border: 1px solid var(--rule);
}

@media (prefers-reduced-motion: no-preference) {
  /* §6.7 finish change: 300ms color crossfade; instant under reduced motion */
  .gate-svg {
    transition: color 300ms linear;
  }

  .gate-plate {
    transition: background-color 300ms linear;
  }
}

.gate-svg .part {
  display: none;
}

/* item-(b)/A2: gate height. The 8' state scales the whole drawing vertically
   about the ground (viewBox 480,520), width unchanged, so it reads as taller.
   non-scaling-stroke on the paths keeps the line weight constant; JS grows the
   viewBox for the 8' state so the scaled top never clips. 6' = identity. */
.gate-scale {
  transform-box: view-box;
  transform-origin: 480px 520px;
}

.gate-svg[data-height="8"] .gate-scale {
  transform: scaleY(1.3333);
}

@media (prefers-reduced-motion: no-preference) {
  .gate-scale {
    transition: transform 300ms ease;
  }
}

.gate-svg[data-top="flat"] .p-top-flat,
.gate-svg[data-top="arched"] .p-top-arched,
.gate-svg[data-top="swept"] .p-top-swept,
.gate-svg[data-infill="picket"] .p-infill-picket,
.gate-svg[data-infill="corrugated"] .p-infill-corrugated,
.gate-svg[data-infill="cable"] .p-infill-cable,
.gate-svg[data-infill="ornate"] .p-infill-ornate,
.gate-svg[data-infill="custom"] .p-infill-custom,
.gate-svg[data-frame="standard"] .p-frame-standard,
.gate-svg[data-frame="heavy"] .p-frame-heavy {
  display: inline;
}

/* §1.2 custom infill label — mono caps, filled in the current draw color */
.gate-custom-label {
  fill: currentColor;
  stroke: none;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* §6.3 cooling: after the ember draw, the changed part cools to bone.
   JS adds .cooling only when motion is allowed. */
@media (prefers-reduced-motion: no-preference) {
  .gate-svg .part.cooling {
    animation: part-cool 400ms linear both;
  }

  /* §2: parts cool arc -> blued -> finish color */
  @keyframes part-cool {
    0% { color: var(--arc); }
    50% { color: var(--blued); }
    100% { color: var(--gate-finish, var(--zinc)); }
  }
}

/* (2.0) railing render layer — the photoreal render sits on top of the SVG in
   a single grid cell. The stack holds the render's aspect ratio from first
   paint (--rr-ratio, set inline from the master's dimensions), so the render
   fading in over the drawing never shifts the page. The SVG is the placeholder
   and the no-JS fallback: the render layer is transparent until JS confirms
   its image decoded, so with scripts off only the drawing shows. */
.railing-stack {
  display: grid;
  aspect-ratio: var(--rr-ratio, auto);
}

.railing-stack > * {
  grid-area: 1 / 1;
  align-self: center;
}

.railing-render {
  display: block;
  opacity: 0;
}

.railing-render img {
  display: block;
  width: 100%;
  height: auto;
}

.railing-render.is-visible {
  opacity: 1;
}

.railing-stack.is-render .railing-svg {
  opacity: 0;
}

/* same 300ms crossfade the finish recolor uses; instant under reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .railing-render,
  .railing-stack .railing-svg {
    transition: opacity 300ms linear;
  }
}

/* Builder page layout */
.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}

@media (max-width: 59.9375rem) {
  .builder-layout {
    grid-template-columns: 1fr;
  }
}

.builder-preview {
  margin: 0;
  position: sticky;
  top: 5rem;
}

@media (max-width: 59.9375rem) {
  .builder-preview {
    position: static;
  }
}

.builder-specline {
  margin-top: 1rem;
  color: var(--steel);
  min-height: 1.5em; /* reserved — the live line never shifts layout */
}

.builder-group {
  border: none;
  margin: 0 0 2rem;
  padding: 0;
}

.builder-group legend {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0;
  margin-bottom: 0.875rem;
  color: var(--steel);
}

.builder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

/* chips: real radios, visually hidden but focusable; selected = ember
   border + straw label (§6.3) */
.chip {
  position: relative;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.chip__face {
  display: inline-block;
  padding: 0.75rem 1.125rem;
  border: 1px solid var(--rule-d);
  color: var(--zinc);
  transition: border-color 150ms ease, color 150ms ease;
}

.chip:hover .chip__face {
  border-color: var(--zinc);
}

.chip input:checked + .chip__face {
  border-color: var(--arc);
  color: var(--steel);
}

.chip input:focus-visible + .chip__face {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
}

.builder-caption {
  margin: 0.875rem 0 0;
  color: var(--steel);
  max-width: 34rem;
}

/* coldwork §3.2 — RAL finish grid (shared by gate + railing) --------------- */

.ral-grid {
  border: none;
  margin: 0 0 2rem;
  padding: 0;
}

.ral-grid > legend {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0;
  margin-bottom: 0.875rem;
  color: var(--steel);
}

.ral-grid__cat {
  font-size: 0.6875rem;
  color: var(--steel);
  margin: 1.25rem 0 0.625rem;
}

.ral-grid__swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 0.625rem;
}

.ral-swatch {
  position: relative;
  display: block;
  cursor: pointer;
}

.ral-swatch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.ral-swatch__chip {
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--rule-d);
  transition: outline-color 150ms ease;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.ral-swatch__cap {
  display: block;
  font-size: 0.625rem;
  line-height: 1.35;
  letter-spacing: 0.04em;
  margin-top: 0.375rem;
  color: var(--steel);
}

.ral-swatch__code {
  display: block;
  font-weight: 700;
}

.ral-swatch__name {
  display: block;
}

/* selected: arc border on the chip + caption brightens to zinc */
.ral-swatch input:checked ~ .ral-swatch__chip {
  outline-color: var(--arc);
}

.ral-swatch input:checked ~ .ral-swatch__cap {
  color: var(--zinc);
}

.ral-swatch input:focus-visible ~ .ral-swatch__chip {
  outline-color: var(--steel);
}

.ral-grid__download {
  margin: 1.25rem 0 0;
}

.ral-grid__download a {
  text-decoration: none;
  color: var(--steel);
}

.ral-grid__download a:hover,
.ral-grid__download a:focus-visible {
  color: var(--zinc);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.builder-actions {
  margin-top: 2.5rem;
}

/* §6.6 no-JS: the chips read as a plain list and a line points to the
   quote form; with JS the line disappears and chips are interactive */
.builder-nojs {
  color: var(--steel);
  max-width: 34rem;
}

.js .builder-nojs {
  display: none;
}

html:not(.js) .chip {
  display: block;
}

html:not(.js) .chip input {
  display: none;
}

html:not(.js) .chip__face,
html:not(.js) .chip:hover .chip__face {
  border: none;
  padding: 0.125rem 0;
}

html:not(.js) .builder-chips {
  flex-direction: column;
  gap: 0.25rem;
}

/* homepage teaser preview (§3.4.4) */
.teaser__preview .gate-svg {
  max-height: 340px;
}

/* ==========================================================================
   Motion & sensory (restyle spec §6) — all gated on no-preference
   ========================================================================== */

/* §6.5 drawing-to-steel reveal container: photo is the base layer */
.project__reveal {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  overflow: hidden;
  margin: 0;
  background: var(--gunmetal);
  color: var(--zinc);
}

.project__reveal-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project__reveal-drawing {
  position: absolute;
  inset: 0;
  padding: 4%;
  opacity: 0; /* JS + motion-ok raises it; otherwise photo only */
}

.project__reveal-drawing svg {
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  /* §6.1 scroll reveals — only elements JS tagged (.rv) ever hide */
  .js .rv {
    opacity: 0;
    transform: translateY(12px);
    transition:
      opacity 400ms var(--ease-out),
      transform 400ms var(--ease-out);
    transition-delay: var(--rv-delay, 0ms);
  }

  .js .rv.rv-in {
    opacity: 1;
    transform: none;
  }

  /* forge §9.3 section rules cut in — hairlines scale-x from left on
     scroll-enter, 300ms. Chanel rule: first thing to cut if it reads busy. */
  .js .section.rl::before {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms var(--ease-out);
  }

  .js .section.rl.rl-in::before {
    transform: scaleX(1);
  }

  /* §6.3 image wipes — scroll-enter (case-study gallery, JS-tagged) */
  .js .wp {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 500ms var(--ease-out);
  }

  .js .wp.wp-in {
    clip-path: inset(0 0 0 0);
  }

  /* §6.3 image wipes — card hover, desktop pointer only */
  @media (hover: hover) and (pointer: fine) {
    .work-card__media img,
    .work-card__media--type {
      clip-path: inset(0 0 0 0);
      transition: clip-path 500ms var(--ease-out);
    }

    .work-card:hover .work-card__media img,
    .work-card:focus-visible .work-card__media img,
    .work-card:hover .work-card__media--type,
    .work-card:focus-visible .work-card__media--type {
      clip-path: inset(4% 4% 4% 4%);
    }
  }
}

/* Reduced motion: kill all CSS motion (spec §1.2) ------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
