/* Boniat Lab: story cards (1.7.0) — one thread, cause → effect, the interface, the stair wake.
 * Markup: template-parts/card-story.php (+ template-parts/story/*). Runtime: assets/js/story.js. Loaded after cards.css.
 */
.cv-story { --glow: #ffe7c7; }
.cv-story .st-fill { position: absolute; inset: 0; overflow: clip; background: #0b0a09; border-radius: inherit; }
.cv-story .st-fit { position: absolute; left: 50%; top: 50%; width: max(100cqw, 100cqh * 1.6); aspect-ratio: 16 / 10; transform: translate(-50%, -50%); transition: transform 4.5s cubic-bezier(.33, 0, .15, 1); }
.cv-story .st-fit.st-zoom { transform: translate(-50%, -50%) scale(1.12); transform-origin: 18% 62%; }
.cv-story .st-l img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cv-story .st-ui.is-on, .cv-story .st-scene.is-on, .has-gal .cv-story .st-ui.is-on { animation: none; }
.cv-story .cv-g.st-ui, .cv-story .cv-g.st-scene { animation: none !important; }
/* full-bleed cards keep the owner's bottom shade */
.cv-story .st-fill::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(to top, #000000b8 0%, #00000052 24%, #0000 48%, #0000002e 100%); }

/* ---------- live points ---------- */
.st-spot { position: absolute; z-index: 4; left: var(--x); top: var(--y); width: 0; height: 0; opacity: 0; transition: opacity .5s var(--ease); }
.st-spot::before, .st-spot i { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; }
.st-spot::before { background: var(--paper); box-shadow: 0 0 0 3px #fff5ee33, 0 0 14px #fff5ee99; transform: scale(.6); }
.st-spot i { border: 1px solid var(--paper); animation: cv-pulse 2.8s ease-out calc(var(--k) * .7s) infinite; }
.st-chip { position: absolute; z-index: 4; left: calc(var(--x) + 12px); top: var(--y); transform: translate(0, calc(-50% + 6px)); padding: 4px 9px; border-radius: 99px; background: #0d0c0bcc; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--paper); font-size: 11px; line-height: 1.2; white-space: nowrap; opacity: 0; transition: opacity .45s var(--ease), transform .6s var(--ease); }
.st-chip b { font-weight: 600; margin-right: 2px; }
.cv-story .st-l.is-on.st-pts .st-spot, .cv-story .st-l.is-on.st-pts .st-chip { opacity: 1; transition-delay: calc(.15s + var(--k) * .12s); }
.cv-story .st-l.is-on.st-pts .st-chip { transform: translate(0, -50%); }

/* ---------- the thread ---------- */
.st-thread { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.st-thread path { fill: none; stroke-linecap: round; }
.st-tb { stroke: var(--paper); opacity: .5; stroke-dasharray: 1; stroke-dashoffset: 1; }
.st-tg { stroke: var(--glow); opacity: .18; stroke-dasharray: 1; stroke-dashoffset: 1; }
.cv-story.st-drawn .st-tb, .cv-story.st-drawn .st-tg { stroke-dashoffset: 0; transition: stroke-dashoffset 1.8s cubic-bezier(.45, 0, .2, 1) .3s; }
.st-tp { stroke: #fff; stroke-dasharray: .07 1.2; opacity: .95; filter: drop-shadow(0 0 3px #ffe7c7); }

/* ---------- cause → effect caption ---------- */
.st-cause { position: absolute; z-index: 6; left: 16px; top: 14px; width: max-content; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 210px); padding: 8px 14px 8px 12px; border-radius: 99px; background: #0d0c0bb8; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid #fff5ee1f;
	font-family: var(--font-display); font-size: 13px; line-height: 1.2; color: #fff5eecc; opacity: 0; transform: translateY(-6px); transition: opacity .45s var(--ease), transform .6s var(--ease); pointer-events: none; white-space: nowrap; overflow: hidden; }
.st-cause.is-on { opacity: 1; transform: none; }
.st-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 10px var(--glow); flex: none; animation: st-blink 1.2s ease-in-out infinite; }
@keyframes st-blink { 50% { opacity: .35; } }
.st-c { white-space: pre; }
.st-caret { display: inline-block; width: .55em; height: 1em; margin-left: -9px; background: #fff5ee99; animation: st-blink .8s steps(1) infinite; }
.st-cause.is-typed .st-caret { display: none; }
.st-e { color: var(--paper); opacity: 0; transform: translateX(-6px); transition: opacity .5s var(--ease), transform .6s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-e.is-on { opacity: 1; transform: none; }
.st-e::before { content: "→  "; color: var(--glow); }

/* ---------- mini plan strip ---------- */
.st-mini { position: absolute; z-index: 6; right: 14px; top: 48px; width: max-content; display: flex; align-items: center; gap: 10px; padding: 7px 11px; border-radius: 13px; background: #0d0c0bb0; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid #fff5ee1a; transition: opacity .6s var(--ease); pointer-events: none; }
.cv-story.is-ui .st-mini { opacity: 0; }
.st-mini svg { width: 120px; height: 27px; overflow: visible; }
.st-mini .hull { fill: none; stroke: #fff5ee59; stroke-width: 1; }
.st-mini .z { fill: #fff5ee12; stroke: #fff5ee30; stroke-width: .6; transition: fill .8s var(--ease), stroke .8s var(--ease); }
.st-mini .z.is-on { fill: #ffe7c7aa; stroke: #ffe7c7; filter: drop-shadow(0 0 4px #ffe7c7); }
.st-lbl { min-width: 88px; font-family: var(--font-display); font-size: 10px; line-height: 1.25; letter-spacing: .04em; color: #fff5eeb3; }
.st-lbl b { display: block; font-family: var(--font-header); font-weight: 500; font-size: 11px; letter-spacing: .06em; color: var(--paper); text-transform: uppercase; }

/* Halden: no plan-wipe hover over the plan frame or the interface */
.cv-story.is-noplan .cv-draw { display: none; }
.wk-link:hover .cv-story.is-noplan .cv-photo { animation: none; }

/* ---------- interface frame (design 980 × 500, scaled by story.js) ---------- */
.st-ui { position: absolute; display: block; overflow: hidden; background: radial-gradient(90% 70% at 30% 40%, #151310 0%, #0a0908 70%); color: var(--paper); }
.st-ui .st-grid { position: absolute; inset: 0; background-image: linear-gradient(#fff5ee08 1px, transparent 1px), linear-gradient(90deg, #fff5ee08 1px, transparent 1px); background-size: 28px 28px; -webkit-mask: radial-gradient(80% 80% at 35% 45%, #000 40%, transparent 100%); mask: radial-gradient(80% 80% at 35% 45%, #000 40%, transparent 100%); }
.st-uiw { position: absolute; left: 50%; top: 50%; display: block; width: 980px; height: 500px; transform: translate(-50%, -50%) scale(var(--uis, 1)); }
.st-top { position: absolute; left: 3%; right: 3%; top: 64px; display: flex; align-items: center; gap: 14px; font-family: var(--font-display); font-size: 12px; line-height: 1; color: #fff5eeb0; white-space: nowrap; }
.st-top svg { width: 22px; height: 30px; fill: var(--paper); flex: none; }
.st-top .t { font-family: var(--font-header); font-weight: 500; font-size: 13px; letter-spacing: .14em; color: var(--paper); }
.st-top .sep { flex: 1; height: 1px; background: #fff5ee29; }
.st-top .live { display: flex; align-items: center; gap: 6px; }
.st-top .live i { width: 6px; height: 6px; border-radius: 50%; background: #9be7b0; box-shadow: 0 0 8px #9be7b0; }
.st-plan { position: absolute; left: 2%; top: 100px; width: 62%; bottom: 60px; display: block; }
.st-plan svg { width: 100%; height: 100%; overflow: visible; }
.st-plan .deck-l { font-family: var(--font-display); font-size: 10px; fill: #fff5ee80; letter-spacing: .12em; }
.st-plan .hull { fill: #fff5ee06; stroke: #fff5ee70; stroke-width: 1; }
.st-plan .court-void { fill: #0a0908; stroke: #fff5ee22; stroke-width: .6; }
.st-plan .zone { fill: #fff5ee08; stroke: #fff5ee33; stroke-width: .8; transition: fill .8s var(--ease), stroke .8s var(--ease); }
.st-ui.is-on .st-plan .zone.live { fill: #ffe7c71f; stroke: #ffe7c7aa; transition-delay: var(--d, 0s); }
.st-plan .zl { font-family: var(--font-header); font-size: 9px; fill: #fff5eeb0; letter-spacing: .1em; text-transform: uppercase; }
.st-plan .zv { font-family: var(--font-display); font-size: 10px; fill: #ffe7c7; }
.st-plan .zv.dim { fill: #fff5ee70; }
.st-plan .guest { fill: var(--paper); filter: drop-shadow(0 0 4px #fff5ee); animation: st-wander 7s ease-in-out infinite alternate; }
@keyframes st-wander { 0% { transform: translate(0, 0); } 50% { transform: translate(6px, -3px); } 100% { transform: translate(-5px, 4px); } }
.st-side { position: absolute; right: 3%; top: 100px; width: 31%; bottom: 40px; display: flex; flex-direction: column; gap: 10px; }
.st-panel { display: block; border: 1px solid #fff5ee1f; border-radius: 14px; background: #fff5ee07; padding: 12px 14px; }
.st-panel .h { display: block; margin: 0 0 8px; font-family: var(--font-display); font-size: 10px; line-height: 1; letter-spacing: .12em; color: #fff5ee90; text-transform: uppercase; }
.st-panel .big { display: block; font-family: var(--font-header); font-weight: 500; font-size: 26px; line-height: 1; letter-spacing: -.02em; }
.st-panel .big small { font-family: var(--font-display); font-size: 12px; color: #fff5ee99; margin-left: 6px; letter-spacing: 0; }
.st-tl { position: relative; display: block; height: 38px; margin-top: 4px; }
.st-tl .bar { position: absolute; left: 0; right: 0; top: 12px; height: 2px; border-radius: 2px; }
.st-tl .mk { position: absolute; top: 6px; left: var(--p, 40%); width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 4px #fff5ee22, 0 0 14px #ffe7c7; }
.st-tl .tk { position: absolute; top: 24px; font-family: var(--font-display); font-size: 9px; line-height: 1; color: #fff5ee90; transform: translateX(-50%); letter-spacing: .06em; }
.st-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-kv .st-panel { padding: 10px 12px; }
.st-kv .big { font-size: 20px; }

/* stacked interface for tall cards (set by story.js) */
.st-ui.st-por .st-uiw { width: 520px; height: 900px; }
.st-ui.st-por .st-top { top: 70px; left: 5%; right: 5%; overflow: hidden; }
.st-ui.st-por .st-plan { left: 3%; width: 94%; top: 110px; bottom: auto; height: 330px; }
.st-ui.st-por .st-side { left: 5%; right: 5%; width: auto; top: 460px; bottom: 40px; }
.st-ui.st-por .st-panel .big { font-size: 24px; }

/* ---------- scene: Meridian stair wake ---------- */
.st-scene .st-tread, .st-scene .st-full { opacity: 0; transition: opacity 1s cubic-bezier(.4, 0, .2, 1); }
.st-scene .st-tread { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.st-scene.wake .st-tread { opacity: 1; transition-delay: calc(.25s + var(--i) * .16s); }
.st-scene.lit .st-full { opacity: 1; transition-duration: 1.6s; }
.st-scr { position: absolute; left: 0; top: 0; width: 320px; height: 600px; display: block; transform-origin: 0 0; overflow: hidden; opacity: 0; transition: opacity .5s; }
.st-scene.wake .st-scr { opacity: 1; }
.st-scr .bg { position: absolute; inset: 0; background: radial-gradient(120% 70% at 30% 20%, #1b1815 0%, #0b0a09 60%, #070606 100%); }
.st-scr .boot { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .6s; }
.st-scr .boot svg { width: 120px; height: 170px; fill: var(--paper); filter: drop-shadow(0 0 18px #ffe7c799); transform: scale(.94); transition: transform 1.4s var(--ease); }
.st-scene.wake .boot { opacity: 1; }
.st-scene.wake .boot svg { transform: none; }
.st-scene.ui-on .boot { opacity: 0; transition-duration: .5s; }
.st-scr .app { position: absolute; inset: 0; display: block; padding: 34px 30px; opacity: 0; transform: translateY(10px); transition: opacity .7s .1s, transform .9s var(--ease); }
.st-scene.ui-on .app { opacity: 1; transform: none; }
.st-scr .hd { display: flex; align-items: center; gap: 10px; color: #fff5eeb8; font-family: var(--font-display); font-size: 15px; line-height: 1; letter-spacing: .06em; }
.st-scr .hd svg { width: 20px; height: 28px; fill: var(--paper); }
.st-scr .sc { display: block; margin-top: 46px; font-family: var(--font-header); font-weight: 500; font-size: 66px; line-height: 1; letter-spacing: -.03em; color: var(--paper); }
.st-scr .tm { display: block; margin-top: 12px; font-family: var(--font-display); font-size: 40px; line-height: 1; color: #ffe7c7; }
.st-scr .sl { position: absolute; left: 30px; right: 30px; bottom: 46px; height: 250px; display: flex; gap: 22px; align-items: flex-end; }
.st-scr .tr { position: relative; display: block; width: 92px; height: 100%; border-radius: 46px; background: #fff5ee14; box-shadow: inset 0 0 0 1px #fff5ee24; overflow: hidden; }
.st-scr .fl { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: linear-gradient(to top, #ffcf8f, #ffe7c7cc); border-radius: 0 0 46px 46px; transition: height 1.8s cubic-bezier(.33, 0, .15, 1) .5s; box-shadow: 0 0 30px #ffd9a066; }
.st-scene.ui-on .st-scr .fl { height: 20%; }
.st-scr .kn { position: absolute; left: 12px; right: 12px; height: 6px; border-radius: 3px; background: #0b0a09aa; bottom: calc(20% + 10px); opacity: 0; transition: opacity .6s 1.6s; }
.st-scene.ui-on .st-scr .kn { opacity: 1; }
.st-scr .lb { display: block; font-family: var(--font-display); font-size: 15px; line-height: 1.5; color: #fff5eeb0; padding-bottom: 6px; }
.st-scr .lb b { display: block; font-family: var(--font-header); font-weight: 500; font-size: 46px; line-height: 1; color: var(--paper); letter-spacing: -.02em; }
.st-scr .refl { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(112deg, #fff5ee00 30%, #fff5ee14 42%, #fff5ee05 52%, #fff5ee00 60%), linear-gradient(to bottom, #fff5ee10, #fff5ee00 12%); }
.st-scr .vig { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 22px 4px #000a; }
.st-sglow { position: absolute; pointer-events: none; border-radius: 50%; background: radial-gradient(closest-side, #ffe2b8 0%, #ffd39a66 38%, #ffcf9000 100%); mix-blend-mode: soft-light; opacity: 0; transition: opacity 1.6s .4s; }
.st-scene.ui-on .st-sglow { opacity: .9; }
.st-plateb { position: absolute; left: 0; top: 0; width: 200px; height: 100px; display: block; transform-origin: 0 0; pointer-events: none; }
.st-plateb svg { position: absolute; left: 50%; top: 50%; width: 40px; height: 57px; transform: translate(-50%, -50%); overflow: visible; }
.st-plateb .cut { fill: #2a1d12; opacity: .42; mix-blend-mode: multiply; }
.st-plateb .lip { fill: #ffe9cc; opacity: .16; mix-blend-mode: screen; transform: translate(2px, 3px); }
.st-sens { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.st-sens::before { content: ""; position: absolute; left: -1.5px; top: -1.5px; width: 3px; height: 3px; border-radius: 50%; background: #1a1410; box-shadow: 0 0 0 .6px #ffffff22; }
.st-sens i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #ffe7c7; opacity: 0; }
.st-scene.sense .st-sens i { animation: st-ring 1.6s cubic-bezier(.2, .6, .3, 1) 2; }
.st-scene.sense .st-sens i + i { animation-delay: .35s; }
@keyframes st-ring { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
.st-sens.led::after { content: ""; position: absolute; left: -1px; top: -1px; width: 2px; height: 2px; border-radius: 50%; background: #ffe7c7; opacity: 0; box-shadow: 0 0 6px #ffe7c7; transition: opacity .4s; }
.st-scene.sense .st-sens.led::after { opacity: .8; }
.st-scene:not(.lit) .st-spot, .st-scene:not(.lit) .st-chip { opacity: 0 !important; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
	.st-cause { left: 10px; top: 10px; max-width: calc(100% - 20px); font-size: 11px; padding: 6px 10px; gap: 7px; }
	.st-mini { top: auto; bottom: 12px; right: 10px; padding: 6px 9px; }
	.st-mini svg { width: 96px; height: 22px; }
	.st-chip { font-size: 10px; padding: 3px 7px; }
	.cv-story .cv-prog { top: auto; bottom: 12px; left: 10px; right: auto; }
}

/* ---------- reduced motion: static first frame, full caption ---------- */
@media (prefers-reduced-motion: reduce) {
	.cv-story .st-fit, .st-cause, .st-e, .st-spot, .st-chip, .st-mini .z, .st-scene *, .st-scr, .st-ui .zone { transition: none !important; animation: none !important; }
	.st-tp, .st-caret { display: none; }
	.st-tb, .st-tg { stroke-dashoffset: 0; }
}
