/* ==========================================================================
   Services page (v3): a pinned showcase that deals service cards off a deck
   (scroll or tabs), related projects either side, then "How I work".
   ========================================================================== */

/* ---------- Showcase ---------- */
.svc {
  min-height: calc(100svh - var(--gap) * 2);
  display: grid; grid-template-rows: 1fr auto; align-items: center;
  padding: 110px var(--pad) 28px;
  background-image: radial-gradient(rgba(20, 19, 28, 0.16) 1px, transparent 1.6px);
  background-size: 28px 28px;
}
.svc-blueprint { position: absolute; left: 50%; top: 58%; width: min(640px, 80%); transform: translateX(-50%); pointer-events: none; overflow: visible; }
.svc-blueprint .bp-links path { fill: none; stroke: rgba(20, 19, 28, 0.22); stroke-width: 1.2; }
.svc-blueprint .bp-boxes rect { fill: rgba(255, 255, 255, 0.6); stroke: rgba(20, 19, 28, 0.25); stroke-width: 1.2; }
.svc-blueprint .bp-dots circle { fill: #fff; stroke: rgba(20, 19, 28, 0.4); stroke-width: 1; }

.svc-stage { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px) minmax(0, 1fr); align-items: center; gap: clamp(20px, 3vw, 60px); }
.svc-side { position: relative; height: 340px; }
.svc-side .ptile { --tw: clamp(150px, 13vw, 210px); position: absolute; top: 0; opacity: 0; pointer-events: none; transform: translateY(30px) rotate(var(--rot, -3deg)); transition: opacity 0.6s var(--ease), transform 0.9s var(--ease); }
.svc-left .ptile { left: 0; --rot: -3deg; }
.svc-right .ptile { right: 0; top: 30px; --rot: 3deg; }
.svc-side .ptile.is-on { opacity: 1; pointer-events: auto; transform: none; }

.svc-deck { position: relative; height: clamp(440px, 52vh, 500px); }
.svc-card {
  position: absolute; inset: 0;
  background: #fff; border-radius: var(--r-md);
  padding: clamp(24px, 2.6vw, 36px);
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 30px 60px -34px rgba(20, 19, 28, 0.45), 0 2px 0 rgba(20, 19, 28, 0.04);
  transition: transform 0.9s var(--ease), opacity 0.6s var(--ease);
  will-change: transform;
}
.svc-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.svc-n { font-size: 14px; font-weight: 600; color: var(--accent); }
.svc-ico { width: clamp(110px, 10vw, 150px); height: auto; margin: -18px -10px -24px 0; filter: drop-shadow(0 18px 20px rgba(0, 0, 255, 0.18)); }
.svc-name { font-size: clamp(28px, 2.8vw, 40px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.02; }
.svc-text { color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.svc-tags { margin-top: 2px; }
.svc-card .tag { background: var(--mist); }
.svc-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.svc-foot .pill { height: 46px; }
.svc-rel { font-size: 13px; color: var(--ink-3); }
.svc-rel a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.svc-rel a:hover { color: var(--accent); }

/* deck states, driven by --k on .svc-deck from JS */
.svc-card[data-state="gone"] { transform: translate(-30%, -115%) rotate(-12deg); opacity: 0; pointer-events: none; }
.svc-card[data-state="top"] { transform: none; opacity: 1; z-index: 5; }
.svc-card[data-state="b1"] { transform: translate(14px, 14px) rotate(2.5deg) scale(0.97); z-index: 4; }
.svc-card[data-state="b2"] { transform: translate(-10px, 26px) rotate(-2deg) scale(0.94); z-index: 3; }
.svc-card[data-state="b3"] { transform: translate(6px, 36px) rotate(1.5deg) scale(0.91); z-index: 2; }
.svc-card[data-state^="b"] { pointer-events: none; }
.svc-card[data-state^="b"] > * { opacity: 0.25; transition: opacity 0.4s; }

.svc-tabs {
  position: relative; z-index: 3; justify-self: center; margin-top: 26px;
  display: flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: #fff; box-shadow: 0 10px 30px -16px rgba(20, 19, 28, 0.35), inset 0 0 0 1px rgba(20, 19, 28, 0.06);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.svc-tabs::-webkit-scrollbar { display: none; }
.svc-tab { height: 40px; padding: 0 18px; border-radius: 999px; font-size: 15px; white-space: nowrap; transition: background-color 0.3s, color 0.3s; }
.svc-tab:hover { background: var(--mist); }
.svc-tab.is-on { background: var(--accent); color: #fff; }

@media (max-width: 1000px) {
  .svc-stage { grid-template-columns: 1fr; }
  .svc-side { display: none; }
  .svc-deck { max-width: 560px; width: 100%; margin: 0 auto; }
}
@media (max-width: 760px) {
  .svc { padding-top: 96px; }
  .svc-blueprint { top: auto; bottom: 90px; width: 90%; }
  .svc-deck { height: auto; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--pad) * -1); padding: 10px var(--pad) 24px; scrollbar-width: none; }
  .svc-deck::-webkit-scrollbar { display: none; }
  .svc-card, .svc-card[data-state] { position: relative; inset: auto; flex: 0 0 86%; transform: none; opacity: 1; pointer-events: auto; scroll-snap-align: center; min-height: 470px; }
  .svc-card[data-state^="b"] > * { opacity: 1; }
  .svc-ico { width: 96px; }
  .svc-tabs { justify-self: stretch; }
}

/* ---------- How I work ---------- */
.how { min-height: calc(100svh - var(--gap) * 2); padding: clamp(80px, 8vw, 100px) var(--pad) clamp(30px, 4vw, 60px); display: flex; flex-direction: column; }
.how .mega { font-size: clamp(48px, 8vw, 128px); }
.how-row { position: relative; flex: 1; display: flex; justify-content: center; align-items: center; margin-top: clamp(24px, 3vw, 44px); min-height: 380px; }
.hcard {
  position: relative; width: clamp(220px, 19vw, 280px); aspect-ratio: 3 / 4; flex: none;
  background: #fff; color: var(--ink); border-radius: var(--r-md);
  padding: 22px; display: flex; flex-direction: column;
  box-shadow: -18px 20px 50px -30px rgba(0, 0, 0, 0.8);
  margin-left: -26px; transform-origin: 50% 100%;
}
.hcard:first-child { margin-left: 0; }
.hcard:nth-child(2) { background: #ececf1; }
.hcard:nth-child(3) { background: #e2e2e9; }
.hcard:nth-child(4) { background: #d8d8e0; }
.hcard-n { font-size: clamp(34px, 3vw, 46px); font-weight: 600; letter-spacing: -0.04em; color: var(--accent); line-height: 1; }
.hcard-art { width: 70%; align-self: center; margin: auto 0; }
.hcard-art * { fill: none; stroke: rgba(20, 19, 28, 0.28); stroke-width: 1.4; }
.hcard h3 { font-size: clamp(20px, 1.7vw, 24px); font-weight: 600; letter-spacing: -0.03em; }
.hcard p { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-top: 6px; }
@media (max-width: 900px) {
  .how-row { flex-direction: column; gap: 12px; min-height: 0; }
  .hcard { width: 100%; aspect-ratio: auto; min-height: 220px; margin-left: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: 6px 16px; }
  .hcard-n { grid-row: 1 / 3; }
  .hcard-art { position: absolute; right: 14px; bottom: 14px; width: 64px; margin: 0; opacity: 0.55; }
  .hcard h3 { align-self: end; }
  .hcard p { padding-right: 56px; }
}
