.noor-entrance-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  background: #e8f3fa;
}

.noor-preview-frame {
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.noor-preview-frame > [data-preview-panel] {
  grid-area: 1 / 1;
  min-height: 0;
  height: 100%;
}

.noor-entrance-visual [hidden] { display: none; }

.noor-motion-scene {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background: #e8f3fa;
}

.noor-motion-scene .noor-scene-base {
  display: block;
  width: 100%;
  height: 100%;
}

.noor-motion-scene-link {
  position: absolute;
  inset-inline-end: 12px;
  inset-block-end: 10px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 4px;
  color: #fff;
  background: var(--noor-deep);
  font-size: clamp(.68rem, 1.2vw, .86rem);
}

/* Both layers use coordinates from the source image's 3:2 frame. */
.noor-sheet-window {
  position: absolute;
  inset: 44.1% 27% 8% 27%;
  overflow: hidden;
  pointer-events: none;
}

.noor-print-sheet {
  position: absolute;
  inset: 0 0 6%;
  color: var(--noor-deep);
  clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(#18374855, transparent 13%),
    linear-gradient(153deg, #fff 51%, #d8edf3 51% 60%, #0e5977 60% 76%, #f5bb59 76% 80%, #0c3248 80%);
}

.noor-print-sheet img {
  position: absolute;
  inset-block-start: 12%;
  inset-inline-start: 10%;
  width: 18%;
  height: 42%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.noor-print-sheet span,
.noor-print-sheet small {
  position: absolute;
  inset-inline-start: 33%;
  line-height: 1.2;
  white-space: nowrap;
}

.noor-print-sheet span {
  inset-block-start: 21%;
  font: 750 clamp(.64rem, 1.8vw, 1.55rem) / 1.2 var(--noor-display);
}

.noor-print-sheet small {
  inset-block-start: 39%;
  font-size: clamp(.42rem, 1vw, .84rem);
}

.noor-van-mask {
  position: absolute;
  inset: 0;
  clip-path: polygon(10% 30.3%, 56.1% 30.4%, 56.1% 75.3%, 28.3% 75.3%,
    27.9% 69.9%, 26.6% 66.1%, 24.9% 63%, 22.2% 60.6%, 19.7% 60.3%,
    17.4% 61.1%, 15.2% 62.8%, 13.5% 65.1%, 12.5% 67.4%, 7.7% 67.1%,
    7.7% 62.8%, 7.8% 55.5%, 8.1% 47.4%, 8.7% 40%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.noor-van-ink {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(5deg, #153b51 0 29%, #116785 29.2% 33%, transparent 33.2%),
    linear-gradient(123deg, #164f6a 0 32%, #0c3248 32% 39%, #f5bb59 39% 42%,
      #eaf5f8 42% 94%, #58acc6 94%)
    left / 60% 100% no-repeat;
}

.noor-van-ink img {
  position: absolute;
  left: 31.5%;
  top: 37%;
  width: 6.5%;
  height: 16.7%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.noor-van-lettering {
  position: absolute;
  left: 39%;
  top: 40%;
  display: grid;
  gap: 3px;
  color: var(--noor-deep);
  text-align: right;
  white-space: nowrap;
  line-height: 1.15;
}

.noor-van-lettering strong { font: 750 clamp(.55rem, 1.5vw, 1.3rem) / 1.2 var(--noor-display); }
.noor-van-lettering small { font-size: clamp(.39rem, .85vw, .72rem); }

.noor-van-scan {
  position: absolute;
  inset: 0 auto 0 7.7%;
  width: 49%;
  opacity: 0;
  background: linear-gradient(to right, transparent calc(100% - 4px), #ffe29b);
}

/* Align the resting label to the flat face of the box. */
.noor-peel-label {
  position: absolute;
  left: 55%;
  top: 43%;
  width: 23%;
  height: 19%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7%;
  padding: 2%;
  border-radius: 5px;
  color: var(--noor-deep);
  background: linear-gradient(115deg, #e9f4f7 0 20%, #fff 20% 93%, #f5bb59 93%);
  box-shadow: 0 1px 2px #61462455;
  pointer-events: none;
}
.noor-peel-label img {
  width: 24%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.noor-peel-label strong {
  font: 750 clamp(.51rem, 1.4vw, 1.35rem) / 1.25 var(--noor-display);
  white-space: nowrap;
}

.noor-card-slide {
  position: absolute;
  left: 8%;
  top: 37%;
  width: 39%;
  height: 23%;
  overflow: hidden;
  border-radius: 4px;
  transform-origin: top left;
  background: #f2e8d6;
  box-shadow: 0 4px 9px #183a5050;
  pointer-events: none;
}

.noor-card-ink {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9%;
  padding: 6%;
  color: #f7d99a;
  background: linear-gradient(130deg, #155579 0 18%, #f1be61 18% 19.5%, #0c3248 19.5% 100%);
}
.noor-card-ink img {
  width: 18%;
  height: 76%;
  padding: 2%;
  object-fit: contain;
  background: #fff;
}
.noor-card-ink div { display: grid; gap: 4px; }
.noor-card-ink strong { font: 750 clamp(.68rem, 1.9vw, 1.55rem) / 1.2 var(--noor-display); }
.noor-card-ink small { color: #e7f2f8; font-size: clamp(.42rem, 1vw, .87rem); }
.noor-card-ink::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, #fff8cd6b 48%, transparent 59%);
  opacity: 0;
  content: '';
}

.noor-brochure {
  position: absolute;
  left: 16%;
  top: 19%;
  width: 68%;
  height: 62%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  direction: ltr;
  perspective: 820px;
  pointer-events: none;
}
.noor-brochure-panel {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
  min-width: 0;
  gap: 6%;
  padding: 11%;
  direction: rtl;
  backface-visibility: hidden;
  box-shadow: 0 4px 10px #17395244;
}
.noor-brochure-panel strong {
  font: 750 clamp(.55rem, 1.6vw, 1.55rem) / 1.4 var(--noor-display);
}
.noor-brochure-left {
  transform-origin: right center;
  color: var(--noor-deep);
  background: #fff;
}
.noor-brochure-left img { width: 100%; height: 35%; object-fit: cover; }
.noor-brochure-center {
  color: #fff;
  background: linear-gradient(150deg, #165c80 0 64%, #edbc5a 64% 67%, #0c3248 67%);
}
.noor-brochure-center img { width: 28%; height: 25%; padding: 2%; object-fit: contain; background: #fff; }
.noor-brochure-right {
  transform-origin: left center;
  color: var(--noor-deep);
  background: linear-gradient(145deg, #f7f0de 0 77%, #edbc5a 77%);
}
.noor-brochure-right small { font-size: clamp(.42rem, .9vw, .8rem); line-height: 1.45; }

.noor-motion-running .noor-print-sheet { animation: noor-feed-sheet 3.8s both; }
.noor-motion-running .noor-van-ink { animation: noor-reveal-wrap 4.3s both; }
.noor-motion-running .noor-van-scan { animation: noor-wrap-scan 4.3s both; }
.noor-motion-running .noor-peel-label { animation: noor-peel-and-place 3.5s both; }
.noor-motion-running .noor-card-slide { animation: noor-card-offset 3.6s both; }
.noor-motion-running .noor-card-ink { animation: noor-card-apply 3.6s both; }
.noor-motion-running .noor-card-ink::after { animation: noor-card-shine 3.6s both; }
.noor-motion-running .noor-brochure-left { animation: noor-open-left-fold 3.5s both; }
.noor-motion-running .noor-brochure-right { animation: noor-open-right-fold 3.5s both; }
.noor-motion-paused *, .noor-motion-paused .noor-card-ink::after { animation-play-state: paused; }

@keyframes noor-feed-sheet {
  0%, 10% { transform: translateY(-103%); }
  22% { transform: translateY(-78%); }
  27% { transform: translateY(-78%); }
  47% { transform: translateY(-44%); }
  52% { transform: translateY(-44%); }
  76%, 100% { transform: translateY(0); }
}

@keyframes noor-reveal-wrap {
  0%, 13% { clip-path: inset(0 92.3% 0 0); }
  73% { clip-path: inset(0 43.3% 0 0); }
  74%, 100% { clip-path: inset(0); }
}

@keyframes noor-wrap-scan {
  0% { opacity: 0; transform: translateX(-100%); }
  13% { opacity: .85; transform: translateX(-100%); }
  73% { opacity: .85; transform: translateX(0); }
  78%, 100% { opacity: 0; transform: translateX(0); }
}

@keyframes noor-peel-and-place {
  0%, 9% {
    clip-path: inset(0 100% 0 0 round 5px);
    transform: translate(-177%, 48%) rotate(-3deg) scale(.67, .72);
  }
  28% {
    clip-path: inset(0 round 5px);
    transform: translate(-177%, 48%) rotate(-3deg) scale(.67, .72);
  }
  53% {
    clip-path: inset(0 round 5px);
    transform: translate(-88%, -27%) rotate(-12deg) scale(.87);
  }
  76%, 100% {
    clip-path: inset(0 round 5px);
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

@keyframes noor-card-offset {
  0%, 17% { transform: translate(124%, -20%) skewX(3deg) scale(1.04, .78); }
  52% { transform: translate(23%, -13%) rotate(-3deg); }
  70%, 100% { transform: translate(0, 0); }
}
@keyframes noor-card-apply {
  0%, 12% { clip-path: inset(0 0 0 100%); }
  56%, 100% { clip-path: inset(0); }
}
@keyframes noor-card-shine {
  0%, 56% { opacity: 0; transform: translateX(-78%); }
  65% { opacity: .75; }
  84%, 100% { opacity: 0; transform: translateX(78%); }
}
@keyframes noor-open-left-fold {
  0%, 19% { transform: rotateY(89deg); }
  62%, 100% { transform: rotateY(0); }
}
@keyframes noor-open-right-fold {
  0%, 36% { transform: rotateY(-89deg); }
  76%, 100% { transform: rotateY(0); }
}

.noor-motion-toolbar, .noor-preview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.noor-motion-toolbar {
  justify-content: space-between;
  padding: 6px clamp(8px, 1.5vw, 20px);
  border-block-start: 1px solid #c8dce7;
  background: #f2f8fb;
}

.noor-motion-toolbar button {
  min-height: 42px;
  padding: 7px clamp(7px, 1.3vw, 15px);
  border-radius: 4px;
  background: transparent;
  color: var(--noor-deep);
  font: inherit;
  font-size: .8125rem;
  cursor: pointer;
}

.noor-preview-controls button[aria-pressed="true"] {
  background: var(--noor-petrol);
  color: #fff;
  font-weight: 650;
}

.noor-motion-toolbar .noor-motion-control { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 540px) {
  .noor-motion-toolbar { justify-content: center; gap: 2px 6px; }
  .noor-preview-controls { justify-content: center; }
  .noor-motion-toolbar button { font-size: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .noor-motion-scene *, .noor-motion-scene .noor-card-ink::after { animation: none !important; }
}
