/* =============================================
   iPraktyk.pl - Główny arkusz stylów
   Dark tech-editorial aesthetic
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Surfaces */
  --bg:          #07101f;
  --bg2:         #0c1a30;
  --bg3:         #112040;
  --bg-header:   #030810;
  --bg-code:     #081828;
  --bg-footer:   #040a15;
  --bg-cookie:   #0d1f35;
  /* Borders */
  --border:      #1e3358;
  --shadow:      0 4px 32px rgba(0,0,0,.45);
  /* Accents */
  --cyan:        #00c8ff;
  --cyan-dim:    rgba(0,200,255,.12);
  --orange:      #ff7b3a;
  --green:       #3dffb0;
  /* Text */
  --text:        #d8e4f4;
  --muted:       #6b83a6;
  --heading:     #f0f6ff;
  --white:       #f0f6ff;
  /* Misc */
  --radius:      10px;
  --code-color:  #3dffb0;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── TYPOGRAPHY ── */
h1,h2,h3,h4 {
  font-family: 'Syne', sans-serif;
  color: var(--heading);
  line-height: 1.25;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 600; }

p { margin-bottom: 1rem; }
a { color: var(--cyan); text-decoration: none; transition: color .2s; }
a:hover { color: var(--orange); }
code, pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: .88rem;
}
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  max-width: 100%;
  white-space: pre;
  word-break: normal;
  margin: 1.5rem 0;
  color: var(--code-color);
  line-height: 1.6;
  box-sizing: border-box;
}
code:not(pre code) {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--cyan);
}

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 2.5rem; align-items: start; }
.layout > * { min-width: 0; overflow: hidden; }
.layout > .sidebar { overflow: visible; }
@media(max-width:900px){ .layout { grid-template-columns: 1fr; } }

/* ── HEADER ── */
.site-header {
  background: linear-gradient(180deg, var(--bg-header) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem; font-weight: 800;
  color: var(--heading);
  letter-spacing: -.02em;
  transition: color .2s;
}
.logo span {
  color: var(--cyan);
  transition: color .2s;
}
.logo:hover { color: var(--orange); }
.logo:hover span { color: var(--cyan); }

nav { display: flex; gap: .2rem; }
nav a {
  color: var(--muted);
  font-size: .88rem; font-weight: 500;
  padding: .45rem .8rem;
  border-radius: 6px;
  transition: all .2s;
}
nav a:hover, nav a.active {
  color: var(--heading);
  background: var(--bg3);
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--heading); margin: 5px 0;
  transition: .3s;
}
@media(max-width:700px){
  .nav-toggle { display: block; }
  nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0;
        background: var(--bg2); padding: 1rem; border-bottom: 1px solid var(--border); }
  nav.open { display: flex; }
}

/* ── HERO ── */
.hero {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0,200,255,.15), transparent),
              radial-gradient(ellipse 60% 80% at 90% 60%, rgba(255,123,58,.07), transparent);
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--cyan-dim); border: 1px solid rgba(0,200,255,.3);
  color: var(--cyan); font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .35rem .9rem; border-radius: 100px;
  margin-bottom: 1.2rem;
}
.hero-badge::before { content:''; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.4)} }
.hero h1 { margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero p.lead {
  font-size: 1.12rem; color: var(--muted);
  max-width: 640px; margin-bottom: 2rem;
}
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.5rem; border-radius: 8px;
  font-weight: 600; font-size: .92rem;
  transition: all .2s; cursor: pointer;
}
.btn-primary {
  background: var(--cyan); color: #07101f;
}
.btn-primary:hover { background: #33d4ff; color: #07101f; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,200,255,.3); }
.btn-ghost {
  border: 1px solid var(--border); color: var(--text);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── STATS BAR ── */
.stats-bar {
  display: flex; gap: 2.5rem; flex-wrap: wrap;
  margin-top: 2.5rem; padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.stat-item { display: flex; flex-direction: column; }
.stat-num {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 1.7rem; color: var(--heading);
}
.stat-num span { color: var(--cyan); }
.stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ── SECTION TITLES ── */
.section-title {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.8rem;
}
.section-title h2 { font-size: 1.3rem; }
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.tag-pill {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: .2rem .65rem;
  border-radius: 100px;
}
.tag-arduino { background: rgba(0,200,255,.15); color: var(--cyan); border: 1px solid rgba(0,200,255,.3); }
.tag-linux { background: rgba(61,255,176,.12); color: var(--green); border: 1px solid rgba(61,255,176,.25); }
.tag-windows { background: rgba(255,123,58,.12); color: var(--orange); border: 1px solid rgba(255,123,58,.25); }
.tag-smart { background: rgba(180,120,255,.12); color: #c084fc; border: 1px solid rgba(180,120,255,.25); }
.tag-lifehack { background: rgba(255,220,50,.1); color: #fde047; border: 1px solid rgba(255,220,50,.2); }

/* ── ARTICLE CARDS ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.card-grid-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  display: flex; flex-direction: column;
}
.card:hover {
  border-color: rgba(0,200,255,.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.card-meta {
  display: flex; align-items: center; gap: .7rem;
  margin-bottom: .9rem;
}
.card-date { font-size: .78rem; color: var(--muted); }
.card h3 { margin-bottom: .6rem; font-size: 1.05rem; }
.card h3 a { color: var(--heading); }
.card h3 a:hover { color: var(--cyan); }
.card p { font-size: .88rem; color: var(--muted); flex: 1; }
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.read-more {
  font-size: .82rem; font-weight: 600; color: var(--cyan);
  display: flex; align-items: center; gap: .3rem;
}
.read-more::after { content:'→'; transition: transform .2s; }
.card:hover .read-more::after { transform: translateX(4px); }
.read-time { font-size: .75rem; color: var(--muted); }

/* ── FEATURED CARD ── */
.card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border-color: rgba(0,200,255,.25);
  padding: 2rem;
}
@media(max-width:600px){ .card-featured { grid-template-columns: 1fr; } }
.card-featured .card-content { display: flex; flex-direction: column; justify-content: center; }
.card-featured h2 { font-size: 1.5rem; margin-bottom: .8rem; }
.card-featured h2 a { color: var(--heading); }
.card-featured p { font-size: .95rem; }
.card-icon-block {
  background: var(--bg3);
  border-radius: 8px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; min-height: 160px;
}

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.widget-title {
  font-family: 'Syne', sans-serif;
  font-size: .85rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 1.1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
}
.category-list { list-style: none; }
.category-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem 0; border-bottom: 1px solid var(--border);
}
.category-list li:last-child { border-bottom: none; }
.category-list a { color: var(--text); font-size: .9rem; display: flex; align-items: center; gap: .6rem; }
.category-list a:hover { color: var(--cyan); }
.category-count {
  font-size: .75rem; background: var(--bg3);
  padding: .15rem .5rem; border-radius: 100px; color: var(--muted);
}

.partner-links { list-style: none; }
.partner-links li {
  padding: .6rem 0; border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.partner-links li:last-child { border-bottom: none; }
.partner-links a { color: var(--muted); }
.partner-links a:hover { color: var(--cyan); }
.partner-links .pl-icon { color: var(--cyan); margin-right: .4rem; }

.tip-box {
  background: linear-gradient(135deg, rgba(0,200,255,.08), rgba(61,255,176,.05));
  border: 1px solid rgba(0,200,255,.2);
  border-radius: var(--radius); padding: 1.2rem;
  font-size: .88rem; color: var(--text);
}
.tip-box strong { color: var(--cyan); }

/* ── BREADCRUMB ── */
.breadcrumb {
  padding: 1rem 0; font-size: .83rem;
  display: flex; gap: .5rem; align-items: center;
  color: var(--muted); flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--cyan); }
/* separatory "/" */
.breadcrumb span:not(:last-child) { color: var(--border); }
/* aktywna podstrona — ostatni span */
.breadcrumb span:last-child {
  color: var(--text);
  font-weight: 600;
  background: rgba(0,200,255,.08);
  border: 1px solid rgba(0,200,255,.18);
  border-radius: 5px;
  padding: .1rem .55rem;
  letter-spacing: .01em;
}

/* ── ARTICLE PAGE ── */
.article-header { padding: 2.5rem 0 2rem; border-bottom: 1px solid var(--border); }
.article-meta {
  display: flex; flex-wrap: wrap; gap: .8rem;
  align-items: center; margin: 1rem 0;
  font-size: .83rem; color: var(--muted);
}
.article-body { padding: 2.5rem 0; }
.article-body h2 { margin: 2rem 0 .8rem; }
.article-body h3 { margin: 1.5rem 0 .6rem; color: var(--cyan); }
.article-body ul, .article-body ol {
  padding-left: 1.5rem; margin-bottom: 1rem;
}
.article-body li { margin-bottom: .4rem; }
.article-body img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }

.info-box {
  background: rgba(0,200,255,.07);
  border: 1px solid rgba(0,200,255,.25);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius); padding: 1.1rem 1.3rem;
  margin: 1.5rem 0; font-size: .92rem;
}
.warning-box {
  background: rgba(255,123,58,.07);
  border: 1px solid rgba(255,123,58,.25);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius); padding: 1.1rem 1.3rem;
  margin: 1.5rem 0; font-size: .92rem;
}
.step-block {
  display: flex; gap: 1.1rem;
  margin-bottom: 1.5rem;
}
.step-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--cyan-dim); border: 1px solid rgba(0,200,255,.3);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .9rem;
  color: var(--cyan);
}
.step-body h4 { margin-bottom: .3rem; }

/* ── TABLE ── */
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .88rem; }
th {
  background: var(--bg3); color: var(--cyan);
  font-family: 'Syne', sans-serif; font-weight: 600;
  padding: .7rem 1rem; text-align: left; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .06em;
}
td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── CATEGORY HERO ── */
.cat-hero {
  padding: 2.5rem 0;
  background: radial-gradient(ellipse 70% 80% at 15% 50%, rgba(0,200,255,.08), transparent);
  border-bottom: 1px solid var(--border);
}
.cat-hero .cat-icon { font-size: 3rem; margin-bottom: .8rem; display: block; }

/* ── TOC ── */
.toc {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius); padding: 1.3rem 1.5rem;
  margin-bottom: 2rem;
}
.toc-title {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: .82rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--cyan); margin-bottom: .8rem;
}
.toc ol { padding-left: 1.3rem; }
.toc li { margin-bottom: .3rem; }
.toc a { color: var(--muted); font-size: .88rem; }
.toc a:hover { color: var(--cyan); }

/* ── AD PLACEHOLDER ── */
.ad-block {
  background: var(--bg2); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  text-align: center; color: var(--muted);
  font-size: .78rem; margin: 1.5rem 0;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
}

/* ── FOOTER ── */
.site-footer {
  background: var(--bg-footer);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem; margin-bottom: 2rem;
}
@media(max-width:700px){ .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { font-size: .88rem; color: var(--muted); margin-top: .8rem; max-width: 300px; }
.footer-col h4 {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: .9rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: var(--muted); font-size: .87rem; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; color: var(--muted); flex-wrap: wrap; gap: .8rem;
}

/* ── UTILS ── */
.mt-1{margin-top:.5rem} .mt-2{margin-top:1rem} .mt-3{margin-top:1.5rem} .mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem} .mb-2{margin-bottom:1rem} .mb-3{margin-bottom:1.5rem} .mb-4{margin-bottom:2rem}
.py-3{padding-top:1.5rem;padding-bottom:1.5rem}
.py-4{padding-top:2rem;padding-bottom:2rem}
.py-6{padding-top:3rem;padding-bottom:3rem}

.text-cyan { color: var(--cyan); }
.text-muted { color: var(--muted); }
.text-sm { font-size: .88rem; }

/* ── HIGHLIGHT GRID ── */
.highlight-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin: 1.5rem 0; }
@media(max-width:600px){ .highlight-grid { grid-template-columns: 1fr 1fr; } }
.highlight-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem; text-align: center;
}
.highlight-item .hi-icon { font-size: 1.8rem; margin-bottom: .4rem; }
.highlight-item .hi-label { font-size: .8rem; color: var(--muted); }
.highlight-item .hi-val { font-weight: 700; color: var(--heading); font-size: 1.05rem; }

/* ── SCROLL TOP ── */
#scroll-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 42px; height: 42px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: all .3s;
  font-size: 1.1rem; color: var(--cyan);
}
#scroll-top.visible { opacity: 1; }
#scroll-top:hover { background: var(--bg3); border-color: var(--cyan); }

/* ── RELATED POSTS ── */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

/* ========================================
   LIGHT MODE (tryb dzienny)
   Wszystkie zmienne CSS nadpisane tu —
   żadnych hardkodowanych ciemnych kolorów.
======================================== */
html.light-mode {
  /* Surfaces */
  --bg:        #f5f7fa;
  --bg2:       #ffffff;
  --bg3:       #eaf0f7;
  --bg-header: #e8f0f9;
  --bg-code:   #1e293b;
  --bg-footer: #1e293b;
  --bg-cookie: #1e293b;
  /* Borders */
  --border:    #c8d6e8;
  --shadow:    0 4px 24px rgba(0,0,0,.1);
  /* Accents */
  --cyan:      #0077cc;
  --cyan-dim:  rgba(0,119,204,.1);
  --orange:    #c05a00;
  --green:     #1a6633;
  /* Text */
  --text:      #1e293b;
  --muted:     #526a87;
  --heading:   #0f172a;
  --white:     #0f172a;
  /* Code */
  --code-color: #86efac;
}

/* Header w trybie dziennym */
html.light-mode .site-header {
  background: linear-gradient(180deg, var(--bg-header) 0%, var(--bg) 100%);
  box-shadow: 0 1px 12px rgba(0,0,0,.08);
}

/* Nawigacja */
html.light-mode nav a { color: #526a87; }
html.light-mode nav a:hover,
html.light-mode nav a.active { color: #0f172a; background: var(--bg3); }

/* Logo */
html.light-mode .logo { color: #1e293b; }
html.light-mode .logo span { color: #0077cc; }
html.light-mode .logo:hover { color: #c05a00; }
html.light-mode .logo:hover span { color: #0077cc; }
/* Logo w stopce — stopka jest ciemna, więc logo musi być jasne */
html.light-mode .site-footer .logo { color: #e2eaf4; }
html.light-mode .site-footer .logo span { color: #60b3ff; }
html.light-mode .site-footer .logo:hover { color: #ff9a5c; }
html.light-mode .site-footer .logo:hover span { color: #60b3ff; }

/* Nav hamburger */
html.light-mode .nav-toggle span { background: #0f172a; }

/* Hero sekcja na stronie głównej */
html.light-mode .hero {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0,119,204,.08), transparent),
    radial-gradient(ellipse 60% 80% at 90% 60%, rgba(192,90,0,.05), transparent);
}

/* Kategoria hero */
html.light-mode .cat-hero {
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
  border-bottom-color: var(--border);
}

/* Karty */
html.light-mode .card { background: #fff; border-color: #c8d6e8; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
html.light-mode .card:hover { box-shadow: 0 8px 24px rgba(0,119,204,.15); border-color: #0077cc; }
html.light-mode .card h3 a { color: #0f172a; }
html.light-mode .card p { color: #526a87; }
html.light-mode .card-footer { border-top-color: #c8d6e8; }
html.light-mode .card-featured { background: linear-gradient(135deg,#f0f8ff,#eaf0f7); border-color: rgba(0,119,204,.2); }
html.light-mode .card-featured h2 a { color: #0f172a; }
html.light-mode .card-icon-block { background: #eaf0f7; border-color: #c8d6e8; }

/* TOC */
html.light-mode .toc { background: #eaf6ff; border-color: #c8d6e8; border-left-color: #0077cc; }
html.light-mode .toc-title { color: #0077cc; }
html.light-mode .toc a { color: #526a87; }
html.light-mode .toc a:hover { color: #0077cc; }

/* Info/warning boxy */
html.light-mode .info-box {
  background: #e8f4fd; border-color: rgba(0,119,204,.3);
  border-left-color: #0077cc; color: #1e293b;
}
html.light-mode .warning-box {
  background: #fff4ea; border-color: rgba(192,90,0,.25);
  border-left-color: #c05a00; color: #3a1a00;
}

/* Sidebar widget */
html.light-mode .widget { background: #fff; border-color: #c8d6e8; }
html.light-mode .widget-title { color: #0077cc; border-bottom-color: #c8d6e8; }
html.light-mode .category-list li { border-bottom-color: #c8d6e8; }
html.light-mode .category-list a { color: #1e293b; }
html.light-mode .category-count { background: #eaf0f7; color: #526a87; }
html.light-mode .partner-links li { border-bottom-color: #c8d6e8; }
html.light-mode .partner-links a { color: #526a87; }
html.light-mode .tip-box { background: linear-gradient(135deg,rgba(0,119,204,.07),rgba(26,102,51,.05)); border-color: rgba(0,119,204,.2); }
html.light-mode .tip-box strong { color: #0077cc; }

/* Highlight grid */
html.light-mode .highlight-item { background: #fff; border-color: #c8d6e8; }
html.light-mode .highlight-item .hi-label { color: #526a87; }
html.light-mode .highlight-item .hi-val { color: #0f172a; }

/* Tabele */
html.light-mode th { background: #eaf0f7; color: #0077cc; }
html.light-mode td { color: #1e293b; border-bottom-color: #c8d6e8; }
html.light-mode tr:hover td { background: rgba(0,119,204,.04); }

/* Tagi */
html.light-mode .tag-arduino { background: rgba(0,119,204,.1); color: #005fa3; border-color: rgba(0,119,204,.3); }
html.light-mode .tag-linux   { background: rgba(22,101,52,.08); color: #166534; border-color: rgba(22,101,52,.2); }
html.light-mode .tag-windows { background: rgba(192,90,0,.1); color: #c05a00; border-color: rgba(192,90,0,.25); }
html.light-mode .tag-smart   { background: rgba(126,34,206,.08); color: #7e22ce; border-color: rgba(126,34,206,.2); }
html.light-mode .tag-lifehack { background: rgba(161,98,7,.1); color: #a16207; border-color: rgba(161,98,7,.25); }

/* Breadcrumb */
html.light-mode .breadcrumb { color: #526a87; }
html.light-mode .breadcrumb a { color: #526a87; }
html.light-mode .breadcrumb span:not(:last-child) { color: #a0b4c8; }
html.light-mode .breadcrumb span:last-child {
  color: #0f172a;
  background: rgba(0,119,204,.07);
  border-color: rgba(0,119,204,.2);
}

/* Artykuł body */
html.light-mode .article-header { border-bottom-color: #c8d6e8; }
html.light-mode .article-body h3 { color: #0077cc; }

/* Kod */
html.light-mode code:not(pre code) { background: #eaf0f7; color: #0055aa; border-color: #c8d6e8; }

/* Reklamy */
html.light-mode .ad-block { background: #eaf0f7; border-color: #c8d6e8; }

/* Stats bar */
html.light-mode .stats-bar { border-top-color: #c8d6e8; }
html.light-mode .stat-num { color: #0f172a; }
html.light-mode .stat-label { color: #526a87; }

/* Section title */
html.light-mode .section-title::after { background: linear-gradient(90deg, #c8d6e8, transparent); }

/* Scroll top */
html.light-mode #scroll-top { background: #fff; border-color: #c8d6e8; color: #0077cc; }
html.light-mode #scroll-top:hover { background: #eaf0f7; border-color: #0077cc; }

/* Step block */
html.light-mode .step-block { background: #eaf0f7; border-left-color: #0077cc; }
html.light-mode .step-num { background: rgba(0,119,204,.1); border-color: rgba(0,119,204,.3); color: #0077cc; }

/* Stopka — zostaje ciemna (dobry kontrast z białą stroną) */
html.light-mode .site-footer { background: #1e293b; border-top-color: #2d3f55; }
html.light-mode .footer-col a { color: #94a8be; }
html.light-mode .footer-col a:hover { color: #60b3ff; }
html.light-mode .footer-col h4 { color: #94a8be; }
html.light-mode .footer-brand p { color: #94a8be; }
html.light-mode .footer-bottom { border-top-color: #2d3f55; color: #94a8be; }

/* Cookie banner (zawsze ciemny dla kontrastu) */
html.light-mode #cookie-banner p { color: #c8d6e8; }

/* ========================================
   THEME TOGGLE BUTTON
======================================== */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: .3rem .8rem .3rem .6rem;
  cursor: pointer;
  font-size: .82rem;
  color: var(--muted);
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s;
  white-space: nowrap;
  margin-left: .5rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.theme-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(0,200,255,.12), transparent 70%);
  opacity: 0;
  transition: opacity .3s;
}
.theme-toggle:hover {
  background: rgba(0,200,255,.08);
  border-color: rgba(0,200,255,.35);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(0,200,255,.15);
}
.theme-toggle:hover::before { opacity: 1; }

.toggle-icon {
  font-size: 1rem;
  display: inline-block;
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), opacity .3s;
}
.toggle-label {
  transition: color .25s;
}

/* — animacja przy przełączeniu — */
@keyframes spin-in {
  0%   { transform: rotate(-90deg) scale(.4); opacity: 0; }
  100% { transform: rotate(0deg)   scale(1);  opacity: 1; }
}
.theme-toggle.switching .toggle-icon {
  animation: spin-in .38s cubic-bezier(.34,1.56,.64,1) forwards;
}

/* Tryb nocny: ciemne, niemal przezroczyste tło zlewa się z headerem */
html:not(.light-mode) .theme-toggle {
  background: rgba(0,0,0,.25);
  border-color: rgba(255,255,255,.08);
  color: var(--muted);
}
html:not(.light-mode) .theme-toggle:hover {
  background: rgba(0,200,255,.1);
  border-color: rgba(0,200,255,.4);
  color: var(--cyan);
}

/* Tryb dzienny */
html.light-mode .theme-toggle {
  background: rgba(0,0,0,.05);
  border-color: rgba(0,0,0,.12);
  color: #526a87;
}
html.light-mode .theme-toggle:hover {
  background: rgba(0,119,204,.08);
  border-color: rgba(0,119,204,.3);
  color: #0077cc;
}

/* ========================================
   COOKIE CONSENT BANNER
======================================== */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-cookie);
  border-top: 2px solid var(--cyan);
  padding: 1rem 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .88rem;
  box-shadow: 0 -4px 24px rgba(0,0,0,.4);
}
#cookie-banner p { margin: 0; color: #cdd6e0; line-height: 1.5; flex: 1; min-width: 220px; }
#cookie-banner a { color: var(--cyan); text-decoration: underline; }
#cookie-banner a:hover { color: #fff; }
.cookie-actions { display: flex; gap: .6rem; flex-shrink: 0; }
.cookie-btn {
  padding: .45rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: .84rem;
  transition: all .18s;
}
.cookie-accept { background: var(--cyan); color: #07101f; }
.cookie-accept:hover { background: #33d4ff; }
.cookie-decline { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.cookie-decline:hover { border-color: var(--muted); color: var(--text); }

/* ================================================================
   SUBTELNE ANIMACJE TREŚCI
   — Wejście elementów (Intersection Observer)
   — Efekty na h2/h3 w artykułach
   — Pasek postępu czytania
   — Hover na kartach (shimmer)
   — Delikatne tło hero
================================================================ */

/* ── Pasek postępu czytania (góra strony) ── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--orange));
  z-index: 9999;
  transition: width .1s linear;
  box-shadow: 0 0 6px rgba(0,200,255,.5);
  pointer-events: none;
}

/* ── Fade-up: elementy wchodzące w viewport ── */
.anim-fade {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
.anim-fade.in-view {
  opacity: 1;
  transform: translateY(0);
}
/* opóźnienia dla siatek */
.anim-fade:nth-child(2) { transition-delay: .08s; }
.anim-fade:nth-child(3) { transition-delay: .16s; }
.anim-fade:nth-child(4) { transition-delay: .24s; }
.anim-fade:nth-child(5) { transition-delay: .32s; }
.anim-fade:nth-child(6) { transition-delay: .38s; }

/* ── H3 w artykułach: podkreślenie rozwijające się przy scroll ── */
.article-body h3 {
  position: relative;
  padding-left: 1.1rem;
}
.article-body h3::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; bottom: 15%;
  width: 3px;
  background: var(--cyan);
  border-radius: 2px;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.article-body h3.in-view::before {
  transform: scaleY(1);
}

/* ── Karty: shimmer przy hover ── */
.card {
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,.045) 50%,
    transparent 70%
  );
  transition: left .55s ease;
  pointer-events: none;
}
.card:hover::after { left: 150%; }

/* ── Widget sidebar: delikatne wejście ── */
.widget {
  transition: box-shadow .3s, border-color .3s;
}
.widget:hover {
  border-color: rgba(0,200,255,.2);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

/* ── TOC: pojawia się z lekkiego przesunięcia ── */
.toc {
  transition: box-shadow .3s;
}
.toc:hover {
  box-shadow: 0 4px 18px rgba(0,200,255,.08);
}

/* ── Hero: floating glow ── */
@keyframes hero-glow {
  0%, 100% { opacity: .6; transform: scale(1); }
  50%       { opacity: 1;  transform: scale(1.08); }
}
.hero::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  top: -120px; right: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,255,.07) 0%, transparent 70%);
  animation: hero-glow 7s ease-in-out infinite;
  pointer-events: none;
}
.hero { position: relative; overflow: hidden; }

/* ── Stat-num: licznik wchodzi z dołu ── */
.stat-item.in-view .stat-num {
  animation: count-up .5s ease forwards;
}
@keyframes count-up {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ── highlight-item: wejście z lekkiego skali ── */
.highlight-item {
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.highlight-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
  border-color: rgba(0,200,255,.3);
}

/* ── Reduce motion: respektuj preferencje systemowe ── */
@media (prefers-reduced-motion: reduce) {
  .anim-fade { opacity: 1; transform: none; transition: none; }
  .article-body h3::before { transition: none; transform: scaleY(1); }
  .card::after { display: none; }
  .hero::before { animation: none; }
  #reading-progress { transition: none; }
}

/* ── Mini terminal widget ── */
.page-terminal {
  position: absolute;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  width: 240px;
  background: #050d1a;
  border: 1px solid rgba(0,200,255,.2);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 0 0 1px rgba(0,200,255,.06);
  pointer-events: none;
  opacity: .82;
  transition: opacity .3s;
  overflow: hidden;
}
.page-terminal:hover { opacity: .96; }

/* Pasek tytułowy */
.pt-bar {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .65rem;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.pt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pt-dot:nth-child(1) { background: #ff5f57; }
.pt-dot:nth-child(2) { background: #febc2e; }
.pt-dot:nth-child(3) { background: #28c840; }
.pt-title {
  font-size: .65rem;
  color: rgba(255,255,255,.3);
  letter-spacing: .06em;
  margin-left: .25rem;
  flex: 1;
  text-align: center;
}

/* Zawartość terminala */
.pt-body {
  padding: .6rem .75rem .7rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-height: 74px;
}
.pt-line {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  color: rgba(61,255,176,.55);
  line-height: 1.5;
}
.pt-line.done { color: rgba(61,255,176,.38); }
.pt-prompt { color: rgba(0,200,255,.6); flex-shrink: 0; }
.pt-cmd { color: rgba(61,255,176,.82); }
.pt-cursor {
  display: inline-block;
  width: 7px; height: 1em;
  background: var(--cyan);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: blink-cur .9s step-end infinite;
}
@keyframes blink-cur {
  0%,100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* Tryb dzienny */
html.light-mode .page-terminal {
  background: #1e293b;
  border-color: rgba(0,119,204,.25);
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  opacity: .75;
}
html.light-mode .page-terminal:hover { opacity: .92; }

/* Ukryj na małych ekranach — za mało miejsca */
@media (max-width: 860px) { .page-terminal { display: none; } }

/* Cat-hero musi mieć position:relative by absolute child działał */
.cat-hero { position: relative; overflow: visible; }
.hero      { position: relative; overflow: hidden; }
