/* Twineye product page: the film in the room, then one stage per feature. Loaded after studio.css. */
.twineye-page {
  --stage: #101316;
  --stage-line: #2b3035;
}
.twineye-page :is(h1, h2) {
  overflow-wrap: break-word;
  text-wrap: balance;
}
.twineye-page:lang(ja) :is(h1, h2, .hero-intro, .stage-head p) {
  word-break: auto-phrase;
}
/* Chinese headings break at punctuation, never inside a word. */
.twineye-page:lang(zh) :is(h1, h2, .hero-intro),
.twineye-page:lang(ko) {
  word-break: keep-all;
}
/* Fourteen-language menus scroll on short screens (shared with the other product pages). */
.language-menu > div {
  max-height: min(70vh, 620px);
  overflow-y: auto;
  min-width: 190px;
}
.language-menu a {
  white-space: nowrap;
}

/* Hero: the copy sits on the ceiling. The background carries on from the photo's top row of pixels. */
.room-hero {
  margin-top: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(90deg, #9f9a8f 10%, #a7a49b 30%, #b5b2aa 50%, #c6c2ba 70%, #ccc9c3 90%);
  text-align: center;
}
.room-copy {
  position: relative;
  z-index: 1;
  padding: 60px 40px 0;
}
.room-hero .product-identity {
  justify-content: center;
  margin-bottom: 26px;
}
.room-hero h1 {
  font-size: clamp(46px, 6.2vw, 88px);
  letter-spacing: -0.05em;
}
.room-hero .hero-intro {
  margin: 22px auto 0;
  max-width: 44ch;
  text-wrap: balance;
}
.room-hero .download-row {
  margin-top: 26px;
}
.room-hero picture {
  display: block;
  /* The photo's empty wall runs up behind the copy; the bottom edge stops at the sofa. */
  margin: -17% 0 -5%;
}
.room-hero picture img {
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(transparent, #000 22%);
  mask-image: linear-gradient(transparent, #000 22%);
}

/* A stage: heading and one sentence, the demo, then three facts. */
.stage-section {
  padding-top: 110px;
}
.stage-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px 60px;
  align-items: end;
}
.stage-head h2 {
  font-size: clamp(34px, 4.2vw, 58px);
  max-width: 15ch;
}
.stage-head p {
  max-width: 46ch;
  text-wrap: balance;
  color: var(--muted);
}
.stage {
  margin-top: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--stage);
  color: #f4f4f1;
}
.stage-view {
  position: relative;
  aspect-ratio: 1280 / 534;
  overflow: hidden;
}
.stage-view > :is(img, canvas, video) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stage-view canvas {
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.stage-view canvas:active {
  cursor: grabbing;
}
.stage-view canvas:focus-visible {
  outline: 3px solid #8fb4ff;
  outline-offset: -5px;
}
.stage [hidden] {
  display: none;
}
/* Each demo starts as a still with its controls' space kept, and takes over in place once it runs. */
.stage-view > canvas {
  opacity: 0;
}
.stage.is-ready .stage-view > canvas {
  opacity: 1;
  transition: opacity 0.35s;
}
.stage:not(.is-ready) :is(.stage-bar, .subs-play, .stage-view > canvas) {
  visibility: hidden;
}
.stage-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.stage-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.stage-choices button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b9bdbf;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
.stage-choices button[aria-pressed="true"] {
  background: #f4f4f1;
  color: #16191c;
}
@media (hover: hover) {
  .stage-choices button:not([aria-pressed="true"]):hover {
    background: #23282c;
    color: #f4f4f1;
  }
}
.stage button:focus-visible {
  outline-color: #8fb4ff;
  outline-offset: 2px;
}
/* Play and pause share one button; the icon is drawn so both states keep the same size. */
.subs-play {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #23282c;
  display: grid;
  place-items: center;
}
.subs-play::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(10% 0, 38% 0, 38% 100%, 10% 100%, 10% 0, 62% 0, 90% 0, 90% 100%, 62% 100%, 62% 0);
}
.is-paused .subs-play::before {
  clip-path: polygon(14% 0, 100% 50%, 14% 100%);
}
.stage-facts {
  margin: 0;
  padding-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 40px;
}
.stage-facts dt {
  font-size: 15px;
  color: var(--muted);
}
.stage-facts dd {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  text-wrap: pretty;
}

/* Spatial video: the same moment on a flat screen and converted. Both pictures are equally tall. */
.before-after {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1.04fr 1.5625fr;
  gap: 14px;
}
.before-after figure {
  margin: 0;
  min-width: 0;
}
.before-after img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.5625;
  object-fit: cover;
  border-radius: 8px;
}
.before-after figure:first-child img {
  aspect-ratio: 1.04;
}
.before-after figcaption {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

/* VR: what you see, with the stored frame in the corner. */
.vr-view {
  aspect-ratio: 2 / 1;
}
.vr-frame {
  position: absolute;
  left: 18px;
  bottom: 18px;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgb(16 19 22 / 82%);
  pointer-events: none;
}
.vr-frame > div {
  width: 240px;
  height: 130px;
}
.vr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.vr-frame figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

/* Subtitles. */
.subs-line {
  position: absolute;
  inset: auto 5% 7%;
  text-align: center;
  font-size: clamp(18px, 2.5vw, 34px);
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
}
.subs-line span {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 0.35em;
  background: rgb(12 14 16 / 62%);
  text-wrap: balance;
}
.subs-line span:empty {
  display: none;
}
.subs-view .subs-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: none;
}
.subs-view .subs-play:focus-visible {
  outline-offset: -5px;
}
.subs-view .subs-play::before {
  opacity: 0;
}
.is-paused .subs-view .subs-play {
  background: radial-gradient(circle 42px at center, rgb(12 14 16 / 66%) 41px, transparent 42px);
}
.is-paused .subs-view .subs-play::before {
  width: 30px;
  height: 30px;
  opacity: 1;
}

.support-links {
  margin-top: 22px;
  display: grid;
  justify-items: start;
  gap: 14px;
}
.support-links a {
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.page-credits {
  padding-bottom: 40px;
  font-size: 13px;
  color: var(--muted);
}
.page-credits a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1000px) {
  .stage-section {
    padding-top: 80px;
  }
  .stage-head {
    grid-template-columns: 1fr;
  }
  .room-hero picture {
    margin-top: -12%;
  }
}
@media (max-width: 650px) {
  .room-hero {
    margin-top: 18px;
  }
  .room-copy {
    padding: 34px 22px 0;
  }
  .room-hero h1 {
    font-size: clamp(42px, 12.5vw, 60px);
  }
  .twineye-page:is(:lang(zh), :lang(ja), :lang(de)) .room-hero h1 {
    font-size: min(10.6vw, 60px);
  }
  .twineye-page:lang(ru) .room-hero h1 {
    font-size: min(8.8vw, 52px);
  }
  .room-hero picture {
    margin: -8% 0 0;
  }
  .stage-section {
    padding-top: 68px;
  }
  .stage-head h2 {
    font-size: 34px;
  }
  /* Demos use the full width of the phone. */
  .stage {
    margin: 26px -18px 0;
    border-radius: 0;
  }
  .subs-view {
    aspect-ratio: 3 / 2;
  }
  .vr-view {
    aspect-ratio: 1 / 1;
  }
  .vr-frame {
    left: 12px;
    bottom: 12px;
    padding: 8px;
  }
  .vr-frame > div {
    width: 150px;
    height: 82px;
  }
  .before-after {
    margin: 26px -18px 0;
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .before-after img,
  .before-after figure:first-child img {
    aspect-ratio: 1.5;
    border-radius: 0;
  }
  .stage-bar {
    padding: 12px;
  }
  .stage-choices button {
    padding: 0 12px;
  }
  .subs-languages {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -12px;
    padding: 0 12px;
    scrollbar-width: none;
  }
  .stage-facts {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 10px;
  }
  .stage-facts > div {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
}
