/* "What we build" visuals (services.js). One stage per practice in the panel image's place;
   the image stays in the HTML as the fallback when the script does not run. */
.acc-stage { display: none; }
.has-stage .acc-inner > img { display: none; }
.has-stage .acc-stage { display: block; grid-column: 2; grid-row: 1; position: relative; aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; }
@media (max-width: 900px) { .has-stage .acc-stage { grid-column: 1; grid-row: auto; aspect-ratio: 4 / 3.4; } }

/* ---------- 1. Layers: code, interface and result stacked in depth ---------- */
.acc-stage-layers { background: #151517; perspective: 1300px; perspective-origin: 50% 40%; }
.layers { --rx: 12deg; --ry: -18deg; --fan: 0; position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.lay { position: absolute; border-radius: 14px; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 30px 50px -24px rgba(0, 0, 0, 0.6); }
.lay-code { left: 4%; top: 8%; width: 64%; background: #222226; color: #E7E6E1; transform: translateZ(calc(-30px - var(--fan) * 50px)); }
.lay-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.lay-bar i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.lay-bar span { margin-left: auto; font: 500 11px/1 var(--mono, monospace); color: rgba(231, 230, 225, 0.5); }
.lay-code pre { margin: 0; padding: 12px 14px 16px; font: 400 clamp(10px, 0.95vw, 13px)/1.65 var(--mono, monospace); white-space: pre-wrap; overflow-wrap: anywhere; }
.lay-ui { left: 28%; top: 32%; width: 52%; background: #FFFFFF; color: #0E0E10; padding: 14px 16px 10px; transform: translateZ(calc(40px + var(--fan) * 30px)); }
.lay-ui b { display: block; font-size: clamp(13px, 1.1vw, 15px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.lay-ui table { width: 100%; border-collapse: collapse; font-size: clamp(11px, 0.95vw, 13px); }
.lay-ui td { padding: 7px 0; border-top: 1px solid rgba(14, 14, 16, 0.08); color: #3B3B40; }
.lay-ui td:first-child { color: #0E0E10; font-weight: 600; }
.lay-ui td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.lay-stat { left: 60%; top: 60%; width: 35%; background: #F2F1EC; color: #0E0E10; padding: 14px 16px 16px; display: grid; gap: 2px; transform: translateZ(calc(110px + var(--fan) * 70px)); }
.lay-stat span { font-size: 12px; color: #55555C; }
.lay-stat strong { font-size: clamp(22px, 2.3vw, 34px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.lay-stat small { font-size: 12px; color: #55555C; line-height: 1.35; }
.acc-item.is-open .lay { animation: lay-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.acc-item.is-open .lay-ui { animation-delay: 0.12s; }
.acc-item.is-open .lay-stat { animation-delay: 0.24s; }
@keyframes lay-in { from { translate: 0 60px -500px; opacity: 0; } }

/* ---------- 2. Logos: extruded tech badges on a turning ring ---------- */
.acc-stage-logos { background: #151517; touch-action: pan-y; }
.orbit-scene { position: absolute; inset: 0; perspective: 1000px; perspective-origin: 50% 35%; cursor: grab; }
.orbit-scene.is-drag { cursor: grabbing; }
.orbit { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; --R: clamp(130px, 15vw, 220px); }
.badge { position: absolute; left: 0; top: 0; transform-style: preserve-3d; transform: rotateY(calc(var(--k) * 360deg / var(--n))) translateZ(var(--R)); }
.badge i { position: absolute; left: 0; top: 0; translate: -50% -50%; transform: translateZ(calc(var(--d) * -2.5px)); white-space: nowrap; font-style: normal; font-weight: 800; letter-spacing: -0.03em; font-size: clamp(16px, 1.7vw, 24px); padding: 0.5em 0.95em; border-radius: 999px; background: #6F6E68; color: transparent; }
.badge i.f { background: #F2F1EC; color: #0E0E10; }
.badge i.b { background: #3A3935; }
.acc-item.is-open .badge { animation: badge-in 1s cubic-bezier(0.16, 1, 0.3, 1) backwards; animation-delay: calc(var(--k) * 70ms); }
@keyframes badge-in { from { rotate: x 90deg; opacity: 0; } }
.acc-stage-logos::after { content: "Drag to spin"; position: absolute; left: 50%; bottom: 14px; translate: -50% 0; font-size: 12px; color: rgba(242, 241, 236, 0.55); pointer-events: none; }

/* ---------- 3. Flip: one card per practice, turning over in 3D ---------- */
.acc-stage-flip { overflow: visible; }
.flip { position: absolute; inset: 0; perspective: 1400px; cursor: pointer; outline: none; }
.flip-card { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(0.7, 0, 0.2, 1); }
.flip:focus-visible .flip-card { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 22px; }
.flip.is-flipped .flip-card { transform: rotateY(180deg); }
@media (hover: hover) and (pointer: fine) { .flip:hover .flip-card { transform: rotateY(180deg); } .flip.is-flipped:hover .flip-card { transform: none; } }
.flip-face { position: absolute; inset: 0; border-radius: 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: clamp(22px, 3vw, 40px); }
.flip-front { transform: rotateY(0deg) translateZ(1px); background: #0E0E10; color: #F2F1EC; }
.flip-front strong { font-size: clamp(34px, 4.4vw, 72px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.92; }
.flip-front span { font-size: 17px; color: rgba(242, 241, 236, 0.75); }
.flip-front em { position: absolute; top: clamp(18px, 2.4vw, 30px); right: clamp(18px, 2.4vw, 30px); font-style: normal; font-size: 12px; color: rgba(242, 241, 236, 0.55); }
.flip-back { background: #FFFFFF; color: #0E0E10; transform: rotateY(180deg) translateZ(1px); justify-content: center; }
.flip-back span { font-size: 15px; color: #55555C; }
.flip-back ul { display: flex; flex-wrap: wrap; gap: 10px; }
.flip-back li { font-size: clamp(18px, 1.9vw, 28px); font-weight: 700; letter-spacing: -0.03em; padding: 0.4em 0.85em; border-radius: 999px; background: #F2F1EC; }
.acc-item.is-open .flip-card { animation: flip-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
@keyframes flip-in { from { rotate: y -0.5turn; scale: 0.92; opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .acc-item.is-open .lay, .acc-item.is-open .badge, .acc-item.is-open .flip-card { animation: none; }
  .flip-card, .layers, .lay { transition: none; }
}
