/* The building-project story. Shared look from ../../site.css; amber, the building line's colour.
   A picture first, then the stages as a vertical line. Colours come from the shared tokens. */

/* ---------- the first screen: the sentence and the before-and-after ---------- */
.story-hero { margin-top: 20px; }
.hero-in { background: var(--tint); border-radius: var(--radius); padding: clamp(24px, 4vw, 52px);
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(20px, 3vw, 44px); align-items: center; }
.story-hero h1 { font-size: clamp(34px, 4.6vw, 58px); margin-top: 16px; }
.lead { margin-top: 14px; font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 34ch; }
.story-hero .site-note { margin-top: 16px; }
.before-after { margin: 0; }
.before-after svg { width: 100%; height: auto; display: block; }
.before-after .ground { stroke: color-mix(in srgb, var(--build-ink) 40%, transparent); stroke-width: 2; }
.before-after .roof { fill: var(--build); }
.before-after .wall { fill: var(--surface); stroke: var(--build-ink); stroke-width: 2.5; }
.before-after .win { fill: color-mix(in srgb, var(--build) 30%, var(--surface)); stroke: var(--build-ink); stroke-width: 2; }
.before-after .door { fill: var(--build-ink); }
.before-after .unit { fill: color-mix(in srgb, var(--build) 22%, var(--surface)); }
.before-after .divide { stroke: var(--build-ink); stroke-width: 2; stroke-dasharray: 5 4; }
.before-after .arrow { fill: none; stroke: var(--ink-2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.before-after text { font-family: var(--sans); fill: var(--ink-2); }
.before-after .cap { font-size: 15px; font-weight: 650; fill: var(--ink); }
.before-after .tag { font-size: 12.5px; font-weight: 600; fill: var(--build-ink); }

@media (prefers-reduced-motion: no-preference) {
  .before-after .new { transform-box: fill-box; transform-origin: 50% 100%; animation: rise-up .7s cubic-bezier(.2, .8, .2, 1) both; }
  .before-after .adu { animation-delay: .35s; }
  @keyframes rise-up { from { transform: scaleY(.15); } to { transform: none; } }
}

/* ---------- the stages, as a vertical line ---------- */
.steps { margin-top: 40px; }
.stages { list-style: none; margin: 0 auto; padding: 0; max-width: 980px; position: relative; }
.stages::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 3px; border-radius: 2px;
  background: linear-gradient(var(--build) 0 30%, var(--bad) 45% 100%); }
.stage { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 4px 22px; padding: 0 0 26px; align-items: start; }
.stage:last-child { padding-bottom: 0; }
.pin { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 3px solid var(--build); color: var(--build-ink);
  display: grid; place-items: center; font-size: 20px; position: relative; z-index: 1; }
.bad .pin { border-color: var(--bad); color: var(--bad); }
.bad .pin::after { content: "!"; position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bad); color: var(--surface); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.said { padding-top: 8px; }
.said h3 { font-size: 22px; }
.said p { margin-top: 6px; color: var(--ink-2); font-size: 16.5px; }
.keep { margin-top: 4px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px; font-size: 15px; }
.keep b { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--build-ink); margin-bottom: 4px; }
.bad .keep b { color: var(--bad); }
/* a link chip sits in the line of text without making that line taller than the others */
.keep { line-height: 1.6; }
.keep .chip { margin-block: 1px; padding-top: 2px; padding-bottom: 2px; line-height: 1.4; vertical-align: 1px; }

/* ---------- the end ---------- */
.lesson { margin-top: 48px; text-align: center; }
.lesson h2 { font-size: clamp(28px, 3.4vw, 40px); }
.lesson p { margin-top: 10px; color: var(--ink-2); }
.lesson .go { justify-content: center; }

/* ---------- smaller screens ---------- */
@media (max-width: 860px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .stage { grid-template-columns: 44px minmax(0, 1fr); }
  .keep { grid-column: 2; }
}
@media (max-width: 600px) {
  .story-hero { margin-top: 12px; }
  .hero-in { padding: 22px 16px; border-radius: 22px; gap: 16px; }
  .story-hero h1 { margin-top: 12px; }
  .lead { margin-top: 10px; }
  .steps { margin-top: 28px; }
  .stage { gap: 4px 14px; }
  .said h3 { font-size: 19px; }
  .said p { font-size: 15.5px; }
}
@media print {
  .hero-in { background: none; padding: 0; }
  .keep { box-shadow: none; border: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .before-after .cap { font-size: 21px; }
  .before-after .tag { font-size: 18px; }
}
