/* =========================
   RESET & BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* zabrání bílé při overscrollu */
html, body {
  width: 100%;
  min-height: 100%;
  background-color: #0b0f1a;
}

/* smooth scroll */
html {
  scroll-behavior: smooth;
}
/* =========================
   If no animations preferred
========================= */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}
/* =========================
   THEME
========================= */
:root{
  --text: #eaeaea;
  --muted: rgba(234,234,234,0.72);
  --card: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.10);
  --shadow: 0 22px 70px rgba(0,0,0,0.55);
  --accent: linear-gradient(90deg, #a050ff, #50b4ff);
  --accent-a: rgba(160,80,255,0.55);
  --accent-b: rgba(80,180,255,0.35);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--text);

  min-height: 100vh;
  overflow-x: hidden;

  background: radial-gradient(
    1200px 600px at 20% 10%,
    #1b1f2a 0%,
    #0b0f1a 60%
  );

  position: relative; /* pro pseudo-elementy */
}

/* =========================
   STARFIELD / GALAXY BACKGROUND
========================= */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;

  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.9) 99%, transparent 100%),
    radial-gradient(1px 1px at 30% 80%, rgba(255,255,255,0.7) 99%, transparent 100%),
    radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,0.8) 99%, transparent 100%),
    radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,0.6) 99%, transparent 100%),
    radial-gradient(2px 2px at 40% 40%, rgba(255,255,255,0.55) 99%, transparent 100%),
    radial-gradient(2px 2px at 80% 10%, rgba(255,255,255,0.45) 99%, transparent 100%);

  background-size:
    700px 700px,
    900px 900px,
    800px 800px,
    1100px 1100px,
    1200px 1200px,
    1400px 1400px;

  opacity: 0.45;
}

body::after{
  content:"";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: -1;

  background:
    radial-gradient(600px 320px at 20% 15%, rgba(160,80,255,0.18), transparent 60%),
    radial-gradient(700px 380px at 75% 25%, rgba(80,180,255,0.16), transparent 60%),
    radial-gradient(900px 520px at 55% 80%, rgba(255,255,255,0.05), transparent 65%);

  filter: blur(18px);
  opacity: 0.9;
}

/* =========================
   CONTAINER
========================= */
.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* =========================
   LAYOUT
========================= */
main { padding-top: 3rem; }

/* =========================
   HEADER & NAV (DESKTOP DEFAULT)
========================= */
header{
  position: sticky;
  top: 0;
  z-index: 10;

  background: rgba(10,12,20,0.55);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);

  padding: 1rem 1.25rem;
  margin-top: 1rem;


  transition:
    padding .22s ease,
    background .22s ease,
    border-color .22s ease,
    box-shadow .22s ease,
    transform .22s ease;
}

.header-inner{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

header h1{
  font-size: 1.4rem;
  font-weight: 600;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header.is-scrolled{
  background: rgba(10,12,20,0.72);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  transform: translateY(-2px);
  padding : 0.65rem 1.1rem;
}

header.is-scrolled .header-inner{
  transform: translateY(-1px);
  transition: transform .22s ease;
}

/* desktop: burger skrytý, menu viditelné */
.nav-toggle{ display: none; }
.nav{ display: block; }

nav ul{
  list-style: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
}

nav a,
nav a:visited{
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;

  position: relative;
  display: inline-flex;
  align-items: center;

  background: transparent;
  border: 1px solid transparent;

  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

/* =========================
   NAV LINKS (HOVER = OUTLINE ONLY)
========================= */
nav a:not(.github-btn):hover{
  background: transparent;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12),
    0 0 18px rgba(80,180,255,0.18),
    0 0 24px rgba(160,80,255,0.12);
  transform: translateY(-1px);
}

nav a:not(.github-btn):hover::before{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius:999px;
  padding:2px;
  background: var(--accent);

  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;

  pointer-events:none;
  opacity: .85;
}

/* =========================
   NAV LINKS (ACTIVE)
========================= */
nav a.active:not(.github-btn){
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  box-shadow:
    0 0 18px rgba(80,180,255,0.25),
    0 0 24px rgba(160,80,255,0.15);
}

nav a.active:not(.github-btn)::before{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius:999px;
  padding:2px;
  background: var(--accent);

  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;

  pointer-events:none;
  opacity: .9;
}

/* =========================
   GITHUB BUTTON (GLASS + GRADIENT BORDER)
========================= */
nav a.github-btn,
nav a.github-btn:visited{
  position: relative;
  isolation: isolate;

  color: #fff;
  font-weight: 600;
  text-decoration: none;

  padding: 0.45rem 0.95rem;
  border-radius: 999px;

  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid transparent;
}

nav a.github-btn::before{
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;

  background: var(--accent);

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;

  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;

  pointer-events: none;
  opacity: 0.85;
}

nav a.github-btn:hover{
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 18px rgba(80,180,255,0.35);
  transform: translateY(-1px);
}

nav a.github-btn:hover::before{
  opacity: 1;
}

nav a:focus{
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 4px;
}

/* =========================
   MOBILE (HAMBURGER)
========================= */
@media (max-width: 768px){

  .header-inner{
    flex-wrap: wrap;
  }

  /* mobil: burger viditelný */
  .nav-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    cursor: pointer;
    margin-left: auto;
  }

  /* mobil: menu defaultně skryté */
  .nav{
    display: none;
    width: 100%;
    margin-top: 0.75rem;
  }

  header.nav-open .nav{
    display: block;
  }

  /* mobil: odkazy pod sebou */
  nav ul{
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
  }
}
/* =========================
   SECTIONS
========================= */
section{
  scroll-margin-top: 110px;
  padding: 4rem 0;
  background: transparent;
}

section h2{
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
}

/* =========================
   HERO
========================= */
#hero{
  padding: 3rem 2rem;
  margin-top: 1.5rem;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(10px);

  text-align: center;
}

#hero h2{
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;

  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  text-shadow:
    0 0 14px rgba(80,180,255,0.35),
    0 0 32px rgba(160,80,255,0.18);
}

#hero p{
  max-width: 60ch;
  margin: 0.75rem auto 0;
  color: var(--muted);
}
/* HERO – animated text */
#hero h2,
#hero p{
  opacity: 0;
  transform: translateY(14px);
  filter: blur(6px);
  transition:
    opacity .65s ease,
    transform .65s ease,
    filter .65s ease;
}

#hero p{
  transition-delay: .10s;
}

/* když je hero vidět */
#hero.is-visible h2,
#hero.is-visible p{
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
#hero h2{
  background-size: 200% 200%;
}

/* =========================
   ABOUT
========================= */
#about{ text-align: center; }

#about p{
  max-width: 65ch;
  margin: 0 auto 1.6rem auto;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
}

/* =========================
   SKILLS
========================= */
#skills{ text-align: center; }

#skills ul{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
}

#skills li{
  position: relative;
  overflow: hidden;

  border-radius: 999px;
  padding: 0.45rem 0.9rem;

  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);

  color: var(--text);
  font-size: 0.9rem;

  transition: transform 0.15s ease;
}

#skills li::before{
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: 999px;

  background: linear-gradient(135deg, var(--accent-a), var(--accent-b), rgba(255,255,255,0.10));

  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);

  -webkit-mask-composite: xor;
  mask-composite: exclude;

  opacity: 0.55;
  pointer-events: none;
}

#skills li:hover{ transform: translateY(-1px); }

/* =========================
   PROJECTS
========================= */
#projects .projects-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.project-card{
  position: relative;
  overflow: hidden;

  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 16px;
  background: var(--card);
  backdrop-filter: blur(10px);

  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.project-card::before{
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: 16px;

  background: linear-gradient(135deg, var(--accent-a), var(--accent-b), rgba(255,255,255,0.10));

  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);

  -webkit-mask-composite: xor;
  mask-composite: exclude;

  opacity: 0.6;
  pointer-events: none;
}

.project-card:hover::before{ opacity: 0.8; }

.project-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project-card:hover h3{
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.project-card p{
  transition: opacity .18s ease;
}

.project-card:hover p{
  opacity: .95;
}

.project-tags li{
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.project-card:hover .project-tags li{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.16);
}

.project-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.project-card h3{
  font-weight: 700;
  margin: 0;

  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  text-shadow:
    0 0 12px rgba(80,180,255,0.28),
    0 0 26px rgba(160,80,255,0.14);
  transition: transform .18s ease, filter .18s ease;
}

.project-card p{
  color: var(--muted);
  margin-top: 0.25rem;
}

.project-links{
  display: flex;
  gap: 0.6rem;
}

.project-links a,
.project-links a:visited{
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.project-links a:hover{ background: rgba(255,255,255,0.08); }

.project-tags{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0;
}

.project-tags li{
  border: 1px solid var(--border);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.85rem;
}

/* =========================
   CONTACT
========================= */
#contact h2{
  font-size: 2rem;
  margin-bottom: 2rem;
}

.contact-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.contact-card{
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: 18px;

  text-decoration: none;
  color: var(--text);

  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);

  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.contact-card::before{
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: 18px;

  background: linear-gradient(135deg, var(--accent-a), var(--accent-b), rgba(255,255,255,0.10));

  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);

  -webkit-mask-composite: xor;
  mask-composite: exclude;

  opacity: 0.6;
  pointer-events: none;
}

.contact-card:hover::before{ opacity: 0.8; }

.contact-title{
  font-size: 1.05rem;
  font-weight: 600;
  transition: transform .18s ease, opacity .18s ease;
}

.contact-sub{
  font-size: 0.9rem;
  color: var(--muted);
  transition: transform .18s ease, opacity .18s ease;
}

.contact-card:hover{
  transform: translateY(-5px);
  background: rgba(255,255,255,0.07);
  box-shadow: var(--shadow);
}

.contact-card:hover .contact-title{
  transform: translateY(-1px);
}

.contact-card:hover .contact-sub{
  opacity: .95;
}

/* =========================
   LEARNING / EDUCATION
========================= */
#learning-education h2{ text-align: center; }

#learning-education ul{
  max-width: 60ch;
  margin: 1.5rem auto 0;
  padding-left: 1.2rem;
  text-align: left;
}

#learning-education li{
  margin: 0.6rem 0;
  color: var(--text);
}

/* =========================
   FOOTER
========================= */
footer{
  border-top: 1px solid rgba(255,255,255,0.10);
  margin-top: 4rem;
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}