:root {
    --primary: #495057;
    --dark: #2c3e50;
    --light: #f8f9fa;
  }

  body {
    font-family: 'Montserrat', sans-serif;
    background: var(--light);
    color: #333;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    position: relative;
  }

  html, body {
    overflow-x: hidden;
  }

  .right {
    margin-left: -0.5px;
  }

  .navbar-nav .nav-link {
    position: relative;
    color: var(--dark);
    transition: color 0.3s;
    padding-bottom: 4px;
    display: inline-block;
  }

  .navbar {
    background: transparent;
    box-shadow: none;
    border-bottom: none;
    backdrop-filter: none;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-bottom 0.3s ease;
    z-index: 1030;
  }

  .navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: none;
  }

  .navbar-collapse {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
    text-align: center;
    background: transparent !important;
    box-shadow: none !important;
    transition: none;
  }

  @media (max-width: 991.98px) {
    .navbar-collapse {
      position: fixed;
      top: 56px;
      left: 0;
      right: 0;
      z-index: 999;
      height: auto;
      overflow-y: visible;
    }

    .navbar-collapse.show .navbar-nav {
	  background: white;
	  padding: 1rem 0;
	  border-radius: 0 0 10px 10px;
	  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
	}
	.navbar-collapse.show {
	  background: white;
	  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); /* jak navbar-nav */
	  border-radius: 0 0 10px 10px;
	}
  }
@media (max-width: 991.98px) {
  .navbar-collapse.show {
    background: white;
    padding-bottom: 1rem;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  }

  .extra-mobile-links {
    padding: 0 1rem;
    background: white;
  }

  .extra-mobile-links a {
    color: var(--dark);
    text-decoration: underline dotted;
    transition: color 0.2s;
  }

  .extra-mobile-links a:hover {
    color: var(--primary);
  }
}
  .navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background-color: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease-in-out;
  }

  .navbar-nav .nav-link:hover::after,
  .navbar-nav .nav-link.active::after {
    transform: scaleX(1);
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active {
    color: var(--primary);
  }

  .split-section {
  display: flex;
  height: 80vh;
  max-height: 600px;
  overflow: hidden;
  position: relative;
  margin-top: 70px;
  gap: 0;
  flex-wrap: wrap;
}

.half {
  flex: 1 0 50%;
  background-size: auto 100%;
  background-repeat: no-repeat;
  background-position: center center;
  min-height: 100%;
}

.left {
  background-image: url("../img/left.e6ab9b9f273c.png");
  background-position: right center;
}

.right {
  background-image: url("../img/right.3ee45b08be67.png");
  background-position: left center;
}

.text-box {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  max-width: 90%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(5px);
  color: white;
  padding: 20px 24px;
  border-radius: 12px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  z-index: 2;
}

.left-text {
  left: 4%;
}

.right-text {
  right: 4%;
}

.text-box h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.text-box p {
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .split-section {
    flex-direction: row;
    flex-wrap: wrap-reverse;
    height: auto;
  }

  .half {
    width: 50%;
    height: 40vh;
    background-size: auto 100%;   /* jak na desktopie */
    background-repeat: no-repeat;
  }

  .left {
    background-position: right center; /* przyklei lewy obraz do środka */
  }

  .right {
    background-position: left center;  /* przyklei prawy obraz do środka */
  }

  .text-box {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    width: 90%;
    margin: 0.75rem auto;
    background: rgba(0, 0, 0, 0.55); /* taki jak na desktopie */
    backdrop-filter: blur(5px);
    color: white;
    padding: 20px 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
  }

  .left-text,
  .right-text {
    margin-bottom: 1rem;
    width: 90%;
  }

  .text-box h2 {
    font-size: 1.1rem;
  }

  .text-box p {
    font-size: 0.9rem;
  }
}

  .card-style {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: 0.3s;
  }

  .card-style:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(73, 80, 87, 0.15);
  }

  footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 30px 20px;
  }

  .social-icons a {
    color: white;
    margin: 0 10px;
    font-size: 20px;
    transition: color 0.3s;
    text-decoration: none;
  }

  .social-icons a:hover {
    color: var(--primary);
  }

  footer .social-icons i {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
  }

  .btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
  }

  .btn-primary:hover {
    background-color: #343a40;
    border-color: #343a40;
  }

  .spinner-border {
    border-color: var(--primary) transparent var(--primary) transparent !important;
  }

  #loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
  }

  section {
    padding: 4rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
    scroll-margin-top: 100px;
  }

  section h2 {
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
  }

  .gap-4 > .col-md-3,
  .gap-4 > .col-md-4,
  .gap-4 > .col-md-6 {
    margin-bottom: 2rem;
  }

  @media (max-width: 768px) {
    section {
      padding-top: 60px;
      padding-bottom: 60px;
    }

    section h2 {
      margin-bottom: 30px;
    }
  }

  .lang-switcher {
    display: flex;
    gap: 0.5rem;
  }

  @media (max-width: 991.98px) {
    .lang-switcher {
      justify-content: center;
      margin-top: 1rem;
    }
  }

  @media (min-width: 992px) {
    .lang-switcher {
      margin-left: 1rem;
    }
  }
  @media (min-width: 992px) {
	  .left-text {
		left: 3%;
		margin-left: 2rem;
	  }

	  .right-text {
		right: 3%;
		margin-right: 2rem;
	  }

	  .text-box {
		max-width: 360px;
		padding: 28px 32px;
		font-size: 1.05rem;
	  }

	  .text-box h2 {
		font-size: 1.4rem;
	  }

	  .text-box p {
		font-size: 1.05rem;
	  }
	}
	@media (max-width: 768px) {
	  .split-text-boxes-mobile .text-box {
		background: rgba(0, 0, 0, 0.55);
		backdrop-filter: blur(5px);
		color: white;
		padding: 16px;
		border-radius: 12px;
		box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
		font-size: 0.95rem;
		max-width: 100%;
	  }

	  .split-text-boxes-mobile .text-box h2 {
		font-size: 1.1rem;
		margin-bottom: 0.5rem;
		font-weight: 700;
	  }

	  .split-text-boxes-mobile .text-box p {
		font-size: 0.9rem;
		margin: 0;
	  }
	  .half .text-box {
		display: none;
	  }
	}
	.half.left {
	  position: relative;
	  overflow: hidden;
	}

	#matrixCanvas {
	  position: absolute;
	  top: 0;
	  left: 0;
	  width: 100%;   /* dopasowane do .half.left */
	  height: 100%;
	  z-index: 1;
	  pointer-events: none;
	  mix-blend-mode: screen; /* efekt przezroczystości na twarzy */
	}

	#glitchCanvas {
      position: absolute;
      top: 0;
      right: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      pointer-events: none;
      mix-blend-mode: screen; /* <<< najważniejsze — jak na lewej stronie */
    }

	.card-style:hover {
	  transform: translateY(-5px);
	  border-color: var(--primary);
	  box-shadow: 0 10px 20px rgba(73, 80, 87, 0.15);
	  cursor: pointer;
	}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

.lang-btn.active {
  background-color: var(--primary);
  color: white;
}
ul.list-inline.small a {
  color: inherit;
  text-decoration: underline dotted;
  margin: 0 0.5rem;
  transition: color 0.2s;
}

ul.list-inline.small a:hover {
  color: var(--primary);
}
.dropdown-menu a {
  font-size: 0.9rem;
}

.dropdown-toggle::after {
  margin-left: 0.3rem;
}
.dropdown-menu {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 0.5rem 0;
}
.dropdown-item:focus,
.dropdown-item:focus-visible {
  outline: 2px solid var(--primary); /* lub np. #495057 */
  outline-offset: 2px;
  border-radius: 4px;
  background-color: rgba(73, 80, 87, 0.1); /* lekki highlight tła */
}
.dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05); /* subtelny efekt jak na navbarze */
  color: var(--primary); /* podkreślenie koloru jak reszta nav-linków */
}
.project-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 12px;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.project-thumb {
  height: 180px;
  object-fit: cover;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.project-thumb.placeholder {
  background: #f8f9fa;
  height: 180px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
/* === MOBILE NAVBAR — brand left / lang center / burger right + fixed spacing === */
@media (max-width: 991.98px) {

  .navbar {
    padding-top: 0.8rem;        /* przywraca odstęp pionowy */
    padding-bottom: 0.8rem;
    min-height: 60px;           /* zapobiega spłaszczeniu po absolute */
  }

  .navbar .container {
    position: relative;         /* anchor dla elementów absolutnych */
  }

  /* LEWO — Walery */
  .navbar-brand {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1060;
    white-space: nowrap;
  }

  /* PRAWO — Burger */
  .navbar-toggler {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1070;
  }

  /* ŚRODEK — EN / PL */
  .lang-switcher.d-lg-none {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1055;
    display: flex;
    gap: 0.4rem;
  }

  /* przyciski językowe — aby nie rozpychały navbaru */
  .lang-switcher.d-lg-none .lang-btn {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    min-width: 38px;
    text-align: center;
  }

  /* rozwinięte menu nad treścią, ale pod togglerem */
  .navbar-collapse {
    z-index: 1040;
  }
}
