:root {
  --ink: #181714;
  --paper: #ebe9e1;
  --orange: #ee4b27;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, a { color: inherit; }
a { text-decoration: none; }
button { font: inherit; }

.page {
  display: grid;
  grid-template-columns: minmax(220px, 24vw) 1fr;
  min-height: 100svh;
  transition: background-color .7s;
}
.tone-rust { background: #e7e2d8; }
.tone-violet { background: #e4e0e7; }

.profile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #181714bf;
  padding: 22px 24px 24px;
}
.profile h1, .profile p { margin: 0; }
.profile h1,
.profile-top p,
.profile-bottom,
.gallery-meta,
.gallery-controls {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-weight: 400;
}
.profile h1 { font-size: 10px; line-height: 1.3; }
.profile-top p { margin-top: 9px; font-size: 10px; }
.profile-bottom {
  display: grid;
  gap: 14px;
  font-size: 10px;
  line-height: 1.3;
}
.profile-bottom a {
  width: fit-content;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
}
.profile-bottom a span { display: inline-block; transition: transform .25s; }
.profile-bottom a:hover span,
.profile-bottom a:focus-visible span { transform: translate(3px, -3px); }

.gallery {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  min-width: 0;
  min-height: 100svh;
  padding: 22px 24px 20px;
}
.gallery-meta,
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  line-height: 1;
}
.gallery-meta { justify-content: flex-end; }
.image-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.image-stage img {
  display: block;
  width: auto;
  max-width: 90%;
  height: auto;
  max-height: calc(100svh - 104px);
  object-fit: contain;
  box-shadow: 0 1px #00000014;
  animation: image-in .65s cubic-bezier(.2,.7,.2,1);
}
.image-hit {
  position: absolute;
  inset-block: 0;
  width: 50%;
  opacity: 0;
  background: transparent;
  border: 0;
}
.image-hit-previous { left: 0; cursor: w-resize; }
.image-hit-next { right: 0; cursor: e-resize; }
.gallery-controls { justify-content: flex-end; gap: 18px; }
.gallery-controls button {
  cursor: pointer;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  padding: 0;
  transition: opacity .2s;
}
.gallery-controls button:hover,
.gallery-controls button:focus-visible { opacity: .45; }
.square { width: 6px; height: 6px; background: var(--orange); }

@keyframes image-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) and (pointer: fine) {
  html, body, a, button, .image-hit-previous, .image-hit-next { cursor: none !important; }
  .custom-cursor {
    --cursor-x: -40px;
    --cursor-y: -40px;
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    width: 9px;
    height: 9px;
    border: 1px solid var(--orange);
    background: var(--orange);
    pointer-events: none;
    opacity: 0;
    transform: translate3d(var(--cursor-x), var(--cursor-y), 0) translate(-50%, -50%);
    transform-origin: 50%;
    transition: width .2s, height .2s, background-color .2s, border-color .2s, opacity .15s;
  }
  .custom-cursor.is-visible { opacity: 1; }
  .custom-cursor.is-viewfinder {
    width: 46px;
    height: 46px;
    background: #ffffff3d;
    border: 0;
  }
  .custom-cursor.is-interactive {
    border-color: var(--ink);
    background: var(--ink);
  }
}

@media (max-width: 700px) {
  .page { display: block; min-height: 100svh; }
  .profile {
    min-height: 112px;
    flex-direction: row;
    align-items: flex-start;
    border-right: 0;
    border-bottom: 1px solid #181714bf;
    padding: 17px 18px;
  }
  .profile-bottom { text-align: right; justify-items: end; }
  .gallery {
    gap: 14px;
    min-height: calc(100svh - 112px);
    padding: 16px 18px 18px;
  }
  .image-stage img {
    max-width: 100%;
    max-height: calc(100svh - 205px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  html, body, a, button, .image-hit-previous, .image-hit-next { cursor: auto !important; }
  .custom-cursor { display: none !important; }
}
