:root {
	--brand: #00adef;
	--brand-deep: #0087bd;
	--brand-ink: #045a7a;
	--ink: #152028;
	--muted: #5b6b76;
	--line: #d7e0e6;
	--paper: #f4f7f9;
	--white: #ffffff;
	--danger: #b42318;
	--danger-bg: #fef3f2;
	--danger-line: #fecdca;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
	box-sizing: border-box;
}

html {
	font-size: 16px;
}

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

body {
	font-family: "Source Sans 3", sans-serif;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
	text-decoration: none;
}

.gate {
	min-height: 100vh;
	min-height: 100dvh;
	display: grid;
	grid-template-columns: minmax(300px, min(42%, 520px)) minmax(0, 1fr);
}

.brand {
	position: relative;
	overflow: hidden;
	container-type: inline-size;
	container-name: brand;
	background:
		radial-gradient(120% 80% at 0% 100%, rgba(0, 0, 0, 0.18), transparent 55%),
		linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 55%, var(--brand-ink) 100%);
	color: var(--white);
	padding: clamp(1.5rem, 3.5vw, 3.5rem);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	isolation: isolate;
	min-width: 0;
}

.brand::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
	background-size: 48px 48px;
	mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
	pointer-events: none;
	z-index: -1;
}

.brand-top {
	/* Reserve space so the absolute logo does not cover hero copy */
	height: clamp(96px, 12vw, 140px);
	pointer-events: none;
	flex-shrink: 0;
}

.brand-mark {
	position: absolute;
	left: 50%;
	top: clamp(1.25rem, 4vh, 2.5rem);
	width: clamp(120px, 28cqi, 200px);
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.24));
	transform: translateX(-50%);
	animation: brandMarkIn 0.9s var(--ease) 0.08s both;
	z-index: 1;
}

.brand-hero {
	position: relative;
	z-index: 2;
	margin: clamp(0.75rem, 2.5vh, 2.5rem) 0;
	min-width: 0;
	max-width: 100%;
}

.brand-welcome {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	margin: 0 0 1rem;
	min-height: 1.45em;
	font-family: "Source Sans 3", sans-serif;
	font-size: clamp(1.05rem, 2.2vw, 1.3rem);
	font-weight: 600;
	line-height: 1.45;
	letter-spacing: 0.01em;
}

.brand-type-text {
	display: inline-block;
	overflow: hidden;
	white-space: nowrap;
	max-width: 0;
	opacity: 1;
	vertical-align: bottom;
}

.brand-type-caret {
	display: inline-block;
	width: 2px;
	height: 1.15em;
	margin-left: 2px;
	background: rgba(255, 255, 255, 0.92);
	opacity: 0;
	flex-shrink: 0;
	vertical-align: middle;
}

.brand-welcome-text {
	/* 1) Welcome to */
	animation:
		welcomeType 0.9s steps(11, end) 0.25s forwards,
		typeUnlock 0.01s linear 1.15s forwards;
}

.brand-welcome-caret {
	animation:
		welcomeCaret 0.7s step-end 0.25s 2,
		welcomeCaretFade 0.2s linear 1.15s forwards;
}

.brand-hero h1 {
	font-family: Syne, "Source Sans 3", sans-serif;
	font-weight: 800;
	/* Scale to brand column width so WORTHWHILE never clips on 12" laptops */
	font-size: clamp(1.2rem, 11cqi, 2.55rem);
	line-height: 0.95;
	letter-spacing: -0.04em;
	margin: 0 0 1.15rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.12em;
	max-width: 100%;
	min-width: 0;
}

.brand-title-line {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	min-height: 1em;
	max-width: 100%;
}

.brand-type-damez {
	/* 2) DAMEZ */
	animation:
		damezType 0.55s steps(5, end) 1.2s forwards,
		typeUnlock 0.01s linear 1.75s forwards;
}

.brand-type-caret--damez {
	height: 0.85em;
	animation:
		welcomeCaret 0.55s step-end 1.2s 2,
		welcomeCaretFade 0.2s linear 1.75s forwards;
}

.brand-type-worthwhile {
	/* 3) WORTHWHILE */
	animation:
		worthwhileType 0.85s steps(10, end) 1.85s forwards,
		typeUnlock 0.01s linear 2.7s forwards;
}

.brand-type-caret--worthwhile {
	height: 0.85em;
	animation:
		welcomeCaret 0.85s step-end 1.85s 2,
		welcomeCaretFade 0.2s linear 2.7s forwards;
}

.brand-hero .brand-tagline,
.brand-hero p.brand-tagline {
	display: flex;
	align-items: flex-start;
	gap: 0.15rem;
	margin: 0;
	max-width: 100%;
	font-size: clamp(0.95rem, 3.8cqi, 1.2rem);
	line-height: 1.5;
	font-weight: 500;
	min-height: 1.5em;
}

.brand-type-tagline {
	/* 4) Tagline */
	animation:
		taglineType 1.85s steps(46, end) 2.85s forwards,
		typeUnlock 0.01s linear 4.7s forwards;
}

.brand-type-caret--tagline {
	height: 1.1em;
	animation:
		welcomeCaret 0.9s step-end 2.85s 3,
		welcomeCaretFade 0.2s linear 4.7s forwards;
}

.brand-foot {
	font-size: 1rem;
	opacity: 0;
	animation: rise 0.7s var(--ease) 0.28s forwards;
}

.brand-foot strong {
	display: block;
	font-family: Syne, "Source Sans 3", sans-serif;
	font-size: 1.15rem;
	font-weight: 700;
	margin-bottom: 0.2rem;
	opacity: 1;
	color: #fff;
}

.workspace {
	padding: clamp(1.5rem, 4vw, 3.25rem);
	display: flex;
	flex-direction: column;
	justify-content: center;
	max-width: 560px;
	width: 100%;
	margin: 0 auto;
	min-width: 0;
}

.workspace-head {
	margin-bottom: 1.75rem;
	opacity: 0;
	animation: rise 0.7s var(--ease) 0.2s forwards;
}

.workspace-head h2 {
	font-family: Syne, "Source Sans 3", sans-serif;
	font-size: clamp(2rem, 3.2vw, 2.55rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	margin: 0 0 0.5rem;
}

.workspace-head p {
	margin: 0;
	color: var(--muted);
	font-size: 1.1rem;
}

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin-top: 0.9rem;
	color: var(--brand-deep);
	font-size: 1rem;
	font-weight: 600;
	opacity: 0;
	animation: rise 0.65s var(--ease) 0.26s forwards;
}

.back-link:hover,
.back-link:focus-visible {
	color: var(--brand-ink);
	outline: none;
}

.roles {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.7rem;
}

.role {
	opacity: 0;
	animation: rise 0.65s var(--ease) forwards;
}

.role:nth-child(1) { animation-delay: 0.28s; }
.role:nth-child(2) { animation-delay: 0.34s; }
.role:nth-child(3) { animation-delay: 0.4s; }
.role:nth-child(4) { animation-delay: 0.46s; }
.role:nth-child(5) { animation-delay: 0.52s; }

.role a {
	display: grid;
	grid-template-columns: 48px 1fr auto;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.15rem;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 7px;
	transition:
		border-color 0.2s ease,
		transform 0.25s var(--ease),
		background-color 0.2s ease,
		box-shadow 0.25s ease;
}

.role a:hover,
.role a:focus-visible {
	border-color: var(--brand);
	transform: translateX(4px);
	box-shadow: 0 10px 24px rgba(21, 32, 40, 0.06);
	outline: none;
}

.role-icon {
	width: 48px;
	height: 48px;
	border-radius: 7px;
	display: grid;
	place-items: center;
	background: rgba(0, 173, 239, 0.1);
	color: var(--brand-deep);
	font-size: 1.15rem;
}

.role-copy strong {
	display: block;
	font-family: Syne, "Source Sans 3", sans-serif;
	font-size: 1.15rem;
	font-weight: 700;
	margin-bottom: 0.2rem;
}

.role-copy span {
	display: block;
	color: var(--muted);
	font-size: 1rem;
	line-height: 1.4;
}

.role-arrow {
	color: var(--brand-deep);
	opacity: 0.45;
	transition: opacity 0.2s ease, transform 0.25s var(--ease);
}

.role a:hover .role-arrow,
.role a:focus-visible .role-arrow {
	opacity: 1;
	transform: translateX(3px);
}

.login-panel {
	opacity: 0;
	animation: rise 0.7s var(--ease) 0.28s forwards;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 7px;
	padding: 1.6rem 1.55rem 1.7rem;
}

.login-panel .role-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	margin-bottom: 1.4rem;
}

.login-panel .role-badge .role-icon {
	width: 46px;
	height: 46px;
	font-size: 1.1rem;
}

.login-panel .role-badge strong {
	font-family: Syne, "Source Sans 3", sans-serif;
	font-size: 1.1rem;
	font-weight: 700;
}

.form-alert {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	padding: 0.85rem 1rem;
	margin-bottom: 1.1rem;
	border-radius: 7px;
	border: 1px solid var(--danger-line);
	background: var(--danger-bg);
	color: var(--danger);
	font-size: 1rem;
	line-height: 1.45;
}

.field {
	margin-bottom: 1.15rem;
}

.field label {
	display: block;
	font-size: 0.98rem;
	font-weight: 700;
	margin-bottom: 0.45rem;
	color: var(--ink);
}

.field input,
.field select {
	width: 100%;
	height: 52px;
	padding: 0 1rem;
	border: 1px solid var(--line);
	border-radius: 7px;
	background: var(--white);
	color: var(--ink);
	font: inherit;
	font-size: 1.05rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
	color: #93a1ab;
}

.field input:focus,
.field select:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(0, 173, 239, 0.15);
}

.btn-sign-in {
	width: 100%;
	min-height: 54px;
	margin-top: 0.45rem;
	padding: 0.9rem 1.25rem;
	border: 0;
	border-radius: 7px;
	background: var(--brand);
	color: #fff;
	font-family: "Source Sans 3", sans-serif;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.4;
	overflow: visible;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	transition: background-color 0.2s ease, transform 0.2s var(--ease);
}

.btn-sign-in i {
	line-height: 1;
	flex-shrink: 0;
}

.btn-sign-in:hover,
.btn-sign-in:focus-visible {
	background: var(--brand-deep);
	outline: none;
}

.btn-sign-in:active {
	transform: translateY(1px);
}

.legal {
	margin-top: 2rem;
	font-size: 0.85rem;
	color: var(--muted);
	opacity: 0;
	animation: rise 0.7s var(--ease) 0.6s forwards;
}

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

@keyframes brandMarkIn {
	from {
		opacity: 0;
		transform: translateX(-50%) scale(0.82);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) scale(1);
	}
}

@keyframes welcomeType {
	from {
		max-width: 0;
	}
	to {
		max-width: 12ch;
	}
}

@keyframes damezType {
	from {
		max-width: 0;
	}
	to {
		max-width: 8em;
	}
}

@keyframes worthwhileType {
	from {
		max-width: 0;
	}
	to {
		max-width: 16em;
	}
}

@keyframes taglineType {
	from {
		max-width: 0;
	}
	to {
		max-width: 48ch;
	}
}

/* After typing, drop the max-width clamp so nothing stays cut off */
@keyframes typeUnlock {
	to {
		max-width: none;
	}
}

@keyframes welcomeCaret {
	50% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

@keyframes welcomeCaretFade {
	to {
		opacity: 0;
	}
}

/* 12–14" laptops: keep brand readable, avoid clipped title */
@media (max-width: 1400px) {
	.gate {
		grid-template-columns: minmax(280px, min(40%, 460px)) minmax(0, 1fr);
	}

	.brand-hero h1 {
		font-size: clamp(1.15rem, 10.5cqi, 2.15rem);
	}
}

@media (max-width: 1100px) {
	.gate {
		grid-template-columns: minmax(260px, min(36%, 400px)) minmax(0, 1fr);
	}

	.brand-hero h1 {
		font-size: clamp(1.1rem, 10cqi, 1.85rem);
	}

	.brand-mark {
		width: clamp(110px, 26cqi, 160px);
	}
}

/* Stack brand above workspace before title would crush */
@media (max-width: 960px) {
	.gate {
		grid-template-columns: 1fr;
	}

	.brand {
		min-height: auto;
		padding: 2rem 1.35rem 2.4rem;
		align-items: center;
		text-align: center;
	}

	.brand-top {
		height: clamp(110px, 20vw, 150px);
	}

	.brand-mark {
		top: clamp(1.25rem, 4vh, 2rem);
		width: clamp(140px, 32vw, 190px);
	}

	.brand-hero {
		margin: 1.75rem 0 1.25rem;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.brand-welcome {
		justify-content: center;
		text-align: center;
	}

	.brand-welcome-text {
		animation:
			welcomeType 0.9s steps(11, end) 0.2s forwards,
			typeUnlock 0.01s linear 1.1s forwards;
	}

	.brand-welcome-caret {
		animation:
			welcomeCaret 0.7s step-end 0.2s 2,
			welcomeCaretFade 0.2s linear 1.1s forwards;
	}

	.brand-type-damez {
		animation:
			damezType 0.55s steps(5, end) 1.15s forwards,
			typeUnlock 0.01s linear 1.7s forwards;
	}

	.brand-type-caret--damez {
		animation:
			welcomeCaret 0.55s step-end 1.15s 2,
			welcomeCaretFade 0.2s linear 1.7s forwards;
	}

	.brand-type-worthwhile {
		animation:
			worthwhileType 0.85s steps(10, end) 1.8s forwards,
			typeUnlock 0.01s linear 2.65s forwards;
	}

	.brand-type-caret--worthwhile {
		animation:
			welcomeCaret 0.85s step-end 1.8s 2,
			welcomeCaretFade 0.2s linear 2.65s forwards;
	}

	.brand-type-tagline {
		animation:
			taglineType 1.85s steps(46, end) 2.8s forwards,
			typeUnlock 0.01s linear 4.65s forwards;
	}

	.brand-type-caret--tagline {
		animation:
			welcomeCaret 0.9s step-end 2.8s 3,
			welcomeCaretFade 0.2s linear 4.65s forwards;
	}

	.brand-hero h1 {
		font-size: clamp(2rem, 10vw, 3.2rem);
		align-items: center;
	}

	.brand-hero .brand-tagline,
	.brand-hero p.brand-tagline {
		justify-content: center;
		text-align: center;
		margin-left: auto;
		margin-right: auto;
		font-size: clamp(1rem, 3.6vw, 1.2rem);
	}

	.brand-type-tagline {
		white-space: normal;
	}

	.workspace {
		justify-content: flex-start;
		padding-top: 1.75rem;
		max-width: none;
	}
}

@media (max-width: 560px) {
	.brand-mark {
		width: min(48vw, 170px);
		top: 1.1rem;
	}

	.brand-top {
		height: clamp(100px, 28vw, 140px);
	}

	.brand-hero h1 {
		font-size: clamp(1.85rem, 11vw, 2.7rem);
	}

	.brand-welcome {
		font-size: 1.05rem;
	}
}

/* Short laptop screens (e.g. 12" 1366×768) */
@media (max-height: 820px) and (min-width: 961px) {
	.brand {
		padding: 1.25rem 1.5rem 1.5rem;
	}

	.brand-top {
		height: 84px;
	}

	.brand-mark {
		width: clamp(96px, 22cqi, 140px);
		top: 1rem;
	}

	.brand-hero {
		margin: 0.5rem 0;
	}

	.brand-welcome {
		margin-bottom: 0.65rem;
		font-size: 1rem;
	}

	.brand-hero h1 {
		font-size: clamp(1.05rem, 9cqi, 1.75rem);
		margin-bottom: 0.75rem;
	}

	.brand-hero .brand-tagline,
	.brand-hero p.brand-tagline {
		font-size: 0.95rem;
	}
}

@container brand (max-width: 340px) {
	.brand-hero h1 {
		font-size: clamp(1.05rem, 12cqi, 1.55rem);
	}

	.brand-type-tagline {
		white-space: normal;
	}
}

@media (prefers-reduced-motion: reduce) {
	.brand-top,
	.brand-hero,
	.brand-mark,
	.brand-type-text,
	.brand-welcome-text,
	.brand-type-damez,
	.brand-type-worthwhile,
	.brand-type-tagline,
	.brand-foot,
	.workspace-head,
	.back-link,
	.role,
	.login-panel,
	.legal {
		animation: none !important;
		opacity: 1 !important;
		max-width: none !important;
	}

	.brand-mark {
		transform: translateX(-50%) !important;
	}

	.brand-type-caret,
	.brand-welcome-caret {
		display: none;
	}

	.role a,
	.btn-sign-in {
		transition: none;
	}
}
