/* Deejayfvse — Legal Pages Stylesheet
 * BEM naming · Logical properties · Mobile-first
 * Sections: Hero, Content Body (TOC + Prose), CTA Strip
 * Shared by: Privacy Policy & Terms of Conditions
 */

/* ═══════════════════════════════════════════════
   §1 — HERO: COMPACT CINEMATIC
   ═══════════════════════════════════════════════ */

.legal-hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-block-size: 70vh;
	overflow: hidden;
	background-color: var(--color-background);
	text-align: center;
}

.legal-hero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.legal-hero__bg img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	opacity: 0.08;
}

.legal-hero__bg-overlay {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, var(--color-background) 0%, rgba(5, 3, 1, 0.6) 40%, rgba(5, 3, 1, 0.6) 60%, var(--color-background) 100%),
		radial-gradient(ellipse at center, transparent 0%, var(--color-background) 70%);
}

.legal-hero__grain {
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
	background-repeat: repeat;
	background-size: 256px 256px;
	pointer-events: none;
	z-index: 1;
}

.legal-hero__spotlight {
	position: absolute;
	inline-size: 40vw;
	block-size: 120%;
	pointer-events: none;
	z-index: 0;
}

.legal-hero__spotlight--left {
	inset-block-start: -20%;
	inset-inline-start: -10%;
	background: conic-gradient(from 160deg at 50% 0%, rgba(240, 187, 59, 0.06) 0deg, transparent 40deg);
	animation: spotlight-sway 8s ease-in-out infinite;
}

.legal-hero__spotlight--right {
	inset-block-start: -20%;
	inset-inline-end: -10%;
	background: conic-gradient(from 200deg at 50% 0%, rgba(254, 110, 0, 0.04) 0deg, transparent 40deg);
	animation: spotlight-sway 8s ease-in-out infinite reverse;
	animation-delay: -4s;
}

.legal-hero__number {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	transform: translate(-50%, -50%);
	font-family: var(--font-display);
	font-size: clamp(8rem, 25vw, 18rem);
	color: var(--color-primary);
	opacity: 0.03;
	line-height: 1;
	pointer-events: none;
	z-index: 1;
}

.legal-hero__content {
	position: relative;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-6);
	max-inline-size: 40rem;
	margin-inline: auto;
}

.legal-hero__overline,
.legal-hero__heading,
.legal-hero__subtitle,
.legal-hero__updated {
	opacity: 0;
	transform: translateY(30px);
}

.legal-hero__overline.is-visible,
.legal-hero__heading.is-visible,
.legal-hero__subtitle.is-visible,
.legal-hero__updated.is-visible {
	opacity: 1;
	transform: translateY(0);
	transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
	            transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-hero__overline {
	display: block;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--color-primary);
	letter-spacing: 0.3em;
	text-transform: uppercase;
}

.legal-hero__heading {
	font-size: clamp(2.5rem, 10vw, 5rem);
	color: var(--color-foreground);
}

.legal-hero__subtitle {
	font-size: var(--text-lg);
	color: var(--color-muted-foreground);
	max-inline-size: 36rem;
	line-height: 1.7;
}

.legal-hero__updated {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-4);
	background-color: rgba(240, 187, 59, 0.1);
	border: 1px solid rgba(240, 187, 59, 0.2);
	border-radius: var(--radius-full);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--color-primary);
}

.legal-hero__updated svg {
	flex-shrink: 0;
}

.legal-hero__scroll-cue {
	position: absolute;
	inset-inline-end: var(--space-6);
	inset-block-end: var(--space-8);
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-3);
	opacity: 0;
	animation: fade-in 1s 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.legal-hero__scroll-text {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--color-muted-foreground);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	writing-mode: vertical-rl;
}

.legal-hero__scroll-line {
	display: block;
	inline-size: 1px;
	block-size: 3rem;
	background: var(--color-primary);
	animation: scroll-line 2s ease-in-out infinite;
	transform-origin: top;
}

/* ═══════════════════════════════════════════════
   §2 — CONTENT BODY: TOC + PROSE
   ═══════════════════════════════════════════════ */

.legal-content {
	position: relative;
	padding-block: var(--space-32);
	overflow: hidden;
	background-color: var(--color-card);
}

.legal-content__gradient {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 50% 30%, rgba(240, 187, 59, 0.03) 0%, transparent 50%);
	pointer-events: none;
}

.legal-content__number {
	position: absolute;
	inset-block-start: var(--space-16);
	inset-inline-end: var(--space-8);
	font-family: var(--font-display);
	font-size: clamp(5rem, 12vw, 10rem);
	color: var(--color-primary);
	opacity: 0.03;
	line-height: 1;
	pointer-events: none;
}

.legal-content__header {
	text-align: center;
	margin-block-end: var(--space-16);
}

.legal-content__overline {
	display: block;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--color-primary);
	letter-spacing: 0.3em;
	text-transform: uppercase;
	margin-block-end: var(--space-4);
}

.legal-content__heading {
	font-size: var(--text-4xl);
}

.legal-content__layout {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: var(--space-12);
}

/* ─── TOC: Mobile (horizontal pills) ─── */

.legal-toc {
	position: relative;
	z-index: 3;
}

.legal-toc__list {
	list-style: none;
	display: flex;
	gap: var(--space-2);
	overflow-x: auto;
	padding-block: var(--space-2);
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.legal-toc__list::-webkit-scrollbar {
	display: none;
}

.legal-toc__link {
	display: block;
	padding: var(--space-2) var(--space-4);
	font-size: var(--text-xs);
	font-weight: var(--font-weight-medium);
	color: var(--color-muted-foreground);
	white-space: nowrap;
	background-color: rgba(240, 187, 59, 0.05);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-full);
	transition: all var(--transition-fast);
}

.legal-toc__link:hover {
	color: var(--color-primary);
	border-color: rgba(240, 187, 59, 0.3);
}

.legal-toc__link.is-active {
	color: var(--color-background);
	background-color: var(--color-primary);
	border-color: var(--color-primary);
}

/* ─── Prose Column ─── */

.legal-prose {
	display: flex;
	flex-direction: column;
	gap: var(--space-16);
	max-inline-size: 48rem;
}

/* ─── Individual Section ─── */

.legal-section__heading {
	font-size: var(--text-2xl);
	font-weight: var(--font-weight-bold);
	color: var(--color-foreground);
	margin-block-end: var(--space-6);
	padding-block-end: var(--space-3);
	border-block-end: 1px solid var(--color-border);
}

.legal-section__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.legal-section__body p {
	font-size: var(--text-base);
	color: var(--color-muted-foreground);
	line-height: 1.8;
}

.legal-section__body ul,
.legal-section__body ol {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	padding-inline-start: var(--space-6);
}

.legal-section__body ul li {
	position: relative;
	font-size: var(--text-base);
	color: var(--color-muted-foreground);
	line-height: 1.8;
	padding-inline-start: var(--space-4);
}

.legal-section__body ul li::before {
	content: '';
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: 0.7em;
	inline-size: 6px;
	block-size: 6px;
	border-radius: var(--radius-full);
	background-color: var(--color-primary);
	opacity: 0.6;
}

.legal-section__body ol {
	counter-reset: legal-list;
}

.legal-section__body ol li {
	position: relative;
	font-size: var(--text-base);
	color: var(--color-muted-foreground);
	line-height: 1.8;
	padding-inline-start: var(--space-4);
	counter-increment: legal-list;
}

.legal-section__body ol li::before {
	content: counter(legal-list) '.';
	position: absolute;
	inset-inline-start: 0;
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	color: var(--color-primary);
	font-weight: var(--font-weight-medium);
}

.legal-section__body strong {
	color: var(--color-foreground);
	font-weight: var(--font-weight-semibold);
}

.legal-section__body a {
	color: var(--color-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color var(--transition-fast);
}

.legal-section__body a:hover {
	color: var(--color-primary-light);
}

/* ─── Callout Block ─── */

.legal-callout {
	padding: var(--space-4) var(--space-6);
	background-color: var(--color-secondary);
	border-inline-start: 3px solid var(--color-primary);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.legal-callout p {
	font-size: var(--text-sm);
	color: var(--color-muted-foreground);
	line-height: 1.7;
}

/* ═══════════════════════════════════════════════
   §3 — CTA STRIP
   ═══════════════════════════════════════════════ */

.legal-cta {
	position: relative;
	padding-block: var(--space-24);
	overflow: hidden;
	background-color: var(--color-background);
	text-align: center;
}

.legal-cta__grain {
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
	background-repeat: repeat;
	background-size: 256px 256px;
	pointer-events: none;
	z-index: 1;
}

.legal-cta__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-6);
}

.legal-cta__heading {
	font-size: var(--text-3xl);
	color: var(--color-foreground);
}

.legal-cta__subtext {
	font-size: var(--text-base);
	color: var(--color-muted-foreground);
	max-inline-size: 28rem;
}

/* ═══════════════════════════════════════════════
   BACK-TO-TOP BUTTON
   ═══════════════════════════════════════════════ */

.legal-back-top {
	position: fixed;
	inset-block-end: var(--space-8);
	inset-inline-end: var(--space-8);
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	inline-size: 3rem;
	block-size: 3rem;
	padding: 0;
	border: 1px solid rgba(240, 187, 59, 0.2);
	border-radius: var(--radius-full);
	background-color: rgba(240, 187, 59, 0.1);
	color: var(--color-primary);
	cursor: pointer;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	opacity: 0;
	transform: translateY(1rem);
	transition: opacity var(--transition-slow),
	            transform var(--transition-slow),
	            background-color var(--transition-fast),
	            border-color var(--transition-fast);
	pointer-events: none;
}

.legal-back-top.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.legal-back-top:hover {
	background-color: var(--color-primary);
	border-color: var(--color-primary);
	color: var(--color-background);
}

.legal-back-top:focus-visible {
	outline: 2px solid var(--color-ring);
	outline-offset: 2px;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: md (48em / 768px)
   ═══════════════════════════════════════════════ */

@media (min-width: 48em) {
	.legal-content__heading {
		font-size: var(--text-5xl);
	}

	.legal-content__layout {
		flex-direction: row;
		gap: var(--space-16);
	}

	/* TOC: Desktop (sticky sidebar) */
	.legal-toc {
		flex: 0 0 14rem;
		position: sticky;
		inset-block-start: calc(var(--space-20) + var(--space-8));
		align-self: flex-start;
		max-block-size: calc(100vh - var(--space-20) - var(--space-16));
		overflow-y: auto;
		scrollbar-width: thin;
	}

	.legal-toc__list {
		flex-direction: column;
		gap: 0;
		overflow-x: visible;
		padding-block: 0;
	}

	.legal-toc__link {
		padding: var(--space-2) var(--space-4);
		font-size: var(--text-sm);
		background-color: transparent;
		border: none;
		border-inline-start: 2px solid transparent;
		border-radius: 0;
		white-space: normal;
	}

	.legal-toc__link:hover {
		border-inline-start-color: rgba(240, 187, 59, 0.3);
		background-color: transparent;
	}

	.legal-toc__link.is-active {
		color: var(--color-primary);
		background-color: transparent;
		border-inline-start-color: var(--color-primary);
		font-weight: var(--font-weight-semibold);
	}

	/* Prose takes remaining space */
	.legal-prose {
		flex: 1;
		min-inline-size: 0;
	}

	.legal-section__heading {
		font-size: var(--text-3xl);
	}

	.legal-cta__heading {
		font-size: var(--text-4xl);
	}
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: lg (62em / 992px)
   ═══════════════════════════════════════════════ */

@media (min-width: 62em) {
	.legal-toc {
		flex: 0 0 16rem;
	}
}

/* ═══════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
	.legal-hero__overline,
	.legal-hero__heading,
	.legal-hero__subtitle,
	.legal-hero__updated {
		opacity: 1;
		transform: none;
	}

	.legal-hero__scroll-cue {
		opacity: 1;
		animation: none;
	}

	.legal-back-top {
		transition: none;
	}
}
