/* DM Sans - Variable Font */
@font-face {
	font-family: 'DM Sans';
	src: url('../webfonts/DMSans.woff2') format('woff2');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

/* ── Design System ── */

:root {
	--color-bg-start: #f0f4f8;
	--color-bg-end: #d9e2ec;
	--color-text: #1a2f42;
	--color-text-muted: rgba(26, 47, 66, 0.55);
	--color-accent: #c9a227;
	--color-toggle-bg: #ffffff;
	--color-shadow: rgba(0, 0, 0, 0.08);

	--font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--app-height: 100vh;
	--radius-full: 9999px;
	--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Dark Theme */
[data-theme="dark"] {
	--color-bg-start: #0f1b2d;
	--color-bg-end: #1a2744;
	--color-text: #e2e8f0;
	--color-text-muted: rgba(226, 232, 240, 0.5);
	--color-accent: #d4aa2a;
	--color-toggle-bg: #ffffff;
	--color-shadow: rgba(0, 0, 0, 0.3);
}

/* ── Reset ── */

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

html, body {
	width: 100%;
	height: var(--app-height);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ── Layout ── */

body {
	font-family: var(--font-main);
	color: var(--color-text);
	background: linear-gradient(135deg, var(--color-bg-start) 0%, var(--color-bg-end) 100%);
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 1.5rem;
	min-height: 100vh;
	min-height: var(--app-height);
	transition: background 0.3s ease, color 0.3s ease;
}

.container {
	width: 100%;
	max-width: 720px;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	animation: fadeInUp 1s ease-out;
}

/* ── Illustrations ── */

.illustration-wrapper {
	position: relative;
	width: 100%;
	max-width: 180px;
	aspect-ratio: 1;
	animation: float 6s ease-in-out infinite;
}

.illustration {
	position: absolute;
	inset: 0;
	transition: opacity 0.6s ease;
}

.illustration svg {
	width: 100%;
	height: auto;
	display: block;
}

/* Crossfade: sun visible in light, moon in dark */
.illustration-sun { opacity: 1; }
.illustration-moon { opacity: 0; }

[data-theme="dark"] .illustration-sun { opacity: 0; }
[data-theme="dark"] .illustration-moon { opacity: 1; }

/* Sun ray animations — individual rays */
.ray { stroke-linecap: round; stroke: var(--color-accent); }

.ray-1 { animation: rayBreath1 3.5s ease-in-out infinite; }
.ray-2 { animation: rayBreath2 4.0s ease-in-out infinite 0.3s; }
.ray-3 { animation: rayBreath1 3.8s ease-in-out infinite 0.6s; }
.ray-4 { animation: rayBreath2 3.6s ease-in-out infinite 0.9s; }
.ray-5 { animation: rayBreath1 4.2s ease-in-out infinite 0.2s; }
.ray-6 { animation: rayBreath2 3.4s ease-in-out infinite 0.5s; }
.ray-7 { animation: rayBreath1 3.9s ease-in-out infinite 0.8s; }
.ray-8 { animation: rayBreath2 3.7s ease-in-out infinite 0.4s; }

@keyframes rayBreath1 {
	0%, 100% { opacity: 0.6; stroke-dasharray: 14 100; }
	50% { opacity: 1; stroke-dasharray: 20 100; }
}

@keyframes rayBreath2 {
	0%, 100% { opacity: 0.8; stroke-dasharray: 10 100; }
	50% { opacity: 0.5; stroke-dasharray: 16 100; }
}

/* Slow overall rotation */
.sun-rays {
	transform-origin: 100px 100px;
	animation: raySpin 60s linear infinite;
}

@keyframes raySpin {
	to { transform: rotate(360deg); }
}

/* Stars (moon only) */
.star { animation: twinkle 4s ease-in-out infinite; }
.star-1 { animation-delay: 0s; }
.star-2 { animation-delay: 0.7s; }
.star-3 { animation-delay: 1.5s; }
.star-4 { animation-delay: 2.2s; }
.star-5 { animation-delay: 3s; }
.star-6 { animation-delay: 1s; }
.star-7 { animation-delay: 1.8s; }

/* ── Typography ── */

.container span {
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.15em;
	color: var(--color-accent);
	text-align: center;
}

h1 {
	font-size: clamp(1.75rem, 5vw, 2.5rem);
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	color: var(--color-text);
}

.container p {
	font-size: clamp(0.9rem, 2vw, 1rem);
	font-weight: 400;
	line-height: 1.7;
	text-align: center;
	color: var(--color-text-muted);
	max-width: 560px;
}

/* ── Theme Toggle ── */

.theme-toggle {
	position: fixed;
	top: 1.5rem;
	right: 1.5rem;
	background: var(--color-toggle-bg);
	border: none;
	border-radius: var(--radius-full);
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--shadow);
	transition: all 0.2s ease;
	z-index: 100;
}

.theme-toggle:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.15);
}

.theme-toggle:active {
	transform: scale(0.95);
}

.theme-toggle svg {
	width: 20px;
	height: 20px;
	color: #1a2f42;
	transition: transform 0.3s ease;
}

.icon-sun { display: none; }
.icon-moon { display: block; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ── Footer ── */

.footer {
	width: 100%;
	padding: 1.25rem;
	text-align: center;
	font-size: 0.8125rem;
	line-height: 1.6;
	color: var(--color-text-muted);
}

.footer-heart {
	color: var(--color-accent);
}

.footer-credit a {
	color: var(--color-accent);
	text-decoration: none;
	font-weight: 500;
}

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

.footer-slogan {
	margin-top: 0.25rem;
	font-size: 0.75rem;
}

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

.footer-slogan a:hover {
	color: var(--color-accent);
}

.footer-extra {
	margin-top: 0.25rem;
	font-size: 0.75rem;
}

/* ── Animations ── */

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-10px); }
}

@keyframes twinkle {
	0%, 100% { opacity: 0.05; }
	50% { opacity: 0.5; }
}

/* ── Responsive ── */

@media (max-width: 768px) {
	.container {
		max-width: 560px;
	}
}

@media (max-width: 600px) {
	.container {
		max-width: 480px;
	}

	.container p {
		max-width: 480px;
	}
}

@media (max-width: 480px) {
	body {
		padding: 1rem;
	}

	.container {
		max-width: 100%;
	}

	.illustration-wrapper {
		max-width: 140px;
	}

	.footer {
		font-size: 0.75rem;
		padding: 1rem;
	}

	.theme-toggle {
		width: 40px;
		height: 40px;
		top: 1rem;
		right: 1rem;
	}

	.theme-toggle svg {
		width: 18px;
		height: 18px;
	}
}

@media (max-width: 375px) {
	h1 {
		font-size: 1.5rem;
	}

	.illustration-wrapper {
		max-width: 120px;
	}
}

/* ── Accessibility ── */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

*:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}
