* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth; 
}


html.introOn,
html.introOn body {
  overflow: hidden;
}

body {
  background: #050505;
  color: #ddd;
  font-family: Georgia, "Times New Roman", serif;
  overflow-x: hidden; /* brak poziomego scrolla na telefonach */
}

/* Delikatne poziome "linie skanowania" nałożone na całą stronę */
body::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0; 
  pointer-events: none; /* nie blokuje klikania */
  z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* Czytelny fokus dla nawigacji klawiaturą (dostępność) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #aaa;
  outline-offset: 4px;
}


.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- 2. INTRO ---------- */

/* Pełnoekranowa nakładka. Znika po kliknięciu „Wejdź na stronę” (klasa .hidden). */
#intro {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  background: #020202;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.5s, visibility 1.5s; /* płynne WYJŚCIE z intra (nie dotyczy logo) */
}

#intro.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* w trakcie znikania nie przechwytuje już kliknięć */
}

/* Ciemne tło z winietą */
.room {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(ellipse at 50% 55%, #171717 0, #090909 35%, #020202 72%);
}

/* Kontener na animację (GIF) ORAZ statyczne logo.
   Oba obrazki leżą w tym samym polu, więc po podmianie logo
   pojawia się dokładnie w tym samym miejscu. */
#wakeAnim {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  height: min(430px, 55vh); /* wysokość ogranicza też widok poziomy na telefonie */
  aspect-ratio: 1168 / 784; /* proporcje pliku animacja.gif */
  max-width: 90vw;
}

/* Wspólne ustawienia dla GIF-a i logo.
   UWAGA: celowo NIE ma tu żadnego "transition" ani "animation" –
   podmiana ma być natychmiastowa („jak sztylet w śnieg”). */
#wakeAnim img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* obraz zawsze w całości, bez rozciągania */
}

/* Cytat + przycisk – pojawiają się razem z logo (atrybut hidden zdejmuje JS) */
.introText {
  position: absolute;
  bottom: 20%;      
  width: 100%;
  padding: 0 5%;
  text-align: center;
}

.quote {
  font-size: clamp(18px, 3vw, 30px);
  letter-spacing: 2px;
  color: #eee;
}

.enter {
  margin-top: 30px;
  background: none;
  border: 1px solid #555;
  color: #bbb;
  padding: 12px 28px;
  cursor: pointer;
  letter-spacing: 4px;
  text-transform: uppercase;
  transition: 0.3s;
}

.enter:hover{
  border-color: #c40000;
  color: #c40000;
  text-shadow: 0.6px 0 0 currentColor, -0.6px 0 0 currentColor;
  box-shadow: 0 0 20px rgba(196, 0, 0, 0.4);
}

/* ---------- 3. NAWIGACJA ---------- */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 22px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(rgba(5, 5, 5, 0.87), transparent);
}

.logoSmall {
  font-weight: bold;
  letter-spacing: 4px;
}

.navlinks {
  display: flex;
  gap: 25px;
  font: 11px Arial, sans-serif;
  letter-spacing: 2px;
  color: #999;
}

.navlinks a:hover,
.navlinks a:focus-visible {
  color: #a30000;
}
/* Przycisk „hamburger” – na komputerze ukryty, pokazuje się tylko na telefonie */
.navToggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}

/* Trzy paski */
.navToggle span {
  display: block;
  width: 26px;
  height: 2px;
  margin: 6px 0;
  background: #bbb;
  transition: transform 0.3s, opacity 0.3s;
}

.navToggle:hover span,
.navToggle:focus-visible span {
  background: #a30000;
}

/* Po otwarciu menu paski zamieniają się w "X" */
nav.open .navToggle span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

nav.open .navToggle span:nth-child(2) {
  opacity: 0;
}

nav.open .navToggle span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}


/* ---------- 4. SEKCJE (wspólny układ) ---------- */

section {
  min-height: 100vh;
  position: relative;
  padding: 120px 7%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 5. HERO ---------- */

.hero {
  background: radial-gradient(ellipse at center, #161616 0, #060606 55%, #020202 100%);
  text-align: center;
  overflow: hidden;
}

/* Przyciemnienie krawędzi hero */
.hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    linear-gradient(transparent 70%, #050505),
    radial-gradient(circle at 50% 45%, transparent 0 20%, rgba(0, 0, 0, 0.6) 75%);
  pointer-events: none;
}

.heroContent {
  position: relative;
  z-index: 2;
}

.kicker {
  font: 11px Arial, sans-serif;
  letter-spacing: 6px;
  color: #777;
  margin-bottom: 25px;
}

h1 {
  font-size: clamp(50px, 10vw, 130px);
  line-height: 0.85;
  letter-spacing: -5px;
  color: #eee;
  text-shadow: 0 0 35px #000;
}

.tagline {
  margin: 30px auto;
  max-width: 650px;
  color: #999;
  font-size: clamp(16px, 2vw, 23px);
  font-style: italic;
}

.cta {
  display: inline-block;
  border: 1px solid #555;
  padding: 15px 32px;
  letter-spacing: 4px;
  font: 12px Arial, sans-serif;
  margin: 10px;
  transition: 0.3s;
}

.cta:hover,
.cta:focus-visible {
  background: transparent;           
  color: #c40000;              
  border-color: #c40000;           
  text-shadow: 0.6px 0 0 currentColor, -0.6px 0 0 currentColor;
  box-shadow: 0 0 18px rgba(196, 0, 0, 0.35); 
}

.scroll {
  margin-top: 55px;
  font: 10px Arial, sans-serif;
  color: #555;
  letter-spacing: 3px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

/* ---------- 6. PROLOG ---------- */

.dark {
  background: #080808;
}

.story {
  max-width: 900px;
  text-align: center;
}

.story p {
  font-size: clamp(20px, 3vw, 31px);
  line-height: 1.7;
  color: #aaa;
  margin: 20px 0;
}

.story .red {
  color: #7c2222;
}

/* Ostatnia linijka prologu (wcześniej styl inline w HTML) */
.story .lastLine {
  margin-top: 55px;
  color: #eee;
}

/* ---------- 7. INTERAKTYWNY FRAGMENT (odłamki) ---------- */

.wakeSection {
  background: radial-gradient(circle at center, #141414, #030303 70%);
  flex-direction: column;
}

.sectionTitle {
  text-align: center;
  margin-bottom: 55px;
}

.sectionTitle small {
  font: 10px Arial, sans-serif;
  letter-spacing: 5px;
  color: #666;
}

.sectionTitle h2 {
  font-size: clamp(35px, 6vw, 70px);
  margin-top: 12px;
}

.interactive {
  position: relative;
  width: min(800px, 90vw);
  height: 420px;
}

/* Odłamek to teraz <button> (dostępny z klawiatury) – stąd reset padding */
.shard {
  position: absolute;
  width: 110px;
  height: 75px;
  padding: 0;
  background: linear-gradient(135deg, rgba(221, 221, 221, 0.53), rgba(68, 68, 68, 0.13));
  clip-path: polygon(0 30%, 80% 0, 100% 75%, 30% 100%); /* kształt „szkła” */
  border: 1px solid #aaa;
  cursor: pointer;
  transition: 0.4s;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.07));
}

.shard:hover,
.shard:focus-visible {
  transform: scale(1.12) rotate(4deg);
  filter: drop-shadow(0 0 15px #aaa);
}

/* Rozmieszczenie i obrót poszczególnych odłamków */
.s1 { left: 10%; top: 20%; transform: rotate(-20deg); }
.s2 { left: 35%; top: 5%;  transform: rotate(18deg); }
.s3 { left: 62%; top: 28%; transform: rotate(-8deg); }
.s4 { left: 24%; top: 58%; transform: rotate(12deg); }
.s5 { left: 70%; top: 68%; transform: rotate(24deg); }
.s6 { left: 45%; top: 48%; transform: rotate(-30deg); }

/* Napis, który pojawia się po kliknięciu odłamka */
.shardMsg {
  position: absolute;
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%);
  width: 90%;
  min-height: 50px;
  text-align: center;
  font-style: italic;
  color: #aaa;
  font-size: 18px;
  opacity: 0;
  transition: 0.4s;
}

/* ---------- 8. KSIĘGI ---------- */

.book {
  background: #070707;
}

/* auto-fit: kolumny same się układają (3 → 2 → 1) bez osobnych media queries */
.bookGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  width: min(1050px, 90vw);
}

.chapter {
  min-height: 300px;
  border: 1px solid #222;
  background: linear-gradient(135deg, #111, #080808);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: 0.4s;
  position: relative;
  overflow: hidden;
}

.chapter:hover {
  border-color: #555;
  transform: translateY(-7px);
}

.chapterNum {
  font: 10px Arial, sans-serif;
  color: #555;
  letter-spacing: 4px;
}

.chapter h3 {
  font-size: 36px;
}

.chapter p {
  color: #777;
  line-height: 1.6;
}

.status {
  font: 10px Arial, sans-serif;
  letter-spacing: 2px;
  color: #444;
}

/* ---------- 9. MIESZKANIE ---------- */

.apartment {
  background: #050505;
  flex-direction: column;
}

/* Puste miejsce na docelowy projekt kawalerki */
.floorplan {
  position: relative;
  width: min(850px, 90vw);
  aspect-ratio: 1.5;
  border: 2px dashed #333;
  background: #0b0b0b;
  box-shadow: 0 0 60px #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font: 12px Arial, sans-serif;
  letter-spacing: 4px;
  text-align: center;
  padding: 20px;
}

/* ---------- 10. TRAILER ---------- */

.trailer {
  background: #020202;
  min-height: 80vh;
  text-align: center;
}

.play {
  width: 100px;
  height: 100px;
  border: 1px solid #666;
  border-radius: 50%;
  background: none;
  color: #aaa;
  font-size: 35px;
  cursor: pointer;
  transition: 0.3s;
}

.play:hover,
.play:focus-visible {
  color: #a30000;
  border-color: #a30000;
  transform: scale(1.08);
  box-shadow: 0 0 18px rgba(163, 0, 0, 0.4);
}
/* Co drugie słowo napisu w trailerze */
.redWord {
  color: #a30000;
}
/* ---------- 11. ZAKOŃCZENIA I STOPKA ---------- */

.endings {
  background: radial-gradient(circle at center, #111, #020202 70%);
  text-align: center;
}

.endCard {
  max-width: 800px;
}

.endCard h2 {
  font-size: clamp(35px, 6vw, 75px);
}

.endCard p {
  margin: 30px 0;
  color: #777;
  font-size: 20px;
  line-height: 1.7;
}

.pill {
  display: inline-block;
  border: 1px solid #333;
  padding: 10px 18px;
  font: 10px Arial, sans-serif;
  letter-spacing: 3px;
  color: #666;
}

footer {
  padding: 60px 7%;
  background: #020202;
  text-align: center;
  color: #444;
  font: 10px Arial, sans-serif;
  letter-spacing: 3px;
}

/* ---------- 12. EFEKT GLITCH (dodawany na <body> przez JS) ---------- */

.glitch {
  animation: glitch 0.25s 2;
}

@keyframes glitch {
  0%   { transform: translate(0); }
  25%  { transform: translate(7px, -2px); }
  50%  { transform: translate(-5px, 3px); }
  75%  { transform: translate(3px, 0); }
  100% { transform: translate(0); }
}

/* ---------- 13. RESPONSYWNOŚĆ ---------- */

/* Tablety i małe laptopy */
@media (max-width: 900px) {
  section {
    padding: 100px 6%;
  }

  .navlinks {
    gap: 14px;
    font-size: 10px;
    letter-spacing: 1px;
  }
}

/* Telefony */
@media (max-width: 700px) {
  .interactive {
    height: 350px;
  }

  .shard {
    width: 90px;
    height: 62px; /* mniejsze odłamki, żeby się nie nakładały */
  }

  .chapter {
    min-height: 220px;
  }

  h1 {
    letter-spacing: -2px; /* ujemny odstęp 5px na małym ekranie sklejał litery */
  }

  .cta {
    padding: 14px 22px;
    letter-spacing: 3px;
  }

  .enter {
    padding: 12px 20px;
    letter-spacing: 3px;
  }

  .floorplan {
    letter-spacing: 2px;
  }
    /* --- Menu rozwijane (hamburger) --- */
  .navToggle {
    display: block;
  }

  /* Lista linków jako panel pod paskiem nawigacji, domyślnie schowany */
  .navlinks {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px 5% 18px;
    background: rgba(5, 5, 5, 0.97);
    border-top: 1px solid #222;
    font-size: 13px;
    letter-spacing: 3px;
  }

  /* Po kliknięciu w hamburger JS dodaje klasę "open" */
  nav.open .navlinks {
    display: flex;
  }

  .navlinks a {
    padding: 16px 0;
    border-bottom: 1px solid #1a1a1a;
  }

  /* --- Mniejsze odstępy między sekcjami --- */
  section {
    min-height: auto;            /* było: 100vh – to robiło te wielkie puste przestrzenie */
    padding: 100px 6% 70px;       /* góra 70px, bo menu jest na wierzchu */
  }

  .hero {
    min-height: 100vh;           /* pierwszy ekran nadal na całą wysokość */
  }

  .trailer {
    min-height: auto;
  }

  .sectionTitle {
    margin-bottom: 30px;
  }

  .story p {
    margin: 12px 0;
  }
}



/* Użytkownicy z włączoną opcją „ogranicz animacje” w systemie */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll,
  .glitch {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
