/* photos — same tokens as alex-kovch.com v2 */
:root {
  --bg: #111111;
  --card: #1c1c1c;
  --card-2: #222222;
  --line: #262626;
  --text: #f2f2f2;
  --muted: #8c8c8c;
  --dim: #5f5f5f;
  --font: "Arial Unicode MS", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --dur: .6s;
  --gap: 10px;    /* between tiles */
  --pad: 10px;    /* page side margin: the grid runs edge to edge */
  --cols: 4;      /* 4 tiles across at 1440 */
}
@media (max-width: 1099px) { :root { --cols: 3; } }
@media (max-width: 759px)  { :root { --cols: 2; } }
@media (max-width: 519px)  { :root { --cols: 1; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lock { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 24px; letter-spacing: -0.04em; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
p, h1 { margin: 0; }
button { font: inherit; letter-spacing: inherit; color: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.label { color: var(--muted); }

/* ---------- top line: name + small contacts ---------- */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 24px; padding: 14px calc(var(--pad) + 6px); }
.who { font-size: inherit; line-height: inherit; font-weight: 400; }
.contacts { display: flex; flex-wrap: wrap; gap: 2px 20px; }
.contacts a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); transition: color .2s; }
.contacts svg { width: 12px; height: 12px; }
.contacts a:hover, .contacts a:focus-visible { color: #fff; }
.who a:hover, .who a:focus-visible { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- grid ---------- */
.wrap { container-type: inline-size; padding: 0 var(--pad); }
/* rows are 2/3 of a column, so a plain tile is 3:2 and a portrait one (2 rows) is about 3:4 */
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap);
  grid-auto-rows: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols) * 2 / 3); grid-auto-flow: dense; }
.tile { position: relative; display: block; margin: 0; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: #1b1b1b; appearance: none; }
button.tile { cursor: zoom-in; }
.tile.tall { grid-row: span 2; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.tile.ok img { opacity: 1; }
@media (hover: hover) { .tile:hover img { transform: scale(1.03); } }
.tile:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- more / notes / credit ---------- */
.more { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 24px; }
.btn { height: 46px; padding: 0 28px; border: 0; border-radius: 10px; background: var(--card-2); color: #fff; font-size: 20px; line-height: 20px; cursor: pointer; transition: background .2s; }
.btn:hover { background: #2c2c2c; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.note { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; padding: 48px 16px; color: var(--muted); text-align: center; }
.credit { padding: 24px calc(var(--pad) + 6px) 28px; color: var(--dim); text-align: right; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; background: rgba(17, 17, 17, .97); color: var(--text); }
.lb::backdrop { background: transparent; }
.lb-bar { position: absolute; z-index: 3; top: 0; left: 0; right: 0; height: 52px; padding: 0 16px; display: flex; align-items: center; gap: 20px; }
.lb-count { margin-right: auto; }
.lb-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; transition: color .2s; }
.lb-link svg { width: 12px; height: 12px; }
.lb-link:hover, .lb-link:focus-visible { color: #fff; }
.lb-img { position: absolute; left: 16px; top: 52px; width: calc(100% - 32px); height: calc(100% - 68px); object-fit: contain; opacity: 0; transition: opacity .3s; }
.lb-img.on { opacity: 1; }
/* the two halves of the screen flip the photo */
.lb-nav { position: absolute; z-index: 2; top: 52px; bottom: 0; width: 50%; padding: 0 20px; border: 0; background: none; outline: none; display: flex; align-items: center; color: var(--muted); font-size: 20px; cursor: pointer; transition: color .2s; }
.lb-nav.prev { left: 0; justify-content: flex-start; }
.lb-nav.next { right: 0; justify-content: flex-end; }
.lb-nav:hover, .lb-nav:focus-visible { color: #fff; }
.lb-nav span { text-shadow: 0 0 8px rgba(0, 0, 0, .8); }
@media (hover: none) { .lb-nav span { display: none; } }  /* touch: swipe instead */

@media (prefers-reduced-motion: reduce) { .tile img, .lb-img { transition: none; } .tile:hover img { transform: none; } }
