:root {
  /* Kluczowe: informujemy przeglądarkę o wsparciu obu trybów */
  color-scheme: light dark;

  /* Poprawione zmienne, żeby w Light Mode tekst i bar były czytelne */
  --bg-page: light-dark(#e5e7eb, #0a0c10);
  --nav-bg: light-dark(rgba(255, 255, 255, 0.7), rgba(30, 32, 38, 0.8));
  --nav-text: light-dark(#111827, #f8fafc);
  --nav-border: light-dark(rgba(0, 0, 0, 0.7), rgba(255, 255, 255, 0.1));
  --indicator: light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.15));
  
  /* Akcent musi być ciemny w jasnym trybie, inaczej biała ikona zniknie na białym barze */
  --accent: light-dark(#000000, #ffffff); 
  --shadow-color: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.4));
}

body {
  margin: 0;
  background-color: var(--bg-page);
  min-height: 100vh;
  font-family: sans-serif;
  overflow: hidden;
}

/* --- STYL DLA "HUB" (Header) --- */
header {
  position: fixed;
  top: 40px;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 10;
}

header h1 {
  color: var(--nav-text);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 1.2rem;
  margin: 0;
  font-weight: 300;
  opacity: 0.9;
}
/* --- PANCERNE UKRYCIE RADIO --- */
input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* --- NAWIGACJA --- */
nav {
  --total-items: 3;
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 450px;
  height: 70px;
  display: grid;
  grid-template-columns: repeat(var(--total-items), 1fr);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--nav-border);
  border-radius: 100px;
  padding: 0 10px;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* PIGUŁKA (Indicator) */
nav::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  /* Szerokość pigułki dopasowana do paddingu nav */
  width: calc((100% - 20px) / var(--total-items)); 
  background: var(--indicator);
  border-radius: 100px;
  /* Super płynne przejście */
  transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
  z-index: 0;
}

/* LOGIKA RUCHU */
nav:has(input:nth-of-type(1):checked)::before { transform: translateX(0); }
nav:has(input:nth-of-type(2):checked)::before { transform: translateX(100%); }
nav:has(input:nth-of-type(3):checked)::before { transform: translateX(200%); }

/* ETYKIETY */
nav label {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1;
  color: var(--nav-text);
  height: 100%;
}

/* IKONY */
nav svg {
  fill: currentColor;
  width: 26px;
  height: 26px;
  /* Dodane cubic-bezier dla "żywych" ikon */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0.4;
}

/* PODŚWIETLENIE AKTYWNEJ IKONY */
input:checked + label svg {
  opacity: 1;
  color: var(--accent);
  transform: scale(1.25);
  /* Dynamiczny cień zależny od trybu */
  filter: drop-shadow(0 0 8px var(--shadow-color));
}
/* SPECJALNE WYRÓŻNIENIE DLA HOME */
nav label[for="home"] svg {
  width: 32px;
  height: 32px;
}

/* --- STRONY (SEKCJE) --- */
main section {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--nav-text);
  font-size: 2rem;
}
main section h2 {
  margin: 0;
  font-weight: 400;
  text-shadow: 0 2px 4px var(--shadow-color);
}
main section p {
  margin-top: 10px;
  font-size: 1rem;
  opacity: 0.8;
  padding: 0 20px;
  text-align: center;
}
body:has(nav input:nth-of-type(1):checked) main section:nth-of-type(1),
body:has(nav input:nth-of-type(2):checked) main section:nth-of-type(2),
body:has(nav input:nth-of-type(3):checked) main section:nth-of-type(3) {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}