/* UNFOLD — a reversible scroll timeline using the existing wallpaper sculpture. */
html[data-os-entrance='playing'] {
  overflow: hidden;
  overscroll-behavior: none;
}
/* Do not start the old window entrance again after the cinematic reveal. */
html[data-os-entrance] .os-window {
  animation: none !important;
}
.os-entrance {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  isolation: isolate;
  color: #f7eadd;
  pointer-events: auto;
  touch-action: pinch-zoom;
  --opening-duration: 3400ms;
}
.os-entrance::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #101015 2%, #101015db 35%, #10101500 67%);
  animation: os-opening-exit var(--opening-duration) both paused;
}
.os-entrance-halo {
  position: absolute;
  width: 75vw;
  height: 100vh;
  left: 30%;
  top: -8%;
  mix-blend-mode: screen;
  animation: os-opening-halo var(--opening-duration) both paused;
}
.os-entrance-halo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse, #edbc8940, #a688b614 36%, transparent 65%);
}
.os-entrance-orbit {
  position: absolute;
  width: min(88vw, 1200px);
  aspect-ratio: 1;
  left: 24%;
  top: 50%;
  border: 1px solid #eed0b537;
  border-radius: 50%;
  box-shadow:
    0 0 36px #ecb98d08,
    inset 0 0 38px #ecb98d06;
  transform: translateY(-50%) rotateX(72deg) rotateZ(-18deg);
  animation: os-opening-orbit var(--opening-duration) both paused;
}
.os-entrance-orbit::before,
.os-entrance-orbit::after {
  content: '';
  position: absolute;
  border: 1px solid #eed0b518;
  border-radius: 50%;
  inset: 8%;
}
.os-entrance-orbit::after {
  inset: 23%;
  border-style: dashed;
  opacity: 0.65;
}
.os-entrance-flare {
  position: absolute;
  width: 84%;
  height: 1px;
  left: 8%;
  top: 51%;
  background: linear-gradient(
    90deg,
    transparent,
    #e9b28630 20%,
    #ffe4bc 64%,
    #e4b7fc70,
    transparent
  );
  box-shadow:
    0 0 19px #ffcda666,
    0 0 3px #fff3da;
  transform-origin: 64% 50%;
  animation: os-opening-flare var(--opening-duration) both paused;
}
.os-entrance-caption {
  position: absolute;
  left: max(7vw, 30px);
  top: 50%;
  transform: translateY(-46%);
  width: 49%;
  animation: os-opening-exit var(--opening-duration) both paused;
}
.os-entrance-eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #baa9a2;
  font-size: 9px;
  letter-spacing: 0.24em;
  font-weight: 500;
}
.os-entrance-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: #f9ba8c;
}
.paper-os .os-entrance-wordmark {
  color: #f7eadd;
  margin: 22px 0 24px;
  font-size: clamp(62px, 8.5vw, 144px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.075em;
  text-shadow:
    0 1px #fff6,
    0 8px 50px #0008;
}
.os-entrance-wordmark span {
  font-weight: 250;
  color: #d7bbab;
  background: linear-gradient(110deg, #f0ded0, #a68c82 60%, #f3ceb0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.os-entrance-promise {
  margin: 0;
  font-size: clamp(20px, 2.3vw, 38px);
  line-height: 1.4;
  letter-spacing: -0.035em;
  font-weight: 350;
  color: #e1d6d0;
}
.os-entrance-promise span {
  display: block;
}
.os-entrance-promise span:last-child {
  color: #a89aa6;
}
.os-entrance-signature {
  position: absolute;
  bottom: 5%;
  left: max(7vw, 30px);
  right: max(7vw, 30px);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #e3c8b51b;
  color: #978b90;
  font-size: 8px;
  letter-spacing: 0.16em;
  animation: os-opening-exit var(--opening-duration) both paused;
}
.os-entrance-signature b {
  color: #dac6b8;
  font-weight: 500;
  letter-spacing: 0.26em;
}
.paper-os .os-entrance-skip {
  position: absolute;
  top: 28px;
  right: max(4vw, 24px);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 11px 15px;
  border: 1px solid #f2d8c327;
  border-radius: 6px;
  background: #15131896;
  color: #cfbfb5;
  font-size: 11px;
  pointer-events: auto;
  cursor: pointer;
}
.os-entrance-skip:hover {
  background: #30252c;
  color: #fff0e2;
  border-color: #f2d8c35a;
}
.os-entrance-skip kbd {
  font: 9px inherit;
  opacity: 0.5;
}
.os-opening-replay {
  color: var(--bi-muted);
  width: 26px;
  height: 26px;
}
.os-opening-replay svg {
  width: 16px;
  height: 16px;
}
.os-opening-replay:hover {
  color: var(--bi-primary);
}
html[data-os-entrance='pending'] .os-systembar,
html[data-os-entrance='pending'] .os-desktop,
html[data-os-entrance='pending'] .os-dock {
  opacity: 0;
}
html[data-os-entrance='pending'] .os-wallpaper {
  opacity: 0;
}
html[data-os-entrance='playing'] .os-wallpaper {
  opacity: 1;
}
html[data-os-entrance='playing'] .os-wallpaper > img {
  animation: os-opening-fallback 3400ms both paused;
}
html[data-os-entrance='playing'] .os-systembar {
  animation: os-opening-bar 620ms cubic-bezier(0.18, 0.8, 0.24, 1) both paused;
  animation-delay: 2500ms;
}
html[data-os-entrance='playing'] .os-desktop {
  animation: os-opening-workspace 800ms cubic-bezier(0.17, 0.82, 0.25, 1) both paused;
  animation-delay: 2460ms;
}
html[data-os-entrance='playing'] .os-window {
  animation: none;
}
html[data-os-entrance='playing'] .os-dock {
  animation: os-opening-dock 600ms cubic-bezier(0.18, 0.8, 0.24, 1) both paused;
  animation-delay: 2800ms;
}
html[data-os-entrance='playing'] .os-dock-item {
  animation: os-opening-icon 340ms both paused;
  animation-delay: calc(2830ms + var(--opening-order, 0) * 40ms);
}
.os-dock-item:nth-child(2) {
  --opening-order: 1;
}
.os-dock-item:nth-child(3) {
  --opening-order: 2;
}
.os-dock-item:nth-child(4) {
  --opening-order: 3;
}
.os-dock-item:nth-child(5) {
  --opening-order: 4;
}
.os-dock-item:nth-child(6) {
  --opening-order: 5;
}
@keyframes os-opening-halo {
  0%,
  8% {
    opacity: 0.65;
    transform: scale(0.8);
  }
  34%,
  62% {
    opacity: 1;
    transform: scale(1);
  }
  88%,
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}
@keyframes os-opening-orbit {
  0%,
  12% {
    opacity: 0.35;
    transform: translateY(-50%) rotateX(72deg) rotateZ(-25deg) scale(0.7);
  }
  37%,
  64% {
    opacity: 0.75;
  }
  84%,
  100% {
    opacity: 0;
    transform: translateY(-50%) rotateX(72deg) rotateZ(0deg) scale(1.06);
  }
}
@keyframes os-opening-flare {
  0%,
  7% {
    opacity: 0;
    transform: scaleX(0.05);
  }
  20% {
    opacity: 0.75;
    transform: scaleX(1);
  }
  47%,
  100% {
    opacity: 0;
    transform: scaleX(1.1);
  }
}
@keyframes os-opening-exit {
  0%,
  65% {
    opacity: 1;
  }
  81%,
  100% {
    opacity: 0;
  }
}
@keyframes os-opening-fallback {
  0% {
    transform: translateX(10%) scale(0.8);
  }
  80%,
  100% {
    transform: none;
  }
}
@keyframes os-opening-bar {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes os-opening-workspace {
  from {
    opacity: 0;
    transform: perspective(1800px) translateY(46px) rotateX(5deg) scale(0.975);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes os-opening-dock {
  from {
    opacity: 0;
    translate: 0 24px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes os-opening-icon {
  from {
    opacity: 0;
    translate: 0 10px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
/* The light desktop retains its theme; only the opening stage is dark. */
html[data-theme='light'][data-os-entrance='playing'] .os-wallpaper {
  background-color: #18151c;
}
.os-entrance input:focus-visible,
.os-entrance button:focus-visible {
  outline: 2px solid #f3b789;
  outline-offset: 5px;
}
@media (max-width: 700px) {
  .paper-os .os-systembar .os-system-actions {
    display: flex;
    gap: 4px;
    margin-left: 0;
  }
  .paper-os .os-system-actions .os-opening-replay {
    display: grid;
    place-items: center;
  }
  .os-entrance-caption {
    left: 8%;
    top: 51%;
    width: 84%;
    transform: none;
  }
  .paper-os .os-entrance-wordmark {
    font-size: clamp(62px, 16vw, 100px);
    margin: 12px 0 14px;
  }
  .os-entrance-eyebrow {
    font-size: 7px;
    letter-spacing: 0.18em;
  }
  .os-entrance-promise {
    font-size: 19px;
  }
  .os-entrance-promise span {
    display: inline;
    margin-right: 6px;
  }
  .os-entrance-signature {
    bottom: 3%;
    left: 8%;
    right: 8%;
    font-size: 6px;
  }
  .os-entrance-signature > span {
    display: none;
  }
  .os-entrance-signature > span {
    max-width: 190px;
    line-height: 1.8;
  }
  .os-entrance-orbit {
    top: 34%;
    left: -35%;
    width: 170vw;
  }
  .os-entrance-halo {
    width: 150vw;
    height: 70vh;
    left: -25%;
    top: -5%;
  }
  .os-entrance::before {
    background: linear-gradient(0deg, #101015 7%, #10101500 68%);
  }
  .os-entrance-flare {
    top: 35%;
  }
  html[data-os-entrance='playing'] .os-wallpaper[data-scene='ready'] > canvas {
    opacity: 1;
  }
}
@media (max-height: 520px) and (min-width: 701px) {
  .os-entrance-caption {
    top: 40%;
  }
  .os-entrance-signature {
    display: none;
  }
  .paper-os .os-entrance-wordmark {
    font-size: 76px;
    margin: 16px 0;
  }
  .os-entrance-promise {
    font-size: 22px;
  }
  .os-entrance-signature {
    bottom: 5%;
    padding-top: 12px;
  }
}
/* Ambient motion is separate from the scrubbed os-opening-* timeline. */
@keyframes os-ambient-breathe {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.035);
  }
}
@keyframes os-ambient-paper {
  0%,
  100% {
    translate: 0 0;
    rotate: -0.25deg;
  }
  50% {
    translate: 0 -9px;
    rotate: 0.25deg;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html[data-os-entrance='playing'] .paper-os:not(.os-motion-paused) .os-entrance-halo::before {
    animation: os-ambient-breathe 8.8s ease-in-out infinite;
  }
  html[data-os-entrance='playing']
    .paper-os:not(.os-motion-paused)
    .os-wallpaper:not([data-scene='ready'])
    > img {
    animation:
      os-opening-fallback 3400ms both paused,
      os-ambient-paper 9s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .os-entrance {
    display: none !important;
  }
  html[data-os-entrance] .os-wallpaper,
  html[data-os-entrance] .os-systembar,
  html[data-os-entrance] .os-desktop,
  html[data-os-entrance] .os-dock {
    animation: none !important;
    opacity: 1 !important;
  }
}
