:root {
  --bg: #ffffff;
  --bg-alt: #f4f4f5;
  --text: #18181b;
  --text-muted: #52525b;
  --border: #e4e4e7;
  --accent: #2952d9;
  --font-heading: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --max-width: 980px;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --bg-alt: #1b1b1e;
    --text: #f1f1f3;
    --text-muted: #a1a1aa;
    --border: #2c2c30;
    --accent: #7c9bff;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

a { color: var(--accent); }

ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }

/* Language toggle: show/hide by data-lang on <html> */
[data-lang="cs"] .lang-en { display: none; }
[data-lang="en"] .lang-cs { display: none; }

.lang-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20;
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.lang-btn {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--text);
  color: var(--bg);
}

/* Section shell */
section {
  padding: 64px 24px;
}

.section-title {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  font-size: 1.6rem;
  margin-bottom: 32px;
}

.section-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
}

.section-grid + .section-grid { margin-top: 48px; }

.section-label {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Hero */
.hero {
  padding: 72px 24px 56px;
  background: var(--bg);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: .4em;
}

.hero .lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46em;
  margin-bottom: 1.5em;
}

.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  justify-self: end;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.contact-list svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text);
}

.contact-list a { text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

/* Skills */
.skills { background: var(--bg-alt); }

.skills-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 48px;
}

.skill-block h3 {
  font-size: 1rem;
  margin-bottom: .35em;
}

.skill-block p {
  color: var(--text-muted);
  font-size: .95rem;
}

/* Experience timeline */
.timeline {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.timeline-group {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
}

.company-badge {
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 72px;
}

.company-badge img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.roles {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.role h3 { font-size: 1.1rem; margin-bottom: .2em; }

.role .meta {
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: .75em;
}

.role ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: .95rem;
}

.role li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* Education block */
.education-block { background: var(--bg-alt); }

.education-block h3 { font-size: 1.05rem; }

.org { font-weight: 600; }
.note { color: var(--text-muted); font-size: .9rem; }

.certs {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.languages li {
  color: var(--text-muted);
}

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

.languages li + li { margin-top: 6px; }

/* Case studies / carousel */
.case-studies { background: var(--bg); }

.carousel {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.case-card {
  scroll-snap-align: start;
  flex: 0 0 300px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.case-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

.case-card-tag {
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 40px;
  margin-bottom: 6px;
}

.case-card-tag img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.case-card h3 { font-size: 1.05rem; margin-bottom: .1em; }

.case-card p {
  color: var(--text-muted);
  font-size: .9rem;
}

.case-card-link {
  margin-top: 8px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--accent);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.carousel-btn.prev { left: -18px; }
.carousel-btn.next { right: -18px; }

/* Footer */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: .9rem;
}

.site-footer a { color: var(--text-muted); }

/* Case study page */
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.case-hero {
  padding: 96px 24px 40px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.case-hero h1 {
  font-size: 2.2rem;
  margin-top: 16px;
}

.case-hero .meta {
  color: var(--text-muted);
  font-size: .95rem;
}

.case-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.case-body h2 {
  font-size: 1.2rem;
  margin-bottom: .5em;
}

.case-body p {
  color: var(--text-muted);
}

.placeholder-note {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: .9rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { display: none; }
  .hero h1 { font-size: 2.1rem; }

  .section-grid { grid-template-columns: 1fr; gap: 12px; }
  .skills-content { grid-template-columns: 1fr; }

  .timeline-group { grid-template-columns: 1fr; gap: 16px; }
  .company-badge { justify-self: start; }

  .carousel-btn { display: none; }
  .case-card { flex-basis: 82vw; }

  section { padding: 48px 20px; }
}
