/**
 * Bricksify: Link Line (widget, Free).
 *
 * Five hover lines for links, all `transition .3s cubic-bezier(.4,0,.2,1)`.
 *   line          ::before .05em tall, scaleX 0 -> 1: grows from the left,
 *                 leaves to the right (origin right at rest, left on hover)
 *   line-reverse  grows from the right, leaves to the left
 *   line-center   grows from the middle both ways
 *   block         a box (white, mix-blend-mode: difference) grows from the
 *                 bottom to 1.4em under the text, inverting it
 *   sweep         the same box, full height, sweeps in from the left
 * Arrow (an up-right arrow .55em, after the text):
 *   rise          fades in from 4px below
 *   rise-turn     the same, turning 45deg (points right)
 *   slide         points right, fades in from 4px to the left
 *
 * CSS only, keyed off data-bxll / data-bxll-arrow on the link.
 *   --bxll-color      line / box colour  (line: the text colour; box: #fff)
 *   --bxll-thickness  line thickness      (.05em)
 *   --bxll-offset     line distance from the bottom of the link   (0)
 *   --bxll-size       block: box height on hover                  (1.4em)
 *   --bxll-dur        duration                                    (.3s)
 */

.bxc-link-line {
	position: relative;
	display: inline-flex;
	align-items: center;
	--bxll-ease: cubic-bezier(.4, 0, .2, 1);
}

.bxc-link-line::before {
	content: "";
	position: absolute;
	left: 0;
	pointer-events: none;
	transition: transform var(--bxll-dur, .3s) var(--bxll-ease), height var(--bxll-dur, .3s) var(--bxll-ease);
}

/* Lines */
.bxc-link-line:is([data-bxll="line"], [data-bxll="line-reverse"], [data-bxll="line-center"])::before {
	bottom: var(--bxll-offset, 0);
	width: 100%;
	height: var(--bxll-thickness, .05em);
	background-color: var(--bxll-color, currentColor);
	transform: scaleX(0);
	transform-origin: right;
}

.bxc-link-line[data-bxll="line-reverse"]::before {
	transform-origin: left;
}

.bxc-link-line[data-bxll="line-center"]::before {
	transform-origin: center;
}

.bxc-link-line:is([data-bxll="line"], [data-bxll="line-reverse"], [data-bxll="line-center"]):is(:hover, :focus-visible)::before {
	transform: scaleX(1);
}

.bxc-link-line[data-bxll="line"]:is(:hover, :focus-visible)::before {
	transform-origin: left;
}

.bxc-link-line[data-bxll="line-reverse"]:is(:hover, :focus-visible)::before {
	transform-origin: right;
}

/* Boxes: inverted by the difference blend. */
.bxc-link-line:is([data-bxll="block"], [data-bxll="sweep"]) {
	padding-left: .5rem;
	padding-right: .5rem;
}

.bxc-link-line:is([data-bxll="block"], [data-bxll="sweep"])::before {
	z-index: 1;
	width: 100%;
	background-color: var(--bxll-color, #fff);
	mix-blend-mode: difference;
}

.bxc-link-line[data-bxll="block"]::before {
	bottom: 0;
	height: 0;
}

.bxc-link-line[data-bxll="block"]:is(:hover, :focus-visible)::before {
	height: var(--bxll-size, 1.4em);
}

.bxc-link-line[data-bxll="sweep"]::before {
	top: 0;
	height: 100%;
	transform: scaleX(0);
	transform-origin: left;
}

.bxc-link-line[data-bxll="sweep"]:is(:hover, :focus-visible)::before {
	transform: scaleX(1);
}

/* Arrow */
.bxc-link-line[data-bxll-arrow]::after {
	content: "";
	flex-shrink: 0;
	width: .55em;
	height: .55em;
	margin-left: .3em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M1.004 9.166 9.337.833m0 0v8.333m0-8.333H1.004' stroke='%23000' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M1.004 9.166 9.337.833m0 0v8.333m0-8.333H1.004' stroke='%23000' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity var(--bxll-dur, .3s) var(--bxll-ease), transform var(--bxll-dur, .3s) var(--bxll-ease);
}

.bxc-link-line[data-bxll-arrow="rise-turn"]::after {
	margin-left: .6em;
}

.bxc-link-line[data-bxll-arrow="slide"]::after {
	margin-left: .6em;
	transform: translateX(-4px) rotate(45deg);
}

.bxc-link-line[data-bxll-arrow]:is(:hover, :focus-visible)::after {
	opacity: 1;
	transform: translateY(0);
}

.bxc-link-line[data-bxll-arrow="rise-turn"]:is(:hover, :focus-visible)::after {
	transform: translateY(0) rotate(45deg);
}

.bxc-link-line[data-bxll-arrow="slide"]:is(:hover, :focus-visible)::after {
	transform: translateX(0) rotate(45deg);
}

/*
 * Button effects (hero buttons, 2026-10-04):
 *   swap    the button's icon sits in a round badge at the right edge; on
 *           hover the badge travels to the left edge turning 45deg while the
 *           side paddings swap (all .5s cubic-bezier(.4,0,.2,1))
 *   circle  a circle (40px) waits under the bottom centre at scale 0 and
 *           grows to scale 18 (.7s cubic-bezier(.4,0,.2,1)), filling the
 *           button behind the label. Set the hover text colour on the
 *           element (Typography, :hover).
 *   --bxll-circle   badge / circle size                    (40px)
 *   --bxll-inset    badge distance from the edge           (4px)
 *   --bxll-side     swap: padding on the label side        (24px)
 *   --bxll-icon     swap: icon colour in the badge   (the text colour of
 *                   the page: #0a0a0a)
 *   --bxll-color    swap: badge colour (#fff); circle: fill (#030712)
 */
.bxc-link-line.bxc-link-line[data-bxll="swap"] {
	position: relative;
	overflow: hidden;
	padding-left: var(--bxll-side, 24px);
	padding-right: calc(var(--bxll-circle, 40px) + var(--bxll-inset, 4px) + 12px);
	transition: padding var(--bxll-dur, .5s) var(--bxll-ease), background-color var(--bxll-dur, .5s) var(--bxll-ease);
}

.bxc-link-line.bxc-link-line[data-bxll="swap"]:is(:hover, :focus-visible) {
	padding-left: calc(var(--bxll-circle, 40px) + var(--bxll-inset, 4px) + 12px);
	padding-right: var(--bxll-side, 24px);
}

.bxc-link-line[data-bxll="swap"]::before {
	content: none;
}

.bxc-link-line[data-bxll="swap"] > :is(i, svg, .icon) {
	position: absolute;
	right: var(--bxll-inset, 4px);
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--bxll-circle, 40px);
	height: var(--bxll-circle, 40px);
	margin: 0;
	padding: calc((var(--bxll-circle, 40px) - 16px) / 2);
	border-radius: 50%;
	background-color: var(--bxll-color, #fff);
	color: var(--bxll-icon, #0a0a0a);
	fill: currentColor;
	font-size: 16px;
	transition: right var(--bxll-dur, .5s) var(--bxll-ease), rotate var(--bxll-dur, .5s) var(--bxll-ease);
}

.bxc-link-line[data-bxll="swap"]:is(:hover, :focus-visible) > :is(i, svg, .icon) {
	right: calc(100% - var(--bxll-circle, 40px) - var(--bxll-inset, 4px));
	rotate: 45deg;
}

.bxc-link-line[data-bxll="circle"] {
	isolation: isolate;
	overflow: hidden;
}

.bxc-link-line[data-bxll="circle"]::before {
	left: 50%;
	top: 100%;
	z-index: -1;
	width: var(--bxll-circle, 40px);
	height: var(--bxll-circle, 40px);
	border-radius: 50%;
	background-color: var(--bxll-color, #030712);
	translate: -50% -50%;
	scale: 0;
	transition: scale var(--bxll-dur, .7s) var(--bxll-ease);
}

.bxc-link-line[data-bxll="circle"]:is(:hover, :focus-visible)::before {
	scale: var(--bxll-scale, 18);
}

/* Circle: an icon in the button can turn on hover (--bxll-turn). */
.bxc-link-line[data-bxll="circle"] > :is(i, svg, .icon) {
	transition: rotate .3s var(--bxll-ease);
}

.bxc-link-line[data-bxll="circle"]:is(:hover, :focus-visible) > :is(i, svg, .icon) {
	rotate: var(--bxll-turn, 0deg);
}

@media (prefers-reduced-motion: reduce) {
	.bxc-link-line,
	.bxc-link-line::before,
	.bxc-link-line::after,
	.bxc-link-line > :is(i, svg, .icon) {
		transition: none;
	}
}
