/* ---------- Borys Żukowski — Portfolio ---------- */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #fbfaf7;
  --paper: #f4f1ea;
  --ink: #1a1816;
  --muted: #6b6862;
  --faint: #a39f97;
  --rule: rgba(26, 24, 22, 0.10);
  --rule-strong: rgba(26, 24, 22, 0.22);
  --accent: #1a1816;

  --serif: 'EB Garamond', 'Cormorant Garamond', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --sidebar-w: 320px;
  --gutter: 80px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  word-spacing: 0.05em;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--bg); }

.index-label, .proj-card, .pc-num, .pc-year, .pc-meta,
.pc-arrow, .proj-sep, .proj-wip-label, .sidebar-foot,
.nav, .crumb, .h1-sub, .am-label, .am-value, .pi-label,
.pi-value, .fig-note, .fig-legend, .fig-ref, .lb-close,
.lb-hint, .contact .c-eyebrow, .contact .c-label, .section-div {
  word-spacing: normal;
}

a { color: inherit; text-decoration: none; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 72px 36px 48px;
  border-right: 1px solid var(--rule);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
}

.sidebar::-webkit-scrollbar { width: 0; }

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--ink);
}

.brand .name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.brand .role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.nav {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  transition: color .2s ease, padding .2s ease;
}

.nav a:first-child { border-top: 1px solid var(--rule); }

.nav a:hover { color: var(--ink); padding-left: 6px; }

.nav a.is-active { color: var(--ink); }
.nav a.is-active::after { content: '•'; color: var(--ink); }

.nav a .nm-num { color: var(--faint); margin-right: 12px; }

/* index header in sidebar */
.index-label {
  margin-top: 0;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
}

/* project cards */
.proj-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.proj-card {
  display: block;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  position: relative;
  transition: padding .25s ease;
}

.proj-card:last-child { border-bottom: 1px solid var(--rule); }

.proj-card:hover { padding-left: 8px; }
.proj-card:hover .pc-title { font-style: italic; }
.proj-card:hover .pc-arrow { transform: translateX(4px); opacity: 1; }

.proj-card.is-current { padding-left: 8px; }
.proj-card.is-current .pc-num { color: var(--ink); }
.proj-card.is-current .pc-title { font-style: italic; }
.proj-card.is-current::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 28px;
  width: 24px;
  height: 1px;
  background: var(--ink);
}

.pc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.pc-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--faint);
}

.pc-year {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.pc-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.005em;
  margin: 2px 0 4px;
  transition: font-style .2s ease;
}

.pc-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-arrow {
  font-family: var(--serif);
  font-size: 14px;
  opacity: 0.4;
  transition: transform .25s ease, opacity .25s ease;
}

/* WIP section divider in sidebar */
.proj-sep {
  margin: 20px 0 4px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
}

/* WIP label under project header */
.proj-wip-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 16px;
  border: 1px solid var(--rule-strong);
  padding: 7px 14px;
}

.proj-wip-label::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  flex-shrink: 0;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 32px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-foot a:hover { color: var(--ink); }

/* ---------- Main ---------- */

main {
  margin-left: var(--sidebar-w);
  padding: 72px var(--gutter) 96px;
  min-height: 100vh;
}

.crumb {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  gap: 16px;
  margin-bottom: 64px;
}

.crumb .sep { color: var(--rule-strong); }

/* ---------- About (O mnie) ---------- */

.about {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 80px;
  align-items: start;
  max-width: var(--maxw);
}

.about-left h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 6.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}

.about-left h1 em {
  font-style: italic;
  font-weight: 400;
}

.about-left .h1-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.about-left .h1-sub::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--ink);
  display: inline-block;
}

.about-lede {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.45;
  margin: 0 0 28px;
  max-width: 36ch;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.about-lede em { font-style: italic; }

.about-body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 42ch;
  margin: 0 0 36px;
}

.about-body p + p { margin-top: 14px; }

.about-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 40px;
  max-width: 480px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

/* contact block on O mnie */
.contact {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rule-strong);
  max-width: 480px;
}

.contact .c-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.contact .c-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 40px;
}

.contact .c-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact .c-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.contact .c-value {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.003em;
}

.contact .c-value em { font-style: italic; font-weight: 400; }

.contact .c-value a { border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.contact .c-value a:hover { border-color: var(--ink); }

.am-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.am-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.am-value {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.am-value em { font-style: italic; font-weight: 400; }

/* portrait */
.portrait {
  width: 100%;
  position: relative;
  background: var(--paper);
  overflow: hidden;
}

.portrait svg { width: 100%; height: 100%; display: block; }

.portrait img { width: 100%; height: auto; display: block; filter: contrast(1.03) saturate(1.07) brightness(1.01); }

.portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(255,255,255,0.10) 0%, transparent 50%);
  pointer-events: none;
}

.portrait .ph-caption {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.portrait-frame {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portrait-cap {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* ---------- Section divider (O mnie → Projekty) ---------- */

.section-div {
  max-width: var(--maxw);
  margin-top: 64px;
  padding: 28px 0 0;
  border-top: 1px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
}

/* ---------- Projects ---------- */

#omnie { scroll-margin-top: 0; }

.project {
  max-width: var(--maxw);
  padding: 96px 0 140px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 40px;
}

.project.project-first { border-top: none; padding-top: 64px; }

.proj-head {
  margin-bottom: 28px;
}

.proj-head.has-logo {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.proj-head.has-logo h2 { margin: 0; }

.proj-head.has-logo .proj-logo { margin-bottom: 6px; flex-shrink: 0; }

.proj-head.has-logo .proj-logo img { height: 104px; }

.proj-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 5.2vw, 76px);
  line-height: 1;
  letter-spacing: -0.012em;
  margin: 0;
}

.proj-head h2 em { font-style: italic; }

.proj-logo {
  margin-bottom: 12px;
}

.proj-logo img {
  height: 72px;
  width: auto;
  display: block;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.88;
}

.proj-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.proj-body {
  margin-bottom: 72px;
  max-width: 60ch;
}

.proj-body p {
  font-size: 18px;
  line-height: 1.65;
  margin: 0;
}

.proj-body p + p { margin-top: 14px; }

.proj-body .lede {
  font-size: 22px;
  line-height: 1.4;
  margin: 0 0 24px;
  letter-spacing: 0.003em;
}

.proj-body .lede em { font-style: italic; }

/* ---------- Project intro (text + info sidebar) ---------- */

.proj-intro {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 48px;
  align-items: start;
  margin-bottom: 72px;
}

.proj-intro .proj-body {
  margin-bottom: 0;
}

.proj-info {
  padding-top: 4px;
}

.pi-row {
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pi-row:last-child {
  border-bottom: 1px solid var(--rule);
}

.pi-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}

.pi-value {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.003em;
}

/* image plates */
.plate {
  margin-bottom: 56px;
}

.plate-row {
  display: grid;
  gap: 20px;
  margin-bottom: 56px;
}

.plate-row.cols-2 { grid-template-columns: 1fr 1fr; }
.plate-row.cols-2-asym { grid-template-columns: 2fr 1fr; }
.plate-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.figure {
  position: relative;
  background: var(--paper);
  overflow: hidden;
}

.figure.tall { aspect-ratio: 4 / 5; }
.figure.wide { aspect-ratio: 16 / 9; }
.figure.wider { aspect-ratio: 3 / 1; }
.figure.square { aspect-ratio: 1 / 1; }
.figure.portrait-3-4 { aspect-ratio: 3 / 4; }
.figure.landscape-3-2 { aspect-ratio: 3 / 2; }
.figure.landscape-4-3 { aspect-ratio: 4 / 3; }

.figure svg { width: 100%; height: 100%; display: block; }

.figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.figure img.contain {
  object-fit: contain;
  background: var(--bg);
  filter: contrast(1.25) brightness(1.02);
}

.plate-row.drawings-pair {
  max-width: 760px;
}

.drawings-pair .figure {
  background: var(--bg);
}

.fig-note {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}

.fig-note .fn-id {
  color: var(--faint);
  margin-right: 12px;
}

/* ---------- Composition board with overlaid labels ---------- */

.figure-board {
  position: relative;
}

.figure-board img {
  width: 100%;
  height: auto;
  display: block;
}

.fig-ref {
  position: absolute;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink);
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}

.figure-natural {
  position: relative;
}

.figure-natural img {
  width: 100%;
  height: auto;
  display: block;
}

.fig-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 24px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  align-items: start;
}

.fig-legend .fn-id {
  color: var(--faint);
  margin-right: 10px;
}

.fig-legend-desc {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  word-spacing: normal;
}

.fig-desc {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 52ch;
}

/* responsive */
@media (max-width: 1100px) {
  :root { --gutter: 56px; }
  .about { grid-template-columns: 1fr 340px; gap: 56px; }
}

@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 32px 28px;
  }
  main { margin-left: 0; padding: 48px 28px 72px; }
  .about { grid-template-columns: 1fr; }
  .about-meta { grid-template-columns: 1fr; }
  .proj-head, .proj-spec, .proj-body, .fig-row, .proj-end, .foot {
    grid-template-columns: 1fr;
  }
  .proj-spec > div:first-child { grid-column: 1; }
  .proj-gallery.layout-split, .proj-gallery.layout-triple {
    grid-template-columns: 1fr;
  }
  .fig-legend { grid-template-columns: 1fr 1fr; }
  .proj-intro { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Lightbox ---------- */

.lb-trigger {
  cursor: zoom-in;
  position: relative;
}

.lb-trigger::after {
  content: 'POWIĘKSZ';
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink);
  background: rgba(244, 241, 234, 0.88);
  padding: 4px 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.lb-trigger:hover::after { opacity: 1; }

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 22, 0.94);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#lightbox.is-open { display: flex; }

#lb-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transform-origin: center center;
  will-change: transform;
  transition: none;
}

#lb-img.is-dragging { cursor: grabbing; }

.lb-close {
  position: fixed;
  top: 28px;
  right: 36px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.55);
  cursor: pointer;
  z-index: 201;
  transition: color 0.2s ease;
}

.lb-close:hover { color: #f4f1ea; }

.lb-hint {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.28);
  pointer-events: none;
  white-space: nowrap;
  z-index: 201;
}
