/* ============================================================
   webRS — Ing. Radim Sváček
   Světlý minimalistický jednostránkový web
   ============================================================ */

:root {
	--bg:            #ffffff;
	--bg-soft:       #f6f6f4;
	--surface:       #ffffff;
	--ink:           #16181d;
	--ink-soft:      #5b6069;
	--ink-faint:     #9096a0;
	--line:          #e8e8e4;
	--line-strong:   #d9d9d3;
	--accent:        #1f4bff;
	--accent-soft:   rgba(31, 75, 255, 0.08);

	--font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

	--max: 1080px;
	--pad: clamp(1.25rem, 5vw, 3rem);
	--radius: 16px;

	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
	--bg:            #0d0e11;
	--bg-soft:       #131519;
	--surface:       #15171c;
	--ink:           #f2f3f5;
	--ink-soft:      #a6acb6;
	--ink-faint:     #6b717c;
	--line:          #23262d;
	--line-strong:   #2e323b;
	--accent:        #7c93ff;
	--accent-soft:   rgba(124, 147, 255, 0.12);
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
	font-family: var(--font-sans);
	background: var(--bg);
	color: var(--ink);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	font-feature-settings: "cv11", "ss01";
	transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; }

::selection { background: var(--accent); color: #fff; }

.container {
	width: 100%;
	max-width: var(--max);
	margin: 0 auto;
	padding-inline: var(--pad);
}

.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--ink);
	color: var(--bg);
	padding: 0.6rem 1rem;
	border-radius: 0 0 8px 0;
	z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 4px;
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	height: 68px;
}

.brand {
	font-family: var(--font-mono);
	font-weight: 700;
	font-size: 1.1rem;
	letter-spacing: -0.02em;
}
.brand-mark { color: var(--ink); }
.brand-accent { color: var(--accent); }

.nav {
	margin-left: auto;
	display: flex;
	gap: 0.35rem;
}
.nav a {
	color: var(--ink-soft);
	font-size: 0.92rem;
	font-weight: 500;
	padding: 0.45rem 0.85rem;
	border-radius: 8px;
	transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--bg-soft); }

.theme-toggle {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: transparent;
	color: var(--ink-soft);
	cursor: pointer;
	transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); background: var(--bg-soft); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

@media (max-width: 560px) {
	.nav { display: none; }
}

/* ---------- Hero ---------- */
.hero {
	position: relative;
	padding-block: clamp(4rem, 12vw, 8rem) clamp(4rem, 10vw, 7rem);
	overflow: hidden;
}
.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, var(--bg-soft) 0%, transparent 55%);
	z-index: -2;
}

.hero-inner {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	align-items: center;
	gap: clamp(2rem, 5vw, 4.5rem);
}
.hero-copy { max-width: 33ch; }

@media (max-width: 880px) {
	.hero-inner { grid-template-columns: 1fr; }
	.hero-copy { max-width: 40ch; }
	.hero-visual { order: -1; margin-inline: auto; }
}

/* ---------- Hero dekorace (blob, dot grid) ---------- */
.hero-decor {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}
.blob {
	position: absolute;
	border-radius: 50%;
	filter: blur(60px);
	opacity: 0.55;
	will-change: transform;
}
.blob-1 {
	width: 460px; height: 460px;
	top: -140px; right: -80px;
	background: radial-gradient(circle at 30% 30%, #6f8bff, #1f4bff 70%);
	animation: float-a 16s var(--ease) infinite;
}
.blob-2 {
	width: 360px; height: 360px;
	bottom: -160px; left: -60px;
	background: radial-gradient(circle at 60% 40%, #5fe3e6, #17c3c9 75%);
	opacity: 0.4;
	animation: float-b 20s var(--ease) infinite;
}
:root[data-theme="dark"] .blob-1 { opacity: 0.4; }
:root[data-theme="dark"] .blob-2 { opacity: 0.25; }

.grid-dots {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
	background-size: 26px 26px;
	-webkit-mask-image: radial-gradient(70% 60% at 60% 30%, #000 0%, transparent 75%);
	        mask-image: radial-gradient(70% 60% at 60% 30%, #000 0%, transparent 75%);
	opacity: 0.5;
}

@keyframes float-a {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50%      { transform: translate(-30px, 34px) scale(1.08); }
}
@keyframes float-b {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50%      { transform: translate(28px, -30px) scale(1.1); }
}

/* ---------- Hero vizuál: okno editoru ---------- */
.hero-visual {
	position: relative;
	justify-self: center;
	width: min(100%, 440px);
}
.code-card {
	position: relative;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: 0 30px 60px -30px rgba(20, 30, 70, 0.35), 0 8px 20px -12px rgba(20, 30, 70, 0.2);
	overflow: hidden;
	animation: card-float 7s ease-in-out infinite;
}
:root[data-theme="dark"] .code-card {
	box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.7);
}
@keyframes card-float {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-9px); }
}

.code-bar {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--line);
	background: var(--bg-soft);
}
.code-dot {
	width: 11px; height: 11px;
	border-radius: 50%;
	background: var(--line-strong);
}
.code-dot:nth-child(1) { background: #ff5f57; }
.code-dot:nth-child(2) { background: #febc2e; }
.code-dot:nth-child(3) { background: #28c840; }
.code-file {
	margin-left: auto;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--ink-faint);
}

.code-body {
	margin: 0;
	padding: 1.25rem 1.4rem 1.5rem;
	font-family: var(--font-mono);
	font-size: clamp(0.78rem, 1.6vw, 0.9rem);
	line-height: 1.9;
	overflow-x: auto;
	tab-size: 2;
}
.code-body .ln { display: block; white-space: pre; }

.tok-tag   { color: #56b6c2; }
.tok-key   { color: #c678dd; }
.tok-var   { color: #61afef; }
.tok-prop  { color: #e06c75; }
.tok-str   { color: #98c379; }
.tok-bool  { color: #d19a66; }
.tok-punct { color: var(--ink-faint); }
:root[data-theme="dark"] .tok-punct { color: #7d8590; }

.caret {
	display: inline-block;
	width: 2px;
	height: 1.05em;
	margin-left: 1px;
	background: var(--accent);
	transform: translateY(2px);
	animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Plovoucí ozdobné prvky */
.chip {
	position: absolute;
	display: grid;
	place-items: center;
	font-family: var(--font-mono);
	font-weight: 600;
	color: var(--accent);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	box-shadow: 0 12px 24px -14px rgba(20, 30, 70, 0.4);
}
.chip-1 {
	top: -22px; left: -22px;
	width: 52px; height: 52px;
	font-size: 1rem;
	animation: card-float 6s ease-in-out infinite;
}
.chip-2 {
	bottom: 44px; right: -26px;
	width: 46px; height: 46px;
	font-size: 0.95rem;
	color: #17c3c9;
	animation: card-float 8s ease-in-out infinite reverse;
}

.badge-available {
	position: absolute;
	bottom: -20px; left: 50%;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	white-space: nowrap;
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 0.5rem 0.95rem;
	box-shadow: 0 14px 30px -16px rgba(20, 30, 70, 0.45);
}
.badge-pulse {
	position: relative;
	width: 9px; height: 9px;
	border-radius: 50%;
	background: #28c840;
}
.badge-pulse::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #28c840;
	animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
	0%   { transform: scale(1); opacity: 0.7; }
	100% { transform: scale(2.8); opacity: 0; }
}

@media (max-width: 420px) {
	.chip-1 { left: -8px; }
	.chip-2 { right: -8px; }
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	font-family: var(--font-mono);
	font-size: 0.85rem;
	color: var(--ink-soft);
	letter-spacing: 0.01em;
	margin-bottom: 1.6rem;
}
.eyebrow .dot {
	width: 7px; height: 7px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-title {
	font-size: clamp(2.6rem, 8vw, 5rem);
	line-height: 1.02;
	letter-spacing: -0.035em;
	font-weight: 700;
	margin-bottom: 1.6rem;
}

.hero-lead {
	font-size: clamp(1.05rem, 2.4vw, 1.3rem);
	color: var(--ink-soft);
	max-width: 40ch;
	margin-bottom: 2.4rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.95rem;
	font-weight: 500;
	padding: 0.8rem 1.4rem;
	border-radius: 10px;
	border: 1px solid transparent;
	transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
	background: var(--ink);
	color: var(--bg);
}
.btn-primary:hover { background: var(--accent); }
.btn-ghost {
	border-color: var(--line-strong);
	color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--bg-soft); }

/* ---------- Sections ---------- */
.services, .contact { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.services { border-top: 1px solid var(--line); }

.section-head {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	margin-bottom: 2.8rem;
}
.section-index {
	font-family: var(--font-mono);
	font-size: 0.85rem;
	color: var(--accent);
}
.section-title {
	font-size: clamp(1.5rem, 4vw, 2rem);
	font-weight: 600;
	letter-spacing: -0.02em;
}

/* ---------- Services ---------- */
.service-grid {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1.25rem;
}
.service-card {
	padding: 1.9rem 1.7rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.service-card:hover {
	transform: translateY(-4px);
	border-color: var(--line-strong);
	box-shadow: 0 18px 40px -24px rgba(20, 24, 40, 0.35);
}
.service-icon {
	color: var(--accent);
	margin-bottom: 1.3rem;
}
.service-card h3 {
	font-size: 1.15rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin-bottom: 0.6rem;
}
.service-card p {
	color: var(--ink-soft);
	font-size: 0.95rem;
}

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--line); }
.contact-inner {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: clamp(2rem, 5vw, 4rem);
	align-items: start;
}
@media (max-width: 720px) {
	.contact-inner { grid-template-columns: 1fr; }
}

.contact-details {
	display: grid;
	gap: 0.25rem;
}
.contact-row {
	display: grid;
	grid-template-columns: 90px 1fr;
	gap: 1rem;
	align-items: baseline;
	padding: 1rem 0;
	border-bottom: 1px solid var(--line);
}
.contact-details > .contact-row:last-child { border-bottom: none; }
a.contact-row { transition: color 0.2s var(--ease); }
a.contact-row:hover .contact-value { color: var(--accent); }
.contact-label {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--ink-faint);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.contact-value {
	font-size: 1.05rem;
	font-weight: 500;
	transition: color 0.2s var(--ease);
}

.contact-social-label {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--ink-faint);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 1.1rem;
}
.social-links { display: flex; gap: 0.7rem; }
.social-links a {
	display: grid;
	place-items: center;
	width: 46px; height: 46px;
	border: 1px solid var(--line);
	border-radius: 12px;
	color: var(--ink-soft);
	transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.social-links a:hover {
	color: var(--accent);
	border-color: var(--accent);
	background: var(--accent-soft);
	transform: translateY(-3px);
}

/* ---------- Footer ---------- */
.site-footer {
	border-top: 1px solid var(--line);
	padding-block: 2rem;
}
.footer-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	align-items: center;
	justify-content: space-between;
}
.footer-brand { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; }
.footer-meta { color: var(--ink-faint); font-size: 0.85rem; }

/* ---------- Reveal animation ----------
   Skrytí se aplikuje jen když běží JS (třída .js), jinak je
   obsah normálně viditelný i bez JavaScriptu. */
.js .reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-visible {
	opacity: 1;
	transform: none;
}
.js .service-card.reveal:nth-child(2) { transition-delay: 0.08s; }
.js .service-card.reveal:nth-child(3) { transition-delay: 0.16s; }
