/* ============ Tokens ============ */
:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --text: #1B1B19;
  --muted: #5F5E59;
  --line: #E4E2DC;
  --line-strong: #CFCCC4;
  --accent: #2F5D50;
  --accent-soft: #E7EFEB;
  --sand-soft: #F1ECE3;
  --blue-soft: #E6EAF0;

  --radius: 14px;
  /* Test: Zalando Sans. Poprzednio: --display "Instrument Serif", --sans "Inter" */
  --display: "Zalando Sans SemiExpanded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Zalando Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1080px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 68px;
  --col: 200px;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p, figure { margin: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section[id] { scroll-margin-top: var(--nav-h); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 8px;
}

/* ============ Nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.nav__logo {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  text-decoration: none;
}
.nav__logo span { color: var(--accent); }

.nav__menu {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav__menu a {
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.nav__menu a:hover,
.nav__menu a.is-active { color: var(--text); }

.nav__menu .nav__cta {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  transition: border-color .2s;
}
.nav__menu .nav__cta:hover { border-color: var(--text); }

.nav__toggle { display: none; }

@media (max-width: 760px) {
  .nav__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 10px;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .nav__toggle span {
    display: block;
    height: 1.5px;
    background: var(--text);
    transition: transform .25s;
  }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .nav__menu {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a {
    width: 100%;
    padding: 12px 0;
    font-size: 18px;
  }
  .nav__menu .nav__cta {
    width: auto;
    margin-top: 8px;
    padding: 10px 18px;
  }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s, border-color .2s, color .2s;
}
.btn--primary {
  background: var(--text);
  color: var(--bg);
}
.btn--primary:hover { background: var(--accent); }
.btn--ghost { border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--text); }

/* ============ Hero ============ */
.hero { padding: clamp(64px, 12vw, 140px) 0 clamp(48px, 7vw, 80px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 6.5vw, 72px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.02em;
}
.hero h1 em { color: var(--muted); }

.lead {
  max-width: 560px;
  margin-top: 28px;
  font-size: clamp(17px, 2vw, 20px);
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 32px;
  margin: clamp(56px, 8vw, 96px) 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.hero__meta dt { font-size: 13px; color: var(--muted); }
.hero__meta dd { margin: 2px 0 0; font-weight: 500; }

@media (max-width: 760px) {
  .hero__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ Sections ============ */
.section {
  padding: clamp(72px, 10vw, 120px) 0;
  border-top: 1px solid var(--line);
}

.section__head {
  display: grid;
  grid-template-columns: var(--col) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: clamp(40px, 6vw, 64px);
}
.section__head h2 {
  max-width: 720px;
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -.01em;
}

.label {
  padding-top: 12px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 760px) {
  .section__head { grid-template-columns: 1fr; gap: 12px; }
  .label { padding-top: 0; }
}

/* ============ About ============ */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.portrait {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #EEECE6, #DCD9D0);
}
.portrait span {
  font-family: var(--display);
  font-size: 64px;
  color: #A29E93;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__text p { color: var(--muted); }
.about__text p + p { margin-top: 18px; }
.about__text a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.about__text a:hover { color: var(--text); }
.about__text p:first-child {
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.5;
  color: var(--text);
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 40px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 500; }

@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .portrait { max-width: 320px; }
}

/* ============ Services ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s;
}
.card:hover { border-color: var(--line-strong); }
.card__num {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}
.card h3 {
  margin: 28px 0 10px;
  font-size: 19px;
  font-weight: 600;
}
.card p { font-size: 16px; color: var(--muted); }

.skills,
.ai {
  display: grid;
  grid-template-columns: var(--col) minmax(0, 1fr);
  gap: 24px;
  margin-top: 56px;
}
.skills .label,
.ai .label { padding-top: 8px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 7px 14px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.ai__lead {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.55;
}
.ai__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.ai__list li {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.ai__list h3 { font-size: 16px; font-weight: 600; }
.ai__list p {
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .skills,
  .ai { grid-template-columns: 1fr; gap: 12px; }
  .skills .label,
  .ai .label { padding-top: 0; }
  .ai__list { grid-template-columns: 1fr; }
}

/* ============ Experience ============ */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline li {
  display: grid;
  grid-template-columns: var(--col) minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline time {
  padding-top: 3px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.timeline h3 { font-size: 19px; font-weight: 600; }
.timeline .company { font-weight: 500; color: var(--accent); }
.timeline p {
  max-width: 620px;
  margin-top: 8px;
  color: var(--muted);
}

.subhead {
  margin: clamp(56px, 8vw, 80px) 0 24px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.project {
  display: block;
  overflow: hidden;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s;
}
a.project:hover { border-color: var(--line-strong); }

.project__cover {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
}
.project__cover span {
  font-family: var(--display);
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 600;
  opacity: .55;
}
.project__cover--green { background: var(--accent-soft); color: var(--accent); }
.project__cover--sand { background: var(--sand-soft); color: #7A6A52; }
.project__cover--blue { background: var(--blue-soft); color: #4A5E78; }

.project__body { padding: 24px 28px 28px; }
.project__tag { font-size: 13px; color: var(--muted); }
.project h3 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 8px;
  font-size: 20px;
  font-weight: 600;
}
.project .arrow {
  color: var(--muted);
  transition: transform .2s, color .2s;
}
.project:hover .arrow {
  color: var(--text);
  transform: translate(3px, -3px);
}
.project p:last-child { font-size: 16px; color: var(--muted); }

@media (max-width: 900px) {
  .projects { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
}

/* ============ Entries (działalność, hobby) ============ */
.entry {
  display: grid;
  grid-template-columns: var(--col) minmax(0, 1fr);
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }

.entry svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.entry h3 {
  margin-top: 14px;
  font-size: 19px;
  font-weight: 600;
}
.entry__meta {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.entry__meta a {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
}
.entry__meta a:hover { color: var(--text); }

.entry__body { max-width: 680px; }
.entry__body p { color: var(--muted); }
.entry__body p + p,
.entry__list + p { margin-top: 16px; }

.entry__list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}
.entry__list li {
  position: relative;
  padding-left: 22px;
}
.entry__list li + li { margin-top: 6px; }
.entry__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .8em;
  width: 10px;
  height: 1px;
  background: var(--accent);
}
.entry__body p:first-child { color: var(--text); }
.entry__body a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.entry__body a:hover { color: var(--text); }

.entry__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 32px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.entry__stats div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
}
.entry__stats dt { font-size: 13px; color: var(--muted); }
.entry__stats dd {
  margin: 0 0 2px;
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--accent);
}

@media (max-width: 760px) {
  .entry { grid-template-columns: 1fr; gap: 16px; }
  .entry__head { display: flex; align-items: flex-start; gap: 12px; }
  .entry h3 { margin-top: 0; }
  .entry__meta { margin-top: 2px; }
  .entry__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
}

/* ============ Gallery ============ */
.entry__gallery { grid-column: 2; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.gallery figure { margin: 0; }
.gallery a {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: var(--line);
}
.gallery--wide a { aspect-ratio: 3 / 2; }
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.gallery a:hover img { transform: scale(1.03); }
.gallery figcaption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.gallery__label {
  margin: 28px 0 12px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pair__imgs {
  display: grid;
  gap: 6px;
}
.tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(250, 250, 247, .9);
  border-radius: 999px;
}

@media (max-width: 760px) {
  .entry__gallery { grid-column: 1; }
  .gallery--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery--pairs { grid-template-columns: 1fr; gap: 20px; }
  .pair__imgs { grid-template-columns: 1fr 1fr; }
}

/* ============ Lightbox ============ */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 64px 16px 24px;
  border: 0;
  color: #fff;
  background: rgba(20, 20, 18, .94);
}
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox::backdrop { background: transparent; }

.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  margin: 0;
}
.lightbox img {
  max-width: min(1400px, 100%);
  max-height: calc(100dvh - 150px);
  border-radius: 6px;
}
.lightbox figcaption {
  max-width: 640px;
  font-size: 14px;
  text-align: center;
  color: rgba(255, 255, 255, .75);
}

.lightbox__btn {
  position: fixed;
  width: 44px;
  height: 44px;
  font: 400 26px/1 var(--sans);
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .24); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev,
.lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
.lightbox.is-single .lightbox__prev,
.lightbox.is-single .lightbox__next { display: none; }

body:has(.lightbox[open]) { overflow: hidden; }

/* ============ Contact ============ */
.contact__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s, transform .2s;
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.contact-card:has(.contact-card__link:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.contact-card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--accent-soft);
  border-radius: 50%;
  transition: background .2s;
}
.contact-card__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .2s;
}
.contact-card:hover .contact-card__icon { background: var(--accent); }
.contact-card:hover .contact-card__icon svg { stroke: var(--surface); }
.contact-card__body { min-width: 0; }
.contact-card__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.contact-card__link:focus-visible { outline: none; }
/* Cała karta klikalna; przycisk „Kopiuj adres” leży nad tą warstwą */
.contact-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.contact-card__name {
  font-size: 14px;
  color: var(--muted);
}
.contact-card__value {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.contact-card__arrow {
  margin-left: auto;
  color: var(--muted);
  transition: color .2s, transform .2s;
}
.contact-card:hover .contact-card__arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.copy {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding: 5px 12px;
  font: 500 13px var(--sans);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.copy:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

@media (max-width: 900px) {
  .contact__cards { grid-template-columns: 1fr; }
}

/* ============ Footer ============ */
.footer {
  padding: 32px 0;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ============ Reveal on scroll ============ */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
