:root{
  --primary:#0d6efd; --secondary:#1c1f26; --accent:#ffdd57; --text:#e4e6eb; --card:#2a2d35;
  --nav-h:64px; --radius:14px; --shadow:0 4px 12px rgba(0,0,0,.3);
}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:"Segoe UI",Roboto,Arial,sans-serif;background:var(--secondary);color:var(--text);line-height:1.6;scroll-behavior:smooth}
section{max-width:1100px;margin:2rem auto;padding:0 1rem;scroll-margin-top:calc(var(--nav-h)+14px)}
h1{margin:0;font-size:2.5rem}
h2{font-weight:400;margin:.5rem 0;font-size:1.2rem;color:#f1f3f5}
h3{color:var(--accent);margin:0 0 1rem 0;font-size:1.5rem}
.progress{position:fixed;top:0;left:0;width:100%;height:3px;background:rgba(255,255,255,.08);z-index:1100}
.progress__bar{height:100%;width:0;background:linear-gradient(90deg,var(--accent),#ffd36b)}
nav{
  position:sticky;top:0;z-index:1000;background:#11141a;height:var(--nav-h);
  display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:0 .75rem 0 1rem;
  box-shadow:0 2px 6px rgba(0,0,0,.6)
}
.brand{display:flex;align-items:center;gap:.6rem;font-weight:700}
.brand i{color:var(--accent)}
.menu{display:flex;gap:1.1rem;align-items:center;overflow:hidden}
.menu a{
  position:relative;color:var(--text);text-decoration:none;font-weight:500;padding:.35rem .25rem;border-radius:.5rem;
}
.menu a.active{color:var(--accent)}
.menu a::after{content:"";position:absolute;left:0;bottom:-2px;height:2px;width:0;background:var(--accent);transition:width .25s}
.menu a:hover::after{width:100%}
.menu a:visited{color:var(--text)}
.lang-switch{cursor:pointer;color:var(--accent);font-weight:700;padding:.35rem .6rem;border:1px solid rgba(255,255,255,.1);border-radius:999px}
.hamburger{display:none;width:42px;height:42px;border:1px solid rgba(255,255,255,.1);border-radius:10px;align-items:center;justify-content:center;cursor:pointer;transition:transform .2s}
.hamburger:active{transform:scale(.96)}
.burger{position:relative;width:22px;height:2px;background:#fff;border-radius:2px}
.burger::before,.burger::after{content:"";position:absolute;left:0;width:22px;height:2px;background:#fff;border-radius:2px;transition:transform .25s,opacity .25s,top .25s}
.burger::before{top:-7px}.burger::after{top:7px}
.nav-open .burger{background:transparent}
.nav-open .burger::before{top:0;transform:rotate(45deg)}
.nav-open .burger::after{top:0;transform:rotate(-45deg)}
.panel{position:fixed;top:var(--nav-h);left:0;right:0;background:#1b1f26;border-bottom:1px solid #2b2f3a;display:none;flex-direction:column;gap:.6rem;padding:1rem;z-index:999;box-shadow:0 8px 24px rgba(0,0,0,.35)}
.nav-open .panel{display:flex}
.panel a{padding:.5rem 0}
header{
  background:linear-gradient(135deg,var(--primary),#0077cc);
  color:#fff;text-align:center;padding:3rem 1rem 4rem;position:relative;overflow:hidden
}
/* Slimmer hero for blog pages */
header.blog-hero{ padding:2rem 1rem 2.6rem; }
header::after{content:"";position:absolute;inset:-20% -20% auto -20%;height:80%;background:radial-gradient(60% 60% at 50% 20%,rgba(255,255,255,.12),transparent 60%);transform:translateY(var(--parallax,0px));transition:transform .15s ease;pointer-events:none}
header img{width:150px;height:150px;border-radius:50%;border:4px solid #fff;box-shadow:0 6px 18px rgba(0,0,0,.4);margin-bottom:1rem;transform:translateY(var(--pfp-parallax,0px));transition:transform .15s ease}
.card{background:var(--card);border-radius:var(--radius);padding:1.5rem;margin:.9rem 0;box-shadow:var(--shadow);opacity:0;transform:translateY(18px);transition:opacity .7s ease,transform .7s ease, box-shadow .2s ease}
.card.show{opacity:1;transform:translateY(0)}
.card:hover{box-shadow:0 8px 22px rgba(0,0,0,.45)}
.job{display:flex;gap:1rem;align-items:flex-start}
.job-logo img{width:60px;height:60px;object-fit:contain;background:#fff;border-radius:8px;padding:6px}
.job h4{margin:.1rem 0 .25rem 0;color:#9ec5fe}
.job span{font-size:.92rem;color:#bdbdbd}
.skills-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1rem}
.skills-grid li{list-style:none;margin:.25rem 0}
.skills-grid i{color:var(--accent);margin-right:.5rem}
.taglist{display:flex;flex-wrap:wrap;gap:.5rem}
.tag{background:#1f232c;border:1px solid #2f3340;border-radius:999px;padding:.25rem .6rem;font-size:.85rem}
.totop{position:fixed;right:18px;bottom:18px;width:46px;height:46px;border-radius:50%;background:#0f1420;border:1px solid #283044;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 22px rgba(0,0,0,.35);opacity:0;pointer-events:none;transition:opacity .25s, transform .2s; z-index:1000}
.totop.show{opacity:1;pointer-events:auto}
.totop:active{transform:scale(.96)}
.totop i{color:#fff}
.link-contrast-demo{}
/* Accessible link styles (improved visited/active contrast) */
a{color:#9ec5fe}
a:visited{color:#c59aff}
a:hover{color:var(--accent)}
a:active{color:#ffd36b}
a:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}

/* Underline links inside content for clarity (not menu) */
.prose a, article a, .card a{ text-decoration: underline; text-underline-offset: 3px; }
/* Ensure images in markdown content are visible and responsive */
/* Default markdown images */
.prose img{display:block;height:auto;border-radius:10px}
/* Inline, wrapped images inside post content */
.prose img.inline-right{float:right;max-width:154px;width:20%;margin:.25rem 0 .75rem 1rem}
.prose img.inline-left{float:left;max-width:154px;width:20%;margin:.25rem 1rem .75rem 0}
/* Clear floats at logical boundaries */
.prose h2,.prose h3,.prose hr{clear:both}
@media (max-width: 800px){
  .prose img.inline-right,.prose img.inline-left{float:none;width:100%;max-width:100%;margin:1rem 0}
}
/* Blog post page: smaller article title */
article h1#title{font-size:1.85rem;line-height:1.25;margin:.4rem 0 .6rem}
@media (max-width: 600px){
  article h1#title{font-size:1.65rem}
}
/* Center the blog list card within the page layout */
section#blog-list.card{ margin-left:auto; margin-right:auto; }

/* Blog list: improve tag filter contrast and focus */
#tagFilter{
  background:#1b1f26 !important;
  color:var(--text) !important;
  border:1px solid #2f3340 !important;
  border-radius:8px;
  padding:.5rem .75rem;
}
#tagFilter:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}
#tagFilter option{
  background:#11141a;
  color:var(--text);
}

/* Blog list: make search more visible */
#q{
  background:#1b1f26 !important;
  color:var(--text) !important;
  border:1px solid #2f3340 !important;
  border-radius:8px;
  padding:.6rem .9rem !important;
  min-width:300px !important;
}
#q::placeholder{ color:#cfd2d6; opacity:1; }
#q:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}

.pl{display:none}
.lang-pl .pl{display:grid}
.lang-pl .en{display:none}
@media (prefers-reduced-motion: reduce){
  .card,.menu a::after,header img,header::after{transition:none}
}
@media (max-width:900px){
  .menu.desktop{display:none}
  .hamburger{display:flex}
}

/* Responsive cover containers for blog */
/* Reset default figure margins to avoid right shift in Chrome */
.cover{ display:block; width:100%; aspect-ratio: var(--cover-ratio, 16/9); overflow:hidden; margin:0; }
.cover > img{ width:100%; height:100%; object-fit:cover; object-position:center; display:block; }
/* Post page cover: slightly wider on desktop */
.cover-post{ --cover-ratio: 16/9; border-radius:10px; margin:0 auto 1rem; max-width: 720px; }
@media (min-width: 900px){ .cover-post{ --cover-ratio: 21/9; } }
/* List card cover: top corners only to blend with card */
.cover-list{ --cover-ratio: 16/9; border-radius:8px 8px 0 0; }
