.about-us-content {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-top: 2em;
}
.about-us-text {
    flex: 1.2;
    font-size: 1.1rem;
    line-height: 1.8;
}
.about-us-text .cta-link {
    display: inline-block;
    margin-top: 25px;
    font-weight: 700;
    position: relative;
    padding-bottom: 3px;
}
.about-us-text .cta-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent-primary);
    transition: width 0.3s ease;
}
.about-us-text .cta-link:hover::after {
    width: 100%;
}
.about-us-image-placeholder {
    flex: 0.8;
    max-width: 450px;
    transition: transform .35s ease, box-shadow .35s ease;
    position: relative;
    overflow: visible;
}
.about-us-image-placeholder img {
    width: 100%;
    border-radius: var(--border-radius-main);
    box-shadow: 0 12px 35px rgba(0,0,0,0.12);
    transition: transform 0.4s ease, box-shadow 0.4s ease, filter 0.4s ease;
}
.about-us-image-placeholder img:hover {
    transform: scale(1.08);
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    filter: brightness(1.12);
}
.about-us-image-placeholder:hover {
  transform: translateY(-4px) scale(1.03);
}
.about-us-image-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-main);
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
      to bottom,
      rgba(122, 45, 242, 0.08) 0%,
      rgba(122, 45, 242, 0.35) 25%,
      rgba(122, 45, 242, 0.75) 65%,
      rgba(122, 45, 242, 0.85) 100%
  );
  filter: blur(18px);
  transform: translateY(8px) scale(1.02);
  opacity: 0;
  transition: opacity .35s ease;
}
.about-us-image-placeholder:hover::after {
  opacity: 1;
}

.services-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 40px);
  margin-top: 2em;
  width: 100%;
  box-sizing: border-box;
}
.service-item{
  background-color: rgba(255,255,255,0.03);
  padding: 40px 30px;
  border-radius: var(--border-radius-main);
  text-align: center;
  transition:
    transform 0.4s cubic-bezier(0.175,0.885,0.32,1.275),
    box-shadow 0.4s cubic-bezier(0.175,0.885,0.32,1.275),
    background-color 0.35s ease;
  border: 1px solid rgba(var(--color-accent-primary-rgb), 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.service-item .service-icon{
  width: 64px;
  height: 64px;
  border: 1px solid var(--color-accent-primary);
  background-color: transparent;
  margin: 0 auto 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-primary);
  font-size: 1.5rem;
  transition: background-color .3s ease, transform .3s ease, color .3s ease, border-color .3s ease;
}
.service-item:hover{
  transform: translateY(-18px) scale(1.02);
  box-shadow: 0 22px 45px rgba(var(--color-accent-primary-rgb), 0.4);
  background-color: rgba(var(--color-accent-primary-rgb), 0.1);
}
.service-item:hover .service-icon{
  background-color: var(--color-accent-secondary);
  border-color: var(--color-accent-secondary);
  color: var(--color-base-dark);
  transform: scale(1.15) rotate(12deg);
}
.service-item h3{
  font-size: 1.5rem;
  margin-bottom: 15px;
}
.service-item p{
  font-size: 0.95rem;
  margin-bottom: 25px;
  line-height: 1.7;
  flex-grow: 1;
}
.service-link{
  font-weight: 700;
  color: var(--color-accent-secondary);
  display: inline-block;
  padding: 5px 0;
  margin-top: auto;
}

.portfolio-grid-intro{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 2em;
}
.portfolio-item-intro{
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-main);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: block;
  aspect-ratio: 16/10;
  transition: transform .4s ease, box-shadow .4s ease;
}
.portfolio-item-intro:hover{
  transform: translateY(-15px) scale(1.05);
  box-shadow: 0 25px 55px rgba(var(--color-accent-primary-rgb), .45);
}
.portfolio-item-intro img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.25,.8,.25,1);
}
.portfolio-item-intro:hover img{ transform: scale(1.1); }
.portfolio-item-overlay{
  position: absolute; inset: 0 auto auto 0;
  width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top,
              rgba(var(--color-accent-primary-rgb), .95) 0%,
              rgba(var(--color-accent-primary-rgb), .65) 50%,
              transparent 100%);
  padding: 25px; color: #fff; box-sizing: border-box;
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s cubic-bezier(.25,.8,.25,1),
              transform .4s cubic-bezier(.25,.8,.25,1);
}
.portfolio-item-intro:hover .portfolio-item-overlay{
  opacity: 1; transform: translateY(0);
}
.portfolio-item-overlay h3{ font-size: 1.4rem; margin: 0 0 5px; color: #fff; }
.portfolio-item-overlay p{ font-size: .85rem; margin: 0; line-height: 1.5; opacity: .9; }

.purple-outline-cta {
  background-color: rgba(var(--color-accent-primary-rgb), 0.08);
  border: 1px solid var(--color-accent-primary);
  color: var(--color-text-light);
  box-shadow: 0 0 12px rgba(var(--color-accent-primary-rgb), 0.2);
  transition: all 0.25s ease-out;
}
.purple-outline-cta:hover {
  transform: translateY(-3px);
  color: var(--color-text-light);
  background-color: rgba(var(--color-accent-primary-rgb), 0.2);
  box-shadow: 0 6px 20px rgba(var(--color-accent-primary-rgb), 0.4);
}

#playGameButton {
  padding-block: 13px;
  padding-inline: 30px;
  box-sizing: border-box;
}

#gamePopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    pointer-events: none;
}
#gamePopup.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 999;
    pointer-events: auto;
}

.carousel-wrapper {
    min-height: 400px; 
    display: block;
    position: relative;
    width: 80%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 50px;
}
.carousel {
    width: 100%;
    height: 360px;
    position: relative;
    overflow: visible;
}
.thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    min-height: 60px;
}

@media (max-width: 640px){
  .services-grid{
    grid-template-columns: 1fr;
  }
  .service-item{
    padding: 28px 22px;
  }
  .service-item .service-icon{
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
  }
  .portfolio-grid-intro{
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 1.5em;
  }
  .portfolio-item-intro{
    aspect-ratio: 16/10;
    box-shadow: 0 8px 24px rgba(0,0,0,.28);
  }
  #playGameButton { min-height: 44px; }
}

@media (hover: none) and (pointer: coarse){
  .service-item:hover{
    transform: none;
    box-shadow: none;
    background-color: rgba(var(--color-accent-primary-rgb), 0.06);
  }
  .service-item:hover .service-icon{
    transform: none;
  }
  .portfolio-item-intro:hover{ transform: none; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
  .portfolio-item-intro:hover img{ transform: none; }
  .portfolio-item-intro:hover .portfolio-item-overlay{ opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce){
  .service-item{ transition: none; }
  .service-item .service-icon{ transition: none; }
  .portfolio-item-intro,
  .portfolio-item-intro img,
  .portfolio-item-overlay{ transition: none; }
}

@media (max-width: 768px) {
    .about-us-content {
        flex-direction: column;
    }
}

/* Mobile: prosta galeria (bez 3D obrotu) */
@media (max-width: 768px) {
  .carousel { overflow: hidden; }

  .carousel__inner {
    transform: none !important;
  }

  .carousel__item {
    position: absolute;
    inset: 0;
    transform: none !important;     /* kasuje ustawienia 3D dla ścian */
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }

  .carousel__item.is-active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ─────────────────────────────────────────────
   MOBILE: statyczna galeria (bez 3D) – FIX layout
   Desktop bez zmian
───────────────────────────────────────────── */
@media (max-width: 768px) {

  /* 1) Wyłącz strzałki na mobile */
  .carousel-arrow,
  .carousel__arrow,
  .carousel .arrow,
  .carousel .prev,
  .carousel .next {
    display: none !important;
  }

  /* 2) Ustal normalny układ kontenera */
  .carousel-wrapper,
  .carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  /* jeśli masz cień/ramki itp., zostawiamy – ważne tylko overflow */
  .carousel {
    margin: 0 auto;
  }

  /* 3) “Duży obraz” ma się mieścić i NIE nachodzić na miniatury */
  .carousel__inner {
    position: relative;
    width: 100%;
    height: auto;
    transform: none !important;
  }

  /* Uwaga: tu zakładam, że miniatury są pod karuzelą i mają własny blok.
     Jeśli miniatury są absolutnie pozycjonowane, to i tak wymusimy odstęp:
  */
  .carousel {
    padding-bottom: 92px; /* rezerwuje miejsce na miniatury (dostosujesz 80–110px) */
  }

  /* 4) Slajdy: pełny rozmiar kontenera, wycentrowane, bez przesunięć */
  .carousel__item {
    position: absolute;
    inset: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;

    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;

    transform: none !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }

  .carousel__item.is-active {
    opacity: 1;
    pointer-events: auto;
  }

  /* 5) Obraz w slajdzie: ma się skalować i NIE wychodzić poza ekran */
  .carousel__item img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: contain;
    display: block;
  }

  /* 6) Miniatury: przypnij na dół karuzeli (żeby nie nachodziły na obraz) */
  .carousel-thumbs,
  .thumbs,
  .carousel__thumbs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    width: 100%;
    z-index: 5;
  }
}

/* =========================
   GALERIA: MOBILE FIX
   Desktop bez zmian
========================= */
@media (max-width: 768px) {

  /* 1) Strzałki – to są pseudo-elementy */
  .carousel::before,
  .carousel::after {
    display: none !important;
    content: none !important;
  }

  /* 2) Duży obraz niżej (bliżej miniatur) */
  .carousel-wrapper {
    margin-top: 22px; /* zwiększ do 28–36 jeśli chcesz jeszcze niżej */
  }

  /* 3) Zmniejsz odstęp na miniatury, żeby obraz był bliżej nich */
  .carousel {
    padding-bottom: 74px !important; /* było większe – dostosuj 68–86 */
  }

  /* 4) Miniatury bliżej karuzeli */
  .thumbnails {
    bottom: 10px !important;
  }
}

/* =========================
   MINIATURY: mocniejsze active (mobile + desktop)
   ========================= */
.thumbnails .thumb.active,
.thumbnails .thumb.is-active,
.thumbnails .thumb[aria-current="true"] {
  outline: 2px solid rgba(145, 92, 255, 0.95);
  box-shadow:
    0 0 0 4px rgba(145, 92, 255, 0.25),
    0 0 22px rgba(145, 92, 255, 0.85);
  border-radius: 10px;
  transform: translateZ(0) scale(1.04);
}

/* MINIATURY – elegancki active (cienka ramka + delikatny glow) */
.thumbnails .thumb.active,
.thumbnails .thumb.is-active,
.thumbnails .thumb[aria-current="true"] {
  outline: 1px solid rgba(145, 92, 255, 0.9);
  outline-offset: 2px;
  box-shadow:
    0 0 0 1px rgba(145, 92, 255, 0.18),
    0 6px 18px rgba(145, 92, 255, 0.18);
  border-radius: 10px;
  transform: translateZ(0); /* bez powiększania – bardziej "pro" */
}

/* =========================================================
   MINIATURY – poprawka ucinania + subtelny active (desktop + mobile)
   ========================================================= */

/* 1) Kontener miniaturek: pozwól na glow/outline (nie ucinaj) */
.thumbnails {
  overflow: visible !important;
  padding: 10px 8px;             /* daje miejsce na ramkę/glow góra/dół */
}

/* 2) Miniatury: też niech nie ucinają */
.thumbnails .thumb {
  overflow: visible !important;
}

/* 3) Active: domyślnie (desktop) – delikatna ramka + subtelny cień */
.thumbnails .thumb.active,
.thumbnails .thumb.is-active,
.thumbnails .thumb[aria-current="true"] {
  outline: 1px solid rgba(145, 92, 255, 0.85);
  outline-offset: 2px;
  box-shadow:
    0 0 0 1px rgba(145, 92, 255, 0.14),
    0 8px 18px rgba(25, 18, 52, 0.18);
  border-radius: 10px;
  transform: translateZ(0);
}

/* =========================================================
   MOBILE – subtelniej + brak ucinania + marginesy obrazu + usuń nakładkę
   ========================================================= */
@media (max-width: 768px) {

  /* A) jeszcze subtelniej active na mobile */
  .thumbnails .thumb.active,
  .thumbnails .thumb.is-active,
  .thumbnails .thumb[aria-current="true"] {
    outline: 1px solid rgba(145, 92, 255, 0.65);
    outline-offset: 2px;
    box-shadow:
      0 0 0 1px rgba(145, 92, 255, 0.10),
      0 6px 14px rgba(25, 18, 52, 0.14);
  }

  /* B) Na mobile miniatury często siedzą “za nisko” – daj im przestrzeń */
  .thumbnails {
    padding: 12px 10px 16px !important; /* dół większy, żeby nie ucinało */
    overflow: visible !important;
  }

  /* C) Duża grafika ma nie dochodzić do krawędzi ekranu */
  .carousel {
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
  }

  .carousel__item img {
    border-radius: 16px; /* zostaje estetyka, ale obraz ma margines przez padding */
  }

  /* D) Usuń białą zaokrągloną nakładkę pod obrazem na mobile
     (u Ciebie to najpewniej pseudo-element .carousel::after / ::before lub wrapper shadow) */
  .carousel::before,
  .carousel::after {
    display: none !important;
    content: none !important;
  }

  /* jeśli ta nakładka jest na wrapperze, to wyłącz też tu */
  .carousel-wrapper::before,
  .carousel-wrapper::after {
    display: none !important;
    content: none !important;
  }
}

/* =========================================================
   GALERIA – poprawki MOBILE (bez zmian na desktop)
========================================================= */
@media (max-width: 768px) {

  /* 1) Zmniejsz pustkę między dużą grafiką a miniaturami */
  .carousel {
    padding-bottom: 44px !important;   /* było za duże – zmniejsza “zielone” */
    margin-bottom: 0 !important;
  }

  /* miniatury podciągnij bliżej obrazu */
  .thumbnails {
    margin-top: 6px !important;        /* jeśli masz większe – zredukuj */
  }

  /* 2) Usuń białą, zaokrągloną “płytkę” pod obrazem (to siedzi na .carousel) */
  .carousel {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
  }
  /* gdyby było zrobione pseudo-elementem */
  .carousel::before,
  .carousel::after {
    display: none !important;
    content: none !important;
  }

  /* 3) Miniatury: daj przestrzeń u góry żeby nie ucinało ramki/glow */
  .thumbnails {
    overflow: visible !important;
    padding-top: 8px !important;      /* kluczowe: miniatura nie jest przy samej krawędzi */
    padding-bottom: 10px !important;
    height: auto !important;          /* zamiast sztywnego ~60px */
    align-items: center;
  }

  /* gdyby same thumby miały swoje overflow */
  .thumbnails .thumb {
    overflow: visible !important;
  }

  /* 4) Duża grafika ma mieć marginesy od krawędzi ekranu */
  .carousel {
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
  }
  .carousel__item img {
    width: 100% !important;
    height: auto !important;
    border-radius: 16px;
  }

  /* (opcjonalnie) wyłącz 3D perspektywę na mobile – niepotrzebna przy statycznym trybie */
  .carousel {
    perspective: none !important;
  }
}

/* =========================================================
   ACTIVE miniatury – subtelnie (globalnie)
========================================================= */
.thumbnails .thumb.active {
  outline: 1px solid rgba(145, 92, 255, 0.72);
  outline-offset: 2px;
  box-shadow:
    0 0 0 1px rgba(145, 92, 255, 0.10),
    0 6px 14px rgba(25, 18, 52, 0.14);
  border-radius: 10px;
}

@media (max-width: 768px) {
  section:not(.hero-section) {
    content-visibility: auto;
    contain-intrinsic-size: 800px;
  }
}
