/* ==========================================================================
   Project details (phone variant default, laptop variant via ?device=laptop)
   ========================================================================== */
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

.proj { position: relative; overflow: hidden; background: #dae0ef; }
.proj-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.proj-bg img { position: absolute; left: 50%; width: 1600px; height: 900px; margin-left: -800px; max-width: none; object-fit: cover; }
.proj-bg img.flip { transform: scaleY(-1); }

/* ---------- hero (1440 canvas, scaled with --hs like Home) ---------- */
.proj-hero { position: relative; z-index: 1; height: calc(925px * var(--hs, 1)); }
.proj-hero__stage {
  position: absolute; left: 50%; top: 0; width: 1440px; height: 925px; margin-left: -720px;
  transform: scale(var(--hs, 1)); transform-origin: 50% 0;
}
.proj-hero__stage .crumb { position: absolute; left: 80px; top: 140px; }

.proj-hero__brand { position: absolute; left: 80px; top: 218px; width: 256px; height: 167px; margin: 0; font-weight: 800; white-space: nowrap; }
.proj-hero__name { position: absolute; left: 19px; top: -12px; display: block; font-size: 70px; line-height: 105px; font-weight: 800; color: var(--c-ink); }
.proj-hero__name b { color: var(--c-blue); font-weight: 800; }
.proj-hero__tag {
  position: absolute; left: 0; top: 78px; display: block; font-family: var(--f-ui); font-size: 50px; line-height: 102px; font-weight: 800;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* device mockups */
.device { position: absolute; left: 50%; z-index: 2; transform: perspective(1100px) rotateY(calc(var(--tx, 0) * 7deg)) rotateX(calc(var(--ty, 0) * -4deg)); transition: transform 0.6s var(--ease-out); }
.device[hidden] { display: none; }
.device__float { position: relative; width: 100%; height: 100%; animation: bob 7s ease-in-out 1.6s infinite; }
.device img { position: absolute; max-width: none; user-select: none; }
.device--phone { top: 186px; width: 216.5px; height: 459px; margin-left: -108.25px; }
.device--phone .device__float { filter: drop-shadow(0 47.757px 26.532px rgba(26, 34, 43, 0.22)); }
.device--phone .device__screen { left: 5.62%; top: 2.32%; width: 89.17%; height: 95.36%; object-fit: cover; clip-path: url(#phoneScreenClip); }
.device--phone .device__frame { left: 0; top: 0; width: 100%; height: 100%; }
.device--laptop { top: 260px; width: 572.8px; height: 358px; margin-left: -286.4px; }
.device--laptop .device__float { filter: drop-shadow(0 40px 30px rgba(26, 34, 43, 0.2)); }
.device--laptop .device__screen { left: 67px; top: 21.4px; width: 436px; height: 270.8px; object-fit: cover; }
.device--laptop .device__frame { width: 106.84%; height: 170.94%; left: -3.53%; top: -35.3%; }

/* call-to-action rows: button + a line that runs off to the right edge */
.proj-cta { position: absolute; display: flex; align-items: center; gap: 15px; z-index: 3; }
.proj-cta--quote { left: 1151px; top: 795px; }
.proj-cta--view { left: 1097px; top: 867px; gap: 20px; }
.proj-cta__line { position: relative; display: block; width: 600px; height: 1px; background: linear-gradient(90deg, #0c5adb, rgba(12, 90, 219, 0.7)); transform-origin: left center; animation: lineIn 1.4s var(--ease-out) 0.9s both; }
.proj-cta__line::before { content: ""; position: absolute; left: -2px; top: -2.2px; width: 5.33px; height: 5.33px; border-radius: 50%; background: var(--c-blue); }
@keyframes lineIn { from { scale: 0 1; } to { scale: 1 1; } }

/* ---------- overview ---------- */
.proj-overview { position: relative; z-index: 1; width: min(100% - var(--gutter) * 2, 1280px); margin: 40px auto 0; display: flex; flex-direction: column; gap: 40px; }
.proj-overview__lead { gap: 48px; }
.proj-overview__copy { width: 1114px; max-width: 100%; font-size: 18px; line-height: 1.5; letter-spacing: 1.44px; color: var(--c-muted); }
.proj-overview__title {
  font-size: 32px; line-height: 1.2; font-weight: 600; margin-bottom: -24px;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; width: max-content; max-width: 100%;
}
.proj-steps { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.proj-step { display: flex; align-items: flex-start; gap: 16px; }
.proj-step:nth-child(1) > div { width: 299px; }
.proj-step:nth-child(2) > div { width: 342px; }
.proj-step:nth-child(3) { width: 436px; }
.proj-step:nth-child(3) > div { flex: 1; min-width: 0; }
.proj-step__num {
  flex: none; font-size: 100px; line-height: 1; font-weight: 900; opacity: 0.2;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  transition: transform 0.6s var(--ease-out), opacity 0.4s;
}
.proj-step:hover .proj-step__num { transform: translateY(-6px) scale(1.06); opacity: 0.38; }
.proj-step h3 { font-size: 24px; line-height: 1.2; font-weight: 600; color: var(--c-ink); margin-bottom: 7.4px; }
.proj-step p { font-size: 16px; line-height: 1.2; color: var(--c-muted); }

/* ---------- more work ---------- */
.proj-more { position: relative; z-index: 1; width: min(100% - var(--gutter) * 2, 1280px); margin: 108px auto 80px; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.proj-more .work__head { gap: 20px; }
.proj-more .work__tags .tag { background: rgba(255, 255, 255, 0.45); border-color: rgba(221, 221, 221, 0.3); }
.proj-more .work__tags button.tag.is-active { background: var(--grad-brand); border-color: transparent; color: #fff; }
.proj-more .work__grid { width: 100%; margin: 0; }
.proj-more .work__more { margin: 0; }

@media (max-width: 1100px) {
  .proj-more .work__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proj-steps { flex-wrap: wrap; row-gap: 32px; }
}
@media (max-width: 899px) {
  .proj-hero { height: auto; padding: 112px var(--gutter) 40px; }
  .proj-hero__stage { position: relative; left: auto; top: auto; width: 100%; height: auto; margin: 0; transform: none; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
  .proj-hero__stage .crumb { position: relative; left: auto; top: auto; }
  .proj-hero__brand { position: relative; left: auto; top: auto; width: auto; height: auto; }
  .proj-hero__name, .proj-hero__tag { position: static; }
  .proj-hero__name { font-size: 56px; line-height: 1.2; }
  .proj-hero__tag { font-size: 40px; line-height: 1.3; }
  .device { position: relative; left: auto; top: auto; margin: 0 auto; }
  .device--laptop { zoom: 0.6; }
  .proj-cta { position: relative; left: auto; top: auto; }
  .proj-cta__line { display: none; }
  .proj-overview { margin-top: 24px; gap: 28px; }
  .proj-overview__copy { font-size: 16px; letter-spacing: 0.6px; }
  .proj-overview__title { font-size: 26px; margin-bottom: -8px; }
  .proj-steps { flex-direction: column; }
  .proj-step:nth-child(n) { width: 100%; }
  .proj-step:nth-child(n) > div { width: auto; flex: 1; }
  .proj-step__num { font-size: 72px; }
  .proj-more { margin-top: 64px; }
  .proj-more .work__grid { grid-template-columns: 1fr; }
  .title { font-size: clamp(34px, 9vw, 48px); line-height: 1.12; }
  .pcard h3 { font-size: 20px; }
  .lead-row { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* silk background drifts slower than the page (scroll-driven, compositor only) */
@supports (animation-timeline: scroll()) {
  .proj-bg { animation: bgShift linear both; animation-timeline: scroll(root); }
}
@keyframes bgShift { from { translate: 0 0; } to { translate: 0 140px; } }

.proj-overview__media { margin: 0 0 40px; }
.proj-overview__img { display: block; max-width: 100%; height: auto; border-radius: 16px; }
.proj-step__img { display: block; max-width: 72px; height: auto; margin: 0 0 12px; }
