/* The Share location button of a made-up meet-up app, alone on black. The pill is one element moved by GSAP (width,
   lift, press); its body, grain and light sit in a clipped layer inside it. Behind it two thin waves and a faint
   range ring grow out of the pill; the three friends live in a layer around it. A GSAP element never has a transform
   in the CSS: the inner child carries the CSS one. */
:root {
  --page: #000000;            /* the page */
  --pill-top: #23252c;        /* the top of the pill's body */
  --pill-bottom: #0e0f13;     /* the bottom of the pill's body */
  --ink: #f3f4f8;             /* the words on the pill */
  --muted: #8d90a0;           /* the small words */
  --accent: #6aa8ff;          /* the arrow, the radar and the time ring */
  --stop: #ff7a6b;            /* the slash on the arrow when sharing stops */
  --friend-a: #ff8f70;        /* the first friend */
  --friend-b: #b79cff;        /* the second friend */
  --friend-c: #5fd6a8;        /* the third friend */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 8px;
}

/* the wrap is the radar's field: the pill in the middle, the friends around it */
.wrap {
  position: relative;
  width: min(340px, calc(100vw - 16px));
  height: min(300px, calc(100vh - 24px));
}

/* ---- the waves and the range ring, all drawn from the pill's own outline ---- */
.wave, .range {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200px;
  height: 60px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}
.wave {
  box-shadow: 0 0 18px -4px rgba(106, 168, 255, 0.45), inset 0 0 18px -6px rgba(106, 168, 255, 0.35);
}
.range {
  border-style: dashed;
  border-color: rgba(106, 168, 255, 0.55);
}

/* ---- the friends ---- */
.friends {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.friend {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  visibility: hidden;
  z-index: 2;
}
.friend__in {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -18px);
  display: grid;
  justify-items: center;
  gap: 7px;
}
.face {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 680;
  font-stretch: 112%;
  letter-spacing: 0.01em;
  color: #121318;
  background:
    radial-gradient(120% 90% at 30% 18%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 52%),
    linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 62%, #000));
  box-shadow:
    0 0 0 2px #000,
    0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent),
    inset 0 -2px 3px rgba(0, 0, 0, 0.18),
    0 10px 20px -8px color-mix(in srgb, var(--c) 70%, transparent);
}
/* the little tail that points the friend back to you */
.face::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 1px 0 2px 0;
  background: color-mix(in srgb, var(--c) 66%, #000);
  transform: rotate(45deg);
  z-index: -1;
}
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  height: 22px;
  padding: 3px 9px 0;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 560;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(40, 42, 50, 0.92), rgba(20, 21, 26, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 14px -6px rgba(0, 0, 0, 0.9);
}
.chip__dot { color: var(--muted); }
.chip__m { color: var(--muted); font-weight: 500; }
.odo {
  display: inline-flex;
  height: 1.25em;
  line-height: 1.25em;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
}
.odo__col {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  flex: none;
}
.odo__col span { flex: none; height: 1.25em; text-align: center; }

/* ---- the pill ---- */
.pill {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 196px;
  height: 60px;
  border-radius: 999px;
  --mx: 50%;
  z-index: 3;
}

.pill__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(106, 168, 255, 0.5), 0 0 26px 2px rgba(106, 168, 255, 0.28);
  opacity: 0;
  pointer-events: none;
}

.pill__clip {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pill-top), var(--pill-bottom));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 18px 36px -14px rgba(0, 0, 0, 0.9),
    0 26px 50px -24px rgba(106, 168, 255, 0.28);
  isolation: isolate;
}
.pill.is-on .pill__clip {
  background:
    radial-gradient(80px 60px at 30px 50%, rgba(106, 168, 255, 0.16), rgba(106, 168, 255, 0) 70%),
    linear-gradient(180deg, var(--pill-top), var(--pill-bottom));
}

.pill__grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  pointer-events: none;
}

.pill__sheen {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 120px;
  background: linear-gradient(100deg, rgba(160, 200, 255, 0) 10%, rgba(160, 200, 255, 0.07) 38%, rgba(255, 255, 255, 0.15) 50%, rgba(160, 200, 255, 0.07) 62%, rgba(160, 200, 255, 0) 90%);
  filter: blur(3px);
  opacity: 0;
  pointer-events: none;
}

/* the 1px edge that takes the light where the pointer is */
.pill__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(140px 70px at var(--mx) 0%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.1) 60%, rgba(255, 255, 255, 0.03));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.4;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.pill.is-hot .pill__edge { opacity: 1; }

/* ---- the button inside ---- */
.share {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 22px 0 10px;
  outline: none;
  white-space: nowrap;
}
.share:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }

.dial {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}
.dial__ring {
  position: absolute;
  inset: -2px;
  width: 44px;
  height: 44px;
  overflow: visible;
  fill: none;
  stroke-width: 1.5;
}
.dial__track { stroke: rgba(255, 255, 255, 0.08); opacity: 0; transition: opacity 0.4s ease; }
.pill.is-on .dial__track { opacity: 1; }
.dial__time { stroke: var(--accent); stroke-linecap: round; }
.dial__disc {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.pill.is-on .dial__disc {
  background: linear-gradient(180deg, rgba(106, 168, 255, 0.3), rgba(106, 168, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(106, 168, 255, 0.4), 0 0 16px -4px rgba(106, 168, 255, 0.6);
}
.arrow {
  position: relative;
  width: 19px;
  height: 19px;
  overflow: visible;
}
.arrow__body {
  fill: rgba(255, 255, 255, 0);
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: fill 0.35s ease, stroke 0.35s ease;
}
.pill.is-on .arrow__body { fill: #ffffff; stroke: #ffffff; }
.arrow__slash {
  fill: none;
  stroke: var(--stop);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.words {
  position: relative;
  height: 22px;
  flex: 1;
  overflow: hidden;
}
.word {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 22px;
  font-size: 15.5px;
  font-weight: 560;
  letter-spacing: -0.005em;
  font-stretch: 100%;
  transition: font-stretch 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.pill.is-hot .word { font-stretch: 107%; }
.word[data-word="off"] { color: var(--muted); }

/* ---- the drawn pointer of the autopilot ---- */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #111216;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (max-width: 360px) {
  .face { width: 32px; height: 32px; font-size: 11.5px; }
  .chip { font-size: 11px; padding: 3px 8px 0; }
}
