:root {
	--ink: #071410;
	--ink-soft: #0d221c;
	--fog: #d7ebe3;
	--fog-dim: rgba(215, 235, 227, 0.55);
	--fog-mute: rgba(215, 235, 227, 0.18);
	--acid: #c6f25a;
	--acid-deep: #9bc73a;
	--line: rgba(215, 235, 227, 0.14);
	--danger: #ff7a59;
	--radius: 18px;
	--font-display: "Syne", sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html,
body {
	margin: 0;
	min-height: 100%;
}

body {
	color: var(--fog);
	font-family: var(--font-mono);
	background: var(--ink);
	overflow-x: hidden;
}

.atmosphere {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		radial-gradient(ellipse 80% 55% at 50% -10%, rgba(198, 242, 90, 0.16), transparent 55%),
		radial-gradient(ellipse 50% 40% at 100% 80%, rgba(40, 120, 95, 0.35), transparent 50%),
		radial-gradient(ellipse 40% 35% at 0% 70%, rgba(18, 70, 55, 0.45), transparent 45%),
		linear-gradient(165deg, var(--ink) 0%, var(--ink-soft) 48%, #06110e 100%);
	animation: atmosphere-drift 18s ease-in-out infinite alternate;
}

.atmosphere::after {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0.35;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 500 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
	mix-blend-mode: soft-light;
}

@keyframes atmosphere-drift {
	from { filter: hue-rotate(0deg) saturate(1); }
	to { filter: hue-rotate(8deg) saturate(1.08); }
}

.stage {
	position: relative;
	z-index: 1;
	width: min(720px, calc(100% - 2rem));
	margin: 0 auto;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 3.5rem 0 4rem;
	gap: 1.75rem;
}

.brand__name {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(2.75rem, 9vw, 4.5rem);
	letter-spacing: -0.04em;
	line-height: 0.95;
	color: var(--fog);
	animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand__tag {
	margin: 0.85rem 0 0;
	max-width: 28rem;
	font-size: 0.95rem;
	line-height: 1.45;
	color: var(--fog-dim);
	animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.composer {
	display: block;
	animation: rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.composer__input {
	display: block;
	width: 100%;
	min-height: 7.5rem;
	resize: vertical;
	padding: 1.25rem 1.35rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: rgba(7, 20, 16, 0.55);
	color: var(--fog);
	font-family: var(--font-mono);
	font-size: 1.05rem;
	line-height: 1.5;
	outline: none;
	backdrop-filter: blur(10px);
	transition:
		border-color 0.25s ease,
		background 0.25s ease,
		transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.composer__input::placeholder {
	color: rgba(215, 235, 227, 0.28);
}

.composer__input:focus {
	border-color: rgba(198, 242, 90, 0.55);
	background: rgba(7, 20, 16, 0.78);
	transform: translateY(-2px);
}

.composer__input.is-invalid {
	border-color: rgba(255, 122, 89, 0.65);
}

.result {
	display: grid;
	gap: 1.25rem;
	padding-top: 0.25rem;
	animation: result-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result[hidden] {
	display: none;
}

.result__link-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.75rem;
	align-items: stretch;
}

.result__url {
	display: flex;
	align-items: center;
	min-width: 0;
	padding: 0.95rem 1.1rem;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: rgba(215, 235, 227, 0.04);
	color: var(--acid);
	font-size: 0.86rem;
	line-height: 1.4;
	text-decoration: none;
	word-break: break-all;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.result__url:hover {
	background: rgba(198, 242, 90, 0.08);
	border-color: rgba(198, 242, 90, 0.35);
}

.result__copy {
	appearance: none;
	cursor: pointer;
	border: 0;
	border-radius: 14px;
	padding: 0 1.2rem;
	min-width: 8.5rem;
	background: var(--acid);
	color: var(--ink);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.95rem;
	letter-spacing: -0.02em;
	transition: background 0.2s ease, transform 0.2s ease;
}

.result__copy:hover {
	background: #d7ff73;
}

.result__copy:active {
	transform: scale(0.98);
}

.result__copy.is-copied {
	background: var(--acid-deep);
	color: var(--ink);
}

.result__qr {
	margin: 0;
	justify-self: start;
	padding: 0.85rem;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: #f3faf6;
	line-height: 0;
}

.result__qr img,
.result__qr canvas {
	display: block;
	width: 180px !important;
	height: 180px !important;
}

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

@keyframes rise-in {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes result-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 560px) {
	.stage {
		justify-content: flex-start;
		padding-top: 18vh;
	}

	.result__link-row {
		grid-template-columns: 1fr;
	}

	.result__copy {
		min-height: 3rem;
	}

	.result__qr {
		justify-self: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.atmosphere,
	.brand__name,
	.brand__tag,
	.composer,
	.result {
		animation: none;
	}

	.composer__input,
	.result__copy {
		transition: none;
	}
}
