/*
Theme Name: Portfolio CV
Theme URI: https://example.com/portfolio-cv
Author: Artem
Author URI: https://example.com
Description: A clean CV/Portfolio theme with dark and light modes and contact form.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: portfolio-cv
Tags: portfolio, cv, dark-mode, light-mode, responsive, accessibility-ready
*/

/* CSS Variables and Color Scheme */
:root {
	--pcv-bg: #0b0f14;
	--pcv-surface: #121821;
	--pcv-text: #e8eef6;
	--pcv-text-muted: #b6c2d0;
	--pcv-accent: #60a5fa;
	--pcv-accent-contrast: #0b1220;
	--pcv-border: #233043;
}

/* Light mode overrides when .light is on html */
html.light {
	--pcv-bg: #f7fafc;
	--pcv-surface: #ffffff;
	--pcv-text: #0d1117;
	--pcv-text-muted: #4a5568;
	--pcv-accent: #2563eb;
	--pcv-accent-contrast: #ffffff;
	--pcv-border: #e2e8f0;
}

/* Respect user preference by default */
@media (prefers-color-scheme: light) {
	html:not(.dark):not(.light) {
		--pcv-bg: #f7fafc;
		--pcv-surface: #ffffff;
		--pcv-text: #0d1117;
		--pcv-text-muted: #4a5568;
		--pcv-accent: #2563eb;
		--pcv-accent-contrast: #ffffff;
		--pcv-border: #e2e8f0;
	}
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
	margin: 0;
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	background: var(--pcv-bg);
	color: var(--pcv-text);
	line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--pcv-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Header Star Rain Effect */
.header-star-rain {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 200px;
	overflow: hidden;
	pointer-events: none;
	z-index: 1;
}

.star {
	--star-color: var(--pcv-accent);
	--star-tail-length: 4em;
	--star-tail-height: 2px;
	--star-width: calc(var(--star-tail-length) / 6);
	--fall-duration: 8s;
	--tail-fade-duration: var(--fall-duration);
	
	position: absolute;
	top: var(--top-offset, 0);
	left: 0;
	width: var(--star-tail-length);
	height: var(--star-tail-height);
	color: var(--star-color);
	background: linear-gradient(45deg, currentColor, transparent);
	border-radius: 50%;
	filter: drop-shadow(0 0 3px currentColor);
	transform: translate3d(104em, 0, 0);
	animation: star-fall var(--fall-duration) var(--fall-delay, 0s) linear infinite, 
	           star-tail-fade var(--tail-fade-duration) var(--fall-delay, 0s) ease-out infinite;
}

.star::before,
.star::after {
	position: absolute;
	content: '';
	top: 0;
	left: calc(var(--star-width) / -2);
	width: var(--star-width);
	height: 100%;
	background: linear-gradient(45deg, transparent, currentColor, transparent);
	border-radius: inherit;
}

.star::before { transform: rotate(45deg); }
.star::after { transform: rotate(-45deg); }

/* Random positions and speeds for stars */
.star:nth-child(1) { --top-offset: 5%; --fall-delay: 0s; }
.star:nth-child(2) { --top-offset: 10%; --fall-delay: 0.5s; }
.star:nth-child(3) { --top-offset: 15%; --fall-delay: 1s; }
.star:nth-child(4) { --top-offset: 20%; --fall-delay: 1.5s; }
.star:nth-child(5) { --top-offset: 25%; --fall-delay: 2s; }
.star:nth-child(6) { --top-offset: 30%; --fall-delay: 2.5s; }
.star:nth-child(7) { --top-offset: 35%; --fall-delay: 3s; }
.star:nth-child(8) { --top-offset: 40%; --fall-delay: 3.5s; }
.star:nth-child(9) { --top-offset: 45%; --fall-delay: 4s; }
.star:nth-child(10) { --top-offset: 50%; --fall-delay: 4.5s; }
.star:nth-child(11) { --top-offset: 5%; --fall-delay: 1.2s; }
.star:nth-child(12) { --top-offset: 12%; --fall-delay: 2.3s; }
.star:nth-child(13) { --top-offset: 18%; --fall-delay: 0.8s; }
.star:nth-child(14) { --top-offset: 22%; --fall-delay: 3.1s; }
.star:nth-child(15) { --top-offset: 28%; --fall-delay: 1.7s; }
.star:nth-child(16) { --top-offset: 33%; --fall-delay: 4.2s; }
.star:nth-child(17) { --top-offset: 38%; --fall-delay: 0.3s; }
.star:nth-child(18) { --top-offset: 42%; --fall-delay: 2.8s; }
.star:nth-child(19) { --top-offset: 48%; --fall-delay: 1.5s; }
.star:nth-child(20) { --top-offset: 52%; --fall-delay: 3.7s; }
.star:nth-child(21) { --top-offset: 8%; --fall-delay: 0.7s; }
.star:nth-child(22) { --top-offset: 14%; --fall-delay: 2.1s; }
.star:nth-child(23) { --top-offset: 19%; --fall-delay: 3.4s; }
.star:nth-child(24) { --top-offset: 24%; --fall-delay: 1.1s; }
.star:nth-child(25) { --top-offset: 29%; --fall-delay: 4.3s; }
.star:nth-child(26) { --top-offset: 34%; --fall-delay: 0.9s; }
.star:nth-child(27) { --top-offset: 39%; --fall-delay: 2.6s; }
.star:nth-child(28) { --top-offset: 44%; --fall-delay: 3.9s; }
.star:nth-child(29) { --top-offset: 49%; --fall-delay: 1.3s; }
.star:nth-child(30) { --top-offset: 54%; --fall-delay: 2.4s; }
.star:nth-child(31) { --top-offset: 7%; --fall-delay: 0.2s; }
.star:nth-child(32) { --top-offset: 13%; --fall-delay: 1.8s; }
.star:nth-child(33) { --top-offset: 17%; --fall-delay: 3.3s; }
.star:nth-child(34) { --top-offset: 21%; --fall-delay: 0.6s; }
.star:nth-child(35) { --top-offset: 26%; --fall-delay: 2.7s; }
.star:nth-child(36) { --top-offset: 31%; --fall-delay: 4.1s; }
.star:nth-child(37) { --top-offset: 36%; --fall-delay: 0.4s; }
.star:nth-child(38) { --top-offset: 41%; --fall-delay: 2.2s; }
.star:nth-child(39) { --top-offset: 46%; --fall-delay: 3.8s; }
.star:nth-child(40) { --top-offset: 51%; --fall-delay: 1.6s; }
.star:nth-child(41) { --top-offset: 6%; --fall-delay: 2.9s; }
.star:nth-child(42) { --top-offset: 11%; --fall-delay: 0.8s; }
.star:nth-child(43) { --top-offset: 16%; --fall-delay: 3.5s; }
.star:nth-child(44) { --top-offset: 23%; --fall-delay: 1.4s; }
.star:nth-child(45) { --top-offset: 27%; --fall-delay: 4.4s; }
.star:nth-child(46) { --top-offset: 32%; --fall-delay: 0.5s; }
.star:nth-child(47) { --top-offset: 37%; --fall-delay: 2.5s; }
.star:nth-child(48) { --top-offset: 43%; --fall-delay: 3.6s; }
.star:nth-child(49) { --top-offset: 47%; --fall-delay: 1.9s; }
.star:nth-child(50) { --top-offset: 53%; --fall-delay: 0.1s; }

@keyframes star-fall {
	to { transform: translate3d(-30em, 0, 0); }
}

@keyframes star-tail-fade {
	0%, 50% {
		width: var(--star-tail-length);
		opacity: 1;
	}
	70%, 80% {
		width: 0;
		opacity: 0.4;
	}
	100% {
		width: 0;
		opacity: 0;
	}
}

/* Header */
.site-header {
	border-bottom: 1px solid var(--pcv-border);
	background: var(--pcv-surface);
	position: sticky;
	top: 0;
	z-index: 100;
}
.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
}
.site-title { 
	font-weight: 700; 
	letter-spacing: 0.3px; 
	font-size: 1.25rem; 
	position: relative;
	z-index: 2;
}
.site-title a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--pcv-accent); }
.site-title a:hover { text-decoration: none; }
.site-title a img { height: 48px; width: auto; display: block; position: relative; z-index: 2; }
.site-title a span { line-height: 1; position: relative; z-index: 2; }

.main-nav {
  display: flex;
  gap: 1.2rem;
}

.nav-btn {
  text-decoration: none;
  color: var(--pcv-text);
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-btn:hover {
  color: var(--pcv-accent);
}



/* Toggle */
.theme-toggle {
	appearance: none;
	border: 1px solid var(--pcv-border);
	background: var(--pcv-surface);
	color: var(--pcv-text);
	padding: 8px 12px;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--pcv-accent); }

/* Toggle icons and accessibility */
.theme-toggle .icon {
	width: 20px;
	height: 20px;
	display: block;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

html.light .theme-toggle .icon-sun { display: block; }
html.light .theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: light) {
	html:not(.dark):not(.light) .theme-toggle .icon-sun { display: block; }
	html:not(.dark):not(.light) .theme-toggle .icon-moon { display: none; }
}

.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;
}

/* Sections */
.section {
	padding: 56px 0;
	border-bottom: 1px solid var(--pcv-border);
	background: var(--pcv-bg);
}
.section.alt { background: var(--pcv-surface); }
.section h2 { margin-top: 0; margin-bottom: 12px; }
.section p.lead { color: var(--pcv-text-muted); margin-top: 0; }

.grid {
	display: grid;
	gap: 20px;
}
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { 
	.grid.cols-2 { grid-template-columns: 1fr; }
	.site-title a img { height: 36px; }
}

.card {
	border: 1px solid var(--pcv-border);
	background: var(--pcv-surface);
	border-radius: 12px;
	padding: 16px;
}

.badge {
	display: inline-block;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 12px;
	border: 1px solid var(--pcv-border);
	background: var(--pcv-surface);
	margin: 4px 6px 0 0;
}

/* Buttons */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid var(--pcv-border);
	background: var(--pcv-accent);
	color: var(--pcv-accent-contrast);
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.button.ghost {
	background: transparent;
	color: var(--pcv-text);
}

/* Forms */
.form-field { margin-bottom: 14px; }
.label { display: block; margin-bottom: 6px; color: var(--pcv-text-muted); }
.input, .textarea {
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--pcv-border);
	background: var(--pcv-surface);
	color: var(--pcv-text);
}
.textarea { min-height: 140px; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert.success { background: #1f4934; color: #d1fae5; border: 1px solid #14532d; }
.alert.error { background: #4c1d1d; color: #fee2e2; border: 1px solid #7f1d1d; }

/* Footer */
.site-footer {
	border-top: 1px solid var(--pcv-border);
	background: var(--pcv-surface);
	padding: 32px 0;
	color: var(--pcv-text-muted);
}
/* --- Navigation & Toggle alignment --- */
.header-right {
	display: flex;
	align-items: center;
	gap: 2rem; /* väli navin ja kuun välillä */
}

.main-nav {
	display: flex;
	align-items: center;
	gap: 1.5rem; /* väli linkkien välillä */
}

.nav-btn {
	text-decoration: none;
	color: var(--pcv-text);
	font-weight: 600;
	transition: color 0.2s ease;
}

.nav-btn:hover {
	color: var(--pcv-accent);
}

/* Kuupainike – vähän irti napeista */
.theme-toggle {
	margin-left: 0.5rem;
	padding: 6px 10px;
	border-radius: 8px;
}

.site-title a img {
	height: 150px !important;
	width: auto !important;
}

#your-element-selector {
    position: relative;
    height: 300px;
    overflow: hidden;
}



