:root {
  font-family: Haffer, Arial, Helvetica, sans-serif;
  --text-size: 12px;
  font-size: var(--text-size);
  line-height: 1.12;
  color: #b5b5b5;
  background: #fff;
  --inset: clamp(16px, 1.63vw, 30px);
  --gap: clamp(9px, .857vw, 16px);
  --tile-height: 63.2svh;
  --tile-width: calc(var(--tile-height) * .7086);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
button { font: inherit; cursor: pointer; border: 0; }
button:focus-visible, .rail:focus-visible { outline: 2px solid #838383; outline-offset: 4px; }
.masthead { position: fixed; inset: var(--inset) var(--inset) auto; display: flex; justify-content: space-between; gap: 30px; }
.about { margin: 0; width: min(28.43vw, 523px); font-size: inherit; line-height: inherit; text-transform: uppercase; }
.about strong { color: #1d1d1d; font-weight: 700; }
.menu { max-width: 55vw; flex-wrap: wrap; justify-content: flex-end; display: flex; align-items: flex-start; gap: clamp(3px, .272vw, 5px); color: #000; }
.menu button { border-radius: 4.5px; background: #dfdfdf; min-width: clamp(20px, 1.423vw, 27px); height: clamp(30px, 2.503vw, 46px); padding: 0 6px; font-size: inherit; font-weight: 400; line-height: inherit; text-transform: uppercase; position: relative; display: inline-grid; place-items: center; transition: background-color 250ms ease; }
.menu-number { position: absolute; opacity: 1; transition: opacity 150ms ease; }
.menu-label { display: block; max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transform: translateY(3px); transition: max-width 320ms cubic-bezier(.22, 1, .36, 1), opacity 200ms ease, transform 320ms cubic-bezier(.22, 1, .36, 1); }
.menu button:is(:hover, :focus-visible) .menu-label { max-width: var(--menu-label-width); opacity: 1; transform: translateY(0); }
.menu button:is(:hover, :focus-visible) .menu-number { opacity: 0; }
.menu button:hover, .menu button.selected { background: #d6d6d6; }
.portfolio { position: fixed; inset: auto 0 var(--inset); }
.project-context { position: relative; width: var(--tile-width); margin-left: var(--inset); margin-bottom: clamp(9px, .911vw, 17px); }
#description { margin: 0 0 clamp(8px, .8vw, 15px); min-height: 1.12em; font-size: inherit; line-height: inherit; text-transform: uppercase; }
.stories { display: flex; gap: clamp(4px, .428vw, 8px); }
.story { position: relative; flex: 1; height: 5px; padding: 0; border-radius: 999px; background: #dfdfdf; }
.story::before { content: ''; position: absolute; inset: -9px 0; }
.story-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: #838383; }
.rail { overflow-x: auto; overflow-y: hidden; width: 100%; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; scroll-snap-type: x mandatory; scroll-padding-inline-start: var(--inset); }
.rail.gliding { scroll-snap-type: none; }
.rail::-webkit-scrollbar { display: none; }
.track { display: flex; gap: var(--gap); width: max-content; padding-inline: var(--inset); }
.tile { position: relative; flex: 0 0 var(--tile-width); width: var(--tile-width); height: var(--tile-height); overflow: hidden; background: #eee; scroll-snap-align: start; }
.tile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 450ms ease; }
.tile img.visible { opacity: 1; }

@media (max-width: 600px) {
  :root { --tile-height: 57svh; --tile-width: calc(var(--tile-height) * .7086); }
  .masthead { gap: 14px; }
  .about { width: min(58vw, 310px); }
  .menu { gap: 3px; }
  .menu button { min-width: 22px; padding-inline: 4px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  :root { --tile-height: 54svh; }
  .about { width: 45vw; }
}
@media (prefers-reduced-motion: reduce) { .tile img, .menu button, .menu-number, .menu-label { transition: none; } }

#project-copy { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 0; font-size: inherit; line-height: inherit; text-transform: uppercase; }
#project-copy:empty { display: none; }
#status { margin: 0 var(--inset) 20px; font-size: inherit; }

.masthead { z-index: 5000; }
.orbit-gallery { position: fixed; inset: var(--index-top, 150px) 0 0; overflow: hidden; background: #fff; cursor: grab; touch-action: none; user-select: none; }
.orbit-gallery.pointer-focused:focus { outline: none; }
.orbit-gallery.is-dragging { cursor: grabbing; }
.orbit-gallery:focus-visible:not(.pointer-focused) { outline: 2px solid #838383; outline-offset: -4px; }
.orbit-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}
.orbit-tile { position: absolute; top: 0; left: 0; width: var(--width); height: var(--height); margin: 0; opacity: var(--opacity, 0); transform: translate3d(var(--x, 0), var(--y, 0), 0) rotate(var(--rotation, 0deg)) scale(var(--scale, .4)); transform-origin: center; will-change: transform, opacity; }
.orbit-tile img { display: block; width: 100%; height: 100%; border-radius: clamp(10px, 2.2vw, 20px); object-fit: cover; }
.orbit-controls { position: absolute; z-index: 5000; bottom: var(--inset); left: var(--inset); right: var(--inset); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; cursor: default; text-transform: uppercase; }
.orbit-mode { color: #1d1d1d; background: #dfdfdf; border-radius: 4.5px; padding: 8px 10px; text-transform: uppercase; }
.orbit-mode[aria-pressed="true"] { background: #d6d6d6; }
.orbit-controls label { display: flex; align-items: center; gap: 6px; }
.orbit-controls input { width: clamp(40px, 8vw, 100px); accent-color: #838383; }
.orbit-controls output { min-width: 3em; }
.orbit-controls span { margin-left: auto; }
@media (max-width: 600px) { .orbit-controls { gap: 6px 12px; } .orbit-controls span { margin-left: 0; width: 100%; } }

/* Menu navigation shares the reference site's quiet exit and slower entrance. */
.page-out { animation: page-out 400ms ease-in both; }
.page-out-back { animation: page-out-back 400ms ease-in both; }
.page-in { animation: page-in 800ms cubic-bezier(0, .635, .345, 1) both; }
.page-in-back { animation: page-in-back 800ms cubic-bezier(0, .635, .345, 1) both; }
@keyframes page-out {
  from { opacity: var(--page-exit-opacity, 1); transform: var(--page-exit-transform, none); }
  80% { opacity: 0; }
  to { opacity: 0; transform: translate3d(-10px, 0, 0); }
}
@keyframes page-out-back {
  from { opacity: var(--page-exit-opacity, 1); transform: var(--page-exit-transform, none); }
  80% { opacity: 0; }
  to { opacity: 0; transform: translate3d(10px, 0, 0); }
}
@keyframes page-in {
  from { opacity: 0; transform: translate3d(max(1vw, 25px), 0, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes page-in-back {
  from { opacity: 0; transform: translate3d(min(-1vw, -25px), 0, 0); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .page-out, .page-out-back, .page-in, .page-in-back { animation: none; }
}
