/* ==========================================================================
   Website case study: Divine Infrastructure, built floor by floor by the scroll.
   The old site sits in a browser while the brief is read; each step of the
   process is a floor of the new site rising over it; then the finished screen
   settles into the laptop it was shot on. Driven by st-divine.js on st-core.
   ========================================================================== */
.dv-reel .st-reel__stage { background: var(--bg); }
.dv-grid { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(40px, 5vw, 88px); padding-top: var(--nav-h); padding-bottom: 32px; }

/* the copy: the brief and the process share one place and hand over to each other */
.dv-copy { display: grid; align-items: center; }
.dv-panel { grid-area: 1 / 1; display: grid; gap: 18px; align-content: center; }
.dv-panel .meta { margin: 0; }
.dv-say { margin: 0; font: 400 clamp(1.7rem, 1.1rem + 1.5vw, 2.6rem)/1.15 var(--f-text); letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.dv-say span { transition: opacity 0.2s linear; }
.dv-body { margin: 0; max-width: 34em; font-size: 16px; line-height: 1.6; color: var(--text-2); }

/* what the site had to do: each point is ticked as it's read */
.dv-need { display: grid; gap: 10px; margin: 4px 0 0; padding: 0; list-style: none; }
.dv-need li { position: relative; padding-left: 30px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.dv-need li::before { content: ""; position: absolute; left: 0; top: 0.1em; width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 50%; transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out); }
.dv-need li::after { content: ""; position: absolute; left: 6px; top: calc(0.1em + 5px); width: 6px; height: 3px; border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(-45deg) scale(0); transition: transform 0.3s var(--ease-out); }
.dv-need li.is-on::before { background: var(--ink); border-color: var(--ink); }
.dv-need li.is-on::after { transform: rotate(-45deg) scale(1); }

/* the steps: the one being built is read in full, the rest wait */
.dv-steps { display: grid; gap: 12px; margin: 4px 0 0; padding: 0; list-style: none; counter-reset: dv; }
.dv-steps li { position: relative; padding-left: 44px; font-size: 15px; line-height: 1.45; color: var(--text-2); counter-increment: dv; transition: opacity 0.35s var(--ease-out); }
.dv-steps li::before { content: counter(dv, decimal-leading-zero); position: absolute; left: 0; top: 0.15em; font: 500 12px/1.2 var(--f-text); letter-spacing: 0.2em; color: var(--text-3); }
.dv-steps b { display: block; font-weight: 500; color: var(--ink); }
.dv-steps li.is-on::before { color: var(--ink); }

/* the browser: the old site, and the new one rising over it a floor at a time */
.dv-browser { position: relative; z-index: 2; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 40px 80px -40px rgba(0, 0, 26, 0.45); transform-origin: 0 0; will-change: transform; }
.dv-bar { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #fbfbff; }
.dv-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(0, 0, 26, 0.14); }
.dv-bar span { margin-inline: auto; padding: 4px 14px; border-radius: 999px; background: rgba(0, 0, 26, 0.05); font-size: 12px; line-height: 1.2; color: var(--text-2); transform: translateX(-20px); }
.dv-screen { position: relative; aspect-ratio: 1600 / 1000; overflow: hidden; background: var(--tile); }
.dv-shot { position: absolute; inset: 0; margin: 0; }
.dv-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dv-shot--after { clip-path: inset(var(--top, 100%) 0 0 0); }
.dv-tag { position: absolute; bottom: 14px; padding: 7px 12px; background: rgba(255, 255, 255, 0.92); font-size: 12px; line-height: 1; color: var(--ink); }
.dv-shot--before .dv-tag { left: 14px; }
.dv-shot--after .dv-tag { right: 14px; }
/* the building line: where the new floor meets the old site, named for the step being built */
.dv-floor { position: absolute; left: 0; right: 0; top: var(--top, 100%); height: 0; border-top: 1px solid #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 26, 0.4); opacity: 0; pointer-events: none; }
.dv-floor__label { position: absolute; right: 14px; bottom: 8px; padding: 6px 10px; background: var(--ink); color: #fff; font: 500 11px/1 var(--f-text); letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; }

/* the laptop the finished site was shot on, behind it all until the match cut */
.dv-site { z-index: 1; opacity: 0; visibility: hidden; }
.dv-hint { position: absolute; z-index: 3; left: 50%; bottom: 24px; margin: 0; transform: translateX(-50%); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.9); opacity: 0; pointer-events: none; }

.dv-row .dv-still { display: none; }

/* the output and the impact */
.dv-head { display: grid; gap: 18px; max-width: 46em; margin-bottom: clamp(40px, 4vw, 64px); }
.dv-head .meta, .dv-head .h2 { margin: 0; }
.dv-wins { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.dv-wins li { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: baseline; padding: 26px 0; border-bottom: 1px solid var(--line); font: 400 clamp(1.3rem, 1rem + 1vw, 2rem)/1.25 var(--f-text); letter-spacing: -0.015em; color: var(--ink); }
.dv-wins li span { font: 500 12px/1 var(--f-text); letter-spacing: 0.2em; color: var(--text-3); }
.dv-short { display: grid; gap: 12px; max-width: 40em; margin: clamp(48px, 5vw, 72px) 0 0; font-size: 18px; line-height: 1.55; color: var(--ink); }

/* without the pinned motion (small screens, reduced motion): the brief, the old site, the steps, the new site, one after another */
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .dv-grid { position: static; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 24px var(--sect-pad); }
  .dv-copy { display: grid; gap: 56px; }
  .dv-panel { grid-area: auto; }
  .dv-need li::before { background: var(--ink); border-color: var(--ink); }
  .dv-need li::after { transform: rotate(-45deg) scale(1); }
  .dv-browser { transform: none !important; }
  .dv-screen { aspect-ratio: auto; display: grid; gap: 1px; background: var(--line); }
  .dv-shot { position: relative; }
  .dv-shot img { height: auto; }
  .dv-site { display: none; }
  .dv-row .dv-still { display: block; }
  .dv-wins li { grid-template-columns: 44px minmax(0, 1fr); padding: 20px 0; }
}

/* scroll section heights, so they are in place before st-divine.js runs (same numbers as its reel() calls) */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .dv-reel { height: 700vh; }
}
