:root {
  --bg: #f4f4f5;
  --bg-alt: #e9e9eb;
  --surface: #fbfbfb;
  --text: #1f2023;
  --muted: #62656b;
  --line: #d9dadd;
  --accent: #8a6a00;        /* žlutá pro text (tmavší kvůli čitelnosti) */
  --accent-fill: #f2c94c;   /* žlutá pro plochy a linky */
  --dark: #2a2b2f;
  --on-dark: #ececee;
  --max: 1080px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1e21;
    --bg-alt: #242529;
    --surface: #2a2b30;
    --text: #e9e9eb;
    --muted: #a0a2a8;
    --line: #36383d;
    --accent: #f2c94c;
    --accent-fill: #f2c94c;
    --dark: #141517;
    --on-dark: #e9e9eb;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 12px;
}

/* ---------- Hlavička ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  flex-wrap: wrap;
}

.logo {
  color: var(--text);
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-size: 15px;
}

.nav a {
  color: var(--muted);
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  text-decoration: none;
}

.nav a.active {
  box-shadow: inset 0 -2px 0 var(--accent-fill);
}

/* ---------- Úvod ---------- */
.hero {
  padding: 72px 0 56px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.lead {
  font-size: 1.2rem;
  max-width: 34em;
}

.lead-small {
  color: var(--muted);
  max-width: 34em;
}

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

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: #1f2023;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn:hover {
  text-decoration: none;
  opacity: 0.85;
}

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

.hero-photo {
  margin: 0;
  justify-self: end;
  width: 100%;
  max-width: 380px;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.facts {
  list-style: none;
  padding: 0;
  margin: 64px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.facts li {
  padding: 24px 20px 0 0;
}

.facts li {
  border-top: 2px solid transparent;
  margin-top: -1px;
}

.facts li:first-child {
  border-top-color: var(--accent-fill);
}

.facts strong {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 8px;
}

.facts span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Bloky ---------- */
.block {
  padding: 80px 0;
}

.block-alt {
  background: var(--bg-alt);
}

.block-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
}

.block-grid > h2 {
  font-size: 1.5rem;
  position: sticky;
  top: 88px;
  align-self: start;
}

.period {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Zkušenosti */
.entry {
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.entry h3 {
  font-size: 1.2rem;
}

.role {
  color: var(--muted);
  margin: 4px 0 12px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 7px 0;
}

/* Panely */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.panel h3 {
  font-size: 1rem;
  margin-bottom: 14px;
}

.panel p:last-child {
  margin-bottom: 0;
}

.panel-spaced {
  margin-top: 32px;
}

.list {
  margin: 0;
  padding-left: 18px;
}

.list li {
  margin-bottom: 8px;
}

.list li:last-child {
  margin-bottom: 0;
}

.stays {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stays li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.stays li:last-child {
  border-bottom: none;
}

.stays li span:last-child {
  color: var(--muted);
  white-space: nowrap;
}

.stays small {
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 10px 0 0;
}

/* Výuka */
.section-lead {
  font-size: 1.15rem;
  max-width: 38em;
}

.block-body > .subhead {
  font-size: 1rem;
  margin: 40px 0 16px;
}

h4 {
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 6px;
}

.philosophy {
  border-left: 3px solid var(--accent-fill);
  padding-left: 20px;
  max-width: 40em;
}

.philosophy-main {
  font-size: 1.15rem;
}

.philosophy p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.approach {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 32px;
}

.approach li {
  counter-increment: step;
  padding-top: 14px;
  border-top: 2px solid var(--line);
}

.approach li::before {
  content: "0" counter(step);
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.approach li:first-child {
  border-top-color: var(--accent-fill);
}

.approach p,
.highlights p {
  color: var(--muted);
  margin: 0;
}

.sites {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.sites a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
}

.sites a::after {
  content: "↗";
  color: var(--accent);
}

.sites a:hover {
  text-decoration: none;
  border-color: var(--accent-fill);
}

.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.highlights strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.1;
  margin-bottom: 8px;
}

/* Projekty */
.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.projects li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.projects p {
  margin: 6px 0 0;
}

/* Dovednosti */
.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
  margin-bottom: 40px;
}

.skill h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.skill p {
  color: var(--muted);
  margin: 0;
}

/* Kontakt */
.contact {
  background: var(--dark);
  color: var(--on-dark);
  padding: 88px 0;
}

.contact h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.contact-links {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 1.25rem;
}

.contact-links li {
  padding: 4px 0;
}

.contact-links a {
  color: var(--on-dark);
  border-bottom: 2px solid var(--accent-fill);
}

.contact-links a:hover {
  text-decoration: none;
  opacity: 0.75;
}

/* Patička */
.site-footer {
  background: var(--dark);
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

/* ---------- Responzivita ---------- */
@media (max-width: 900px) {
  .block-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .block-grid > h2 {
    position: static;
  }

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

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

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

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

@media (max-width: 700px) {
  body {
    font-size: 16px;
  }

  .wrap {
    padding: 0 16px;
  }

  .header-inner {
    padding: 10px 0;
  }

  .hero {
    padding-top: 40px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-photo {
    order: -1;
    justify-self: start;
    max-width: 200px;
  }

  .block {
    padding: 56px 0;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .two-col,
  .projects,
  .skills,
  .approach {
    grid-template-columns: 1fr;
  }
}

/* ---------- Mikroanimace ---------- */
:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Průběh scrollování – tenká žlutá linka pod hlavičkou */
.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--accent-fill);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}

/* Podtržení aktivní položky navigace vyjíždí zleva */
.nav a {
  position: relative;
  transition: color 0.25s ease;
}

.nav a.active {
  box-shadow: none;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  background: var(--accent-fill);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.35s var(--ease);
}

.nav a:hover::after {
  transform: scaleX(0.4);
}

.nav a.active::after {
  transform: scaleX(1);
}

/* Tlačítka */
.btn {
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost:hover {
  border-color: var(--accent-fill);
  box-shadow: none;
}

/* Fotka */
.hero-photo {
  overflow: hidden;
  border-radius: var(--radius);
}

.hero-photo img {
  transition: transform 0.8s var(--ease);
}

.hero-photo:hover img {
  transform: scale(1.03);
}

/* Karty a panely – jemné zvednutí */
.projects li,
.panel,
.sites a {
  transition: transform 0.3s var(--ease), border-color 0.3s ease, box-shadow 0.3s ease;
}

.projects li:hover,
.highlights .panel:hover,
.sites a:hover {
  transform: translateY(-2px);
  border-color: var(--accent-fill);
  box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.4);
}

.sites a::after {
  transition: transform 0.3s var(--ease);
}

.sites a:hover::after {
  transform: translate(2px, -2px);
}

/* Kroky „Jak učím“ – horní linka se při najetí obarví */
.approach li {
  position: relative;
}

.approach li::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-fill);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s var(--ease);
}

.approach li:hover::after {
  transform: scaleX(1);
}

/* Kontakt – podtržení se při najetí zúží a vrátí */
.contact-links a {
  border-bottom: 0;
  background: linear-gradient(var(--accent-fill), var(--accent-fill)) 0 100% / 100% 2px no-repeat;
  transition: background-size 0.4s var(--ease);
}

.contact-links a:hover {
  opacity: 1;
  background-size: 30% 2px;
}

/* Postupné odkrývání při scrollu (jen když běží JS) */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0s);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Úvod – nástup po načtení */
.js .hero-text > *,
.js .hero-photo {
  animation: rise 0.8s var(--ease) both;
}

.js .hero-text > :nth-child(2) { animation-delay: 0.06s; }
.js .hero-text > :nth-child(3) { animation-delay: 0.12s; }
.js .hero-text > :nth-child(4) { animation-delay: 0.18s; }
.js .hero-text > :nth-child(5) { animation-delay: 0.24s; }
.js .hero-photo { animation-delay: 0.15s; animation-duration: 1s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Omezení pohybu */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
