:root {
  --paper: #f2f2ef;
  --ink: #0a0a0a;
  --quiet: #8f8f8b;
  --hairline: rgba(10, 10, 10, 0.17);
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  /* Slow spring resistance, then a fast mechanical seat into the detent. */
  --dial-ease: cubic-bezier(0.68, 0, 0.94, 0.42);
  --dial-duration: 440ms;
  --dial-angle: 0deg;
  --stage-scale: 1;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #deded9;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

.viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/*
  A fixed 1366 × 768 design stage preserves the coordinates in BG.svg.
  JavaScript scales this complete stage to fit any browser window.
*/
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1366px;
  height: 768px;
  overflow: hidden;
  background: var(--paper);
  transform: translate(-50%, -50%) scale(var(--stage-scale));
  transform-origin: center;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.08);
}

.indicator-artwork {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  width: 1366px;
  height: 768px;
  pointer-events: none;
  user-select: none;
}

.close-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.close-button::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 300ms ease;
}

.close-button:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.wordmark {
  position: absolute;
  /* The wordmark alone is lowered 60px from v1; the dial stays fixed. */
  left: 2.46px;
  top: 411.41px;
  z-index: 3;
  width: 646.27px;
  height: 364.99px;
  transform: rotate(0deg);
  transform-origin: 267.54px 10px;
  transition: transform 1100ms var(--ease);
  pointer-events: none;
  user-select: none;
}

.wordmark img {
  display: block;
  width: 100%;
  height: 100%;
}

body.is-open .wordmark {
  transform: rotate(90deg);
}

.dial-control {
  position: absolute;
  left: 195px;
  top: 346.41px;
  z-index: 12;
  width: 150px;
  height: 150px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.dial-control:active {
  cursor: grabbing;
}

.dial-artwork {
  display: block;
  width: 150px;
  height: 150px;
  transform: rotate(var(--dial-angle));
  transform-origin: 50% 50%;
  transition: transform var(--dial-duration) var(--dial-ease), filter 300ms ease;
  user-select: none;
  will-change: transform;
}

.dial-control:hover .dial-artwork {
  filter: drop-shadow(0 8px 13px rgba(0, 0, 0, 0.12));
}

.dial-control.is-dragging .dial-artwork {
  transition: none;
}

.dial-hit-label {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 64px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(242, 242, 239, 0.92);
  color: var(--ink);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 250ms ease;
  text-transform: uppercase;
  overflow: hidden;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  pointer-events: none;
}

.dial-control:hover .dial-hit-label {
  opacity: 1;
}

body.is-open .dial-hit-label {
  display: none;
}

.dial-help {
  position: absolute;
  left: 22.74px;
  top: 40px;
  z-index: 6;
  width: 330px;
  margin: 0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  transition: opacity 350ms ease;
}

body.is-open .dial-help {
  opacity: 0.52;
}

.mode-readout {
  position: absolute;
  left: 342px;
  top: 421.41px;
  z-index: 8;
  width: 120px;
  color: var(--quiet);
  opacity: 0;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.15em;
  transform: translateY(-50%);
  transition: opacity 400ms ease;
}

body.is-open .mode-readout {
  opacity: 1;
}

.gallery {
  position: absolute;
  left: 510px;
  top: 72px;
  z-index: 4;
  width: 790px;
  height: 650px;
  opacity: 0;
  transform: translateX(46px);
  transition: opacity 500ms 300ms ease, transform 900ms 220ms var(--ease);
  pointer-events: none;
}

body.is-open .gallery {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.gallery-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 34px;
  min-height: 115px;
  padding: 0 4px 20px;
  border-bottom: 1px solid var(--hairline);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--quiet);
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.gallery h1 {
  margin: 0;
  font-size: 35px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
}

.gallery h1 a {
  text-decoration: none;
}

.gallery h1 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.mode-description {
  margin: 10px 0 0;
  color: #5f5f5b;
  font-size: 12px;
  line-height: 1.45;
}

.close-button {
  margin-top: 4px;
}

.photo-stream {
  height: 535px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px 5px 90px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.24) transparent;
  overscroll-behavior: contain;
}

.photo-stream::-webkit-scrollbar {
  width: 5px;
}

.photo-stream::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
}

.photo-status,
.empty-series {
  margin: 0;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.empty-series {
  max-width: 310px;
  padding-top: 58px;
}

.empty-series p {
  margin: 0 0 5px;
  color: var(--ink);
}

.empty-series span {
  display: block;
}

.photo-card {
  width: 100%;
  margin: 0 0 58px;
  animation: photo-in 700ms var(--ease) both;
}

.back-to-top {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.back-to-top svg { display: block; width: 28px; height: 28px; }

.back-to-top:hover { opacity: 0.5; }

/*
  Portrait photographs keep their complete frame and approximately the same
  displayed height as a conventional full-width landscape photograph. The
  per-image width is calculated from its natural aspect ratio in site.js.
*/
.photo-card.is-portrait {
  width: min(100%, var(--portrait-width, 390px));
  margin-right: auto;
  margin-left: auto;
}

.photo-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.photo-open img {
  display: block;
  width: 100%;
  height: auto;
  background: #d8d8d4;
}

.photo-meta {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.photo-meta span {
  color: var(--quiet);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}

body.is-lightbox-open .lightbox {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.lightbox-figure {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: stretch;
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 100px);
  margin: 0;
}

.lightbox-image-button {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 138px);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.lightbox-image-button[data-zone="previous"] {
  cursor: w-resize;
}

.lightbox-image-button[data-zone="next"] {
  cursor: e-resize;
}

.lightbox-image-button[data-zone="close"] {
  cursor: zoom-out;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 138px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-meta {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  color: var(--quiet);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.lightbox-close {
  position: absolute;
  top: 28px;
  right: 34px;
  z-index: 4;
  margin: 0;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 58px;
  height: 120px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  opacity: 0.32;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity 180ms ease;
  font-size: 22px;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  opacity: 1;
}

.lightbox-previous {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.lightbox-instructions {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 3;
  margin: 0;
  color: var(--quiet);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .lightbox-figure {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 96px);
  }

  .lightbox-image-button,
  .lightbox-image {
    max-height: calc(100vh - 130px);
  }

  .lightbox-nav {
    width: 40px;
  }

  .lightbox-previous {
    left: 0;
  }

  .lightbox-next {
    right: 0;
  }

  .lightbox-close {
    top: 18px;
    right: 20px;
  }

  .lightbox-instructions {
    display: none;
  }
}

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

.info-sheet {
  width: 72%;
  margin: 18px 0 0 auto;
  padding-top: 4px;
  animation: photo-in 700ms var(--ease) both;
}

.info-sheet h2 {
  max-width: 9ch;
  margin: 0 0 28px;
  font-size: 48px;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.info-sheet p {
  max-width: 43ch;
  margin: 0 0 18px;
  color: #555550;
  font-size: 13px;
  line-height: 1.65;
}

.info-sheet .contact-email {
  display: inline-block;
  margin-top: 18px;
  color: var(--ink);
  font-size: 12px;
}

.noscript {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translateX(-50%);
  font-size: 12px;
}

/* The desktop gallery keeps its original stage and geometry. */
.mobile-opening-cue,
.mobile-selection-help,
.mobile-off {
  display: none;
}

/* A phone gets a real scrolling document and a larger, touch-sized dial. */
@media (max-width: 720px), (max-width: 900px) and (max-height: 600px) {
  html,
  body {
    height: auto;
    min-height: 100%;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--paper);
  }

  .viewport {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 100svh;
    overflow: visible;
  }

  .stage {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 100svh;
    overflow: visible;
    transform: none;
    box-shadow: none;
  }

  .stage main {
    position: relative;
    min-height: 100svh;
    padding-top: 1px;
  }

  .indicator-artwork {
    display: none;
  }

  .dial-help {
    display: none;
  }

  .wordmark {
    left: var(--mobile-mark-left);
    top: var(--mobile-mark-top);
    width: var(--mobile-mark-width);
    height: var(--mobile-mark-height);
    transform-origin: 41.399% 2.74%;
    transition: transform 850ms var(--ease);
  }

  body.is-open .wordmark {
    transform: translateX(var(--mobile-open-mark-offset)) rotate(90deg);
  }

  .dial-control {
    left: var(--mobile-pivot-x);
    top: var(--mobile-pivot-y);
    width: clamp(72px, 22vw, 90px);
    height: clamp(72px, 22vw, 90px);
    transform: translate(-50%, -50%);
    transition: width 620ms var(--ease), height 620ms var(--ease);
  }

  body.is-open .dial-control {
    width: min(190px, 50vw);
    height: min(190px, 50vw);
  }

  .dial-artwork {
    width: 100%;
    height: 100%;
  }

  .dial-hit-label {
    display: none;
  }

  .mode-readout {
    left: calc(var(--mobile-pivot-x) + min(25vw, 95px) + 19px);
    top: var(--mobile-pivot-y);
    width: max(0px, calc(100vw - var(--mobile-pivot-x) - min(25vw, 95px) - 28px));
    font-size: 9px;
    line-height: 1.25;
    letter-spacing: 0.12em;
    overflow-wrap: anywhere;
  }

  .mode-readout::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -17px;
    width: 13px;
    height: 4px;
    border-radius: 3px;
    background: #c6c6c6;
    transform: translateY(-50%);
  }

  .mobile-opening-cue,
  .mobile-selection-help {
    position: absolute;
    left: 16px;
    margin: 0;
    color: #777772;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.01em;
  }

  .mobile-opening-cue {
    display: block;
    top: calc(var(--mobile-mark-top) + var(--mobile-mark-height) + 14px);
  }

  body.is-open .mobile-opening-cue {
    display: none;
  }

  .mobile-selection-help {
    top: 20px;
    max-width: calc(100% - 70px);
  }

  body.is-open .mobile-selection-help {
    display: block;
  }

  .mobile-off {
    position: absolute;
    top: 20px;
    right: 16px;
    z-index: 15;
    min-height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  body.is-open .mobile-off {
    display: block;
  }

  .gallery {
    display: none;
    position: relative;
    left: auto;
    top: auto;
    z-index: 7;
    width: 100%;
    height: auto;
    margin-top: calc(var(--mobile-mark-top) + 245px);
    padding: 0 16px 36px;
    background: var(--paper);
    opacity: 1;
    transform: none;
    transition: none;
  }

  body.is-open .gallery {
    display: block;
    opacity: 1;
    transform: none;
  }

  .gallery-header {
    min-height: 0;
    padding: 0 0 20px;
    border: 0;
  }

  .gallery-header .close-button {
    display: none;
  }

  .eyebrow {
    font-size: 10px;
  }

  .gallery h1 {
    font-size: clamp(34px, 9vw, 46px);
  }

  .mode-description {
    font-size: 13px;
  }

  .photo-stream {
    height: auto;
    overflow: visible;
    padding: 12px 0 60px;
    overscroll-behavior: auto;
  }

  .photo-card {
    margin-bottom: 30px;
  }

  .photo-card.is-portrait {
    max-width: min(100%, 54svh);
  }

  .info-sheet {
    width: 100%;
    margin: 12px 0 0;
  }

  .info-sheet h2 {
    font-size: clamp(34px, 10vw, 48px);
  }

  .info-sheet p {
    font-size: 14px;
  }

  .lightbox {
    touch-action: none;
  }
}

@media (max-width: 360px) {
  .mode-readout {
    width: max(0px, calc(100vw - var(--mobile-pivot-x) - min(25vw, 95px) - 18px));
    font-size: 8px;
    letter-spacing: 0.06em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
