/* =========================================================
   FRAMEWORK — contractor landing page (/contractor-websites)
   Same identity as the site: sharp corners, ruled lines, display type,
   black and white. Colour comes only from photography and the
   websites shown. No shadows, no rounded corners.
   ========================================================= */

.cx-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 4.7vw, 70px);
  line-height: 0.98;
  letter-spacing: -0.022em;
  margin: 18px 0 0;
  text-wrap: balance;
}
.cx-display--md { font-size: clamp(36px, 5.4vw, 72px); margin: 0; max-width: 16ch; }
.cx-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 14px 0 0;
  max-width: 20ch;
  text-wrap: balance;
}
.cx-h3 { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.15; letter-spacing: -0.01em; margin: 0; display: block; }
.cx-h3--lg { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.02; letter-spacing: -0.02em; }
.cx-lead { font-size: clamp(18px, 1.7vw, 22px); line-height: 1.5; max-width: 30em; margin: 24px 0 0; }
.cx-index { display: block; font-weight: 600; font-size: 13px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--stone); margin-bottom: 14px; }
.cx-note { max-width: 46em; margin: 28px 0 0; color: var(--slate); }

.cx-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 3px;
}
.cx-arrow::after { content: "→"; display: inline-block; transition: transform 0.25s ease; }
a:hover > .cx-arrow::after, .cx-arrow:hover::after { transform: translateX(5px); }

/* Rules that carry a border line up with the page content, not the padded container */
.cx-hero__trades, .cx-stage { padding-left: 0; padding-right: 0; width: min(calc(var(--max) - 2 * var(--gutter)), calc(100% - 2 * var(--gutter))); }

/* ---------- Hero ---------- */

.cx-hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(48px, 7vw, 96px) 0 0; }
.cx-hero__photo, .cx-band__photo {
  position: absolute; left: 0; width: 100%; height: 118%; top: -9%;
  object-fit: cover; z-index: -2;
  transform: translate3d(0, calc(var(--bp, 0) * var(--par, 0.16) * -120px), 0);
}
.cx-hero__photo { opacity: 0.85; }
.cx-hero__veil { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.7) 45%, rgba(10,10,10,0.25) 100%); }
.cx-hero__grid { display: grid; grid-template-columns: minmax(0, 5.4fr) minmax(0, 6.6fr); gap: clamp(24px, 3.5vw, 56px); align-items: center; padding-bottom: clamp(40px, 6vw, 72px); }
.cx-hero .eyebrow { color: var(--stone); }
.cx-hero .cx-lead { color: #D4D4D4; }


.cx-hero__trades { display: grid; margin-left: auto; margin-right: auto; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255,255,255,0.2); padding: 0; }
.cx-hero__trades li + li { border-left: 1px solid rgba(255,255,255,0.2); }
.cx-hero__trades a { display: flex; gap: 14px; align-items: baseline; padding: 20px 20px; text-decoration: none; font-weight: 600; font-size: 15px; transition: background 0.2s ease, color 0.2s ease; }
.cx-hero__trades a span { color: var(--stone); font-size: 13px; letter-spacing: 1.6px; }
.cx-hero__trades a:hover, .cx-hero__trades a:focus-visible { background: var(--paper); color: var(--ink); }
.cx-hero__trades a:hover span { color: var(--slate); }

/* Device mockups are the Portfolio's (.device-stage in styles.css, behaviour in main.js); only placement is set here */
.cx-hero__stage { min-width: 0; transform: translate3d(0, calc(var(--sy, 0) * var(--depth, 0) * 1px), 0); }
.cx-hero__stage .device-stage { margin: 0; }

/* ---------- Who we build for ---------- */

.cx-who { padding-bottom: 0; }
.cx-ticker { display: flex; overflow: hidden; margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.cx-ticker__row { display: flex; flex: none; min-width: 100%; align-items: center; justify-content: space-around; gap: 0; animation: cx-ticker 48s linear infinite; }
.cx-ticker:hover .cx-ticker__row { animation-play-state: paused; }
.cx-ticker__row li { padding: 22px 32px; white-space: nowrap; font-family: var(--font-display); font-weight: 600; font-size: clamp(18px, 2vw, 26px); letter-spacing: -0.01em; }
.cx-ticker__row li::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 64px; background: var(--ink); vertical-align: middle; }
@keyframes cx-ticker { to { transform: translateX(-100%); } }

/* ---------- Four jobs ---------- */

.cx-jobs__grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--ink); }
.cx-jobs__grid li { position: relative; padding: 32px 28px 40px 0; display: flex; flex-direction: column; }
.cx-jobs__grid li + li { border-left: 1px solid var(--hairline); padding-left: 28px; }
.cx-jobs__grid svg { width: 48px; height: 48px; margin-bottom: 36px; }
.cx-jobs__grid p { color: var(--slate); margin: 10px 0 0; max-width: 18em; transition: color 0.25s ease; }
/* Hover only draws an ink rule along the top and darkens the line of text: nothing moves, nothing changes size. */
.cx-jobs__grid li::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.4s cubic-bezier(.2,.7,.2,1); }
.cx-jobs__grid li:hover::before, .cx-jobs__grid li:focus-within::before { transform: scaleX(1); }
.cx-jobs__grid li:hover p { color: var(--ink); }

/* ---------- Showcase ---------- */

.cx-work { padding-bottom: 0; }
.cx-stage { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 80px); align-items: center; padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(56px, 8vw, 112px); border-bottom: 1px solid var(--hairline); }
.cx-stage--flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.cx-stage--flip .cx-stage__info { order: 2; }
.cx-stage__info p { color: var(--slate); margin: 18px 0 0; max-width: 24em; }
.cx-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 32px; }
.cx-tags li { border: 1px solid var(--ink); padding: 6px 12px; font-size: 13px; font-weight: 600; }

/* The first showcase stage sits under the section intro on an ink rule */
.cx-work > .cx-stage:first-of-type { margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--ink); }
.cx-stage__visual { min-width: 0; }

/* ---------- Photo statement ---------- */

.cx-band { position: relative; overflow: hidden; isolation: isolate; min-height: clamp(360px, 62vh, 640px); display: flex; align-items: flex-end; color: var(--paper); }
.cx-band__veil { position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10,10,10,0.78), rgba(10,10,10,0.15) 70%); }
.cx-band__text { margin: 0 auto; padding-bottom: clamp(32px, 6vw, 72px); font-family: var(--font-display); font-weight: 700; font-size: clamp(48px, 9vw, 140px); line-height: 0.95; letter-spacing: -0.03em; }

/* ---------- Client projects ---------- */

.cx-clients { padding-top: clamp(64px, 9vw, 120px); padding-bottom: clamp(64px, 9vw, 120px); }
.cx-clients__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); margin-top: clamp(28px, 4vw, 48px); }
.cx-client { display: flex; flex-direction: column; align-items: flex-start; text-decoration: none; }
.cx-client__img { display: block; overflow: hidden; width: 100%; aspect-ratio: 3 / 2; margin-bottom: 24px; border: 1px solid var(--hairline); background: var(--mist); }
.cx-client__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(.2,.7,.2,1); }
.cx-client:hover .cx-client__img img { transform: scale(1.04); }
.cx-client .cx-index { margin-bottom: 8px; }
.cx-client__line { color: var(--slate); margin: 12px 0 20px; max-width: 30em; }

/* ---------- Process ---------- */

.cx-steps { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 4vw, 56px); margin: clamp(40px, 6vw, 72px) 0 40px; padding-top: 36px; }
.cx-steps::before, .cx-steps::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; }
.cx-steps::before { background: var(--hairline); }
.cx-steps::after { background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.cx-steps.is-in::after { transform: scaleX(1); }
.cx-steps p { color: var(--slate); margin: 10px 0 0; max-width: 18em; }

/* ---------- Where we work ---------- */

.cx-where__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.cx-where .eyebrow { color: var(--stone); }
/* The homepage logo drawing, unchanged (markup and .dw-* styles are the homepage's); it only waits until it is on screen to begin */
.cx-where__drawing { width: 100%; max-width: 520px; margin: 0; justify-self: center; }
.cx-js .cx-where__drawing:not(.is-in) * { animation-play-state: paused; }
.cx-places { margin-top: clamp(28px, 4vw, 48px); border-top: 1px solid rgba(255,255,255,0.25); }
.cx-places li { display: grid; grid-template-columns: minmax(0, 16em) 1fr; gap: 20px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,0.25); }
.cx-places strong { font-family: var(--font-display); font-size: clamp(24px, 3vw, 38px); letter-spacing: -0.02em; }
.cx-places span { color: #D4D4D4; }
.cx-places + .muted { margin-top: 28px; color: #D4D4D4; }
/* Communities served: a plain line of names, nothing else */
.cx-area { display: flex; flex-wrap: wrap; gap: 6px clamp(20px, 3.4vw, 52px); margin-top: clamp(28px, 4vw, 48px); padding: clamp(20px, 3vw, 32px) 0; border-top: 1px solid rgba(255,255,255,0.25); border-bottom: 1px solid rgba(255,255,255,0.25); font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 4vw, 52px); letter-spacing: -0.02em; line-height: 1.15; }
.cx-area + .muted { margin-top: 28px; color: #D4D4D4; }
.cx-proof { align-self: center; }
.cx-proof .muted { margin: 20px 0 16px; max-width: 34em; }

/* ---------- FAQ ---------- */

.cx-faq { margin-top: clamp(28px, 4vw, 48px); border-top: 1px solid var(--ink); }
.cx-faq details { border-bottom: 1px solid var(--hairline); }
.cx-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 2vw, 26px); letter-spacing: -0.01em; }
.cx-faq summary::-webkit-details-marker { display: none; }
.cx-faq summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat; transition: transform 0.25s ease; }
.cx-faq details[open] summary::after { transform: rotate(45deg); }
.cx-faq summary:hover { color: var(--slate); }
.cx-faq details p { max-width: 44em; color: var(--slate); padding: 0 0 28px; margin: 0; }
.cx-faq__more { margin-top: 28px; }

/* ---------- Closing call to action ---------- */

.cx-cta { position: relative; overflow: hidden; isolation: isolate; padding: clamp(96px, 14vw, 200px) 0; }
.cx-cta .cx-band__veil { background: rgba(10,10,10,0.62); }
.cx-credits { margin: 0 auto; padding: 20px var(--gutter) 28px; font-size: 13px; color: var(--stone); max-width: var(--max); }

/* ---------- Motion (only when the script runs and motion is allowed) ---------- */

.cx-js [data-reveal], .cx-js .cx-in { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity 0.8s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--d, 0) * 90ms); }
.cx-js [data-reveal].is-in, .cx-js .cx-in.is-in { opacity: 1; transform: none; }
[data-d="1"] { --d: 1; } [data-d="2"] { --d: 2; } [data-d="3"] { --d: 3; }
.cx-js .cx-hero .cx-in:nth-child(2) { --d: 1; } .cx-js .cx-hero .cx-in:nth-child(3) { --d: 2; } .cx-js .cx-hero .cx-in:nth-child(4) { --d: 3; }

@media (max-width: 960px) {
  .cx-hero__grid, .cx-where__grid, .cx-stage, .cx-stage--flip { grid-template-columns: 1fr; }
  .cx-stage--flip .cx-stage__info { order: 0; }
  .cx-hero__veil { background: linear-gradient(180deg, rgba(10,10,10,0.9), rgba(10,10,10,0.55)); }
  .cx-hero__trades { grid-template-columns: 1fr 1fr; }
  .cx-hero__trades li:nth-child(3) { border-left: 0; }
  .cx-hero__trades li:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.2); }
  .cx-jobs__grid { grid-template-columns: 1fr 1fr; }
  .cx-jobs__grid li:nth-child(3) { border-left: 0; padding-left: 0; }
  .cx-jobs__grid li:nth-child(n+3) { border-top: 1px solid var(--hairline); }
}
@media (max-width: 640px) {
  .cx-clients__grid, .cx-steps { grid-template-columns: 1fr; }
  .cx-jobs__grid { grid-template-columns: 1fr; }
  .cx-jobs__grid li, .cx-jobs__grid li + li, .cx-jobs__grid li:nth-child(3) { border-left: 0; padding-left: 0; }
  .cx-jobs__grid li + li { border-top: 1px solid var(--hairline); }
  .cx-places li { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-ticker { overflow-x: auto; }
  .cx-ticker__row { animation: none; }
  .cx-ticker__row[aria-hidden="true"] { display: none; }
  .cx-hero__stage, .cx-hero__photo, .cx-band__photo { transform: none; }
  .cx-client__img img, .cx-arrow::after { transition: none; }
}
