/* ========================================================================
   Variables
   ======================================================================== */
:root {
  /* Colors - Neon Pixel Art Theme */
  --color-background: #050816;
  --color-surface: #0b1020;
  --color-elevated: #12162a;
  --color-text: #f5f5ff;
  --color-text-muted: #a2a7d0;

  --color-primary: #ff4bcb; /* neon pink */
  --color-primary-soft: rgba(255, 75, 203, 0.12);
  --color-primary-strong: #ff8ff0;

  --color-success: #48ff9b;
  --color-warning: #ffd447;
  --color-danger: #ff3b6b;

  --gray-50: #f8fafc;
  --gray-100: #e2e8f0;
  --gray-200: #cbd5f5;
  --gray-300: #94a3b8;
  --gray-400: #6b7280;
  --gray-500: #4b5563;
  --gray-600: #374151;
  --gray-700: #1f2933;
  --gray-800: #111827;
  --gray-900: #020617;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Press Start 2P", "VT323", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.1;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.125rem; /* 2px */
  --space-2: 0.25rem;  /* 4px */
  --space-3: 0.375rem; /* 6px */
  --space-4: 0.5rem;   /* 8px */
  --space-5: 0.625rem; /* 10px */
  --space-6: 0.75rem;  /* 12px */
  --space-7: 0.875rem; /* 14px */
  --space-8: 1rem;     /* 16px */
  --space-10: 1.25rem; /* 20px */
  --space-12: 1.5rem;  /* 24px */
  --space-16: 2rem;    /* 32px */
  --space-20: 2.5rem;  /* 40px */
  --space-24: 3rem;    /* 48px */
  --space-32: 4rem;    /* 64px */
  --space-40: 5rem;    /* 80px */
  --space-48: 6rem;    /* 96px */

  /* Radius (slightly crisp but modern) */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadows (neon glow) */
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 0 18px rgba(255, 75, 203, 0.7);
  --shadow-elevated: 0 18px 45px rgba(0, 0, 0, 0.75);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 320ms ease-out;

  /* Layout */
  --layout-max-width: 1120px;
  --layout-gutter: var(--space-16);

  /* Focus outline */
  --focus-ring-color: rgba(255, 139, 255, 0.9);
  --focus-ring-offset: 2px;
  --focus-ring-width: 2px;
}

/* ========================================================================
   Reset / Normalize
   ======================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote,
dl, dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

input,
button,
textarea,
select {
  font: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

/* Improve text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================================================
   Base Styles
   ======================================================================== */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background:
    radial-gradient(circle at top left, rgba(255, 75, 203, 0.16), transparent 55%),
    radial-gradient(circle at bottom right, rgba(72, 255, 155, 0.16), transparent 52%),
    var(--color-background);
}

main {
  display: block;
}

/* Headings - modern with a subtle pixel-game feel */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.25rem, 4vw, 3rem);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-16);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-12);
}

h3 {
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-10);
}

h4 {
  font-size: 1.25rem;
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-8);
}

h5 {
  font-size: 1.125rem;
  margin-bottom: var(--space-6);
}

h6 {
  font-size: 1rem;
  margin-bottom: var(--space-4);
}

p {
  margin-bottom: var(--space-8);
  color: var(--color-text-muted);
}

strong, b {
  font-weight: 600;
  color: var(--color-text);
}

/* Links */
a {
  color: var(--color-primary-strong);
  text-decoration: none;
  position: relative;
  transition: color var(--transition-normal),
    text-shadow var(--transition-normal);
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  transition: transform var(--transition-normal);
}

a:hover {
  color: var(--color-primary);
  text-shadow: 0 0 8px rgba(255, 75, 203, 0.7);
}

a:hover::after {
  transform: scaleX(1);
}

a:focus-visible {
  outline: none;
}

/* Lists */
ul, ol {
  margin-left: 1.25rem;
  margin-bottom: var(--space-8);
}

li + li {
  margin-top: var(--space-2);
}

/* Code blocks */
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

pre {
  margin: 0 0 var(--space-12);
  padding: var(--space-8);
  border-radius: var(--radius-md);
  background: rgba(10, 14, 35, 0.9);
  overflow-x: auto;
}

/* ========================================================================
   Accessibility & Motion
   ======================================================================== */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

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

/* ========================================================================
   Utilities
   ======================================================================== */

/* Layout container */
.container {
  width: 100%;
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
  overflow-x: hidden;
}

@media (max-width: 640px) {
  .container {
    padding-inline: var(--space-8);
  }

  /* Prevent text overflow */
  h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* Prevent wide elements */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  pre, code {
    max-width: 100%;
    overflow-x: auto;
  }
}

/* Flex helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-xs {
  gap: var(--space-4);
}

.gap-sm {
  gap: var(--space-6);
}

.gap-md {
  gap: var(--space-10);
}

.gap-lg {
  gap: var(--space-16);
}

/* Grid helpers */
.grid {
  display: grid;
}

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-10);
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Simple spacing utilities for sections */
#main-content {
  overflow-x: hidden;
  width: 100%;
}

.section {
  overflow-x: hidden;
  width: 100%;
  padding-block: var(--space-32);
}

.section-tight {
  padding-block: var(--space-20);
}

/* ========================================================================
   Components
   ======================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 52%),
    linear-gradient(135deg, #ff4bcb 0%, #ff8ff0 40%, #48ff9b 100%);
  color: #050816;
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background-position var(--transition-fast);
  background-size: 160% 160%;
  background-position: 0% 50%;
}

.btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: var(--shadow-elevated), var(--shadow-strong);
  filter: brightness(1.05);
  background-position: 100% 50%;
}

.btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-soft);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(9, 12, 33, 0.9);
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(140, 160, 255, 0.16);
}

.btn-secondary:hover {
  background: rgba(23, 28, 64, 0.98);
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Inputs */
.input,
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 8, 22, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  outline: none;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

.input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 1px rgba(255, 75, 203, 0.7), 0 0 18px rgba(255, 75, 203, 0.35);
  background: rgba(9, 12, 33, 0.98);
}

.input[aria-invalid="true"],
.input--error {
  border-color: var(--color-danger);
}

/* Cards - for sections like opisy, FAQ, galerie */
.card {
  position: relative;
  padding: var(--space-16);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 60%),
    rgba(7, 10, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from 180deg,
    rgba(255, 75, 203, 0.45),
    rgba(72, 255, 155, 0.3),
    rgba(91, 151, 255, 0.4),
    rgba(255, 75, 203, 0.45)
  );
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.card:hover::before {
  opacity: 0.25;
}

.card-header {
  margin-bottom: var(--space-10);
}

.card-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

.card-meta {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.card-body {
  font-size: var(--font-size-sm);
}

/* Tag / pill for categories like FAQ, poradnik, aktualności */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.175rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(5, 8, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

/* FAQ accordion basic base style hook */
.accordion-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 10, 30, 0.95);
}

.accordion-header {
  padding: var(--space-10) var(--space-12);
}

.accordion-body {
  padding: 0 var(--space-12) var(--space-12);
  color: var(--color-text-muted);
}

/* Responsive helpers for hero / gallery sections */
.hero {
  padding-block: var(--space-40);
}

@media (max-width: 768px) {
  .hero {
    padding-block: var(--space-32);
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--space-10);
}

/* Minimal pixel-style accent (for separators) */
.pixel-line {
  position: relative;
  height: 3px;
  background-image: linear-gradient(90deg, #ff4bcb, #ff8ff0, #48ff9b, #5b97ff);
  image-rendering: pixelated;
}

.pixel-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background-size: 8px 3px;
  mix-blend-mode: screen;
}

/* Footer base */
.footer {
  padding-block: var(--space-20);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer a {
  font-size: inherit;
}

/* Store buttons */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-top: var(--space-8);
  align-items: center;
}

.store-button {
  display: inline-block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.store-button:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

.store-button img {
  height: 40px;
  width: auto;
  max-width: 100%;
  display: block;
}

@media (max-width: 640px) {
  .store-button img {
    height: 36px;
    max-width: 140px;
  }
}
