/*
 * LinkNest — public profile pages.
 * Every colour, font and radius comes from custom properties set on .lnst-root,
 * so one stylesheet serves every theme.
 */

.lnst-html,
.lnst-body {
	margin: 0;
	padding: 0;
}

.lnst-body {
	min-height: 100vh;
	min-height: 100dvh;
}

.lnst-root {
	--lnst-radius: 14px;
	--lnst-media-radius: 9px;
	--lnst-card-radius: min(var(--lnst-radius), 20px);
	--lnst-avatar: 96px;
	position: relative;
	isolation: isolate;
	color: var(--lnst-text);
	font-family: var(--lnst-font-body);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.lnst-root *,
.lnst-root *::before,
.lnst-root *::after {
	box-sizing: border-box;
}

/* Zero-specificity resets, so component rules below always win. */
:where(.lnst-root) img {
	max-width: 100%;
}

:where(.lnst-root) a {
	color: inherit;
}

.lnst-full {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

/* Button shape */
.lnst-shape--square {
	--lnst-radius: 0px;
	--lnst-media-radius: 0px;
}

.lnst-shape--rounded {
	--lnst-radius: 14px;
	--lnst-media-radius: 9px;
}

.lnst-shape--pill {
	--lnst-radius: 999px;
	--lnst-media-radius: 50%;
}

/* Photo size */
.lnst-avatar-size--s {
	--lnst-avatar: 72px;
}

.lnst-avatar-size--m {
	--lnst-avatar: 96px;
}

.lnst-avatar-size--l {
	--lnst-avatar: 128px;
}

/* ---------------------------------------------------------------------
 * Background
 * ------------------------------------------------------------------ */

.lnst-bg {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	background: var(--lnst-bg);
	pointer-events: none;
}

/* Cover the largest viewport so mobile toolbars never reveal a gap. */
.lnst-full .lnst-bg {
	bottom: auto;
	height: 100vh;
	height: 100lvh;
}

.lnst-inline .lnst-bg {
	position: absolute;
}

.lnst-bg--gradient .lnst-bg {
	background: linear-gradient(var(--lnst-angle), var(--lnst-bg), var(--lnst-bg-2));
}

.lnst-bg--animated .lnst-bg {
	background: linear-gradient(var(--lnst-angle), var(--lnst-bg), var(--lnst-bg-2), var(--lnst-bg-3), var(--lnst-bg-2), var(--lnst-bg));
	background-size: 300% 300%;
	animation: lnst-drift 22s ease-in-out infinite alternate;
}

@keyframes lnst-drift {
	from {
		background-position: 0% 30%;
	}

	to {
		background-position: 100% 70%;
	}
}

.lnst-bg--image .lnst-bg::before {
	content: "";
	position: absolute;
	inset: calc(var(--lnst-blur) * -2.5);
	background: var(--lnst-bg-image, none) center / cover no-repeat;
	filter: blur(var(--lnst-blur));
}

.lnst-bg--image .lnst-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--lnst-overlay));
}

.lnst-pattern {
	position: absolute;
	inset: 0;
	color: rgba(var(--lnst-text-rgb), 0.1);
}

.lnst-pattern--dots .lnst-pattern {
	background-image: radial-gradient(currentColor 1.4px, transparent 1.9px);
	background-size: 16px 16px;
}

.lnst-pattern--grid .lnst-pattern {
	background-image:
		linear-gradient(currentColor 1px, transparent 1px),
		linear-gradient(90deg, currentColor 1px, transparent 1px);
	background-size: 32px 32px;
	background-position: center top;
}

.lnst-pattern--lines .lnst-pattern {
	background-image: repeating-linear-gradient(0deg, currentColor 0 1px, transparent 1px 4px);
}

.lnst-pattern--diagonal .lnst-pattern {
	background-image: repeating-linear-gradient(-45deg, currentColor 0 1px, transparent 1px 14px);
}

/* ---------------------------------------------------------------------
 * Page
 * ------------------------------------------------------------------ */

.lnst-page {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	width: 100%;
	max-width: 600px;
	margin: 0 auto;
	padding: calc(56px + env(safe-area-inset-top, 0px)) 20px calc(40px + env(safe-area-inset-bottom, 0px));
}

.lnst-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 28px;
	text-align: center;
}

.lnst-avatar {
	display: block;
	flex: none;
	width: var(--lnst-avatar);
	height: var(--lnst-avatar);
	margin: 0 0 18px;
	border-radius: 50%;
	object-fit: cover;
	background: rgba(var(--lnst-text-rgb), 0.08);
}

.lnst-avatar--rounded .lnst-avatar {
	border-radius: 28%;
}

.lnst-avatar--square .lnst-avatar {
	border-radius: 0;
}

.lnst-avatar--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--lnst-text);
	background: rgba(var(--lnst-text-rgb), 0.1);
	font-family: var(--lnst-font-heading);
	font-weight: var(--lnst-heading-wght);
	font-size: calc(var(--lnst-avatar) * 0.36);
	letter-spacing: 0;
	line-height: 1;
}

.lnst-name {
	margin: 0;
	color: inherit;
	font-family: var(--lnst-font-heading);
	font-weight: var(--lnst-heading-wght);
	font-size: calc(clamp(1.75rem, 7vw, 2.25rem) * var(--lnst-heading-size, 1));
	letter-spacing: var(--lnst-heading-ls);
	line-height: 1.1;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

.lnst-verified {
	margin-left: 0.3em;
	font-size: 0.5em;
	vertical-align: 0.32em;
}

.lnst-bio {
	max-width: 34em;
	margin: 12px 0 0;
	font-size: 1rem;
	line-height: 1.55;
	opacity: 0.82;
	white-space: pre-line;
	text-wrap: pretty;
}

/* Social icons */
.lnst-socials {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 6px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.lnst-socials li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lnst-social {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--lnst-text);
	font-size: 22px;
	text-decoration: none;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.lnst-social:hover {
	transform: translateY(-2px);
}

.lnst-social:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.lnst-social--filled .lnst-social {
	background: var(--lnst-btn);
	color: var(--lnst-btn-contrast);
	font-size: 18px;
}

.lnst-socials-bottom {
	display: flex;
	justify-content: center;
	margin-top: 28px;
}

.lnst-socials-bottom .lnst-socials {
	margin-top: 0;
}

/* ---------------------------------------------------------------------
 * Blocks
 * ------------------------------------------------------------------ */

.lnst-blocks {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
}

.lnst-item {
	margin: 0;
}

.lnst-item--header {
	margin-top: 14px;
}

.lnst-item--header:first-child {
	margin-top: 0;
}

/* Link buttons */
.lnst-link {
	position: relative;
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) 48px;
	align-items: center;
	width: 100%;
	min-height: 60px;
	margin: 0;
	padding: 6px;
	border: 0;
	border-radius: var(--lnst-radius);
	background: var(--lnst-btn);
	color: var(--lnst-btn-text);
	font-family: var(--lnst-font-body);
	font-size: 1rem;
	font-weight: var(--lnst-body-wght);
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.lnst-link:hover {
	transform: translateY(-2px);
}

.lnst-link:active {
	transform: translateY(0) scale(0.99);
}

.lnst-link:focus-visible {
	outline: 2px solid var(--lnst-text);
	outline-offset: 3px;
}

.lnst-link-media {
	grid-column: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: var(--lnst-media-radius);
	font-size: 20px;
}

.lnst-link-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lnst-link-text {
	grid-column: 2;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	padding: 8px 4px;
}

.lnst-link-title {
	overflow-wrap: anywhere;
}

.lnst-link-sub {
	font-size: 0.8125rem;
	font-weight: 400;
	opacity: 0.75;
}

/* Featured links: the thumbnail becomes a large image */
.lnst-link--featured {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	border-radius: var(--lnst-card-radius);
}

.lnst-link-cover {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: max(0px, calc(var(--lnst-card-radius) - 4px));
	background: rgba(var(--lnst-text-rgb), 0.08);
}

.lnst-link-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lnst-link--featured .lnst-link-text {
	padding: 12px 10px 8px;
}

/* Button styles */
.lnst-btn--soft .lnst-link {
	box-shadow: 0 1px 2px rgba(var(--lnst-text-rgb), 0.08), 0 8px 20px -8px rgba(var(--lnst-text-rgb), 0.28);
}

.lnst-btn--soft .lnst-link:hover {
	box-shadow: 0 2px 4px rgba(var(--lnst-text-rgb), 0.08), 0 14px 28px -10px rgba(var(--lnst-text-rgb), 0.36);
}

.lnst-btn--outline .lnst-link {
	background: transparent;
	box-shadow: inset 0 0 0 2px var(--lnst-btn);
}

.lnst-btn--outline .lnst-link:hover {
	background: var(--lnst-btn);
	color: var(--lnst-btn-contrast);
}

.lnst-btn--hard .lnst-link {
	border: 2px solid var(--lnst-btn-shadow);
	box-shadow: 4px 4px 0 var(--lnst-btn-shadow);
}

.lnst-btn--hard .lnst-link:hover {
	transform: translate(-2px, -2px);
	box-shadow: 6px 6px 0 var(--lnst-btn-shadow);
}

.lnst-btn--hard .lnst-link:active {
	transform: translate(2px, 2px);
	box-shadow: 2px 2px 0 var(--lnst-btn-shadow);
}

.lnst-btn--glass .lnst-link {
	background: rgba(var(--lnst-btn-rgb), 0.14);
	box-shadow: inset 0 0 0 1px rgba(var(--lnst-btn-rgb), 0.32);
	-webkit-backdrop-filter: blur(16px) saturate(150%);
	backdrop-filter: blur(16px) saturate(150%);
}

.lnst-btn--glass .lnst-link:hover {
	background: rgba(var(--lnst-btn-rgb), 0.24);
}

/* Attention animations */
.lnst-hl--pulse {
	animation: lnst-pulse 2.2s ease-in-out infinite;
}

@keyframes lnst-pulse {
	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.03);
	}
}

.lnst-hl--wobble {
	animation: lnst-wobble 4s ease-in-out infinite;
}

@keyframes lnst-wobble {
	0%,
	76%,
	100% {
		transform: rotate(0);
	}

	80% {
		transform: rotate(-2deg);
	}

	84% {
		transform: rotate(2deg);
	}

	88% {
		transform: rotate(-1.5deg);
	}

	92% {
		transform: rotate(1deg);
	}

	96% {
		transform: rotate(-0.5deg);
	}
}

.lnst-hl--glow::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	animation: lnst-glow 2.4s ease-in-out infinite;
}

@keyframes lnst-glow {
	0%,
	100% {
		box-shadow: 0 0 0 0 rgba(var(--lnst-btn-rgb), 0);
	}

	50% {
		box-shadow: 0 0 0 5px rgba(var(--lnst-btn-rgb), 0.25), 0 0 26px 2px rgba(var(--lnst-btn-rgb), 0.55);
	}
}

/* Headers and text */
.lnst-section {
	margin: 0;
	color: inherit;
	font-family: var(--lnst-font-heading);
	font-weight: var(--lnst-heading-wght);
	font-size: calc(1.125rem * var(--lnst-heading-size, 1));
	letter-spacing: var(--lnst-heading-ls);
	line-height: 1.3;
	text-align: center;
	text-wrap: balance;
}

.lnst-text {
	font-size: 0.9375rem;
	line-height: 1.6;
	text-align: center;
	opacity: 0.86;
	text-wrap: pretty;
}

.lnst-text p {
	margin: 0 0 0.75em;
}

.lnst-text p:last-child {
	margin-bottom: 0;
}

.lnst-text a {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Embeds */
.lnst-embed {
	width: 100%;
	overflow: hidden;
	border-radius: var(--lnst-card-radius);
	line-height: 0;
}

.lnst-embed iframe {
	display: block;
	width: 100% !important;
	max-width: 100%;
	border: 0;
}

.lnst-embed--video iframe {
	height: auto !important;
	aspect-ratio: 16 / 9;
}

.lnst-embed--other {
	display: flex;
	justify-content: center;
	line-height: normal;
}

.lnst-embed blockquote {
	margin: 0 auto !important;
}

.lnst-embed-placeholder,
.lnst-empty {
	margin: 0;
	padding: 24px 18px;
	border: 1.5px dashed rgba(var(--lnst-text-rgb), 0.35);
	border-radius: var(--lnst-card-radius);
	font-size: 0.875rem;
	text-align: center;
	opacity: 0.8;
}

/* Email signup */
.lnst-subscribe {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 18px;
	border-radius: var(--lnst-card-radius);
	background: rgba(var(--lnst-text-rgb), 0.04);
	box-shadow: inset 0 0 0 1px rgba(var(--lnst-text-rgb), 0.1);
	text-align: center;
}

.lnst-subscribe-title {
	margin: 0 0 4px;
	font-family: var(--lnst-font-heading);
	font-weight: var(--lnst-heading-wght);
	font-size: calc(1.0625rem * var(--lnst-heading-size, 1));
	letter-spacing: var(--lnst-heading-ls);
	line-height: 1.3;
}

.lnst-field {
	display: block;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 18px;
	border: 0;
	border-radius: var(--lnst-radius);
	background: rgba(var(--lnst-text-rgb), 0.07);
	box-shadow: inset 0 0 0 1.5px rgba(var(--lnst-text-rgb), 0.24);
	color: var(--lnst-text);
	font: inherit;
	font-size: 1rem;
	-webkit-appearance: none;
	appearance: none;
}

.lnst-field::placeholder {
	color: var(--lnst-text);
	opacity: 0.55;
}

/* Filled button styles: fields take the button colours so they match the buttons. */
.lnst-btn--fill .lnst-field,
.lnst-btn--soft .lnst-field,
.lnst-btn--hard .lnst-field {
	background: var(--lnst-btn);
	box-shadow: inset 0 0 0 1.5px rgba(var(--lnst-text-rgb), 0.16);
	color: var(--lnst-btn-text);
}

.lnst-btn--fill .lnst-field::placeholder,
.lnst-btn--soft .lnst-field::placeholder,
.lnst-btn--hard .lnst-field::placeholder {
	color: var(--lnst-btn-text);
}

.lnst-btn--hard .lnst-field {
	box-shadow: inset 0 0 0 2px var(--lnst-btn-shadow);
}

.lnst-field:focus {
	outline: none;
	box-shadow: inset 0 0 0 2px var(--lnst-text);
}

.lnst-link--button {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 20px;
}

.lnst-link--button:disabled {
	opacity: 0.6;
	cursor: progress;
}

.lnst-subscribe-msg {
	margin: 0;
	font-size: 0.875rem;
}

.lnst-subscribe-msg:empty {
	display: none;
}

.lnst-subscribe.is-done .lnst-field,
.lnst-subscribe.is-done .lnst-link--button {
	display: none;
}

.lnst-subscribe.is-done .lnst-subscribe-msg {
	font-size: 1rem;
	font-weight: 600;
}

.lnst-hp {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Password-protected profiles */
.lnst-locked {
	width: 100%;
	font-size: 0.9375rem;
	text-align: center;
}

.lnst-locked form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.lnst-locked p {
	margin: 0;
}

.lnst-locked label {
	display: block;
	font-weight: 600;
}

.lnst-locked input[type="password"] {
	margin-top: 8px;
}

.lnst-locked input[type="submit"] {
	width: 100%;
	margin-top: 12px;
	-webkit-appearance: none;
	appearance: none;
}

/* Footer */
.lnst-foot {
	margin-top: auto;
	padding-top: 40px;
	font-size: 0.8125rem;
	text-align: center;
	opacity: 0.65;
}

/* Preview only: links hidden by their schedule */
.is-scheduled {
	opacity: 0.45;
}

.is-scheduled .lnst-link {
	outline: 1.5px dashed rgba(var(--lnst-text-rgb), 0.6);
	outline-offset: 3px;
}

/* ---------------------------------------------------------------------
 * Share button, toast, gate, edit link
 * ------------------------------------------------------------------ */

.lnst-share {
	position: absolute;
	top: calc(16px + env(safe-area-inset-top, 0px));
	right: calc(16px + env(safe-area-inset-right, 0px));
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(var(--lnst-text-rgb), 0.1);
	color: var(--lnst-text);
	font-size: 15px;
	cursor: pointer;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: background-color 0.15s ease;
}

.lnst-share:hover {
	background: rgba(var(--lnst-text-rgb), 0.18);
}

.lnst-share:focus-visible {
	outline: 2px solid var(--lnst-text);
	outline-offset: 2px;
}

.lnst-toast {
	position: fixed;
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	left: 50%;
	z-index: 30;
	padding: 10px 16px;
	border-radius: 999px;
	background: var(--lnst-text);
	color: var(--lnst-bg);
	font-size: 0.875rem;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 16px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.lnst-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.lnst-gate {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(var(--lnst-bg-rgb), 0.86);
	-webkit-backdrop-filter: blur(24px);
	backdrop-filter: blur(24px);
}

.lnst-gate-card {
	width: 100%;
	max-width: 360px;
	padding: 28px 24px 24px;
	border-radius: var(--lnst-card-radius);
	background: var(--lnst-bg);
	box-shadow: inset 0 0 0 1px rgba(var(--lnst-text-rgb), 0.16), 0 24px 60px -20px rgba(0, 0, 0, 0.35);
	text-align: center;
}

.lnst-gate-icon {
	font-size: 26px;
}

.lnst-gate-title {
	margin: 12px 0 6px;
	font-family: var(--lnst-font-heading);
	font-weight: var(--lnst-heading-wght);
	font-size: calc(1.25rem * var(--lnst-heading-size, 1));
	letter-spacing: var(--lnst-heading-ls);
}

.lnst-gate-text {
	margin: 0 0 20px;
	font-size: 0.9375rem;
	opacity: 0.8;
}

.lnst-gated,
.lnst-gated body {
	overflow: hidden;
}

.lnst-edit {
	position: fixed;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	left: 16px;
	z-index: 6;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 14px;
	border-radius: 999px;
	background: #1d2327;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	color: #fff !important;
	font: 600 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
	text-decoration: none;
}

.lnst-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------
 * Shortcode version inside a theme page
 * ------------------------------------------------------------------ */

.lnst-inline {
	max-width: 640px;
	margin: 0 auto 1.5em;
	overflow: hidden;
	border-radius: 24px;
}

.lnst-inline .lnst-page {
	padding: 40px 20px 32px;
}

.lnst-inline .lnst-name {
	font-size: calc(clamp(1.5rem, 4vw, 2rem) * var(--lnst-heading-size, 1));
}

.lnst-inline a {
	text-decoration: none;
}

.lnst-inline .lnst-toast {
	position: absolute;
}

/* ---------------------------------------------------------------------
 * Page-load sequence
 * ------------------------------------------------------------------ */

.lnst-motion .lnst-head,
.lnst-motion .lnst-item,
.lnst-motion .lnst-socials-bottom {
	animation: lnst-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.lnst-motion .lnst-item {
	animation-delay: calc(80ms + min(var(--i, 0), 12) * 50ms);
}

.lnst-motion .lnst-socials-bottom {
	animation-delay: 420ms;
}

@keyframes lnst-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 420px) {
	.lnst-page {
		padding-right: 16px;
		padding-left: 16px;
	}

	.lnst-link {
		min-height: 58px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lnst-root *,
	.lnst-root *::before,
	.lnst-root *::after {
		animation: none !important;
		transition: none !important;
	}
}
