/* =========================================================
   BARVY A ZÁKLADNÍ PROMĚNNÉ – tady snadno změníš vzhled
   ========================================================= */
:root {
  --bg: #0b0d12;
  --bg-alt: #11141b;
  --surface: #161a23;
  --border: #242a36;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --accent: #6c8cff;
  --accent-2: #3dd6c6;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --radius: 16px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
  --container: 1140px;
  --header-h: 72px;
  --on-accent: #0b0d12;
  --header-bg: rgba(11, 13, 18, .8);
  --nav-mobile-bg: rgba(11, 13, 18, .97);
  --border-strong: #34405a;
  --placeholder: #5f687a;
  --thumb-bg: #1c2130;
  --blob-opacity: .35;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Space Grotesk", sans-serif; line-height: 1.15; letter-spacing: -.02em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-primary { background: var(--gradient); color: var(--on-accent); box-shadow: 0 10px 30px -10px rgba(108, 140, 255, .6); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(108, 140, 255, .8); }
.btn-ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }

/* =========================================================
   1. HLAVIČKA
   ========================================================= */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; }

.logo { display: flex; align-items: center; gap: 12px; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.2rem; }
.logo img { height: 40px; width: auto; }
.footer .logo img { height: 34px; }

.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; }
.nav-links a { color: var(--muted); font-weight: 500; position: relative; transition: color .2s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--gradient); transition: width .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links .btn { padding: 10px 20px; color: var(--on-accent); }
.nav-links .btn::after { display: none; }

.menu-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; position: relative;
}
.menu-toggle span {
  position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform .3s, opacity .3s;
}
.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 27px; }
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* =========================================================
   2. HERO
   ========================================================= */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 40px) 0 80px;
  position: relative; overflow: hidden;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(100px); opacity: var(--blob-opacity); z-index: -1;
}
.hero::before { width: 520px; height: 520px; background: var(--accent); top: -120px; right: -120px; }
.hero::after { width: 420px; height: 420px; background: var(--accent-2); bottom: -160px; left: -140px; opacity: .2; }

.hero-grid-bg {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  opacity: .4;
}

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: .9rem; margin-bottom: 28px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px rgba(61, 214, 198, .2); }

.hero h1 { font-size: clamp(2.5rem, 6.5vw, 4.75rem); max-width: 900px; margin-bottom: 24px; }
.hero-lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 620px; margin-bottom: 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 64px; }

.hero-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 900px; }
.hero-feature { display: flex; gap: 14px; align-items: flex-start; }
.hero-feature .ico {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--accent);
}
.hero-feature .ico svg { width: 22px; height: 22px; }
.hero-feature strong { display: block; font-weight: 600; }
.hero-feature span { color: var(--muted); font-size: .92rem; }

/* =========================================================
   SPOLEČNÉ SEKCE
   ========================================================= */
section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.eyebrow { color: var(--accent-2); font-weight: 600; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; display: block; }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 16px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

/* =========================================================
   3. O MNĚ
   ========================================================= */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
.about-title { font-size: clamp(2.75rem, 7vw, 4.5rem) !important; }
.about-text p { color: var(--muted); font-size: 1.15rem; margin-bottom: 18px; }
.about-text p strong { color: var(--text); font-weight: 600; }

.stats { display: flex; gap: 40px; margin-top: 32px; flex-wrap: wrap; }
.stat b { display: block; font-family: "Space Grotesk", sans-serif; font-size: 2.2rem; line-height: 1; margin-bottom: 6px; }
.stat span { color: var(--muted); font-size: .9rem; }

.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 18px; text-align: center;
  transition: transform .25s, border-color .25s;
}
.skill:hover { transform: translateY(-4px); border-color: var(--accent); }
.skill svg { width: 40px; height: 40px; margin: 0 auto 12px; }
.skill h3 { font-size: 1rem; font-family: "Inter", sans-serif; font-weight: 600; letter-spacing: 0; }
.skill p { color: var(--muted); font-size: .82rem; margin-top: 4px; line-height: 1.4; }

/* =========================================================
   4. PORTFOLIO
   ========================================================= */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.project {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.project:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }

.project-thumb { aspect-ratio: 16 / 10; overflow: hidden; position: relative; background: var(--thumb-bg); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.project:hover .project-thumb img { transform: scale(1.05); }

.project-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag { font-size: .75rem; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: rgba(108, 140, 255, .12); color: var(--accent); }
.project h3 { font-size: 1.3rem; margin-bottom: 8px; }
.project p { color: var(--muted); font-size: .95rem; margin-bottom: 22px; flex: 1; }
.project-links { display: flex; gap: 12px; flex-wrap: wrap; }
.project-links .btn { padding: 10px 18px; font-size: .9rem; }

/* =========================================================
   5. KONTAKT
   ========================================================= */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
.contact-info .section-head { margin-bottom: 36px; }
.contact-list { list-style: none; display: grid; gap: 14px; margin-bottom: 32px; }
.contact-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s;
}
a.contact-item:hover { border-color: var(--accent); transform: translateX(4px); }
.contact-item .ico {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; background: rgba(108, 140, 255, .12); color: var(--accent);
}
.contact-item .ico svg { width: 20px; height: 20px; }
.contact-item small { display: block; color: var(--muted); font-size: .8rem; }
.contact-item b { font-weight: 600; word-break: break-all; }


.contact-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 36px; box-shadow: var(--shadow);
}
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 500; font-size: .92rem; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(108, 140, 255, .15); }
.field input.invalid, .field textarea.invalid { border-color: #ff6b6b; }
.contact-form .btn { width: 100%; justify-content: center; }
.form-status { margin-top: 16px; font-size: .95rem; min-height: 1.5em; text-align: center; }
.form-status.ok { color: var(--accent-2); }
.form-status.err { color: #ff6b6b; }

/* =========================================================
   ČASTÉ DOTAZY (FAQ)
   ========================================================= */
.faq-list { max-width: 820px; display: grid; gap: 14px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  transition: border-color .2s;
}
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-weight: 600; font-size: 1.08rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 400;
  background: rgba(108, 140, 255, .12); color: var(--accent); transition: transform .25s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 14px; }
.faq-answer { padding: 0 24px 22px; color: var(--muted); }
.faq-answer p + p, .faq-answer p + ul, .faq-answer ul + p { margin-top: 10px; }
.faq-answer ul { padding-left: 20px; }
.faq-answer li { margin: 4px 0; }
.faq-answer strong { color: var(--text); }
.faq-cta { margin-top: 36px; color: var(--muted); }
.faq-cta a { color: var(--accent); font-weight: 600; }

/* =========================================================
   6. PATIČKA
   ========================================================= */
.footer { border-top: 1px solid var(--border); padding: 56px 0 32px; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer p { color: var(--muted); font-size: .95rem; max-width: 320px; margin-top: 14px; }
.footer h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 16px; font-weight: 600; }
.footer-links { list-style: none; display: grid; gap: 10px; }
.footer-links a { word-break: break-all; color: var(--text); opacity: .85; transition: opacity .2s, color .2s; }
.footer-links a:hover { opacity: 1; color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  padding-top: 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem;
}
.to-top { display: inline-flex; align-items: center; gap: 6px; transition: color .2s; }
.to-top:hover { color: var(--text); }

/* ---------- Animace při scrollování ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   RESPONZIVITA
   ========================================================= */
@media (max-width: 960px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-top > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  section { padding: 80px 0; }
  .menu-toggle { display: block; }
  .nav-links {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 12px 20px 24px;
    background: var(--nav-mobile-bg); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%); opacity: 0; pointer-events: none;
    transition: transform .35s ease, opacity .35s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 0; font-size: 1.1rem; border-bottom: 1px solid var(--border); }
  .nav-links a::after { display: none; }
  .nav-links li:last-child a { border: 0; margin-top: 16px; text-align: center; justify-content: center; }
  .hero-features { grid-template-columns: 1fr; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: 1fr; }
  .contact-form { padding: 24px; }
}

@media (max-width: 420px) {
  .hero-actions .btn { width: 100%; justify-content: center; }
  .footer-top { grid-template-columns: 1fr; }
}

/* Jednotné pozadí ve všech sekcích */
.section-alt { background: var(--bg); }
main section + section { border-top: 1px solid var(--border); }

/* Když je v portfoliu jen jeden projekt, vycentruj ho */
.projects:has(> .project:only-child) { grid-template-columns: minmax(0, 560px); justify-content: center; }
