/* Libor Krsek — portfolio. Montserrat 200/300, světlý/tmavý režim. */

:root {
  --bg: #ffffff;
  --fg: #101010;
  --muted: #8a8a8a;
  --line: rgba(0,0,0,.12);
  --overlay: rgba(255,255,255,.82);
}
html[data-theme="dark"] {
  --bg: #0b0b0b;
  --fg: #f1f1f1;
  --muted: #8f8f8f;
  --line: rgba(255,255,255,.16);
  --overlay: rgba(11,11,11,.82);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-y: scroll; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; }

/* ---------- Hlavička ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-weight: 400; letter-spacing: .32em; text-transform: uppercase; font-size: 13px; }
.brand-sub  { font-weight: 200; letter-spacing: .18em; text-transform: uppercase; font-size: 9px; color: var(--muted); }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); transition: color .25s;
  padding: 4px 0; border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a.is-active { color: var(--fg); }
.nav a.is-active { border-bottom-color: var(--fg); }
.nav-toggle { display: none; flex-direction: column; gap: 6px; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 1px; background: var(--fg); transition: transform .25s; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; position: relative; z-index: 60; }

  /* Hlavička na mobilu plně krycí, ať je název čitelný i přes fotku */
  .topbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }

  .nav {
    position: fixed; inset: 0; z-index: 45;
    flex-direction: column; justify-content: flex-start; align-items: stretch;
    gap: 0;
    /* začátek až pod hlavičkou, s ohledem na výřez displeje */
    padding: calc(env(safe-area-inset-top, 0px) + 78px) 22px calc(env(safe-area-inset-bottom, 0px) + 32px);
    background: var(--bg);
    overflow-y: auto;
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .nav.is-open { opacity: 1; pointer-events: auto; }

  .nav a {
    display: block; width: 100%;
    font-size: 17px; font-weight: 400; letter-spacing: .14em;
    color: var(--fg);                     /* plný kontrast místo šedé */
    padding: 17px 2px;
    border-bottom: 1px solid var(--line);
  }
  .nav a:last-child { border-bottom: 0; }
  .nav a.is-active { font-weight: 500; }
  .nav a.ext::after { content: '↗'; float: right; opacity: .45; font-size: 13px; }

  body.nav-open { overflow: hidden; }
  body.nav-open .nav-toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
  body.nav-open .nav-toggle span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }
}

/* ---------- Úvodní karusel ---------- */
.hero { position: relative; height: 100svh; overflow: hidden; background: var(--bg); }
.hero-slide {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity 1.1s ease;
}
.hero-slide.is-on { opacity: 1; }
.hero-slide img, .hero-slide picture { width: 100%; height: 100%; }
.hero-slide img { object-fit: cover; }
.hero-ui { position: absolute; inset: 0; pointer-events: none; }
.hero-counters {
  position: absolute; left: 28px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px;
}
.hero-counter {
  pointer-events: auto;
  font-weight: 200; font-size: 11px; letter-spacing: .2em;
  color: rgba(255,255,255,.55); text-shadow: 0 0 12px rgba(0,0,0,.35);
  transition: color .3s;
}
.hero-counter.is-on, .hero-counter:hover { color: #fff; }
.hero-title {
  position: absolute; left: 28px; bottom: 34px;
  color: #fff; text-shadow: 0 0 18px rgba(0,0,0,.4);
  font-weight: 200; font-size: clamp(26px, 5vw, 52px);
  letter-spacing: .22em; text-transform: uppercase;
}
.hero-scroll {
  pointer-events: auto;
  position: absolute; right: 28px; bottom: 38px;
  color: #fff; text-shadow: 0 0 12px rgba(0,0,0,.4);
  font-size: 10px; letter-spacing: .28em; text-transform: uppercase;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .hero-scroll { animation: none; }
  .hero-slide { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Galerie ---------- */
.wrap { padding: 0 28px 60px; }
.grid-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 90px 0 26px;
}
.grid-title {
  margin: 0; font-weight: 200; font-size: 13px;
  letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
}
.size-switch { display: flex; gap: 16px; }
.size-switch button {
  font-size: 11px; letter-spacing: .12em; color: var(--muted);
  padding: 2px 1px; border-bottom: 1px solid transparent;
  transition: color .25s;
}
.size-switch button.is-on { color: var(--fg); border-bottom-color: var(--fg); }

.gallery { display: flex; flex-wrap: wrap; }
.gallery .ph {
  position: relative; overflow: hidden; margin: 0 8px 8px 0; padding: 0;
  opacity: 0; transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
}
.gallery .ph.is-in { opacity: 1; transform: none; }
.gallery .ph img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.gallery .ph:hover img { transform: scale(1.025); }
.empty { color: var(--muted); padding: 40px 0 120px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,5,5,.94);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 90vh; object-fit: contain; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; color: #cfcfcf; font-weight: 200;
  transition: color .2s; z-index: 2;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: #fff; }
.lb-close { top: 16px; right: 24px; font-size: 32px; line-height: 1; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 42px; padding: 20px; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }

/* ---------- Patička ---------- */
.footer {
  display: flex; gap: 28px; align-items: center; justify-content: space-between;
  padding: 26px 28px 34px; border-top: 1px solid var(--line);
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.footer a { transition: color .25s; }
.footer a:hover { color: var(--fg); }
@media (max-width: 560px) {
  .footer { flex-direction: column; gap: 12px; }
  .wrap { padding: 0 12px 40px; }
  .topbar { padding: 14px 16px; }
  .hero-counters { left: 16px; }
  .hero-title { left: 16px; bottom: 26px; }
  .hero-scroll { right: 16px; bottom: 30px; }
}
