:root {
  color-scheme: dark;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
  color: #fff;
  background: #000;
}

* { box-sizing: border-box; }

html, body, main {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

main { position: relative; --side-inset: 16px; }

.presentation-view, .presentation-card, .presentation-face {
  position: absolute;
  inset: 0;
}

.presentation-view { perspective: 1200px; }
.presentation-face { overflow: hidden; background: #000; }
.presentation-view.is-flipping .presentation-card { transform-style: preserve-3d; }
.presentation-view.is-flipping .presentation-face {
  backface-visibility: hidden;
  pointer-events: none;
}
.presentation-view.is-flipping .presentation-live { transform: rotateX(180deg); }
.presentation-view.is-flipping ~ .hint { opacity: 0; }

iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.shipped-demo, .u1-screen, #u1-transition {
  position: absolute;
  z-index: 1;
}

.shipped-demo-viewport, .u1-screen-viewport, #u1-transition {
  overflow: hidden;
}

.shipped-demo-viewport, .u1-screen-viewport {
  position: absolute;
  inset: 0;
}

.shipped-demo-viewport iframe {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1600px;
  height: 900px;
  background: #f5f5f5;
  transform: scale(var(--demo-scale));
  transform-origin: top left;
}

.interaction-note {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0;
  color: rgb(255 255 255 / .92);
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
}

.interaction-note svg { flex: none; }

.shipped-demo-note {
  right: calc(16px * var(--demo-scale));
  bottom: calc(100% + 14px * var(--demo-scale));
  font-size: 27px;
  transform: scale(var(--demo-scale));
  transform-origin: bottom right;
}

.u1-screen-note {
  left: calc(100% + 32px * var(--screen-note-scale));
  top: calc(162px * var(--screen-note-scale));
  font-size: 20px;
  transform: scale(var(--screen-note-scale));
  transform-origin: top left;
}

#u1-transition {
  inset: 0;
  background: #000;
  pointer-events: none;
}

.u1-screen-viewport {
  border-radius: var(--screen-radius);
  background: #000;
}

.u1-screen-viewport iframe {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1280px;
  height: 720px;
  transform: scale(var(--screen-scale-x), var(--screen-scale-y));
  transform-origin: top left;
}

@font-face {
  font-family: "Style Unity Harmony";
  src: url("player/assets/style-unity/harmony-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Style Unity Harmony";
  src: url("player/assets/style-unity/harmony-black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

.style-unity {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #000;
  touch-action: pinch-zoom;
}

.style-unity:focus { outline: none; }

.style-unity-flight {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  transform-origin: top left;
  /* Crop the Keynote texture's padding to the visible 480 × 216 interface. */
  clip-path: inset(21.66% 9.56% 21.5% 9.49% round 6px);
}

.style-unity-viewport {
  position: absolute;
  overflow: hidden;
}

.style-unity-slide {
  position: absolute;
  width: 1920px;
  height: 1080px;
  font-family: "Style Unity Harmony", "PingFang SC", sans-serif;
  transform: scale(var(--style-unity-scale, 1));
  transform-origin: top left;
}

.style-unity-slide :is(h2, h3, p, ul, img) {
  position: absolute;
  margin: 0;
}

#style-unity-title { left: 169px; top: 139px; font-size: 60px; font-weight: 900; line-height: 82px; }
.style-unity-subtitle { left: 169px; top: 244px; font-size: 30px; line-height: 36px; }
.style-unity-signature { left: 1781px; top: 80px; }

.style-unity-column { position: absolute; inset: 0 auto 0 var(--column-x); width: 593px; }
.style-unity-before { --column-x: 102px; --label-x: 244px; }
.style-unity-concepts { --column-x: 719px; --label-x: 216px; --arrow-x: -58px; }
.style-unity-after { --column-x: 1317px; --label-x: 234px; --arrow-x: -45px; }

.style-unity-column h3 {
  z-index: 1;
  left: var(--label-x);
  top: 379px;
  width: max-content;
  color: #666;
  font-size: 40px;
  font-weight: 900;
  line-height: 54px;
}

.style-unity-after h3 { color: #d9d9d9; }
.style-unity-screen { left: 0; top: 342px; }
.style-unity-screen-second { top: 508px; }
.style-unity-screen-third { top: 672px; }
.style-unity-arrow { left: var(--arrow-x); top: 497px; }

.style-unity-idea {
  left: 59px;
  top: 700px;
  color: #6cd386;
  border-bottom: 2px solid currentColor;
  font-size: 42px;
  font-weight: 900;
  line-height: 58px;
}

.style-unity-notes {
  left: 61px;
  top: 798px;
  width: max-content;
  padding-left: 17px;
  color: #909090;
  font-size: 20px;
  line-height: 40.6px;
  white-space: nowrap;
}

.style-unity [data-reveal] > * {
  transition: opacity 270ms ease-out, transform 340ms cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.style-unity [data-reveal] :is(h3, .style-unity-screen) { --reveal-delay: 40ms; }
.style-unity [data-reveal] .style-unity-screen-second { --reveal-delay: 90ms; }
.style-unity [data-reveal] .style-unity-screen-third { --reveal-delay: 140ms; }

.style-unity[data-step="0"] [data-reveal] > *,
.style-unity[data-step="1"] [data-reveal="2"] > * {
  opacity: 0;
  transform: translateX(-24px);
  transition-delay: 0ms;
  transition-duration: 160ms;
}

@media (prefers-reduced-motion: reduce) {
  .style-unity [data-reveal] > * { transition: none; }
}

#analysis-panel-viewport {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.analysis-panel {
  /* Measured against the 1920 × 1080 slide, then scaled with the stage. */
  position: absolute;
  top: 100%;
  left: 5.52%;
  width: 89.94%;
  height: 93.21%;
  overflow: hidden;
  border-radius: 2.4% / 4.12%;
  background: #eceef1;
  transform: translateY(var(--analysis-panel-offset, 0%));
}

#analysis-panel-viewport[data-position="folded"] { --analysis-panel-offset: -2.87%; }
#analysis-panel-viewport[data-position="comparison"] { --analysis-panel-offset: -93.46%; }
#analysis-panel-viewport[data-position="flow"] { --analysis-panel-offset: -93.86%; }

@media (prefers-reduced-motion: no-preference) {
  #analysis-panel-viewport[data-revealing] .analysis-panel { will-change: transform; }

  #analysis-panel-viewport[data-animate] .analysis-panel {
    transition: transform 480ms cubic-bezier(.38, .1, .69, 1);
  }

  #analysis-panel-viewport:is([data-position="comparison"], [data-position="flow"])[data-animate] .analysis-panel {
    transition: transform 760ms cubic-bezier(.22, .76, .27, 1);
  }
}

.analysis-panel img { position: absolute; }

.analysis-panel img[data-art="comparison"] {
  left: 3.24%;
  top: 6.44%;
  width: 95.14%;
  height: 80.36%;
}

.analysis-panel img[data-art="flow"] {
  left: 1.80%;
  top: 7.14%;
  width: 96.37%;
  height: 85.72%;
}

#opening-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#opening-cover[hidden] { display: none; }

#cover-glitch {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  clip-path: inset(53.23475% 0 0);
  mix-blend-mode: screen;
  pointer-events: none;
}

#cover-glitch[hidden], .cover-glitch-row { display: none; }

.cover-glitch-row {
  position: absolute;
  left: 0;
  width: 100%;
  --mx: 50%;
  --my: 50%;
}

.cover-glitch-row.is-active { display: block; }

.cover-glitch-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  mix-blend-mode: screen;
  mask-image: radial-gradient(circle 92px at var(--mx) var(--my), #000 0, rgba(0, 0, 0, .95) 52%, transparent 76%);
  -webkit-mask-image: radial-gradient(circle 92px at var(--mx) var(--my), #000 0, rgba(0, 0, 0, .95) 52%, transparent 76%);
}

.cover-glitch-layer-a {
  clip-path: polygon(0 0, 100% 0, 100% 28%, 0 20%);
  animation: cover-glitch-a 820ms steps(2, end) infinite;
}

.cover-glitch-layer-b {
  clip-path: polygon(0 32%, 100% 24%, 100% 68%, 0 72%);
  animation: cover-glitch-b 640ms steps(2, end) infinite;
}

.cover-glitch-layer-c {
  clip-path: polygon(0 74%, 100% 66%, 100% 100%, 0 100%);
  animation: cover-glitch-c 910ms steps(2, end) infinite;
}

@keyframes cover-glitch-a {
  0%, 100% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
    filter: none;
  }
  8% {
    transform: translate3d(-18px, -3px, 0);
    opacity: .35;
    filter: blur(.4px);
  }
  16% {
    transform: translate3d(14px, 0, 0);
    opacity: .9;
  }
  26% {
    transform: translate3d(-22px, 2px, 0);
    opacity: .55;
  }
  40% {
    transform: translate3d(9px, -2px, 0) skewX(-6deg);
    opacity: .15;
  }
  55% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }
}

@keyframes cover-glitch-b {
  0%, 100% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
    filter: none;
  }
  10% {
    transform: translate3d(20px, 0, 0);
    opacity: .3;
  }
  21% {
    transform: translate3d(-12px, 1px, 0) skewX(10deg);
    opacity: .95;
    filter: blur(.5px);
  }
  34% {
    transform: translate3d(26px, -2px, 0);
    opacity: .45;
  }
  49% {
    transform: translate3d(-3px, 0, 0);
    opacity: .1;
  }
  63% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }
}

@keyframes cover-glitch-c {
  0%, 100% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
    filter: none;
  }
  14% {
    transform: translate3d(-15px, 2px, 0);
    opacity: .32;
  }
  24% {
    transform: translate3d(19px, -4px, 0) skewX(-7deg);
    opacity: .88;
  }
  37% {
    transform: translate3d(-28px, 3px, 0);
    opacity: .42;
    filter: blur(.5px);
  }
  52% {
    transform: translate3d(5px, 0, 0);
    opacity: .12;
  }
  68% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover-glitch-layer { animation: none; }
  .cover-glitch-layer-a {
    clip-path: none;
    opacity: .18;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .2));
  }
}

#intro-transition, #intro-light { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
#intro-transition[hidden], #intro-light[hidden] { display: none; }
#intro-transition { background: #000; }
#intro-snapshot { position: absolute; inset: 0; overflow: hidden; }
.intro-stage { position: relative; width: min(100vw, 177.7778vh); aspect-ratio: 16 / 9; overflow: hidden; }
.intro-shade { position: absolute; inset: 0; background: #000; opacity: 0; }
.intro-logo { position: absolute; width: 7.35%; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.92); opacity: 0; }
.intro-beam { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse 35% 50% at 14% 0%, rgba(190,220,255,.29), transparent 75%), linear-gradient(128deg, transparent 10%, rgba(179,211,255,.12) 30%, rgba(225,238,255,.18) 38%, transparent 54%); mix-blend-mode: screen; }
.intro-beam::after { content: ''; position: absolute; left: -3%; top: -9%; width: 120%; height: 27%; transform: rotate(29deg); transform-origin: top left; background: linear-gradient(to bottom, transparent, rgba(220,237,255,.11) 28%, rgba(230,242,255,.26) 50%, rgba(190,218,255,.1) 72%, transparent); mask-image: linear-gradient(to right, #000 0%, rgba(0,0,0,.8) 38%, transparent 83%); }
#intro-transition.playing .intro-shade { animation: intro-shade 1.7s ease forwards; }
#intro-transition.playing .intro-logo { animation: intro-logo 1.7s ease forwards; }
#intro-transition.playing + #intro-light .intro-beam { animation: intro-beam 1.7s ease forwards; }
#intro-light .intro-beam { opacity: .8; }
@keyframes intro-shade { 0% { opacity: 0; } 38%, 100% { opacity: .8; } }
@keyframes intro-logo { 0%, 32% { opacity: 0; transform: translate(-50%,-50%) scale(.92); } 70%, 100% { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes intro-beam { 0%, 53% { opacity: 0; } 100% { opacity: .8; } }

button, select {
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: #fff;
  background: #171717;
  cursor: pointer;
}

button:not(:disabled):hover, select:hover { background: #343434; }
button:disabled { color: #858585; cursor: default; }
button:focus-visible, select:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
button[hidden] { display: none; }
::selection { color: #000; background: #fff; }

.side-navigation, .side-navigation-backdrop {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: max(var(--side-inset), env(safe-area-inset-left));
  transform: translateY(-50%);
  pointer-events: none;
}

/* Keep the backdrop separate from the navigation's difference blend. */
.side-navigation-backdrop {
  width: 28px;
  height: 56px;
  margin-left: 8px;
  border-radius: 14px;
  background: rgb(0 0 0 / 10%);
  opacity: 0;
  transition: opacity 150ms cubic-bezier(.25, .46, .45, .94);
}

.side-navigation-backdrop:has(+ .side-navigation[hidden]) { display: none; }

.side-navigation {
  display: grid;
  grid-template: 44px 20px 44px / 44px;
  place-items: center;
  color: #fff;
  font-weight: 450;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  user-select: none;
  mix-blend-mode: difference;
}

.side-navigation[hidden] { display: none; }

.side-step, .side-step:disabled, .side-step:not(:disabled):hover {
  width: 100%;
  height: 100%;
  padding: 0;
  display: grid;
  justify-items: center;
  color: inherit;
  background: transparent;
  touch-action: manipulation;
}

.side-step {
  opacity: .5;
  pointer-events: auto;
  transition: opacity 150ms cubic-bezier(.25, .46, .45, .94);
}

.side-step:disabled { opacity: .25; }
.side-step:not(:disabled):active { opacity: 1; }
.side-step:focus-visible { opacity: 1; outline: 1px solid currentColor; outline-offset: 1px; }
#previous.side-step { align-items: end; padding-bottom: 4px; }
#next.side-step { align-items: start; padding-top: 4px; }

@media (hover: hover) {
  .side-navigation-backdrop:has(+ .side-navigation:hover) { opacity: 1; }

  .side-navigation:not(:hover):not(:has(.side-step:focus-visible)) .side-step {
    opacity: 0;
    pointer-events: none;
  }

  .side-step:not(:disabled):hover { opacity: 1; }
}

.side-arrow {
  width: 12px;
  height: 8px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-count, .side-count:not(:disabled):hover {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 20px;
  height: 20px;
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: 9px;
  opacity: .64;
  pointer-events: auto;
  touch-action: manipulation;
}

.personal-home .side-count { visibility: hidden; }

.side-digit-slot {
  position: relative;
  height: 20px;
  overflow: hidden;
}

.side-digit { display: block; }
.side-digit.is-leaving { position: absolute; top: 0; left: 0; }

@media (max-width: 820px) {
  main { --side-inset: 6px; }
}

@media (forced-colors: active) {
  .side-navigation-backdrop { display: none; }
  .side-navigation { mix-blend-mode: normal; }
  .side-count { opacity: 1; }
}

.controls {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #454545;
  border-radius: 10px;
  background: #080808;
}

.page-picker { display: flex; }
select { width: 96px; font-variant-numeric: tabular-nums; }

.controls[hidden], .debug-thumbnails[hidden] { display: none; }

.debug-thumbnails {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: calc(max(var(--side-inset), env(safe-area-inset-left)) + 50px);
  width: 132px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
  background: #101010;
  border-right: 1px solid #454545;
}

.debug-thumbnail {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  width: 100%;
  padding: 4px;
  background: transparent;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.debug-thumbnail[aria-current="page"] { background: #343434; }
.debug-thumbnail:focus-visible { outline-offset: -2px; }

.debug-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  background: #080808;
  border: 1px solid #555;
}

.hint {
  position: absolute;
  left: max(20px, env(safe-area-inset-left));
  bottom: max(21px, env(safe-area-inset-bottom));
  z-index: 1;
  margin: 0;
  padding: 8px 12px;
  border-radius: 6px;
  color: #fff;
  background: #080808;
  font-size: 12px;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

body.hint-hidden .hint { opacity: 0; }

.orientation {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0;
  padding: 24px;
  background: #000;
}

.loading {
  position: absolute;
  z-index: 3;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  max-width: calc(100vw - 32px);
  border-radius: 8px;
  background: #080808;
}

.loading p, .orientation p { margin: 0; font-size: 14px; }
.loading a { color: #fff; white-space: nowrap; }
.loading a[hidden] { display: none; }
.file-mode .loading { flex-direction: column; bottom: 10%; text-align: center; }
.loading[hidden], .orientation { display: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (orientation: portrait) and (max-width: 900px) {
  body:not(.allow-portrait):not(.file-mode) .orientation { display: flex; z-index: 4; }
  .hint { left: 50%; bottom: 84px; transform: translateX(-50%); white-space: nowrap; }
  .controls { right: 50%; transform: translateX(50%); white-space: nowrap; }
}

@media (max-height: 500px) {
  .controls { bottom: max(8px, env(safe-area-inset-bottom)); right: max(10px, env(safe-area-inset-right)); }
  .hint { bottom: 15px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .shipped-demo:not([hidden]) ~ .controls { top: max(4px, env(safe-area-inset-top)); bottom: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .side-navigation-backdrop, .side-step, .hint { transition: none; }
}
