.ori-intro-open { overflow: hidden; }

.ori-upload-wall { display: none; }

body[data-ori-wall]:is(.portada, :has(#start:not([hidden]))) {
  isolation: isolate;
  min-height: 100dvh;
}

body[data-ori-wall]:is(.portada, :has(#start:not([hidden]))) .ori-upload-wall {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--wall-color);
}

/* Frame a clear patch of plaster within the same photo used by the intro. */
.ori-upload-wall::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(calc(100vw / var(--wall-width)), calc(100dvh * var(--wall-ratio) / var(--wall-height)));
  aspect-ratio: var(--wall-ratio);
  transform: translate(var(--wall-x), var(--wall-y));
  background: var(--wall-photo) center / 100% 100% no-repeat;
  content: '';
}

body[data-ori-wall] {
  --wall-photo: var(--wall-wide-photo);
  --wall-ratio: 1.777;
  --wall-x: var(--wall-wide-x);
  --wall-y: var(--wall-wide-y);
  --wall-width: var(--wall-wide-width);
  --wall-height: var(--wall-wide-height);
}

body[data-ori-wall="01"] {
  --wall-color: #c9ab89;
  --wall-wide-photo: url("01/staged.webp");
  --wall-wide-x: -46%;
  --wall-wide-y: -27%;
  --wall-wide-width: .29;
  --wall-wide-height: .29;
  --wall-portrait-photo: url("01/staged-portrait.webp");
  --wall-portrait-x: -55%;
  --wall-portrait-y: -34%;
}

body[data-ori-wall="02"] {
  --wall-color: #b89670;
  --wall-wide-photo: url("02/staged.webp");
  --wall-wide-x: -36%;
  --wall-wide-y: -39%;
  --wall-wide-width: .22;
  --wall-wide-height: .24;
  --wall-portrait-photo: url("02/staged-portrait.webp");
  --wall-portrait-x: -53%;
  --wall-portrait-y: -40%;
}

body[data-ori-wall="03"] {
  --wall-color: #bea68c;
  --wall-wide-photo: url("03/staged.webp");
  --wall-wide-x: -51%;
  --wall-wide-y: -28%;
  --wall-wide-width: .42;
  --wall-wide-height: .23;
  --wall-portrait-photo: url("03/staged-portrait.webp");
  --wall-portrait-x: -60%;
  --wall-portrait-y: -32%;
}

body[data-ori-wall="04"] {
  --wall-color: #b7a089;
  --wall-wide-photo: url("04/staged.webp");
  --wall-wide-x: -51%;
  --wall-wide-y: -19%;
  --wall-wide-width: .42;
  --wall-wide-height: .16;
  --wall-portrait-photo: url("04/staged-portrait.webp");
  --wall-portrait-x: -60%;
  --wall-portrait-y: -31%;
}

body[data-ori-wall="05"] {
  --wall-color: #bea185;
  --wall-wide-photo: url("05/staged.webp");
  --wall-wide-x: -51%;
  --wall-wide-y: -28%;
  --wall-wide-width: .40;
  --wall-wide-height: .28;
  --wall-portrait-photo: url("05/staged-portrait.webp");
  --wall-portrait-x: -56%;
  --wall-portrait-y: -39%;
  --wall-portrait-ratio: .563;
}

@media (max-aspect-ratio: 4/5) {
  body[data-ori-wall] {
    --wall-photo: var(--wall-portrait-photo);
    --wall-ratio: var(--wall-portrait-ratio, .705);
    --wall-x: var(--wall-portrait-x);
    --wall-y: var(--wall-portrait-y);
    --wall-width: .45;
    --wall-height: .19;
  }
}

body[data-ori-wall] #start .upload-box {
  background-color: #fff8ed44;
  border-color: #34443775;
}

body[data-ori-wall] #start .muted,
body[data-ori-wall] #start .status,
body[data-ori-wall] #start .intro-replay {
  color: #303e32;
}

.ori-intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  isolation: isolate;
}

.ori-intro-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #e9e1d3;
}

.ori-intro-room {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, calc(100vh * var(--ori-intro-ratio, 1.5)));
  width: max(100%, calc(100dvh * var(--ori-intro-ratio, 1.5)));
  aspect-ratio: var(--ori-intro-ratio, 1.5);
  transform: translate(-50%, -50%);
}

.ori-intro-photo {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
}

.ori-intro-empty { background-image: var(--ori-intro-empty); }

.ori-intro.is-mobile .ori-intro-room {
  inset: 0;
  width: auto;
  aspect-ratio: auto;
  transform: none;
}
.ori-intro.is-mobile .ori-intro-photo { display: none; }
.ori-intro-mobile-empty, .ori-intro-mobile-staged {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ori-intro-mobile-staged { opacity: 0; }

.ori-intro-layer {
  opacity: 0;
  background-image: var(--ori-intro-staged);
  mask-image: linear-gradient(104deg, #000 0% 34%, transparent 42%);
  mask-size: 300% 100%;
  mask-repeat: no-repeat;
  mask-position: 100% 0;
}

.ori-intro-rug {
  clip-path: var(--ori-rug-mask, polygon(7% 92%, 18% 83%, 27% 82%, 38% 78%, 63% 78%, 76% 88%, 84% 85%, 94% 93%));
  --reveal-delay: 640ms;
  --reveal-duration: 1250ms;
}

.ori-intro-furniture {
  clip-path: var(--ori-furniture-mask, polygon(15% 58%, 27% 54%, 29% 47%, 69% 47%, 71% 57%, 84% 58%, 86% 92%, 10% 92%));
  --reveal-delay: 810ms;
  --reveal-duration: 1370ms;
}

.ori-intro-detail {
  --reveal-delay: 1030ms;
  --reveal-duration: 1550ms;
}

.ori-intro[data-scene="01"] {
  --ori-rug-mask: polygon(14% 93%, 27% 81%, 35% 83%, 62% 83%, 75% 88%, 88% 90%, 86% 99%, 15% 99%);
  --ori-furniture-mask: polygon(25% 63%, 44% 56%, 80% 57%, 83% 63%, 96% 62%, 98% 99%, 24% 95%);
}

.ori-intro[data-scene="02"] {
  --ori-rug-mask: polygon(12% 97%, 26% 86%, 38% 87%, 72% 86%, 83% 91%, 88% 98%);
  --ori-furniture-mask: polygon(17% 61%, 40% 62%, 42% 73%, 62% 73%, 64% 59%, 86% 61%, 85% 92%, 17% 92%);
}

.ori-intro[data-scene="03"] {
  --ori-rug-mask: polygon(5% 94%, 23% 84%, 33% 83%, 66% 82%, 73% 91%, 88% 92%, 95% 100%, 8% 100%);
  --ori-furniture-mask: polygon(19% 61%, 28% 52%, 74% 52%, 75% 61%, 91% 61%, 92% 98%, 17% 90%);
}

.ori-intro[data-scene="04"] {
  --ori-rug-mask: polygon(9% 97%, 24% 88%, 35% 90%, 66% 89%, 78% 89%, 91% 99%);
  --ori-furniture-mask: polygon(13% 64%, 31% 62%, 36% 59%, 70% 59%, 72% 63%, 91% 63%, 91% 97%, 13% 97%);
}

.ori-intro.is-portrait {
  --ori-rug-mask: polygon(2% 81%, 14% 75%, 23% 76%, 36% 73%, 65% 73%, 80% 78%, 94% 75%, 99% 81%);
  --ori-furniture-mask: polygon(10% 64%, 23% 63%, 24% 59%, 73% 59%, 77% 65%, 93% 65%, 93% 79%, 10% 79%);
}

.ori-intro.is-portrait[data-scene="01"] {
  --ori-rug-mask: polygon(0% 85%, 16% 79%, 36% 81%, 65% 81%, 82% 85%, 91% 92%, 0% 91%);
  --ori-furniture-mask: polygon(15% 68%, 34% 62%, 90% 62%, 99% 69%, 100% 93%, 15% 86%);
}

.ori-intro.is-portrait[data-scene="02"] {
  --ori-rug-mask: polygon(0% 91%, 12% 82%, 38% 83%, 74% 83%, 89% 83%, 100% 91%);
  --ori-furniture-mask: polygon(1% 64%, 26% 65%, 29% 73%, 70% 73%, 73% 65%, 99% 65%, 99% 85%, 1% 85%);
}

.ori-intro.is-portrait[data-scene="03"] {
  --ori-rug-mask: polygon(0% 89%, 15% 84%, 35% 85%, 68% 84%, 86% 87%, 99% 95%, 4% 95%);
  --ori-furniture-mask: polygon(9% 75%, 26% 63%, 80% 63%, 81% 72%, 99% 73%, 99% 93%, 9% 92%);
}

.ori-intro.is-portrait[data-scene="04"] {
  --ori-rug-mask: polygon(0% 91%, 20% 85%, 37% 86%, 63% 86%, 78% 85%, 100% 91%, 100% 96%, 0% 96%);
  --ori-furniture-mask: polygon(0% 72%, 25% 71%, 31% 66%, 69% 66%, 76% 71%, 100% 72%, 100% 92%, 0% 92%);
}

.ori-intro.is-playing .ori-intro-layer {
  animation: ori-intro-reveal var(--reveal-duration) cubic-bezier(.36, 0, .22, 1) var(--reveal-delay) both;
}

.ori-intro.is-reduced-motion.is-playing .ori-intro-layer { animation: none; }
.ori-intro.is-reduced-motion.is-playing .ori-intro-detail {
  mask-image: none;
  animation: ori-intro-opacity 180ms ease-out 900ms both;
}

@keyframes ori-intro-reveal {
  from { opacity: 1; mask-position: 100% 0; }
  to { opacity: 1; mask-position: 0 0; }
}

.ori-intro-brand {
  position: absolute;
  top: clamp(4.5rem, 19vh, 13rem);
  top: clamp(4.5rem, 19svh, 13rem);
  left: 50%;
  width: max-content;
  max-width: calc(100% - 2rem);
  transform: translateX(-50%);
  opacity: 0;
  color: #233a30;
  text-shadow: 0 1px 14px #f8f2e2a8;
}

.ori-intro.is-playing .ori-intro-brand { animation: ori-intro-opacity 720ms ease-out 2980ms both; }
.ori-intro.is-reduced-motion.is-playing .ori-intro-brand { animation-duration: 180ms; }
.ori-intro.is-mobile.is-playing .ori-intro-brand { animation: none; }

@keyframes ori-intro-opacity {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ori-intro-brand .brand {
  display: grid;
  grid-template-columns: auto auto;
  justify-items: center;
  gap: .75rem .65rem;
  color: inherit;
}

.ori-intro-brand .brand-mark {
  grid-column: 1 / -1;
  width: clamp(2.4rem, 4.8vw, 4rem);
}

.ori-intro-brand .brand-name {
  font-size: clamp(1.2rem, 4vw, 2.6rem);
}

.ori-intro-brand .brand-caption {
  font-size: clamp(.58rem, 1.45vw, .9rem);
  letter-spacing: .04em;
  text-transform: none;
}

.ori-intro-brand .brand > * { transform-origin: top left; }
.ori-intro.is-portrait .ori-intro-brand { top: 26vh; top: 26svh; }
.ori-intro-open.is-intro-docking > header .brand { visibility: hidden; }
.ori-intro-open.is-intro-docking:has(.ori-intro.is-reduced-motion:not(.is-mobile)) > header .brand { visibility: visible; }

.ori-intro-skip {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  min-height: 44px;
  padding: .5rem .85rem;
  border: 1px solid #d5c9b5;
  border-radius: .45rem;
  background: #fffaf1;
  color: #233a30;
  font-size: .85rem;
  font-weight: 650;
  cursor: pointer;
}

.intro-replay {
  display: block;
  min-height: 44px;
  margin: .55rem auto 0;
  padding: .35rem .65rem;
  border: 0;
  background: transparent;
  color: #4a5b4c;
  text-decoration: underline;
  text-underline-offset: .25em;
  cursor: pointer;
}
