/* ========================================
   MAIN.CSS - Layout, Navigation, Base
======================================== */

/* Reset + zmienne + bazowe */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, p {
  margin: 0 0 .75rem 0;
}

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

:root {
  /* Paleta zgodna z projektem */
  --red: #a01f2c;
  --black: #000;
  --white: #fff;
  --gray-1: #ececec;
  --gray-2: #dadada;

  --bg: var(--white);
  --bg-soft: #f7f7f7;
  --ink: var(--black);
  --ink-dim: #222;

  --container: 1200px;
  --radius: 18px;
  --pad: clamp(16px, 2.2vw, 32px);
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

body {
  font-family: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* Papierowy gradient tła */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 40% at 20% 10%, rgba(0, 0, 0, .03), transparent 70%),
    radial-gradient(50% 35% at 80% 20%, rgba(0, 0, 0, .035), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.no-js .js-only {
  display: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Header / Nav */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  backdrop-filter: saturate(140%) blur(8px);
  background: color-mix(in lab, var(--bg), transparent 35%);
  border-bottom: 1px solid var(--gray-1);
  transition: min-height .3s ease, padding .3s ease;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  transition: min-height .3s ease;
}

.nav.nav--compact {
  min-height: 45px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand__logo {
  height: 22px;
  width: auto;
  transition: height .3s ease;
}

.nav--compact .brand__logo {
  height: 20px;
}

.nav__links {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav__links a {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  color: #333;
  border: 1px solid transparent;
  font-size: .85rem;
  transition: all .3s ease;
}

.nav--compact .nav__links a {
  padding: 6px 10px;
  font-size: .8rem;
}

.nav__links a[aria-current="true"],
.nav__links a:hover {
  background: var(--gray-1);
  border-color: var(--gray-2);
}

.nav__links .home-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Progress bar */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--red);
  width: 0;
  z-index: 100;
}

/* Main content */
main {
  isolation: isolate;
  padding-top: 50px;
}

/* Grid system */
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}

.grid.cols-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .grid.cols-2 {
    grid-template-columns: 1.1fr .9fr;
  }
}

/* Footer */
footer.site-footer {
  padding-block: 48px;
  background: #fff;
  border-top: 1px solid var(--gray-1);
}

.foot-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .foot-grid {
    grid-template-columns: 1.2fr .8fr;
  }
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(192, 14, 14, .25);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: all .3s ease;
  transform: translateY(10px);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(192, 14, 14, .35);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.skip-link {
  position: fixed;
  left: var(--pad);
  top: 10px;
  translate: 0 -120%;
  transition: translate .2s ease;
  background: #000;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 200;
}

.skip-link:focus {
  translate: 0 0;
}

/* Mobile Menu */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  z-index: 100;
  position: relative;
}

.hamburger i {
  font-size: 28px;
  color: #333;
  transition: all 0.3s ease;
  position: absolute;
}

.hamburger .hamburger-icon {
  opacity: 1;
  visibility: visible;
  transform: rotate(0deg) scale(1);
}

.hamburger .close-icon {
  opacity: 0;
  visibility: hidden;
  transform: rotate(90deg) scale(0.8);
}

.hamburger.active .hamburger-icon {
  opacity: 0;
  visibility: hidden;
  transform: rotate(-90deg) scale(0.8);
}

.hamburger.active .close-icon {
  opacity: 1;
  visibility: visible;
  transform: rotate(0deg) scale(1);
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #333;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(-10px);
}

.mobile-menu.active .mobile-menu__close {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.mobile-menu__close:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-2px) rotate(90deg);
}

.mobile-menu__close:hover i {
  color: #fff;
}

.mobile-menu__close i {
  font-size: 24px;
  color: #333;
  transition: color 0.3s ease;
}

.mobile-menu__links {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
  padding: 2rem;
}

.mobile-menu__links a {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  padding: 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.mobile-menu.active .mobile-menu__links a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.active .mobile-menu__links a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-menu__links a:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active .mobile-menu__links a:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-menu__links a:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.active .mobile-menu__links a:nth-child(5) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-menu__links a:nth-child(6) { transition-delay: 0.35s; }
.mobile-menu.active .mobile-menu__links a:nth-child(7) { transition-delay: 0.4s; }

.mobile-menu__links a:hover,
.mobile-menu__links a[aria-current="true"] {
  background: var(--gray-1);
  color: var(--red);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 767.98px) {
  .hamburger {
    display: flex;
    margin-left: auto;
  }

  .nav__links {
    display: none;
  }

  body.menu-open {
    overflow: hidden;
  }
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .nav__links {
    gap: 2px;
  }
  
  .nav__links a {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
}

/* Reveal animations support */
[data-reveal] {
  opacity: 1;
  transform: none;
}

[data-parallax] {
  will-change: transform;
}

.rw-fly {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  font-size: 32px;
  line-height: 40px;
  text-align: center;
  pointer-events: none;
  z-index: 999999;
}


