/* 1) „Reset” i sensowne domyślne zachowanie */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
  color: #111;
  background: #e5e6ec;
}

/* Sticky header + nav container */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgb(200, 200, 200);
  width: 100%;
}

/* 2) Prosty układ: ograniczenie szerokości + oddech */
main {
  max-width: 900px;
  margin: 96px auto 0 auto;
  padding: 24px;
}

p {
  margin: 0 auto 1em auto;
  max-width: 65ch;
  text-align: justify;
}

/* 3) Nagłówek */
header {
  background: rgb(200, 200, 200);
  padding: 6px;
  border-bottom: 1px solid #e6e6e6;
  text-align: center;
  margin: 0;
}

header h1 {
  margin: 0;
  font-size: 16px;
}

/* 4) Nawigacja */
nav {
  background: white;
  padding: 6px 12px;
  border-bottom: 1px solid #e6e6e6;

  /* Centrowanie zawartości nav (działa także jeśli linki są bez .nav-inner) */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 0;
}

/* Opcjonalny wewnętrzny kontener nav (jeśli używasz <div class="nav-inner"> w HTML) */
.nav-inner {
  display: flex;
  justify-content: center;
  gap: 16px;
}

nav a {
  color: #111;
  text-decoration: none;
  padding: 2px 10px;
  border-radius: 14px;
  background: #cae1fd;
  transition: background 500ms;
  border-style: solid;
  border-width: 1px;
  border-color: #111;
}

nav a.active {
  background: #ddeccd;
  border-color: #333333;
  font-weight: 600;
}

nav a:hover {
  background: #eeffeb;
}

/* 5) Sekcje jako „karty” */
section {
  background: white;
  margin: 24px 0;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #ececec;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  transition: transform 200ms, box-shadow 200ms;
}
/*
section:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}*/

section h2 {
  margin-top: 0;
}

/* Projects layout */
.projects-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}

.projects-nav h3 {
  margin-top: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
}

/* Keep the project navigation visible while scrolling */
.projects-nav {
  position: sticky;
  top: 110px;        /* kompensuje wysokość topbara + margines */
  align-self: flex-start;
}

.projects-nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.projects-nav li {
  margin: 6px 0;
}

.projects-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: #111;
  font-size: 0.9rem;
  transition: background 140ms ease, transform 120ms ease;
}

.projects-nav a:hover {
  background: #f0f2ff;
  transform: translateX(2px);
}

.projects-content {
  min-width: 0;
}

.linkedin-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  padding: 0.55rem 0.9rem;

  background-color: #0a66c2;
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;

  transition: background-color 0.15s ease, transform 0.1s ease;
}

.linkedin-button:hover {
  background-color: #084b8a;
  transform: translateY(-1px);
}

.linkedin-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.project {
  margin-bottom: 24px;
  scroll-margin-top: 110px; /* kompensacja fixed headera przy skoku do kotwicy */
}

.project:last-child {
  margin-bottom: 0;
}

/* Responsive adjustments for Projects layout */
@media (max-width: 768px) {
  .projects-layout {
    grid-template-columns: 1fr;
  }

  .projects-nav {
    order: -1;
  }

  .projects-nav a {
    padding: 8px 12px;
  }
}

/* Publications typography */
#publications h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 4px 0;
}

#publications .authors {
  font-size: 0.85rem;
  margin: 0;
  max-width: none;
}

#publications .journal {
  font-size: 0.85rem;
  margin: 2px 0 0 0;
  max-width: none;
}

#publications .doi {
  font-size: 0.8rem;
  margin: 2px 0 0 0;
  text-align: left;
  max-width: none;
}

#publications p {
  margin-left: 0;
  margin-right: 0;
}

/* Spacing between publications */
.publication {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eeeeee;
}

.publication:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

/* Lista: odstępy między elementami (bez podskakiwania) */
ul {
  margin: 0;
  padding-left: 20px;
}

ul li {
  margin: 10px 0;
}

ul li:hover {
  color: #2f5cff;
  cursor: pointer;
}

/* 6) Obrazek */
img {
  display: block;
  max-width: 240px;
  height: auto;
  border-radius: 12px;
  margin: 24px auto;
}

.project-image {
  max-width: 100%;
  height: auto;
  margin: 16px auto 24px;
}

/* 7) Przycisk */
button {
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  background: #2f5cff;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 200ms, filter 200ms;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* 8) Stopka */
footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 24px 32px;
  color: #555;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #2f5cff;
  outline-offset: 2px;
}

/* Fade for dynamic content */
#content {
  opacity: 1;
  transition: opacity 0.35s ease-in-out;
}

