:root {
  --bg: #faf8f5;
  --bg-alt: #f2eee8;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6b7280;
  --line: #e7e1d8;
  --primary: #1e3a5f;
  --accent: #c8a165;
  --accent-soft: rgba(200, 161, 101, .14);
  --shadow: 0 10px 40px rgba(30, 58, 95, .08);
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --radius: 18px;
  --radius-lg: 22px;
}
[data-theme="dark"] {
  --bg: #12161d;
  --bg-alt: #171c25;
  --card: #1d2330;
  --text: #ecebe8;
  --muted: #9aa3b2;
  --line: #2a3140;
  --primary: #8fb3e0;
  --accent: #d9b57c;
  --accent-soft: rgba(217, 181, 124, .12);
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.7; transition: background .3s, color .3s; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--accent); }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.center { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 36px; }

/* ===== Nav ===== */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: .3s; }
.nav.scrolled { background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { font-family: var(--serif); font-size: 28px; color: var(--primary); }
.logo span { color: var(--accent); }
.links { display: flex; align-items: center; gap: 28px; }
.links a { font-size: 15px; font-weight: 500; color: var(--muted); position: relative; transition: color .2s; }
.links a:not(.nav-cta)::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px; background: var(--accent); transition: width .25s; }
.links a:hover, .links a.active { color: var(--text); }
.links a:hover::after, .links a.active::after { width: 100%; }
.nav-cta { background: var(--primary); color: var(--bg) !important; padding: 9px 20px; border-radius: 30px; font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.lang-btn { display: inline-flex; align-items: center; gap: 3px; height: 40px; padding: 0 12px; border-radius: 30px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-family: var(--sans); font-size: 13px; font-weight: 700; cursor: pointer; transition: .2s; }
.lang-btn:hover { border-color: var(--accent); }
.lang-opt { transition: color .2s; }
.lang-opt.active { color: var(--accent); }
.lang-sep { opacity: .4; font-weight: 400; font-size: 11px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 17px; color: var(--text); display: grid; place-items: center; transition: .2s; }
.icon-btn:hover { border-color: var(--accent); }
.menu-btn { display: none; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: 40px; font-weight: 600; font-size: 15px; font-family: inherit; cursor: pointer; border: 2px solid transparent; transition: .25s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--primary); color: var(--bg); box-shadow: 0 10px 25px rgba(30, 58, 95, .25); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: var(--bg); }
.btn-light { background: #fff; color: #1e3a5f; }
.btn-ghost-light { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); }

/* ===== Hero & O mnie (Połączone) ===== */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 120px 0 90px; position: relative;
  background: radial-gradient(circle at 85% 20%, var(--accent-soft), transparent 45%), radial-gradient(circle at 10% 90%, rgba(30,58,95,.06), transparent 40%); }
.hero-inner { display: grid; grid-template-columns: 1.25fr 0.85fr; gap: 56px; align-items: center; }
.hero-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 6px 16px;
  border-radius: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  margin-bottom: 16px;
}
.hero-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  animation: ping 2.5s infinite;
}
.hero-status-text {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
}
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(54px, 8.5vw, 96px); line-height: 1.05; color: var(--primary); margin-bottom: 4px; }
.role { font-size: clamp(16px, 2vw, 19px); font-weight: 600; margin: 14px 0 20px; color: var(--primary); }

.hero-bio { display: flex; flex-direction: column; gap: 14px; max-width: 620px; }
.hero-bio p { color: var(--muted); font-size: 15.5px; line-height: 1.8; margin: 0; }
.hero-bio p:first-of-type { color: var(--text); font-size: 16.5px; }
.hero-bio strong { color: var(--text); font-weight: 600; }
.hero-bio em { color: var(--accent); font-style: italic; }

.hero-actions-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.hero-actions-group .cta { margin-top: 0; }
.hero-socials {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 30px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.hero-social-btn svg {
  color: var(--accent);
  transition: transform .25s ease;
}
.hero-social-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(200, 161, 101, .15);
}
.hero-social-btn:hover svg {
  transform: scale(1.15);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.avatar {
  width: min(340px, 80vw);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(145deg, var(--accent), var(--primary));
  box-shadow: 0 20px 50px rgba(30, 58, 95, .18), 0 0 0 1px rgba(200, 161, 101, .25);
  position: relative;
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease;
}
.avatar:hover {
  transform: scale(1.02);
  box-shadow: 0 26px 60px rgba(30, 58, 95, .24), 0 0 0 2px var(--accent);
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  background: var(--card);
}
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

/* ===== Sections ===== */
.section { padding: 100px 0; position: relative; }
.section.alt { background: var(--bg-alt); }
.section-label { display: inline-block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-bottom: 12px; }
.section-label::before { content: ""; display: inline-block; width: 28px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: 10px; }
.section-title { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.5vw, 48px); line-height: 1.2; color: var(--primary); margin-bottom: 48px; }

/* ===== Timeline (Doświadczenie & Edukacja) ===== */
.timeline { position: relative; margin-top: 10px; }
.timeline::before { content: ""; position: absolute; left: 200px; top: 14px; bottom: 14px; width: 2px; background: var(--line); }
.t-item { display: grid; grid-template-columns: 200px 1fr; gap: 48px; margin-bottom: 36px; position: relative; }
.t-item:last-child { margin-bottom: 0; }
.t-item::before { content: ""; position: absolute; left: 193px; top: 28px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-alt); border: 3px solid var(--accent); z-index: 1; }
.t-item:first-child::before { background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.t-date { text-align: right; padding: 22px 14px 0 0; display: flex; flex-direction: column; gap: 4px; }
.t-date b { color: var(--primary); font-size: 15px; line-height: 1.3; }
.t-date span { color: var(--muted); font-size: 13.5px; }
.t-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; box-shadow: var(--shadow); }
.t-card:hover { box-shadow: 0 14px 35px rgba(30, 58, 95, .1); transform: translateX(4px); border-color: var(--accent); }
.t-card h3 { font-size: 19px; line-height: 1.35; color: var(--primary); }
.company { color: var(--accent); font-weight: 600; font-size: 14.5px; margin: 4px 0 16px; }
.role-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); padding: 3px 12px; border-radius: 20px; margin-bottom: 10px; }
.t-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.t-card li { color: var(--muted); font-size: 14.5px; line-height: 1.6; padding-left: 20px; position: relative; }
.t-card li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Experience & Education Timelines Specific */
.exp-t-head, .edu-t-head { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.exp-logo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #ffffff;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--line);
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.t-card:hover .exp-logo-wrap {
  transform: scale(1.08);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(200, 161, 101, 0.25);
}
.exp-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.exp-t-head h3, .edu-t-head h3 { font-family: var(--serif); font-size: 21px; margin: 4px 0 2px; }
.exp-t-head .company, .edu-t-head .company { margin-bottom: 0; font-size: 14.5px; }

.edu-t-card { position: relative; }
.edu-t-head .edu-logo-wrap { width: 54px; height: 54px; border-radius: 50%; background: #ffffff; padding: 4px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); border: 2px solid rgba(200, 161, 101, 0.35); overflow: hidden; flex-shrink: 0; transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.edu-t-card:hover .edu-logo-wrap { transform: scale(1.08); border-color: var(--accent); box-shadow: 0 6px 18px rgba(200, 161, 101, 0.25); }
.edu-logo { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; display: block; }
.edu-logo-wrap.edu-logo-fallback { background: var(--accent-soft); font-size: 24px; border: 1px solid var(--line); }
.edu-spec-highlight { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 10px 18px; border-radius: 0 8px 8px 0; margin: 14px 0 16px; font-size: 14px; color: var(--text); line-height: 1.5; }
.edu-spec-highlight strong { color: var(--accent); }

/* ===== Skills (Technical Capabilities Matrix) ===== */
.skills-intro { max-width: 860px; margin-bottom: 44px; }
.skills-lead { font-size: 16px; line-height: 1.7; margin-top: -32px; }

.skills-matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.sm-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}
.sm-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--line);
  transition: background .3s ease;
}
.sm-card:hover {
  transform: translateY(-4px);
  border-color: rgba(200, 161, 101, .45);
  box-shadow: 0 16px 36px rgba(30, 58, 95, .08);
}
.sm-card:hover::before {
  background: linear-gradient(90deg, var(--accent), var(--primary));
}
.sm-card.featured-enterprise::before {
  background: linear-gradient(90deg, #1e3a5f, var(--accent));
}
.sm-card.featured-ai::before {
  background: linear-gradient(90deg, #8b5cf6, var(--accent));
}

.sm-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.sm-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  border: 1px solid rgba(200, 161, 101, .25);
}
.sm-icon-wrap.sm-icon-brand {
  background: #ffffff;
  padding: 6px;
  border-color: rgba(200, 161, 101, .4);
}
.sm-brand-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.sm-title-box { display: flex; flex-direction: column; gap: 3px; }
.sm-category-tag {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--accent);
}
.sm-category-tag.accent-tag {
  color: var(--primary);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  align-self: flex-start;
  font-weight: 800;
}
.sm-category-tag.ai-tag {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  align-self: flex-start;
  font-weight: 800;
}
.sm-title-box h3 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  color: var(--primary);
  margin: 0;
  line-height: 1.2;
}
.skills-dash-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skills-dash-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
}
.skills-dash-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}

/* ===== Projects (IoTLab — Concise Showcase) ===== */
.projects-header { max-width: 860px; margin-bottom: 32px; }

.project-showcase {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(30, 58, 95, .07);
  display: flex;
  flex-direction: column;
  max-width: 860px;
  padding: 40px 42px;
  position: relative;
  overflow: hidden;
  transition: border-color .3s ease, box-shadow .3s ease, transform .2s ease;
}
.project-showcase::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}
.project-showcase:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 48px rgba(30, 58, 95, .1);
}

.ps-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ps-univ-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(200, 161, 101, .45);
  padding: 5px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--accent);
}
.ps-put-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(200, 161, 101, .5);
}
.ps-stack-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
}
.ps-title {
  font-family: var(--serif);
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: 400;
  color: var(--primary);
  line-height: 1.3;
  margin: 0 0 16px;
}
.ps-description {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 24px;
}
.proj-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.proj-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}
.proj-feature-list .feat-icon {
  font-size: 19px;
  line-height: 1.35;
  flex-shrink: 0;
}
.proj-tech-line {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  margin-bottom: 26px;
}
.proj-tech-line strong {
  color: var(--primary);
  font-weight: 700;
  margin-right: 6px;
}
.ps-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
}
.footer-links a {
  color: var(--muted);
  transition: color .2s;
}
.footer-links a:hover {
  color: var(--accent);
}

/* ===== Reveal Animation ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .hero { min-height: auto; padding: 110px 0 60px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .hero-bio { max-width: 100%; }
}
@media (max-width: 800px) {
  .section { padding: 75px 0; }
  .section-title { font-size: 32px; margin-bottom: 36px; }
  .skills-lead { margin-top: -20px; font-size: 15px; }
  .menu-btn { display: block; }
  .links { position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 24px 20px; display: none; }
  .links.open { display: flex; }
  .links a { padding: 12px 0; width: 100%; text-align: center; }
  .nav-cta { margin-top: 8px; }
  .hero-bio p { font-size: 15px; }
  .timeline::before { left: 7px; top: 8px; bottom: 8px; }
  .t-item { grid-template-columns: 1fr; gap: 10px; padding-left: 32px; margin-bottom: 28px; }
  .t-item::before { left: 0; top: 6px; }
  .t-date { text-align: left; padding: 0; flex-direction: row; gap: 10px; align-items: baseline; }
  .t-card { padding: 22px 20px; }
  .skills-matrix-grid { grid-template-columns: 1fr; gap: 20px; }
  .project-showcase { padding: 30px 20px; }
  .footer-inner { flex-direction: column; text-align: center; gap: 12px; }
  .avatar { width: min(280px, 70vw); }
}

/* ===== Print ===== */
@media print {
  .nav, .hero-visual, .cta, #projects, .footer { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { min-height: auto; padding: 0; background: none; }
  .hero-inner { display: block; }
  .section { padding: 24px 0; background: #fff !important; }
  .reveal { opacity: 1; transform: none; }
  .t-card, .edu-t-card, .sm-card, .project-showcase { box-shadow: none; break-inside: avoid; }
  .edu-card.featured { background: #fff; color: #000; border: 1px solid #ccc; }
}
