/* ---------- Bazowe ---------- */
:root { --gutter: 24px; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; min-width: 320px; }

body {
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  color: #111;
  background: #fff;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

.container {
  width: 60vw;           /* ~1/5 tła po lewej i prawej */
  margin: 0 auto;
  max-width: 1400px; /* limit, np. 1200–1400px */
}

@media (max-width: 1024px) {
  .container { width: 90vw; }  /* na małych ekranach pełniej */
}

/* ---------- Preloader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.4s ease;
}
#preloader.hide {
  opacity: 0;
  pointer-events: none;
}

.loading-bar {
  position: absolute;
  top: 50%;              /* środek pionowo */
  left: 50%;             /* środek poziomo */
  transform: translate(-50%, -50%); /* wycentrowanie */
  width: 200px;
  height: 6px;
  background: #ddd;       /* szary pasek */
  overflow: hidden;
  
  opacity: 0;            /* ukryty na początku */
  transition: opacity 0.3s ease;
}

.loading-bar.visible {
  opacity: 1;            /* klasa nadaje widoczność */
}

/* Zielony wskaźnik */
.loading-progress {
  width: 60px;            /* długość zielonego fragmentu */
  height: 100%;
  background: #008d36;
  animation: bounce 1.4s ease-in-out infinite;
}

/* animacja – odbijanie się prawo-lewo */
@keyframes bounce {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(140px); } /* 200 - 60 = 140 */
  100% { transform: translateX(0); }
}

#transition {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 20000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
}

/* gdy aktywny */
#transition.active {
  opacity: 1;
  visibility: visible;
}

/* ---------- Header ---------- */
header {
  position: fixed; top: 0; left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.06);
  z-index: 1000;
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
  transition: padding .2s ease;
}

#header.shrink .header-inner { padding: 12px 0; }

.logo {
  display: inline-block;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: .5px;
}

.logo a {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: .5px;
}

.logo .rest,
.logo .surname {
  position: relative;
  top: 0.01em;  /* eksperymentuj: 0.05–0.1em */
}

.logo span {
  line-height: 1;         /* usuwamy różnice w pionie */
  vertical-align: bottom;
  display: inline-block;
}

.logo .dot {
  color: #008d36;
}

/* ukryte na start */
.logo .name,
.logo .surname {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  display: inline-block;
  transition: max-width .4s ease, opacity .3s ease;
}

/* hover → odsłaniamy po kolei */
.logo:hover .surname {
  opacity: 1;
  max-width: 500px; /* na tyle, żeby zmieścił się napis */
  transition-delay: .1s;
}

.logo:hover .name {
  opacity: 1;
  max-width: 500px;
  transition-delay: .5s;
}

/* otwarcie strony → zachowuj się jak hover */
.logo.open .surname {
  opacity: 1;
  max-width: 500px;
  transition-delay: .1s;
}

.logo.open .name {
  opacity: 1;
  max-width: 500px;
  transition-delay: .5s;
}

/* wspólny styl dla wszystkich linków w menu */
.nav a,
#overlay-menu nav a {
  position: relative;
  text-decoration: none;
  color: #111;
  font-weight: 500;
  margin-left: 28px;
  font-size: 17px;
}

/* usuwamy standardowe podkreślenie */
.nav a::after,
#overlay-menu nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;         /* odległość kreski od tekstu */
  width: 0%;
  height: 2px;
  background: #008d36;
  transition: width 0.25s ease;
}

/* hover – kreska wyjeżdża z lewej do prawej */
.nav a:hover::after,
#overlay-menu nav a:hover::after {
  width: 100%;
}

/* start: ukryte pod spodem */
.nav a {
  display: inline-block;
  transform: translateY(20px);
  opacity: 0;
}

/* animacja */
@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* klasa aktywująca animację */
.nav a.animate {
  animation: slideUp .4s ease forwards;
}

/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px; height: 20px;
  background: none; border: none;
  cursor: pointer;
  z-index: 1200;
}
.hamburger span {
  display: block;
  height: 3px; background: #111;
  border-radius: 2px;
}

/* Pokazuj hamburger zamiast nav w danych breakpointach */
@media (max-width: 1305px) {
  .nav { display: none; }
  .hamburger { display: flex; }
}

/* Overlay menu */
#overlay-menu {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center; 
  justify-content: center;
  opacity: 0; 
  visibility: hidden;
  transition: opacity .2s ease;
  z-index: 1500;
}
#overlay-menu.open {
  opacity: 1; visibility: visible;
}

#overlay-menu.closing {
  opacity: 0; visibility: visible; /* widoczny, ale wygaszany */
}

#overlay-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  justify-content: center;
  text-align: center;
  width: 100%;
}

#overlay-menu nav a {
  font-size: 28px;
  color: #111;
  opacity: 0;
  animation: fadeIn .2s forwards;
  text-align: center;    /* wycentrowany tekst */
  display: block;        /* zamiast inline — blok idealnie centruje */
  width: max-content;    /* dopasuj szerokość do tekstu */
  margin: 0 auto;        /* i wycentruj na osi */
}
#overlay-menu.open nav a:nth-child(1) { animation-delay: .05s; }
#overlay-menu.open nav a:nth-child(2) { animation-delay: .1s; }
#overlay-menu.open nav a:nth-child(3) { animation-delay: .15s; }
#overlay-menu.open nav a:nth-child(4) { animation-delay: .2s; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Close button */
.close-menu {
  margin-top: 40px;
  font-size: 32px;
  background: none; border: none;
  cursor: pointer;
  color: #111;
  display: block;
}

main { padding-top: 100px; flex: 1; }

img {
  max-width: 100%;
  height: auto;
}

/* ---------- Galeria: masonry ---------- */
.gallery {
  column-count: 2;      /* zawsze dwie kolumny */
  column-gap: var(--gutter);    /* równe odstępy między kolumnami */
}

.gallery img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 0 var(--gutter);
  border-radius: 8px;
  break-inside: avoid; 

  /* efekt powiększenia w ramce */
  transition: transform .25s ease;
  clip-path: inset(0 round 8px);
  cursor: zoom-in;
}

.gallery img:hover { transform: scale(1.03); }
.gallery img:active { transform: scale(1.02); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.9);
  display: flex;
  align-items: center; justify-content: center;
  padding: 2rem;
  z-index: 2000;
  cursor: zoom-out;
  
  opacity:0; visibility:hidden;
  transition: opacity .2s ease;
}

.lightbox.open { 
  display: flex; 
  opacity: 1;
  transform: scale(1);
  visibility:visible;
}

.lightbox.closing{
  opacity:0; visibility:visible; /* widoczny ale wygaszamy */
}

.lightbox img { 
  max-width: 90vw; 
  max-height: 90vh; 
  width: auto; 
  height: auto; 
  border-radius: 6px;
  opacity:0; transform:scale(.95);
  transition:opacity .3s ease, transform .3s ease;
}

.lightbox.open img{
  opacity:1; transform:scale(1); 
}

.lightbox button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  padding: 0 20px;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index:2100;
}
.lightbox button:hover { opacity: 1; }
.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

/* ---------- Work ---------- */

.work-gallery {
  margin: 60px auto;
  width: 60vw;   /* proporcje jak w portfolio */
  max-width: 1200px;
  min-width: 320px;   /* nie pozwala się rozsypać */
}

.work-gallery h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
  display: inline-block;
  position: relative;
}

.work-gallery h2 a {
  text-decoration: none;
  color: #111;
  position: relative;
  display: inline-block;
  padding-bottom: 3px;
}

.work-gallery h2 a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: #008d36;
  transition: width 0.3s ease;
}

.work-gallery:hover h2 a::after {
  width: 100%;
}

.gallery-slider {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.slides {
  display: flex;
  gap: 12px;
  transition: transform 0.3s ease;
}

.slides img {
  height: 280px;       /* zawsze stała wysokość */
  width: auto;         /* proporcje */
  flex: 0 0 auto;      /* NIE elastyczny */
  border-radius: 8px;
  cursor: pointer;
  object-fit: cover;   /* przycięcie zamiast ściskania */
}

.wg-content {
  transition: transform .3s ease;
  transform-origin: left center;
  will-change: transform;
}

/* Strzałki */
.gallery-controls {
  margin-top: 10px;
  text-align: center;
}

.gallery-controls button {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  margin: 0 12px;
  opacity: 0.7;
  transition: color 0.2s, opacity 0.2s;
  font-weight: 300; /* cieńszy wygląd */
}

.gallery-controls button:hover {
  opacity: 1;
  color: #008d36;
}

/* --- About --- */
.about {
  padding-top: 120px; /* pod nagłówek */
}

.about-inner {
  display: flex;
  gap: 40px;
  width: 60vw;
  margin: 0 auto;
  align-items: center;   /* środek w pionie */
  justify-content: center; /* środek w poziomie */
}

.about-photo img {
  width: 100%;
  max-width: 300px; /* połowa szerokości zdjęcia z portfolio */
  height: auto;
  border-radius: 8px;
}

.about-text {
  display: inline-block;
  font-size: 18px;
  line-height: 1.6;
  color: #111;
  text-align: left;
}

/* --- Sekcja kontaktu --- */
.contact {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  width: 60vw;
  margin: 100px auto;
  align-items: flex-start;
}

#typing {
  color: #008d36 !important;
  font-size: 32px !important;
  font-weight: 800 !important;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.cursor {
  display: inline-block;
  margin-left: 2px;
  font-weight: 300;
  animation: blink 1.05s step-end infinite;
  color: #008d36;
  height: 1em; 
  position: relative;
  bottom: 3px;  
}

@keyframes blink {
  50% { opacity: 0; }
}

.contact-left, .contact-right {
  flex: 1;
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* animacje wejścia */
.contact-left.show {
  opacity: 1;
  transform: translateY(0);
}

.contact-right.show {
  opacity: 1;
  transform: translateY(0);
  transition-delay: .2s;
}

/* teksty */
.contact-left .intro {
  margin-bottom: 20px;
  font-size: 16px;
}

.contact-left .email {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
}

.contact-left .address {
  margin-bottom: 20px;
  color: #444;
}

/* email */
.email {
  position: relative;
  cursor: pointer;
  display: inline-block;
  font-size: clamp(16px, 2vw, 24px);
  text-align: center;
  white-space: nowrap; 
  margin: 0;
}

.contact-left {
  display: flex;
  flex-direction: column;
  align-items: center;   /* wyśrodkowanie w poziomie */
  text-align: center;    /* teksty też centralnie */
}

/* pseudo-element jest zawsze, tylko niewidoczny */
.email::after {
  content: "COPIED";
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: 6px;
  font-size: 12px;
  color: #008d36;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;

  opacity: 0;
  transform: translateY(-50%) translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* aktywacja */
.email.copied::after {
  opacity: 1;
  transform: translateY(-50%) translateY(0);
}

/* ikony socjalne */
.contact-left .socials {
  display: flex;
  gap: 16px;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.contact-left.show .socials {
  opacity: 1;
  transform: translateY(0);
  transition-delay: .4s;
}

.contact-left .socials img {
  width: 28px;
  height: auto;
  filter: grayscale(100%);
  transition: filter .2s ease;
}

.contact-left .socials img:hover {
  filter: grayscale(0%);
}

/* ikony: wejście po kolei */
.contact-left .socials{ display:flex; gap:16px; margin-top:14px; }
.contact-left .socials a{ opacity:0; transform:translateY(-10px); }
.contact-left.show .socials a{ animation: rise .45s ease forwards; }
.contact-left.show .socials a:nth-child(1){ animation-delay: .75s; }
.contact-left.show .socials a:nth-child(2){ animation-delay: 1s; }
.contact-left.show .socials a:nth-child(3){ animation-delay: 1.25s; }
@keyframes rise{ to{ opacity:1; transform:translateY(0);} }

/* formularz */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 15px;
  resize: vertical;
}

.contact-form button {
  background: #111;
  color: #fff;
  padding: 12px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  transition: background .3s ease;
}

.contact-form button:hover {
  background: #008d36;
}

@media (max-width: 1200px) {
  .contact {
    flex-direction: column;  /* zmiana na jedną kolumnę */
    align-items: center;
    text-align: center;
  }
  
  @media (max-width: 580px) {
  .email {
    font-size: 19px !important;
  }
}

  .contact-left, .contact-right {
    width: 100%;
  }

  .contact-right {
    margin-top: 32px; /* odstęp pod sekcją tekstową */
  }
}

/* --- Animacje wejścia --- */
.fade-in {
  opacity: 0;
  transform: translateY(-40px);
  animation: slideIn 0.6s ease forwards;
}

.fade-in.delay-0 { animation-delay: 0s; }
.fade-in.delay-1 { animation-delay: 0.2s; }

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- responsywność --- */
@media (max-width: 768px) {
  .about-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .about-photo img {
    max-width: 200px;
    margin-bottom: 20px;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 12px; /* zamiast 24px */
  }
}

@media (max-width: 400px) {
  :root {
    --gutter: 8px; /* jeszcze ciaśniej */
  }
}

/* ---------- Stopka ---------- */
footer { background: #f5f5f5; margin-top: 48px; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  flex-direction: column;
}

.socials img { width: 30px; height: auto; margin: 0 10px; }

.socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.copy { justify-self: flex-start; color: #555; font-size: 14px; }
