/* =========================================================
   WORK — a deck of playing cards standing in a 3D ring
   ========================================================= */
.deck { position: relative; margin-top: 6px; }
.deck-stage {
  --cw: 236px; --ch: calc(var(--cw) * 1.4); --R: 450px; --step: 60deg;
  position: relative; height: calc(var(--ch) + 150px); perspective: 1600px; perspective-origin: 50% 25%;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
}
.deck-stage.is-drag { cursor: grabbing; }
.deck-floor {
  position: absolute; left: 50%; bottom: 18px; width: min(960px, 96%); height: 130px; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--front-c, #1ABCA5) 30%, transparent), transparent 70%);
  transition: background .8s ease;
}
.deck-ring {
  position: absolute; left: 50%; top: 40px; width: var(--cw); height: var(--ch); margin-left: calc(var(--cw) / -2);
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--R) * -1)) rotateX(-7deg) rotateY(var(--ring, 0deg));
}
.dslot { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(calc(var(--i) * var(--step))) translateZ(var(--R)) rotateY(var(--face, 0deg)); }

/* ---------- the card ---------- */
.dcard {
  position: absolute; inset: 0; padding: 0; border: 0; background: none; color: var(--paper); font: inherit; cursor: pointer;
  transform-style: preserve-3d; transition: transform .6s var(--ease);
}
.dslot.is-front .dcard { transform: translateY(-10px) translateZ(20px); }
.dslot.is-front .dcard:hover { transform: translateY(-22px) translateZ(40px) rotateX(4deg); }
.dcard:focus-visible { outline: none; }
.dcard:focus-visible .dc-front { outline: 3px solid var(--c2); outline-offset: 4px; }

.dc-face { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.dc-front {
  --ang: 0deg;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(120% 75% at 50% 0%, var(--bg1), var(--bg2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 30px 60px -22px rgba(0,0,0,.75);
  filter: brightness(calc(1 - var(--dim, 0) * .5)) saturate(calc(1 - var(--dim, 0) * .3));
  transition: box-shadow .5s ease;
}
/* playing-card inner border */
.dc-front::after { content: ""; position: absolute; inset: 9px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); pointer-events: none; }
/* rotating glow ring */
.dc-front::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: .35; transition: opacity .5s ease;
  background: conic-gradient(from var(--ang), transparent 0deg, var(--c1) 60deg, var(--c2) 110deg, transparent 170deg, transparent 240deg, var(--c3) 300deg, transparent 350deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spinAng 6s linear infinite;
}
.dslot.is-front .dc-front::before { opacity: 1; }
.dslot.is-front .dc-front { box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 0 50px -6px var(--c1), 0 40px 80px -24px rgba(0,0,0,.85); }

/* corner indices */
.dc-idx { position: absolute; top: 16px; left: 16px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 5px; line-height: 1; }
.dc-idx b { font-family: var(--f-display); font-weight: 800; font-variation-settings: "wdth" 80; font-size: 20px; letter-spacing: -0.02em; }
.dc-idx-r { top: auto; left: auto; bottom: 16px; right: 16px; transform: rotate(180deg); }
.dc-suit { width: 18px; height: 18px; color: var(--c1); }
.dc-seven { width: auto; height: auto; font-family: var(--f-display); font-weight: 900; font-size: 18px; line-height: 1; }

/* center art */
.dc-art { position: relative; z-index: 1; width: 64%; height: 50%; margin-top: -14%; display: flex; align-items: center; justify-content: center; }
.art-phone { height: 100%; aspect-ratio: 720 / 1561; padding: 3px; border-radius: 15px; background: #111116; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 18px 30px -12px rgba(0,0,0,.7); transform: rotate(-6deg); transition: transform .6s var(--ease); }
.art-phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 12px; display: block; }
.dslot.is-front .dcard:hover .art-phone { transform: rotate(0deg) scale(1.06); }
.art-pip svg { width: 92%; height: 92%; filter: drop-shadow(0 16px 20px rgba(0,0,0,.45)); animation: pipBob 4.2s ease-in-out infinite; }
.art-seven span, .art-wild span { font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 70; line-height: .8; font-size: calc(var(--cw) * .62); }
.art-seven span { color: var(--c2); text-shadow: 0 0 40px color-mix(in srgb, var(--c2) 55%, transparent); }
.art-wild span { color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.85); }
.ab-sheet { width: 66%; aspect-ratio: 3 / 4; padding: 12px 11px; border-radius: 8px; background: #FBFAF6; display: flex; flex-direction: column; gap: 6px; transform: rotate(-5deg); box-shadow: 0 18px 30px -12px rgba(0,0,0,.6); transition: transform .6s var(--ease); }
.ab-sheet i { display: block; height: 6px; border-radius: 3px; background: #E3DFD4; }
.ab-sheet i:first-child { width: 70%; height: 8px; background: #1A1712; }
.ab-sheet i.s { width: 55%; }
.ab-sheet em { display: block; height: 10px; border-radius: 3px; background: linear-gradient(90deg, #2F4BFF 0 10px, transparent 10px 15px, #E3DFD4 15px); }
.ab-sheet em:nth-of-type(2) { background: linear-gradient(90deg, #16A34A 0 10px, transparent 10px 15px, #E3DFD4 15px); }
.dslot.is-front .dcard:hover .ab-sheet { transform: rotate(0deg) scale(1.06); }

/* Appetizer website: tiny browser with the real hero line */
.as-win { width: 100%; padding-bottom: 10px; border-radius: 10px; overflow: hidden; background: #fff; color: #0F1F1B; display: flex; flex-direction: column; align-items: center; gap: 7px; box-shadow: 0 18px 30px -12px rgba(0,0,0,.6); transform: rotate(-4deg); transition: transform .6s var(--ease); }
.as-bar { align-self: stretch; display: flex; gap: 4px; padding: 6px 8px; background: #EEF2F1; }
.as-bar i { width: 6px; height: 6px; border-radius: 50%; background: #C9D3D1; }
.as-dots { display: flex; gap: 4px; margin-top: 2px; }
.as-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); background: #E9A23B; }
.as-dots i:nth-child(2) { background: #C2185B; } .as-dots i:nth-child(3) { background: #8D6E63; } .as-dots i:nth-child(4) { background: #7CB342; } .as-dots i:nth-child(5) { background: #F2B705; }
.as-h { padding: 0 10px; font-family: 'Geist', var(--f-body); font-weight: 800; font-size: 11.5px; line-height: 1.12; text-align: center; letter-spacing: -0.02em; }
.as-btn { width: 46%; height: 11px; border-radius: 999px; background: #0F766E; }
.dslot.is-front .dcard:hover .as-win { transform: rotate(0deg) scale(1.06); }

.dc-name { position: absolute; left: 0; right: 0; bottom: 34px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.dc-name b { font-family: var(--f-display); font-weight: 800; font-variation-settings: "wdth" 85; font-size: 21px; line-height: 1; text-transform: uppercase; letter-spacing: -0.01em; }
.dc-name small { font-family: var(--f-mono); font-size: 11px; color: rgba(255,255,255,.68); }

/* card back: TC pattern */
.dc-back {
  transform: rotateY(180deg); display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.07) 0 5px, transparent 5px 13px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 5px, transparent 5px 13px),
    radial-gradient(circle at 50% 50%, var(--bg1), var(--bg2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 30px 60px -22px rgba(0,0,0,.75);
  filter: brightness(.8);
}
.dc-back::after { content: ""; position: absolute; inset: 9px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.28); }
.dc-logo { width: 42%; aspect-ratio: 1; --logo-bg: var(--bg2); --logo-fg: rgba(255,255,255,.94); border-radius: 21%; box-shadow: 0 0 0 1.5px rgba(255,255,255,.3), 0 18px 34px -12px rgba(0,0,0,.6); }

/* ---------- controls ---------- */
.deck-ctrl { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 4px; }
.deck-arrow { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(255,255,255,.05); border: 1px solid var(--line-d); color: var(--paper); transition: background-color .3s ease, color .3s ease, transform .3s var(--ease); }
.deck-arrow:hover { background: var(--paper); color: var(--ink); transform: scale(1.06); }
.deck-now { min-width: 230px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.dn-num, .dn-hint { color: var(--muted-d); font-size: 12px; }
.dn-name { font-family: var(--f-display); font-weight: 800; font-variation-settings: "wdth" 85; font-size: 28px; line-height: 1.05; text-transform: uppercase; }

/* case study widget: live site in a device frame (rendered inside the case overlay) */
.w-site { display: flex; flex-direction: column; gap: 16px; }
.ws-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.ws-devs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--line-d); }
.ws-dev { min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 0; background: transparent; color: var(--muted-d); font-weight: 700; font-size: 14px; cursor: pointer; transition: background-color .3s ease, color .3s ease; }
.ws-dev small { font-family: var(--f-mono); font-size: 11px; font-weight: 400; opacity: .7; }
.ws-dev.is-on { background: var(--c1); color: #062A26; }
.ws-open { display: inline-flex; align-items: center; gap: 6px; color: var(--c2); text-decoration: none; }
.ws-open:hover { color: var(--paper); }
.ws-view { display: flex; justify-content: center; }
.ws-device { border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 40px 80px -30px rgba(0,0,0,.8), 0 0 70px -20px color-mix(in srgb, var(--c1) 55%, transparent); transition: width .6s var(--ease), border-radius .6s ease; }
.ws-device.is-phone { border-radius: 30px; border: 8px solid #15151B; }
.ws-chrome { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #EEF2F1; color: #55616A; }
.ws-chrome i { width: 9px; height: 9px; border-radius: 50%; background: #CBD3D1; }
.ws-chrome span { margin-left: 8px; padding: 3px 10px; border-radius: 6px; background: #fff; font-size: 11px; }
.ws-device.is-phone .ws-chrome { display: none; }
.ws-frame { position: relative; overflow: hidden; background: #fff; transition: height .6s var(--ease); }
.ws-frame iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #fff; opacity: 0; transition: opacity .5s ease; }
.ws-frame.is-loaded iframe { opacity: 1; }
.ws-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #55616A; }
.ws-frame.is-loaded .ws-loading { display: none; }

@media (max-width: 1080px) {
  .deck-stage { --cw: 210px; --R: 380px; }
}
@media (max-width: 760px) {
  .deck-stage { --cw: 168px; --R: 270px; perspective: 1100px; height: calc(var(--ch) + 110px); }
  .deck-ring { top: 30px; }
  .dc-idx { top: 12px; left: 12px; } .dc-idx-r { bottom: 12px; right: 12px; }
  .dc-idx b { font-size: 16px; }
  .dc-name { bottom: 44px; } .dc-name b { font-size: 16px; } .dc-name small { display: none; }
  .deck-ctrl { gap: 14px; }
  .deck-now { min-width: 0; flex: 1; }
  .dn-name { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .dc-front::before { animation: none; }
}
