:root {
	--bg: #0a0a0a;
	--bg-panel: rgba(24, 24, 24, 0.9);
	--bg-hover: rgba(37, 37, 37, 0.8);
	--fg: #f7f7f7;
	--fg-muted: #a1a1aa;
	--accent: #6366f1;
	--accent-muted: rgba(99, 102, 241, 0.15);
	--danger: #f97316;
	--success: #34d399;
	--border: rgba(255, 255, 255, 0.08);
	--radius: 12px;
	--shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	font-size: 16px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
	min-height: 100vh;
	background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.35) 0%, transparent 40%), radial-gradient(circle at 100% 0%, rgba(129, 140, 248, 0.25) 0%, transparent 45%), var(--bg);
	color: var(--fg);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 4rem 1.5rem;
}

.layout {
	width: min(960px, 100%);
	display: grid;
	gap: 1.5rem;
}

.hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--bg-panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.75rem 2rem;
	box-shadow: var(--shadow);
}

.hero__title h1 {
	font-size: clamp(1.75rem, 3vw, 2.4rem);
	font-weight: 600;
	letter-spacing: -0.03em;
}

.hero__title p {
	margin-top: 0.35rem;
	color: var(--fg-muted);
	max-width: 36ch;
}

.panel {
	background: var(--bg-panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	box-shadow: var(--shadow);
	backdrop-filter: blur(12px);
}

.metrics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1rem;
	align-items: center;
}

.metric {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.metric__label {
	font-size: 0.85rem;
	color: var(--fg-muted);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.metric__value {
	font-size: 1.5rem;
	font-weight: 600;
}

.duration-selector {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	font-size: 0.9rem;
	color: var(--fg-muted);
}

.duration-selector select {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 40px;
	color: var(--fg);
	padding: 0.6rem 1rem;
	appearance: none;
	outline: none;
	cursor: pointer;
}

.duration-selector select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-muted);
}

.quote-panel {
	position: relative;
	padding: 1.1rem 1.4rem;
}

.progress {
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: inherit;
	overflow: hidden;
	border: 1px solid rgba(99, 102, 241, 0.2);
}

.progress__bar {
	position: absolute;
	height: 100%;
	width: 0;
	background: linear-gradient(120deg, rgba(99, 102, 241, 0.35), rgba(129, 140, 248, 0.6));
	transition: width 0.2s ease-out;
}

.quote {
	position: relative;
	z-index: 1;
	font-size: 1.15rem;
	line-height: 1.7;
	color: var(--fg-muted);
	letter-spacing: 0.015em;
	overflow-y: auto;
	padding-right: 0.75rem;
	white-space: pre-wrap;
	word-break: break-word;
}

.quote-input {
	width: 100%;
	background: var(--bg);
	border-radius: var(--radius);
	padding: 1.25rem;
	font-size: 1.1rem;
	color: var(--fg);
	border: 1px solid var(--border);
	resize: vertical;
	line-height: 1.6;
	transition: border-color 0.2s ease;
}

.quote-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-muted);
}

.controls {
	display: flex;
	justify-content: center;
	align-items: center;
}

.controls__group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 500;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 0.75rem 1.6rem;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
	opacity: 0.5;
	pointer-events: none;
	box-shadow: none;
	transform: none;
}

.btn--primary {
	background: linear-gradient(120deg, #6366f1, #8b5cf6);
	color: var(--fg);
}

.btn--warning {
	background: rgba(249, 115, 22, 0.2);
	color: var(--danger);
	border-color: rgba(249, 115, 22, 0.4);
}

.btn--ghost {
	background: rgba(255, 255, 255, 0.05);
	color: var(--fg);
	border-color: var(--border);
}

.btn--ghost:hover {
	background: rgba(255, 255, 255, 0.08);
}

.summary {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.summary h2 {
	font-size: 1.3rem;
	font-weight: 600;
}

.summary p {
	color: var(--fg-muted);
	line-height: 1.6;
}

.quote-chars {
	color: var(--fg-muted);
	transition: color 0.1s ease, text-shadow 0.1s ease;
}

.quote-chars.success {
	color: var(--fg);
	text-shadow: 0 0 12px rgba(52, 211, 153, 0.45);
}

.quote-chars.fail {
	color: #f87171;
	text-shadow: 0 0 10px rgba(248, 113, 113, 0.35);
}

.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 (max-width: 720px) {
	body {
		padding-top: 3rem;
	}

	.hero {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}

	.hero__title p {
		max-width: 100%;
	}

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

.credit {
    margin-top: auto;
    color: var(--text-muted);
    font-size: 1rem;
    text-align: center;
}

.credit a {
    color: var(--text-muted);
    text-decoration: none;
}

.credit a:hover {
    text-decoration: underline;
}