@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;600;700&display=swap");

:root {
	color-scheme: light;
	--canvas: #f7f7fa;
	--surface: #ffffff;
	--surface-soft: #f0efff;
	--ink: #17171b;
	--muted: #6f6e78;
	--faint: #aaa8b2;
	--accent: #6d5ce8;
	--accent-strong: #5948d4;
	--accent-ink: #4c3cbe;
	--line: rgba(23, 23, 27, 0.09);
	--control: #f0eff3;
	--control-hover: #e8e6ec;
	--frame: #e9e8ee;
	--frame-start: #eeecff;
	--frame-end: #dfdbff;
	--empty: rgba(255, 255, 255, 0.5);
	--image-outline: rgba(0, 0, 0, 0.1);
	--shadow-card:
		0 1px 2px rgba(23, 23, 27, 0.04), 0 12px 32px rgba(23, 23, 27, 0.07);
	--shadow-button:
		0 1px 2px rgba(50, 38, 132, 0.24), 0 8px 20px rgba(109, 92, 232, 0.22);
}

* {
	box-sizing: border-box;
}

html {
	min-width: 320px;
	background: var(--canvas);
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	margin: 0;
	color: var(--ink);
	background:
		radial-gradient(
			circle at 50% -10%,
			rgba(130, 120, 250, 0.13),
			transparent 34rem
		),
		var(--canvas);
	font-family: "DM Sans", Inter, ui-sans-serif, system-ui, sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.55;
}

button,
input {
	font: inherit;
}

button,
a {
	-webkit-tap-highlight-color: transparent;
}

button {
	user-select: none;
}

a {
	color: inherit;
	text-underline-position: from-font;
	text-decoration-thickness: from-font;
}

::selection {
	color: var(--ink);
	background: rgba(130, 120, 250, 0.28);
}

.site-header,
main,
footer {
	width: min(1120px, calc(100% - 40px));
	margin-inline: auto;
}

.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 80px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-decoration: none;
}

.brand-mark {
	width: 22px;
	height: 22px;
	border-radius: 8px;
	background: linear-gradient(145deg, #9d94ff, var(--accent));
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.35),
		0 4px 12px rgba(109, 92, 232, 0.25);
	transform: rotate(-7deg);
}

.tella-link,
.text-button {
	color: var(--muted);
	font-size: 14px;
	font-weight: 600;
}

.tella-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	text-decoration: none;
	transition: color 150ms ease;
}

.tella-link:hover {
	color: var(--ink);
}

.hero {
	max-width: 780px;
	margin: 112px auto 128px;
	text-align: center;
}

.eyebrow {
	color: var(--accent-ink);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

h1,
h2,
p {
	margin-block: 0;
}

h1 {
	max-width: 760px;
	margin: 18px auto 22px;
	font-size: clamp(44px, 7.2vw, 76px);
	font-weight: 700;
	letter-spacing: -0.055em;
	line-height: 0.98;
	text-wrap: balance;
}

h1 span {
	color: var(--accent);
}

.hero-copy {
	max-width: 620px;
	margin-inline: auto;
	color: var(--muted);
	font-size: 18px;
	line-height: 1.6;
	text-wrap: pretty;
}

.extract-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px;
	margin-top: 40px;
	padding: 8px;
	border-radius: 20px;
	background: var(--surface);
	box-shadow:
		var(--shadow-card),
		inset 0 0 0 1px var(--line);
}

.url-field {
	display: flex;
	align-items: center;
	min-width: 0;
}

.url-field svg {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-inline: 10px 0;
	fill: none;
	stroke: var(--faint);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.url-field input {
	width: 100%;
	min-width: 0;
	height: 52px;
	padding: 0 12px;
	border: 0;
	outline: 0;
	color: var(--ink);
	background: transparent;
	font-size: 16px;
	font-weight: 500;
}

.url-field input::placeholder {
	color: var(--faint);
	opacity: 1;
}

.extract-form:focus-within {
	box-shadow:
		var(--shadow-card),
		0 0 0 3px rgba(109, 92, 232, 0.16),
		inset 0 0 0 1px rgba(109, 92, 232, 0.65);
}

.primary-button,
.secondary-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 52px;
	border-radius: 12px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition-property: background-color, box-shadow, opacity, scale;
	transition-duration: 150ms;
	transition-timing-function: ease;
}

.primary-button {
	min-width: 168px;
	padding: 0 20px;
	border: 0;
	color: white;
	background: var(--accent);
	box-shadow: var(--shadow-button);
}

.primary-button:hover {
	background: var(--accent-strong);
}

.primary-button:active,
.secondary-button:active,
.card-actions button:active,
.text-button:active {
	scale: 0.96;
}

.primary-button:disabled {
	opacity: 0.55;
	cursor: wait;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.card-actions button:focus-visible,
.text-button:focus-visible,
.tella-link:focus-visible,
.watch-link:focus-visible,
.model-toggle input:focus-visible + .toggle-track {
	outline: 3px solid rgba(109, 92, 232, 0.28);
	outline-offset: 2px;
}

.form-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-top: 14px;
	padding-inline: 4px;
	color: var(--muted);
	font-size: 13px;
}

.model-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	cursor: pointer;
	user-select: none;
}

.model-toggle input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.toggle-track {
	display: inline-flex;
	align-items: center;
	width: 32px;
	height: 20px;
	padding: 2px;
	border-radius: 999px;
	background: #d3d1d8;
	transition: background-color 150ms ease;
}

.toggle-track span {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: white;
	box-shadow: 0 1px 3px rgba(23, 23, 27, 0.24);
	transition: translate 150ms cubic-bezier(0.2, 0, 0, 1);
}

.model-toggle input:checked + .toggle-track {
	background: var(--accent);
}

.model-toggle input:checked + .toggle-track span {
	translate: 12px 0;
}

.status {
	min-height: 22px;
	margin-top: 18px;
	color: var(--muted);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.status.error {
	color: #b42318;
}

.progress {
	display: none;
	width: 100%;
	height: 4px;
	margin-top: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(109, 92, 232, 0.11);
}

.progress span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--accent);
	transition: width 200ms ease;
}

.section {
	margin-bottom: 112px;
}

.section-heading {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 24px;
}

h2 {
	margin-top: 6px;
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 700;
	letter-spacing: -0.04em;
	line-height: 1.1;
	text-wrap: balance;
}

h2 span {
	color: var(--faint);
	font-variant-numeric: tabular-nums;
}

.text-button {
	min-width: 72px;
	min-height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition-property: color, scale;
	transition-duration: 150ms;
}

.text-button:hover {
	color: var(--ink);
}

.card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.hook-card {
	min-width: 0;
	overflow: hidden;
	border-radius: 20px;
	background: var(--surface);
	box-shadow:
		var(--shadow-card),
		inset 0 0 0 1px var(--line);
}

.frame-wrap {
	position: relative;
	aspect-ratio: 16 / 10;
	margin: 8px 8px 0;
	overflow: hidden;
	border-radius: 14px;
	background: var(--frame);
	outline: 1px solid var(--image-outline);
	outline-offset: -1px;
}

.frame {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.frame[hidden] {
	display: none;
}

.frame-fallback {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: var(--accent);
	font-size: 32px;
	background: linear-gradient(145deg, var(--frame-start), var(--frame-end));
}

.watch-link {
	position: absolute;
	z-index: 2;
	right: 10px;
	bottom: 10px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 36px;
	padding: 0 12px;
	border-radius: 10px;
	color: white;
	background: rgba(16, 16, 19, 0.76);
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
	backdrop-filter: blur(10px);
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 150ms ease;
}

.watch-link:hover {
	background: rgba(16, 16, 19, 0.9);
}

.card-body {
	padding: 20px;
}

.creator {
	overflow: hidden;
	color: var(--muted);
	font-size: 13px;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hook {
	min-height: 112px;
	margin: 10px 0 18px;
	overflow-wrap: break-word;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.5;
}

.hook::before {
	content: "“";
	color: var(--accent);
}

.hook:not(.pending)::after {
	content: "”";
	color: var(--accent);
}

.hook.pending {
	color: var(--faint);
}

.hook.pending::before {
	content: "";
}

.card-actions {
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.card-actions:not([hidden]) {
	display: grid;
}

.card-actions button {
	min-height: 42px;
	padding: 0 12px;
	border: 0;
	border-radius: 10px;
	color: var(--ink);
	background: var(--control);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition-property: background-color, color, scale;
	transition-duration: 150ms;
}

.card-actions button:hover {
	background: var(--control-hover);
}

.card-actions button[data-action="save"] {
	color: var(--accent-ink);
	background: var(--surface-soft);
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 280px;
	padding: 40px;
	border-radius: 20px;
	color: var(--muted);
	background: var(--empty);
	box-shadow: inset 0 0 0 1px var(--line);
	text-align: center;
}

.empty-state[hidden] {
	display: none;
}

.empty-state strong {
	margin-top: 14px;
	color: var(--ink);
	font-size: 17px;
	font-weight: 700;
}

.empty-state span:not(.empty-icon) {
	margin-top: 4px;
	font-size: 14px;
}

.empty-icon {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 16px;
	color: var(--accent);
	background: var(--surface-soft);
	box-shadow: inset 0 0 0 1px rgba(109, 92, 232, 0.12);
	font-size: 20px;
}

.automation-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 48px;
	margin-bottom: 112px;
	padding: 48px;
	border-radius: 28px;
	color: white;
	background:
		radial-gradient(
			circle at 90% 0%,
			rgba(169, 158, 255, 0.35),
			transparent 24rem
		),
		#24222d;
	box-shadow: 0 24px 60px rgba(23, 23, 27, 0.15);
}

.automation-card .eyebrow {
	color: #a9a0ff;
}

.automation-card h2 {
	max-width: 620px;
}

.automation-card p {
	max-width: 660px;
	margin-top: 16px;
	color: #bdbac6;
	line-height: 1.65;
	text-wrap: pretty;
}

.secondary-button {
	min-width: 190px;
	padding: 0 20px;
	color: var(--ink);
	background: white;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.secondary-button:hover {
	background: #f4f2ff;
}

footer {
	display: flex;
	justify-content: space-between;
	gap: 24px;
	padding-block: 24px 40px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 13px;
}

footer a {
	color: var(--ink);
	font-weight: 700;
}

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

@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--canvas: #111116;
		--surface: #1c1c23;
		--surface-soft: rgba(109, 92, 232, 0.16);
		--ink: #f4f3f7;
		--muted: #aaa8b4;
		--faint: #7f7d89;
		--accent-ink: #b9b2ff;
		--line: rgba(255, 255, 255, 0.09);
		--control: #292830;
		--control-hover: #32313a;
		--frame: #24232b;
		--frame-start: #292643;
		--frame-end: #24213b;
		--empty: rgba(255, 255, 255, 0.025);
		--image-outline: rgba(255, 255, 255, 0.1);
		--shadow-card:
			0 1px 2px rgba(0, 0, 0, 0.15), 0 12px 32px rgba(0, 0, 0, 0.2);
	}

	body {
		background:
			radial-gradient(
				circle at 50% -10%,
				rgba(130, 120, 250, 0.16),
				transparent 34rem
			),
			var(--canvas);
	}

	.primary-button {
		background: var(--accent);
	}

	.automation-card {
		box-shadow:
			inset 0 0 0 1px var(--line),
			0 24px 60px rgba(0, 0, 0, 0.24);
	}
}

@media (max-width: 840px) {
	.hero {
		margin-block: 80px 96px;
	}

	.card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.automation-card {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.secondary-button {
		justify-self: start;
	}
}

@media (max-width: 600px) {
	.site-header,
	main,
	footer {
		width: min(100% - 28px, 1120px);
	}

	.site-header {
		min-height: 68px;
	}

	.tella-link {
		font-size: 0;
	}

	.tella-link::before {
		content: "Tella";
		font-size: 14px;
	}

	.tella-link span {
		font-size: 14px;
	}

	.hero {
		margin-block: 64px 80px;
	}

	h1 {
		margin-top: 14px;
		font-size: clamp(40px, 13vw, 58px);
	}

	.hero-copy {
		font-size: 16px;
	}

	.extract-form {
		grid-template-columns: 1fr;
		padding: 8px;
		border-radius: 18px;
	}

	.primary-button {
		width: 100%;
	}

	.form-meta {
		align-items: start;
	}

	.privacy-note {
		max-width: 150px;
		text-align: end;
	}

	.section {
		margin-bottom: 80px;
	}

	.card-grid {
		grid-template-columns: 1fr;
	}

	.hook {
		min-height: auto;
	}

	.automation-card {
		margin-bottom: 80px;
		padding: 32px 24px;
		border-radius: 22px;
	}

	.secondary-button {
		width: 100%;
	}

	footer {
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
