:root {
  --logo-fill: #231f20;
}

@media (prefers-color-scheme: dark) {
  :root {
    --logo-fill: #f4f2ed;
  }
}

.ss-logo-stage,
.ss-logo-stage * {
  box-sizing: border-box;
}

.ss-logo-stage {
  position: relative;
  float: right;
  width: min(calc(322.5px - 1em), calc(100vw - 1em));
  height: calc(250px - 4em);
  overflow: visible;
  /* background: var(--scene-color); */
}

/* On narrow screens the text beside the logo shrinks to a word or two; stack it below instead. */
@media (max-width: 540px) {
  .ss-logo-stage {
    float: none;
  }
}

.ss-logo-link {
  position: absolute;
  top: 154px;
  left: calc(1em + 2.8px);
  padding: 0;
  font: 13.5px/16px Helvetica, Arial, sans-serif;
}

.animation-target {
  cursor: pointer;
  pointer-events: auto;
}

/*
 * The tagline's exit animation falls ~2300px below the logo. Transforms count
 * toward scrollable overflow, which would add a scrollbar (and the PoC's
 * html/body overflow lock would remove scrolling for real content). Instead,
 * this box is exactly one viewport tall and clips the fall at the window's
 * bottom edge, so the tagline is seen falling off the page while contributing
 * no extra scroll height. It carries the animation's 16px font and -2em offset
 * so the logo sits where the original PoC placed it. Its width matches the
 * stage so it can't widen the page when the stage floats right.
 */
.ss-logo-clip {
  position: absolute;
  font-size: 16px;
  top: -2em;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: clip;
  pointer-events: none;
}

.ss-logo-animation {
  position: absolute;
  top: 0;
  right: auto;
  bottom: auto;
  left: 1em;
  width: calc(430px - 2em);
  height: 250px;
  overflow: visible;
  font-size: 16px;
  pointer-events: none;
}

.ss-logo-animation[data-state="initial"] .software {
  transform: rotate(180deg);
}

.ss-logo-animation[data-state="initial"] .tagline {
  opacity: 0;
  transform: translateX(-360px);
}

.logo {
  position: absolute;
  left: 0;
  top: 56.8%;
  width: 35.81%;
  height: 20.4%;
  transform: translateY(-0.5em);
}

.logo svg,
.logo img {
  position: absolute;
  display: block;
  overflow: visible;
}

.signature {
  left: 1.95%;
  top: 33.33%;
  width: 73.38%;
  height: 49.02%;
  fill: var(--logo-fill);
}

.software {
  left: 0;
  top: 0;
  width: 72.08%;
  height: 43.14%;
  fill: var(--logo-fill);
  transform: rotate(0deg);
  transform-origin: 120% 114%;
}

.s-mark {
  left: 75.32%;
  top: 1.96%;
  width: 24.68%;
  height: 98.04%;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
}

.ss-logo-animation[data-state="turned"] .software {
  transform: rotate(180deg);
}

.tagline {
  position: absolute;
  left: 26.97%;
  top: 74.4%;
  width: auto;
  max-width: none;
  min-height: 7.2%;
  overflow: visible;
  color: var(--logo-fill);
  font: 13.5px/16px Helvetica, Arial, sans-serif;
  text-align: left;
  white-space: nowrap;
  transform: translate(0, 0) rotateX(0deg);
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
}

@media (max-width: 360px) {
  .tagline,
  .ss-logo-link {
    font-size: 12px;
    line-height: 14px;
  }
}

.ss-logo-animation[data-state="turned"] .tagline {
  opacity: 0;
  transform: translate(0, 2322px) rotateX(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .ss-logo-animation {
    scroll-behavior: auto;
  }
}
