@property --mt { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --m0 { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --mb { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --ms { syntax: '<length>'; inherits: true; initial-value: 0px; }

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #0c3523 0%, #14503a 45%, #9fd8bf 100%);
}

/* --fw, --fh, --plate-h, --plate-top, --case-top and --scr-* are set from GEO by scene.js. */
.frame {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--fw);
  height: var(--fh);
  transform-origin: 0 0;
  --glide: 1.6s;
  --mt: 0px;
  --m0: 0px;
  --mb: 0px;
  --ms: 0px;
}
.frame.glide {
  transition:
    transform var(--glide) cubic-bezier(.65, 0, .35, 1),
    --mt var(--glide) cubic-bezier(.65, 0, .35, 1),
    --m0 var(--glide) cubic-bezier(.65, 0, .35, 1),
    --mb var(--glide) cubic-bezier(.65, 0, .35, 1),
    --ms var(--glide) cubic-bezier(.65, 0, .35, 1);
}

/* Edge fades. Desktop fades only show when the laptop has to shrink. */
.frame.d-fade.m-case { --mt: 110px; --mb: 60px; --ms: 170px; }
.frame.m-fade { --mt: 190px; --ms: 140px; }
.frame.m-fade.m-case { --m0: 48px; --mt: 40px; --mb: 70px; --ms: 140px; }

.plate, .cut, .caseplate {
  position: absolute;
  left: 0;
  width: var(--fw);
  height: var(--plate-h);
  max-width: none;
  pointer-events: none; /* the invisible laptop plate must not cover the badge's hover target */
}
.plate, .cut { top: var(--plate-top); }
.plate {
  --o: calc(var(--plate-top) * -1);
  --ob: calc(var(--plate-h) - var(--fh) - var(--o));
}
.cut { z-index: 4; }
.caseplate {
  top: var(--case-top);
  z-index: 7;
  opacity: 0;
  --o: calc(var(--case-top) * -1);
  --ob: calc(var(--plate-h) - var(--fh) - var(--o));
}
.trans {
  position: absolute;
  inset: 0;
  width: var(--fw);
  height: var(--fh);
  object-fit: cover;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  --o: 0px;
  --ob: 0px;
}

/* One mask for all photographic layers so they fade at the same frame line.
   Never applied to .cut: the man's head stays crisp. */
.plate, .trans, .caseplate {
  -webkit-mask-image:
    linear-gradient(180deg,
      transparent calc(var(--o, 0px) + var(--m0)),
      rgba(0, 0, 0, .35) calc(var(--o, 0px) + var(--m0) + var(--mt) * .37),
      #000 calc(var(--o, 0px) + var(--m0) + var(--mt)),
      #000 calc(100% - var(--ob, 0px) - var(--mb)),
      transparent calc(100% - var(--ob, 0px))),
    linear-gradient(90deg, transparent 0, #000 var(--ms), #000 calc(100% - var(--ms)), transparent 100%);
  mask-image:
    linear-gradient(180deg,
      transparent calc(var(--o, 0px) + var(--m0)),
      rgba(0, 0, 0, .35) calc(var(--o, 0px) + var(--m0) + var(--mt) * .37),
      #000 calc(var(--o, 0px) + var(--m0) + var(--mt)),
      #000 calc(100% - var(--ob, 0px) - var(--mb)),
      transparent calc(100% - var(--ob, 0px))),
    linear-gradient(90deg, transparent 0, #000 var(--ms), #000 calc(100% - var(--ms)), transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* Wordmark sits behind the cutout (z 3 vs 4). */
.wm { position: absolute; left: 0; top: 0; width: var(--fw); height: 260px; overflow: visible; z-index: 3; }
.wm text, .m-wm text {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 900;
  font-size: 268px;
  letter-spacing: -6px;
}

.script {
  position: absolute;
  left: 88px;
  top: 148px;
  z-index: 6;
  font-family: 'Caveat Brush', cursive;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -.5px;
  white-space: nowrap;
  color: #fff;
  transform: rotate(-8deg);
  transform-origin: 0 50%;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .18);
}

/* Lanyard badge. Pivots at the top of the strap. */
.badge {
  position: absolute;
  left: 986px;
  top: -165px;
  width: 582px;
  height: 1030px;
  z-index: 5;
  transform-origin: 288px 0;
  pointer-events: none;
}
.badge > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.badge .card {
  position: absolute;
  left: 172px;
  top: 536px;
  width: 238px;
  height: 392px;
  padding: 20px 16px 0;
  color: #141615;
}
.badge h4 { margin: 0; font-size: 30px; line-height: .95; font-weight: 800; letter-spacing: -.5px; }
.badge .yr { position: absolute; right: 16px; top: 62px; font-size: 11px; font-weight: 700; }
.badge .role {
  margin-top: 12px;
  padding-top: 5px;
  border-top: 1px solid #222;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .2px;
}
.badge .ph {
  width: 92px;
  height: 112px;
  margin: 12px auto;
  border-radius: 6px;
  background: #dfe4e1 no-repeat center / cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.badge .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 6px 0 3px;
  border-bottom: 1.5px dotted #333;
  font-size: 9px;
  font-weight: 700;
}
.badge .row b { font-weight: 600; }
.badge .hit {
  position: absolute;
  left: 160px;
  top: 470px;
  width: 262px;
  height: 440px;
  pointer-events: auto;
  cursor: grab;
}
body.is-desk .badge .hit { pointer-events: none; }

/* Laptop display. */
.screen {
  position: absolute;
  left: var(--scr-l);
  top: var(--scr-t);
  width: var(--scr-w);
  height: var(--scr-h);
  z-index: 8;
  overflow: hidden;
  border-radius: 7px 7px 3px 3px;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
body.is-desk .screen { pointer-events: auto; }
/* Off the desktop the screen is transparent; keep its icons and dock out of the tab order too. */
body:not(.is-desk) .screen { visibility: hidden; }
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, 0) 38%);
}
.flash { position: absolute; inset: 0; z-index: 2; background: #fff; opacity: 0; pointer-events: none; }
