/* Projektsopi — modernizacja warstwy prezentacji
   Zachowuje istniejące zasoby i paletę: biel, czerń, szarości oraz akcent #ada074.
*/

:root {
  --brand-accent: #ada074;
  --ink: #22211f;
  --muted: #77736d;
  --paper: #ffffff;
  --surface: #f3f3f3;
  --line: rgba(34, 33, 31, 0.12);
  --shadow-soft: 0 18px 50px rgba(34, 33, 31, 0.09);
  --shadow-card: 0 14px 32px rgba(34, 33, 31, 0.12);
  --radius: 16px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

/* Stabilny, delikatny preloader zamiast migotania starego układu. */
.preloader { background: rgba(255,255,255,.97); backdrop-filter: blur(8px); }
.preloader .item img { width: 72px; height: 72px; object-fit: contain; opacity: .8; }

.start-page {
  min-height: 680px;
  height: min(100vh, 920px);
  background-position: center;
}
.start-page .opacity { background: linear-gradient(135deg, rgba(34,33,31,.72), rgba(34,33,31,.38)); }
.start-page .content { width: min(900px, calc(100% - 48px)); }
.start-page .content .text {
  width: min(760px, 100%);
  height: auto;
  padding: 48px 24px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}
.start-page .content .text .logo {
  width: 132px;
  height: 132px;
  margin-bottom: 34px;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.24));
}
.start-page .content .text .logo img { max-width: 100%; height: auto; }
.start-page h1 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: clamp(3px, .8vw, 8px);
  font-weight: 700;
}
.start-page p {
  max-width: 620px;
  margin: 26px auto 0;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .2px;
}
.start-page hr { margin: 24px auto 0; opacity: .7; }
.start-page .content .text .read-more,
.portfolio .portfolio-margin .read-more {
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 999px;
  width: 190px;
  height: 50px;
  line-height: 50px;
  margin: 44px auto 0;
  letter-spacing: 1.6px;
  font-weight: 700;
  background: rgba(255,255,255,.06);
  transition: transform .25s ease, background-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.start-page .content .text .read-more:hover { background: var(--brand-accent); border-color: var(--brand-accent); transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,.16); }

/* Nawigacja: większy oddech, wyraźny stan aktywny i subtelne rozmycie. */
.menu {
  height: 76px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(34,33,31,.06);
  backdrop-filter: blur(14px);
}
.menu-content { width: min(1180px, calc(100% - 48px)); height: 76px; display: flex; align-items: center; justify-content: space-between; }
.menu-content .logo { width: auto; line-height: 1; font-size: 23px; letter-spacing: -.4px; }
.menu-content ul { width: auto; float: none; display: flex; align-items: center; gap: 4px; }
.menu-content li a { line-height: 76px; padding: 0 14px; font-size: 12px; letter-spacing: 1.2px; font-weight: 700; color: var(--ink); position: relative; }
.menu-content li a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 20px; height: 2px; background: var(--brand-accent); transform: scaleX(0); transform-origin: center; transition: transform .22s ease; }
.menu-content li a:hover::after, .menu-content li.active a::after { transform: scaleX(1); }
.menu-content li a:hover, .menu-content li.active a { color: var(--brand-accent); }
.menu-content li.external-link a { color: var(--brand-accent); }
.menu-content li.external-link a::before { content: "↗"; margin-right: 5px; font-size: 14px; }

.menu-media { height: 68px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); box-shadow: 0 8px 24px rgba(34,33,31,.08); }
.menu-media .menu-content { width: calc(100% - 36px); height: 68px; display: flex; align-items: center; justify-content: space-between; }
.menu-media .menu-content .logo { line-height: 1; font-size: 21px; color: var(--ink); }
.menu-media .menu-content .icon { width: 34px; height: 34px; line-height: 1; display: grid; place-items: center; }
.menu-media .menu-content .icon img { width: 24px; height: 24px; opacity: .75; }
.menu-click { background: rgba(255,255,255,.98); box-shadow: 0 18px 28px rgba(34,33,31,.1); }
.menu-click li { height: 56px; line-height: 56px; font-size: 12px; letter-spacing: 1.3px; font-weight: 700; border-bottom-color: var(--line); }
.menu-click li.external-link { color: var(--brand-accent); }

/* Sekcje: większa czytelność, bez zmiany treści. */
.offer .content, .portfolio .portfolio-margin, .contact .content { width: min(1120px, calc(100% - 48px)); }
.offer h1, .portfolio .portfolio-margin h1, .contact h1 { margin-top: 112px; font-size: clamp(26px, 3vw, 36px); letter-spacing: clamp(3px, .7vw, 6px); }
.offer hr, .portfolio .portfolio-margin hr, .contact hr { margin-top: 22px; background: var(--brand-accent); height: 3px; border-radius: 2px; }
.offer .content { overflow: visible; padding-bottom: 26px; }
.offer .column-one, .offer .column-two, .offer .column-three {
  width: calc((100% - 48px) / 3);
  height: auto;
  min-height: 290px;
  margin: 42px 8px 72px;
  padding: 34px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(34,33,31,.04);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.offer .column-one:hover, .offer .column-two:hover, .offer .column-three:hover { transform: translateY(-8px); box-shadow: var(--shadow-soft); border-color: rgba(173,160,116,.65); }
.offer .column-one .circle-one, .offer .column-two .circle-two, .offer .column-three .circle-three { width: 92px; height: 92px; border-color: rgba(173,160,116,.55); }
.offer h2 { margin-top: 30px; font-size: 17px; letter-spacing: 3px; font-weight: 700; }
.offer p { width: auto; max-width: 270px; margin: 20px auto 0; color: var(--muted); line-height: 1.8; }

.portfolio { background: var(--surface); }
.portfolio .portfolio-margin { overflow: visible; padding-bottom: 1px; }
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 54px;
  margin-bottom: 54px;
  overflow: visible;
}
.grid li { width: auto; margin: 0; border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(34,33,31,.08); }
.grid li a { display: block; height: 100%; }
.grid img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; float: none; display: block; }
.grid .text { width: 100%; height: 100%; background: rgba(173,160,116,.94); display: flex; flex-direction: column; justify-content: center; padding: 20px; box-sizing: border-box; }
.grid p { margin: 0; font-size: 16px; line-height: 1.4; }
.grid p.description { width: auto; margin-top: 12px; font-size: 12px; line-height: 1.6; }
.portfolio .portfolio-margin .read-more { border-color: var(--ink); color: var(--ink); margin-top: 34px; margin-bottom: 92px; }
.portfolio .portfolio-margin .read-more:hover { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; transform: translateY(-3px); }

.partners { height: 420px; background-position: center; }
.partners .opacity { height: 420px; background: linear-gradient(135deg, rgba(34,33,31,.72), rgba(34,33,31,.52)); }
.partners .content { width: min(1120px, calc(100% - 48px)); height: auto; }
.partners h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: 3px; font-weight: 700; }
.partners .logo { width: 100%; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 38px; }
.partners .logo a { display: grid; place-items: center; min-width: 150px; min-height: 98px; padding: 8px 15px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(255,255,255,.09); transition: transform .25s ease, background-color .25s ease; }
.partners .logo a:hover { transform: translateY(-5px); background: rgba(255,255,255,.16); }
.partners .logo img { width: 122px; height: 81px; object-fit: contain; opacity: .78; }
.partners .logo a:hover img { opacity: 1; }

.contact { margin-bottom: 0; }
.contact .content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .82fr); gap: 64px; margin: 56px auto 92px; overflow: visible; }
.contact .content .form, .contact .content .contact-text { float: none; width: auto; padding: 0; }
.contact .content .form { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.contact .content .form .column, .contact .content .form .column-2, .contact .content .form .column-3 { width: 100%; padding: 0; float: none; margin-bottom: 24px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 1.2px; }
input, textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; padding: 0 14px; margin-top: 10px; transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
input { height: 46px; }
textarea { height: 150px; padding-top: 14px; border-top: 1px solid var(--line); }
input:focus, textarea:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 4px rgba(173,160,116,.16); background: #fff; }
input.submit { width: auto; min-width: 112px; height: 42px; margin: 2px 0 0; padding: 0 22px; border: 1px solid var(--ink); border-radius: 999px; text-align: center; color: var(--ink); cursor: pointer; }
input.submit:hover { color: #fff; border-color: var(--brand-accent); background: var(--brand-accent); }
.contact .content .contact-text { color: var(--muted); line-height: 1.9; padding-top: 16px; }
.contact .content .contact-text strong { color: var(--ink); }

.footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer .logo { padding-top: 42px; }
.menu-footer { padding-top: 26px; }
.menu-footer a { display: inline-block; padding: 8px 12px; line-height: 30px; font-size: 12px; letter-spacing: .7px; }
.footer .copyright { padding: 20px 0 34px; font-size: 12px; }
.footer .up { padding: 0 0 44px; }

@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .offer .column-one, .offer .column-two, .offer .column-three { width: calc((100% - 32px) / 3); margin-left: 4px; margin-right: 4px; padding-left: 14px; padding-right: 14px; }
  .contact .content { gap: 36px; }
}

@media (max-width: 767px) {
  .start-page { min-height: 620px; height: 100svh; }
  .start-page .content { width: calc(100% - 36px); }
  .start-page .content .text { padding: 30px 0; }
  .start-page .content .text .logo { width: 108px; height: 108px; margin-bottom: 26px; }
  .start-page p { font-size: 14px; line-height: 1.65; }
  .start-page .content .text .read-more { margin-top: 30px; }
  .offer .content, .portfolio .portfolio-margin, .contact .content, .partners .content { width: calc(100% - 36px); }
  .offer h1, .portfolio .portfolio-margin h1, .contact h1 { margin-top: 76px; }
  .offer .column-one, .offer .column-two, .offer .column-three { width: 100%; margin: 28px 0 0; min-height: 0; padding: 30px 20px 18px; box-sizing: border-box; }
  .offer .column-three { margin-bottom: 46px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 38px; }
  .grid p { font-size: 14px; }
  .grid p.description { font-size: 11px; }
  .partners { height: auto; min-height: 480px; padding: 76px 0; box-sizing: border-box; }
  .partners .opacity { height: 100%; }
  .partners .content { position: relative; }
  .partners .logo { gap: 10px; margin-top: 28px; }
  .partners .logo a { min-width: 124px; min-height: 86px; padding: 4px 8px; }
  .partners .logo img { width: 106px; height: 70px; }
  .contact .content { display: flex; flex-direction: column; gap: 30px; margin-top: 38px; margin-bottom: 64px; }
  .contact .content .form { padding: 22px; }
  .contact .content .contact-text { text-align: center; padding: 0; }
  .footer .logo { padding-top: 30px; }
}

@media (max-width: 400px) {
  .grid { grid-template-columns: 1fr; }
  .start-page h1 { letter-spacing: 2px; }
  .partners .logo a { min-width: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Korekta układu ofert: trzy równe karty w jednym rzędzie na desktopie. */
.offer .content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.offer .content > h1,
.offer .content > hr,
.offer .content > p.title {
  flex-basis: 100%;
}
.offer .column-one, .offer .column-two, .offer .column-three {
  box-sizing: border-box;
  float: none;
  flex: 0 1 calc((100% - 32px) / 3);
  margin-left: 0;
  margin-right: 0;
}
@media (max-width: 1023px) {
  .offer .column-one, .offer .column-two, .offer .column-three { flex-basis: calc((100% - 24px) / 3); }
}
@media (max-width: 767px) {
  .offer .column-one, .offer .column-two, .offer .column-three { flex-basis: 100%; }
}

/* Stary overlay ładowania blokował widok przy częściowym ładowaniu bibliotek. */
.preloader { display: none; }

/* Stabilność przewijania i kafelków: bez fixed-parallax oraz bez konfliktu z pluginami. */
html { scroll-behavior: auto; }
.start-page, .partners { background-attachment: scroll; }
.menu { position: sticky; top: 0; }
.menu-media { position: sticky; top: 0; }
.grid { align-items: start; contain: layout paint; }
.grid li { position: relative; overflow: hidden; min-width: 0; }
.grid li img { max-width: 100%; }
.grid .text { position: absolute; inset: 0; }
@media (prefers-reduced-motion: reduce) {
  .grid .text, .offer .column-one, .offer .column-two, .offer .column-three { transition: none; }
}

/* Oferta: CSS Grid eliminuje odziedziczone konflikty float/flex i gwarantuje równe kolumny. */
.offer .content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 0;
  justify-content: initial;
}
.offer .content > h1,
.offer .content > hr,
.offer .content > p.title { grid-column: 1 / -1; }
.offer .column-one, .offer .column-two, .offer .column-three {
  width: auto;
  min-width: 0;
  margin: 42px 0 72px;
  float: none;
  flex: none;
}
@media (max-width: 767px) {
  .offer .content { grid-template-columns: minmax(0, 1fr); }
  .offer .column-one, .offer .column-two, .offer .column-three { margin-top: 28px; margin-bottom: 0; }
  .offer .column-three { margin-bottom: 46px; }
}

/* Finalne dopracowanie sekcji zgodnie z uwagami użytkownika. */

/* Większe kafelki portfolio bez przycinania podglądów. */
.portfolio .portfolio-margin {
  padding-top: 64px;
}
.portfolio .portfolio-margin h1 {
  margin-top: 0;
}
.grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 58px;
}
.grid li {
  display: block;
  height: auto;
}
.grid li a {
  height: auto;
}
.grid img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
}

/* Nagłówek i logotypy partnerów są centrowane względem całej sekcji/tła. */
.partners {
  background-attachment: scroll;
  display: grid;
  place-items: center;
}
.partners .content {
  position: relative;
  inset: auto;
  width: min(1120px, calc(100% - 48px));
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 56px 0;
}
.partners h2 {
  margin: 0 0 28px;
}
.partners .logo {
  margin: 0;
}

/* Czytelniejszy opis po prawej stronie formularza. */
.contact .content .contact-text {
  font-size: 16px;
  line-height: 1.95;
}

/* Stopka: przycisk powrotu ma własną przestrzeń i nie nachodzi na copyright. */
.footer .copyright {
  margin: 0;
  padding-bottom: 18px;
}
.footer .up {
  min-height: 72px;
  padding: 12px 0 40px;
  box-sizing: border-box;
}
.footer .up .myszka {
  position: relative;
  left: auto;
  bottom: auto;
  margin: 0 auto;
}

/* Wszystkie pozycje nav mają jednolity, wyśrodkowany obszar klikalny. */
.menu-content ul {
  justify-content: flex-end;
  align-items: center;
}
.menu-content li a {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.menu-content li.external-link a::before {
  content: none;
}

@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .portfolio .portfolio-margin { padding-top: 42px; }
  .grid { grid-template-columns: 1fr; gap: 16px; margin-top: 42px; }
  .partners .content {
    width: calc(100% - 36px);
    min-height: 480px;
    height: auto;
    padding: 76px 0;
  }
  .contact .content .contact-text { font-size: 15px; line-height: 1.85; }
  .menu-content li a { display: block; }
}


/* Ostateczne poprawki: sticky nav musi mieć pełny, przewijalny kontener nadrzędny. */
.container {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 100%;
}
.menu,
.menu-media {
  position: sticky;
  top: 0;
  z-index: 1000;
}
.menu {
  width: 100%;
}

/* Portfolio jako równe kolumny masonry — bez dużych pustych przerw między wierszami. */
.grid {
  display: block;
  column-count: 3;
  column-gap: 16px;
  column-fill: balance;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
  contain: none;
}
.grid li {
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  vertical-align: top;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.grid li a,
.grid li img {
  display: block;
  width: 100%;
}
.grid li img {
  height: auto;
}

/* Tło partnerów jest przewijane razem ze stroną, nigdy jako fixed attachment. */
.partners {
  background-attachment: scroll !important;
  background-position: center center;
}
.partners h2 {
  font-weight: 300;
}

/* Stopka zawsze centruje copyright niezależnie od odziedziczonych reguł. */
.footer .copyright {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

@media (max-width: 1023px) {
  .grid { column-count: 2; }
}
@media (max-width: 767px) {
  .grid { column-count: 1; }

  /* Na telefonie wskaźnik przewijania jest w normalnym przepływie hero. */
  .start-page {
    overflow: hidden;
  }
  .start-page .content {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .start-page .content .text {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
  }
  .start-page .content .myszka {
    position: relative;
    left: auto;
    bottom: auto;
    margin: 28px auto 0;
  }
}


/* Dark theme i graficzny przełącznik w navbarze. */
.theme-switch-item {
  display: flex;
  align-items: center;
  margin-left: 8px;
}
.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #fff;
  outline: none;
  transform: translateY(-1px);
}
.theme-toggle-icon {
  width: 19px;
  height: 19px;
  display: block;
  position: relative;
}
.theme-toggle-icon::before {
  content: "☾";
  position: absolute;
  inset: -4px 0 0;
  font-size: 23px;
  line-height: 24px;
  text-align: center;
}
[data-theme="dark"] .theme-toggle-icon::before { content: "☀"; }
.mobile-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.menu-media .theme-toggle {
  width: 34px;
  height: 34px;
}
.menu-media .theme-toggle-icon {
  transform: scale(.88);
}

[data-theme="dark"] {
  --ink: #f2f0eb;
  --muted: #c1bdb4;
  --paper: #1d1c1a;
  --surface: #262522;
  --line: rgba(255, 255, 255, .16);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, .28);
  --shadow-card: 0 14px 32px rgba(0, 0, 0, .34);
}
[data-theme="dark"] body {
  background: var(--paper);
  color: var(--ink);
}
[data-theme="dark"] .menu,
[data-theme="dark"] .menu-media,
[data-theme="dark"] .menu-click {
  background: rgba(29, 28, 26, .96);
  border-color: var(--line);
}
[data-theme="dark"] .menu-content li a,
[data-theme="dark"] .menu-content .logo,
[data-theme="dark"] .menu-media .logo {
  color: var(--ink);
}
[data-theme="dark"] .menu-content li a:hover,
[data-theme="dark"] .menu-content li.active a,
[data-theme="dark"] .menu-content li.external-link a {
  color: #d6c58f;
}
[data-theme="dark"] .menu-click li,
[data-theme="dark"] .menu-click a {
  color: var(--ink);
}
[data-theme="dark"] .offer,
[data-theme="dark"] .contact {
  background: var(--paper);
  color: var(--ink);
}
[data-theme="dark"] .offer .column-one,
[data-theme="dark"] .offer .column-two,
[data-theme="dark"] .offer .column-three,
[data-theme="dark"] .contact .content .form {
  background: #252421;
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}
[data-theme="dark"] .offer p,
[data-theme="dark"] .contact .content .contact-text {
  color: var(--muted);
}
[data-theme="dark"] .offer h2,
[data-theme="dark"] .contact .content .contact-text strong {
  color: var(--ink);
}
[data-theme="dark"] .portfolio {
  background: #22211f;
}
[data-theme="dark"] .grid li {
  background: #2b2a27;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
}
[data-theme="dark"] .grid img {
  background: #2b2a27;
}
[data-theme="dark"] .portfolio .portfolio-margin .read-more {
  color: var(--ink);
  border-color: var(--ink);
}
[data-theme="dark"] input,
[data-theme="dark"] textarea {
  background: #302f2b;
  color: var(--ink);
  border-color: var(--line);
}
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
  background: #383732;
}
[data-theme="dark"] input.submit {
  color: var(--ink);
  border-color: var(--ink);
}
[data-theme="dark"] .footer {
  background: #171614;
  color: var(--ink);
  border-color: var(--line);
}
[data-theme="dark"] .footer a {
  color: var(--muted);
}
[data-theme="dark"] .footer a:hover {
  color: #d6c58f;
}
[data-theme="dark"] .theme-toggle {
  color: var(--ink);
  border-color: var(--line);
}
@media (max-width: 767px) {
  .theme-switch-item {
    margin-left: 0;
  }
}


/* Dark theme: kontrast nagłówków i elementów nawigacji sekcji. */
[data-theme="dark"] .offer h1,
[data-theme="dark"] .portfolio .portfolio-margin h1,
[data-theme="dark"] .contact h1,
[data-theme="dark"] .partners h2 {
  color: #fff;
}
[data-theme="dark"] .offer hr,
[data-theme="dark"] .portfolio .portfolio-margin hr,
[data-theme="dark"] .contact hr {
  background: var(--brand-accent);
}

/* Biały logotyp stopki i czytelne wskaźniki przewijania w ciemnym motywie. */
[data-theme="dark"] .footer .logo img {
  filter: brightness(0) invert(1);
}
[data-theme="dark"] .start-page .content .myszka,
[data-theme="dark"] .footer .up .myszka,
[data-theme="dark"] .myszka {
  border-color: rgba(255, 255, 255, .9);
}
[data-theme="dark"] .start-page .scroll,
[data-theme="dark"] .footer .up .scroll2,
[data-theme="dark"] .scroll2 {
  background: rgba(255, 255, 255, .95);
}

/* Partnerzy: bardziej wyrazisty hover z unoszeniem, poświatą i efektem świetlnego przesunięcia. */
.partners .logo a {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .38s cubic-bezier(.2,.8,.2,1), box-shadow .38s ease, background-color .38s ease, border-color .38s ease;
}
.partners .logo a::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: -60%;
  left: -35%;
  width: 28%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: rotate(22deg) translateX(-220%);
  transition: transform .7s ease;
  pointer-events: none;
}
.partners .logo a:hover,
.partners .logo a:focus-visible {
  transform: translateY(-9px) scale(1.045);
  border-color: rgba(255,255,255,.62);
  background: rgba(173,160,116,.25);
  box-shadow: 0 16px 30px rgba(0,0,0,.28), 0 0 0 4px rgba(173,160,116,.18);
  outline: none;
}
.partners .logo a:hover::after,
.partners .logo a:focus-visible::after {
  transform: rotate(22deg) translateX(720%);
}
.partners .logo a img {
  position: relative;
  z-index: 1;
  transition: transform .38s cubic-bezier(.2,.8,.2,1), filter .38s ease, opacity .38s ease;
}
.partners .logo a:hover img,
.partners .logo a:focus-visible img {
  transform: scale(1.12) rotate(-2deg);
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.3));
  opacity: 1;
}
.partners .logo a.tiktok-logo {
  min-width: 180px;
}
.partners .logo a.tiktok-logo img {
  width: 160px;
  height: 88px;
  object-fit: contain;
}
@media (max-width: 767px) {
  .partners .logo a.tiktok-logo { min-width: 124px; }
  .partners .logo a.tiktok-logo img { width: 106px; height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .partners .logo a,
  .partners .logo a::after,
  .partners .logo a img { transition: none; }
}


/* Końcowe poprawki widoku mobilnego i sekcji partnerów. */
.menu-media .menu-content {
  position: relative;
}
.menu-media .mobile-actions {
  margin-left: auto;
  flex-shrink: 0;
}
.menu-media .menu-content .icon {
  float: none;
  position: relative;
  width: 34px;
  height: 34px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.menu-media .menu-content .icon a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.menu-media .menu-content .icon img {
  display: block;
  width: 24px;
  height: 24px;
  opacity: .86;
  filter: brightness(0);
}
[data-theme="dark"] .menu-media .menu-content .icon img {
  filter: brightness(0) invert(1);
}
.menu-click li a,
.menu-click li.external-link a {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  color: var(--ink);
  text-decoration: none;
}
.menu-click li.external-link,
.menu-click li.external-link a {
  color: var(--ink);
}
.menu-click li:hover a,
.menu-click li.external-link:hover a {
  color: var(--brand-accent);
}

/* Mobilny wskaźnik znajduje się bezpośrednio pod przyciskiem Portfolio. */
@media (max-width: 767px) {
  .start-page .content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    padding-top: clamp(54px, 9vh, 88px);
  }
  .start-page .content .text {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    flex: none;
    padding: 30px 0 0;
  }
  .start-page .content .text .read-more {
    margin-bottom: 0;
  }
  .start-page .content > a:last-child {
    display: block;
    flex: none;
  }
  .start-page .content .myszka {
    position: relative;
    left: auto;
    bottom: auto;
    margin: 12px auto 0;
  }
}

/* Oferta: trzy karty mają zawsze identyczną szerokość. */
.offer .content {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.offer .column-one,
.offer .column-two,
.offer .column-three {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Partnerzy bez kafelków — zostają same logotypy i subtelny hover. */
.partners .logo a,
.partners .logo a.tiktok-logo {
  min-width: 150px;
  min-height: 98px;
  padding: 8px 15px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.partners .logo a::after {
  display: none;
}
.partners .logo a:hover,
.partners .logo a:focus-visible {
  transform: scale(1.06);
  border: 0;
  background: transparent;
  box-shadow: none;
}
.partners .logo a img,
.partners .logo a.tiktok-logo img {
  transition: transform .25s ease, filter .25s ease, opacity .25s ease;
}
.partners .logo a:hover img,
.partners .logo a:focus-visible img {
  transform: scale(1.05);
  filter: drop-shadow(0 5px 10px rgba(255,255,255,.3));
  opacity: 1;
}
@media (max-width: 767px) {
  .partners .logo a,
  .partners .logo a.tiktok-logo {
    min-width: 124px;
    min-height: 86px;
    padding: 4px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .partners .logo a,
  .partners .logo a img { transition: none; }
}


/* Mobilny hero: kursor jest zakotwiczony bezpośrednio pod przyciskiem Portfolio. */
@media (max-width: 767px) {
  .start-page .content {
    display: block;
    position: relative;
    box-sizing: border-box;
    padding-top: 0;
  }
  .start-page .content .text {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(-50%);
    padding: 30px 0 0;
  }
  .start-page .content .myszka {
    position: absolute;
    top: calc(50% + clamp(180px, 30vh, 250px));
    left: 50%;
    right: auto;
    bottom: auto;
    margin: 0;
    transform: translateX(-50%);
  }
}


/* Ostateczna stabilizacja mobilnego układu — bez absolutnego pozycjonowania kursora. */
@media (max-width: 767px) {
  .start-page .content {
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
  }
  .start-page .content .text {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: auto !important;
    margin: 0;
    padding: 30px 0 0;
    transform: none;
  }
  .start-page .content .text .read-more {
    margin-top: 30px;
    margin-bottom: 0;
  }
  .start-page .content > a:last-child {
    position: relative;
    display: block;
    width: 21px;
    height: 39px;
    flex: 0 0 39px;
    margin: 14px auto 0;
  }
  .start-page .content .myszka {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: 19px;
    height: 37px;
    margin: 0;
    transform: none;
  }
  .offer .content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    width: calc(100% - 36px);
    overflow: visible;
  }
  .offer .column-one,
  .offer .column-two,
  .offer .column-three {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
  }
}


/* Mobilne menu hamburgera: rozwinięta lista pozostaje pod sticky navbar, niezależnie od scrolla. */
@media (max-width: 767px) {
  .menu-media {
    position: sticky;
    top: 0;
    z-index: 1100;
  }
  .menu-click {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    margin: 0;
    padding: 0;
    z-index: 1090;
    box-sizing: border-box;
    border-top: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(0,0,0,.14);
  }
  .menu-click li {
    width: 100%;
    box-sizing: border-box;
  }
  .menu-click li a {
    text-align: center;
  }
}


/* Płynne przejście jasny/dark theme, także w mobilnym breakpointcie. */
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
body,
.menu,
.menu-media,
.menu-click,
.menu-content .logo,
.menu-content li a,
.offer,
.portfolio,
.contact,
.footer,
.offer .column-one,
.offer .column-two,
.offer .column-three,
.contact .content .form,
.contact .content .contact-text,
.grid li,
.grid .text,
.offer h1,
.offer h2,
.offer p,
.portfolio h1,
.contact h1,
.partners h2,
.footer a,
input,
textarea,
input.submit {
  transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease;
}
.theme-toggle-icon {
  transition: transform .28s ease;
}
[data-theme="dark"] .theme-toggle-icon {
  transform: rotate(180deg);
}
[data-theme="dark"] .menu-media .theme-toggle-icon {
  transform: rotate(180deg) scale(.88);
}


/* Mobilna oferta: blokowy układ eliminuje wszystkie odziedziczone różnice szerokości. */
@media (max-width: 767px) {
  .offer .content {
    display: block !important;
    width: calc(100% - 36px) !important;
    max-width: none !important;
    overflow: visible !important;
  }
  .offer .column-one,
  .offer .column-two,
  .offer .column-three {
    display: block;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }
  .offer .column-one p,
  .offer .column-two p,
  .offer .column-three p {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }
}
