/* =============================================
   VARIABLES
   ============================================= */
:root {
  --bg: #0d0d0f;
  --bg-elevated: #131316;
  --bg-card: #18181c;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text: #e8e8ed;
  --text-dim: #8b8b99;
  --text-faint: #4a4a58;
  --accent: #2ee59d;
  --accent-dim: rgba(46, 229, 157, 0.12);
  --accent-glow: rgba(46, 229, 157, 0.25);
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max-w: 960px;
  --max-w-narrow: 680px;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(46, 229, 157, 0.25);
  border-radius: 99px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(46, 229, 157, 0.55);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 229, 157, 0.25) transparent;
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Zakazuje výběr textu */
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

img {
  display: block;
  max-width: 100%;
  /* Zakazuje drag obrázků */
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Vrátí pointer-events tam, kde jsou obrázky uvnitř klikatelných prvků */
a img,
button img {
  pointer-events: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease), opacity 0.2s;
}

a:hover {
  color: #5ef5b5;
}

strong {
  font-weight: 600;
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================
   SKIP LINK
   ============================================= */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #0a0a0c;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* =============================================
   LANG SWITCHER
   ============================================= */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 1.5rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
  position: relative;
}

.lang-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
}

.lang-label {
  font-size: 0.72rem;
}

.lang-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn.is-active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* =============================================
   HEADER
   ============================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 13, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav a.is-active {
  color: var(--accent);
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-left: auto;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* =============================================
   MAIN / PAGES
   ============================================= */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 60px;
}

.page {
  display: none;
  flex: 1;
  flex-direction: column;
}

.page.is-active {
  display: flex;
}

/* =============================================
   HERO
   ============================================= */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 5rem 2rem 4rem;
  min-height: calc(100dvh - 60px);
}

.hero-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-lead {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 580px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0c;
}

.btn-primary:hover {
  background: #4ff5af;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

/* Terminal */
.terminal-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 560px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-faint);
}

.terminal-dots span:first-child { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:last-child { background: #28c840; }

.terminal-title {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.terminal-body {
  padding: 1.25rem 1.25rem 1rem;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #a3e8c8;
  height: 260px;
  white-space: pre;
  overflow-x: auto;
  overflow-y: hidden;
}

.terminal-body code {
  font-family: var(--font-mono);
  display: block;
}

/* =============================================
   SECTIONS
   ============================================= */
.section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 5rem 2rem 4rem;
}

.section-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-inner--narrow {
  max-width: var(--max-w-narrow);
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.875rem;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 540px;
  margin-bottom: 3rem;
  line-height: 1.7;
}

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

.about-text {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.about-text p {
  font-size: 1.025rem;
  color: var(--text-dim);
  line-height: 1.8;
}

.about-text strong {
  color: var(--text);
}

.skills-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.skills-heading {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}

.skills-groups {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skills-group-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.625rem;
  letter-spacing: 0.04em;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}

.tag:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.08);
}

/* =============================================
   PROJECTS
   ============================================= */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.projects-empty {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md, 12px);
  color: var(--text-dim);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.projects-empty[hidden] {
  display: none;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
}

.project-card--current {
  border-color: rgba(46, 229, 157, 0.2);
}

.project-card--current:hover {
  border-color: rgba(46, 229, 157, 0.35);
  box-shadow: 0 4px 32px rgba(46, 229, 157, 0.06);
}

.project-card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.project-logo-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.project-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.project-role {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-server {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.badge-now {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: var(--accent-dim);
  border: 1px solid rgba(46, 229, 157, 0.3);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-desc {
  font-size: 0.975rem;
  color: var(--text-dim);
  line-height: 1.75;
  margin-bottom: 1.25rem;
  max-width: 680px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-sm {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
}

/* =============================================
   CURSOR — custom
   ============================================= */

/* Schovat výchozí kurzor všude */
*, *::before, *::after { cursor: none !important; }

/* Dot — sleduje přesně */
.cur-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.15s var(--ease), height 0.15s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.2s;
  will-change: transform;
}

/* Hover stav — rozšíří se na kroužek */
body.cur-hover .cur-dot {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Klik stav — malý zelený bod */
body.cur-click .cur-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Schovat kurzor na dotyku / mobilech */
@media (pointer: coarse) {
  .cur-dot { display: none; }
  * { cursor: auto !important; }
  a, button, [data-nav], [data-card], .ripple { cursor: pointer !important; }
}


/* =============================================
   RIPPLE
   ============================================= */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0);
  animation: rippleAnim 0.55s var(--ease) forwards;
  pointer-events: none;
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* =============================================
   PROJECT CARDS — expandable
   ============================================= */
.project-card {
  cursor: pointer;
}

.project-card-top {
  cursor: pointer;
}

.card-expand-icon {
  margin-left: auto;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-faint);
  line-height: 1;
  transition: transform 0.3s var(--ease), color 0.2s;
  flex-shrink: 0;
}

.project-card.is-open .card-expand-icon {
  transform: rotate(45deg);
  color: var(--accent);
}

/* Body collapsed by default */
.project-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}

.project-body > * {
  overflow: hidden;
}

.project-card.is-open .project-body {
  grid-template-rows: 1fr;
}

/* inner wrapper for overflow trick */
.project-body-inner {
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* =============================================
   SKILL TAGS — interactive
   ============================================= */
.tag[data-tag] {
  cursor: default;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s var(--ease);
}

.tag[data-tag]:hover {
  border-color: rgba(46, 229, 157, 0.4);
  background: rgba(46, 229, 157, 0.08);
  color: var(--accent);
  transform: translateY(-2px);
}

.tag[data-tag].is-lit {
  border-color: rgba(46, 229, 157, 0.5);
  background: rgba(46, 229, 157, 0.1);
  color: var(--accent);
}

/* =============================================
   CONTACT
   ============================================= */
.section--contact .section-sub {
  max-width: 480px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.contact-link:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateX(4px);
  color: var(--text);
}

.contact-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  flex-shrink: 0;
}

.contact-link-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.contact-link-name {
  font-size: 1rem;
  font-weight: 600;
}

.contact-link-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.contact-link-arrow {
  color: var(--text-faint);
  font-size: 1.1rem;
  transition: color 0.2s, transform 0.2s;
}

.contact-link:hover .contact-link-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer-views {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 0.25rem;
  font-family: var(--font-mono);
}

/* =============================================
   MONO HELPER
   ============================================= */
.mono {
  font-family: var(--font-mono);
}

/* =============================================
   FADE-IN ANIMATION
   ============================================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page.is-active .hero-inner,
.page.is-active .section-inner {
  animation: fadeUp 0.45s var(--ease) both;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(13, 13, 15, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem;
    margin-left: 0;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .hero {
    padding: 3rem 1.25rem 3rem;
    min-height: calc(100dvh - 60px);
    align-items: flex-start;
    padding-top: 4rem;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .section {
    padding: 3.5rem 1.25rem 3rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .terminal-window {
    max-width: 100%;
  }

  .header-inner {
    padding: 0 1.25rem;
  }

  .footer {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .contact-link {
    padding: 1rem 1.25rem;
  }
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.1ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
