/* michalklusek.com: one stylesheet for every page.
   Layout: one paper sheet. On Commercial the client names are pinned as a typographic wall at the foot of the first
   screen; photos rise between its rows and the rows slide out at the end. Subpages reuse the same shell.
   Sections are marked with landmarks like the one below, so a change can be found by name. */

/* ── Tokens ── */
:root{
  --paper:#eeede9; --ink:#141414; --mute:#5f5e5a; --faint:#8a8880; --line:#cfccc4; --sub:#3d3c39; --ph:#dcd9d2;
  --sans:'Inter','Helvetica Neue',Arial,sans-serif;
  --mono:'DM Mono',ui-monospace,Menlo,monospace;
  --serif:'Spectral',Georgia,serif;
  --gut-l:max(16px, env(safe-area-inset-left, 0px)); --gut-r:max(16px, env(safe-area-inset-right, 0px));
  --top:env(safe-area-inset-top, 0px);
}
@media (min-width: 900px){:root{--gut-l:max(40px, env(safe-area-inset-left, 0px)); --gut-r:max(40px, env(safe-area-inset-right, 0px))}}
html.dk{--paper:#131312; --ink:#ecebe6; --mute:#a3a198; --faint:#77756e; --line:#2e2d2a; --sub:#c9c7bf; --ph:#22211f; color-scheme:dark}

/* ── Base ── */
html{background:var(--paper); overflow-x:clip; transition:background-color .3s}
/* the page content sits 8 px inside the gutters of the fixed logo and menu button (as designed) */
body{margin:8px; background:var(--paper); color:var(--ink); font-family:var(--sans); font-weight:500; font-size:14px; overflow-x:clip; -webkit-font-smoothing:antialiased; transition:background-color .3s, color .3s}
a{color:inherit; text-decoration:none}
a:focus-visible,button:focus-visible{outline:1px solid currentColor; outline-offset:3px}
p{margin:0}
.met,.mi a,.mi .grp,.btn{font-size:11px; line-height:1.3; font-weight:600; letter-spacing:.06em; text-transform:uppercase}
.mute{color:var(--mute)}
.mono{font-family:var(--mono); font-size:11px; line-height:1.3; font-weight:400; letter-spacing:0; text-transform:none}

/* ── Toggles: dark mode (half circle) and film grain (noise swatch) ── */
.lang{display:flex; justify-content:flex-end; gap:14px; align-items:center; position:relative; z-index:25}
.dm{display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; margin:-9px; padding:0; border:0; background:none; color:var(--ink); cursor:pointer}
.dm svg{display:block; width:14px; height:14px; transition:transform .45s cubic-bezier(.5,0,.2,1)}
.dm[aria-pressed="true"] svg{transform:rotate(180deg)}
.gr{display:inline-flex; align-items:center; justify-content:center; width:40px; height:32px; margin:-12px -9px; padding:0; border:0; background:none; color:var(--ink); cursor:pointer}
.gr svg{display:block; width:22px; height:8px} .gr .nz{transition:opacity .3s ease} .gr[aria-pressed="false"] .nz{opacity:0}
.grain{position:fixed; inset:0; z-index:60; pointer-events:none; opacity:.25; background-repeat:repeat; transition:opacity .4s ease}
html.ng .grain{opacity:0}

/* ── Logo and phone menu button (fixed) ── */
.logo{position:fixed; z-index:30; top:calc(var(--top) + 16px); left:var(--gut-l); mix-blend-mode:difference; display:block}
.logo svg{display:block; width:62.4px; height:64.1px}
.btn{position:fixed; z-index:30; top:calc(var(--top) + 16px); right:var(--gut-r); min-height:44px; padding:0 2px; border:0; background:none; color:#fff; mix-blend-mode:difference; font-family:var(--sans); cursor:pointer}
@media (min-width: 900px){.logo{top:calc(var(--top) + 28px)} .logo svg{width:83.2px; height:85.5px} .btn{display:none}}

/* ── Menu (desktop cascade) ── */
.mi a,.mi .grp{position:relative; z-index:25}
.mi a.fold{overflow:visible; max-height:1.3em}
.mi .grp{cursor:default}
.cur{position:relative}
.cur::before{content:"•"; position:absolute; right:100%; margin-right:.5em}
/* hover: the same bullet that marks the current page slides in before the pointed item */
.mi a:not(.cur):not(.prn)::before{content:"•"; position:absolute; right:100%; margin-right:.5em; opacity:0; transform:translateX(-5px); transition:opacity .25s ease, transform .3s cubic-bezier(.22,1,.36,1); pointer-events:none}
@media (hover:hover) and (pointer:fine){.mi a:not(.cur):not(.prn):hover::before{opacity:1; transform:none} .mi a:hover, .mi a.sub:hover{color:var(--ink)}}
.mi .soon{cursor:default}
/* the Commercial line carries the two pools: 100% straight advertising, 50% campaigns that read like life */
.mi .ln{display:flex; align-items:baseline; position:relative; z-index:25} .mi .ln a{margin-left:0}
.mi .ln.fold{gap:2.4em; overflow:visible; max-height:1.3em}
.mi .ln.fold.pr{max-height:2.4em; align-items:center; gap:2.2em}
/* 100 / 50 as DM Mono indices, the chosen one in square brackets */
.pv{display:inline-flex; gap:.15em; margin-left:.35em; align-self:flex-start}
.pc{all:unset; cursor:pointer; font-family:var(--mono); font-size:8.5px; line-height:1; font-weight:400; letter-spacing:0; text-transform:none; color:var(--faint); transition:color .25s}
.pc::before{content:"["} .pc::after{content:"]"} .pc::before,.pc::after{visibility:hidden}
.pc[aria-pressed="true"]{color:var(--ink)} .pc[aria-pressed="true"]::before,.pc[aria-pressed="true"]::after{visibility:visible}
.pc:hover{color:var(--ink)} .pc:focus-visible{outline:1px solid currentColor; outline-offset:2px}
/* PRINTS: Michał's own handwriting, the one hand-made word in a typeset menu */
.prn{display:inline-flex; align-items:center} .prn svg{display:block; height:2.1em; width:auto; transform:translateY(-.1em)}
.mi a.prn:hover{color:var(--ink)}
.cartn{font-family:var(--mono); font-size:8.5px; font-weight:400; letter-spacing:0; margin-left:.4em; align-self:flex-start}

/* ── Overlay menu (phone) ── */
.ov[hidden]{display:none}
.ov{position:fixed; inset:0; z-index:20; background:var(--paper); padding:calc(var(--top) + 110px) var(--gut-r) calc(env(safe-area-inset-bottom,0px) + 24px) var(--gut-l); display:flex; flex-direction:column; justify-content:space-between; overflow-y:auto}
.ov nav{display:flex; flex-direction:column; gap:2px}
.ov nav a,.ov nav .grp{font-size:34px; line-height:1.05; font-weight:600; letter-spacing:-.04em; margin-left:calc(var(--i) * 22px)}
.ov nav .grp{cursor:default}
.ov nav a.sub{font-size:20px; line-height:1.3; font-weight:500; letter-spacing:-.02em; color:var(--mute); margin-left:66px}
.ov nav .ln{display:flex; align-items:baseline; margin-left:calc(var(--i) * 22px)} .ov nav .ln a{margin-left:0} .ov nav .ln.fold{flex-direction:column}
.ov nav .pc{font-size:12px} .ov nav .pv{margin-left:.4em; margin-top:.25em}
.ov nav .prn svg{height:1.5em; margin-top:.1em}
.ov .foot{display:flex; justify-content:space-between; padding-top:12px; border-top:1px solid var(--line)}
.ov .foot .tg{display:inline-flex; gap:14px; align-items:center}

/* ── Hero: menu at the top, the page's opening block (brand rows, project text) at the foot of the first screen ── */
.hero{min-height:calc(100svh - 150px); box-sizing:border-box; padding:calc(var(--top) + 16px) var(--gut-r) 24px var(--gut-l); display:flex; flex-direction:column; justify-content:flex-end}
.hero header{display:none}
/* short hero: subpages that start right under the menu */
.hero.short{min-height:0}
.cl{display:flex; flex-direction:column; gap:14px; padding-top:72px}
@media (min-width: 900px){
  .hero{padding:calc(var(--top) + 28px) var(--gut-r) 12px var(--gut-l); min-height:max(calc(100svh - 56px), 560px); justify-content:space-between}
  .hero header{display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); column-gap:24px; align-items:start}
  .mi{grid-column:5 / span 5; display:flex; flex-direction:column; align-items:flex-start}
  .mi a,.mi .grp{margin-left:calc(var(--i) * 48px)} .mi .ln{margin-left:calc(var(--i) * 48px)} .mi .ln a{margin-left:0} .mi a.sub{color:var(--mute); font-weight:500}
  .lang{grid-column:11 / span 2}
}

/* ── Brand rows (Commercial) ── */
.rows{font-size:14px; line-height:1.3; font-weight:500; letter-spacing:-.03em}
.row{display:block; position:relative; white-space:nowrap; width:max-content; transition:margin-left .6s cubic-bezier(.22,1,.36,1)}
.ix{font-family:var(--mono); font-size:max(.36em, 7px); line-height:0; vertical-align:super; margin-left:.15em; margin-right:1.1em; letter-spacing:0; font-weight:400; color:var(--faint); transition:color .3s ease}
.row .b:last-child .ix{margin-right:0}
.rows.d{display:none}
@media (min-width: 900px){.rows{font-size:30px} .rows.m{display:none} .rows.d{display:block}}
/* a brand name turns into its logo on hover, or while one of its photos crosses the rows */
.b{display:inline-block; white-space:nowrap; position:relative}
.bx{position:relative; display:inline-block; text-align:center; transition:width .6s cubic-bezier(.22,1,.36,1)}
.ready .bx{width:calc(var(--wn) * 1em)}
.nm{display:inline-block; transition:opacity .28s ease, filter .35s ease, transform .5s cubic-bezier(.22,1,.36,1), color .3s ease}
.lg{position:absolute; left:50%; top:50%; width:calc(var(--wl) * .78em); height:calc(var(--hl) * .78em); color:var(--ink); opacity:0; transform:translate(-50%,-50%) scale(.45); transition:transform .65s cubic-bezier(.34,1.5,.64,1), opacity .3s ease; pointer-events:none; z-index:5; overflow:visible}
@media (hover:hover) and (pointer:fine){
  .ready .b:hover .bx{width:calc(max(var(--wn), var(--wl) * .78) * 1em + 1.2em)}
  .b:hover .nm{opacity:0; filter:blur(6px); transform:scale(.72)}
  .b:hover .lg{opacity:1; transform:translate(-50%,-50%) scale(1); transition-delay:.06s}
  .rows:has(.b:hover) .b:not(:hover) .nm{color:var(--faint)}
  .row:has(.b:hover){z-index:10 !important}
}
.ready .b.on .bx{width:calc(max(var(--wn), var(--wl) * .78) * 1em + 1.2em)}
.b.on .nm{opacity:0; filter:blur(6px); transform:scale(.72)}
.b.on .lg{opacity:1; transform:translate(-50%,-50%) scale(1); transition-delay:.06s}

/* ── Photo grid ── */
.wrap{padding-inline:var(--gut-l) var(--gut-r); padding-block:0; transition:opacity .35s ease}
.wrap.swap{opacity:0}
.set[hidden]{display:none}
.g{display:flex; flex-direction:column; gap:12px; padding-top:96px}
.g.first{padding-top:8px; margin-top:-50px} .g.last{padding-bottom:160px}
.it{min-width:0; margin:0}
.it img{display:block; width:100%; height:auto; max-width:100%; object-fit:cover; background:var(--ph)}
.lift,.g > .it{position:relative; z-index:2}
.px{--k:.35}
.w100{width:100%} .w82{width:82%} .w72{width:72%} .w62{width:62%}
.right{align-self:flex-end} .center{align-self:center}
@media (min-width: 900px){
  .px{--k:1}
  .g{display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); column-gap:24px; row-gap:0; align-items:start; padding-top:200px}
  .g.first{padding-top:16px} .g.last{padding-bottom:240px}
  .g > *{grid-column:var(--gc); grid-row:var(--gr, 1); width:auto; align-self:start}
  .g > .end{align-self:end}
  .g.pair > .end{margin-top:220px}
}
/* captions travel with their photo, beside its bottom edge */
.cap{display:block; margin-top:8px; font-size:9px; line-height:1.18; font-weight:400; letter-spacing:0} .cap .t{font-weight:600} .cap .s{color:var(--faint)}
.it.right .cap{text-align:right}
@media (min-width: 900px){
  .cap{position:absolute; bottom:0; margin:0; width:max-content; max-width:160px}
  .cap.L{right:100%; margin-right:28px; text-align:right}
  .cap.R{left:100%; margin-left:28px; text-align:left}
  .it.right .cap.R{text-align:left}
}

/* ── Contact (foot of every page) ── */
.contact{position:relative; z-index:2; display:grid; grid-template-columns:1fr; gap:18px; padding-block:160px 28px}
.c-txt{max-width:34ch; font-size:15px; line-height:1.38; font-weight:500; letter-spacing:-.01em; text-wrap:pretty}
.c-txt a{text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:.18em} .c-txt a:hover{color:var(--mute)}
.c-meta{line-height:1.5} .c-meta a:hover{color:var(--ink)}
.c-foot{margin-top:120px; padding-top:12px; border-top:1px solid var(--line)}
@media (min-width: 900px){
  .contact{grid-template-columns:repeat(12, minmax(0,1fr)); column-gap:24px; row-gap:18px; padding-block:240px 40px}
  .c-lab{grid-column:1 / span 2; grid-row:1} .c-txt{grid-column:3 / span 4; grid-row:1; font-size:16px} .c-meta{grid-column:3 / span 4}
  .c-foot{grid-column:1 / -1; margin-top:160px}
}

/* ── Scroll-driven motion ── */
@supports (animation-timeline: scroll()){
  /* the logo turns as the page scrolls */
  @keyframes mk-gear{to{rotate:1080deg}}
  .logo svg{transform-origin:50% 50%; animation:mk-gear linear both; animation-timeline:scroll(root)}
  /* pinned: translate by the full scroll range, so the element stays put on screen (--maxs is set by site.js) */
  @keyframes mk-pin{from{translate:0 0}to{translate:0 var(--maxs, 0px)}}
  .row{animation:mk-pin linear both; animation-timeline:scroll(root)}
  .mi a, .mi .grp, .mi .ln, .lang{animation:mk-pin linear both; animation-timeline:scroll(root)} .mi .ln a{animation:none}
  /* after 180 px of scroll the menu folds to Commercial, Personal and the current page */
  @keyframes mk-fold{to{max-height:0; opacity:0; visibility:hidden}}
  .mi a.fold, .mi .ln.fold{animation:mk-pin linear both, mk-fold cubic-bezier(.5,0,.2,1) both; animation-timeline:scroll(root), scroll(root); animation-range:normal, 0px 180px}
  /* gentle parallax on photos */
  @keyframes mk-par{from{transform:translateY(calc(var(--p) * var(--k)))}to{transform:translateY(calc(var(--p) * var(--k) * -1))}}
  .px{animation:mk-par linear both; animation-timeline:view(); animation-range:cover 0% cover 100%}
  /* captions drift gently against their photo, level with its bottom edge mid-screen */
  @keyframes mk-cap{from{translate:0 calc(var(--cp) * var(--k) * -1)}to{translate:0 calc(var(--cp) * var(--k))}}
  .cap{--cp:44px; animation:mk-cap linear both; animation-timeline:view(); animation-range:cover 0% cover 100%}
}
@media (prefers-reduced-motion: reduce){
  .dm svg,.bx,.nm,.lg{transition:none}
  .mi a,.mi .grp,.mi .ln,.lang,.logo svg,.row,.px,.cap,.nw-p .tl,.nw-tx > .mono{animation:none !important}
}

/* ════ Page: N.W.P.D.P.R. ════ */
/* the project text takes the place of the brand rows; it is split into its rendered lines (site.js) so the photos
   pass between them like between the rows: over the upper lines, under the last one */
.nw-p{font-size:16px; line-height:1.3; font-weight:500; letter-spacing:-.02em; text-align:justify; text-align-last:left; hyphens:auto; -webkit-hyphens:auto}
.nw-p .tl{display:block; position:relative; white-space:nowrap; text-align:justify; text-align-last:justify}
.nw-p .tl.end{text-align-last:left}
.nw-tx > .mono{position:relative; z-index:1}
.nw-f{justify-self:center}
.pg-nwpdpr .contact{padding-top:200px}
@media (min-width: 900px){
  .nw-p{font-size:30px; line-height:1.3; letter-spacing:-.03em}
  .g > .nw-f{width:85%}
}
@supports (animation-timeline: scroll()){
  .nw-p .tl, .nw-tx > .mono{animation:mk-pin linear both; animation-timeline:scroll(root)}
}

/* ════ Page: 01 ════ */
/* the first photo is on screen at once; the series text sits at its bottom right corner like a caption */
.pg-01 .g.first{margin-top:0}
.pg-01 .contact{padding-top:200px}
.p01c{font-size:12px; line-height:1.38; font-weight:500; letter-spacing:0; max-width:none; margin-top:14px; hyphens:auto; -webkit-hyphens:auto}
.p01c .m{display:block; font-family:var(--mono); font-size:10px; font-weight:400; color:var(--faint); margin-bottom:10px}
.p01c .pp{display:block; text-wrap:pretty}
.p01c .pp + .pp{margin-top:.6em}
@media (min-width: 900px){
  .pg-01 .g.first{padding-top:40px}
  /* caption column = the three grid columns right of the photo */
  .p01c{width:calc((100% - 192px) / 3 + 72px - 28px); max-width:340px; margin-top:0}
}

/* ════ Page: Selected ════ */
.se-h{padding-top:48px}
.pg-selected .g.se{padding-top:56px}
.pg-selected .contact{padding-top:200px}

/* ════ Page: Prints ════ */
/* one framed print at a time, never two side by side; the shop caption sits at the frame's bottom right corner */
.pr-h{padding-top:48px}
.pw{display:flex; flex-direction:column; gap:56px; padding:56px 0 0}
.pi{margin:0; position:relative; z-index:2}
.pr-f{position:relative; width:calc(78% * var(--k,1)); max-width:100%}
.pr-f img{display:block; width:100%; height:auto}
.pr-c{display:block; margin-top:6px; font-size:9px; line-height:1.35; font-weight:400; letter-spacing:0}
.pr-c .t{font-weight:600} .pr-c .s{color:var(--faint)}
.pr-p{display:block; margin-top:8px; font-family:var(--mono); font-size:9px}
.pr-b{all:unset; display:inline-block; margin-top:8px; font-size:10px; line-height:1.3; font-weight:600; letter-spacing:.06em; text-transform:uppercase; border-bottom:1px solid currentColor; padding-bottom:1px; cursor:pointer}
.pr-b:hover{color:var(--mute)} .pr-b.in{color:var(--mute); border-bottom-color:transparent}
.pr-b:focus-visible{outline:1px solid currentColor; outline-offset:3px}
@media (min-width: 900px){
  .pw{display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); column-gap:24px; row-gap:120px; align-items:start; padding-top:72px}
  .pi{grid-column:var(--c) / span 5; grid-row:var(--r); padding-left:var(--pl)}
  .pi.land{grid-column:var(--c) / span 6}
  /* one fixed scale for every frame, so all prints read at the same real size */
  .pr-f{width:calc(450px * var(--k,1)); max-width:none}
  .pr-c{position:absolute; left:calc(var(--fr) * 100% + 28px); bottom:calc(var(--fb) * 100%); width:140px; margin:0}
}

/* ════ Page: Spotkania (list) ════ */
/* mirrored cascade (K10); captions under the photo: number and place in DM Mono, the name in Inter */
.sp-h{padding-top:48px}
.sw{display:flex; flex-direction:column; gap:56px; padding-top:56px}
.st{margin:0; width:72%; position:relative; z-index:2}
.st:nth-child(even){align-self:flex-end}
.st img{display:block; width:100%; height:auto; aspect-ratio:4 / 5; object-fit:cover; background:var(--ph)}
.st a:hover img{filter:brightness(.94)}
/* each caption line is its own block with an explicit size, so the default strut can't open the leading */
.st-c{display:block; margin-top:9px; font-size:10px; line-height:1.2}
.st-l,.st-s{display:block; line-height:1.2}
.st-n,.st-s{font-family:var(--mono); font-size:10px; font-weight:400; letter-spacing:0; color:var(--faint)}
.st-t{font-size:11px; font-weight:600; letter-spacing:-.01em}
@media (min-width: 900px){
  /* the item's right edge sits where its column's left edge would be in the left-to-right version */
  .sw{display:block; position:relative; height:calc(var(--rows) / 1440 * 100vw); padding-top:0; margin-top:72px}
  .st{position:absolute; width:calc(var(--w) / 1360 * 100%); right:calc(var(--c) * ((100% - 264px) / 12 + 24px)); top:calc(var(--t) / 1440 * 100vw)}
}

/* ════ Page: a single story (H4, a book page) ════ */
/* one comfortable reading column (Spectral 300, 20 px, line-height 1.62, about 65 characters a line);
   the left margin holds the metadata and a small portrait, sticky while reading */
.sy{display:flex; flex-direction:column; gap:28px; padding:40px 0 0}
.sy-m{display:flex; flex-direction:column; gap:12px}
.sy-meta{display:flex; flex-direction:column; font-family:var(--mono); font-size:10px; line-height:1.3; color:var(--faint)}
.sy-meta span:nth-child(2){font-family:var(--sans); font-size:11px; font-weight:600; color:var(--ink)}
.sy-mf{margin:0; width:150px} .sy-mf img{display:block; width:100%; height:auto; aspect-ratio:4/5; object-fit:cover}
.sy-f figcaption{margin-top:8px; font-size:9px; line-height:1.2; color:var(--faint)}
.sy-back{align-self:flex-start; font-size:10px; line-height:1.3; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--ink); border-bottom:1px solid currentColor} .sy-back:hover{color:var(--mute)}
.sy-back-end{display:inline-block; margin-top:22px}
.sy-m .sy-back{margin-top:22px; font-size:11px; letter-spacing:0; text-transform:none}
.sy-col{max-width:620px}
.sy-h{margin:0 0 36px; font-family:var(--serif); font-weight:300; font-size:44px; line-height:1; letter-spacing:-.02em}
.sy-b p{margin:0 0 1.05em; font-family:var(--serif); font-weight:300; font-size:19px; line-height:1.62; letter-spacing:0; hyphens:manual}
.sy-f{margin:2em 0 2.2em} .sy-f img{display:block; width:100%; height:auto}
.sy-next{display:flex; justify-content:space-between; align-items:baseline; margin-top:48px; padding-top:14px; border-top:1px solid var(--line)}
.sy-next span:first-child{font-family:var(--mono); font-size:10px; color:var(--faint)}
.sy-nn{font-family:var(--serif); font-weight:300; font-size:20px} .sy-next:hover .sy-nn{color:var(--mute)}
.pg-story .contact{padding-top:160px}
@media (min-width: 900px){
  .sy{display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); column-gap:24px; padding-top:72px; align-items:start}
  .sy-m{grid-column:1 / span 3; position:sticky; top:120px}
  .sy-mf{width:220px}
  .sy-col{grid-column:4 / span 6; max-width:640px}
  .sy-h{font-size:64px}
  .sy-b p{font-size:20px}
}
/* reading pages: the menu scrolls away with the page instead of staying pinned over the text column */
@supports (animation-timeline: scroll()){
  .pg-story .mi a, .pg-story .mi .grp, .pg-story .mi .ln, .pg-story .lang{animation:none}
}
