:root {
  color-scheme: dark;
  --bg: #080c10;
  --sky: var(--bg);
  --paper: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --ink: #e7edf2;
  --ink-soft: #94a3b0;
  --grass: #3ddc84;
  --grass-deep: #22b46a;
  --violet: #8b7cf6;
  --soil: #c9a27a;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --code-bg: rgba(5, 9, 12, 0.75);
  --code-ink: #d6e2dc;
  --code-key: #7ee7a8;
  --code-val: #f5cf8a;
  --code-com: #64757f;
  --radius: 10px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  position: relative;
  isolation: isolate;
}

/* Animowane tło: dryfujące poświaty + delikatna siatka punktów */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(28vmax 28vmax at 20% 25%, rgba(61, 220, 132, 0.22), transparent 70%),
    radial-gradient(32vmax 32vmax at 80% 20%, rgba(139, 124, 246, 0.20), transparent 70%),
    radial-gradient(30vmax 30vmax at 60% 85%, rgba(34, 150, 170, 0.18), transparent 70%);
  filter: blur(20px);
  animation: drift 26s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(6vmax, -4vmax, 0) rotate(12deg) scale(1.08); }
  100% { transform: translate3d(-5vmax, 5vmax, 0) rotate(-8deg) scale(0.96); }
}

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

img { max-width: 100%; display: block; }
a { color: var(--grass); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--grass); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(61, 220, 132, 0.35); }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Nagłówek */
.site-head { padding: 18px 0; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(8, 12, 16, 0.55); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wordmark { font: 800 1.35rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.wordmark span { color: var(--grass); }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--ink); }

/* Przyciski */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  font: 600 1rem/1.2 var(--body); text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--grass), #2bc4a0);
  color: #04130b;
  box-shadow: 0 8px 28px -10px rgba(61, 220, 132, 0.6);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { color: #04130b; transform: translateY(-1px); box-shadow: 0 12px 34px -10px rgba(61, 220, 132, 0.8); }
.btn.ghost { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.3); }

/* Nagłówki */
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.025em; margin: 0; }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.05; font-weight: 800; }
h3 { font-size: 1.3rem; line-height: 1.2; font-weight: 700; }
.lead { color: var(--ink-soft); max-width: 60ch; }

section { padding: 80px 0; }
.section-head { display: grid; gap: 12px; margin-bottom: 36px; }

/* Szkło */
.glass {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

/* Blok kodu (wygląd configu) */
.cfg {
  background: var(--code-bg); color: var(--code-ink);
  border: 1px solid var(--line);
  border-radius: 14px; padding: 22px 24px;
  font: 400 0.95rem/1.75 var(--mono);
  overflow-x: auto;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.cfg .fname { display: block; color: var(--code-com); margin-bottom: 8px; }
.cfg .k { color: var(--code-key); }
.cfg .v { color: var(--code-val); }
.cfg .c { color: var(--code-com); }
.cfg .live { color: #9af0be; }

.site-foot { padding: 32px 0 48px; color: var(--ink-soft); font-size: .95rem; border-top: 1px solid var(--line); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.tag { display: inline-block; font-size: .82rem; padding: 2px 10px; border-radius: 99px; background: rgba(61, 220, 132, 0.12); color: var(--grass); border: 1px solid rgba(61, 220, 132, 0.25); font-weight: 500; }

/* Formularze w ciemnym motywie */
input, select, textarea { color-scheme: dark; }
