/* jtvda.design — mostly black, sometimes International Klein Blue. */

:root {
  --black: #0a0a0a;
  --white: #f4f3ef;
  --ikb: #002fa7;
  --muted: #8f8d87;
  --soft: #c9c7c1;
  --line: #232323;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --pad: clamp(16px, 2.6vw, 36px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scrollbar-gutter: stable; background: var(--black); }

::selection { background: var(--ikb); color: #ffffff; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
em { font-style: italic; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.label {
  margin: 0;
  font: 500 11px/1.4 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- loader ---------- */

.loader { display: none; }
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  background: var(--black);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.js.seen .loader { display: none; }
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  background: var(--ikb);
}
.loader__count {
  position: absolute;
  left: 50%;
  top: calc(50% + 34px);
  transform: translateX(-50%);
  font: 500 11px var(--sans);
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ---------- corners ---------- */

.hud {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 var(--pad);
  font: 500 11px/1.3 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--white);
  pointer-events: none;
}
.hud a { pointer-events: auto; text-decoration: none; padding: 16px 0; }
.hud a:hover, .hud__nav a[aria-current] { text-decoration: underline; text-underline-offset: 5px; }
.hud--top { top: 0; --hud-bg: var(--black); }
.hud--top[data-theme="blue"] { --hud-bg: var(--ikb); }
.hud--bottom { bottom: 0; padding-bottom: 14px; color: var(--muted); }
.hud__brand { font-family: var(--serif); font-size: 24px; letter-spacing: 0; text-transform: none; }
.hud__nav { display: flex; gap: 24px; }

/* ---------- cursor ---------- */

.cursor { display: none; }
.has-cursor .cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  display: block;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--white);
  pointer-events: none;
  opacity: 0;
  transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease, background 0.3s ease, opacity 0.3s ease;
}
.has-cursor .cursor.is-on { opacity: 1; }
.has-cursor .cursor.is-hover { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: transparent; border: 1px solid var(--white); }
.cursor__label {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font: 500 11px var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
}
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }

/* ---------- float ---------- */

@keyframes float-a { 0%, 100% { transform: translate3d(0, 0, 0) rotate(-1.5deg); } 50% { transform: translate3d(0, -18px, 0) rotate(1deg); } }
@keyframes float-b { 0%, 100% { transform: translate3d(0, 0, 0) rotate(1.5deg); } 50% { transform: translate3d(0, 16px, 0) rotate(-1deg); } }
@keyframes float-c { 0%, 100% { transform: translate3d(0, -8px, 0); } 50% { transform: translate3d(0, 12px, 0) rotate(3deg); } }
.float-a { animation: float-a 11s ease-in-out infinite; }
.float-b { animation: float-b 14s ease-in-out infinite; }
.float-c { animation: float-c 9s ease-in-out infinite; }

/* ---------- entrance: a Klein square that becomes the whole screen ---------- */

.scene { position: relative; }
.scene__stick {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.scene--entrance { height: 340vh; }
.entrance__square {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  background: var(--ikb);
  transform: scale(var(--s, 1));
  will-change: transform;
}
.entrance__intro {
  position: absolute;
  top: clamp(72px, 12vh, 120px);
  right: var(--pad);
  max-width: 240px;
  margin: 0;
  font-size: 13px;
  color: var(--soft);
  opacity: var(--intro-o, 1);
}
.entrance__hint {
  position: absolute;
  left: 50%;
  top: calc(50% + 34px);
  transform: translateX(-50%);
  color: var(--muted);
  opacity: var(--hint-o, 1);
}
.entrance__hint span { display: inline-block; animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(4px); } }
.entrance__name {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: clamp(48px, 8vh, 88px);
  margin: 0;
  font: 400 clamp(52px, 10.4vw, 176px)/0.86 var(--serif);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  opacity: var(--name-o, 1);
  transform: translateY(var(--name-y, 0));
}
.entrance__name span { display: block; }
.entrance__end {
  position: absolute;
  inset: 0;
  opacity: var(--end-o, 0);
  pointer-events: none;
}
.entrance__judd {
  position: absolute;
  left: 50%;
  top: 44%;
  width: clamp(240px, 36vw, 560px);
  margin-left: calc(clamp(240px, 36vw, 560px) / -2);
}
.entrance__judd img { width: 100%; transform: translateY(-50%) scale(var(--judd-s, 0.9)); }
.entrance__klein {
  position: absolute;
  left: var(--pad);
  bottom: clamp(48px, 8vh, 88px);
  max-width: 16ch;
  margin: 0;
  font: 400 clamp(36px, 5.2vw, 84px)/0.95 var(--serif);
  text-wrap: balance;
  color: #ffffff;
}
.entrance__cap {
  position: absolute;
  right: var(--pad);
  bottom: clamp(48px, 8vh, 88px);
  text-align: right;
  color: #ffffff;
}

/* ---------- work: pieces float on black, photographs stay still ---------- */

.work {
  position: relative;
  background: var(--black);
  padding: clamp(96px, 14vh, 160px) var(--pad) clamp(72px, 12vh, 140px);
}
.work__label, .about__label { color: var(--muted); }
.field { position: relative; }
.field--objects { height: clamp(760px, 112vh, 1100px); }
.field--photos { height: clamp(980px, 140vh, 1500px); margin-top: clamp(48px, 10vh, 120px); }

.item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translate3d(0, var(--py, 0px), 0);
  transition: opacity 0.5s ease;
  will-change: transform;
}
.item:focus-visible { outline: 1px solid var(--white); outline-offset: 10px; }
.item img { width: 100%; -webkit-user-drag: none; user-select: none; }
.item__img { display: block; }
.item__cap {
  display: flex;
  gap: 14px;
  width: max(100%, 200px);
  font: 500 11px/1.4 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.item__no { color: var(--muted); font-variant-numeric: tabular-nums; }
.item__name, .item__detail { display: block; }
.item__detail { margin-top: 2px; color: var(--muted); }

/* Photographs are black and white on the page; the viewer shows them as shot. */
.item--photo .item__img { overflow: hidden; background: #141414; }
.item--photo img {
  filter: grayscale(1) brightness(0.82);
  transition: filter 0.6s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.item--photo:hover img, .item--photo:focus-visible img { filter: grayscale(1) brightness(1.05); transform: scale(1.04); }

/* Point at one, the rest step back. */
@media (hover: hover) {
  .work:has(.item:hover) .item:not(:hover) { opacity: 0.35; }
}

/* ---------- viewer ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: var(--black);
  color: var(--white);
  opacity: 0;
  overscroll-behavior: contain;
  transition: opacity 0.35s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox, .lightbox * { cursor: auto; }
.lightbox button, .lightbox .lightbox__img { cursor: pointer; }
.lightbox__fig {
  margin: 0;
  width: min(84vw, 1200px);
  height: min(70vh, 860px);
  display: grid;
  place-items: center;
}
.lightbox__img {
  max-width: min(84vw, 1200px);
  max-height: min(70vh, 860px);
  width: auto;
  height: auto;
  object-fit: contain;
  transform: scale(0.97);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.lightbox.is-open .lightbox__img { transform: none; }
.lightbox button {
  appearance: none;
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 500 11px/1.4 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lightbox button:focus { outline: none; }
.lightbox button:focus-visible { outline: 1px solid currentColor; outline-offset: 6px; }
.lightbox__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--pad);
  font-variant-numeric: tabular-nums;
}
.lightbox__close { padding: 16px 0 16px 24px; }
.lightbox__close:hover, .lightbox__nav:hover { text-decoration: underline; text-underline-offset: 5px; }
.lightbox__nav {
  position: absolute;
  top: 56px;
  bottom: 120px;
  z-index: 1;
  width: 18%;
  display: flex;
  align-items: center;
  padding: 0 var(--pad) !important;
}
.lightbox__nav--prev { left: 0; justify-content: flex-start; }
.lightbox__nav--next { right: 0; justify-content: flex-end; }
.lightbox__bottom {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: clamp(20px, 4vh, 40px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px 24px;
  flex-wrap: wrap;
}
.lightbox__name { margin: 0; font: 400 clamp(28px, 3.4vw, 52px)/0.95 var(--serif); text-transform: uppercase; }
.lightbox__detail { max-width: 46ch; color: var(--muted); }
.lb-open { overflow: hidden; }
.lb-open .cursor { display: none !important; }

/* ---------- about ---------- */

.about {
  background: var(--black);
  border-top: 1px solid var(--line);
  padding: clamp(96px, 14vh, 160px) var(--pad) clamp(96px, 16vh, 180px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: clamp(40px, 7vh, 80px);
  align-items: start;
}
.about__label { grid-column: 1 / -1; }
.about__portrait { grid-column: 1 / span 4; margin: 0; max-width: 380px; }
.about__portrait img { width: 100%; }
.about__text { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 28px; }
.about__lead { margin: 0; font: 400 clamp(26px, 3vw, 46px)/1.1 var(--serif); text-wrap: pretty; }
.about__body { margin: 0; max-width: 46ch; color: var(--soft); text-wrap: pretty; }
.about__facts {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px 24px;
  align-items: baseline;
  margin: 12px 0 0;
  padding-top: 22px;
  max-width: 560px;
  border-top: 1px solid var(--line);
}
.about__facts dt { color: var(--muted); }
.about__facts dd { margin: 0; }
.about__facts a { text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--muted); transition: text-decoration-color 0.25s ease; }
.about__facts a:hover { text-decoration-color: var(--white); }

/* ---------- contact: the one blue screen ---------- */

.contact {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--ikb);
  color: #ffffff;
  padding: clamp(96px, 14vh, 160px) var(--pad) clamp(56px, 9vh, 88px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 64px;
}
.contact__main { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.contact__mail {
  font: 400 clamp(30px, 8.2vw, 140px)/0.9 var(--serif);
  text-decoration: underline;
  text-decoration-thickness: 0.035em;
  text-underline-offset: 0.12em;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.3s ease;
}
.contact__mail:hover, .contact__mail:focus-visible { text-decoration-color: currentColor; outline: none; }
.contact__copy {
  appearance: none;
  margin: 0;
  padding: 14px 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}
.contact__copy:hover, .contact__copy:focus-visible { text-decoration-color: #ffffff; outline: none; }
.contact__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  padding-top: 4px;
}
.contact__foot a, .contact__foot span { padding: 14px 0; }
.contact__foot a { text-decoration: none; }
.contact__foot a:hover { text-decoration: underline; text-underline-offset: 5px; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  /* Menu: a solid bar that hides while you scroll down and comes back on the way up. */
  .hud--top {
    background: var(--hud-bg);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.3s ease;
  }
  .hud--top[data-section="entrance"] { background: transparent; }
  .nav-hidden .hud--top { transform: translateY(-100%); }
  .hud__nav { gap: 16px; }
  /* The clock stays on the first screen only. */
  .hud--bottom { position: absolute; bottom: auto; top: calc(100vh - 40px); top: calc(100svh - 40px); padding-bottom: 0; }

  .entrance__name, .entrance__klein { bottom: 64px; }
  .entrance__cap { top: 72px; bottom: auto; left: var(--pad); right: auto; text-align: left; }

  .field--objects { height: 150vh; margin-top: 40px; }
  .field--photos { height: 190vh; }
  .item { left: var(--xm); top: var(--ym); width: var(--wm); gap: 10px; }
  .item__cap { width: max(100%, 170px); }
  .item--photo .item__cap { width: 100%; }

  .about { display: flex; flex-direction: column; }
  .about__portrait { width: 58vw; }

  .contact__foot { padding-bottom: 8px; }

  /* Viewer: photo on top, caption under it, Prev / Next as the last row. */
  .lightbox { align-items: start; padding-top: 60px; }
  .lightbox__fig { width: 92vw; height: calc(100vh - 270px); height: calc(100svh - 270px); }
  .lightbox__img { max-width: 92vw; max-height: calc(100vh - 270px); max-height: calc(100svh - 270px); }
  .lightbox__nav { top: auto; bottom: 0; height: 56px; width: 50%; align-items: center; }
  .lightbox__bottom { bottom: 64px; flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float-a, .float-b, .float-c, .entrance__hint span { animation: none; }
  .js .loader { display: none; }
}
