.terms-shell {
	--legal-ink: #171426;
	--legal-copy: #56535f;
	--legal-muted: #77737f;
	--legal-line: #e8e5eb;
	--legal-accent: #644aff;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	color: var(--legal-ink);
}

.terms-header {
	position: relative;
	z-index: 20;
}

.legal-main {
	flex: 1;
}

.legal-wrap {
	width: min(calc(100% - 48px), 1200px);
	margin: 0 auto;
}

.legal-hero {
	padding: 156px 0 78px;
	border-bottom: 1px solid var(--legal-line);
}

.legal-eyebrow {
	margin: 0;
	color: var(--legal-accent);
	font-size: 0.75rem;
	font-weight: 750;
	letter-spacing: 0.09em;
	line-height: 1.4;
	text-transform: uppercase;
}

.legal-hero h1 {
	max-width: 860px;
	margin: 18px 0 20px;
	font-size: clamp(2.5rem, 5vw, 4.2rem);
	font-weight: 620;
	letter-spacing: -0.065em;
	line-height: 1;
	text-wrap: balance;
}

.terms-updated {
	margin: 0;
	color: var(--legal-muted);
	font-size: 0.92rem;
	line-height: 1.5;
}

.legal-layout {
	display: grid;
	grid-template-columns: minmax(190px, 240px) minmax(0, 760px);
	gap: clamp(56px, 9vw, 120px);
	align-items: start;
	justify-content: space-between;
	padding-top: 76px;
	padding-bottom: 112px;
}

.legal-sidebar {
	position: sticky;
	top: 108px;
	max-height: calc(100vh - 140px);
	overflow-y: auto;
	scrollbar-width: thin;
}

.legal-sidebar > p {
	margin: 0 0 18px;
	color: var(--legal-ink);
	font-size: 0.78rem;
	font-weight: 720;
	letter-spacing: 0.075em;
	text-transform: uppercase;
}

.legal-sidebar nav {
	display: flex;
	padding-left: 17px;
	border-left: 1px solid var(--legal-line);
	flex-direction: column;
	gap: 2px;
}

.legal-sidebar a {
	padding: 6px 0;
	color: var(--legal-muted);
	font-size: 0.84rem;
	line-height: 1.4;
	transition: color 160ms ease, transform 160ms ease;
}

.legal-sidebar a:hover {
	color: var(--legal-accent);
	transform: translateX(3px);
}

.legal-sidebar a:focus-visible {
	border-radius: 4px;
	outline: 3px solid rgba(100, 74, 255, 0.22);
	outline-offset: 2px;
}

.terms-card {
	width: 100%;
}

.terms-list {
	margin: 0;
	padding: 0;
	counter-reset: legal-section;
	list-style: none;
}

.terms-list > li {
	padding: 0 0 46px;
	border-bottom: 1px solid var(--legal-line);
	counter-increment: legal-section;
	scroll-margin-top: 112px;
}

.terms-list > li + li {
	padding-top: 46px;
}

.terms-list h2 {
	display: flex;
	margin: 0 0 16px;
	gap: 15px;
	align-items: baseline;
	color: var(--legal-ink);
	font-size: clamp(1.28rem, 2vw, 1.6rem);
	font-weight: 620;
	letter-spacing: -0.035em;
	line-height: 1.2;
}

.terms-list h2::before {
	min-width: 24px;
	content: counter(legal-section, decimal-leading-zero);
	color: var(--legal-accent);
	font-size: 0.72rem;
	font-weight: 720;
	letter-spacing: 0.06em;
}

.terms-list p,
.terms-sublist {
	margin: 0;
	color: var(--legal-copy);
	font-size: 1rem;
	line-height: 1.76;
}

.terms-sublist {
	padding-left: 23px;
}

.terms-sublist > li {
	padding-left: 7px;
}

.terms-sublist > li + li {
	margin-top: 10px;
}

@media (max-width: 900px) {
	.legal-layout {
		grid-template-columns: 1fr;
		gap: 52px;
	}

	.legal-sidebar {
		position: static;
		max-height: none;
		overflow: visible;
	}

	.legal-sidebar nav {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2px 28px;
	}
}

@media (max-width: 620px) {
	.legal-wrap {
		width: min(calc(100% - 32px), 1200px);
	}

	.legal-hero {
		padding: 126px 0 62px;
	}

	.legal-hero h1 {
		font-size: clamp(2.3rem, 11vw, 3.2rem);
	}

	.legal-layout {
		gap: 42px;
		padding-top: 58px;
		padding-bottom: 78px;
	}

	.legal-sidebar nav {
		grid-template-columns: 1fr;
		max-height: 260px;
		overflow-y: auto;
	}

	.terms-list > li {
		padding-bottom: 38px;
	}

	.terms-list > li + li {
		padding-top: 38px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.legal-sidebar a {
		transition: none;
	}
}
