/* Design Build page only (design-build.html). Loaded after styles.css, shared.css and services.css. */

/* ---------- Intro: the H2 statement lights up word by word as you scroll (js/design-build.js) ---------- */
.db-intro .eyebrow { margin-bottom: 20px; }
.db-words { max-width: 1500px; line-height: 1.2; }
.db-intro { padding-bottom: 0; }
.db-divider { height: 1px; background: var(--accent); margin-top: var(--section-y); } /* full section width, inside the page gutters */
.db-words .w { opacity: .18; transition: opacity .4s var(--ease); }
.db-words .w.is-lit { opacity: 1; }

/* ---------- What's Included: one photo tile with its text over the image, four equal tiles beside it ---------- */
.db-incl { padding-top: var(--section-y); }
.db-incl__lead { max-width: 640px; margin-top: 20px; }
.db-incl__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.db-incl__tiles { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: var(--gap); }
.bt {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  padding: calc(var(--gap) * 2);
  background: var(--bg); color: var(--secondary); border: 1px solid var(--accent);
  transition: background-color .5s var(--ease), color .5s var(--ease), opacity .9s var(--ease), transform .9s var(--ease); /* opacity + transform keep the .reveal fade-in */
}
.bt:hover { background: var(--secondary); color: var(--white); }
.bt h4 { margin-bottom: 10px; }
.bt p { opacity: .88; }
.bt--photo { min-height: clamp(460px, 42vw, 660px); color: var(--white); background: var(--secondary); justify-content: flex-end; }
.bt--photo:hover { background: var(--secondary); }
.bt--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.bt--photo:hover img { transform: scale(1.06); }
.bt--photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(20, 17, 18, .1) 30%, rgba(20, 17, 18, .82)); }
.bt--photo .label { color: var(--white); }
.bt__body { position: relative; z-index: 1; }
.bt__body h3 { margin: 10px 0 14px; }
.bt__body p { max-width: 460px; }
@media (max-width: 1000px) {
  .db-incl__grid { grid-template-columns: 1fr; }
  .bt--photo { min-height: clamp(320px, 52vw, 460px); }
}
@media (max-width: 600px) {
  .db-incl__tiles { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: 1fr; } /* all four tiles the same height (the tallest one's) */
}

/* ---------- How We Work: the photo stays put and changes with the step in view; the button stays level with the bottom of the photo ---------- */
.db-flow { --stage-h: min(calc(100svh - 112px - var(--gap)), 720px); background: var(--secondary); color: var(--white); }
.db-flow__grid { display: grid; grid-template-columns: 5fr 6fr; column-gap: clamp(32px, 6vw, 112px); align-items: start; }
.db-flow__sticky { /* spans both columns and sticks as one piece: photo on the left, button at the bottom of the right column */
  grid-column: 1 / -1; grid-row: 1; align-self: start; z-index: 2;
  position: sticky; top: 112px; height: var(--stage-h);
  display: grid; grid-template-columns: 5fr 6fr; column-gap: clamp(32px, 6vw, 112px);
  pointer-events: none;
}
.db-flow__stage { position: relative; height: 100%; overflow: hidden; }
.db-flow__photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.05); transition: opacity .8s var(--ease), transform 1.6s var(--ease); }
.db-flow__photos img.is-active { opacity: 1; transform: none; }
.db-flow__stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 60%, rgba(20, 17, 18, .7)); }
.db-flow__count { position: absolute; left: calc(var(--gap) * 2); bottom: calc(var(--gap) * 2); z-index: 1; color: var(--white); }
.db-flow__cta { align-self: end; justify-self: start; pointer-events: auto; }
.db-flow__cta-m { display: none; }
.db-flow__steps { grid-column: 2; grid-row: 1; }
.db-step {
  min-height: 62svh; display: flex; flex-direction: column; justify-content: center;
  padding-block: calc(var(--gap) * 3); border-top: 1px solid rgba(255, 255, 255, .14);
  opacity: .3; transition: opacity .6s var(--ease);
}
.db-step:first-child { border-top: 0; }
.db-step.is-active { opacity: 1; }
.db-step__num { /* same big faded number as the Our Process steps (84px is the one sanctioned exception to the size scale); the step name overlaps its bottom */
  display: block; font-family: var(--font-head); font-size: 84px;
  position: relative; top: -8px; line-height: 1;
  color: var(--white); opacity: .08;
  transition: opacity .5s var(--ease), color .5s var(--ease);
}
.db-step.is-active .db-step__num { color: var(--accent); opacity: .3; }
.db-step h3 { margin-top: calc(84px * -.42); position: relative; }
.db-step p { margin-top: 20px; max-width: 560px; opacity: .88; }
@media (max-width: 900px) {
  .db-flow__grid { grid-template-columns: 1fr; }
  .db-flow__sticky { grid-column: 1; top: 78px; height: 34svh; display: block; margin-bottom: var(--gap); } /* the photo pins under the header while the steps scroll beneath it */
  .db-flow__cta { display: none; }
  .db-flow__cta-m { display: flex; }
  .db-flow__steps { grid-column: 1; grid-row: 2; }
  .db-step { min-height: 46svh; }
}

@media (prefers-reduced-motion: reduce) {
  .db-words .w { transition: none; }
  .bt, .bt--photo img, .db-flow__photos img, .db-step, .db-step__num { transition: none; }
}

/* How We Work photos: keep each subject inside the tall frame */
.db-flow__photos img:nth-child(1) { object-position: 50% 35%; }
.db-flow__photos img:nth-child(2) { object-position: 50% 40%; }
.db-flow__photos img:nth-child(6) { object-position: 50% 70%; }
