:root {
  --bg: #e3e3e3;
  --fg: #003cea;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Figtree", Arial, sans-serif;
}

button, input { font: inherit; }

.demo-header {
  position: absolute;
  top: 32px;
  left: 48px;
  right: 48px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
}

.demo-header a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.demo-header span { opacity: .62; }
.demo-header a:hover { opacity: .62; }

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.stage::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(0, 60, 234, .18);
  border-radius: 28px;
  pointer-events: none;
}

.composition {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4vw;
  gap: clamp(10px, 2vw, 32px);
}

h1 {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin: 0;
  color: var(--fg);
  font-family: "Hubot Sans", sans-serif;
  font-size: clamp(4rem, 13.5vw, 13rem);
  line-height: .78;
  letter-spacing: -.075em;
  white-space: nowrap;
}

.letter {
  display: inline-block;
  transform-origin: 50% 70%;
  will-change: font-variation-settings, transform;
}

.asterisk {
  flex: 0 0 auto;
  font-size: clamp(2rem, 6vw, 6rem);
  line-height: 1;
  animation: turn 8s linear infinite;
}

.caption,
.axis-label {
  position: absolute;
  z-index: 1;
  margin: 0;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .18em;
}

.caption { top: 78px; left: 48px; }
.axis-label { right: 48px; bottom: 42px; }

.controls {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 4;
  width: min(320px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid rgba(0, 60, 234, .22);
  border-radius: 14px;
  background: rgba(239, 239, 239, .9);
  box-shadow: 0 18px 55px rgba(0, 28, 130, .13);
  backdrop-filter: blur(14px);
  transition: transform .25s ease, opacity .25s ease;
}

.controls.hidden {
  transform: translateX(calc(100% + 28px));
  opacity: 0;
  pointer-events: none;
}

.heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
}

.heading p {
  margin: 0 0 4px;
  font: 600 9px/1 "Figtree", sans-serif;
  letter-spacing: .16em;
}

.heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.heading button {
  border: 0;
  background: none;
  color: var(--fg);
  font-size: 24px;
  line-height: .8;
  cursor: pointer;
}

label {
  display: block;
  margin-bottom: 19px;
}

label > span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

output { opacity: .65; }

input[type="range"] {
  width: 100%;
  height: 2px;
  appearance: none;
  border: 0;
  background: rgba(0, 60, 234, .22);
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.actions button,
.show {
  padding: 10px 8px;
  border: 1px solid rgba(0, 60, 234, .3);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  cursor: pointer;
}

.actions button:first-child { grid-column: 1 / -1; }

.note {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.45;
  opacity: .58;
}

.show {
  display: none;
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 3;
  background: rgba(227, 227, 227, .9);
}

.show.visible { display: block; }

@keyframes turn { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  .composition { gap: 8px; }
  .asterisk { font-size: 5vw; }
  h1 { font-size: 14vw; }
  .stage::after { inset: 12px; border-radius: 18px; }
  .caption { top: 26px; left: 28px; }
  .axis-label { right: 28px; bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .asterisk { animation: none; }
}
