/* ============================================================
   SprzątanieProsto - design system
   Koncept: "Woda i świeżość" - czystość, woda, dom
   Paleta: teal #0f766e (woda, świeżość, zaufanie)
           + błękit #1d6fa5 + bursztyn #b45309 (energia, CTA)
           + krem #f6f4ee + grafit #1c2422
   Typografia: Bricolage Grotesque (display, przyjazny charakter)
               + Karla (body, humanistyczna) + Space Mono (dane)
   ============================================================ */

:root {
  --bg: #f6f4ee;
  --bg-soft: #ece8dd;
  --bg-card: #fdfcf8;
  --ink: #1c2422;
  --ink-soft: #39443f;
  --muted: #56635d;
  --accent: #0f766e;
  --accent-strong: #0b5d57;
  --accent-soft: rgba(15, 118, 110, 0.09);
  --accent-line: rgba(15, 118, 110, 0.3);
  --sky: #1d6fa5;
  --sky-soft: rgba(29, 111, 165, 0.1);
  --sky-line: rgba(29, 111, 165, 0.32);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, 0.1);
  --amber-line: rgba(180, 83, 9, 0.32);
  --border: #e3ddd0;
  --ok: #256e4b;
  --ok-bg: rgba(37, 110, 75, 0.09);
  --warn: #8a5a12;
  --warn-bg: rgba(217, 154, 25, 0.12);
  --bad: #8c2f39;
  --bad-bg: rgba(140, 47, 57, 0.08);
  --header-h: 62px;
  --sidebar-w: 290px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(28, 36, 34, 0.05), 0 4px 18px rgba(28, 36, 34, 0.05);
  --shadow-card-hover: 0 2px 4px rgba(28, 36, 34, 0.06), 0 12px 30px rgba(15, 118, 110, 0.14);
  --font-display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --font-body: "Karla", system-ui, sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;
  --transition: all 0.2s ease-out;
  --body-grad-1: radial-gradient(620px 420px at 92% -60px, rgba(15, 118, 110, 0.08), transparent 70%);
  --body-grad-2: radial-gradient(720px 520px at -10% 110%, rgba(29, 111, 165, 0.08), transparent 70%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1413;
    --bg-soft: #111a19;
    --bg-card: #16211f;
    --ink: #e7ede8;
    --ink-soft: #c3ccc6;
    --muted: #94a39c;
    --accent: #34c9bb;
    --accent-strong: #5fd8cc;
    --accent-soft: rgba(52, 201, 187, 0.13);
    --accent-line: rgba(52, 201, 187, 0.34);
    --sky: #6cb8e8;
    --sky-soft: rgba(108, 184, 232, 0.12);
    --sky-line: rgba(108, 184, 232, 0.34);
    --amber: #f0b45a;
    --amber-soft: rgba(240, 180, 90, 0.12);
    --amber-line: rgba(240, 180, 90, 0.34);
    --border: #24312e;
    --ok: #6fcf9d;
    --ok-bg: rgba(111, 207, 157, 0.12);
    --warn: #f0c05a;
    --warn-bg: rgba(240, 192, 90, 0.12);
    --bad: #f08a94;
    --bad-bg: rgba(240, 138, 148, 0.12);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.35);
    --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 30px rgba(52, 201, 187, 0.16);
    --body-grad-1: radial-gradient(620px 420px at 92% -60px, rgba(52, 201, 187, 0.1), transparent 70%);
    --body-grad-2: radial-gradient(720px 520px at -10% 110%, rgba(108, 184, 232, 0.07), transparent 70%);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--body-grad-1), var(--body-grad-2);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; text-wrap: balance; margin: 0 0 0.55em; letter-spacing: 0.005em; }
h1 { font-size: 2.15rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; font-family: var(--font-body); font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; }
::selection { background: var(--sky-soft); }

.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px;
  border-radius: var(--radius-sm); font-weight: 600; transition: top 0.2s ease-out;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.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; }

/* ---------- header ---------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.app-header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--sky-line), transparent);
  opacity: 0.3; pointer-events: none;
}
.header-inner {
  max-width: 1440px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 20px;
  padding: 0 22px;
}
.mark { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.mark-svg { color: var(--accent); display: block; }
.mark-text {
  font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--ink);
}
.mark-text em { font-style: normal; color: var(--accent); }

.header-search { position: relative; flex: 1; max-width: 460px; margin: 0 auto; }
.header-search input {
  width: 100%; height: 40px; padding: 0 16px;
  font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; transition: var(--transition);
}
.header-search input:focus { outline: none; border-color: var(--accent); background: var(--bg-card); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 120;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card-hover);
  overflow: hidden;
}
.sr-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); transition: var(--transition); }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover { background: var(--accent-soft); }
.sr-title { font-weight: 600; color: var(--ink); font-size: 0.92rem; }
.sr-meta { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sr-empty { padding: 12px 14px; color: var(--muted); font-size: 0.9rem; }

.burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; border-radius: 8px; }
.burger span { display: block; width: 22px; height: 2.5px; background: var(--ink); margin: 4px 0; border-radius: 2px; transition: var(--transition); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- layout ---------- */
.layout { display: flex; max-width: 1440px; margin: 0 auto; padding-top: var(--header-h); }
.sidebar {
  position: sticky; top: var(--header-h); align-self: flex-start;
  width: var(--sidebar-w); height: calc(100vh - var(--header-h));
  overflow-y: auto; padding: 20px 14px 24px 22px;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.side-group { margin-bottom: 18px; }
.side-group-title {
  font-family: var(--font-body); font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
  margin: 0 0 6px; padding-left: 8px;
}
.side-links { display: flex; flex-direction: column; }
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; line-height: 1.35; color: var(--ink-soft);
  padding: 5.5px 8px; border-radius: 8px; transition: var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: var(--accent-soft); color: var(--ink); }
.sidebar-link.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.sl-ic { font-size: 0.85rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-foot { margin-top: 22px; padding: 14px 8px; border-top: 1px solid var(--border); }
.sidebar-foot p { font-size: 0.8rem; color: var(--muted); margin: 0; line-height: 1.5; }

.main { flex: 1; min-width: 0; padding: 34px 42px 60px; }
.overlay { position: fixed; inset: 0; background: rgba(13, 20, 19, 0.5); z-index: 90; }

/* ---------- home ---------- */
.home-hero {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0b2e2b 0%, #0f403b 55%, #124a42 100%);
  color: #eef4ef;
  padding: 44px 44px 36px;
  margin-bottom: 38px;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(115deg, transparent 0 34px, rgba(108, 184, 232, 0.045) 34px 35px),
    radial-gradient(500px 300px at 88% 20%, rgba(52, 201, 187, 0.16), transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--amber);
  margin-bottom: 12px;
}
.home-hero h1 { font-size: 3rem; color: #f4f8f4; margin-bottom: 10px; }
.home-hero h1 .hl { color: #4dd6c7; }
.hero-lead { font-size: 1.08rem; color: #cfd9d2; max-width: 560px; margin-bottom: 22px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.98rem;
  padding: 11px 22px; border-radius: 999px; transition: var(--transition);
  border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--amber); color: #fff; }
.btn-primary:hover { background: #92400e; color: #fff; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: #eef4ef; border-color: rgba(238, 244, 239, 0.45); }
.btn-ghost:hover { border-color: #4dd6c7; color: #4dd6c7; transform: translateY(-2px); }
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.hs-num { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: #4dd6c7; line-height: 1.1; }
.hs-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #b3c0b8; }

/* hero-art: woda - bąbelki + iskierki (signature) */
.hero-art { margin-top: 26px; }
.bubbles-svg { width: 100%; height: 86px; display: block; }
.bub-line { stroke: rgba(238, 244, 239, 0.18); stroke-width: 1.2; fill: none; stroke-dasharray: 3 6; }
.bub { fill: none; stroke: #4dd6c7; stroke-width: 2; }
.bub-hi { fill: rgba(52, 201, 187, 0.16); stroke: #4dd6c7; stroke-width: 2; }
.bub-spark { fill: var(--amber); }
.bub-label { font-family: var(--font-mono); font-size: 10px; fill: #b3c0b8; letter-spacing: 0.1em; }

.home-section { margin-bottom: 48px; }
.home-section-head { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--border); padding-bottom: 8px; margin-bottom: 20px; }
.home-section-head h2 { margin: 0; font-size: 1.42rem; letter-spacing: 0.02em; }
.sec-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.home-card {
  position: relative; display: flex; flex-direction: column; gap: 5px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 17px 15px;
  transition: var(--transition);
}
.home-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: var(--accent-line); }
.home-card::before {
  content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--sky));
  opacity: 0; transition: opacity 0.2s ease-out; border-radius: 0 0 4px 4px;
}
.home-card:hover::before { opacity: 1; }
.hc-icon { font-size: 1.15rem; }
.hc-title { font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; line-height: 1.35; color: var(--ink); }
.home-card:hover .hc-title { color: var(--accent); }
.hc-excerpt { font-size: 0.85rem; line-height: 1.5; color: var(--muted); }
.hc-arrow { position: absolute; right: 14px; top: 14px; color: var(--accent); opacity: 0; transform: translateX(-6px); transition: var(--transition); font-size: 1.05rem; }
.home-card:hover .hc-arrow { opacity: 1; transform: translateX(0); }

/* ---------- article ---------- */
.page-enter { animation: fadeUp 0.26s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumb-sep { margin: 0 7px; color: var(--border); }
.article-head { margin-bottom: 22px; }
.article-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}
.article-head h1 { font-size: 2.3rem; margin-bottom: 10px; }
.article-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); }
.article-meta .am-icon { font-size: 0.95rem; }

.toc {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); background: var(--bg-card);
  padding: 12px 18px; margin-bottom: 26px;
}
.toc summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.toc ol { margin: 10px 0 2px; padding-left: 22px; }
.toc li { margin: 4px 0; font-size: 0.92rem; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--accent); }

.content-article { max-width: 780px; }
.content-article h2 {
  font-size: 1.6rem; margin-top: 1.7em; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.content-article h3 { font-size: 1.12rem; margin-top: 1.4em; }
.content-article ul, .content-article ol { padding-left: 24px; margin-bottom: 1.1em; }
.content-article li { margin: 5px 0; }
.content-article strong { color: var(--ink); }
.content-article a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }

.info-box, .tip-box, .warning-box {
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 1.3em 0;
  font-size: 0.96rem; line-height: 1.6;
}
.info-box { background: var(--sky-soft); border-left: 4px solid var(--sky); }
.tip-box { background: var(--amber-soft); border-left: 4px solid var(--amber); }
.warning-box { background: var(--bad-bg); border-left: 4px solid var(--bad); }

.table-responsive { overflow-x: auto; margin: 1.3em 0; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--bg-card); }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 700; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--accent-soft); }

.compare-table th { background: var(--ink); color: #f2efe8; }
.compare-table td:first-child { font-weight: 600; }

.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; margin: 12px 0; background: var(--bg-card); }
.faq-item h3 { margin: 0 0 6px; color: var(--accent); }

dl.glossary { margin: 1.2em 0; }
dl.glossary dt { font-weight: 700; color: var(--ink); margin-top: 1.1em; font-size: 1.02rem; }
dl.glossary dt::before { content: '▸ '; color: var(--accent); }
dl.glossary dd { margin: 3px 0 0 18px; color: var(--ink-soft); }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 42px; border-top: 1px solid var(--border); padding-top: 24px; }
.pn-card { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; transition: var(--transition); }
.pn-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.pn-card.next { text-align: right; }
.pn-dir { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 4px; }
.pn-title { font-weight: 600; color: var(--ink); font-size: 0.95rem; }

/* ---------- footer ---------- */
.app-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 20px; }
.footer-inner { max-width: 1440px; margin: 0 auto; padding: 26px 42px; }
.footer-inner p { font-size: 0.9rem; color: var(--muted); margin: 0 0 6px; max-width: 760px; }
.footer-inner strong { color: var(--ink); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.02em; }
.footer-inner strong em { font-style: normal; color: var(--accent); }
.footer-meta { font-family: var(--font-mono); font-size: 0.78rem !important; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.4s ease-out, transform 0.4s ease-out; }
.reveal.on { opacity: 1; transform: translateY(0); }

/* ---------- cursor glow (pointer: fine only) ---------- */
@media (pointer: fine) {
  body::before, body::after {
    content: ''; position: fixed; width: 340px; height: 340px; border-radius: 50%;
    left: var(--ox, 50vw); top: var(--oy, 30vh);
    pointer-events: none; z-index: 0; opacity: 0; transition: opacity 0.5s ease-out;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.07), transparent 65%);
    transform: translate(-50%, -50%);
  }
  body::after { background: radial-gradient(circle, rgba(180, 83, 9, 0.05), transparent 65%); width: 260px; height: 260px; }
  body.orb-on::before, body.orb-on::after { opacity: 1; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 95;
    transform: translateX(-102%); transition: transform 0.24s ease-out;
    background: var(--bg); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    width: min(320px, 86vw);
  }
  .sidebar.open { transform: translateX(0); }
  .burger { display: block; }
  .main { padding: 24px 20px 50px; }
  .footer-inner { padding: 22px 20px; }
  .home-hero { padding: 32px 24px 28px; }
  .home-hero h1 { font-size: 2.2rem; }
}
@media (max-width: 600px) {
  .header-search { max-width: none; }
  .mark-text { font-size: 1.05rem; }
  .home-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .hs-num { font-size: 1.2rem; }
  .article-head h1 { font-size: 1.8rem; }
  .prevnext { grid-template-columns: 1fr; }
  .pn-card.next { text-align: left; }
  .toc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .page-enter { animation: none; }
}
