/* ============================================================
   STYLE.CSS — Bernardeta Wiekiera Portfolio
   Wersja: 1.0 | Kolorystyka: jasna, biznesowa, elegancka
   ============================================================ */

/* ---- 1. ZMIENNE CSS ---- */
:root {
  --bg:         #F8FAFC;
  --navy:       #1F3A5F;
  --dark-navy:  #0F172A;
  --blue:       #3B82F6;
  --text:       #334155;
  --white:      #FFFFFF;
  --border:     #E2E8F0;
  --muted:      #64748B;
  --light-blue: #EFF6FF;
  --blue-mid:   #DBEAFE;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow:    0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.09), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.11);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --nav-h:      72px;
  --max-w:      1200px;
  --section-py: 96px;

  --transition: 0.22s ease;
}

/* ---- 2. RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; }

/* ---- 3. TYPOGRAFIA ---- */
h1, h2, h3, h4, h5 { color: var(--dark-navy); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p  { line-height: 1.75; }

/* ---- 4. LAYOUT ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}
.section        { padding: var(--section-py) 0; }
.section-white  { background: var(--white); }
.section-bg     { background: var(--bg); }

.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p  { color: var(--muted); font-size: 1.05rem; max-width: 580px; margin: 0 auto; }

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

/* ---- 5. NAVBAR ---- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(248,250,252,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
#navbar.scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow);
  background: rgba(248,250,252,0.97);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 28px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 1.1rem; font-weight: 800; color: var(--dark-navy); letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-logo span { color: var(--blue); }
#nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 0.88rem; font-weight: 500; color: var(--text);
  padding: 7px 14px; border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover  { color: var(--navy); background: var(--light-blue); }
.nav-link.active { color: var(--blue); background: var(--light-blue); font-weight: 600; }

.lang-btn {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--navy); background: var(--white);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 14px; cursor: pointer;
  transition: all var(--transition); margin-left: 8px;
}
.lang-btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px; background: none; border: none;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--dark-navy); border-radius: 2px; transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- 6. BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition); border: none;
  text-decoration: none; line-height: 1;
}
.btn-primary {
  background: var(--navy); color: var(--white);
  box-shadow: 0 2px 10px rgba(31,58,95,0.28);
}
.btn-primary:hover { background: var(--dark-navy); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(31,58,95,0.35); }

.btn-outline {
  background: transparent; color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); transform: translateY(-2px); }

.btn-blue {
  background: var(--blue); color: var(--white);
  box-shadow: 0 2px 10px rgba(59,130,246,0.3);
}
.btn-blue:hover { background: #2563EB; transform: translateY(-2px); }

.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); border-color: var(--text); }

.btn-sm { padding: 8px 16px; font-size: 0.82rem; border-radius: var(--radius-sm); }

/* ---- 7. TAGI ---- */
.tag {
  display: inline-block; font-size: 0.71rem; font-weight: 600;
  letter-spacing: 0.03em; padding: 4px 10px; border-radius: 100px;
  background: var(--light-blue); color: #1D4ED8; white-space: nowrap;
}
.tag-navy  { background: rgba(31,58,95,0.09); color: var(--navy); }
.tag-muted { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.tags      { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- 8. FADE-IN ANIMACJA ---- */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.55s ease, transform 0.55s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ============================================================
   SEKCJE STRONY GŁÓWNEJ
   ============================================================ */

/* ---- 9. HERO ---- */
#hero {
  min-height: 100vh; display: flex; align-items: center;
  padding-top: var(--nav-h); overflow: hidden; position: relative;
}
.hero-blob {
  position: absolute; right: -180px; top: 10%; width: 680px; height: 680px;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 68%);
  pointer-events: none; border-radius: 50%;
}
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 72px; align-items: center; padding: 72px 0;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--blue);
  background: var(--light-blue); border: 1px solid var(--blue-mid);
  padding: 6px 14px; border-radius: 100px; margin-bottom: 20px;
}
.hero-name {
  font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800;
  color: var(--dark-navy); letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 14px;
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem); font-weight: 500;
  color: var(--navy); margin-bottom: 20px; line-height: 1.45;
}
.hero-desc {
  font-size: 0.97rem; color: var(--muted);
  max-width: 510px; margin-bottom: 36px; line-height: 1.78;
}
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 52px; }

/* Statystyki hero */
.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px; text-align: center;
  box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-num {
  font-size: 1.85rem; font-weight: 800; color: var(--navy);
  display: block; line-height: 1; margin-bottom: 6px;
}
.stat-label { font-size: 0.73rem; color: var(--muted); font-weight: 500; line-height: 1.35; }

/* Hero zdjęcie */
.hero-img-wrap { display: flex; justify-content: center; align-items: center; position: relative; }
.hero-img-glow {
  position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(31,58,95,0.09) 0%, rgba(59,130,246,0.07) 50%, transparent 70%);
  z-index: 0;
}
.hero-img-frame {
  position: relative; z-index: 1;
  width: 320px; height: 390px; border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-xl);
  border: 4px solid var(--white);
}
.hero-img-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(145deg, #d6e4f5 0%, #b0c9e5 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #6b8fbf; font-size: 0.82rem; font-weight: 500;
}
.hero-img-placeholder i { font-size: 40px; opacity: 0.5; }

/* ---- 10. PROJEKTY (grid na stronie głównej) ---- */
#projects { background: var(--bg); }
.projects-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-bottom: 44px; }
.project-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.28s, box-shadow 0.28s;
  display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.project-card-img {
  width: 100%; height: 210px; overflow: hidden;
  background: linear-gradient(135deg, #d8e7f7 0%, #bdd2ed 100%);
  display: flex; align-items: center; justify-content: center;
  color: #6b8fbf; font-size: 0.8rem; font-weight: 500;
  position: relative;
}
.project-card-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.project-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.project-card-title {
  font-size: 0.97rem; font-weight: 700; color: var(--dark-navy);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.3;
}
.project-card-desc {
  font-size: 0.87rem; color: var(--muted); line-height: 1.68;
  margin-bottom: 16px; flex: 1;
}
.project-card-tags { margin-bottom: 20px; }
.project-card-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.projects-cta { text-align: center; }

/* Karta-teaser "wkrótce" */
.project-card--teaser { border-style: dashed; }
.project-card--teaser:hover { transform: translateY(-3px); }
.project-card-img--teaser {
  width: 100%; height: 210px;
  background: linear-gradient(135deg, var(--light-blue) 0%, var(--blue-mid) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue); font-size: 2.4rem;
}
.project-card--teaser .project-card-title { color: var(--navy); opacity: 0.75; }
.project-card--teaser .project-card-desc  { font-style: italic; }

/* ---- 10a. KARUZELA PROJEKTÓW ---- */
.carousel-outer {
  position: relative;
  padding: 0 56px;
  margin-bottom: 28px;
}
.carousel-stage {
  overflow: hidden;
  height: 500px; /* fallback, JS nadpisuje po renderze */
}
.carousel-track {
  display: flex;
  gap: 0;
  align-items: center;
  height: 100%;
  will-change: transform;
}
.carousel-track.is-animating {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.carousel-stage .project-card {
  flex: none; /* szerokość ustawia JS */
  min-width: 0;
  transition: transform 0.5s ease,
              opacity   0.5s ease,
              filter    0.5s ease;
}
/* Podczas cichego skoku pętli wyłącz transitions na kartach */
.carousel-stage.is-jumping .project-card {
  transition: none !important;
}
.project-card.cs-active {
  transform: scale(1.06);
  opacity: 1;
  filter: none;
  position: relative;
  z-index: 2;
}
.project-card.cs-prev,
.project-card.cs-next {
  transform: scale(0.88);
  opacity: 0.52;
  filter: brightness(0.58);
  cursor: pointer;
}
.project-card.cs-hidden {
  transform: scale(0.75);
  opacity: 0;
  pointer-events: none;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  font-size: 0.9rem;
  z-index: 10;
}
.carousel-btn:hover  { background: var(--navy); color: var(--white); box-shadow: var(--shadow-lg); }
.carousel-prev { left: 0; }
.carousel-next { right: 0; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}
.carousel-dot {
  width: 8px; height: 8px;
  border-radius: 4px;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), width var(--transition);
}
.carousel-dot.active {
  background: var(--navy);
  width: 24px;
}

/* ---- 11. DOŚWIADCZENIE (oś czasu) ---- */
#experience { background: var(--white); }
.timeline {
  position: relative; max-width: 820px; margin: 0 auto;
}
.timeline::before {
  content: ''; position: absolute;
  left: 32px; top: 12px; bottom: 12px; width: 2px;
  background: linear-gradient(to bottom, var(--blue) 0%, var(--navy) 70%, transparent 100%);
}
.timeline-item { position: relative; padding-left: 88px; margin-bottom: 44px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute; left: 24px; top: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); border: 3px solid var(--white);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2); z-index: 1;
}
.timeline-period {
  display: inline-block; font-size: 0.73rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue); background: var(--light-blue);
  padding: 4px 12px; border-radius: 100px; margin-bottom: 12px;
}
.timeline-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px 30px;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--transition);
}
.timeline-card:hover { box-shadow: var(--shadow-md); }
.timeline-role   { font-size: 1.15rem; font-weight: 700; color: var(--dark-navy); margin-bottom: 4px; }
.timeline-company{ font-size: 0.88rem; color: var(--navy); font-weight: 600; margin-bottom: 14px; }
.timeline-desc   { font-size: 0.9rem; color: var(--text); line-height: 1.72; margin-bottom: 18px; }


/* ---- 11a. REFERENCJE ---- */
#references { background: var(--bg); }
.references-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-bottom: 26px;
}
.reference-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 30px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.reference-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59,130,246,0.35);
}
.reference-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--light-blue);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 17px;
}
.reference-text {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.78;
  font-style: italic;
}
.reference-footer {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.reference-footer strong {
  display: block;
  color: var(--navy);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

/* ---- 12. O MNIE ---- */
#about { background: var(--bg); }
.about-grid { display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: start; }
.about-content h2    { margin-bottom: 24px; }
.about-content p     { font-size: 0.97rem; color: var(--text); margin-bottom: 18px; }
.about-content p:last-child { margin-bottom: 0; }

.about-quote-card {
  background: var(--navy); border-radius: var(--radius-lg);
  padding: 36px 32px; color: var(--white);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.about-quote-card::before {
  content: '"'; position: absolute; top: -20px; left: 20px;
  font-size: 100px; color: rgba(255,255,255,0.08);
  font-family: Georgia, serif; line-height: 1; pointer-events: none;
}
.about-quote-text {
  font-size: 1.02rem; line-height: 1.72;
  color: rgba(255,255,255,0.9); font-style: italic; position: relative; z-index: 1;
}
.about-quote-attr {
  margin-top: 22px; font-size: 0.82rem; font-weight: 600;
  color: rgba(255,255,255,0.5); letter-spacing: 0.07em; text-transform: uppercase;
}

/* ---- 13. TECHNOLOGIE ---- */
#skills { background: var(--white); }
.skills-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.skill-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 12px; text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.skill-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(59,130,246,0.4); }
.skill-icon {
  width: 42px; height: 42px; background: var(--light-blue); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; font-size: 18px; color: var(--navy);
}
.skill-name { font-size: 0.82rem; font-weight: 700; color: var(--dark-navy); margin-bottom: 5px; }
.skill-desc { font-size: 0.68rem; color: var(--muted); line-height: 1.45; }


/* ---- 13a. WYKSZTAŁCENIE ---- */
#education { background: var(--bg); }
.education-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.education-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.education-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59,130,246,0.35);
}
.education-period {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--light-blue);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}
.education-title {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.education-school {
  font-size: 0.88rem;
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 14px;
}
.education-desc {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.72;
  margin-bottom: 18px;
}

/* ---- 14. KONTAKT ---- */
#contact { background: var(--bg); }
.contact-wrap {
  max-width: 700px; margin: 0 auto;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 60px 56px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.contact-wrap h2 { margin-bottom: 12px; }
.contact-sub  { color: var(--muted); font-size: 1.05rem; margin-bottom: 20px; }
.contact-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.83rem; color: #059669; background: #ECFDF5;
  border: 1px solid #A7F3D0; border-radius: 100px;
  padding: 6px 16px; margin-bottom: 40px; font-weight: 500;
}
.contact-badge::before {
  content: ''; width: 8px; height: 8px;
  background: #10B981; border-radius: 50%; flex-shrink: 0;
}
.contact-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }
.contact-link-box {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 600; color: var(--text);
  transition: all var(--transition); min-width: 150px; justify-content: center;
}
.contact-link-box:hover {
  border-color: var(--navy); color: var(--navy);
  background: var(--white); box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.contact-link-box i { font-size: 17px; color: var(--navy); flex-shrink: 0; }

/* ---- 15. FOOTER ---- */
footer {
  background: var(--dark-navy); color: rgba(255,255,255,0.5);
  text-align: center; padding: 24px 28px; font-size: 0.82rem;
}

/* ============================================================
   PODSTRONY (hero nagłówkowy)
   ============================================================ */

.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--dark-navy) 100%);
  padding: calc(var(--nav-h) + 52px) 0 60px;
  text-align: center; color: var(--white);
}
.page-hero h1  { color: var(--white); margin-bottom: 14px; }
.page-hero p   { color: rgba(255,255,255,0.72); font-size: 1.05rem; max-width: 540px; margin: 0 auto; }

/* ============================================================
   PODSTRONA: PORTFOLIO
   ============================================================ */

.portfolio-list { display: flex; flex-direction: column; gap: 32px; }
.portfolio-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.28s, box-shadow 0.28s;
}
.portfolio-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.portfolio-card-inner { display: grid; grid-template-columns: 320px 1fr; }

.portfolio-card-img {
  background: linear-gradient(135deg, #d8e7f7 0%, #bdd2ed 100%);
  min-height: 280px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #6b8fbf; font-size: 0.85rem; font-weight: 500;
}
.portfolio-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.portfolio-card-content { padding: 36px 40px; display: flex; flex-direction: column; }
.portfolio-card-title {
  font-size: 1.3rem; font-weight: 800; color: var(--dark-navy);
  text-transform: uppercase; letter-spacing: 0.01em; margin-bottom: 26px;
}
.portfolio-meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; align-items: baseline; margin-bottom: 22px; }
.meta-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.meta-value { font-size: 0.9rem; color: var(--text); line-height: 1.55; }
.portfolio-card-footer {
  margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; align-items: center;
}

/* ============================================================
   PODSTRONA: CERTYFIKATY
   ============================================================ */

.cert-list { display: flex; flex-direction: column; gap: 26px; }
.cert-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.28s, box-shadow 0.28s;
  display: grid; grid-template-columns: 280px 1fr;
}
.cert-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.cert-card-img {
  background: #f4f6f9;
  position: relative; overflow: hidden;
  border-right: 1px solid var(--border);
  cursor: zoom-in;
}
.cert-card-img img { width: 100%; height: auto; display: block; }

.cert-img-fallback {
  display: none;
  padding: 64px 24px; text-align: center;
  font-size: 2.5rem; color: #6b8fbf; opacity: 0.5;
}
.cert-img-missing .cert-img-fallback { display: block; }
.cert-img-missing { cursor: default; }

.cert-zoom-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); color: white; font-size: 1.8rem;
  opacity: 0; transition: background 0.25s, opacity 0.25s;
  pointer-events: none;
}
.cert-card-img:not(.cert-img-missing):hover .cert-zoom-hint {
  background: rgba(0,0,0,0.32); opacity: 1;
}

/* ---- Lightbox certyfikatu ---- */
.cert-lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(10, 15, 30, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 40px; cursor: zoom-out;
  opacity: 0; visibility: hidden;
  transition: opacity 0.22s, visibility 0.22s;
  backdrop-filter: blur(4px);
}
.cert-lightbox.open { opacity: 1; visibility: visible; }
.cert-lightbox img {
  max-width: min(90vw, 900px); max-height: 90vh;
  object-fit: contain; border-radius: 4px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.6);
  cursor: default;
}
.cert-lightbox-close {
  position: absolute; top: 18px; right: 22px;
  background: rgba(255,255,255,0.15); border: none; color: white;
  width: 44px; height: 44px; border-radius: 50%; font-size: 1.1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.cert-lightbox-close:hover { background: rgba(255,255,255,0.3); }

.cert-card-content { padding: 28px 36px; }
.cert-card-title { font-size: 1.12rem; font-weight: 700; color: var(--dark-navy); margin-bottom: 18px; }
.cert-meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; align-items: baseline; }

/* ============================================================
   PODSTRONA: CASE STUDY
   ============================================================ */

.cs-layout {
  display: grid; grid-template-columns: 230px 1fr;
  gap: 52px; align-items: start; padding: 64px 0;
}
.cs-sidebar {
  position: sticky; top: calc(var(--nav-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.cs-sidebar-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px; display: block;
}
.cs-sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.cs-sidebar-nav a {
  display: block; font-size: 0.82rem; color: var(--text);
  padding: 7px 12px; border-radius: var(--radius-sm);
  transition: all 0.15s; border-left: 2px solid transparent;
}
.cs-sidebar-nav a:hover  { background: var(--light-blue); color: var(--blue); border-left-color: var(--blue); }
.cs-sidebar-nav a.active { background: var(--light-blue); color: var(--blue); font-weight: 600; border-left-color: var(--blue); }

.cs-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; font-weight: 600; color: var(--muted);
  margin-bottom: 32px; transition: color var(--transition);
}
.cs-back-link:hover { color: var(--navy); }

.cs-title   { font-size: clamp(1.75rem,4vw,2.5rem); margin-bottom: 18px; }
.cs-intro-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.cs-intro-p { font-size: 0.97rem; color: var(--text); line-height: 1.8; margin-bottom: 36px; }

.cs-hero-img {
  width: 100%; border-radius: var(--radius-lg);
  margin-bottom: 52px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.cs-hero-img img { width: 100%; max-height: 460px; object-fit: cover; display: block; }
.cs-hero-img-placeholder {
  width: 100%; height: 380px;
  background: linear-gradient(135deg, #d8e7f7 0%, #b0c9e5 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: #6b8fbf; font-size: 0.88rem; font-weight: 500;
}
.cs-hero-img-placeholder i { font-size: 40px; opacity: 0.45; }

.cs-section { margin-bottom: 56px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.cs-section-title {
  font-size: 1.2rem; font-weight: 700; color: var(--dark-navy);
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.cs-num {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; background: var(--navy); color: var(--white);
  border-radius: 50%; font-size: 0.73rem; font-weight: 700; flex-shrink: 0;
}
.cs-section p { font-size: 0.95rem; line-height: 1.82; margin-bottom: 12px; }
.cs-section ul { padding: 0; }
.cs-section ul li {
  padding: 9px 0 9px 22px; position: relative;
  font-size: 0.95rem; color: var(--text); line-height: 1.68;
  border-bottom: 1px solid var(--border);
}
.cs-section ul li:last-child { border-bottom: none; }
.cs-section ul li::before { content: '→'; position: absolute; left: 0; color: var(--blue); font-size: 0.85rem; }

.cs-screenshot-ph {
  width: 100%; min-height: 340px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #e2eaf5 0%, #c8d9ee 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: #6b8fbf; font-size: 0.88rem; font-weight: 500;
  border: 1px solid var(--border);
}
.cs-screenshot-ph i { font-size: 36px; opacity: 0.45; }

.cs-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  padding-top: 40px; margin-top: 40px; border-top: 2px solid var(--border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* --- Tablet --- */
@media (max-width: 1024px) {
  :root { --section-py: 80px; }
  .projects-grid   { grid-template-columns: repeat(2,1fr); }
  /* carousel stage height set by JS */
  .skills-grid     { grid-template-columns: repeat(4,1fr); }
  .education-grid  { grid-template-columns: 1fr; }
  .about-grid      { grid-template-columns: 1fr; gap: 44px; }
  .portfolio-card-inner { grid-template-columns: 280px 1fr; }
  .cs-layout       { grid-template-columns: 200px 1fr; gap: 36px; }
  .hero-grid       { gap: 48px; }
}


/* --- Mobile/tablet navigation --- */
@media (max-width: 900px) {
  .nav-inner { padding: 0 18px; }
  .hamburger { display: flex; position: relative; z-index: 1002; }

  #nav-menu {
    position: fixed;
    top: calc(var(--nav-h) + 10px);
    left: 14px;
    right: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 6px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1001;
    max-height: calc(100vh - var(--nav-h) - 28px);
    overflow-y: auto;
  }

  #nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #nav-menu li { width: 100%; }
  .nav-link { display: block; width: 100%; padding: 12px 14px; }
  .lang-btn { display: block; width: 100%; margin: 4px 0 0; text-align: center; padding: 12px 14px; }
}

/* --- Mobile --- */
@media (max-width: 768px) {
  :root { --section-py: 64px; }


  /* Hero */
  .hero-grid { grid-template-columns: 1fr; gap: 44px; padding: 48px 0; text-align: center; }
  .hero-img-wrap { order: -1; }
  .hero-img-frame { width: 230px; height: 280px; }
  .hero-img-glow  { width: 270px; height: 270px; }
  .hero-desc, .hero-btns { margin-left: auto; margin-right: auto; }
  .hero-btns { justify-content: center; }

  /* Stats */
  .hero-stats { grid-template-columns: repeat(3,1fr); }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }
  .carousel-outer { padding: 0 44px; }
  .carousel-btn { width: 36px; height: 36px; font-size: 0.8rem; }

  /* Timeline */
  .timeline::before { left: 16px; }
  .timeline-item { padding-left: 52px; }
  .timeline-dot  { left: 9px; width: 14px; height: 14px; }

  /* About */
  .about-grid { grid-template-columns: 1fr; }
  .references-grid { grid-template-columns: 1fr; }
  .powerbi-embed-wrap { height: 520px; }

  /* Skills */
  .skills-grid { grid-template-columns: repeat(2,1fr); }

  /* Contact */
  .contact-wrap { padding: 40px 28px; }

  /* Portfolio page */
  .portfolio-card-inner { grid-template-columns: 1fr; }
  .portfolio-card-img   { min-height: 200px; }

  /* Certs */
  .cert-card { grid-template-columns: 1fr; }
  .cert-card-img { border-right: none; border-bottom: 1px solid var(--border); }
  .cert-card-content { padding: 24px; }

  /* Case study */
  .cs-layout  { grid-template-columns: 1fr; gap: 0; }
  .cs-sidebar { display: none; }
}

@media (max-width: 480px) {
  .hero-stats  { grid-template-columns: 1fr; max-width: 240px; margin: 0 auto; }
  .powerbi-embed-wrap { height: 460px; }
  .cs-button-row { flex-direction: column; align-items: stretch; }
  .cs-button-row .btn { justify-content: center; }
  .contact-links { flex-direction: column; }
  .contact-link-box { width: 100%; }
  .portfolio-card-content { padding: 24px; }
  .cs-footer { flex-direction: column; align-items: flex-start; }
}


/* ============================================================
   PODSTRONA PROJEKTU 1 — CASE STUDY INDYWIDUALNE
   ============================================================ */
.cs-content { min-width: 0; }
.project-hero p { max-width: 760px; }
.project1-case h3 {
  font-size: 1.02rem;
  margin: 26px 0 10px;
  color: var(--navy);
}
.project1-case p { margin-bottom: 14px; }
.cs-figure { margin: 28px 0 42px; }
.cs-main-figure { margin-top: 28px; }
.cs-figure figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}
.cs-wide-img,
.cs-video-wrap {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow);
}
.cs-wide-img img {
  width: 100%;
  height: auto;
  display: block;
}
.cs-video-wrap { padding: 18px; }
.cs-video-wrap video {
  width: 100%;
  max-height: 620px;
  display: block;
  background: #000;
  border-radius: var(--radius);
}
.cs-video-note {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
@media (max-width: 768px) {
  .cs-figure { margin: 22px 0 34px; }
  .cs-video-wrap { padding: 12px; }
}

/* ---- Korekty projektu 1 v6 ---- */
.project1-case .cs-section ul {
  margin: 8px 0 20px 0;
  padding-left: 22px;
  list-style: disc;
}
.project1-case .cs-section ol {
  margin: 8px 0 20px 0;
  padding-left: 24px;
}
.project1-case .cs-section ul li {
  padding: 3px 0;
  border-bottom: none;
  line-height: 1.7;
}
.project1-case .cs-section ol li {
  padding: 3px 0 3px 4px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}
.project1-case .cs-section ul li::before { content: none; }
.project1-case .cs-demo-gif img {
  width: 100%;
  height: auto;
  display: block;
}
.project1-case .cs-main-figure figcaption { display: none; }

/* ---- Projekt 1 v8: film osadzony jak GIF ---- */
.project1-case .cs-demo-video {
  margin: 28px 0 42px;
}
.project1-case .cs-video-giflike {
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.project1-case .cs-video-giflike video {
  width: 100%;
  height: auto;
  display: block;
  background: var(--white);
  border-radius: 0;
}


/* ---- Projekt 2: osadzony raport Power BI ---- */
.powerbi-embed-wrap {
  height: 640px;
  background: #f8fafc;
  padding: 0;
}
.powerbi-embed-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #f8fafc;
}
.cs-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Project case study sidebar active state */
.cs-sidebar-nav a.active {
  background: var(--light-blue);
  color: var(--blue);
  font-weight: 700;
  border-left-color: var(--blue);
}


/* ============================================================
   V19 — responsywność podstron Portfolio/Certyfikaty + menu
   ============================================================ */
html, body { max-width: 100%; overflow-x: clip; }

/* Długie linki i nazwy nie powinny rozpychać kart na telefonie */
.portfolio-card,
.cert-card,
.portfolio-card-content,
.cert-card-content,
.meta-value,
.cert-meta,
.cert-card-title,
.portfolio-card-title {
  min-width: 0;
}
.meta-value,
.cert-meta dd,
.portfolio-meta,
.cert-meta,
.portfolio-card-title,
.cert-card-title {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* W menu aktywna ma być tylko bieżąca strona; aktywny link nie dziedziczy się po URL folderu */
#nav-menu .nav-link.active {
  color: var(--blue);
  background: var(--light-blue);
  font-weight: 700;
}

@media (max-width: 900px) {
  #nav-menu .nav-link.active {
    border-left: 3px solid var(--blue);
    padding-left: 11px;
  }
}

@media (max-width: 768px) {
  .page-hero {
    padding: calc(var(--nav-h) + 34px) 0 42px;
  }
  .page-hero h1 {
    font-size: clamp(2rem, 10vw, 2.7rem);
  }
  .page-hero p {
    font-size: 0.98rem;
    padding: 0 8px;
  }

  .portfolio-list,
  .cert-list {
    gap: 22px;
  }

  .portfolio-card-inner,
  .cert-card {
    grid-template-columns: 1fr !important;
  }

  .portfolio-card-img {
    min-height: 190px;
    aspect-ratio: 16 / 9;
  }

  .portfolio-card-content,
  .cert-card-content {
    padding: 24px;
  }

  .portfolio-card-title,
  .cert-card-title {
    font-size: 1.08rem;
    line-height: 1.35;
    margin-bottom: 18px;
  }

  .portfolio-meta,
  .cert-meta {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .meta-label {
    margin-top: 10px;
  }
  .portfolio-meta .meta-label:first-child,
  .cert-meta .meta-label:first-child {
    margin-top: 0;
  }

  .portfolio-card-footer {
    justify-content: stretch;
  }
  .portfolio-card-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .cert-card-img {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .cert-card-img img {
    width: 100%;
    height: auto;
  }

  .cert-lightbox {
    padding: 18px;
  }
  .cert-lightbox img {
    max-width: 96vw;
    max-height: 86vh;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .page-hero {
    padding: calc(var(--nav-h) + 28px) 0 36px;
  }

  .portfolio-card-content,
  .cert-card-content {
    padding: 20px;
  }

  .portfolio-card-img {
    min-height: 170px;
  }

  .portfolio-card-title,
  .cert-card-title {
    font-size: 1rem;
  }

  .meta-value {
    font-size: 0.88rem;
  }
}

/* CV download buttons */
.hero-btns .btn {
  white-space: nowrap;
}

@media (max-width: 520px) {
  .hero-btns {
    width: 100%;
  }
  .hero-btns .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---- Responsywność osadzonego raportu Power BI ---- */
@media (max-width: 768px) {
  .powerbi-embed-wrap { height: 520px; }
}

@media (max-width: 480px) {
  .powerbi-embed-wrap { height: 460px; }
  .cs-button-row { flex-direction: column; align-items: stretch; }
  .cs-button-row .btn { justify-content: center; }
}

/* ---- Projekt 3: tabele wyników i kolorowanie składni SQL ---- */
.cs-table-wrap {
  width: 100%;
  margin: 22px 0 30px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.cs-table-wrap:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 3px;
}
.cs-data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.5;
}
.cs-data-table th,
.cs-data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.cs-data-table th {
  background: var(--light-blue);
  color: var(--dark-navy);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cs-data-table tbody tr:nth-child(even) { background: #f8fafc; }
.cs-data-table tbody tr:last-child td { border-bottom: 0; }
.cs-data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.sql-code-block {
  margin: 22px 0 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-lg);
  background: #f7f9fc;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.sql-code-block code {
  display: block;
  min-width: 720px;
  padding: 24px 26px;
  color: #24324a;
  font-family: "Consolas", "Cascadia Code", "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.7;
  tab-size: 4;
}
.sql-keyword  { color: #005cc5; font-weight: 700; }
.sql-function { color: #6f42c1; font-weight: 600; }
.sql-string   { color: #087f5b; }
.sql-number   { color: #c2410c; }
.sql-alias    { color: #9a6700; }

@media (max-width: 768px) {
  .cs-data-table { font-size: 0.82rem; }
  .cs-data-table th,
  .cs-data-table td { padding: 10px 12px; }
  .sql-code-block code { padding: 20px; font-size: 0.8rem; }
}


/* ============================================================
   PROJEKT 4 — responsywny podgląd kodu zamiast screenshotu
   ============================================================ */
.project-code-preview {
  width: 100%; height: 100%;
  min-height: 210px;
  padding: 24px 26px;
  background: linear-gradient(145deg, #0f172a 0%, #172554 100%);
  color: #dbeafe;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.project-code-preview--portfolio { min-height: 280px; }
.project-code-badge {
  align-self: flex-start;
  margin-bottom: 16px;
  padding: 5px 10px;
  border: 1px solid rgba(147,197,253,.35);
  border-radius: 999px;
  color: #bfdbfe;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
}
.project-code-preview pre {
  margin: 0;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.project-code-preview code {
  color: #e2e8f0;
  font-family: "Consolas", "Cascadia Code", "Courier New", monospace;
  font-size: .82rem;
  line-height: 1.7;
}

/* The project navigation remains visible while the detailed page is scrolled. */
@media (min-width: 769px) {
  .cs-sidebar {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    align-self: start;
    z-index: 2;
  }
}

@media (max-width: 768px) {
  .project-code-preview { padding: 20px; min-height: 200px; }
  .project-code-preview--portfolio { min-height: 220px; }
  .project-code-preview code { font-size: .76rem; }
}
