:root {
  /* Výchozí denní režim (zářivá bílá) */
  --bg-color: #fcfcfc;
  --text-main: #111111;
  --text-muted: #888888;
  --accent: #CFFF00; /* Neonová žlutá */
  --max-width: 1200px; 
  --border-color: rgba(0,0,0,0.1);
  --nav-bg: rgba(252,252,252,0.85);
  --input-bg: #fff;
  --card-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

/* --- DARK MODE (Ztlumený "papírový" režim pro šetření očí) --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #e4e4e4; /* Tmavší, měkká bílá/šedá */
    --text-main: #111111; /* Text zůstává tmavý */
    --text-muted: #666666; /* Mírně ztmavená šedá pro lepší kontrast */
    --border-color: rgba(0,0,0,0.15); 
    --nav-bg: rgba(228,228,228,0.85); /* Odpovídající poloprůhledné pozadí navigace */
    --input-bg: #ebebeb; 
    --card-shadow: 0 20px 40px rgba(0,0,0,0.12); /* Nepatrně silnější stín pro zachování hloubky */
  }
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent; 
}

::selection { 
  background-color: var(--accent); 
  color: #111;
}

::-webkit-scrollbar { 
  width: 0px; 
  background: transparent; 
}

html { 
  scroll-behavior: smooth; 
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* --- PRELOADER --- */
#preloader {
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: var(--bg-color); 
  z-index: 9999;
  display: flex; 
  justify-content: center; 
  align-items: center;
  transition: transform 0.8s cubic-bezier(0.7,0,0.2,1);
}

.loader-mask { 
  overflow: hidden; 
  display: inline-block; 
  padding: 10px; 
}

.loader-text {
  display: inline-block; 
  font-weight: 600; 
  font-size: 1.4rem; 
  letter-spacing: -1px;
  transform: translateY(100%);
  animation: slideUpLoader 1s cubic-bezier(0.16,1,0.3,1) forwards 0.2s,
           pulseText 1.5s infinite ease-in-out 1.2s;
}

@keyframes slideUpLoader { 
  to { transform: translateY(0); } 
}

@keyframes pulseText { 
  0%, 100% { opacity: 0.4; } 
  50% { opacity: 1; } 
}

#preloader.hidden { 
  transform: translateY(-100%); 
  pointer-events: none; 
}

/* --- REVEAL --- */
.reveal-up {
  opacity: 0; 
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16,1,0.3,1);
}

.reveal-up.is-visible { 
  opacity: 1; 
  transform: translateY(0); 
}

/* --- NAV --- */
nav {
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 80px; 
  padding: 0 50px;
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  background: var(--nav-bg); 
  backdrop-filter: blur(20px);
  z-index: 1000;
  transition: background-color 0.4s ease;
}

.logo { 
  font-weight: 700; 
  font-size: 0.95rem; 
  color: var(--text-main); 
  letter-spacing: -0.5px; 
  cursor: pointer; 
  text-decoration: none; 
  transition: color 0.3s ease;
}

.nav-links { 
  display: flex; 
  gap: 30px; 
  align-items: center; 
}

.animated-link {
  position: relative; 
  font-size: 0.85rem; 
  color: var(--text-main); 
  text-decoration: none;
  font-weight: 600; 
  cursor: pointer; 
  padding-bottom: 2px; 
  display: inline-block;
  transition: color 0.3s ease;
}

.animated-link::after {
  content: ''; 
  position: absolute; 
  width: 100%; 
  height: 3px; 
  bottom: -2px; 
  left: 0;
  background-color: var(--accent); 
  transform: scaleX(0); 
  transform-origin: bottom right; 
  transition: transform 0.3s ease-out;
}

.animated-link:hover::after { 
  transform: scaleX(1); 
  transform-origin: bottom left; 
}

.text-link {
  text-decoration: none; 
  color: var(--text-main); 
  font-weight: 700;
  position: relative;
  z-index: 1;
  padding-bottom: 2px; 
  transition: color 0.3s ease;
}

.text-link::before {
  content: ''; 
  position: absolute; 
  bottom: 0; 
  left: -2%; 
  width: 104%; 
  height: 2px; 
  background-color: var(--text-main); 
  z-index: -1; 
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-link:hover {
  color: #111; 
}

.text-link:hover::before { 
  height: 45%; 
  background-color: var(--accent); 
}

/* --- HEADER / HERO --- */
header {
  height: 80vh; 
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: flex-start;
  padding: 0 50px; 
  max-width: var(--max-width); 
  margin: 0 auto;
}

.hero-title { 
  font-size: clamp(3rem,7vw,4.5rem); 
  font-weight: 800; 
  font-style: italic; 
  letter-spacing: -2px; 
  line-height: 1.1; 
  margin-bottom: 25px; 
  max-width: 900px; 
  color: var(--text-main); 
}

.hero-desc { 
  font-size: 1.2rem; 
  color: var(--text-muted); 
  max-width: 550px; 
  font-weight: 400; 
  line-height: 1.6; 
  margin-left: 5px; 
}

/* --- PROJECTS --- */
.projects-wrap { 
  max-width: 900px; 
  margin: 0 auto; 
  padding: 0 50px 100px 50px; 
  display: flex; 
  flex-direction: column; 
  gap: 100px; 
}

.project-card { 
  display: block; 
  width: 100%; 
  background: transparent; 
  border: none; 
  cursor: pointer; 
  position: relative; 
  z-index: 1; 
  transform: translateZ(0); 
  backface-visibility: hidden; 
  will-change: transform; 
}

.card-img-wrap { 
  width: 100%; 
  border-radius: 0; 
  overflow: hidden; 
  background: transparent; 
  position: relative; 
  transform: translate3d(0,0,0); 
  will-change: transform; 
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
}

.project-img { 
  width: 100%; 
  height: auto; 
  display: block; 
  opacity: 0; /* Skryté před načtením */
  transition: opacity 0.6s ease, filter 0.4s ease; 
}

.project-img.img-loaded {
  opacity: 1; /* Viditelné po načtení */
}

.project-card:hover .card-img-wrap { 
  transform: translate3d(0, -10px, 0); 
}

.project-card:hover .project-img { 
  filter: drop-shadow(var(--card-shadow)); 
}

.card-body { 
  padding: 25px 0 0 0; 
}

.card-label { 
  font-size: 0.75rem; 
  color: var(--text-muted); 
  letter-spacing: 1.5px; 
  font-weight: 600; 
  font-style: italic; 
  margin-bottom: 8px; 
  display: block; 
  text-transform: lowercase; 
}

.card-title { 
  font-size: 1.8rem; 
  font-weight: 700; 
  letter-spacing: -1px; 
  margin-bottom: 15px; 
  color: var(--text-main); 
}

/* BUTTON */
.liquid-btn {
  display: inline-flex; 
  align-items: center; 
  font-size: 0.9rem; 
  font-weight: 700; 
  color: var(--text-main);
  background: transparent; 
  border: none; 
  cursor: pointer; 
  text-decoration: none;
  padding: 0; 
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}

.liquid-btn::after {
  content: '→'; 
  margin-left: 8px; 
  font-size: 1.2em; 
  transition: transform 0.3s ease;
}

.liquid-btn::before {
  content: ''; 
  position: absolute; 
  bottom: 0; 
  left: -5%; 
  width: 110%; 
  height: 45%;
  background-color: var(--accent);
  z-index: -1; 
  transform: scaleX(0); 
  transform-origin: right; 
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}

.liquid-btn:hover {
  color: #111; 
}

.liquid-btn:hover::before { 
  transform: scaleX(1); 
  transform-origin: left; 
}

.liquid-btn:hover::after { 
  transform: translateX(6px); 
}

/* --- GALLERY GRID --- */
.gallery-wrap { 
  max-width: var(--max-width); 
  margin: 0 auto; 
  padding: 0 50px 100px 50px; 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 40px; 
}

.polaroid-item { 
  width: 100%; 
  cursor: pointer; 
  position: relative; 
  transform: translateZ(0); 
  will-change: transform; 
  transition: transform 0.4s ease, filter 0.4s ease; 
}

.polaroid-item img { 
  width: 100%; 
  height: auto; 
  display: block; 
  background: transparent; 
  border: none;
  outline: none;
  color: transparent; 
  font-size: 0; 
  /* AKTUALIZOVÁNO: Silnější stín, méně posunutý dolů, aby vynikl i nahoře */
  filter: drop-shadow(0 2px 40px rgba(0,0,0,0.15)); 
  border-radius: 0; 
  opacity: 0; /* Skryté před načtením */
  transition: opacity 0.6s ease, filter 0.4s ease; 
}

.polaroid-item img.img-loaded {
  opacity: 1; /* Viditelné po načtení */
}

.polaroid-item:hover { 
  transform: translateY(-8px); 
  z-index: 10; 
}

/* --- CONTACT --- */
.contact-section { 
  max-width: var(--max-width); 
  margin: 0 auto; 
  padding: 100px 50px; 
  border-top: 1px solid var(--border-color); 
  text-align: center; 
}

.contact-link-large { 
  position: relative; 
  font-size: 3.5rem; 
  font-weight: 800; 
  font-style: italic; 
  letter-spacing: -1.5px; 
  color: var(--text-main); 
  text-decoration: none; 
  display: inline-block; 
  margin-top: 10px; 
  cursor: pointer; 
  z-index: 1;
  transition: color 0.3s ease;
}

.contact-link-large::after { 
  content: ''; 
  position: absolute; 
  width: 104%; 
  height: 35%; 
  bottom: 12%; 
  left: -2%; 
  background-color: var(--accent); 
  transform: scaleX(0); 
  transform-origin: right; 
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1); 
  z-index: -1; 
}

.contact-link-large:hover {
  color: #111;
}

.contact-link-large:hover::after { 
  transform: scaleX(1); 
  transform-origin: left; 
}

/* --- FOOTER --- */
.site-footer { 
  width: 100%; 
  border-top: 1px solid var(--border-color); 
  padding: 40px 50px; 
}

.footer-content { 
  max-width: var(--max-width); 
  margin: 0 auto; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  flex-wrap: wrap; 
  gap: 20px; 
}

.footer-left { 
  display: flex; 
  align-items: center; 
  gap: 30px; 
}

.footer-copy { 
  font-size: 0.85rem; 
  color: var(--text-muted); 
  font-weight: 500; 
}

.footer-link { 
  font-size: 0.85rem; 
  color: var(--text-main); 
  text-decoration: none; 
  font-weight: 700; 
  transition: opacity 0.3s ease; 
}

.footer-link:hover { 
  opacity: 0.5; 
}

.footer-right { 
  display: flex; 
  align-items: center; 
  gap: 15px; 
}

.footer-label { 
  font-size: 0.7rem; 
  color: var(--text-muted); 
  text-transform: uppercase; 
  letter-spacing: 1.5px; 
  font-weight: 600; 
}

.zet-logo-link { 
  display: flex; 
  align-items: center; 
  transition: opacity 0.3s ease; 
  opacity: 1; 
}

.zet-logo-link:hover { 
  opacity: 0.5; 
}

.zet-footer-icon { 
  height: 22px; 
  width: auto; 
  display: block; 
}

/* --- MODAL (OBECNÉ) --- */
.modal-overlay {
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: var(--bg-color); 
  z-index: 2000; 
  opacity: 0; 
  pointer-events: none; 
  transition: opacity 0.4s ease, background-color 0.4s ease;
  overflow-y: auto; 
}

.modal-overlay.active { 
  opacity: 1; 
  pointer-events: all; 
}

.modal-container { 
  max-width: 900px; 
  margin: 80px auto; 
  padding: 0 20px 80px 20px; 
}

/* --- 50/50 LAYOUT FOTKY V MODALU --- */
.modal-photo-view { 
  display: flex; 
  width: 100vw;
  height: 100vh;
  margin: 0; 
  padding: 0; 
  max-width: none;
  align-items: center;
}

.photo-details-grid {
  display: flex; 
  width: 100%;
  height: 100vh;
}

.photo-details-col-left {
  flex: 0 0 50%; 
  height: 100vh;
  background: transparent; 
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px; 
}

.modal-photo-img { 
  max-width: 100%; 
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain; 
  border-radius: 0;
  box-shadow: none; 
  filter: drop-shadow(0 20px 50px rgba(0,0,0,0.1)); 
}

.photo-details-col-right {
  flex: 0 0 50%; 
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 0 10%; 
  background-color: var(--bg-color);
  overflow-y: auto; 
  transition: background-color 0.4s ease;
}

.modal-photo-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  font-style: italic;
  letter-spacing: -2px;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 20px;
}

.modal-photo-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 50px;
  display: flex;
  gap: 8px;
}

.modal-photo-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 500px;
}

/* Tlačítko zavřít */
.close-modal {
  position: fixed; 
  top: 0; 
  right: 0; 
  height: 80px; 
  padding: 0 50px;
  border: none; 
  cursor: pointer; 
  background: transparent;
  font-family: inherit; 
  font-size: 0.85rem; 
  font-weight: 600; 
  color: var(--text-main);
  z-index: 2001; 
  display: flex; 
  align-items: center;
  transition: color 0.3s ease;
}

.close-modal span { 
  position: relative; 
  z-index: 1;
}

.close-modal span::after { 
  content: ''; 
  position: absolute; 
  width: 115%; 
  height: 45%; 
  bottom: -2px; 
  left: -7.5%; 
  background-color: var(--accent); 
  transform: scaleX(0); 
  transform-origin: right; 
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1); 
  z-index: -1;
}

.close-modal:hover {
  color: #111;
}

.close-modal:hover span::after { 
  transform: scaleX(1); 
  transform-origin: left; 
}

/* --- O Mně a Kontakt --- */
.about-grid { 
  display: grid; 
  grid-template-columns: 1fr 1.5fr; 
  gap: 60px; 
  align-items: center; 
}

.about-photo { 
  width: 100%; 
  aspect-ratio: 3/4; 
  background: #ddd; 
  object-fit: cover; 
  border-radius: 0; 
  box-shadow: var(--card-shadow); 
  position: relative; 
  top: 0; 
  transition: top 0.4s ease; 
}

.about-photo:hover { 
  top: -5px; 
}

.about-title { 
  font-size: clamp(2.5rem,5vw,4rem); 
  font-weight: 800; 
  font-style: italic; 
  letter-spacing: -2px; 
  margin-bottom: 20px; 
  color: var(--text-main); 
  line-height: 1.1; 
}

.about-desc { 
  font-size: 1.1rem; 
  color: var(--text-muted); 
  line-height: 1.7; 
  margin-bottom: 40px; 
  max-width: 600px; 
}

.services-list { 
  margin-top: 40px; 
  padding-top: 40px; 
  border-top: 1px solid var(--border-color); 
}

.services-list h4 { 
  font-size: 0.75rem; 
  color: var(--text-muted); 
  letter-spacing: 1.5px; 
  font-weight: 600; 
  margin-bottom: 20px; 
  text-transform: uppercase; 
}

.services-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 20px; 
}

.service-item { 
  font-size: 1.05rem; 
  font-weight: 500; 
  color: var(--text-main); 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  transition: opacity 0.3s ease; 
}

.service-item:hover { 
  opacity: 0.6; 
}

.service-item::before { 
  content: ''; 
  display: block; 
  width: 6px; 
  height: 6px; 
  background: var(--accent); 
  border-radius: 50%; 
}

.contact-form { 
  max-width: 500px; 
  margin: 0; 
  text-align: left; 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
}

.form-group { 
  width: 100%; 
}

.form-input { 
  width: 100%; 
  padding: 18px 20px; 
  background: var(--input-bg); 
  border: 1px solid var(--border-color); 
  border-radius: 0; 
  font-family: inherit; 
  font-size: 1rem; 
  color: var(--text-main); 
  transition: all 0.3s ease; 
  outline: none; 
  resize: none; 
}

.form-input:focus { 
  border-color: var(--text-main); 
  box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
}

#popup-submit-btn { 
  width: auto; 
  padding: 0; 
  font-size: 1rem; 
  margin-top: 10px; 
  justify-content: flex-start; 
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  nav, header, .gallery-wrap, .projects-wrap { 
    padding: 0 20px; 
  }
  
  header { 
    padding-top: 120px; 
    height: 70vh; 
  }
  
  .hero-title { 
    font-size: 2.8rem; 
  }
  
  .about-grid { 
    grid-template-columns: 1fr; 
    gap: 30px; 
  }
  
  .about-img-wrapper { 
    display: flex; 
    justify-content: left; 
  }
  
  .about-photo { 
    width: 100%; 
    max-width: 280px; 
    aspect-ratio: auto; 
    height: auto; 
  }
  
  .services-grid { 
    grid-template-columns: 1fr; 
  }
  
  .close-modal { 
    right: 20px; 
  }
  
  .projects-wrap { 
    padding-bottom: 80px; 
    gap: 60px; 
  }
  
  .gallery-wrap { 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 15px; 
  }
  
  .contact-link-large { 
    font-size: 2.2rem; 
  }
  
  .site-footer { 
    padding: 30px 20px; 
  }
  
  .footer-content { 
    flex-direction: column-reverse; 
    align-items: flex-start; 
    gap: 40px; 
  }
  
  .footer-left { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 15px; 
  }

  .modal-photo-view { 
    height: auto; 
    min-height: 100vh; 
    padding: 0; 
    align-items: stretch; 
  }
  
  .photo-details-grid { 
    flex-direction: column; 
    height: auto; 
  }
  
  .photo-details-col-left { 
    flex: 0 0 50vh; 
    width: 100%; 
    height: 50vh; 
    padding: 40px 20px; 
  }
  
  .photo-details-col-right { 
    flex: 1; 
    width: 100%; 
    height: auto; 
    padding: 40px 20px; 
    align-items: center; 
    text-align: center; 
  }
  
  .modal-photo-title { 
    font-size: 2rem; 
    margin-bottom: 10px; 
  }
  
  .modal-photo-meta { 
    margin-bottom: 20px; 
    font-size: 0.75rem; 
    justify-content: center; 
  }
  
  .modal-photo-desc { 
    font-size: 1rem; 
  }
  
  .close-modal { 
    right: 20px; 
    padding: 0; 
  }
}