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

:root {
  --bg:        #0d1117;
  --bg-card:   #161b22;
  --bg-card2:  #1c2330;
  --border:    #30363d;
  --text:      #e6edf3;
  --text-muted:#8b949e;
  --accent:    #2f81f7;
  --accent2:   #58a6ff;
  --accent-glow: rgba(47, 129, 247, 0.15);
  --radius:    10px;
  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

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

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ============================================================
   NAVBAR
============================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent2);
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 10px;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ============================================================
   LANGUAGE SWITCHER
============================================================ */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switcher {
  position: relative;
}

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.lang-current:hover { border-color: var(--accent); background: var(--accent-glow); }
.lang-current[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-glow); }

.lang-flag {
  width: 22px;
  height: 15px;
  display: inline-block;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
.lang-flag svg { width: 100%; height: 100%; display: block; }

.lang-code { letter-spacing: 0.5px; }

.lang-caret {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.lang-current[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  list-style: none;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
}
.lang-menu[hidden] { display: none; }

.lang-menu li button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.lang-menu li button:hover { background: var(--accent-glow); }
.lang-menu li[aria-selected="true"] button { background: var(--accent-glow); color: var(--accent2); font-weight: 600; }

/* ============================================================
   HERO
============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(47,129,247,0.08) 0%, transparent 70%);
  position: relative;
}

.hero-content {
  max-width: 820px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 48px;
}

.hero-photo-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 2.5rem;
  color: var(--accent2);
  flex-shrink: 0;
  box-shadow: 0 0 40px var(--accent-glow);
  overflow: hidden;
}

.hero-photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #e6edf3 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: 1.1rem;
  color: var(--accent2);
  font-weight: 500;
  margin-bottom: 16px;
  font-family: var(--mono);
}

.hero-affil {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.hero-links {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--accent2);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-glow); text-decoration: none; }

.hero-scroll-hint {
  position: absolute;
  bottom: 30px;
  font-size: 1.4rem;
  color: var(--text-muted);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ============================================================
   SECTIONS
============================================================ */
section { padding: 90px 0; }
section:nth-child(even) { background: var(--bg-card); }

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 48px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================================================
   ABOUT
============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
  font-size: 1.02rem;
}
.about-text p strong { color: var(--text); }

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 28px;
  text-align: center;
  min-width: 140px;
  transition: border-color 0.2s;
}
.stat:hover { border-color: var(--accent); }

.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent2);
  font-family: var(--mono);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================================
   RESEARCH
============================================================ */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.research-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.research-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.research-icon { font-size: 2rem; margin-bottom: 14px; }

.research-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.research-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   PUBLICATIONS
============================================================ */
.pub-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.pub-filter {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  padding: 6px 18px;
  font-size: 0.85rem;
  font-family: var(--mono);
  cursor: pointer;
  transition: all 0.2s;
}
.pub-filter:hover { border-color: var(--accent); color: var(--text); }
.pub-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pub-item {
  display: flex;
  gap: 16px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color 0.2s, transform 0.15s;
}
.pub-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.pub-item.hidden { display: none; }

.pub-year-badge {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent2);
  background: var(--accent-glow);
  border: 1px solid rgba(47,129,247,0.3);
  border-radius: 6px;
  padding: 4px 10px;
  height: fit-content;
  white-space: nowrap;
  flex-shrink: 0;
}

.pub-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.5;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-style: italic;
}

.pub-doi {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent2);
  opacity: 0.8;
  transition: opacity 0.2s;
}
.pub-doi:hover { opacity: 1; text-decoration: none; }

/* ============================================================
   SUB-PAGE LAYOUT (projekty/, jazyky/, …)
============================================================ */
.page-section {
  padding: 140px 0 90px;
  min-height: 100vh;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}
.page-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.breadcrumbs {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent2); }
.breadcrumbs .sep { margin: 0 8px; opacity: 0.5; }

/* ============================================================
   PROJECTS
============================================================ */
.section-intro {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 32px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  display: block;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
  text-decoration: none;
}

.project-icon { font-size: 2rem; margin-bottom: 12px; }

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.project-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.project-card p strong { color: var(--text); }

.project-cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent2);
  font-weight: 500;
}
.project-card:hover .project-cta { color: var(--text); }

/* ============================================================
   LANGUAGE PICKER (jazyky/)
============================================================ */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.lang-card {
  display: block;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.lang-card--active:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
  text-decoration: none;
}
.lang-card--soon {
  opacity: 0.55;
  cursor: not-allowed;
}

.lang-card-flag {
  width: 60px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}
.lang-card-flag svg { width: 100%; height: 100%; display: block; }

.lang-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.lang-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
}
.lang-soon-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

/* ============================================================
   CONTACT
============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
  font-size: 0.95rem;
}
.contact-item:hover { border-color: var(--accent); }
.contact-item .icon { color: var(--accent2); }

.map-placeholder {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
}
.map-placeholder svg { opacity: 0.4; }

/* ============================================================
   FOOTER
============================================================ */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; gap: 16px; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
  }
  .nav-toggle { display: block; }
  .lang-current { padding: 5px 8px; font-size: 0.75rem; }
  .lang-code { display: none; }
  .lang-flag { width: 20px; height: 14px; }

  .hero-content { flex-direction: column; text-align: center; gap: 28px; }
  .hero-affil { justify-content: center; }
  .hero-links { justify-content: center; }

  .about-grid { grid-template-columns: 1fr; }
  .about-stats { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .stat { min-width: 110px; }

  .contact-grid { grid-template-columns: 1fr; }

  .pub-item { flex-direction: column; gap: 10px; }
}

@media (max-width: 480px) {
  section { padding: 60px 0; }
  .hero-photo-placeholder { width: 120px; height: 120px; font-size: 2rem; }
}

/* ============================================================
   PUBLICATION METRICS BADGES
============================================================ */
.pub-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.pub-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  letter-spacing: 0.3px;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.pub-if {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

/* ── Colored mode ── */
.pub-list--colored .pub-badge.q1 {
  color: #f0c050;
  border-color: #f0c050;
  background: rgba(240, 192, 80, 0.1);
}
.pub-list--colored .pub-badge.q2 {
  color: var(--accent2);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.pub-list--colored .pub-badge.q3 {
  color: #f0883e;
  border-color: #f0883e;
  background: rgba(240, 136, 62, 0.1);
}
.pub-list--colored .pub-badge.q4 {
  color: #8b949e;
  border-color: #484f57;
  background: rgba(139, 148, 158, 0.08);
}
.pub-list--colored .pub-badge.conf,
.pub-list--colored .pub-badge.book,
.pub-list--colored .pub-badge.thesis {
  color: #bc8cff;
  border-color: #bc8cff;
  background: rgba(188, 140, 255, 0.1);
}
.pub-list--colored .pub-badge.scopus {
  color: #f0883e;
  border-color: #f0883e;
  background: rgba(240, 136, 62, 0.1);
}
.pub-list--colored .pub-if { color: var(--text); }
