/* ===== VARIABLES & RESET ===== */
:root {
  --primary: #004cff;
  --primary-dark: #008fcc;
  --text: #fff;
  --bg-dark: rgba(0, 0, 0, 0.7);
  --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ===== BASE STYLES ===== */
html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text);
  background-color: transparent;
  height: 100%;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ===== FIX FOR HEADING WARNING ===== */
/* Explicit font sizes for semantic headings */
article h1,
aside h1,
nav h1,
section h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

.sg-offcanvas .offcanvas-title {
  font-size: 1.25rem;
  margin: 0;
}

/* Base heading styles */
h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
}

h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

/* ===== BACKGROUND SLIDESHOW ===== */
#bg-container, .bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
}

.bg-layer {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s var(--transition);
  will-change: opacity;
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
}

.bg-layer.active {
  opacity: 1;
}

/* ===== LAYOUT COMPONENTS ===== */
header {
  text-align: center;
  padding: clamp(2rem, 5vw, 3rem) 1rem;
  background: var(--bg-dark);
  position: relative;
  z-index: 1;
  animation: fadeUp 1s var(--transition) both;
}

main {
  padding: 2rem;
  position: relative;
  z-index: 1;
  animation: fadeUp 1.2s var(--transition) both;
}

section.content-section {
  max-width: min(800px, 90%);
  margin: 2rem auto;
  padding: clamp(1.5rem, 4vw, 2rem);
  background: var(--bg-dark);
  border-radius: 12px;
  animation: fadeUp 1.3s var(--transition) both;
}

footer {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-dark);
  position: relative;
  z-index: 1;
}

/* ===== HERO SECTION ===== */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: -webkit-fill-available; /* Fix iOS */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 0 clamp(1rem, 3vw, 2rem);
  overflow: hidden; /* nie pozwól wyciec wideo */
  z-index: 0; /* niżej niż zawartość i nakładka */
}

/* Wideo tła */
.hero-section .hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* wypełnij, przytnij nadmiar */
  z-index: 0; /* pod nakładką i treścią */
  pointer-events: none; /* nie blokuje interakcji */
}

/* Nakładka półprzezroczysta nad filmem, pod treścią */
.hero-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1; /* nad wideo, pod treścią */
}

/* Treść hero nad nakładką i wideo */
.hero-section .hero-content {
  position: relative;
  z-index: 2;
  max-width: min(900px, 90%);
  animation: fadeUp 0.8s var(--transition) both;
  will-change: transform, opacity; /* optymalizacja animacji */
}

/* Teksty w hero */
.hero-content h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-content h1 span {
  color: var(--primary);
  display: inline-block;
}

.hero-content p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 2rem;
  line-height: 1.6;
}

:where(h1) {
  margin-block: 0.67em;
  font-size: 2em;
}

/* ===== BUTTONS ===== */
.button-link,
.cta-button {
  display: inline-block;
  padding: clamp(0.7rem, 2vw, 0.9rem) clamp(1.3rem, 3vw, 1.8rem);
  background-color: var(--primary); /* upewnij się, że to jest pełny, nieprzezroczysty kolor */
  color: white;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s var(--transition), transform 0.2s var(--transition);
  will-change: transform; /* zamiast translateZ(0) */
}

.button-link:hover, .cta-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px) translateZ(0);
}

.button-link.back {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.button-link.back:hover {
  background: var(--primary);
  color: white;
}

/* ===== FORM STYLES ===== */
.modern-form {
  background: #fff;
  padding: clamp(2rem, 4vw, 3rem);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  max-width: min(600px, 90%);
  margin: 2rem auto;
  color: #333;
}

.form-group {
  margin-bottom: 1.5rem;
}

.modern-form label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.modern-form input,
.modern-form textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font: inherit;
  transition: 
    border-color 0.2s var(--transition),
    box-shadow 0.2s var(--transition);
}

.modern-form input:focus,
.modern-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2);
  outline: 2px solid transparent;
}

.submit-button {
  width: 100%;
  padding: 0.9rem;
}

.form-status {
  margin-top: 1rem;
  font-weight: 600;
}

.form-status.success { color: #2ecc71; }
.form-status.error { color: #e74c3c; }

/* ===== NAVIGATION ===== */
.sg-navbar {
  position: fixed;
  top: 1.2rem;
  right: clamp(1rem, 3vw, 2rem);
  z-index: 1030;
}

.sg-toggler {
  width: 46px;
  height: 40px;
  padding: 6px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  transition: 
    background 0.2s var(--transition),
    border-color 0.2s var(--transition);
  margin-left: auto;
}

.sg-toggler:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
}

.sg-offcanvas {
  background: rgba(0, 27, 61, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  width: 260px;
}

.sg-navlist .nav-link {
  font-size: 1.4rem;
  font-weight: 600;
  padding: 0.7rem 0;
  color: var(--text);
  transition: color 0.2s var(--transition);
}

.sg-navlist .nav-link:hover {
  color: var(--primary);
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
  --bar-w: 32px;
  --bar-h: 4px;
  position: fixed;
  top: 1.2rem;
  right: clamp(1rem, 3vw, 2rem);
  width: 42px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1040;
}

.hamburger span {
  display: block;
  width: 100%;
  height: var(--bar-h);
  background: var(--text);
  border-radius: 3px;
  transform-origin: center;
  transition: 
    transform 0.3s var(--transition),
    opacity 0.2s var(--transition);
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(calc(var(--bar-h) + 7px)) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(calc(-1 * (var(--bar-h) + 7px))) rotate(-45deg);
}

/* ===== UTILITY CLASSES ===== */
.highlighted-points {
  list-style-type: "✔️ ";
  padding-left: 1.2rem;
}

.call-to-action {
  text-align: center;
  margin-top: 2rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ===== MEDIA QUERIES ===== */
/* iOS Viewport Fix */
@supports (-webkit-touch-callout: none) {
  .hero-section {
    min-height: -webkit-fill-available;
  }
}

/* Windows High Contrast Mode */
@media (-ms-high-contrast: active) {
  .button-link, .cta-button {
    border: 2px solid currentColor !important;
  }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: 150vh;
  }
}

/* Tablet Optimization */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-content h1 {
    font-size: clamp(2.5rem, 4vw, 3rem);
  }
}

/* Desktop Enhancements */
@media (min-width: 1200px) {
  .sg-offcanvas {
    width: 300px;
  }
}

/* 4K Screens */
@media (min-width: 2560px) {
  :root {
    font-size: 110%;
  }
}