:root {
  --otto-paper: #f5f0eb;
  --otto-ink: #181716;
  --otto-nav-bg: rgb(15 15 14 / 80%);
  --otto-gallery-ease: cubic-bezier(.22, .72, .18, 1);
}

.otto-scroll-cue {
  display: none;
}

.otto-gallery {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  color: var(--otto-ink);
  background: var(--otto-paper);
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
}

.otto-categories,
.otto-category {
  position: absolute;
  inset: 0;
}

.otto-category {
  visibility: hidden;
  pointer-events: none;
}

.otto-category.is-active,
.otto-category.is-entering,
.otto-category.is-leaving,
.otto-category.is-boundary-in,
.otto-category.is-boundary-out {
  visibility: visible;
}

.otto-category.is-active {
  pointer-events: auto;
}

.otto-heading {
  position: fixed;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: max-content;
  max-width: 94vw;
  margin: 0;
  transform: translate(-50%, -50%);
  font-family: "Fraunces", "Big Caslon", "Iowan Old Style", Georgia, serif;
  font-size: clamp(6.3rem, 12.5vw, 13.5rem);
  font-weight: 400;
  line-height: .84;
  letter-spacing: -.03em;
  white-space: nowrap;
  pointer-events: none;
}

.otto-heading__word {
  display: flex;
  align-items: flex-start;
}

.otto-char-mask {
  display: block;
  overflow: hidden;
  flex: 0 0 auto;
  max-width: 1.25em;
  padding-block: .12em .18em;
  margin-block: -.12em -.18em;
  opacity: 1;
}

.otto-char {
  display: block;
  transform: translate3d(0, 108%, 0);
  will-change: transform;
}

.otto-count {
  display: block;
  min-width: 2.3em;
  margin: .09em 0 0 .38em;
  font-family: "Suisse Intl", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(.64rem, .76vw, .82rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .01em;
}

.otto-category.is-revealed .otto-char,
.otto-category.is-active.is-revealed .otto-char {
  transform: translate3d(0, 0, 0);
  transition: transform 850ms var(--otto-gallery-ease);
  transition-delay: calc(var(--char-index, 0) * 45ms);
}

.otto-category.is-leaving .otto-char {
  transform: translate3d(0, 108%, 0);
  transition: transform 420ms cubic-bezier(.55, .02, .82, .4);
  transition-delay: calc(var(--char-reverse, 0) * 24ms);
}

/* User-scrubbed boundary choreography: word → initial → next initial → next word. */
.otto-category:is(.is-boundary-out, .is-boundary-in) :is(
  .otto-char-mask,
  .otto-char,
  .otto-count,
  .otto-case,
  .otto-case__image
) {
  transition: none !important;
  transition-delay: 0ms !important;
}

.otto-category:is(.is-boundary-out, .is-boundary-in) .otto-case::after {
  transition: none !important;
  transition-delay: 0ms !important;
}

.otto-category:is(.is-boundary-out, .is-boundary-in) .otto-char-mask:not(:first-child) {
  max-width: var(--otto-boundary-width, 0);
  opacity: var(--otto-boundary-opacity, 0);
}

.otto-category:is(.is-boundary-out, .is-boundary-in) .otto-char-mask:not(:first-child) .otto-char {
  transform: translate3d(0, var(--otto-boundary-y, 108%), 0);
}

.otto-category:is(.is-boundary-out, .is-boundary-in) .otto-char-mask:first-child .otto-char {
  opacity: var(--otto-seed-opacity, 0);
  transform: translate3d(0, var(--otto-seed-y, 0%), 0);
}

.otto-category:is(.is-boundary-out, .is-boundary-in) .otto-count {
  width: var(--otto-count-width, 0);
  min-width: var(--otto-count-width, 0);
  max-width: var(--otto-count-width, 0);
  margin-left: var(--otto-count-margin, 0);
  overflow: hidden;
  opacity: var(--otto-count-opacity, 0);
}

.otto-cases {
  position: absolute;
  inset: 0;
  height: 295vh;
  transform: translate3d(0, var(--otto-cases-y, 0), 0);
  will-change: transform;
}

.otto-case {
  --otto-photo-y: 0px;
  --otto-photo-focus: 0;
  position: absolute;
  z-index: 2;
  width: var(--case-width, 23.26vw);
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #dad3ca;
  box-shadow: none;
  color: inherit;
  cursor: none;
  opacity: 0;
  clip-path: inset(7% 0 7% 0);
  transform: translate3d(var(--intro-x, 0), var(--intro-y, 80px), 0) scale(.96);
  transition:
    opacity 620ms var(--otto-gallery-ease),
    transform 900ms var(--otto-gallery-ease),
    clip-path 760ms cubic-bezier(.16, 1, .3, 1);
  transition-delay: calc(var(--case-index, 0) * 42ms);
}

.otto-case__media {
  position: absolute;
  z-index: 0;
  inset: -3.5%;
  display: block;
  transform: translate3d(0, var(--otto-photo-y), 0) scale(1.035);
  will-change: transform;
  pointer-events: none;
}

.otto-case::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: rgb(245 240 235 / 88%);
  transform: translate3d(0, 0, 0);
  transform-origin: 50% 100%;
  pointer-events: none;
}

.otto-category.is-revealed .otto-case {
  opacity: 1;
  clip-path: inset(0);
  transform: translate3d(0, 0, 0) scale(1);
}

.otto-category.is-revealed .otto-case::after {
  transform: translate3d(0, 102%, 0);
  transition: transform 720ms cubic-bezier(.16, 1, .3, 1);
  transition-delay: calc(60ms + var(--case-index, 0) * 38ms);
}

.otto-category.is-leaving .otto-case {
  opacity: 0;
  transform: translate3d(calc(var(--otto-direction, 1) * -120px), 44px, 0) scale(.965);
  transition-duration: 440ms;
  transition-delay: calc(var(--case-index, 0) * 18ms);
}

.otto-category:is(.is-boundary-out, .is-boundary-in) .otto-case {
  opacity: var(--otto-boundary-case-opacity, 0);
  clip-path: inset(var(--otto-boundary-case-clip, 7%) 0);
  transform: translate3d(0, var(--otto-boundary-case-y, 0), 0) scale(var(--otto-boundary-case-scale, .975));
}

.otto-category.is-boundary-in .otto-case::after {
  display: block;
  transform: translate3d(0, var(--otto-boundary-veil-y, 0%), 0);
}

.otto-category.is-boundary-in .otto-case__image {
  filter:
    saturate(var(--otto-boundary-saturation, .48))
    contrast(var(--otto-boundary-contrast, .92))
    brightness(var(--otto-boundary-brightness, .82));
  transform: scale(var(--otto-boundary-image-scale, 1.065));
}

.otto-category.is-entering .otto-case {
  --intro-x: calc(var(--otto-direction, 1) * 120px);
}

.otto-case__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.48) contrast(.92) brightness(.82);
  transform: scale(1.065);
  transition:
    transform 900ms cubic-bezier(.16, 1, .3, 1),
    filter 720ms cubic-bezier(.16, 1, .3, 1);
  will-change: transform;
  pointer-events: none;
}

.otto-category.is-revealed .otto-case__image {
  filter:
    saturate(calc(.92 + var(--otto-photo-focus) * .1))
    contrast(calc(.99 + var(--otto-photo-focus) * .03))
    brightness(calc(.975 + var(--otto-photo-focus) * .025));
  transform: scale(1.001);
  transition-delay: calc(40ms + var(--case-index, 0) * 34ms);
}

.otto-case:is(:hover, :focus-visible) .otto-case__image {
  filter: saturate(1.05) contrast(1.035) brightness(1.015);
  transform: scale(1.022);
  transition-delay: 0ms;
}

.otto-case:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

/* Pattern 0 — reference editorial wall. */
.otto-category[data-pattern="0"] .otto-case:nth-child(1) { left: 9.6vw; top: 22vh; --case-width: 23.26vw; --intro-x: -72px; }
.otto-category[data-pattern="0"] .otto-case:nth-child(2) { left: 75.3vw; top: 23.4vh; --case-width: 15.05vw; --intro-x: 86px; --intro-y: -45px; }
.otto-category[data-pattern="0"] .otto-case:nth-child(3) { left: 50.7vw; top: 64.1vh; --case-width: 23.26vw; --intro-y: 118px; }
.otto-category[data-pattern="0"] .otto-case:nth-child(4) { left: 61vw; top: 111vh; --case-width: 15.05vw; --intro-x: 72px; }
.otto-category[data-pattern="0"] .otto-case:nth-child(5) { left: 6vw; top: 143vh; --case-width: 23.26vw; --intro-x: -84px; }
.otto-category[data-pattern="0"] .otto-case:nth-child(6) { left: 72vw; top: 169vh; --case-width: 23.26vw; --intro-x: 88px; }
.otto-category[data-pattern="0"] .otto-case:nth-child(7) { left: 38vw; top: 206vh; --case-width: 15.05vw; --intro-y: 110px; }
.otto-category[data-pattern="0"] .otto-case:nth-child(8) { left: 14vw; top: 238vh; --case-width: 23.26vw; --intro-x: -76px; }

/* Three alternate stagger systems keep category changes spatially distinct. */
.otto-category[data-pattern="1"] .otto-case:nth-child(1) { left: 67vw; top: 10vh; --case-width: 15.05vw; --intro-x: 78px; }
.otto-category[data-pattern="1"] .otto-case:nth-child(2) { left: 13vw; top: 37vh; --case-width: 23.26vw; --intro-x: -90px; }
.otto-category[data-pattern="1"] .otto-case:nth-child(3) { left: 56vw; top: 73vh; --case-width: 23.26vw; --intro-y: 110px; }
.otto-category[data-pattern="1"] .otto-case:nth-child(4) { left: 8vw; top: 120vh; --case-width: 15.05vw; --intro-x: -70px; }
.otto-category[data-pattern="1"] .otto-case:nth-child(5) { left: 72vw; top: 145vh; --case-width: 23.26vw; --intro-x: 90px; }
.otto-category[data-pattern="1"] .otto-case:nth-child(6) { left: 33vw; top: 181vh; --case-width: 23.26vw; --intro-y: 118px; }
.otto-category[data-pattern="1"] .otto-case:nth-child(7) { left: 6vw; top: 225vh; --case-width: 23.26vw; --intro-x: -80px; }
.otto-category[data-pattern="1"] .otto-case:nth-child(8) { left: 65vw; top: 241vh; --case-width: 15.05vw; --intro-x: 74px; }

.otto-category[data-pattern="2"] .otto-case:nth-child(1) { left: 42vw; top: 8vh; --case-width: 23.26vw; --intro-y: -95px; }
.otto-category[data-pattern="2"] .otto-case:nth-child(2) { left: 5vw; top: 54vh; --case-width: 15.05vw; --intro-x: -75px; }
.otto-category[data-pattern="2"] .otto-case:nth-child(3) { left: 76vw; top: 63vh; --case-width: 23.26vw; --intro-x: 90px; }
.otto-category[data-pattern="2"] .otto-case:nth-child(4) { left: 29vw; top: 111vh; --case-width: 23.26vw; --intro-y: 115px; }
.otto-category[data-pattern="2"] .otto-case:nth-child(5) { left: 68vw; top: 151vh; --case-width: 15.05vw; --intro-x: 74px; }
.otto-category[data-pattern="2"] .otto-case:nth-child(6) { left: 7vw; top: 176vh; --case-width: 23.26vw; --intro-x: -88px; }
.otto-category[data-pattern="2"] .otto-case:nth-child(7) { left: 47vw; top: 215vh; --case-width: 23.26vw; --intro-y: 112px; }
.otto-category[data-pattern="2"] .otto-case:nth-child(8) { left: 79vw; top: 247vh; --case-width: 15.05vw; --intro-x: 72px; }

.otto-category[data-pattern="3"] .otto-case:nth-child(1) { left: 5vw; top: 8vh; --case-width: 23.26vw; --intro-x: -88px; }
.otto-category[data-pattern="3"] .otto-case:nth-child(2) { left: 65vw; top: 38vh; --case-width: 23.26vw; --intro-x: 90px; }
.otto-category[data-pattern="3"] .otto-case:nth-child(3) { left: 36vw; top: 78vh; --case-width: 15.05vw; --intro-y: 108px; }
.otto-category[data-pattern="3"] .otto-case:nth-child(4) { left: 8vw; top: 112vh; --case-width: 15.05vw; --intro-x: -70px; }
.otto-category[data-pattern="3"] .otto-case:nth-child(5) { left: 70vw; top: 141vh; --case-width: 23.26vw; --intro-x: 88px; }
.otto-category[data-pattern="3"] .otto-case:nth-child(6) { left: 27vw; top: 179vh; --case-width: 23.26vw; --intro-y: 116px; }
.otto-category[data-pattern="3"] .otto-case:nth-child(7) { left: 6vw; top: 224vh; --case-width: 23.26vw; --intro-x: -86px; }
.otto-category[data-pattern="3"] .otto-case:nth-child(8) { left: 67vw; top: 244vh; --case-width: 15.05vw; --intro-x: 72px; }

.otto-nav-overlay {
  position: fixed;
  z-index: 8;
  inset: 0;
  border: 0;
  background: rgb(0 0 0 / 20%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 520ms var(--otto-gallery-ease), visibility 0s linear 520ms;
}

.otto-nav-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.otto-nav {
  position: fixed;
  z-index: 9;
  bottom: 20px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 289px;
  height: 68px;
  transform: translateX(-50%);
  color: #fff;
  font-family: "Suisse Intl", "Helvetica Neue", Arial, sans-serif;
  pointer-events: none;
}

.otto-nav__shape {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  width: 222px;
  height: 53px;
  overflow: hidden;
  border-radius: 53px;
  background: var(--otto-nav-bg);
  pointer-events: auto;
  transition: width 520ms var(--otto-gallery-ease), height 520ms var(--otto-gallery-ease), border-radius 520ms var(--otto-gallery-ease);
}

.otto-nav.is-open .otto-nav__shape {
  width: 289px;
  height: 68px;
  border-radius: 68px;
}

.otto-nav__toggle {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.otto-nav__toggle:focus-visible,
.otto-nav__arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

.otto-nav__thumbs {
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  pointer-events: none;
}

.otto-nav__thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 10%);
  transform: translate(-50%, -50%) rotate(var(--thumb-rotate, 0deg));
  transform-origin: 50% 66%;
  transition: width 520ms var(--otto-gallery-ease), height 520ms var(--otto-gallery-ease), transform 520ms var(--otto-gallery-ease), opacity 260ms ease;
}

.otto-nav__thumb:nth-child(2) { --thumb-rotate: -7deg; opacity: .78; }
.otto-nav__thumb:nth-child(3) { --thumb-rotate: 6deg; opacity: .64; }
.otto-nav__thumb.is-current { z-index: 4; --thumb-rotate: 0deg; opacity: 1; }

.otto-nav.is-open .otto-nav__thumb {
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%) rotate(0deg);
}

.otto-nav__copy {
  position: absolute;
  left: 58px;
  right: 46px;
  top: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.otto-nav__kicker {
  overflow: hidden;
  max-height: 0;
  font-size: 12px;
  line-height: 1.1;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 260ms ease, transform 420ms var(--otto-gallery-ease), max-height 420ms var(--otto-gallery-ease);
}

.otto-nav__name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: font-size 420ms var(--otto-gallery-ease);
}

.otto-nav.is-open .otto-nav__kicker {
  max-height: 16px;
  opacity: .66;
  transform: translateY(0);
}

.otto-nav.is-open .otto-nav__name {
  font-size: 18px;
}

.otto-nav__arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 50%;
  background: rgb(255 255 255 / 7%);
  color: #fff;
  font: inherit;
  opacity: 0;
  transform: translateY(-50%) scale(.7);
  pointer-events: none;
  transition: opacity 260ms ease, transform 420ms var(--otto-gallery-ease), background-color 180ms ease;
  cursor: pointer;
}

.otto-nav__arrow:hover { background: rgb(255 255 255 / 18%); }
.otto-nav__arrow--prev { left: 8px; }
.otto-nav__arrow--next { right: 8px; }

.otto-nav.is-open .otto-nav__thumbs { left: 48px; }
.otto-nav.is-open .otto-nav__copy { left: 96px; right: 52px; }
.otto-nav.is-open .otto-nav__arrow { opacity: 1; transform: translateY(-50%) scale(1); pointer-events: auto; }
.otto-nav.is-open .otto-nav__arrow--prev { left: 8px; }
.otto-nav.is-open .otto-nav__arrow--next { right: 8px; }

.otto-project-cursor {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  padding: 7px 11px 8px;
  border-radius: 999px;
  background: rgb(16 15 14 / 88%);
  color: #fff;
  font-family: "Suisse Intl", "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .01em;
  opacity: 0;
  transform: translate3d(var(--cursor-x, -100px), var(--cursor-y, -100px), 0) scale(.78);
  transition: opacity 160ms ease, scale 240ms var(--otto-gallery-ease);
  pointer-events: none;
  will-change: transform;
}

.otto-project-cursor.is-visible {
  opacity: 1;
  scale: 1;
}

@media (max-height: 520px) and (orientation: landscape) {
  .otto-heading { font-size: 15vw; }
  .otto-nav { bottom: 10px; }
  .otto-case { --case-width: 34vw; }
  .otto-category[data-pattern] .otto-case:nth-child(odd) { --case-width: 22vw; }
  .otto-category[data-pattern="0"] .otto-case:nth-child(1) { left: 7vw; top: 16vh; }
  .otto-category[data-pattern="0"] .otto-case:nth-child(2) { left: 69vw; top: 24vh; }
  .otto-category[data-pattern="0"] .otto-case:nth-child(3) { left: 28vw; top: 74vh; }
}

@media (prefers-reduced-motion: reduce) {
  .otto-char,
  .otto-case,
  .otto-case__image,
  .otto-nav-overlay,
  .otto-nav__shape,
  .otto-nav__thumb,
  .otto-nav__kicker,
  .otto-nav__name,
  .otto-nav__arrow,
  .otto-project-cursor {
    transition-duration: 120ms !important;
    transition-delay: 0ms !important;
  }

  .otto-cases { will-change: auto; }

  .otto-case__media {
    inset: 0;
    transform: none;
    will-change: auto;
  }

  .otto-case {
    clip-path: inset(0) !important;
  }

  .otto-case::after {
    display: none;
  }

  .otto-case__image {
    filter: none !important;
    transform: none !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .otto-case { cursor: pointer; }
  .otto-project-cursor { display: none; }
}
