@charset "UTF-8";

/*
  Mateusz Juras — full-screen photograph
  - fills the whole screen on desktop and mobile (no black strip on iPhone)
  - composition sits slightly left of centre, not dead-middle
  - the image drifts a few pixels with the cursor (desktop) / finger (mobile)
  - everything fades in gently on load
*/

:root {
  /* how far the image can drift during parallax, in px (kept subtle) */
  --drift: 16px;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000; /* shown only while the photo loads */
}

body {
  overflow: hidden; /* single screen, never scrolls */
}

/* The stage fills the visible screen, including under the iPhone home bar.
   position: fixed + inset: 0 avoids the mobile 100vh address-bar problem. */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
  touch-action: none; /* let us read finger movement without page gestures */
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.slide.is-active {
  opacity: 1;
}

.slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* shift the crop a little to the left of centre for an off-grid feel */
  object-position: 62% 50%;
  /* scaled up slightly so there is room to drift without showing edges */
  transform: scale(1.08);
  transform-origin: center;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;

  /* start hidden; .ready (added by JS once loaded) fades it in */
  opacity: 0;
  transition: opacity 1.1s ease;
}

/* On portrait phones the photo is cropped hard left-to-right, so ease the
   off-centre bias back toward the middle to keep the contact text on screen. */
@media (orientation: portrait) {
  .slide img {
    object-position: 52% 50%;
  }
}

body.ready .slide.is-active img {
  opacity: 1;
}

/* Accessibility: anyone who asks their device to reduce motion gets
   no drift and an instant (not animated) image. */
@media (prefers-reduced-motion: reduce) {
  .slide,
  .slide img {
    transition: none;
  }
  .slide img {
    transform: none;
  }
}

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