/* =========================================================================
   Creovate FX — dock taskbar, nav spotlight, gooey drips, cat scene.
   Loaded after main.css.
   ========================================================================= */

@property --r   { syntax: '<percentage>'; inherits: true;  initial-value: 0%; }
@property --pa  { syntax: '<angle>';      inherits: false; initial-value: 0deg; }

/* =========================================================================
   1. Spotlight (shared by the top nav and the dock)
   ========================================================================= */
[data-cv-spot] { position: relative; }
.cv-spot {
	position: absolute; top: 0; bottom: 0; left: 0;
	width: var(--spot-w, 90px);
	transform: translate3d(var(--spot-x, 0px), 0, 0);
	opacity: var(--spot-o, 0);
	pointer-events: none;
	z-index: 0;
	transition: transform .45s cubic-bezier(.2, .9, .25, 1.15), width .45s cubic-bezier(.2, .9, .25, 1.15), opacity .3s ease;
}
/* the beam coming down from above */
.cv-spot::before {
	content: ''; position: absolute; left: 50%; top: -6px; bottom: 6px;
	width: 140%; transform: translateX(-50%);
	background: linear-gradient(180deg, rgba(255, 222, 47, .38), rgba(255, 222, 47, .08) 70%, transparent);
	clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
	filter: blur(3px);
}
/* the pool of light on the "floor" */
.cv-spot::after {
	content: ''; position: absolute; left: 50%; bottom: 2px;
	width: 120%; height: 14px; transform: translateX(-50%);
	background: radial-gradient(50% 50% at 50% 50%, rgba(255, 222, 47, .55), transparent 70%);
	filter: blur(2px);
}
@keyframes cv-spot-flicker { 0%, 100% { opacity: 1; } 46% { opacity: .82; } 48% { opacity: 1; } 72% { opacity: .9; } }

/* the idle sweep — the spotlight looks around every few seconds */
[data-cv-spot].is-sweeping .cv-spot { transition-duration: 1.1s; }

/* top nav: links sit above the light, glow when lit */
.cv-nav .cv-nav__list { position: relative; z-index: 1; }
.cv-nav .cv-nav__list > li > a { transition: background .18s ease, color .18s ease, text-shadow .25s ease; }
.cv-nav .cv-nav__list > li > a.is-lit { color: var(--cv-white); text-shadow: 0 0 14px rgba(255, 222, 47, .55); background: transparent; }
/* a faint torch that follows the pointer across the whole bar */
.cv-header { --mx: -200px; }
.cv-header::after {
	content: ''; position: absolute; inset: 0; pointer-events: none;
	background: radial-gradient(220px 80px at var(--mx) 50%, rgba(255, 222, 47, .07), transparent 70%);
}

/* =========================================================================
   2. Dock — the mini taskbar
   ========================================================================= */
.cv-dock {
	position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	transform: translateX(-50%);
	z-index: 110;
	padding: 7px 9px;
	border-radius: 22px;
	background: rgba(24, 26, 29, .74);
	border: 1px solid rgba(255, 222, 47, .22);
	box-shadow: 0 18px 40px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .06);
	backdrop-filter: blur(16px) saturate(140%);
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	transition: transform .35s cubic-bezier(.2, .8, .3, 1), opacity .3s ease;
}
.cv-dock.is-hidden { transform: translate(-50%, 140%); opacity: 0; }
.cv-dock .cv-spot { top: 4px; bottom: 4px; }
.cv-dock .cv-spot::before { top: -4px; border-radius: 12px; }

.cv-dock__list { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cv-dock__item { position: relative; }
.cv-dock__sep { align-self: center; width: 1px; height: 28px; margin: 0 5px; background: rgba(255, 255, 255, .14); }

.cv-dock__link {
	position: relative;
	display: grid; place-items: center;
	width: 46px; height: 46px;
	border-radius: 14px;
	color: #D8DADE;
	transform-origin: 50% 100%;
	transform: translateY(var(--dy, 0px)) scale(var(--ds, 1));
	transition: transform .18s ease-out, color .2s ease, background .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.cv-dock__link:hover, .cv-dock__link:focus-visible { color: var(--cv-yellow); background: rgba(255, 255, 255, .05); }
.cv-dock__icon { display: grid; place-items: center; width: 22px; height: 22px; }
.cv-dock__icon .cv-icon { width: 22px; height: 22px; }

/* desktop: labels are tooltips */
.cv-dock__label {
	position: absolute; left: 50%; bottom: calc(100% + 12px);
	transform: translate(-50%, 6px);
	padding: 5px 10px; border-radius: 8px;
	background: #16181B; color: var(--cv-white);
	border: 1px solid rgba(255, 222, 47, .28);
	font-size: .74rem; font-weight: 600; white-space: nowrap;
	opacity: 0; pointer-events: none;
	transition: opacity .18s ease, transform .18s ease;
}
.cv-dock__link:hover .cv-dock__label, .cv-dock__link:focus-visible .cv-dock__label { opacity: 1; transform: translate(-50%, 0); }

/* "running app" dot under the page you are on */
.cv-dock__item.is-current .cv-dock__link { color: var(--cv-yellow); }
.cv-dock__item.is-current .cv-dock__link::after {
	content: ''; position: absolute; bottom: 2px; left: 50%;
	width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
	background: var(--cv-yellow); box-shadow: 0 0 8px var(--cv-yellow);
}
.cv-dock__link.is-bounce { animation: cv-dock-bounce .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes cv-dock-bounce { 0% { transform: translateY(0); } 40% { transform: translateY(-12px); } 100% { transform: translateY(0); } }

/* keep the corner widgets clear of the dock */
@media (min-width: 901px) {
	.has-cv-dock .cv-arcade { bottom: 0; }
}

/* phones & tablets: a full-width tab bar with labels under the icons */
@media (max-width: 900px) {
	.cv-dock {
		left: 10px; right: 10px; transform: none;
		bottom: calc(10px + env(safe-area-inset-bottom, 0px));
		padding: 5px 6px; border-radius: 20px;
		background: rgba(24, 26, 29, .96); /* solid on phones so text never shows through */
	}
	.cv-dock.is-hidden { transform: translateY(150%); }
	.cv-dock__list { justify-content: space-between; gap: 0; }
	.cv-dock__item { flex: 1 1 0; min-width: 0; }
	.cv-dock__sep { display: none; }
	.cv-dock__link { width: 100%; height: 54px; gap: 3px; align-content: center; transform: none; }
	.cv-dock__label {
		position: static; transform: none; opacity: .85;
		padding: 0; border: 0; background: none; color: inherit;
		font-size: .6rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
	}
	.cv-dock__link:hover .cv-dock__label { transform: none; }
	.cv-dock__item.is-current .cv-dock__link::after { bottom: auto; top: 3px; }

	.has-cv-dock { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
	.has-cv-dock .cv-totop { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
	.has-cv-dock .cv-bot,
	.has-cv-dock .cv-bot__panel { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
	.has-cv-dock .cv-bot__panel { height: min(460px, calc(100vh - 190px)); }
	.has-cv-dock .cv-arcade { display: none !important; }
}
@media (max-width: 380px) {
	.cv-dock__label { font-size: .54rem; }
	.cv-dock__icon, .cv-dock__icon .cv-icon { width: 20px; height: 20px; }
}
body.cv-drawer-open .cv-dock, .cv-drawer[aria-hidden="false"] ~ .cv-dock { opacity: 0; pointer-events: none; }

/* =========================================================================
   3. Gooey drip — yellow pours into the dark section
   ========================================================================= */
.cv-drip,
section.cv-gooey > .cv-drip.cv-drip {
	position: absolute; left: 0; right: 0; top: 0;
	height: clamp(170px, 20vw, 280px);
	z-index: 3; pointer-events: none;
	--p: 1;           /* scroll progress, JS animates it 0 → 1 */
}
.cv-drip__goo { position: absolute; inset: 0 -30px; filter: url(#cv-goo-filter); }
.cv-drip__band {
	position: absolute; left: 0; right: 0; top: -24px;
	height: calc(44px + 10px * var(--p));
	background: var(--drip);
}
.cv-drip__drop {
	position: absolute; top: 0;
	left: var(--x);
	width: var(--w);
	margin-left: calc(var(--w) / -2);
	height: calc((34px + 120px * var(--len)) * (.2 + .8 * var(--p)));
	background: var(--drip);
	border-radius: 0 0 999px 999px;
	transform-origin: 50% 0;
	animation: cv-ooze 4.8s ease-in-out infinite;
	animation-delay: calc(var(--i) * -.63s);
	transition: height .5s cubic-bezier(.3, .8, .3, 1);
}
.cv-drip__ball {
	position: absolute; left: 50%; bottom: 0;
	width: calc(var(--w) * .7); height: calc(var(--w) * .7);
	margin-left: calc(var(--w) * -.35);
	border-radius: 50%;
	background: var(--drip);
	animation: cv-drop-fall 4.8s cubic-bezier(.55, 0, .9, .45) infinite;
	animation-delay: calc(var(--i) * -.63s + 1.4s);
	opacity: calc(.15 + .85 * var(--p));
}
@keyframes cv-ooze {
	0%, 100% { transform: scaleY(.86) scaleX(1); }
	45%      { transform: scaleY(1.08) scaleX(.9); }
	60%      { transform: scaleY(.94) scaleX(1.05); }
}
@keyframes cv-drop-fall {
	0%, 30%  { transform: translateY(-40%) scale(.85); opacity: 0; }
	40%      { transform: translateY(0) scale(1); opacity: 1; }
	75%      { transform: translateY(120px) scale(.75); opacity: 1; }
	100%     { transform: translateY(190px) scale(.4); opacity: 0; }
}
/* keep the dark section's own content above the drip */
section.cv-gooey > .cv-drip ~ .cv-wrap { z-index: 4; }
@media (max-width: 700px) {
	.cv-drip__drop:nth-child(3n) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.cv-drip__drop, .cv-drip__ball { animation: none; }
	.cv-drip__ball { display: none; }
}

/* =========================================================================
   4. Night / day cat scene
   ========================================================================= */
.cv-catscene {
	position: relative;
	padding-block: clamp(48px, 6vw, 88px);
	background: radial-gradient(120% 80% at 50% 0%, #1B1D21 0%, #0E0F11 70%);
	color: #C5C9CF;
	overflow: hidden;
	transition: background 2.4s ease;
}
.cv-catscene.is-day { background: radial-gradient(120% 80% at 50% 0%, #2A2C31 0%, #16181B 70%); }
.cv-catscene__head { text-align: center; margin-bottom: clamp(22px, 3vw, 36px); }
.cv-catscene__head h2 { color: var(--cv-white); margin-bottom: 8px; }
.cv-catscene__lead { max-width: 56ch; margin-inline: auto; color: #A6AAB2; }

.cv-catscene__frame {
	max-width: 1280px; margin-inline: auto; padding-inline: var(--cv-gutter);
	perspective: 1600px;
}
.cv-catscene__stage {
	--tx: 0deg; --ty: 0deg;
	position: relative;
	aspect-ratio: var(--ratio, 16 / 9);
	border-radius: clamp(14px, 2vw, 26px);
	transform-style: preserve-3d;
	box-shadow: 0 40px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 222, 47, .14);
}
.cv-catscene__cam {
	position: absolute; inset: 0;
	border-radius: inherit;
	overflow: hidden;
	transform: scale(1);
	transition: transform 11s cubic-bezier(.15, .6, .2, 1);
	background: #0B0C0E;
	isolation: isolate;
}
.cv-catscene.is-entered .cv-catscene__cam { transform: scale(1.05); }

.cv-cat__img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
	user-select: none; -webkit-user-drag: none;
	pointer-events: none;
}

/* --- day layer 1: the sky through the window ------------------------------ */
.cv-cat__day--sky {
	clip-path: inset(var(--win-y) calc(100% - var(--win-x) - var(--win-w)) calc(100% - var(--win-y) - var(--win-h)) var(--win-x) round 6px);
	opacity: 0;
	filter: brightness(.6) saturate(.6) hue-rotate(-12deg);
	transition: opacity 1.8s ease, filter 2.4s ease;
}
/* --- day layer 2: sunlight floods the room from the window ---------------- */
.cv-cat__day--room {
	--r: 0%;
	-webkit-mask-image: radial-gradient(170% 170% at calc(var(--win-x) + var(--win-w) / 2) calc(var(--win-y) + var(--win-h) / 2), #000 calc(var(--r) * .62), transparent var(--r));
	mask-image: radial-gradient(170% 170% at calc(var(--win-x) + var(--win-w) / 2) calc(var(--win-y) + var(--win-h) / 2), #000 calc(var(--r) * .62), transparent var(--r));
	opacity: 0;
	transition: --r 2.6s cubic-bezier(.45, .05, .3, 1), opacity 1.2s ease;
}
/* --- cat patches: the sleeping cat sits on top until it wakes ------------- */
.cv-cat__patch {
	-webkit-mask-image: radial-gradient(calc(var(--cat-w) / 2) calc(var(--cat-h) / 2) at var(--cat-x) var(--cat-y), #000 62%, transparent 100%);
	mask-image: radial-gradient(calc(var(--cat-w) / 2) calc(var(--cat-h) / 2) at var(--cat-x) var(--cat-y), #000 62%, transparent 100%);
	transform-origin: var(--cat-x) calc(var(--cat-y) + var(--cat-h) / 2);
}
.cv-cat__patch--sleep { opacity: 1; animation: cv-cat-breathe 3.8s ease-in-out infinite; transition: opacity 1.3s ease, filter 1.3s ease; }
.cv-cat__patch--awake { opacity: 0; transform: translateY(2.4%) scale(.965, .93); filter: blur(4px); transition: opacity 1.4s ease, transform 1.6s cubic-bezier(.25, 1.25, .4, 1), filter 1.4s ease; }
@keyframes cv-cat-breathe { 0%, 100% { transform: scale(1, 1); } 45% { transform: scale(1.006, 1.016); } }
@keyframes cv-cat-stretch {
	0%   { transform: scale(1, 1); }
	35%  { transform: scale(1.05, .965) translateX(.6%); }
	65%  { transform: scale(.985, 1.04) translateY(-.8%); }
	100% { transform: scale(1, 1.02) translateY(-1%); }
}

/* --- curtains sway in the breeze ----------------------------------------- */
.cv-cat__curtain {
	clip-path: inset(var(--cur-y, 0) calc(100% - var(--cur-x, 0%) - var(--cur-w, 0%)) calc(100% - var(--cur-y, 0%) - var(--cur-h, 0%)) var(--cur-x, 0));
	transform-origin: calc(var(--cur-x, 0%) + var(--cur-w, 0%) / 2) var(--cur-y, 0%);
	animation: cv-curtain 6.5s ease-in-out infinite;
	transition: opacity 2s ease;
}
.cv-cat__curtain--day { opacity: 0; }
@keyframes cv-curtain {
	0%, 100% { transform: skewX(0deg); }
	30%      { transform: skewX(.9deg); }
	62%      { transform: skewX(-.6deg); }
}

/* --- light ---------------------------------------------------------------- */
.cv-cat__fx { position: absolute; inset: 0; pointer-events: none; }
.cv-cat__moon {
	background: radial-gradient(14% 18% at var(--moon-x) var(--moon-y), rgba(200, 220, 255, .38), rgba(150, 175, 230, .12) 45%, transparent 100%);
	mix-blend-mode: screen;
	transition: opacity 1.4s ease;
}
.cv-cat__lamp {
	background:
		radial-gradient(9% 13% at var(--lamp-x) var(--lamp-y), rgba(255, 230, 90, .75), transparent 100%),
		radial-gradient(42% 52% at var(--lamp-x) calc(var(--lamp-y) + 12%), rgba(255, 210, 40, .28), transparent 100%);
	mix-blend-mode: screen;
	animation: cv-lamp-hum 4s ease-in-out infinite;
	transition: opacity .9s ease;
}
@keyframes cv-lamp-hum { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
@keyframes cv-lamp-flicker-off {
	0% { opacity: 1; } 12% { opacity: .35; } 18% { opacity: .95; } 28% { opacity: .2; } 34% { opacity: .7; } 100% { opacity: 0; }
}
@keyframes cv-lamp-flicker-on {
	0% { opacity: 0; } 20% { opacity: .7; } 26% { opacity: .1; } 40% { opacity: .9; } 46% { opacity: .4; } 100% { opacity: 1; }
}
.cv-cat__sun {
	background: radial-gradient(60% 70% at calc(var(--win-x) + var(--win-w) / 2) calc(var(--win-y) + var(--win-h) / 2), rgba(255, 236, 170, .34), rgba(255, 210, 120, .08) 55%, transparent 80%);
	mix-blend-mode: soft-light;
	opacity: 0;
	transition: opacity 2.6s ease;
}
.cv-cat__beams {
	background: repeating-conic-gradient(from 200deg at calc(var(--win-x) + var(--win-w) / 2) calc(var(--win-y) + var(--win-h) * .2), rgba(255, 244, 200, .16) 0deg 3deg, transparent 3deg 9deg);
	-webkit-mask-image: radial-gradient(80% 90% at calc(var(--win-x) + var(--win-w) / 2) var(--win-y), #000 10%, transparent 70%);
	mask-image: radial-gradient(80% 90% at calc(var(--win-x) + var(--win-w) / 2) var(--win-y), #000 10%, transparent 70%);
	mix-blend-mode: screen;
	opacity: 0;
	filter: blur(6px);
	transition: opacity 3s ease;
}
.cv-cat__dust {
	background-image:
		radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 250, 220, .8), transparent),
		radial-gradient(1px 1px at 60% 70%, rgba(255, 250, 220, .7), transparent),
		radial-gradient(1.2px 1.2px at 80% 20%, rgba(255, 250, 220, .8), transparent),
		radial-gradient(1px 1px at 35% 85%, rgba(255, 250, 220, .6), transparent),
		radial-gradient(1.4px 1.4px at 50% 45%, rgba(255, 250, 220, .7), transparent);
	background-size: 240px 200px;
	-webkit-mask-image: radial-gradient(60% 80% at calc(var(--win-x) + var(--win-w) / 2) calc(var(--win-y) + var(--win-h)), #000 10%, transparent 70%);
	mask-image: radial-gradient(60% 80% at calc(var(--win-x) + var(--win-w) / 2) calc(var(--win-y) + var(--win-h)), #000 10%, transparent 70%);
	opacity: 0;
	animation: cv-dust 22s linear infinite;
	transition: opacity 3s ease;
}
@keyframes cv-dust { to { background-position: 240px -400px, -240px -300px, 120px -500px, -120px -350px, 200px -450px; } }
.cv-cat__vignette {
	background: radial-gradient(120% 100% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55) 100%);
	transition: opacity 2.4s ease;
}

/* --- hologram text ------------------------------------------------------ */
.cv-cat__holo {
	position: absolute;
	left: var(--lamp-x); top: calc(var(--lamp-y) - 12%);
	transform: translate(-30%, -50%) translateZ(0);
	font-family: 'Orbitron', var(--cv-font);
	font-weight: 800;
	font-size: clamp(.7rem, 1.9vw, 1.5rem);
	letter-spacing: .22em;
	white-space: nowrap;
	color: rgba(255, 236, 120, .92);
	text-shadow: 0 0 6px rgba(255, 222, 47, .9), 0 0 18px rgba(255, 222, 47, .55), 0 0 40px rgba(255, 200, 0, .35);
	mix-blend-mode: screen;
	opacity: 0;
	animation: cv-holo-float 6s ease-in-out infinite, cv-holo-flicker 7s steps(1) infinite;
	transition: opacity 1.4s ease;
	pointer-events: none;
}
.cv-cat__holo::before { /* scanlines */
	content: ''; position: absolute; inset: -20% -6%;
	background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px);
	mix-blend-mode: multiply;
}
.cv-cat__holo::after { /* chroma ghost */
	content: attr(data-text);
	position: absolute; left: 2px; top: 0;
	color: rgba(120, 240, 255, .35);
	text-shadow: none;
	clip-path: inset(0 0 55% 0);
	animation: cv-holo-glitch 3.2s steps(2) infinite;
}
@keyframes cv-holo-float   { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }
@keyframes cv-holo-flicker { 0%, 100% { filter: none; } 62% { filter: brightness(.6); } 63% { filter: none; } 88% { filter: brightness(.75); } 89% { filter: none; } }
@keyframes cv-holo-glitch  { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-3px); } }

/* --- video mode (optional wake / sleep clips) ----------------------------- */
.cv-cat__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 20; opacity: 0; transition: opacity .35s ease; }
.cv-cat__video.is-on { opacity: 1; }

/* =========================================================================
   States. Night is the default (also what renders without JavaScript).
   Transition delays live on the DESTINATION state so it plays in order
   both ways: wake = sky → room → lamp off → cat;  sleep = cat → room → sky → lamp on.
   ========================================================================= */
.is-night .cv-cat__holo { opacity: .9; transition-delay: 2.6s; }
.is-night .cv-cat__lamp { opacity: 1; }
.is-night .cv-cat__moon { opacity: 1; transition-delay: 2s; }
.is-night .cv-cat__vignette { opacity: 1; transition-delay: 1.6s; }
.is-night .cv-cat__day--sky  { transition-delay: 1.5s; }
.is-night .cv-cat__day--room { transition-delay: .7s, 1.6s; }
.is-night .cv-cat__patch--awake { transition-delay: 0s; }
.is-night .cv-cat__patch--sleep { transition-delay: .5s; }
.is-night .cv-cat__curtain--day { transition-delay: 1.4s; }
.cv-catscene.is-sleeping .cv-cat__lamp { animation: cv-lamp-flicker-on 1.3s 2.3s ease-out both, cv-lamp-hum 4s 3.6s ease-in-out infinite; }

.is-day .cv-cat__day--sky  { opacity: 1; filter: none; transition-delay: 0s; }
.is-day .cv-cat__day--room { --r: 115%; opacity: 1; transition-delay: .9s, .9s; }
.is-day .cv-cat__moon { opacity: 0; transition-delay: 0s; }
.is-day .cv-cat__lamp { opacity: 0; animation: cv-lamp-flicker-off 1.1s .8s ease-out both; }
.is-day .cv-cat__holo { opacity: 0; transition-delay: .7s; }
.is-day .cv-cat__sun { opacity: 1; transition-delay: 1.2s; }
.is-day .cv-cat__beams { opacity: .9; transition-delay: 1.6s; }
.is-day .cv-cat__dust { opacity: .9; transition-delay: 2.2s; }
.is-day .cv-cat__vignette { opacity: .3; transition-delay: .8s; }
.is-day .cv-cat__curtain--day { opacity: 1; transition-delay: .9s; }
.is-day .cv-cat__patch--sleep { opacity: 0; filter: blur(2px); animation: cv-cat-stretch 1.7s 2s ease-in-out both; transition-delay: 3.1s, 3.1s; }
.is-day .cv-cat__patch--awake { opacity: 1; transform: none; filter: none; transition-delay: 3.2s, 3.2s, 3.2s; }

/* Instant state (used after a video clip finishes, and on first paint) */
.cv-catscene.is-instant * { transition-duration: 0s !important; transition-delay: 0s !important; animation-delay: 0s !important; }

/* =========================================================================
   5. The fabric cushion button
   ========================================================================= */
.cv-cushion-wrap {
	position: absolute;
	left: var(--btn-x, 5%); bottom: var(--btn-y, 8%);
	z-index: 30;
	transform: translateZ(70px);
	transform-style: preserve-3d;
}
.cv-cushion {
	--lift: 0px; --glow: .55; --squish: 1;
	position: relative;
	display: block;
	padding: 0; border: 0; background: none;
	border-radius: 24px;
	cursor: pointer;
	color: var(--cv-yellow);
	transform: translateY(calc(var(--lift) + var(--float, 0px))) scale(var(--squish), calc(2 - var(--squish)));
	transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
	animation: cv-cushion-float 4.6s ease-in-out infinite;
	-webkit-tap-highlight-color: transparent;
}
@keyframes cv-cushion-float { 0%, 100% { --float: 0px; } 50% { --float: -7px; } }
@property --float { syntax: '<length>'; inherits: true; initial-value: 0px; }

.cv-cushion__face {
	position: relative;
	display: flex; align-items: center; gap: 12px;
	padding: clamp(13px, 1.6vw, 18px) clamp(18px, 2.2vw, 26px);
	border-radius: 24px;
	font-family: 'Orbitron', var(--cv-font);
	font-weight: 800;
	font-size: clamp(.64rem, 1.05vw, .84rem);
	letter-spacing: .14em;
	text-transform: uppercase;
	line-height: 1.15;
	text-shadow: 0 0 8px rgba(255, 222, 47, .55);
	/* puff highlight, fabric fuzz, weave, base */
	background:
		radial-gradient(120% 95% at 32% 18%, rgba(255, 255, 255, .13), transparent 52%),
		radial-gradient(90% 80% at 70% 100%, rgba(0, 0, 0, .55), transparent 60%),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
		repeating-linear-gradient(45deg, rgba(255, 255, 255, .035) 0 1.5px, transparent 1.5px 3.5px),
		repeating-linear-gradient(-45deg, rgba(0, 0, 0, .35) 0 1.5px, transparent 1.5px 3.5px),
		#131416;
	background-size: auto, auto, 160px 160px, auto, auto, auto;
	box-shadow:
		inset 0 2px 2px rgba(255, 255, 255, .09),
		inset 0 -8px 14px rgba(0, 0, 0, .7),
		inset 0 8px 16px rgba(255, 255, 255, .035),
		0 0 0 1px rgba(255, 222, 47, .42),
		0 0 calc(22px * var(--glow)) rgba(255, 222, 47, calc(.5 * var(--glow))),
		0 0 calc(60px * var(--glow)) rgba(255, 200, 0, calc(.18 * var(--glow))),
		0 16px 26px rgba(0, 0, 0, .55);
	transition: box-shadow .35s ease, background-size .6s ease;
}
.cv-cushion__stitch {
	position: absolute; inset: 7px;
	border-radius: 17px;
	border: 2px dashed rgba(255, 222, 47, .88);
	filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .75));
	pointer-events: none;
}
.cv-cushion__icon { position: relative; display: grid; place-items: center; width: 22px; height: 22px; flex: none; }
.cv-cushion__icon .cv-icon { position: absolute; width: 22px; height: 22px; filter: drop-shadow(0 0 6px rgba(255, 222, 47, .8)); transition: opacity .4s ease, transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.cv-cushion__icon .cv-icon + .cv-icon { opacity: 0; transform: rotate(-90deg) scale(.6); }
.cv-catscene.is-day .cv-cushion__icon .cv-icon:first-child { opacity: 0; transform: rotate(90deg) scale(.6); }
.cv-catscene.is-day .cv-cushion__icon .cv-icon + .cv-icon { opacity: 1; transform: none; }
.cv-cushion__label { position: relative; max-width: 15ch; }

/* travelling neon pulse on click */
.cv-cushion__pulse {
	position: absolute; inset: -3px;
	border-radius: 27px;
	padding: 3px;
	background: conic-gradient(from var(--pa), transparent 0 62%, rgba(255, 240, 150, 1) 80%, #FFDE2F 86%, transparent 100%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	opacity: 0;
	pointer-events: none;
	filter: drop-shadow(0 0 6px #FFDE2F);
}
.cv-cushion.is-pulsing .cv-cushion__pulse { animation: cv-pulse-run 1.1s cubic-bezier(.4, 0, .2, 1) 2; }
@keyframes cv-pulse-run { 0% { --pa: 0deg; opacity: 1; } 90% { opacity: 1; } 100% { --pa: 360deg; opacity: 0; } }

/* hover: rises, glows, fabric shows */
.cv-cushion:hover, .cv-cushion:focus-visible { --lift: -7px; --glow: 1; }
.cv-cushion:hover .cv-cushion__face, .cv-cushion:focus-visible .cv-cushion__face { background-size: auto, auto, 120px 120px, auto, auto, auto; }
.cv-cushion:hover .cv-cushion__stitch { animation: cv-stitch-run 1.6s linear infinite; }
@keyframes cv-stitch-run { to { border-color: rgba(255, 240, 150, 1); } }
.cv-cushion:focus-visible { outline: 2px solid var(--cv-yellow); outline-offset: 6px; }

/* press: a soft squash like a real cushion */
.cv-cushion:active, .cv-cushion.is-pressed { --lift: 3px; --squish: 1.04; transition-duration: .12s; }
.cv-cushion:active .cv-cushion__face, .cv-cushion.is-pressed .cv-cushion__face {
	box-shadow:
		inset 0 6px 16px rgba(0, 0, 0, .8),
		inset 0 -2px 6px rgba(255, 255, 255, .05),
		0 0 0 1px rgba(255, 222, 47, .6),
		0 0 30px rgba(255, 222, 47, .6),
		0 6px 12px rgba(0, 0, 0, .55);
}
.cv-cushion__shadow {
	position: absolute; left: 10%; right: 10%; bottom: -16px; height: 14px;
	border-radius: 50%;
	background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, .65), transparent 70%);
	filter: blur(3px);
	transform: scale(calc(1 + var(--float, 0px) / 40px));
	pointer-events: none;
}
.cv-cushion[disabled] { cursor: progress; }

/* screen-reader status */
.cv-cat__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* phones: the button sits under the picture so it never covers the cat */
@media (max-width: 640px) {
	.cv-catscene__stage { transform: none !important; }
	.cv-cushion-wrap { position: relative; left: auto; bottom: auto; transform: none; display: flex; justify-content: center; margin-top: 26px; }
	.cv-catscene__stage { margin-bottom: 0; }
	.cv-catscene__frame .cv-catscene__stage { border-radius: 16px; }
	.cv-cushion-wrap .cv-cushion__shadow { left: 25%; right: 25%; }
}
@media (max-width: 640px) {
	.cv-catscene__stage { aspect-ratio: auto; box-shadow: none; }
	.cv-catscene__cam { position: relative; aspect-ratio: var(--ratio, 16 / 9); box-shadow: 0 24px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 222, 47, .14); }
}

@media (prefers-reduced-motion: reduce) {
	.cv-catscene *, .cv-catscene *::before, .cv-catscene *::after { animation: none !important; transition-duration: .01s !important; transition-delay: 0s !important; }
	.cv-catscene.is-entered .cv-catscene__cam { transform: none; }
}

/* =========================================================================
   6. Layout tuner (?catdebug=1, admins only)
   ========================================================================= */
.cv-cat__debug { position: absolute; inset: 0; z-index: 50; }
.cv-cat__box {
	position: absolute; border: 2px dashed #FFDE2F; background: rgba(255, 222, 47, .08);
	color: #FFDE2F; font: 700 11px/1 monospace; padding: 3px; cursor: move; touch-action: none;
}
.cv-cat__box--pt { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; padding: 0; }
.cv-cat__box--pt span { position: absolute; left: 20px; top: 0; white-space: nowrap; }
.cv-cat__box i { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #FFDE2F; cursor: nwse-resize; }
.cv-cat__out {
	position: absolute; left: 10px; right: 10px; top: 10px; z-index: 60;
	display: flex; gap: 8px; align-items: center;
	padding: 8px; border-radius: 10px; background: rgba(0, 0, 0, .82); color: #fff; font: 12px/1.3 monospace;
}
.cv-cat__out input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid #555; border-radius: 6px; background: #111; color: #FFDE2F; font: inherit; }
.cv-cat__out button { padding: 6px 10px; border: 0; border-radius: 6px; background: #FFDE2F; color: #111; font-weight: 700; cursor: pointer; }

/* give the dark section's content room so the drips never sit on top of text */
section:has(> .cv-drip) { padding-top: calc(var(--cv-section-y, 72px) + clamp(80px, 9vw, 140px)); }
.cv-catscene.is-debug .cv-catscene__cam { transform: none !important; }
