/* Luis Tokarski – Fotografie */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --r-lg: 28px;
  --r-md: 20px;
  --gap: 12px;
  --max: 1200px;
  --gutter: 24px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

body[data-theme="light"] {
  --bg: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .1);
  --nav: rgba(255, 255, 255, .72);
}

body[data-theme="dark"] {
  --bg: #000000;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --line: rgba(255, 255, 255, .16);
  --nav: rgba(0, 0, 0, .66);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.47 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.025em; line-height: 1.06; text-wrap: balance; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 8px 14px; border-radius: 10px; background: var(--text); color: var(--bg);
}
.skip:focus { top: 8px; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: calc(var(--max) + 2 * var(--gutter)); height: 48px; margin: 0 auto; padding: 0 var(--gutter);
  font-size: 13px;
}
.brand { font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.nav-links { display: flex; gap: 24px; white-space: nowrap; }
.nav-links a { opacity: .78; transition: opacity .2s; padding: 8px 0; }
.nav-links a:hover, .nav-links a[aria-current] { opacity: 1; }

/* Shared text */
.eyebrow { color: var(--muted); font-size: 15px; font-weight: 500; letter-spacing: -.005em; margin-bottom: 8px; }
.lead { font-size: clamp(21px, 2.6vw, 28px); line-height: 1.25; letter-spacing: -.015em; color: var(--muted); }
.more { display: inline-block; font-size: 17px; }
.chev { display: inline-block; transition: transform .25s var(--ease); }
a:hover > .chev, a:hover .more .chev, .next-link:hover .chev { transform: translateX(3px); }

/* Home hero */
.hero { text-align: center; padding: clamp(56px, 9vw, 104px) var(--gutter) 0; }
.hero h1 { font-size: clamp(48px, 9vw, 104px); letter-spacing: -.035em; }
.hero .lead { margin: 12px 0 18px; }
.hero-img { max-width: var(--max); margin: clamp(40px, 6vw, 64px) auto 0; }
.hero-img img { width: 100%; border-radius: var(--r-lg); }

/* Work tiles */
.work { padding: clamp(72px, 10vw, 120px) var(--gutter) var(--gap); }
.work-title {
  max-width: var(--max); margin: 0 auto 32px;
  font-size: clamp(36px, 5vw, 56px);
}
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); max-width: var(--max); margin: 0 auto; }
.tile {
  display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden; padding: var(--gap);
}
.tile-full { grid-column: 1 / -1; }
.tile-light { background: #f5f5f7; color: #1d1d1f; --muted: #6e6e73; }
.tile-dark { background: #161617; color: #f5f5f7; --muted: #a1a1a6; }
.tile-text { text-align: center; padding: clamp(28px, 4vw, 44px) 16px clamp(24px, 3vw, 32px); }
.tile h3 { font-size: clamp(30px, 3.6vw, 40px); margin-bottom: 10px; }
.tile-full h3 { font-size: clamp(34px, 5vw, 56px); }
.tile-img { margin-top: auto; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 3 / 2; }
.tile-full .tile-img { aspect-ratio: 2 / 1; }
.tile-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .9s var(--ease);
}
.tile:hover .tile-img img { transform: scale(1.025); }

/* About + contact */
.about { padding: clamp(72px, 10vw, 120px) var(--gutter); }
.about-in {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center;
  gap: clamp(32px, 7vw, 96px); max-width: 980px; margin: 0 auto;
}
.about-img img { width: 100%; border-radius: var(--r-lg); }
.about h2 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 14px; }

.contact {
  text-align: center; padding: clamp(56px, 8vw, 96px) var(--gutter) clamp(88px, 12vw, 144px);
  border-top: 1px solid var(--line);
}
.contact h2 { font-size: clamp(44px, 7vw, 80px); letter-spacing: -.03em; margin-bottom: 32px; }
.pill {
  display: inline-block; max-width: 100%; padding: 13px 26px; border-radius: 980px;
  background: var(--text); color: var(--bg); font-size: 17px; font-weight: 500;
  overflow-wrap: anywhere; transition: opacity .2s;
}
.pill:hover { opacity: .82; }

/* Series pages */
.s-head { text-align: center; padding: clamp(56px, 8vw, 96px) var(--gutter) clamp(36px, 5vw, 56px); }
.s-head h1 { font-size: clamp(44px, 8vw, 88px); letter-spacing: -.035em; }
.gallery {
  display: flex; flex-direction: column; gap: var(--gap);
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
}
.ph { display: block; border-radius: var(--r-md); overflow: hidden; cursor: zoom-in; }
.ph img { width: 100%; border-radius: var(--r-md); transition: opacity .25s; }
.ph:hover img { opacity: .9; }
.cover img, .cover { border-radius: var(--r-lg); }
.cover-portrait { width: min(100%, 560px); margin: 0 auto; }
.row { display: flex; gap: var(--gap); align-items: flex-start; }
.row .ph { flex: var(--ar) 1 0; min-width: 0; }

.next { text-align: center; padding: clamp(72px, 10vw, 120px) var(--gutter); }
.next-link { display: block; }
.next-title { display: block; font-size: clamp(34px, 5vw, 56px); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; }
.all { display: inline-block; margin-top: 20px; color: var(--muted); font-size: 15px; }
.all:hover { color: var(--text); }

/* Legal */
.legal { max-width: 680px; margin: 0 auto; padding: 0 var(--gutter) clamp(88px, 12vw, 144px); text-align: center; }
.legal h2 { font-size: 28px; margin-bottom: 12px; }
.legal a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.legal-img { width: min(100%, 420px); margin: clamp(40px, 6vw, 64px) auto 0; border-radius: var(--r-lg); }

/* Footer */
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot-in {
  display: flex; justify-content: space-between; gap: 16px;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 20px var(--gutter);
}
.foot a:hover { color: var(--text); }

/* Lightbox */
.lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #fff; color: #1d1d1f; overflow: hidden;
}
.lb::backdrop { background: #fff; }
.lb[open] { display: flex; align-items: center; justify-content: center; }
.lb img {
  max-width: calc(100vw - 32px); max-height: calc(100dvh - 112px);
  width: auto; height: auto; border-radius: var(--r-md);
}
.lb-btn {
  position: absolute; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .06); color: #1d1d1f; cursor: pointer;
  font: 400 24px/1 var(--font); transition: background .2s;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.lb-btn:hover { background: rgba(0, 0, 0, .12); }
.lb-close { top: 16px; right: 16px; font-size: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 13px; color: #6e6e73; font-variant-numeric: tabular-nums; }

/* Scroll animations. Scroll-linked values use the separate `scale` and
   `translate` properties, so they never fight with transform-based effects. */
@media (prefers-reduced-motion: no-preference) {
  /* Fade in as content enters the view */
  .js .reveal {
    opacity: 0; transform: translateY(32px);
    transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out);
  }

  /* Pictures slide in from the side. The distance is relative to the picture,
     so part of it always overlaps its final place and is detected on screen. */
  main { overflow-x: hidden; overflow-x: clip; }
  .js .slide-l, .js .slide-r {
    transition: opacity .7s var(--ease), transform 1.3s var(--ease-out);
  }
  .js .slide-l { transform: translateX(-60%); }
  .js .slide-r { transform: translateX(60%); }
  .js .hero-img:not(.in), .js .gallery > .cover:not(.in) { opacity: 0; }
  .js .reveal.in { opacity: 1; transform: none; }

  /* About: picture from the side, then the text line by line */
  .js .about-in.reveal { opacity: 1; transform: none; }
  .js .about-img, .js .about-text > * {
    opacity: 0;
    transition: opacity 1s var(--ease-out), transform 1.3s var(--ease-out);
  }
  .js .about-img { transform: translateX(-40%); }
  .js .about-text > * { transform: translateY(28px); }
  .js .about-text > :nth-child(1) { transition-delay: .15s; }
  .js .about-text > :nth-child(2) { transition-delay: .25s; }
  .js .about-text > :nth-child(3) { transition-delay: .35s; }
  .js .about-in.in .about-img, .js .about-in.in .about-text > * { opacity: 1; transform: none; }

  /* Entrance when a page opens */
  @keyframes rise { from { opacity: 0; transform: translateY(20px); } }
  .js .hero > :not(.hero-img), .js .s-head > * {
    animation: rise 1.1s var(--ease-out) backwards;
  }
  .js .hero > :nth-child(2), .js .s-head > :nth-child(2) { animation-delay: .08s; }
  .js .hero > :nth-child(3), .js .s-head > :nth-child(3) { animation-delay: .16s; }

  /* Scroll-linked: tile pictures drift in their frame */
  .js .tile-img img { scale: 1.14; translate: 0 var(--py, 0); }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; --r-lg: 22px; --r-md: 16px; --gap: 10px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile-full .tile-img { aspect-ratio: 3 / 2; }
  .nav-links { gap: 16px; }
  .row { flex-direction: column; }
  .row .ph { flex: none; width: 100%; }
  .about-in { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .about-img { max-width: 420px; margin: 0 auto; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile-img img, .chev, .ph img { transition: none; }
}
