/* =========================
   Base / Theme
   ========================= */
:root {
  --bg: #0f1115;         /* dark graphite */
  --bg-alt: #12141a;
  --surface: #161a22;
  --border: rgba(255,255,255,0.06);
  --text: #e6e6ea;
  --muted: #9aa0a6;
  --muted-2: #6b7280;
  --accent: #60a5fa;     /* blue */
  --accent-2: #22d3ee;   /* cyan */
  --shadow: 0 6px 24px rgba(0,0,0,0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 20px;
  --container: 1100px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% -10%, rgba(34,211,238,0.08), transparent 60%),
              radial-gradient(1000px 600px at 120% 10%, rgba(96,165,250,0.08), transparent 60%),
              var(--bg);
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Typography */
h1,h2,h3 { margin: 0 0 12px; line-height: 1.2; }
p { margin: 0 0 12px; color: var(--muted); }
.lead { font-size: 1.125rem; color: var(--text); }

/* Layout */
.content {
  max-width: var(--container);
  margin-left: 300px; /* space for sidebar */
  padding: 40px 28px;
}

.section {
  margin: 64px 0;
  padding: 28px;
  background: linear-gradient(180deg, var(--surface), rgba(22,26,34,0.7));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Sidebar / TOC */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  padding: 28px 20px;
  background: linear-gradient(180deg, var(--bg-alt), rgba(18,20,26,0.9));
  border-right: 1px solid var(--border);
}

.brand {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 24px;
}

.logo {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(96,165,250,0.35), rgba(34,211,238,0.35));
  color: #8a94b8; font-weight: 800;
}

.brand-text strong { font-size: 1.05rem; letter-spacing: .3px; }
.brand-text .muted { color: var(--muted); font-size: .9rem; display: block; margin-top: 2px; }

.toc { display: grid; gap: 6px; margin-bottom: 18px; }
.toc-link {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid transparent;
}
.toc-link:hover { color: var(--text); background: rgba(255,255,255,0.03); border-color: var(--border); }
.toc-link.active { color: var(--text); background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.35); }

.lang-switch {
    display: flex;
    justify-content: flex-start;
    gap: 6px;
    margin-bottom: 20px;
}

.lang-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    line-height: 0;
    /* <-- usuwa "nadmiarową" wysokość */
}

.lang-btn img {
    width: 18px;
    /* mniejsze */
    height: 12px;
    /* proporcjonalnie */
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
    display: block;
}

.lang-btn:hover img {
    transform: scale(1.15);
}

.lang-btn[aria-pressed="true"] img {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

.social { 
    display: flex; 
    gap: 12px; 
    flex-wrap: wrap; 
    margin-top: 8px; 
}
.social a {
  color: #ccc;
  text-decoration: none;
  font-size: .95rem;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.social a:hover { 
    color: #ccc;
    background: rgba(255,255,255,0.04); 
    border-color: var(--border); 
}
.social-icons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 10px;
}

.social-icons a {
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    padding: 6px 12px;
    border: 1px solid #555;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.social-icons a:hover {
    background: #333;
}
/* Hero */
.hero { padding-top: 32px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
}
.hero-photo {
  justify-self: end;
  max-width: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-photo img { display: block; width: 100%; height: auto; }

.cta { display: flex; gap: 12px; margin: 16px 0 8px; }
.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--border);
}
.btn.primary {
  background: linear-gradient(135deg, rgba(96,165,250,0.25), rgba(34,211,238,0.25));
  color: var(--text);
  border-color: rgba(96,165,250,0.45);
}
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { color: var(--text); background: transparent; }
.btn.ghost:hover { background: rgba(255,255,255,0.04); }

/* GitHub widget */
.gh-widget {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(96,165,250,0.35);
  border-radius: 10px;
  color: var(--muted);
}
.gh-widget a { color: var(--accent); text-decoration: none; }
.gh-widget a:hover { text-decoration: underline; }

/* Facts */
.facts { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.facts li { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.facts li span { filter: saturate(1.2); }

/* Projects Grid */
.grid.projects {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}
.card.project {
  background: linear-gradient(180deg, #151a23, #131821);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card.project:hover {
  transform: translateY(-3px);
  border-color: rgba(96,165,250,0.35);
  box-shadow: 0 12px 34px rgba(0,0,0,0.45);
}
.project .thumb { aspect-ratio: 16/9; background: #0c0f15; border-bottom: 1px solid var(--border); }
.project .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project .body { padding: 14px 16px 16px; }
.project .desc { color: var(--muted); }
.tech { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 10px 0; }
.tech li {
  padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  font-size: .9rem; color: var(--text);
}
.links { display: flex; gap: 10px; }
.links a { color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; }

/* Skills */
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.skill-col { background: rgba(255,255,255,0.02); padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.skill-col h3 { color: var(--text); margin-bottom: 8px; }
.chips { list-style: none; display: flex; gap: 10px; flex-wrap: wrap; padding: 0; margin: 0; }
.chips li { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); }

/* Contact */
.contact-form { display: grid; gap: 12px; max-width: 680px; }
.form-row { display: grid; gap: 6px; }
label { color: var(--text); font-weight: 600; }
input, textarea {
  width: 100%; background: #0f141d; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.contact-links { margin-top: 12px; }
.contact-links a { color: var(--accent); text-decoration: none; margin-right: 12px; }
.contact-links a:hover { text-decoration: underline; }

/* Footer */
.footer { text-align: center; color: var(--muted-2); margin: 40px 0 10px; }

/* Responsive */
@media (max-width: 1200px) {
  .grid.projects { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .content { margin-left: 0; padding-top: 80px; }
  .sidebar {
    position: fixed; inset: 0 auto auto 0; height: auto; width: 100%;
    display: grid; grid-template-columns: 1fr auto auto; align-items: center;
    gap: 12px; padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--border);
  }
  .brand { margin: 0; }
  .toc { grid-template-columns: repeat(6, auto); overflow-x: auto; padding-bottom: 4px; }
  .lang-switch { margin: 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { justify-self: start; max-width: 220px; }
  .skills { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid.projects { grid-template-columns: 1fr; }
}
