/* ============================================================
   Fabian Sponholz – CV website
   Self-contained, no external dependencies.
   ============================================================ */

:root {
	--accent: #1b4ed8;
	--accent-soft: #3b6df0;
	--accent-ghost: rgba(27, 78, 216, 0.10);

	--bg: #f6f7fb;
	--bg-alt: #eef1f8;
	--surface: #ffffff;
	--surface-2: #f3f5fb;
	--text: #1a1f2e;
	--text-soft: #5a6377;
	--border: #e2e6f0;
	--shadow: 0 10px 30px -12px rgba(20, 30, 70, 0.18);
	--shadow-sm: 0 2px 8px -2px rgba(20, 30, 70, 0.12);

	--radius: 16px;
	--radius-sm: 10px;
	--maxw: 1080px;
	--font: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
	--accent: #6f9bff;
	--accent-soft: #89adff;
	--accent-ghost: rgba(111, 155, 255, 0.14);

	--bg: #0e1220;
	--bg-alt: #121829;
	--surface: #171d30;
	--surface-2: #1d2540;
	--text: #eaeef9;
	--text-soft: #9aa6c2;
	--border: #28304a;
	--shadow: 0 14px 40px -16px rgba(0, 0, 0, 0.6);
	--shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font);
	color: var(--text);
	background: var(--bg);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	transition: background 0.3s ease, color 0.3s ease;
}

.container { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; }

h1, h2, h3 { line-height: 1.2; margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
	position: absolute; left: -999px; top: 0; z-index: 200;
	background: var(--accent); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: color-mix(in srgb, var(--surface) 86%, transparent);
	backdrop-filter: saturate(160%) blur(12px);
	border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; height: 64px; }

.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
	display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
	background: linear-gradient(135deg, var(--accent), var(--accent-soft));
	color: #fff; font-weight: 800; font-size: 0.95rem; letter-spacing: 0.5px;
}
.brand-name { font-size: 1.02rem; }

.main-nav { display: flex; gap: 1.3rem; margin-left: auto; }
.main-nav a { color: var(--text-soft); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover { color: var(--accent); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: 1rem; }
.main-nav + .header-actions { margin-left: 1.4rem; }

.pill-btn, .icon-btn {
	border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
	cursor: pointer; border-radius: 999px; transition: all 0.2s ease;
}
.pill-btn { padding: 0.32rem 0.7rem; font-weight: 700; font-size: 0.82rem; letter-spacing: 0.4px; }
.pill-btn .sep { opacity: 0.4; margin: 0 0.15rem; }
.pill-btn .lang-de, .pill-btn .lang-en { opacity: 0.45; }
html[lang="de"] .pill-btn .lang-de, html[lang="en"] .pill-btn .lang-en { opacity: 1; color: var(--accent); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; }
.pill-btn:hover, .icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn svg { stroke: currentColor; fill: none; stroke-width: 2; }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 5vw, 4rem); position: relative; overflow: hidden; }
.hero::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background:
		radial-gradient(60% 60% at 85% 0%, var(--accent-ghost), transparent 70%),
		radial-gradient(50% 50% at 0% 100%, var(--accent-ghost), transparent 70%);
}
.hero-inner { display: grid; grid-template-columns: 280px 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }

.hero-photo img {
	width: 100%; max-width: 300px; height: auto; display: block;
	border-radius: 22px; box-shadow: var(--shadow);
	border: 4px solid var(--surface);
}

.eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 0 0 0.4rem; }
.hero-text h1 { font-size: clamp(2.2rem, 6vw, 3.5rem); font-weight: 800; letter-spacing: -1px; }
.hero-role { font-size: clamp(1.05rem, 2.5vw, 1.4rem); font-weight: 600; color: var(--text); margin: 0.5rem 0 0; }
.hero-tagline { color: var(--text-soft); max-width: 52ch; margin: 0.9rem 0 0; font-size: 1.02rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }
.btn {
	display: inline-flex; align-items: center; gap: 0.5rem;
	padding: 0.6rem 1.05rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
	border: 1px solid var(--border); background: var(--surface); color: var(--text);
	cursor: pointer; transition: all 0.2s ease;
}
.btn svg { stroke: currentColor; fill: none; stroke-width: 2; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); text-decoration: none; border-color: var(--accent); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-soft)); color: #fff; border-color: transparent; }
.btn-primary svg { fill: none; }
.btn-ghost { background: transparent; }

.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; padding: 0; margin: 1.6rem 0 0; color: var(--text-soft); font-size: 0.92rem; }
.hero-facts li { display: flex; align-items: center; gap: 0.5rem; }
.hero-facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Sections ---------- */
.section { padding: clamp(2.8rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--bg-alt); }

.section-title { display: flex; align-items: baseline; gap: 0.8rem; font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 2rem; }
.section-title .num { font-size: 0.95rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

.lead { font-size: 1.12rem; color: var(--text-soft); max-width: 68ch; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 0 0 1.6rem 2.4rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
	content: ""; position: absolute; left: 2px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
	background: var(--surface); border: 3px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-ghost);
}
.t-date { display: inline-block; font-size: 0.82rem; font-weight: 700; color: var(--accent); letter-spacing: 0.3px; margin-bottom: 0.35rem; }
.t-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.2rem; box-shadow: var(--shadow-sm); }
.t-card h3 { font-size: 1.08rem; font-weight: 700; }
.t-org { margin: 0.2rem 0 0; font-weight: 600; color: var(--text); font-size: 0.95rem; }
.t-desc { margin: 0.5rem 0 0; color: var(--text-soft); font-size: 0.95rem; }

/* ---------- Skills ---------- */
.skill-group { margin-bottom: 1.8rem; }
.skill-group:last-child { margin-bottom: 0; }
.skill-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; font-size: 1.05rem; font-weight: 700; margin-bottom: 0.9rem; }
.badge { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }
.badge-pro { background: var(--accent); color: #fff; border-color: transparent; }

.chip-grid { list-style: none; display: flex; flex-wrap: wrap; gap: 0.55rem; padding: 0; margin: 0; }
.chip {
	background: var(--surface); border: 1px solid var(--border); color: var(--text);
	padding: 0.45rem 0.9rem; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
	box-shadow: var(--shadow-sm); transition: transform 0.15s ease, border-color 0.15s ease;
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.chip-pro { background: linear-gradient(135deg, var(--accent), var(--accent-soft)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px var(--accent); }
.chip-soft { background: var(--surface-2); box-shadow: none; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.project-card { display: flex; flex-direction: column; gap: 0.3rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem; color: var(--text); box-shadow: var(--shadow-sm); transition: transform 0.18s ease, border-color 0.18s ease; }
.project-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.project-name { font-weight: 700; font-size: 1.05rem; }
.project-tech { font-size: 0.8rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }
.project-desc { color: var(--text-soft); font-size: 0.92rem; }
.all-repos { display: inline-block; margin-top: 1.1rem; font-weight: 600; }

/* ---------- Languages ---------- */
.lang-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; padding: 0; margin: 0; }
.lang-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 0.25rem; }
.lang-name { font-weight: 700; font-size: 1.1rem; }
.lang-level { color: var(--text-soft); font-size: 0.92rem; }

/* ---------- Hobbies ---------- */
.hobby-grid { list-style: none; display: flex; flex-wrap: wrap; gap: 0.7rem; padding: 0; margin: 0; }
.hobby { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0.6rem 1.2rem; font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 2.2rem 0; margin-top: 1rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.5rem; }
.footer-name { font-weight: 700; margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-right: auto; }
.footer-copy { color: var(--text-soft); font-size: 0.88rem; margin: 0; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; transition: none; }
	.btn:hover, .chip:hover, .project-card:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
	.main-nav { display: none; }
	.header-actions, .main-nav + .header-actions { margin-left: auto; }
	.hero-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
	.hero-photo img { max-width: 220px; }
	.hero-tagline { margin-inline: auto; }
	.hero-actions, .hero-facts { justify-content: center; }
}

/* ---------- Print (Save as PDF) ---------- */
@media print {
	:root { --bg: #fff; --bg-alt: #fff; --surface: #fff; --surface-2: #fff; --text: #111; --text-soft: #333; --border: #ccc; --shadow: none; --shadow-sm: none; }
	.site-header, .hero-actions, .theme-toggle, #theme-toggle, #lang-toggle, .skip-link, .all-repos, .main-nav { display: none !important; }
	body { background: #fff; font-size: 11pt; }
	.hero { padding: 0 0 0.6rem; }
	.hero::before { display: none; }
	.hero-inner { grid-template-columns: 150px 1fr; gap: 1.2rem; }
	.hero-photo img { max-width: 130px; box-shadow: none; border: 1px solid #ccc; }
	.section { padding: 0.7rem 0; break-inside: avoid; }
	.section-alt { background: #fff; }
	.reveal { opacity: 1 !important; transform: none !important; }
	.t-card, .chip, .lang-item, .hobby, .project-card { box-shadow: none; }
	.chip-pro { background: #eee !important; color: #111 !important; border: 1px solid #999; }
	.timeline-item { break-inside: avoid; }
	a { color: #111; text-decoration: none; }
	.container { width: 100%; }
}
