/* Victor Torres — personal site, 2026
   Modern, minimal, dark-first with light theme support. */

:root {
	--bg: #0b0d10;
	--bg-soft: #14171d;
	--surface: rgba(255, 255, 255, 0.035);
	--surface-hover: rgba(255, 255, 255, 0.06);
	--border: rgba(255, 255, 255, 0.09);
	--border-strong: rgba(255, 255, 255, 0.16);
	--text: #e9ebf0;
	--muted: #98a1b0;
	--faint: #6b7482;
	--accent: #8b8cff;
	--accent-2: #5ad1c9;
	--glow-1: rgba(139, 140, 255, 0.22);
	--glow-2: rgba(90, 209, 201, 0.14);
	--shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
	--radius: 16px;
	--maxw: 620px;
}

:root[data-theme="light"] {
	--bg: #f7f8fa;
	--bg-soft: #ffffff;
	--surface: rgba(20, 24, 33, 0.02);
	--surface-hover: rgba(20, 24, 33, 0.045);
	--border: rgba(20, 24, 33, 0.10);
	--border-strong: rgba(20, 24, 33, 0.18);
	--text: #1a1e26;
	--muted: #59616e;
	--faint: #8b93a1;
	--accent: #5b5cf0;
	--accent-2: #0f9b90;
	--glow-1: rgba(91, 92, 240, 0.14);
	--glow-2: rgba(15, 155, 144, 0.10);
	--shadow: 0 18px 45px -22px rgba(30, 40, 60, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
		"Apple Color Emoji", "Segoe UI Emoji", sans-serif;
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: clamp(2.5rem, 8vh, 6rem) 1.25rem 3rem;
	position: relative;
	overflow-x: hidden;
}

/* Ambient background glow */
.glow {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(60vw 60vw at 20% -10%, var(--glow-1), transparent 60%),
		radial-gradient(50vw 50vw at 100% 10%, var(--glow-2), transparent 55%);
}

.wrap {
	width: 100%;
	max-width: var(--maxw);
}

/* ---------- Hero ---------- */
.hero { text-align: center; }

#avatar {
	width: 112px;
	height: 112px;
	border-radius: 50%;
	border: 1px solid var(--border-strong);
	padding: 4px;
	background: var(--bg-soft);
	box-shadow: var(--shadow);
}

h1 {
	margin: 1.1rem 0 0.35rem;
	font-size: clamp(2rem, 6vw, 2.75rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.tagline {
	margin: 0 auto;
	max-width: 26ch;
	font-size: clamp(1.05rem, 3vw, 1.25rem);
	font-weight: 500;
	background: linear-gradient(100deg, var(--accent), var(--accent-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.tagline .amp { opacity: 0.7; }

.role {
	margin: 0.75rem 0 0.35rem;
	color: var(--muted);
	font-size: 0.92rem;
	font-weight: 500;
}

.location {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
	color: var(--faint);
	font-size: 0.85rem;
}
.location svg { color: var(--accent); }

/* ---------- About ---------- */
.about {
	margin: 2.5rem auto 0;
	max-width: 56ch;
	text-align: center;
	color: var(--muted);
	font-size: 1rem;
}
.about p { margin: 0 0 0.9rem; }
.about p:last-child { margin-bottom: 0; }

/* ---------- Links ---------- */
.links {
	display: grid;
	gap: 0.7rem;
	margin-top: 2.75rem;
}

.card {
	display: flex;
	align-items: center;
	gap: 0.95rem;
	padding: 0.95rem 1.05rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	transition: transform 0.18s ease, border-color 0.18s ease,
		background 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
	transform: translateY(-2px);
	border-color: var(--border-strong);
	background: var(--surface-hover);
	box-shadow: var(--shadow);
}

.card .ic {
	flex: none;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	border: 1px solid var(--border);
	color: var(--accent);
	background: var(--bg-soft);
	transition: color 0.18s ease, border-color 0.18s ease;
}
.card:hover .ic { color: var(--accent-2); border-color: var(--border-strong); }

.card .body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.card .title { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.card .sub { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }

.card .arrow {
	margin-left: auto;
	color: var(--faint);
	font-size: 1.1rem;
	transition: transform 0.18s ease, color 0.18s ease;
}
.card:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }

/* Featured (WebPiper) */
.card.featured {
	border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
	background:
		linear-gradient(120deg, var(--glow-1), transparent 55%),
		var(--surface);
}

.badge {
	display: inline-block;
	margin-left: 0.5rem;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
	color: var(--accent);
	background: color-mix(in srgb, var(--accent) 12%, transparent);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	vertical-align: middle;
}

/* ---------- Footer ---------- */
.foot {
	margin-top: 2.75rem;
	text-align: center;
}
.mail {
	display: inline-block;
	color: var(--text);
	text-decoration: none;
	font-weight: 500;
	border-bottom: 1px solid var(--border-strong);
	padding-bottom: 2px;
	transition: color 0.18s ease, border-color 0.18s ease;
}
.mail:hover { color: var(--accent); border-color: var(--accent); }
.copy { margin: 0.9rem 0 0; color: var(--faint); font-size: 0.8rem; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
	position: fixed;
	top: 1.1rem;
	right: 1.1rem;
	z-index: 10;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text);
	cursor: pointer;
	backdrop-filter: blur(8px);
	transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); background: var(--surface-hover); transform: translateY(-1px); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Reveal animation ---------- */
.reveal {
	opacity: 0;
	transform: translateY(14px);
	animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero  { animation-delay: 0.02s; }
.about { animation-delay: 0.10s; }
.links { animation-delay: 0.18s; }
.foot  { animation-delay: 0.26s; }

@keyframes rise {
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.reveal { animation: none; opacity: 1; transform: none; }
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}