:root {
  color-scheme: light;
  --paper: #f4f0e9;
  --ink: #211e1a;
  --muted: #60584d;
  --line: #bfb4a6;
  --accent: #922e22;
  --header-height: 72px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  font: 400 1.0625rem/1.5 "Barlow", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-padding-top: calc(var(--header-height) + 12px); }
body { margin: 0; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(1440px, calc(100% - clamp(32px, 8vw, 144px))); margin-inline: auto; }
.skip { position: fixed; z-index: 2; top: 12px; left: 16px; padding: 9px 12px; background: var(--paper); transform: translateY(-160%); }
.skip:focus { transform: none; }
.site-header { position: sticky; top: 0; z-index: 1; background: var(--paper); }
.site-header-inner { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.wordmark { font-size: .81rem; font-weight: 700; letter-spacing: .13em; text-decoration: none; }
.wordmark strong { color: var(--accent); }
.site-header nav { display: flex; gap: clamp(16px, 3vw, 38px); }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover, .back:hover, .contact a:hover { color: var(--accent); }
.masthead { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding-block: clamp(22px, 4.5vw, 68px) clamp(16px, 2.4vw, 32px); }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--display); }
h1 { font-size: clamp(4rem, 11vw, 10rem); font-weight: 600; letter-spacing: -.035em; line-height: .83; }
.masthead p { margin-bottom: .14em; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(9px, 1.4vw, 20px); }
.tile { grid-column: span 4; position: relative; display: block; isolation: isolate; overflow: hidden; aspect-ratio: 1.06; background: #29231e; color: var(--paper); }
.tile--portrety { grid-column: span 7; aspect-ratio: auto; height: clamp(360px, 49vw, 670px); }
.tile--sport { grid-column: span 5; aspect-ratio: auto; }
.tile img, .tile::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile img { z-index: -2; object-fit: cover; transition: transform .65s cubic-bezier(.22,.64,.23,1); }
.tile--portrety img { object-position: 50% 40%; }
.tile--sport img { object-position: 50% 57%; }
.tile::after { z-index: -1; content: ""; background: linear-gradient(transparent 58%, rgb(17 12 10 / .84)); }
.tile-caption { position: absolute; inset: auto clamp(11px, 2vw, 30px) clamp(12px, 1.8vw, 27px); display: flex; gap: 10px; align-items: baseline; justify-content: space-between; font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 3.9vw, 4rem); line-height: 1; }
.tile-caption span:last-child { font: 400 .54em/1 sans-serif; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.035); }
.gallery-header { padding-block: clamp(25px, 4vw, 55px) clamp(19px, 3vw, 40px); }
.back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; text-decoration: none; color: var(--muted); }
.gallery-header h1 { font-size: clamp(3.8rem, 9vw, 8.4rem); line-height: .92; }
.gallery-nav { display: flex; flex-wrap: wrap; gap: 7px clamp(15px, 2.4vw, 32px); margin-top: 24px; }
.gallery-nav a { padding-block: 2px; text-decoration: none; border-bottom: 1px solid transparent; color: var(--muted); }
.gallery-nav a:hover, .gallery-nav [aria-current] { color: var(--accent); border-bottom-color: currentColor; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: clamp(7px, 1.25vw, 18px); }
.frame { display: block; overflow: hidden; background: #e5ded4; }
.frame img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; transition: opacity .25s; }
.frame--original img { aspect-ratio: auto; }
.frame:hover img { opacity: .88; }
footer { margin-top: clamp(52px, 8vw, 115px); border-top: 1px solid var(--line); }
.contact { display: grid; grid-template-columns: 1.15fr 1fr auto; align-items: end; gap: 24px; padding-block: clamp(21px, 4vw, 47px); }
.contact h2 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; margin-bottom: 8px; }
.contact p { color: var(--muted); }
.contact-links { display: grid; gap: 3px; justify-items: start; }
.contact-links a { text-underline-offset: 4px; }
html:has(.viewer[open]) { overflow: hidden; }
.viewer {
  position: fixed; inset: 0; margin: 0; width: 100%; height: 100%; height: 100dvh;
  max-width: none; max-height: none; border: 0; padding: 12px; overflow: hidden;
  background: #141210; color: var(--paper);
}
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer button { min-width: 48px; min-height: 48px; padding: 0 10px; color: inherit; background: transparent; border: 1px solid #756b61; cursor: pointer; font-size: 1.45rem; line-height: 1; }
.viewer button:hover { background: #35302a; }
.viewer button:focus-visible { outline-color: var(--paper); }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; padding-inline: 4px; }
.viewer-stage { position: relative; min-width: 0; min-height: 0; touch-action: pan-y pinch-zoom; }
.viewer-stage img {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: auto; height: auto;
  max-width: calc(100% - 10px); max-height: calc(100% - 10px);
  object-fit: contain;
}
.viewer-controls { display: flex; justify-content: center; gap: 10px; padding-top: 5px; }
@media (max-width: 950px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  :root { --header-height: 56px; }
  .wordmark { font-size: .69rem; letter-spacing: .075em; }
  .site-header nav { font-size: .89rem; }
  .masthead p { font-size: .84rem; }
  h1 { font-size: clamp(3.55rem, 14vw, 5.3rem); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { grid-column: span 1; aspect-ratio: 4 / 5; }
  .tile--portrety, .tile--sport { grid-column: span 2; height: auto; }
  .tile--portrety { aspect-ratio: 1.04; }
  .tile--sport, .tile--produktowa { aspect-ratio: 1.32; }
  .tile--produktowa { grid-column: span 2; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact { grid-template-columns: 1fr; gap: 15px; }
}
@media (max-width: 360px) {
  .site-header nav { gap: 10px; }
  .masthead { display: block; }
  .masthead p { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile img, .frame img { transition: none; }
}
