/* ============================================================
   WEDKARSTWOPROSTO - design system
   Paleta "Woda i świt": głęboki water-teal + mech + bursztyn + piasek
   Typografia: Bricolage Grotesque (display) + Figtree (body)
   ============================================================ */

:root {
  /* Light theme */
  --ink: #17282c;
  --ink-soft: #22363b;
  --paper: #f5f1e8;
  --paper-2: #ece6d8;
  --card: #fffdf8;
  --water: #0d3b43;
  --water-deep: #0a2c32;
  --moss: #3f6f4f;
  --moss-deep: #2f573d;
  --amber: #c2570e;
  --amber-soft: #fdf0e0;
  --water-soft: #e3edec;
  --moss-soft: #e9f1e8;
  --dim: #5c6b66;
  --border: #ded7c6;
  --mono: #3a4a48;

  --header-h: 64px;
  --sidebar-w: 300px;
  --radius: 12px;
  --transition: all .2s ease-out;

  --font-body: 'Figtree', system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Figtree', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --bg-gradient: radial-gradient(ellipse 60% 45% at 88% 0%, rgba(13,59,67,.08), transparent 60%),
                 radial-gradient(ellipse 50% 40% at 5% 100%, rgba(63,111,79,.07), transparent 60%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eae4;
    --ink-soft: #cdd5cf;
    --paper: #0c1619;
    --paper-2: #122024;
    --card: #152327;
    --water: #58b3a4;
    --water-deep: #3d9487;
    --moss: #6fb583;
    --moss-deep: #4f9468;
    --amber: #f2a14f;
    --amber-soft: #2a2013;
    --water-soft: #14282b;
    --moss-soft: #16261c;
    --dim: #9db0a8;
    --border: #26383a;
    --mono: #a8c0b8;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; text-wrap: balance; }
h1 { font-size: 2.1rem; font-weight: 700; }
h2 { font-size: 1.45rem; margin: 2rem 0 .7rem; font-weight: 600; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; font-weight: 600; }
p { margin-bottom: 1rem; }
a { color: var(--water-deep); }
a:hover { color: var(--moss-deep); }
::selection { background: rgba(224,123,46,.28); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--water); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* === HEADER === */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(8px);
}
.app-header::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(13,59,67,.35), transparent);
}
.header-inner {
  max-width: 1400px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 1.2rem; padding: 0 1.2rem;
}
.brand {
  display: flex; align-items: center; gap: .55rem; text-decoration: none;
  color: var(--ink); font-family: var(--font-display); font-size: 1.35rem; font-weight: 700;
  white-space: nowrap;
}
.brand-mark { color: var(--water); display: flex; }
.brand-text em { font-style: normal; color: var(--amber); }
.brand:hover { color: var(--ink); }

.search-wrap { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
#search-input {
  width: 100%; padding: .55rem 1rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--paper-2);
  font-family: var(--font-body); font-size: .95rem; color: var(--ink);
  outline: none;
}
#search-input:focus { border-color: var(--water); box-shadow: 0 0 0 3px rgba(13,59,67,.15); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.12); z-index: 200; overflow: hidden;
}
.search-results a {
  display: block; padding: .65rem 1rem; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--water-soft); }
.search-results strong { display: block; font-size: .92rem; }
.search-results small { color: var(--dim); font-size: .8rem; }
.sr-empty { padding: .8rem 1rem; color: var(--dim); font-size: .9rem; }

.burger {
  display: none; flex-direction: column; gap: 5px; padding: 10px;
  background: none; border: none; cursor: pointer;
}
.burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: var(--transition); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === LAYOUT === */
.layout { display: flex; max-width: 1400px; margin: 0 auto; padding-top: var(--header-h); min-height: calc(100vh - var(--header-h)); }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  padding: 1.4rem 1rem 2rem; border-right: 1px solid var(--border);
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.sidebar-home {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: .95rem; text-decoration: none; color: var(--ink);
  padding: .55rem .8rem; border-radius: 8px; margin-bottom: .4rem;
}
.sidebar-home:hover { background: var(--water-soft); }
.sidebar-sec {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); margin: 1.1rem 0 .35rem; padding: 0 .8rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: .55rem;
  font-size: .9rem; line-height: 1.35; padding: .42rem .8rem; border-radius: 8px;
  text-decoration: none; color: var(--ink-soft);
}
.sidebar-link:hover { background: var(--water-soft); color: var(--ink); }
.sidebar-link.active { background: var(--water-soft); color: var(--water-deep); font-weight: 600; }
.sidebar-link .sico { font-size: .95rem; flex-shrink: 0; }

.main { flex: 1; min-width: 0; padding: 1.6rem 2.2rem 3rem; }
.sidebar-overlay { display: none; }

/* === HERO === */
.home-hero {
  border-radius: 16px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #0a2c32 0%, #0d3b43 50%, #1d5a52 130%);
  color: #f2efe4; padding: 2.8rem 2.6rem;
  box-shadow: 0 10px 40px rgba(10,44,50,.2);
}
.home-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 90% 10%, rgba(240,146,61,.18), transparent 60%),
              radial-gradient(ellipse 40% 50% at 8% 90%, rgba(111,181,131,.15), transparent 60%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.25fr 1fr; gap: 2rem; align-items: center; }
.badge {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #f5d9b8;
  background: rgba(240,146,61,.16); border: 1px solid rgba(240,146,61,.4);
  padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1rem;
}
.home-hero h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); color: #fff; margin-bottom: .9rem; }
.home-hero h1 em { font-style: italic; color: #f0a04f; }
.home-hero .lead { color: #cdd9cf; font-size: 1.05rem; max-width: 34em; }
.hero-cta { display: flex; gap: .8rem; margin-top: 1.4rem; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: .65rem 1.4rem; border-radius: 999px;
  font-weight: 700; font-size: .95rem; text-decoration: none; transition: var(--transition);
}
.btn-primary { background: var(--amber); color: #fff; }
.btn-primary:hover { background: #a84a0c; color: #fff; transform: translateY(-1px); }
.btn-ghost { border: 1px solid rgba(255,255,255,.35); color: #f2efe4; }
.btn-ghost:hover { border-color: #f0a04f; color: #f0a04f; transform: translateY(-1px); }

/* === FISHING SIGNATURE (hero) - depth meter === */
.fishing-wrap { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 1.2rem 1.2rem .9rem; }
.fishing-title { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #b9cdbf; margin-bottom: .5rem; }
.fishing-tag { font-family: var(--font-mono); font-size: .7rem; color: #f0a04f; background: rgba(240,146,61,.15); padding: .15rem .5rem; border-radius: 4px; }
.depth-svg { width: 100%; height: auto; display: block; }
.depth-line { stroke: rgba(255,255,255,.08); stroke-width: 1; }
.depth-water { fill: rgba(88,179,164,.1); }
.depth-fish { fill: #f0a04f; }
.depth-bait { fill: #e8eae4; }
.depth-label { fill: #b9cdbf; font-family: var(--font-mono); font-size: 10px; }
.depth-legend { display: flex; gap: 1rem; margin-top: .5rem; font-size: .75rem; color: #b9cdbf; }
.legend-dot { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: .4rem; vertical-align: middle; }
.fishing-tip { font-size: .72rem; color: #93a89a; margin-top: .6rem; font-family: var(--font-mono); }

/* === STATS === */
.stats-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin: 1.4rem 0 2.4rem;
}
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--water-deep); }
.stat span { font-size: .85rem; color: var(--dim); }

/* === HOME SECTIONS === */
.home-section { margin-bottom: 2.2rem; }
.section-head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .9rem; }
.section-head h2 { margin: 0; font-size: 1.35rem; }
.sec-count { font-size: .8rem; color: var(--dim); font-family: var(--font-mono); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.home-card {
  position: relative; display: block; text-decoration: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; transition: var(--transition);
}
.home-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(10,44,50,.1); border-color: var(--water); }
.card-arrow { position: absolute; top: 1rem; right: 1.1rem; opacity: 0; transform: translateX(-8px); transition: var(--transition); color: var(--water); font-weight: 700; }
.home-card:hover .card-arrow { opacity: 1; transform: translateX(0); }
.home-card .ico { font-size: 1.4rem; }
.home-card h3 { font-size: .95rem; margin: .45rem 0 .35rem; color: var(--ink); font-weight: 600; }
.home-card p { font-size: .85rem; color: var(--dim); margin: 0; line-height: 1.55; }

/* === ARTICLE === */
.article { max-width: 780px; animation: fadeUp .28s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.breadcrumbs { font-size: .83rem; color: var(--dim); margin-bottom: .6rem; }
.breadcrumbs a { color: var(--water-deep); text-decoration: none; }
.breadcrumbs span { margin: 0 .35rem; }
.article h1 { margin-bottom: .5rem; }
.meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; font-size: .83rem; color: var(--dim); margin-bottom: 1.2rem; }
.meta-sec { background: var(--water-soft); color: var(--water-deep); padding: .2rem .7rem; border-radius: 999px; font-weight: 600; }
.trust-badge { color: var(--moss-deep); font-weight: 600; }

.toc {
  background: var(--paper-2); border: 1px solid var(--border); border-left: 3px solid var(--water);
  border-radius: 8px; padding: 1rem 1.2rem; margin: 1.2rem 0 1.6rem;
}
.toc b { display: block; font-size: .85rem; margin-bottom: .5rem; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.toc-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .25rem .8rem; }
.toc-links a { font-size: .88rem; text-decoration: none; color: var(--ink-soft); padding: .15rem 0; }
.toc-links a:hover { color: var(--water-deep); }

.article ul, .article ol { margin: 0 0 1.1rem 1.3rem; }
.article li { margin-bottom: .35rem; }

/* === COMPONENTS === */
.info-box, .warn-box, .tip-box {
  border-radius: 10px; padding: 1rem 1.2rem; margin: 1.2rem 0;
  font-size: .95rem;
}
.info-box { background: var(--water-soft); border: 1px solid rgba(13,59,67,.25); }
.info-box b { color: var(--water-deep); }
.warn-box { background: var(--amber-soft); border: 1px solid rgba(194,87,14,.3); }
.warn-box b { color: var(--amber); }
.tip-box { background: var(--moss-soft); border: 1px solid rgba(63,111,79,.3); }
.tip-box b { color: var(--moss-deep); }

.cmp-table, .error-table {
  width: 100%; border-collapse: collapse; margin: 1.2rem 0 1.6rem;
  font-size: .9rem;
}
.cmp-table th, .cmp-table td, .error-table th, .error-table td {
  border: 1px solid var(--border); padding: .6rem .8rem; text-align: left; vertical-align: top;
}
.cmp-table th, .error-table th { background: var(--paper-2); font-weight: 700; font-size: .88rem; }
.cmp-table tr:nth-child(even) td, .error-table tr:nth-child(even) td { background: rgba(236,230,216,.35); }
.table-responsive { overflow-x: auto; margin: 1.2rem 0; }
.table-responsive .cmp-table, .table-responsive .error-table { margin: 0; }

.steps { list-style: none; counter-reset: step; margin: 1.2rem 0 !important; }
.steps li {
  counter-increment: step; position: relative;
  padding: .7rem 0 .7rem 2.6rem; border-bottom: 1px solid var(--border);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: .7rem;
  font-family: var(--font-mono); font-size: .85rem; font-weight: 600; color: var(--water);
}

.faq-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: .7rem; overflow: hidden; }
.faq-q {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  width: 100%; padding: .9rem 1.1rem; background: var(--card);
  border: none; cursor: pointer; text-align: left;
  font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--ink);
}
.faq-q::after { content: '+'; font-size: 1.3rem; color: var(--water); transition: var(--transition); }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 1.1rem 1rem; font-size: .95rem; }
.faq-item.open .faq-a { display: block; }

dl.glossary { margin: 1.2rem 0; }
dl.glossary dt {
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  margin-top: 1rem; color: var(--water-deep);
}
dl.glossary dd { margin: .2rem 0 0 0; font-size: .93rem; color: var(--ink-soft); }

.error-page { max-width: 600px; margin: 4rem auto; text-align: center; }
.error-page h1 { font-size: 4rem; color: var(--water); }

/* === FOOTER === */
.app-footer { border-top: 1px solid var(--border); background: var(--paper-2); }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 1.6rem 1.2rem 2rem; font-size: .88rem; color: var(--dim); }
.foot-note { margin: .5rem 0; }
.foot-bottom { font-size: .8rem; font-family: var(--font-mono); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; width: 300px;
    background: var(--paper); z-index: 150;
    transform: translateX(-100%); transition: transform .25s ease-out;
    box-shadow: 4px 0 30px rgba(0,0,0,.12);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(10,44,50,.45); z-index: 140; }
  .burger { display: flex; }
  .hero-inner { grid-template-columns: 1fr; }
  .main { padding: 1.2rem 1.1rem 2.5rem; }
  .home-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 16.5px; }
  h1 { font-size: 1.7rem; }
  .home-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr; }
  .home-hero { padding: 1.8rem 1.4rem; }
  .search-wrap { max-width: none; }
  .brand-text { font-size: 1.15rem; }
}

/* === KEYFRAMES === */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes fadeIn { to { opacity: 1; } }
.depth-fish { animation: bob 3.2s ease-in-out infinite; }
.depth-bait { animation: bob 2.4s ease-in-out infinite; }
.depth-fade { opacity: 0; animation: fadeIn 1.2s ease-out forwards; }

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