/* =========================================================================
   LICZYDŁO — system designu
   Kierunek: edytorialny / print. Liczby jako bohater. Papier + atrament + limonka.
   Typografia: Fraunces (display) / Space Grotesk (liczby) / Instrument Sans (tekst)
   ========================================================================= */

:root {
  /* Paleta bazowa */
  --paper:      #F4F0E6;   /* ciepły papier */
  --paper-2:    #EBE5D6;   /* papier ciemniejszy */
  --ink:        #17150E;   /* atrament (ciepła czerń) */
  --ink-soft:   #3A362B;   /* atrament miękki */
  --muted:      #7A7364;   /* tekst drugorzędny */
  --line:       #DBD3C1;   /* linie/ramki na papierze */
  --line-ink:   #2C2A20;   /* linie na atramencie */

  /* Sygnatura */
  --lime:       #CBEF4A;   /* akcent główny */
  --lime-deep:  #A6C82F;

  /* Kolory kategorii */
  --c-finanse:  #1F4FE0;   /* kobalt */
  --c-podatki:  #C2410C;   /* rdza */
  --c-zdrowie:  #E8552D;   /* glina/koral */
  --c-matma:    #7A3CE0;   /* fiolet (tylko jako kod kategorii) */
  --c-data:     #E0A11F;   /* bursztyn */
  --c-przelicz: #12A594;   /* morski */
  --c-dom:      #16A34A;   /* zieleń */
  --c-auto:     #0EA5E9;   /* błękit (motoryzacja) */
  --c-ai:       #0E0E0E;   /* AI = atrament + limonka */

  /* Typografia */
  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-num:     "Space Grotesk", ui-monospace, "SF Mono", monospace;
  --f-body:    "Instrument Sans", system-ui, -apple-system, sans-serif;

  /* Rytm */
  --wrap: 1240px;
  --gap: clamp(16px, 3vw, 40px);
  --radius: 4px;

  /* Cień offsetowy (edytorialny, nie miękki blur) */
  --shadow: 5px 5px 0 var(--ink);
  --shadow-lime: 5px 5px 0 var(--lime-deep);
}

/* ------------------------- reset lekki ------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

/* Ziarno papieru — subtelna tekstura na całej stronie */
body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: 9999; pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------- typografia ------------------------- */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; line-height: 1.02; letter-spacing: -.02em; margin: 0; }
.display {
  font-family: var(--f-display);
  font-weight: 500;
  font-optical-sizing: auto;
  font-size: clamp(3rem, 9vw, 8.5rem);
  line-height: .92;
  letter-spacing: -.035em;
}
.display em { font-style: italic; font-variation-settings: "SOFT" 60, "WONK" 1; }
.eyebrow {
  font-family: var(--f-num);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-weight: 600;
  color: var(--muted);
}
.num { font-family: var(--f-num); font-feature-settings: "tnum" 1; letter-spacing: -.01em; }

/* ------------------------- layout ------------------------- */
.wrap { width: min(var(--wrap), 100% - 2*clamp(16px,4vw,48px)); margin-inline: auto; }
.section { padding-block: clamp(60px, 9vw, 130px); }
.section--tight { padding-block: clamp(40px, 6vw, 80px); }
.stack > * + * { margin-top: 1rem; }

/* ------------------------- nagłówek / nawigacja ------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 200;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: transform .35s ease, box-shadow .35s ease;
}
.site-head__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap); height: 74px;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand__mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); border-radius: 8px;
}
.brand__mark span { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 9px 0 0 var(--paper), -9px 0 0 var(--paper); }
.brand__name { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; letter-spacing: -.03em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav a { font-size: .95rem; font-weight: 500; position: relative; padding-block: 4px; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--ink); transition: width .25s ease; }
.nav a:hover::after { width: 100%; }
.nav__cta {
  font-family: var(--f-num); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600;
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px;
  transition: transform .2s ease, background .2s ease;
}
.nav__cta:hover { transform: translateY(-2px); background: var(--c-finanse); }
.nav__cta::after { display: none; }

/* rozwijane menu kategorii */
.nav__item { position: relative; display: inline-flex; align-items: center; }
.nav__item > a { display: inline-flex; align-items: center; gap: 5px; font-size: .95rem; font-weight: 500; }
.caret { font-size: .65rem; transition: transform .2s; }
.nav__item:hover .caret, .nav__item:focus-within .caret { transform: rotate(180deg); }
.subnav {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 210;
  min-width: 260px; padding: 8px; display: flex; flex-direction: column; gap: 2px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0,0,0,.12);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.nav__item:hover .subnav, .nav__item:focus-within .subnav { opacity: 1; visibility: visible; transform: none; }
.subnav a { padding: 9px 12px; border-radius: 8px; font-size: .9rem; font-weight: 500; white-space: nowrap; }
.subnav a::after { display: none; }
.subnav a:hover { background: var(--paper-2); }
.subnav__all { color: var(--c-finanse); font-family: var(--f-num); font-size: .82rem !important; margin-top: 4px; padding-top: 11px !important; border-top: 1px solid var(--line); border-radius: 0; }
.burger { display: none; background: none; border: 0; padding: 8px; outline: none; -webkit-tap-highlight-color: transparent; border-radius: 8px; }
.burger:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.burger span { display: block; width: 26px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .25s ease, opacity .2s ease; }
.burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ------------------------- marquee (pasek popularnych) ------------------------- */
.ticker {
  background: var(--ink); color: var(--paper);
  border-block: 1px solid var(--line-ink);
  overflow: hidden; white-space: nowrap;
}
.ticker__row { display: inline-flex; gap: 3rem; padding-block: 12px; animation: slide 38s linear infinite; }
.ticker:hover .ticker__row { animation-play-state: paused; }
.ticker__row span { font-family: var(--f-num); font-size: .85rem; letter-spacing: .04em; display: inline-flex; align-items: center; gap: .7rem; }
.ticker__row span::before { content: "→"; color: var(--lime); }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ------------------------- hero ------------------------- */
.hero { position: relative; padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(30px, 4vw, 60px); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 4vw, 64px); align-items: end; }
.hero__title { margin-bottom: 1.5rem; }
.hero__title .line { display: block; overflow: visible; padding-bottom: .06em; }
.hero__lead { max-width: 44ch; color: var(--ink-soft); font-size: 1.12rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; }

/* Ogromna liczba dekoracyjna w tle */
.hero__ghost {
  position: absolute; right: -2vw; top: -4vw; z-index: -1;
  font-family: var(--f-num); font-weight: 700;
  font-size: 34vw; line-height: .8; color: var(--paper-2);
  user-select: none; pointer-events: none;
}

/* Mini-kalkulator w hero (żywy) */
.quickcalc {
  background: var(--ink); color: var(--paper);
  border-radius: 14px; padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-lime);
}
.quickcalc__tag { display: inline-flex; align-items: center; gap: .5rem; }
.quickcalc__tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: pulse 1.8s ease infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.quickcalc label { display: block; font-family: var(--f-num); font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; color: #b9b2a1; margin: 14px 0 6px; }
.quickcalc .field { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line-ink); padding-bottom: 8px; }
.quickcalc .field .cur { font-family: var(--f-num); color: var(--muted); }
.quickcalc input[type="text"], .quickcalc input[type="number"] {
  flex: 1; background: none; border: 0; color: var(--paper);
  font-family: var(--f-num); font-size: 1.6rem; font-weight: 600; outline: none; width: 100%;
}
.quickcalc input[type="range"] { width: 100%; accent-color: var(--lime); margin-top: 10px; }
.quickcalc__out { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line-ink); }
.quickcalc__out .k { font-family: var(--f-num); font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; color: #b9b2a1; }
.quickcalc__out .v { font-family: var(--f-num); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; color: var(--lime); line-height: 1; margin-top: 4px; }

/* ------------------------- przyciski ------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--f-num); font-weight: 600; font-size: .9rem;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 15px 26px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: var(--paper); color: var(--ink);
  transition: transform .18s ease, background .18s, color .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--c-finanse); border-color: var(--c-finanse); }
.btn--lime { background: var(--lime); border-color: var(--ink); }
.btn--ghost { background: none; }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translate(3px,-3px); }

/* ------------------------- siatka kategorii ------------------------- */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cat {
  position: relative; padding: 34px 28px 30px; background: var(--paper);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background .3s ease, color .3s ease; overflow: hidden;
}
.cat__idx { position: absolute; top: 18px; right: 22px; font-family: var(--f-num); font-size: .8rem; color: var(--muted); }
.cat__accent { width: 40px; height: 6px; border-radius: 3px; background: var(--acc, var(--ink)); margin-bottom: 22px; transition: width .3s ease; }
.cat h3 { font-size: 1.5rem; margin-bottom: 8px; }
.cat p { color: var(--muted); font-size: .95rem; margin: 0 0 18px; }
.cat__list { display: flex; flex-wrap: wrap; gap: 6px; }
.cat__list li { font-family: var(--f-num); font-size: .74rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.cat:hover { background: var(--ink); color: var(--paper); }
.cat:hover .cat__accent { width: 80px; background: var(--acc, var(--lime)); }
.cat:hover p, .cat:hover .cat__idx { color: #b9b2a1; }
.cat:hover .cat__list li { border-color: var(--line-ink); color: var(--paper); }

/* ------------------------- nagłówek sekcji ------------------------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); max-width: 16ch; line-height: 1.12; }
.sec-head p { color: var(--muted); max-width: 40ch; }

/* ------------------------- karta wyróżniona (AI) ------------------------- */
.feature {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 0;
  background: var(--ink); color: var(--paper); border-radius: 18px; overflow: hidden;
}
.feature__body { padding: clamp(28px, 4vw, 56px); }
.feature__badge { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--f-num); font-size: .7rem; text-transform: uppercase; letter-spacing: .18em; color: var(--ink); background: var(--lime); padding: 6px 12px; border-radius: 999px; }
.feature h2 { font-size: clamp(2rem, 4vw, 3.4rem); margin: 22px 0 16px; }
.feature p { color: #c3bcab; max-width: 46ch; }
.feature__visual { position: relative; background: linear-gradient(135deg, #1d1b12, #0c0b07); border-left: 1px solid var(--line-ink); display: grid; place-items: center; padding: 30px; min-height: 320px; }

/* mini wykres kosztów AI */
.aichart { width: 100%; }
.aichart .bar { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 12px; margin-bottom: 14px; }
.aichart .bar b { font-family: var(--f-num); font-size: .82rem; font-weight: 600; }
.aichart .bar .track { height: 12px; background: var(--line-ink); border-radius: 999px; overflow: hidden; }
.aichart .bar .fill { height: 100%; background: var(--lime); border-radius: 999px; transform-origin: left; transform: scaleX(0); transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.aichart .bar .val { font-family: var(--f-num); font-size: .78rem; color: #c3bcab; }

/* ------------------------- reklamy (miejsca) ------------------------- */
.ad {
  position: relative; display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, var(--paper-2), var(--paper-2) 12px, var(--paper) 12px, var(--paper) 24px);
  border: 1px dashed var(--line); border-radius: 10px; color: var(--muted);
  text-align: center; overflow: hidden;
}
.ad::before { content: "Reklama"; position: absolute; top: 8px; left: 10px; font-family: var(--f-num); font-size: .6rem; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); }
.ad__inner { padding: 20px; font-family: var(--f-num); font-size: .8rem; }
.ad--leaderboard { min-height: 110px; }        /* 728x90 / responsywny */
.ad--rectangle { min-height: 280px; }           /* 300x250 */
.ad--sky { min-height: 600px; }                 /* 300x600 sidebar */
.ad--inline { min-height: 130px; margin-block: 40px; }
.ad--footer { min-height: 100px; }

/* ------------------------- blog ------------------------- */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.post {
  display: flex; flex-direction: column; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.post:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post__media { aspect-ratio: 16/10; background: var(--paper-2); position: relative; overflow: hidden; }
.post__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post:hover .post__media img { transform: scale(1.05); }
.post__tag { position: absolute; top: 12px; left: 12px; font-family: var(--f-num); font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; background: var(--paper); border: 1px solid var(--ink); padding: 5px 10px; border-radius: 999px; }
.post__tag--spon { background: var(--lime); border-color: var(--ink); }
.post__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post__meta { font-family: var(--f-num); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.post h3 { font-size: 1.4rem; }
.post p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.post__more { margin-top: auto; font-family: var(--f-num); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; display: inline-flex; gap: 6px; }
.post__more .arr { transition: transform .2s; }
.post:hover .post__more .arr { transform: translateX(4px); }

/* ------------------------- stronicowanie ------------------------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 44px; }
.pager__num, .pager__btn {
  font-family: var(--f-num); font-size: .9rem; font-weight: 600;
  min-width: 42px; height: 42px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--paper);
  transition: background .2s, color .2s, border-color .2s;
}
.pager__num:hover, .pager__btn:hover { border-color: var(--ink); }
.pager__num.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pager__btn { background: none; }

/* ------------------------- blok linków / partnerzy (SEO) ------------------------- */
.links {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(24px, 3vw, 40px);
}
.links__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 30px; margin-top: 20px; }
.links__grid a { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; padding: 6px 0; border-bottom: 1px solid transparent; transition: border-color .2s, color .2s; }
.links__grid a::before { content: "↗"; font-family: var(--f-num); color: var(--c-finanse); font-size: .85rem; }
.links__grid a:hover { border-color: var(--ink); }
.links__note { font-family: var(--f-num); font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; margin-top: 24px; }

/* Kontekstowy blok linków w artykule */
.linkbox { border-left: 4px solid var(--lime); background: var(--paper-2); padding: 18px 22px; border-radius: 0 8px 8px 0; margin-block: 30px; }
.linkbox .eyebrow { margin-bottom: 8px; }
.linkbox ul { display: flex; flex-direction: column; gap: 6px; }
.linkbox a { font-weight: 600; border-bottom: 1px solid var(--ink); }

/* CTA pod wpisem: artykuł sponsorowany */
.postcta { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; background: var(--ink); color: var(--paper); border-radius: 16px; padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-lime); }
.postcta h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 8px 0 10px; }
.postcta p { color: #c3bcab; max-width: 52ch; margin: 0; }
.postcta .btn { flex: none; }

/* ------------------------- statystyki / zaufanie ------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stat { background: var(--paper); padding: 30px 22px; overflow: hidden; }
.stat .v { font-family: var(--f-num); font-weight: 700; font-size: clamp(1.7rem, 3.2vw, 2.7rem); line-height: 1; letter-spacing: -.03em; white-space: nowrap; }
.stat .k { color: var(--muted); font-size: .9rem; margin-top: 8px; }

/* ------------------------- stopka ------------------------- */
.site-foot { background: var(--ink); color: var(--paper); padding-top: clamp(50px, 7vw, 90px); }
.foot__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 50px; border-bottom: 1px solid var(--line-ink); }
.foot h4 { font-family: var(--f-num); font-size: .74rem; text-transform: uppercase; letter-spacing: .18em; color: #b9b2a1; font-weight: 600; margin-bottom: 18px; }
.foot ul { display: flex; flex-direction: column; gap: 10px; }
.foot a { color: #d8d2c4; font-size: .95rem; }
.foot a:hover { color: var(--lime); }
.foot__brand .brand__name { color: var(--paper); }
.foot__brand p { color: #b9b2a1; max-width: 34ch; margin-top: 16px; font-size: .95rem; }
.foot__bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 26px; flex-wrap: wrap; font-family: var(--f-num); font-size: .78rem; color: #9a9384; }

/* atrybut hidden musi działać nawet przy display:flex/inline-flex */
[hidden] { display: none !important; }

/* ------------------------- baner cookies ------------------------- */
.cookie {
  position: fixed; z-index: 500; left: 16px; right: 16px; bottom: 16px;
  background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
  animation: cookieUp .4s cubic-bezier(.2,.8,.2,1);
}
@keyframes cookieUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.cookie__inner {
  display: flex; align-items: flex-start; gap: 22px;
  max-width: var(--wrap); margin-inline: auto; padding: 18px 22px; flex-wrap: wrap;
}
.cookie__main { flex: 1; min-width: 260px; }
.cookie__text { margin: 0; font-size: .92rem; color: #d8d2c4; line-height: 1.5; }
.cookie__text a { color: var(--lime); border-bottom: 1px solid currentColor; }
.cookie__prefs { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-ink); }
.cookie__opt { display: flex; align-items: flex-start; gap: 10px; font-size: .85rem; color: #c3bcab; line-height: 1.4; cursor: pointer; }
.cookie__opt input { margin-top: 3px; accent-color: var(--lime); flex: none; }
.cookie__opt b { color: var(--paper); }
.cookie__btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cookie__btns .btn { padding: 12px 20px; }
.cookie__btns .btn--ghost { color: var(--paper); border-color: var(--line-ink); }
.cookie__btns .btn--ghost:hover { background: var(--ink-soft); box-shadow: none; }
@media (max-width: 560px) {
  .cookie__inner { padding: 16px; }
  .cookie__btns { width: 100%; }
  .cookie__btns .btn { flex: 1; justify-content: center; }
}

/* ------------------------- reveal on scroll ------------------------- */
/* Ukrywamy tylko gdy działa JS (klasa has-js). Bez JS treść jest zawsze widoczna. */
.has-js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1 !important; transform: none !important; }
.reveal[data-d="1"]{transition-delay:.08s}.reveal[data-d="2"]{transition-delay:.16s}.reveal[data-d="3"]{transition-delay:.24s}.reveal[data-d="4"]{transition-delay:.32s}

/* ========================================================================
   STRONA KALKULATORA
   ======================================================================== */
.calc-head { padding-top: clamp(30px, 4vw, 50px); }
.crumb { font-family: var(--f-num); font-size: .78rem; color: var(--muted); display: flex; gap: 8px; margin-bottom: 20px; }
.crumb a:hover { color: var(--ink); }
.calc-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.calc-side { position: sticky; top: 94px; display: flex; flex-direction: column; gap: 24px; }

.calc-card { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.calc-card__head { padding: 22px 26px; border-bottom: 1.5px solid var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.calc-card__head h1 { font-size: 1.7rem; }
.calc-tabs { display: flex; gap: 6px; padding: 16px 26px 0; flex-wrap: wrap; }
.calc-tab { font-family: var(--f-num); font-size: .8rem; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--ink-soft); }
.calc-tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.calc-body { padding: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.calc-fields { display: flex; flex-direction: column; gap: 20px; }
.f { display: flex; flex-direction: column; gap: 8px; }
.f label { font-family: var(--f-num); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); display: flex; justify-content: space-between; }
.f label .hint { color: var(--muted); text-transform: none; letter-spacing: 0; }
.f__control { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; background: var(--paper); transition: border-color .2s; }
.f__control:focus-within { border-color: var(--ink); }
.f__control input, .f__control select { flex: 1; border: 0; background: none; outline: none; font-family: var(--f-num); font-size: 1.1rem; font-weight: 600; padding: 12px 14px; color: var(--ink); width: 100%; }
.f__control .unit { font-family: var(--f-num); font-size: .85rem; color: var(--muted); padding-right: 14px; }
.f input[type="range"] { accent-color: var(--ink); width: 100%; }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: none; padding: 10px; font-family: var(--f-num); font-size: .82rem; color: var(--ink-soft); }
.seg button.active { background: var(--ink); color: var(--paper); }

.calc-result { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 26px; display: flex; flex-direction: column; }
.calc-result .rlead { font-family: var(--f-num); font-size: .74rem; text-transform: uppercase; letter-spacing: .16em; color: #b9b2a1; }
.calc-result .rbig { font-family: var(--f-num); font-weight: 700; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; color: var(--lime); margin: 8px 0 4px; }
.calc-result .rsub { color: #c3bcab; font-size: .9rem; }
.calc-result .rrow { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-ink); font-family: var(--f-num); font-size: .9rem; }
.calc-result .rrow:first-of-type { margin-top: 20px; }
.calc-result .rrow .rk { color: #b9b2a1; }
.calc-result .rrow .rv { font-weight: 600; }

.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 40px 0 14px; scroll-margin-top: 96px; }
.prose h3 { font-size: 1.3rem; margin: 28px 0 10px; scroll-margin-top: 96px; }

/* Spis treści (auto) */
.toc { background: var(--paper-2); border: 1px solid var(--line); border-left: 4px solid var(--lime); border-radius: 0 10px 10px 0; padding: 20px 24px; margin: 28px 0; }
.toc__title { font-family: var(--f-num); font-size: .74rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); margin: 0 0 10px; }
.toc ol { margin: 0; padding: 0; counter-reset: toc; list-style: none; }
.toc li { counter-increment: toc; margin: 6px 0; }
.toc li::before { content: counter(toc) ". "; font-family: var(--f-num); color: var(--muted); font-size: .85rem; }
.toc li.toc__sub { margin-left: 20px; }
.toc li.toc__sub::before { content: "– "; }
.toc a { border-bottom: 1px solid transparent; font-weight: 500; }
.toc a:hover { border-color: var(--ink); }
.prose p { margin: 0 0 16px; color: var(--ink-soft); }
.prose a { color: var(--c-finanse); border-bottom: 1px solid currentColor; font-weight: 500; }
.prose table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: .92rem; display: block; overflow-x: auto; }
.prose table thead th { background: var(--ink); color: var(--paper); font-family: var(--f-num); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; text-align: left; padding: 12px 14px; white-space: nowrap; }
.prose table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
.prose table tbody tr:nth-child(even) { background: var(--paper-2); }
.prose table tbody tr:hover { background: color-mix(in srgb, var(--lime) 18%, transparent); }
.prose table td:first-child { font-family: var(--f-num); font-weight: 600; color: var(--ink); white-space: nowrap; }
.prose table th:first-child { border-radius: 0; }

.prose ul.dot { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.prose ul.dot li { position: relative; padding-left: 26px; color: var(--ink-soft); }
.prose ul.dot li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; background: var(--lime); border: 1px solid var(--ink); border-radius: 2px; }

/* Listy z treści edytora (punktowane i numerowane) */
.prose ul:not(.dot), .prose ol { list-style: none; padding-left: 0; margin: 0 0 20px; }
.prose ul:not(.dot) li { position: relative; padding-left: 28px; margin: 9px 0; color: var(--ink-soft); }
.prose ul:not(.dot) li::before { content: ""; position: absolute; left: 5px; top: .6em; width: 8px; height: 8px; background: var(--lime); border: 1px solid var(--ink); border-radius: 2px; }
.prose ol { counter-reset: li; }
.prose ol li { position: relative; padding-left: 40px; margin: 12px 0; color: var(--ink-soft); min-height: 26px; }
.prose ol li::before { counter-increment: li; content: counter(li); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; background: var(--ink); color: var(--paper); font-family: var(--f-num); font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { font-family: var(--f-display); font-size: 1.2rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-num); }
.faq details[open] summary::after { content: "-"; }
.faq details p { margin-top: 12px; color: var(--ink-soft); }

/* tabela tokenów AI */
.aitable { width: 100%; border-collapse: collapse; font-family: var(--f-num); font-size: .9rem; }
.aitable th, .aitable td { text-align: right; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.aitable th:first-child, .aitable td:first-child { text-align: left; }
.aitable thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.aitable tbody tr:hover { background: var(--paper-2); }
.aitable .model { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.aitable .swatch { width: 10px; height: 10px; border-radius: 3px; }
.aitable .best { color: var(--lime-deep); font-weight: 700; }

/* Tabela AI jako karty na telefonie */
@media (max-width: 600px) {
  .aitable thead { display: none; }
  .aitable, .aitable tbody, .aitable tr, .aitable td { display: block; width: 100%; }
  .aitable tr { border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 12px; padding: 6px 12px; background: var(--paper); }
  .aitable tbody tr:hover { background: var(--paper); }
  .aitable td { display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: right; border: 0; border-bottom: 1px solid var(--line); padding: 9px 0; }
  .aitable tr td:last-child { border-bottom: 0; }
  .aitable td::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; text-align: left; }
  .aitable td:first-child { justify-content: flex-start; }
  .aitable td:first-child::before { display: none; }
}

/* ========================================================================
   ARTYKUŁ
   ======================================================================== */
.article-head { padding-top: clamp(30px, 4vw, 60px); }
.article-head h1 { font-size: clamp(2.2rem, 6vw, 4.4rem); max-width: 20ch; margin: 16px 0 20px; }
.article-meta { display: flex; align-items: center; gap: 16px; font-family: var(--f-num); font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.article-meta .author { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.article-meta .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--paper-2); border: 1px solid var(--line); }
.spon-banner { display: flex; align-items: center; gap: 12px; background: var(--lime); border: 1.5px solid var(--ink); border-radius: 10px; padding: 12px 18px; font-family: var(--f-num); font-size: .82rem; margin: 24px 0; }
.article-hero { aspect-ratio: 21/9; width: min(100vw - 64px, 1520px); margin-left: 50%; transform: translateX(-50%); background: var(--paper-2); border-radius: 14px; overflow: hidden; margin-bottom: 40px; border: 1px solid var(--line); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: clamp(24px,4vw,56px); align-items: start; }

/* ------------------------- responsywność ------------------------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .feature, .calc-layout, .article-layout { grid-template-columns: 1fr; }
  .calc-side { position: static; }
  .foot__top { grid-template-columns: 1fr 1fr; }
  .calc-body { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav { position: fixed; inset: 74px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 24px 24px; transform: translateY(-120%); transition: transform .3s ease; }
  .nav.open { transform: none; }
  .nav a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav__item { width: 100%; display: block; }
  .nav__item > a { justify-content: space-between; }
  .caret { display: inline-block; transition: transform .2s ease; }
  .nav__item.open .caret { transform: rotate(180deg); }
  .subnav { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: none; padding: 0 0 6px 14px; min-width: 0; display: none; }
  .nav__item.open .subnav { display: flex; flex-direction: column; }
  .subnav a { padding: 11px 0; font-size: .98rem; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
  .subnav a:hover { background: none; }
  .subnav__all { color: var(--c-finanse); border-top: 0; }
  .nav__cta { width: 100%; justify-content: center; text-align: center; margin-top: 16px; padding: 15px 18px; border-bottom: 0; font-size: .9rem; }
  .burger { display: block; }
  .foot__top { grid-template-columns: 1fr; gap: 30px; }
  .hero__ghost { display: none; }
  .calc-body, .feature__visual { padding-inline: 18px; }
  .calc-card__head { flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 18px; }
  .calc-card__head h1 { font-size: 1.4rem; }
  .calc-tabs { padding-inline: 18px; }
  .calc-card > div[style*="overflow-x"] { padding-inline: 18px !important; }
  .article-hero {
    aspect-ratio: 4 / 3;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    transform: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

/* ograniczenie ruchu */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal, .has-js .reveal { opacity: 1 !important; transform: none !important; }
}
