/* ============================================
   Random Quote Machine — Styles
   Matches the portfolio design system
   ============================================ */

:root {
	--indigo: #4f46e5;
	--indigo-light: #818cf8;
	--cyan: #06b6d4;
	--cyan-light: #67e8f9;
	--emerald: #10b981;
	--amber: #f59e0b;

	--midnight: #0b1120;
	--navy: #111827;
	--card-bg: #161d2f;
	--card-border: rgba(255, 255, 255, 0.06);
	--slate-700: #334155;
	--slate-600: #475569;
	--slate-400: #94a3b8;
	--slate-300: #cbd5e1;
	--slate-200: #e2e8f0;
	--white: #ffffff;

	--font-heading:
		"Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
	--font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
	--font-mono: "JetBrains Mono", "Fira Code", monospace;

	--r-md: 10px;
	--r-lg: 16px;
	--r-xl: 24px;
	--r-full: 9999px;

	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--font-body);
	background: var(--midnight);
	color: var(--slate-300);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem 1.5rem;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	position: relative;
	overflow-x: hidden;
}

/* Subtle gradient background */
body::before {
	content: "";
	position: fixed;
	top: -30%;
	left: 50%;
	transform: translateX(-50%);
	width: 700px;
	height: 700px;
	border-radius: 50%;
	background: var(--indigo);
	filter: blur(160px);
	opacity: 0.1;
	pointer-events: none;
	z-index: 0;
}

body::after {
	content: "";
	position: fixed;
	bottom: -20%;
	right: -10%;
	width: 500px;
	height: 500px;
	border-radius: 50%;
	background: var(--cyan);
	filter: blur(140px);
	opacity: 0.07;
	pointer-events: none;
	z-index: 0;
}

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

button {
	font-family: inherit;
	border: none;
	cursor: pointer;
}

/* ==================
   BACK LINK
   ================== */
.back-link {
	position: fixed;
	top: 1.5rem;
	left: 1.5rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--slate-400);
	padding: 0.5em 1em;
	border-radius: var(--r-full);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--card-border);
	transition: all 0.25s ease;
	z-index: 100;
}

.back-link:hover {
	color: var(--white);
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.12);
	transform: translateX(-3px);
}

/* ==================
   CLOCK
   ================== */
.clock {
	position: fixed;
	top: 1.5rem;
	right: 1.5rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	color: var(--slate-400);
	padding: 0.5em 1em;
	border-radius: var(--r-full);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--card-border);
	z-index: 100;
}

.clock__separator {
	color: var(--slate-600);
}

/* ==================
   APP LAYOUT
   ================== */
.app {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 640px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2rem;
}

.app__header {
	text-align: center;
}

.app__header h1 {
	font-family: var(--font-heading);
	font-size: clamp(1.4rem, 4vw, 2rem);
	font-weight: 700;
	color: var(--white);
	margin-bottom: 0.4rem;
}

.app__subtitle {
	font-size: 0.95rem;
	color: var(--slate-400);
}

/* ==================
   QUOTE CARD
   ================== */
.quote-card {
	width: 100%;
	border-radius: var(--r-xl);
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	padding: 2.5rem 2rem;
	position: relative;
	overflow: hidden;
	transition: box-shadow 0.4s ease;
}

.quote-card:hover {
	box-shadow:
		0 20px 60px rgba(0, 0, 0, 0.2),
		0 0 40px rgba(79, 70, 229, 0.08);
}

/* Accent line at top */
.quote-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(
		90deg,
		var(--indigo),
		var(--cyan),
		var(--emerald)
	);
}

.quote-card__inner {
	position: relative;
}

.quote-card__icon {
	font-size: 1.6rem;
	color: var(--indigo-light);
	opacity: 0.4;
	margin-bottom: 1rem;
	display: block;
}

.quote-card__text {
	font-family: var(--font-heading);
	font-size: clamp(1.15rem, 3vw, 1.5rem);
	font-weight: 500;
	color: var(--white);
	line-height: 1.6;
	margin-bottom: 1.5rem;
	min-height: 4em;
	transition: opacity 0.3s ease;
}

.quote-card__text.fade-out {
	opacity: 0;
}

.quote-card__author {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-mono);
	font-size: 0.85rem;
	font-style: normal;
	color: var(--cyan);
	transition: opacity 0.3s ease;
}

.quote-card__author.fade-out {
	opacity: 0;
}

.quote-card__author::before {
	content: "";
	display: inline-block;
	width: 24px;
	height: 1px;
	background: var(--cyan);
	opacity: 0.5;
}

/* ==================
   BUTTONS
   ================== */
.actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	justify-content: center;
	flex-wrap: wrap;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-family: var(--font-body);
	font-size: 0.88rem;
	font-weight: 600;
	padding: 0.75em 1.6em;
	border-radius: var(--r-full);
	border: 2px solid transparent;
	cursor: pointer;
	transition: all 0.3s var(--ease-out);
	white-space: nowrap;
}

.btn:hover {
	transform: translateY(-2px);
}

.btn:active {
	transform: translateY(0);
}

.btn--primary {
	background: linear-gradient(135deg, var(--indigo), var(--indigo-light));
	color: var(--white);
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn--primary:hover {
	box-shadow: 0 6px 24px rgba(79, 70, 229, 0.5);
}

.btn--primary:active {
	box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* Icon-only buttons */
.actions__share {
	display: flex;
	gap: 0.5rem;
}

.btn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--card-border);
	color: var(--slate-400);
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.25s ease;
}

.btn-icon:hover {
	background: rgba(255, 255, 255, 0.1);
	color: var(--white);
	border-color: rgba(255, 255, 255, 0.15);
	transform: translateY(-2px);
}

/* Copied tooltip */
.btn-icon.copied {
	color: var(--emerald);
	border-color: rgba(16, 185, 129, 0.3);
	background: rgba(16, 185, 129, 0.1);
}

/* ==================
   FOOTER
   ================== */
.app__footer {
	text-align: center;
	padding-top: 1rem;
}

.app__footer p {
	font-size: 0.8rem;
	color: var(--slate-600);
}

.app__footer a {
	color: var(--slate-400);
	transition: color 0.2s ease;
}

.app__footer a:hover {
	color: var(--indigo-light);
}

/* ==================
   RESPONSIVE
   ================== */
@media (max-width: 640px) {
	body {
		padding: 4rem 1rem 2rem;
	}

	.back-link span {
		display: none;
	}

	.clock {
		top: auto;
		bottom: 1rem;
		right: 50%;
		transform: translateX(50%);
	}

	.quote-card {
		padding: 2rem 1.5rem;
	}
}

@media (max-width: 400px) {
	.actions {
		flex-direction: column;
	}

	.btn {
		width: 100%;
		justify-content: center;
	}
}
