/* Boniat Lab: work cards per discipline (v1.4.0).
 * Same glass card shell everywhere; the inner frame (.wk-pic.cv) changes with the project's type:
 * interface · building · wearable · space · systems. Loaded after main.css.
 */

/* ---------- shared ---------- */
.cv { overflow: clip; container-type: size; }
.cv-fill { position: absolute; inset: 6px; border-radius: 13px; overflow: clip; background: var(--ink-3); }
.cv-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease), filter .6s var(--ease); }
.wk-link:hover .cv-photo { transform: scale(1.025); }

/* discipline chip in the meta row */
.wk-type { display: inline-flex; align-items: center; gap: 5px; padding: 0 7px 0 5px; border: 1px solid #fff5ee38; border-radius: 99px; color: var(--paper); line-height: 1.55; }
.ty-ico { width: 11px; height: 11px; flex: none; }
.wk-meta > .wk-type + span::before { content: none; }
.wk-meta > .wk-type { margin-right: .1em; }

/* cube tag type label (3D scene) */
.hero-tag-type { display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 3px; font-size: .8em; letter-spacing: .1em; opacity: .55; }
.hero-tag-type .ty-ico { width: 8px; height: 8px; }

/* ---------- building: photo, then "drawn, then built" on hover ---------- */
.cv-draw { position: absolute; inset: 6px; display: grid; place-items: center; border-radius: 13px; pointer-events: none; color: var(--paper); }
.cv-plan { width: 62%; max-height: 82%; overflow: visible; opacity: 0; }
.cv-plan .pl { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cv-plan .pl-t { opacity: 0; font-family: var(--font-display); }
.wk-link:hover .cv-building .cv-photo { animation: cv-built 2.6s var(--ease) both; }
.wk-link:hover .cv-building .cv-plan { animation: cv-plan-life 2.6s linear both; }
.wk-link:hover .cv-building .cv-plan .pl { animation: cv-draw 1.1s cubic-bezier(.45, 0, .2, 1) calc(.25s + var(--k) * .03s) both; }
.wk-link:hover .cv-building .cv-plan .pl-t { animation: cv-fade .5s ease 1s both; }
@keyframes cv-built { 0% { filter: none; } 14%, 62% { filter: brightness(.34) grayscale(.5); } 100% { filter: none; } }
@keyframes cv-plan-life { 0% { opacity: 0; } 8%, 60% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cv-draw { to { stroke-dashoffset: 0; } }
@keyframes cv-fade { to { opacity: 1; } }

/* ---------- space: room photo, hotspots + leader lines, labels on hover ---------- */
.cv-fit { position: absolute; left: 50%; top: 50%; width: max(100cqw, 100cqh * 1.6); aspect-ratio: 16 / 10; transform: translate(-50%, -50%); }
.cv-fit .cv-photo { transition: filter .6s var(--ease); }
.cv-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--paper); stroke-width: .28; }
.cv-lead { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .7; animation: cv-draw 1.4s cubic-bezier(.45, 0, .2, 1) calc(.6s + var(--k) * .25s) both; }
.cv-spot { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.cv-spot::before, .cv-spot i { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; }
.cv-spot::before { background: var(--paper); box-shadow: 0 0 0 3px #fff5ee33, 0 0 14px #fff5ee99; transform: scale(.6); }
.cv-spot i { border: 1px solid var(--paper); animation: cv-pulse 2.8s ease-out calc(var(--k) * .7s) infinite; }
@keyframes cv-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
.cv-chip { position: absolute; left: var(--x); top: var(--y); transform: translate(0, calc(-100% - 4px)); padding: 3px 7px; border-radius: 99px; background: #0d0c0bcc; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--paper); font-size: 10px; white-space: nowrap; opacity: 0; transition: opacity .45s var(--ease), transform .45s var(--ease); transition-delay: calc(var(--k) * .08s); }
.cv-chip b { font-weight: 600; }
.wk-link:hover .cv-space .cv-chip { opacity: 1; transform: translate(0, calc(-100% - 7px)); }
.wk-link:hover .cv-space .cv-lead { opacity: 1; }
.wk-link:hover .cv-space .cv-photo { filter: brightness(.82); }

/* ---------- wearable: product on a soft backdrop, app slides in on hover ---------- */
.cv-stage { position: absolute; inset: 6px; border-radius: 13px; overflow: clip; background: radial-gradient(70% 90% at 50% 40%, #f3eee8 0%, #e2dbd3 58%, #cfc6bc 100%); }
.cv-prod { position: absolute; left: 50%; top: 50%; width: 40%; transform: translate(-50%, -52%); transition: left .8s var(--ease); }
.cv-prod img { position: relative; z-index: 1; width: 100%; filter: drop-shadow(0 18px 22px #4a3f3533); animation: cv-float 6s ease-in-out infinite; }
.cv-shadow { position: absolute; left: 18%; right: 18%; bottom: -10%; height: 12%; border-radius: 50%; background: radial-gradient(closest-side, #3b322a40, #3b322a00); animation: cv-shadow 6s ease-in-out infinite; }
@keyframes cv-float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-5%) rotate(-1.5deg); } }
@keyframes cv-shadow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.86); opacity: .7; } }
.cv-phone { position: absolute; top: 9%; bottom: 9%; right: 13%; aspect-ratio: 9 / 19.5; border: 4px solid #141210; border-radius: 18px; background: #141210; overflow: clip; box-shadow: 0 24px 40px #2a221c40; opacity: 0; transform: translateX(30%); transition: opacity .55s var(--ease), transform .8s var(--ease); }
.cv-phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.wk-link:hover .cv-wearable .cv-prod { left: 36%; }
.wk-link:hover .cv-wearable .cv-phone { opacity: 1; transform: none; }

/* ---------- systems: building left, system right, a centre seam like the hero ---------- */
.cv-systems { --sx: 50%; }
.cv-sys { position: absolute; inset: 6px; border-radius: 13px; background: radial-gradient(80% 90% at 75% 50%, #22201d 0%, #0b0a09 70%); clip-path: inset(0 0 0 var(--sx)); transition: clip-path .9s var(--ease); }
.cv-diagram { position: absolute; top: 8%; bottom: 8%; right: 3%; width: 46%; height: 84%; overflow: visible; }
.cv-flow { fill: none; stroke: #fff5ee8c; stroke-width: .7; stroke-dasharray: 2 3; animation: cv-flow 1.6s linear infinite; }
@keyframes cv-flow { to { stroke-dashoffset: -10; } }
.cv-node rect { fill: #fff5ee0d; stroke: #fff5ee59; stroke-width: .5; }
.cv-node text { fill: var(--paper); font-family: var(--font-display); }
.cv-node .n { font-size: 5.6px; letter-spacing: .08em; text-transform: uppercase; }
.cv-node .v { font-size: 5px; fill: #fff5ee99; }
.cv-hub { fill: var(--paper); animation: cv-hub 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes cv-hub { 50% { transform: scale(1.5); opacity: .6; } }
.cv-seam { position: absolute; top: 6px; bottom: 6px; left: calc(6px + (100% - 12px) * var(--p, .5)); width: 2px; margin-left: -1px; background: var(--crease); box-shadow: 0 0 18px #fff5ee40; transition: left .9s var(--ease); }
.wk-link:hover .cv-systems .cv-sys { clip-path: inset(0 0 0 38%); }
.wk-link:hover .cv-systems .cv-seam { --p: .38; left: calc(6px + (100% - 12px) * .38); }
.wk-link:hover .cv-systems .cv-photo { transform: scale(1.04) translateX(-2%); }

/* ---------- case page: photo-led stills + plans ---------- */
.cs-stills.is-photo { grid-template-columns: 1fr; }
.cs-stills.is-photo .cs-still { aspect-ratio: 16 / 9; }
.cs-plans { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); gap: 30px 60px; align-items: start; padding-bottom: clamp(90px, 10vw, 160px); }
.cs-plan { padding: clamp(24px, 4vw, 60px); border-radius: clamp(10px, 1.2vw, 18px); background: var(--ink-3); color: var(--paper); }
.cs-plan svg { display: block; width: 100%; height: auto; overflow: visible; }
.cs-plan .pl { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s cubic-bezier(.45, 0, .2, 1) calc(var(--k) * .05s); }
.cs-plan .pl-t { opacity: 0; transition: opacity .6s ease 1.2s; font-family: var(--font-display); }
.cs-plan[data-in="1"] .pl { stroke-dashoffset: 0; }
.cs-plan[data-in="1"] .pl-t { opacity: 1; }
.cs-plan-note { max-width: 32ch; margin-top: 14px; color: var(--mute); }

/* ---------- phones: stacked rows show the visual full-bleed ---------- */
@media (max-width: 760px) {
	.cv-fill, .cv-draw, .cv-stage, .cv-sys { inset: 0; border-radius: 0; }
	.wk-meta > .wk-type { display: inline-flex; }
	.wk-meta > .wk-type ~ span { display: none; }
	/* wearable: band and app side by side */
	.cv-prod { width: 52%; left: 30%; top: 46%; }
	.cv-phone { top: auto; bottom: 10%; right: 6%; height: 46%; opacity: 1; transform: none; }
	/* systems: halves stack top/bottom, like the hero on phones */
	.cv-sys { clip-path: inset(50% 0 0 0); }
	.cv-diagram { top: auto; bottom: 4%; right: 50%; width: 88%; height: 42%; transform: translateX(50%); }
	.cv-seam { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: 2px; margin: -1px 0 0; }
	.wk-link:hover .cv-systems .cv-sys { clip-path: inset(50% 0 0 0); }
	.wk-link:hover .cv-systems .cv-seam { left: 0; }
	/* space: readings always on (no hover on touch) */
	.cv-chip { opacity: 1; }
	.cs-plans { grid-template-columns: 1fr; }
}
@media (hover: none) {
	.cv-chip { opacity: 1; }
}

/* ---------- reduced motion: static versions ---------- */
@media (prefers-reduced-motion: reduce) {
	.cv *, .cv *::before, .cv *::after { animation: none !important; transition: none !important; }
	.cv-lead { stroke-dashoffset: 0; }
	.cv-spot i { display: none; }
	.wk-link:hover .cv-building .cv-photo { filter: brightness(.38) grayscale(.5); }
	.wk-link:hover .cv-building .cv-plan { opacity: 1; }
	.wk-link:hover .cv-building .cv-plan .pl { stroke-dashoffset: 0; }
	.wk-link:hover .cv-building .cv-plan .pl-t { opacity: 1; }
	.cs-plan .pl { stroke-dashoffset: 0; transition: none; }
	.cs-plan .pl-t { opacity: 1; transition: none; }
}

/* Building with a drawn plan image of its own ('plan', or a 'hero' named *plan*): the image wipes in like a pen, then dissolves */
.cv-draw.has-img { inset: 6px; overflow: clip; }
.cv-plan-img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: cover; mix-blend-mode: screen; filter: sepia(.3) contrast(1.35) brightness(1.25); clip-path: inset(0 100% 0 0); }
.wk-link:hover .cv-building .cv-plan-img { animation: cv-plan-life 2.6s linear both, cv-wipe 1.3s cubic-bezier(.45, 0, .2, 1) .15s both; }
@keyframes cv-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.cs-plan.has-img { padding: 0; overflow: clip; background: none; }
.cs-plan.has-img img { display: block; width: 100%; height: auto; clip-path: inset(0 100% 0 0); transition: clip-path 1.6s cubic-bezier(.45, 0, .2, 1); }
.cs-plan.has-img[data-in="1"] img { clip-path: inset(0 0 0 0); }
@media (max-width: 760px) { .cv-draw.has-img { inset: 0; } }
@media (prefers-reduced-motion: reduce) {
	.cv-plan-img, .cs-plan.has-img img { clip-path: none; transition: none; }
	.wk-link:hover .cv-building .cv-plan-img { animation: none; opacity: 1; }
}

/* The owner's full-bleed card variant (main.css, building / smart-space / wearable): keep its bottom shade with the new card frames */
@media (min-width: 761px) {
	.wk-card:is([data-type="building"], [data-type="smart-space"], [data-type="wearable"]) .cv::after {
		content: ""; position: absolute; inset: 0; border-radius: 23px; pointer-events: none;
		background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .42) 26%, rgba(0, 0, 0, .06) 52%, rgba(0, 0, 0, .14) 100%);
	}
	.wk-card[data-type="wearable"] .cv::after { background: linear-gradient(to top, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .3) 22%, rgba(0, 0, 0, 0) 44%); }
}

/* ---------- v1.5.0: card galleries, stepped by the pinned deck (main.js) ---------- */
.cv-g { position: absolute; inset: 0; display: block; opacity: 0; transform: scale(1.07); filter: blur(6px);
	transition: opacity 1.3s cubic-bezier(.65, 0, .35, 1), transform 3.4s cubic-bezier(.16, 1, .3, 1), filter 1.1s cubic-bezier(.65, 0, .35, 1); }
.cv-fill, .cv-prod { isolation: isolate; }
.cv-g.is-on { z-index: 1; opacity: 1; transform: scale(1); filter: none; }
.cv-g.is-past { opacity: 0; transform: scale(.985); filter: blur(3px); }
.has-gal .cv-g.is-on { animation: cv-drift 9s linear .9s both; }
@keyframes cv-drift { from { scale: 1; } to { scale: 1.035; } }
.cv-prod .cv-g { transform-origin: 50% 60%; }
.cv-prod .cv-g:first-child { position: relative; }
.cv-prod .cv-g img { height: 100%; object-fit: contain; }
.wk-shot .cv-g img { display: block; }
/* wearable: the last step brings the app in, as hover does */
.cv-wearable.is-app .cv-prod { left: 36%; }
.cv-wearable.is-app .cv-phone { opacity: 1; transform: none; }
/* progress: thin segments + 01 / 04 */
.cv-prog { position: absolute; z-index: 5; top: 12px; right: 14px; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 11px; border-radius: 99px;
	background: #14131261; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff5ee99; font-size: 10px; line-height: 1; letter-spacing: .08em; pointer-events: none; }
.cv-segs { display: flex; gap: 4px; }
.cv-segs i { position: relative; width: 16px; height: 2px; border-radius: 2px; overflow: clip; background: #fff5ee38; }
.cv-segs i::after { content: ""; position: absolute; inset: 0; background: var(--paper); transform: scaleX(0); transform-origin: 0 50%; transition: transform .8s cubic-bezier(.65, 0, .35, 1); }
.cv-segs i.is-on::after { transform: none; }
.cv-count { font-variant-numeric: tabular-nums; }
.cv-count b { font-weight: inherit; color: var(--paper); }
@media (max-width: 760px) {
	.cv-prog { top: 10px; right: 10px; gap: 8px; padding: 5px 8px; font-size: 9px; }
	.cv-segs i { width: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.cv-g, .cv-g.is-on, .cv-g.is-past { transition: none; transform: none; filter: none; animation: none; }
	.cv-segs i::after { transition: none; }
}
