* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg-soft-2));
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: -80px auto 0;
  padding: 0 0 60px;
  position: relative;
  z-index: 2;
}

.hero {
  position: relative;
  height: 460px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
  animation: fadeIn 0.9s ease;
}

.hero-content h1 {
  font-size: clamp(44px, 8vw, 72px);
  margin: 0 0 12px;
  letter-spacing: -0.04em;
}

.hero-content p {
  font-size: 22px;
  margin: 0;
  color: var(--text-muted);
}

.buttons {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.buttons a,
.terminal-btn {
  padding: 12px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 16px;
  font-family: inherit;
}

/* běžná tlačítka */
.buttons a {
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
}

.buttons a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 33, 61, 0.08);
}

/* SQL terminal tlačítko */
.terminal-btn {
  border: 1px solid #14213d;
  background: #14213d;
  color: white;
}

.terminal-btn:hover {
  background: #2d5ca8;
  border-color: #2d5ca8;
}

/* dark mode pro normální tlačítka */
body.dark .buttons a {
  border: 1px solid var(--border-strong);
  background: rgba(22, 33, 54, 0.88);
  color: var(--text);
}

/* dark mode pro SQL terminal */
body.dark .terminal-btn {
  background: linear-gradient(180deg, #1c2a44, #162136);
  color: #f1f5ff;
  border: 1px solid #6e8fc4;
}

body.dark .terminal-btn:hover {
  background: #2d5ca8;
  border-color: #8fbcff;
  box-shadow: 0 0 18px rgba(143, 188, 255, 0.18);
}


.section {
  margin-top: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.section-badge {
  font-size: 14px;
  color: var(--badge-text);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  padding: 8px 12px;
  border-radius: 999px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 22px;
}

.lead {
  font-size: 20px;
  line-height: 1.7;
  color: var(--text);
  margin-top: 0;
}

.about-grid p:last-child {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 0;
}

.about-stats {
  display: grid;
  gap: 14px;
}

.stat-card {
  border: 1px solid #dbe4f2;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
}

.stat-label {
  display: block;
  font-size: 13px;
  color: #6a7892;
  margin-bottom: 8px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card-soft);
}

.skill-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--skill-icon-bg);
  font-size: 20px;
}

.skill-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.skill-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 14px;
}

.timeline {
  position: relative;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  position: relative;
  padding-left: 34px;
  margin-bottom: 28px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1px;
  top: 8px;
  width: 12px;
  height: 12px;
  background: var(--timeline-dot);
  border-radius: 50%;
  box-shadow: 0 0 0 6px var(--timeline-dot-ring);
}

.timeline-top {
  margin-bottom: 10px;
}

.timeline-year {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--badge-text);
  font-weight: 700;
}

.timeline-content h3 {
  margin: 0;
  font-size: 20px;
}

.timeline-content ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  line-height: 1.8;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
}

.project-top {
  height: 160px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.project-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-top img {
  transform: scale(1.06);
}

.project-body {
  padding: 18px;
}

.project-body h3 {
  margin: 0 0 10px;
}

.project-body p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.contact-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  background: var(--card-soft);
  transition: 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 33, 61, 0.07);
}

.contact-card span {
  display: block;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 14px;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 24px));
  margin: 70px auto;
  background: var(--card);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(10, 20, 40, 0.24);
  overflow: hidden;
}

.modal-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 22px;
}

.close-btn {
  border: none;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.terminal-window {
  background: linear-gradient(180deg, var(--terminal-bg-1), var(--terminal-bg-2));
  color: var(--terminal-text);
}

.terminal-toolbar {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.terminal-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.24);
}

.terminal-body {
  padding: 18px;
  min-height: 260px;
  white-space: pre-wrap;
  font-family: Consolas, Monaco, monospace;
  line-height: 1.7;
  font-size: 15px;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 18px;
}

.terminal-prompt {
  color: #7de4e7;
  font-family: Consolas, Monaco, monospace;
}

.terminal-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #ffffff;
  outline: none;
  font-family: Consolas, Monaco, monospace;
  font-size: 15px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .about-grid,
  .skills-grid,
  .projects-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 24px auto;
  }
}

@media (max-width: 640px) {
  .hero {
    height: 520px;
  }

  .card {
    padding: 20px;
  }

  .section-header h2 {
    font-size: 28px;
  }

  .hero-content p {
    font-size: 18px;
  }
}


.about-photo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-photo img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.skill-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

:root {
  --bg: #f5f7fb;
  --bg-soft: #f8fbff;
  --bg-soft-2: #eef4fb;
  --text: #14213d;
  --text-muted: #5b6780;
  --card: #ffffff;
  --card-soft: #fbfdff;
  --border: #dbe4f2;
  --border-strong: #d4deee;
  --shadow: 0 10px 30px rgba(20, 33, 61, 0.05);

  --badge-bg: #edf4ff;
  --badge-border: #d7e5fb;
  --badge-text: #2d5ca8;

  --skill-icon-bg: #eaf7f8;

  --timeline-line: #dde6f3;
  --timeline-dot: #6ccfd0;
  --timeline-dot-ring: #edf9fa;

  --project-top-a: rgba(108, 207, 208, 0.25);
  --project-top-b: rgba(45, 92, 168, 0.16);

  --modal-backdrop: rgba(15, 23, 48, 0.55);

  --terminal-bg-1: #162346;
  --terminal-bg-2: #0f1730;
  --terminal-text: #f1f5ff;
}

body.dark {
  --bg: #0f1728;
  --bg-soft: #111b30;
  --bg-soft-2: #16233d;
  --text: #eef4ff;
  --text-muted: #a7b4cc;
  --card: #162136;
  --card-soft: #19263d;
  --border: #27344d;
  --border-strong: #33425f;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);

  --badge-bg: #1c2a44;
  --badge-border: #30415e;
  --badge-text: #8fbcff;

  --skill-icon-bg: #203349;

  --timeline-line: #2b3954;
  --timeline-dot: #71d8da;
  --timeline-dot-ring: rgba(113, 216, 218, 0.14);

  --project-top-a: rgba(108, 207, 208, 0.14);
  --project-top-b: rgba(45, 92, 168, 0.16);

  --modal-backdrop: rgba(4, 8, 18, 0.72);

  --terminal-bg-1: #0c1427;
  --terminal-bg-2: #09101f;
  --terminal-text: #f1f5ff;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(20, 33, 61, 0.08);
  transition: 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

body.dark .theme-toggle {
  background: rgba(19, 29, 47, 0.82);
}

#mouse-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  opacity: 0.22;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(108, 207, 208, 0.22) 0%,
    rgba(45, 92, 168, 0.14) 35%,
    rgba(45, 92, 168, 0.06) 55%,
    rgba(45, 92, 168, 0) 72%
  );
  filter: blur(18px);
  transition: opacity 0.25s ease;
}

body.dark #mouse-glow {
  opacity: 0.3;
  background: radial-gradient(
    circle,
    rgba(113, 216, 218, 0.18) 0%,
    rgba(143, 188, 255, 0.12) 35%,
    rgba(143, 188, 255, 0.05) 55%,
    rgba(143, 188, 255, 0) 72%
  );
}

.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  backface-visibility: hidden;
}

.tilt-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 20%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0) 80%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tilt-card:hover::after {
  opacity: 1;
}

body.dark .tilt-card::after {
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 20%,
    rgba(255,255,255,0.05) 50%,
    rgba(255,255,255,0) 80%
  );
}

.tilt-card * {
  transform: translateZ(0);
}
