:root {
    --bg: #0b0d0f;
    --surface: #111316;
    --surface2: #181b1f;
    --border: #1e2227;
    --accent: #c8f04b;
    --accent2: #4bf0c8;
    --text: #e8eaec;
    --muted: #6b7280;
    --tag-bg: #151a10;
    --tag-border: #2e3d18;
  }

/* :root {
  --bg: #0a0a28;
  --surface: #1e1d18;
  --surface2: #25241e;
  --border: #2f2e27;
  --accent: #f97316;
  --accent2: #fbbf24;
  --text: #e7e5df;
  --muted: #a09d94;
  --tag-bg: #2a1a00;
  --tag-border: #4a2e00;
} */

/* :root {
  --bg: #060d12;
  --surface: #0b1822;
  --surface2: #0f2030;
  --border: #14283d;
  --accent: #22d3ee;
  --accent2: #818cf8;
  --text: #cffafe;
  --muted: #5e8fa0;
  --tag-bg: #031420;
  --tag-border: #072840;
} */

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Syne', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
  }

  /* ── NOISE OVERLAY ── */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 999;
  }

  /* ── GRID BACKGROUND ── */
  .grid-bg {
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(rgba(200,240,75,0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(200,240,75,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
  }

  /* ── LAYOUT ── */
  .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
  }

  /* ── HEADER ── */
  header {
    padding: 3rem 0 0;
    position: relative;
  }

  .top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .top-bar a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
  }
  .top-bar a:hover { border-color: var(--accent); }

  .hero {
    padding-bottom: 6rem;
    border-bottom: 1px solid var(--border);
  }

  .hero-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }
  .hero-label::before {
    content: '';
    display: inline-block;
    width: 28px; height: 1px;
    background: var(--accent);
  }

  .hero h1 {
    font-size: clamp(2.5rem, 8vw, 6.5rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
  }

  .hero h1 .line2 {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--muted);
  }

  .hero-desc {
    max-width: 520px;
    font-family: 'DM Mono', monospace;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 2.5rem;
  }

  .hero-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .btn {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.85rem 1.8rem;
    border-radius: 2px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .btn-primary {
    background: var(--accent);
    color: #0b0d0f;
    font-weight: 500;
  }
  .btn-primary:hover {
    background: #d8ff5a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200,240,75,0.25);
  }

  .btn-ghost {
    border: 1px solid var(--border);
    color: var(--muted);
  }
  .btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
  }

  /* ── SECTIONS ── */
  section {
    padding: 5rem 0;
    border-bottom: 1px solid var(--border);
  }

  .section-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 3rem;
  }

  .section-num {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent);
    letter-spacing: 0.1em;
  }

  .section-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  /* ── SKILLS ── */
  .skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
  }

  .skill-item {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem 1.2rem;
    border-radius: 4px;
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: all 0.2s;
    cursor: default;
  }

  .skill-item:hover {
    border-color: var(--accent);
    background: var(--surface2);
    transform: translateY(-2px);
  }

  .skill-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
  }

  .skill-dot.secondary { background: var(--accent2); }
  .skill-dot.neutral { background: var(--muted); }

  /* ── PROJECTS ── */
  .projects-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
  }

  .project-card {
    background: var(--surface);
    padding: 1.8rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
  }

  .project-card:last-child { border-bottom: none; }

  .project-card:hover {
    background: var(--surface2);
  }

  .project-lang {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
  }

  .lang-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
  }

  .project-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
  }

  .project-desc {
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.7;
  }

  .project-arrow {
    color: var(--muted);
    font-size: 1.2rem;
    transition: all 0.2s;
    margin-top: 0.2rem;
  }

  .project-card:hover .project-arrow {
    color: var(--accent);
    transform: translate(3px, -3px);
  }

  /* ── EXPERIENCE ── */
  .exp-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
  }

  .exp-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 2rem;
  }

  .exp-year {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    padding-top: 0.2rem;
    line-height: 1.4;
  }

  .exp-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    letter-spacing: -0.01em;
  }

  .exp-company {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.6rem;
    letter-spacing: 0.04em;
  }

  .exp-desc {
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.75;
  }

  /* ── CERTIFICATIONS ── */
  .cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }

  .cert-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.2rem 1.4rem;
    border-radius: 4px;
    transition: all 0.2s;
  }

  .cert-card:hover {
    border-color: var(--accent2);
    transform: translateY(-2px);
  }

  .cert-icon {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
  }

  .cert-name {
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    color: var(--text);
    line-height: 1.5;
  }

  /* ── CONTACT ── */
  .contact-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
  }

  .contact-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
  }

  .contact-sub {
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
  }

  /* ── FOOTER ── */
  footer {
    padding: 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.06em;
  }

  /* ── ANIMATIONS ── */
  .fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease forwards;
  }

  @keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
  }

  .fade-in:nth-child(1) { animation-delay: 0.1s; }
  .fade-in:nth-child(2) { animation-delay: 0.2s; }
  .fade-in:nth-child(3) { animation-delay: 0.3s; }
  .fade-in:nth-child(4) { animation-delay: 0.4s; }

  /* ── STATUS DOT ── */
  .status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    color: var(--muted);
  }

  .status-dot {
    width: 6px; height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
  }

  /* ── PHOTO ── */
  .hero-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
  }

  .hero-photo-wrap {
    position: relative;
    width: 200px;
    flex-shrink: 0;
  }

  .hero-photo {
    width: 200px;
    height: 220px;
    object-fit: cover;
    object-position: center top;
    border-radius: 4px;
    display: block;
    filter: grayscale(20%) contrast(1.05);
  }

  @media (max-width: 700px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-photo-wrap { width: 140px; margin: 0 auto; }
    .hero-photo { width: 140px; height: 155px; }
  }

  /* ── PHOTO ── */
  .hero-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
  }

  .hero-photo {
    width: 200px;
    height: 220px;
    object-fit: cover;
    object-position: center top;
    display: block;
  }

  @media (max-width: 700px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-photo { width: 140px; height: 155px; } 
  }

  @media (max-width: 600px) {
    .exp-item { grid-template-columns: 1fr; gap: 0.3rem; }
    .contact-block { grid-template-columns: 1fr; }
    .top-bar .status { display: none; }
  }
  /* ── NAVBAR ── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
  }

  .nav-inner {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(11,13,15,0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.5rem;
    pointer-events: all;
  }

  /* Na desktopu jsou odkazy v řádku uvnitř nav-inner */
  .nav-links-wrap {
    display: contents; /* průhledný obal — děti se chovají jako by byly přímo v nav-inner */
  }

  .nav-link {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    transition: all 0.2s;
    white-space: nowrap;
  }

  .nav-link:hover {
    color: var(--text);
    background: var(--surface2);
  }

  .nav-link.active {
    color: #0b0d0f;
    background: var(--accent);
    font-weight: 500;
  }

  .nav-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 0.25rem;
    flex-shrink: 0;
  }

  /* ── HAMBURGER — skrytý na desktopu ── */
  .nav-hamburger {
    display: none;
  }

  /* ── MOBILE ── */
  @media (max-width: 680px) {
    .navbar {
      padding: 0.75rem 1rem;
      justify-content: flex-end;
      align-items: flex-start;
    }

    .nav-inner {
      border-radius: 12px;
      padding: 0;
      flex-direction: column;
      align-items: stretch;
      width: auto;
    }

    /* Hamburger tlačítko — jen ikona, žádný border */
    .nav-hamburger {
      display: flex;
      flex-direction: column;
      gap: 5px;
      background: none;
      border: none;
      cursor: pointer;
      padding: 0.65rem 0.9rem;
      margin: 0;
      align-self: flex-end;
    }

    .nav-hamburger span {
      display: block;
      width: 20px;
      height: 1.5px;
      background: var(--text);
      border-radius: 2px;
      transition: all 0.3s ease;
      transform-origin: center;
    }

    .nav-hamburger.open span:nth-child(1) {
      transform: translateY(6.5px) rotate(45deg);
    }
    .nav-hamburger.open span:nth-child(2) {
      opacity: 0;
      transform: scaleX(0);
    }
    .nav-hamburger.open span:nth-child(3) {
      transform: translateY(-6.5px) rotate(-45deg);
    }

    /* Skryté položky */
    .nav-links-wrap {
      display: none;
      flex-direction: column;
      padding: 0.25rem 0.5rem 0.6rem;
      gap: 0.15rem;
      border-top: 1px solid var(--border);
    }

    .nav-links-wrap.open {
      display: flex;
    }

    .nav-link {
      padding: 0.6rem 0.9rem;
      border-radius: 8px;
      font-size: 0.75rem;
    }

    .nav-divider {
      display: none;
    }
  }



  /* ── AI CHAT BUTTON ── */
  .ai-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    width: 52px; height: 52px;
    border-radius: 999px;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 20px rgba(200,240,75,0.35);
    transition: all 0.2s;
  }
  .ai-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(200,240,75,0.5);
  }

  /* ── AI CHAT PANEL ── */
  .ai-panel {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 200;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
  }
  .ai-panel.open { display: flex; }

  .ai-panel-header {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: var(--text);
  }

  .ai-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
  }

  .ai-messages {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
  }

  .ai-msg {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    max-width: 90%;
    animation: fadeUp 0.3s ease;
  }

  .ai-msg.bot {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    align-self: flex-start;
  }

  .ai-msg.user {
    background: var(--accent);
    color: #0b0d0f;
    align-self: flex-end;
    font-weight: 500;
  }

  .ai-msg.thinking {
    background: var(--surface2);
    border: 1px solid var(--border);
    align-self: flex-start;
    color: var(--muted);
  }

  .ai-suggestions {
    padding: 0 1rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .ai-suggestion {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    letter-spacing: 0.04em;
  }
  .ai-suggestion:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  .ai-input-row {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
  }

  .ai-input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
  }
  .ai-input:focus { border-color: var(--accent); }
  .ai-input::placeholder { color: var(--muted); }

  .ai-send {
    background: var(--accent);
    border: none;
    border-radius: 6px;
    width: 34px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
  }
  .ai-send:hover { background: #d8ff5a; }

  /* offset header by navbar */
  body { padding-top: 72px; }

/* ── AI CHAT — oprava přetékání a Markdown ── */
  .ai-messages {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .ai-msg {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    max-width: 90%;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }

  /* Markdown styly uvnitř zpráv */
  .ai-msg p {
    margin: 0 0 0.5em;
  }
  .ai-msg p:last-child {
    margin-bottom: 0;
  }

  .ai-msg strong, .ai-msg b {
    color: var(--accent);
    font-weight: 600;
  }

  .ai-msg em, .ai-msg i {
    font-style: italic;
    color: var(--text);
  }

  .ai-msg ul, .ai-msg ol {
    padding-left: 1.2em;
    margin: 0.4em 0;
  }

  .ai-msg li {
    margin-bottom: 0.2em;
  }

  .ai-msg code {
    background: rgba(200,240,75,0.1);
    border: 1px solid rgba(200,240,75,0.2);
    border-radius: 3px;
    padding: 0.1em 0.35em;
    font-size: 0.9em;
    color: var(--accent);
  }

  .ai-msg a {
    color: var(--accent);
    text-decoration: underline;
    word-break: break-all;
  }

  .ai-msg h1, .ai-msg h2, .ai-msg h3 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    margin: 0.5em 0 0.25em;
    color: var(--text);
    font-size: 0.85rem;
  }

  .ai-msg hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.5em 0;
  }
