:root {
  --bg: #f6f2ec;
  --bg-alt: #ede6dc;
  --surface: #faf7f2;
  --text: #4a443d;
  --heading: #3d3832;
  --muted: #847b70;
  --accent: #b08b62;
  --accent-strong: #9a774f;
  --accent-text: #fbf8f3;
  --border: #e2d9cc;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2a2724;
    --bg-alt: #33302c;
    --surface: #2f2c28;
    --text: #d8d0c5;
    --heading: #e6dfd5;
    --muted: #a39a8e;
    --accent: #cfae86;
    --accent-strong: #dcbf9a;
    --accent-text: #2a2724;
    --border: #423e38;
  }
  .logo img, .logo-tile img { filter: invert(.88) sepia(.15); }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent-strong); }
h1, h2, h3 { color: var(--heading); font-weight: 600; }
img { max-width: 100%; display: block; }

html { overflow-y: scroll; scrollbar-gutter: stable; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* nagłówek i zakładki */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "logo tabs lang";
  align-items: center;
  gap: 24px;
  min-height: 64px;
}
.logo { grid-area: logo; display: flex; align-items: center; }
.logo img { height: 26px; width: auto; }
.tabs { grid-area: tabs; display: flex; justify-content: flex-end; gap: 4px; }
.tab {
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--bg-alt); }
.tab[aria-selected="true"] { color: var(--heading); background: var(--bg-alt); font-weight: 500; }
.lang-switch { grid-area: lang; display: flex; gap: 6px; }
.flag {
  width: 34px; height: 24px; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: 5px; overflow: hidden;
  background: none; opacity: .45; filter: saturate(.6);
  transition: opacity .15s, filter .15s;
}
.flag { display: block; line-height: 0; }
.flag svg { display: block; width: 100%; height: 100%; }
.flag:hover { opacity: .8; }
.flag[aria-pressed="true"] { opacity: 1; filter: none; border-color: var(--accent); cursor: default; }

/* treść */

.page { flex: 1; padding-top: 56px; padding-bottom: 72px; }
.page:focus { outline: none; }

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "id photo" "text photo";
  column-gap: 48px;
  align-items: start;
  padding: 24px 0 40px;
}
.hero .avatar { grid-area: photo; }
.hero-id { grid-area: id; align-self: end; }
.hero-text { grid-area: text; align-self: start; }
.name { margin: 0 0 4px; font-size: 18px; font-weight: 600; color: var(--heading); }
.eyebrow { margin: 0 0 8px; color: var(--accent-strong); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.15; margin: 0 0 20px; }
.page-title { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 26px; margin: 0 0 8px; }
h3 { font-size: 18px; margin: 0 0 6px; }
.lead { font-size: 20px; color: var(--muted); max-width: 38em; margin: 0 0 32px; }
.section-lead { color: var(--muted); margin: 0 0 24px; }
.empty { color: var(--muted); padding: 24px; border: 1px dashed var(--border); border-radius: var(--radius); }

.avatar {
  width: 240px; height: 240px; border-radius: 50%;
  object-fit: cover;
  background: var(--bg-alt); border: 1px solid var(--border);
}

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  text-decoration: none; font-weight: 500;
}
.btn:hover { background: var(--accent-strong); }

.block { padding: 32px 0; }

.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 16px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 14px; padding: 4px 12px; border-radius: 999px;
  background: var(--bg-alt); border: 1px solid var(--border);
}

.languages { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 12px 48px; }
.languages li { display: flex; flex-direction: column; }
.languages span { color: var(--muted); font-size: 15px; }
.causes-heading { margin: 8px 0 12px; }

.logo-tile {
  width: 56px; height: 56px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px;
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.logo-initials { font-size: 17px; font-weight: 600; color: var(--accent-strong); letter-spacing: .02em; }
.timeline-wide .achievement.with-logo { grid-template-columns: 170px 56px 1fr; }

.scroll-cue {
  position: fixed; left: 50%; bottom: 16px; z-index: 5;
  width: 44px; height: 44px; margin-left: -22px; padding: 10px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--accent-strong);
  box-shadow: 0 2px 10px rgba(61, 56, 50, .12);
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.scroll-cue svg { display: block; width: 100%; height: 100%; }
.scroll-cue.visible { opacity: 1; pointer-events: auto; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue.visible { animation: none; } }

/* projekty */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  color: inherit; text-decoration: none;
}
.card.has-link:hover { border-color: var(--accent); }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent-strong); }
button.card-image { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb {
  width: 72px; height: 54px; padding: 0; cursor: zoom-in; overflow: hidden;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-alt);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb:hover { border-color: var(--accent); }
a.card-link { text-decoration: none; }

.lightbox {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 12px;
  padding: 56px 16px 24px; background: rgba(42, 39, 36, .88);
}
.lightbox.open { display: flex; }
.lb-image { max-width: min(1000px, 100%); max-height: calc(100vh - 120px); width: auto; height: auto; border-radius: 10px; background: #fff; }
.lb-caption { margin: 0; color: #e6dfd5; font-size: 15px; }
.lightbox button {
  position: absolute; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(42, 39, 36, .6);
  color: #f6f2ec; font-size: 28px; line-height: 1;
}
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; margin-top: -22px; }
.lb-next { right: 12px; top: 50%; margin-top: -22px; }
.lightbox button[hidden] { display: none; }
body.no-scroll { overflow: hidden; }
.card-image { aspect-ratio: 16 / 9; background: var(--bg-alt); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body p { margin: 0; color: var(--muted); }
.card .meta { font-size: 14px; }
.card.featured { grid-column: 1 / -1; }
@media (min-width: 761px) {
  .card.featured:has(.card-image) { display: grid; grid-template-columns: 2fr 3fr; }
  .card.featured .card-image { aspect-ratio: auto; min-height: 100%; border-right: 1px solid var(--border); }
  .card.featured .card-image img { object-position: center top; }
}
.card-link { margin-top: auto; color: var(--accent-strong); font-weight: 500; }

/* osiągnięcia */

.achievements { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.achievement {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 20px;
  padding: 0 0 28px 24px; position: relative;
}
.achievement::before {
  content: ""; position: absolute; left: -7px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
}
.achievement .date { color: var(--muted); font-size: 15px; padding-top: 2px; }
.achievement-text p { margin: 0 0 6px; color: var(--muted); }
.achievement-text .meta { color: var(--text); }
.achievement-text .tags { margin-top: 10px; }
.engagements { margin-top: 20px; }
.engagements-intro { color: var(--text) !important; font-weight: 500; margin-bottom: 16px !important; }
.engagements .achievements { border-left-style: dashed; }
@media (min-width: 761px) {
  .engagements .timeline-wide .achievement.with-logo { grid-template-columns: 130px 48px 1fr; gap: 16px; padding-bottom: 24px; }
  .engagements .logo-tile { width: 48px; height: 48px; padding: 8px; }
}
.highlights { margin: 4px 0 8px; padding-left: 18px; color: var(--muted); }
.highlights li { margin-bottom: 4px; }
.highlights li::marker { color: var(--accent); }
.timeline-wide .achievement { grid-template-columns: 170px 1fr; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-ghost { background: transparent; color: var(--accent-strong); border: 1px solid var(--accent); }
.btn-ghost:hover { background: var(--bg-alt); }
.achievement-image img { width: 160px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* kontakt */

.reveal {
  font: inherit; font-size: 15px; cursor: pointer;
  padding: 4px 14px; border-radius: 999px;
  color: var(--accent-strong); background: transparent; border: 1px solid var(--accent);
}
.reveal:hover { background: var(--bg-alt); }

.contact { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.contact span { display: inline-block; min-width: 150px; color: var(--muted); }

.site-footer { padding: 24px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0; }

/* telefon */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas: "logo lang" "tabs tabs";
    gap: 8px 16px;
    padding-top: 10px;
  }
  .logo img { height: 22px; }
  .tabs { justify-content: flex-start; overflow-x: auto; margin: 0 -20px; padding: 0 20px 10px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs.more-right { -webkit-mask-image: linear-gradient(to right, #000 80%, transparent); mask-image: linear-gradient(to right, #000 80%, transparent); }
  .tabs.more-left { -webkit-mask-image: linear-gradient(to left, #000 80%, transparent); mask-image: linear-gradient(to left, #000 80%, transparent); }
  .tabs.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent); }
  .tab { padding: 6px 12px; font-size: 15px; }
  .page { padding-top: 24px; padding-bottom: 48px; }
  .hero {
    grid-template-columns: auto 1fr;
    grid-template-areas: "photo id" "text text";
    column-gap: 16px;
    padding: 0 0 8px;
  }
  .hero .avatar { width: 76px; height: 76px; }
  .hero-id { align-self: center; }
  .hero-id .eyebrow { font-size: 12px; letter-spacing: .05em; margin: 0; }
  .hero-text { margin-top: 20px; }
  h1 { font-size: 28px; margin-bottom: 14px; }
  .lead { font-size: 17px; margin-bottom: 24px; }
  .skills { grid-template-columns: 1fr; }
  .achievement, .timeline-wide .achievement { grid-template-columns: 1fr; gap: 6px; }
  .timeline-wide .achievement.with-logo { grid-template-columns: 48px 1fr; grid-template-areas: "date date" "logo text"; gap: 6px 14px; }
  .with-logo .date { grid-area: date; }
  .with-logo .logo-tile { grid-area: logo; width: 48px; height: 48px; padding: 8px; }
  .with-logo .achievement-text { grid-area: text; }
  .achievement-image img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .engagements { margin-left: -62px; }
  .engagements .achievement { padding-left: 18px; }
}

.site-version { margin-left: .4em; opacity: .7; }

.personal { margin: 16px 0 0; color: var(--muted); }
.company-heading { margin-top: 40px; }

/* kafelki projektów (od 1.10.0) */

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr; gap: 16px; } }
.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: inherit; text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(60, 50, 40, .08); }
.tile-main { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.tile-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.tile-open {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(40, 32, 25, .15);
}
.tile-open svg { width: 20px; height: 20px; }
.tile-open:hover { border-color: var(--accent); background: var(--bg-alt); }
.tile-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-no-cover .tile-body h3 { padding-right: 44px; }
.tile-cover { aspect-ratio: 16 / 7; background: var(--bg-alt); border-bottom: 1px solid var(--border); overflow: hidden; }
.tile-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.tile-body { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tile-body h3 { margin: 0; }
.tile-text {
  margin: 0; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tile .tags { margin: 0; }
.tag-more { opacity: .75; }
.tile-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.tile-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tile-badge { font-size: 13px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }
.tile-more { color: var(--accent-strong); font-weight: 500; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .tile, .tile:hover { transition: none; transform: none; } }

/* okno szczegółów projektu */

.pd-backdrop {
  position: fixed; inset: 0; z-index: 40; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(42, 39, 36, .6);
}
.pd-backdrop.open { display: flex; }
.pd {
  position: relative; width: min(860px, 100%); max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(30, 25, 20, .3);
}
.pd-body { padding: 28px 32px 32px; display: flex; flex-direction: column; gap: 14px; }
.pd-body h2 { margin: 0; padding-right: 48px; }
.pd-lead { margin: 0; }
.pd .highlights { margin: 0; }
.pd .tags { margin: 0; }
.pd-close {
  position: sticky; float: right; top: 12px; margin: 12px 12px -56px 0; z-index: 1;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--heading);
  font-size: 26px; line-height: 1;
}
.pd-close:hover { border-color: var(--accent); }
.pd-shots { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.pd-shot {
  flex: 0 0 auto; height: 180px; padding: 0; cursor: zoom-in; overflow: hidden; scroll-snap-align: start;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt);
}
.pd-shot img { display: block; height: 100%; width: auto; }
.pd-shot:hover { border-color: var(--accent); }
.pd-open { align-self: flex-start; text-decoration: none; }
@media (max-width: 720px) {
  .pd-backdrop { padding: 0; align-items: stretch; }
  .pd { max-height: none; height: 100%; border-radius: 0; border: 0; }
  .pd-body { padding: 20px 16px 28px; }
  .pd-shot { height: 150px; }
}
