/*!
 * Metallic buttons (progressive enhancement of .btn--primary and .btn--light).
 * metallic-buttons.js adds .btn--metal and inserts <canvas.btn__metal> + <span.btn__face>.
 * The canvas renders animated chrome; the face sits on top inset by 2px so the metal shows as a
 * 2px rim. Every button gets the same rim, depth and motion: primary buttons have the ACCA-red
 * face, the light button (used on the red closing panel) a white face so it stays visible there.
 * Without JS / WebGL2 none of this applies and main.css's glass buttons stay.
 */
.btn.btn--metal{
	--mt-rest:0 0 0 1px rgba(0,0,0,.3),0 36px 14px rgba(0,0,0,.02),0 20px 12px rgba(0,0,0,.08),0 9px 9px rgba(0,0,0,.12),0 2px 5px rgba(0,0,0,.15),0 10px 28px -12px rgba(200,0,0,.45);
	--mt-hover:0 0 0 1px rgba(0,0,0,.4),0 12px 6px rgba(0,0,0,.05),0 8px 5px rgba(0,0,0,.1),0 4px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.2),0 12px 30px -12px rgba(200,0,0,.6);
	--mt-press:0 0 0 1px rgba(0,0,0,.5),0 1px 2px rgba(0,0,0,.3),0 4px 12px -8px rgba(200,0,0,.4);
	background:transparent;
	-webkit-backdrop-filter:none;backdrop-filter:none;
	text-shadow:0 1px 1px rgba(60,0,0,.35);
	box-shadow:var(--mt-rest);
	transition:transform .3s cubic-bezier(.34,1.56,.64,1),box-shadow .3s ease;
}
.btn.btn--metal:hover{box-shadow:var(--mt-hover);transform:none}
.btn.btn--metal:active{box-shadow:var(--mt-press);transform:translateY(1px) scale(.98)}

/* The metal replaces the glossy highlight. */
.btn--metal::before{display:none}

/* Layers (the button is isolated: -2 metal, -1 face / ripple / pointer light / spinner). */
.btn__metal{position:absolute;inset:0;z-index:-2;display:block;width:100%;height:100%;border-radius:inherit;pointer-events:none}
.btn__face{
	position:absolute;inset:2px;z-index:-1;border-radius:inherit;pointer-events:none;
	background:linear-gradient(180deg,#E01B1B 0%,#C80000 55%,#A80000 100%);
	box-shadow:inset 0 1px 0 rgba(255,255,255,.35),inset 0 -6px 12px -6px rgba(90,0,0,.45);
	transition:box-shadow .3s ease;
}
.btn--metal:active .btn__face{box-shadow:inset 0 2px 4px rgba(0,0,0,.4),inset 0 1px 2px rgba(0,0,0,.3)}

/* Light variant: white face, ACCA-red label (closing panel on red). */
.btn.btn--light.btn--metal{--btn-fg:var(--red-ink);color:var(--red-ink);text-shadow:none}
.btn--light.btn--metal .btn__face{
	background:linear-gradient(180deg,#FFFFFF 0%,#F7F7F9 55%,#ECECF0 100%);
	box-shadow:inset 0 1px 0 #fff,inset 0 -6px 12px -6px rgba(120,0,0,.14);
}
.btn--light.btn--metal:active .btn__face{box-shadow:inset 0 2px 4px rgba(90,0,0,.22),inset 0 1px 2px rgba(90,0,0,.16)}

/* ::after (pointer light) stays above the face but inside the rim; .is-loading keeps its spinner geometry. */
.btn--metal:not(.is-loading)::after{inset:2px;background:radial-gradient(circle 90px at var(--mx,50%) var(--my,0%),rgba(255,255,255,.3),rgba(255,255,255,0) 70%)}
.btn.btn--metal.is-loading{transform:none}

/* Disabled metallic buttons look calm. */
.btn.btn--metal:disabled,.btn.btn--metal[aria-disabled=true]{opacity:.55;box-shadow:var(--mt-press);transform:none}

/* Click ripple (white, from the click point). */
.btn__ripple{
	position:absolute;z-index:-1;width:20px;height:20px;border-radius:50%;pointer-events:none;
	background:radial-gradient(circle,rgba(255,255,255,.4) 0%,rgba(255,255,255,0) 70%);
	transform:translate(-50%,-50%) scale(0);opacity:.6;
	animation:ov-metal-ripple .6s ease-out forwards;
}
.btn--light .btn__ripple{background:radial-gradient(circle,rgba(200,0,0,.18) 0%,rgba(200,0,0,0) 70%)}
@keyframes ov-metal-ripple{
	from{transform:translate(-50%,-50%) scale(0);opacity:.6}
	to{transform:translate(-50%,-50%) scale(4);opacity:0}
}

@media (prefers-reduced-motion:reduce){
	.btn.btn--metal,.btn__face{transition:none}
	.btn.btn--metal:active{transform:none}
	.btn__ripple{display:none}
}

/* Windows high-contrast: drop the decoration, let the system draw the button. */
@media (forced-colors:active){
	.btn__metal,.btn__face,.btn__ripple{display:none}
	.btn.btn--metal{background:ButtonFace;color:ButtonText;text-shadow:none;outline:1px solid ButtonText}
}

@media print{.btn__metal,.btn__face,.btn__ripple{display:none}}
