/* Projects showcase: Hover Tabs on desktop, Arc Wave drum on mobile. Original cards stay in the DOM but are hidden once enhanced. */
.expanded-card-rail.pshow-ready { display: block !important; overflow: visible !important; }
.expanded-card-rail.pshow-ready > .case-card { display: none !important; }
.expanded-card-rail.pshow-ready > .project-group-heading { flex: none !important; width: auto !important; margin: 56px 0 8px !important; align-self: auto; }
.expanded-card-rail.pshow-ready > .project-group-heading-first { margin-top: 0 !important; }

.pshow-group { --pf: #1d1517; margin: 20px 0 0; }
.pshow { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); align-items: start; }
.parc { display: none; }

/* ---- Desktop: Hover Tabs ---- */
.pshow-tabs { display: flex; flex-direction: column; height: max(460px, calc(var(--n) * 56px + 200px)); margin: 0; padding: 0; list-style: none; position: relative; z-index: 2; }
.pshow-tabs > li { flex: 1 1 0; min-height: 52px; transition: flex-grow .45s var(--ease-sh); }
.pshow-tabs > li:has(.is-active) { flex-grow: 3.4; }
.pshow-tab { position: relative; display: flex; flex-direction: column; height: 100%; margin-right: -1px; padding: 0 24px; border-radius: 16px 0 0 16px; color: var(--muted); text-decoration: none; transition: background .3s ease, color .3s ease; }
.pshow-row { display: flex; align-items: center; gap: 14px; min-height: 52px; flex: none; }
.pshow-num { font: 11px var(--mono); letter-spacing: .08em; opacity: .55; }
.pshow-name { font-size: 18px; font-weight: 500; letter-spacing: -.01em; transition: color .25s ease; }
.pshow-tab:hover .pshow-name, .pshow-tab.is-active .pshow-name { color: var(--text); }
.pshow-more { display: grid; grid-template-rows: 0fr; min-height: 0; opacity: 0; transition: grid-template-rows .45s var(--ease-sh), opacity .25s ease; }
.pshow-more-in { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; padding-bottom: 6px; }
.pshow-kind { font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #ff7180; }
.pshow-desc { font-size: 14px; line-height: 1.5; color: var(--muted); }
.pshow-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 12px var(--mono); color: var(--text); }
.pshow-go { display: inline-flex; align-items: center; gap: 6px; }
.pshow-tab.is-active { background: var(--pf); }
.pshow-tab.is-active .pshow-more { grid-template-rows: 1fr; opacity: 1; transition-delay: 0s, .08s; }
.pshow-tab:focus-visible { outline: 2px solid #ff7180; outline-offset: -2px; }

/* concave corners joining the active tab to the frame */
.pshow-tab.is-active::before, .pshow-tab.is-active::after { content: ""; position: absolute; right: 0; width: 24px; height: 24px; pointer-events: none; }
.pshow-tab.is-active::before { top: -24px; background: radial-gradient(circle at 0 0, transparent 23.5px, var(--pf) 24px); }
.pshow-tab.is-active::after { bottom: -24px; background: radial-gradient(circle at 0 100%, transparent 23.5px, var(--pf) 24px); }
.pshow-tabs > li:first-child .pshow-tab.is-active::before, .pshow-tabs > li:last-child .pshow-tab.is-active::after { display: none; }

.pshow-frame { position: relative; height: max(460px, calc(var(--n) * 56px + 200px)); border-radius: 24px; background: var(--pf); overflow: hidden; }
.pshow.is-first .pshow-frame { border-top-left-radius: 0; }
.pshow.is-last .pshow-frame { border-bottom-left-radius: 0; }
.pshow-slide { position: absolute; inset: 14px; display: block; overflow: hidden; border-radius: 14px; background: #0c0a0b; opacity: 0; transition: opacity .5s ease; }
.pshow-slide.is-active { opacity: 1; }
.pshow-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.pshow-img.is-contain { object-fit: contain; object-position: center; }
.pshow-mock { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; padding: clamp(16px, 3vw, 44px); background: radial-gradient(ellipse at 70% 30%, rgba(209,59,80,.18), transparent 62%), #171315; }
.pshow-mock > div { width: 100%; }
.pshow-plate { display: flex; width: 100%; height: 100%; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 28px; background: radial-gradient(ellipse at 75% 20%, rgba(209,59,80,.28), transparent 60%), #151113; }
.pshow-plate span { font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #ff7180; }
.pshow-plate b { font-size: clamp(30px, 4vw, 56px); font-weight: 500; letter-spacing: -.03em; line-height: 1.05; color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .pshow-tabs > li, .pshow-more, .pshow-slide, .pshow-tab { transition: none; }
}

/* ---- Mobile: foldable phone (closed = mobile site, open = web version) with floating bubbles ---- */
@media (max-width: 800px) {
  .pshow { display: none; }
  .parc { display: block; margin: 0 calc(var(--page-gutter) * -1); overflow: hidden; }
  .parc-stage { position: relative; height: 580px; touch-action: pan-y; outline: none; user-select: none; -webkit-user-select: none; }
  .parc-stage:focus-visible { outline: 2px solid #ff7180; outline-offset: -2px; }

  /* Laptop: 3D lid that opens the first time the section scrolls into view */
  .lp { --w: min(80vw, 300px); --lh: calc(var(--w) * .63); --bd: calc(var(--w) * .67); position: absolute; left: 50%; top: 50%; z-index: 2; width: var(--w); height: calc(var(--w) * .87); transform: translate(-50%, -50%); perspective: 1500px; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
  .lp:focus-visible { outline: 2px solid #ff7180; outline-offset: 8px; }
  .lp-scene { position: absolute; left: 0; top: calc(var(--w) * .6); width: 100%; height: 0; transform-style: preserve-3d; transform-origin: 50% 0; transform: rotateX(-24deg); }
  .lp-lid { position: absolute; left: 0; bottom: 0; width: 100%; height: var(--lh); transform-origin: 50% 100%; transform-style: preserve-3d; transform: rotateX(-88deg); transition: transform 1.8s cubic-bezier(.22, .9, .24, 1); }
  .lp.is-open .lp-lid { transform: rotateX(15deg); }

  /* base with keyboard deck */
  .lp-base { position: absolute; left: 0; top: 0; width: 100%; height: var(--bd); transform-origin: 50% 0; transform: rotateX(90deg); border-radius: 2px 2px 14px 14px; background: linear-gradient(180deg, #d4d7dd 0%, #b3b7bf 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 1px 0 #7d818a; }
  .lp-keys { position: absolute; left: 6%; right: 6%; top: 8%; height: 46%; border-radius: 4px; background: linear-gradient(90deg, #14151a 1.5px, transparent 1.5px) 0 0 / calc(var(--w) * .0625) 100%, linear-gradient(180deg, #14151a 1.5px, transparent 1.5px) 0 0 / 100% calc(var(--w) * .05), #2d2f37; }
  .lp-pad { position: absolute; left: 34%; width: 32%; bottom: 8%; height: 25%; border-radius: 6px; border: 1px solid rgba(70, 74, 84, .45); background: rgba(255, 255, 255, .12); }
  .lp-lip { position: absolute; left: 42%; width: 16%; bottom: 0; height: 5px; border-radius: 0 0 6px 6px; background: rgba(60, 64, 72, .35); }

  /* lid: screen on the front face, aluminium shell on the back */
  .lp-screen { position: absolute; inset: 0; padding: 2.4% 2.4% 3.6%; border-radius: 12px 12px 2px 2px; background: #0a0a0c; border: 1px solid #3a3d46; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
  .lp-glass { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 4px; background: var(--pf); }
  .lp-glass::after { content: ""; position: absolute; inset: 0; z-index: 3; background: linear-gradient(125deg, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, 0) 30%); pointer-events: none; }
  .lp-cam { position: absolute; top: 1.1%; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #4a5a80, #05070b 70%); }
  .lp-shell { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 12px 12px 2px 2px; background: linear-gradient(160deg, #e1e4ea 0%, #b4b8c1 55%, #cfd2d9 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); transform: rotateY(180deg); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
  .lp-mark { width: 14%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .9), rgba(120, 125, 135, .55)); box-shadow: 0 0 0 1px rgba(80, 84, 94, .25); }
  .lp-content { position: absolute; inset: 0; opacity: 1; transition: opacity .24s ease; }
  .lp-content.is-swap { opacity: 0; }
  .lp-content .pshow-img, .lp-content .pshow-mock, .lp-content .pshow-plate { position: absolute; inset: 0; }
  .lp-content .pshow-img { width: 100%; height: 100%; object-fit: cover; object-position: center top; pointer-events: none; }
  .lp-content .pshow-img.is-contain { object-fit: cover; object-position: center top; }
  .lp-content .pshow-mock { padding: 14px; }
  .lp-content .pshow-plate { padding: 20px; justify-content: center; }
  .lp-content .pshow-plate b { font-size: 26px; }
  .lp-shadow { position: absolute; left: 6%; right: 6%; bottom: -4%; height: 18%; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 70%); filter: blur(6px); pointer-events: none; }

  /* floating glass bubbles */
  .ph-chip { position: absolute; left: 50%; top: 50%; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; will-change: transform; touch-action: manipulation; }
  .ph-chip.is-hidden { pointer-events: none; }
  .ph-chip.is-hidden .ph-fl { opacity: 0; transform: scale(.25); }
  .ph-fl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 96px; height: 96px; padding: 6px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .16); background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .26), rgba(255, 113, 128, .2) 38%, rgba(29, 21, 23, .8) 74%); box-shadow: inset 0 0 18px rgba(255, 255, 255, .1), inset -7px -11px 20px rgba(0, 0, 0, .4), 0 16px 30px rgba(0, 0, 0, .45), 0 0 26px rgba(255, 113, 128, .14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--text); text-align: center; transition: transform .7s cubic-bezier(.22, 1.2, .36, 1), opacity .35s ease; }
  .ph-fl i { font: normal 10px var(--mono); letter-spacing: .06em; color: #ffb3bb; }
  .ph-fl b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; font-size: 10.5px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: normal; }
  .ph-chip:focus-visible .ph-fl { outline: 2px solid #ff7180; outline-offset: 2px; }

  .parc-info { padding: 0 var(--page-gutter); min-height: 190px; }
  .parc-kind { margin: 0 0 6px; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #ff7180; }
  .parc-title { margin: 0 0 8px; font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
  .parc-desc { margin: 0 0 6px; font-size: 14px; line-height: 1.5; color: var(--muted); }
  .parc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .parc-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font: 13px var(--mono); color: var(--text); text-decoration: none; }
  .parc-fold { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font: 13px var(--mono); cursor: pointer; }
  .parc-nav { display: flex; align-items: center; justify-content: space-between; padding: 4px calc(var(--page-gutter) + 56px) 0 var(--page-gutter); }
  .parc-count { font: 12px var(--mono); letter-spacing: .08em; color: var(--muted); }
  .parc-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); font-size: 18px; cursor: pointer; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-lid, .lp-content, .ph-fl { transition: none; }
}
