/* michalskiwagner.com: replica of the Wix layout.
   Desktop: Wix's centred 980 px column, header and menu pinned to the window.
   Mobile (< 768 px): Wix's 320 px mobile layout, scaled to the screen width.
   --u = one desktop pixel, --m = one mobile-layout pixel. */

:root {
  --u: 1px;
  --m: calc(100vw / 320);
  --ink: #000;
  --off: #d6d6d4;
  --paper: #fff;
  color-scheme: light;
}
@media (min-width: 768px) and (max-width: 979.98px) {
  :root { --u: calc(100vw / 980); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--paper); }
body {
  overflow-x: hidden;
  color: var(--ink);
  font-family: arial, "ms pgothic", dotum, helvetica, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
ul { list-style: none; margin: 0; padding: 0; }
img { display: block; }

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px;
}

/* ---------- header: team@michalskiwagner.com ---------- */

.hdr { z-index: 50; }
.hdr p { margin: 0; white-space: nowrap; }
.t1, .t3 { font-weight: 700; }
.t2 { font-family: Avenir, "Avenir Next", arial, helvetica, sans-serif; font-weight: 800; }
.on-dark { color: #fff; }

/* ---------- menu ---------- */

.menu { z-index: 50; }
.menu li.off { color: var(--off); }
.menu li.cur { font-weight: 700; }

/* ---------- page ---------- */

.page { position: relative; overflow: hidden; }
.col { position: absolute; top: 0; height: 100%; }
.im { position: absolute; transform-origin: 50% 50%; }
.im img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.notfound { position: absolute; margin: 0; }

/* Home slideshow: every photograph whole (never cropped). It always spans the full window
   width, touching the top, left and right edges; its height follows the photo's own
   proportions (--r = width / height, set per slide), so the bottom ends where the photo ends. */
.home .page { height: auto; }
.gallery { position: relative; width: 100%; }
.frame {
  position: relative; overflow: hidden; background: #e9e9e7;
  width: 100%;
  aspect-ratio: var(--r, 1.25);
}
.frame img { width: 100%; height: 100%; object-fit: contain; object-position: 0 0; }
@supports not (aspect-ratio: 1) {
  .frame img { height: auto; }
}
.counter { position: absolute; color: #fff; font-family: arial, helvetica, sans-serif; line-height: normal; }

/* ---------- desktop ---------- */

@media (min-width: 768px) {
  .pin { position: fixed; }
  .hdr { left: calc(var(--u) * 80); top: calc(var(--u) * 216); width: calc(var(--u) * 432); }
  .hdr p { font-size: calc(var(--u) * 15); line-height: calc(var(--u) * 33); }
  .t1 { font-size: calc(var(--u) * 60); }
  .t2 { font-size: calc(var(--u) * 19); }
  .t3 { font-size: calc(var(--u) * 24); }

  .menu { left: calc(var(--u) * 76); top: calc(var(--u) * 269); width: calc(var(--u) * 163); }
  .menu li { font-size: calc(var(--u) * 15); line-height: calc(var(--u) * 21); }

  .page { height: calc(var(--u) * var(--ph)); }
  .col { left: 50%; width: calc(var(--u) * 980); margin-left: calc(var(--u) * -490); }
  .im {
    left: calc(var(--u) * var(--dx)); top: calc(var(--u) * var(--dy));
    width: calc(var(--u) * var(--dw)); height: calc(var(--u) * var(--dh));
    transform: rotate(var(--dr));
  }
  .counter { right: calc(var(--u) * 10); bottom: calc(var(--u) * 10); font-size: calc(var(--u) * 12); }
  .notfound { left: calc(var(--u) * 300); top: calc(var(--u) * 269); font-size: calc(var(--u) * 15); }
}

/* Short windows: the pinned menu would not fit, so it scrolls with the page instead. */
@media (min-width: 768px) and (max-height: 679.98px) {
  .pin { position: absolute; }
}

/* ---------- mobile ---------- */

@media (max-width: 767.98px) {
  .pin { position: absolute; }
  .hdr { left: calc(var(--m) * 8); top: calc(var(--m) * 46); width: calc(var(--m) * 304); }
  .hdr p { font-size: calc(var(--m) * 20); line-height: normal; }
  .t1 { font-size: calc(var(--m) * 31); }
  .t2, .t3 { font-size: calc(var(--m) * 17); }

  .menu { left: calc(var(--m) * 9); top: calc(var(--m) * 102); width: calc(var(--m) * 301); }
  .menu li { font-size: calc(var(--m) * 15); line-height: calc(var(--m) * 21); }
  .project .menu { display: none; }

  .page { height: calc(var(--m) * var(--pm)); }
  .col { left: 0; width: 100%; }
  .im {
    left: calc(var(--m) * var(--mx)); top: calc(var(--m) * var(--my));
    width: calc(var(--m) * var(--mw)); height: calc(var(--m) * var(--mh));
    transform: rotate(var(--mr));
  }
  .counter { right: calc(var(--m) * 10); bottom: calc(var(--m) * 10); font-size: calc(var(--m) * 12); }
  .notfound { left: calc(var(--m) * 9); top: calc(var(--m) * 120); font-size: calc(var(--m) * 15); }
}

.page.nf { --ph: 900; --pm: 700; }
