/* The magnetic button: a big round button that comes to meet the pointer, with a light inside that follows it and a
   ring of words turning around it; two smaller pills do the same, half as much. */
:root {
  --page: #000000;          /* the page */
  --cream: #f3ecdf;         /* the full buttons and the outlined one's text */
  --amber: #ffb347;         /* the light inside the buttons and the ring of a press */
  --muted: rgba(243, 236, 223, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--cream);
  font-family: 'Manrope Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 40px clamp(18px, 3.2vw, 48px);
}

/* the round one on top, the pills below: far enough apart that their catching zones never overlap */
.magnets {
  display: grid;
  justify-items: center;
  gap: 110px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* ---------------------------------------------------------------- the magnets */
/* the wrapper never moves: its box is where the magnet catches the pointer; the body inside moves */
.magnet {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.magnet__body {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;   /* no link preview under a long press on iPhone */
  will-change: transform;
}

.magnet__label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  will-change: transform;
}

/* the light inside: a soft spot that sits under the pointer */
.magnet__glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), var(--glow) 0%, rgba(255, 179, 71, 0) 58%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.magnet__body.is-held .magnet__glow {
  opacity: 1;
}

/* the ring of a press: it grows out of the button and fades */
.magnet__ripple {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--amber);
  opacity: 0;
  pointer-events: none;
}

.magnet--round .magnet__ripple {
  border-radius: 50%;
}

.magnet__body:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 6px;
}

/* the pills */
.pill {
  height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 680;
}

.pill--full {
  --glow: rgba(255, 179, 71, 0.75);
  background: var(--cream);
  color: var(--page);
}

.pill--line {
  --glow: rgba(255, 179, 71, 0.3);
  color: var(--cream);
  box-shadow: inset 0 0 0 1.5px rgba(243, 236, 223, 0.5);
}

/* the big round one and its ring of words */
.reel {
  position: relative;
  width: min(380px, 78vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.reel__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.magnet--round {
  width: 64%;
  aspect-ratio: 1;
}

.round {
  --glow: rgba(255, 179, 71, 0.9);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--cream);
  color: var(--page);
}

.round__label {
  display: grid;
  justify-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 760;
  line-height: 1.1;
  text-align: center;
}

.round__play {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

@media (max-width: 760px) {
  .magnets {
    gap: 72px;
  }
}
