/* The connect button with the request that gets accepted: the profile card of a made-up professional network on a
   pure black page. The button is the whole piece: a light pill that drains to dark while the request waits, with a
   beam of light running round its edge (an SVG rect drawn with dashes, so it runs at the same speed on the straight
   sides and on the round ends), and a ring that closes when the request is accepted. */
:root {
  --page: #000000;          /* the page */
  --card: #111114;          /* the body of the card */
  --card-low: #0b0b0d;      /* the bottom of the card */
  --edge: rgba(255, 255, 255, 0.08); /* the card's edge */
  --ink: #ededf0;           /* the words */
  --muted: #8b8b96;         /* the small words */
  --button: #f4f4f5;        /* the Connect button */
  --button-ink: #0b0b0d;    /* the words on it */
  --wait: #16161a;          /* the button while it waits */
  --accent: #8b9bff;        /* the beam, the check, the focus */
  --her-a: #ffcf9e;         /* her avatar, light side */
  --her-b: #e2616f;         /* her avatar, dark side */
  --you-a: #b9c6ff;         /* your avatar, light side */
  --you-b: #5865d8;         /* your avatar, dark side */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

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

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

p {
  margin: 0;
}

/* ---- the card ---- */
.card {
  position: relative;
  width: min(88vw, 344px);
  padding: clamp(16px, 4.6vh, 24px) clamp(16px, 5vw, 22px) clamp(12px, 3.4vh, 18px);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card), var(--card-low));
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 24px 48px -20px rgba(0, 0, 0, 0.9),
    0 60px 90px -50px color-mix(in srgb, var(--accent) 18%, transparent);
  isolation: isolate;
}

/* a warm light behind her avatar, and a cold one that comes up under the button when the ring closes */
.card__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.card__glow::before {
  content: '';
  position: absolute;
  left: -30%;
  top: -46%;
  width: 90%;
  height: 90%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--her-b) 22%, transparent), transparent);
  filter: blur(6px);
}

.card__top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatars {
  position: relative;
  flex: none;
  width: 54px;
  height: 54px;
}

.avatar {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}

.avatar--her {
  inset: 0;
  z-index: 2;
  background: radial-gradient(120% 120% at 28% 18%, var(--her-a), var(--her-b) 72%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 6px 16px -8px color-mix(in srgb, var(--her-b) 80%, transparent);
}

.avatar__shine {
  position: absolute;
  left: 14%;
  top: 8%;
  width: 46%;
  height: 30%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  filter: blur(4px);
}

.avatar__letters {
  position: relative;
  font-size: 17px;
  font-weight: 640;
  font-variation-settings: 'wdth' 104;
  letter-spacing: 0.01em;
  color: rgba(40, 10, 16, 0.78);
}

/* your own avatar waits hidden behind hers and slides out to her bottom right when she accepts */
.avatar--you {
  width: 24px;
  height: 24px;
  right: -2px;
  bottom: -2px;
  z-index: 1;
  background: radial-gradient(120% 120% at 30% 20%, var(--you-a), var(--you-b) 75%);
  box-shadow: 0 0 0 2.5px var(--card), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.avatar--you .avatar__letters {
  font-size: 8.5px;
  font-weight: 620;
  color: rgba(12, 16, 50, 0.8);
}

.who {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.who__line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.who__name {
  font-size: 17px;
  font-weight: 620;
  font-variation-settings: 'wdth' 102;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.who__role {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the degree of the connection: 2nd rolls to 1st */
.chip {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 560;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.chip__win {
  display: block;
  height: 14px;
  overflow: hidden;
}

.chip__col {
  display: flex;
  flex-direction: column;
  line-height: 14px;
}

.mutual {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(12px, 3.4vh, 18px);
  font-size: 12.5px;
  color: var(--muted);
}

.mutual b {
  color: var(--ink);
  font-weight: 560;
}

.faces {
  display: flex;
  flex: none;
}

.face {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: -7px;
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 640;
  color: rgba(10, 10, 20, 0.72);
  background: radial-gradient(120% 120% at 30% 20%, var(--a), var(--b) 78%);
  box-shadow: 0 0 0 2px var(--card);
}

.face::after {
  content: '';
  width: 9px;
  height: 5px;
  margin: -9px 0 0 -6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  filter: blur(1.5px);
}

.face:first-child {
  margin-left: 0;
}

.mutual__text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.stats__num {
  display: inline-flex;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  height: 1.25em;
  line-height: 1.25em;
  align-items: flex-start;
}

.stats__sep {
  width: 1px;
  height: 11px;
  background: rgba(255, 255, 255, 0.14);
}

/* the rolling figures */
.digit {
  display: inline-block;
  height: 1.25em;
  line-height: 1.25em;
  overflow: hidden;
  vertical-align: bottom;
}

.digit__col {
  display: flex;
  flex-direction: column;
}

/* ---- the button ---- */
.connect {
  position: relative;
  display: block;
  width: 100%;
  height: 58px;
  margin-top: clamp(14px, 4vh, 22px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--button-ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.connect:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.connect__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: var(--button);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(0, 0, 0, 0.08), 0 10px 22px -12px rgba(255, 255, 255, 0.35);
}

/* a soft band of light that crosses the light pill on hover */
.connect__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  opacity: 0;
}

.connect__beam {
  position: absolute;
  left: -6px;
  top: -6px;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

.beam {
  fill: none;
  stroke-linecap: round;
  opacity: 0;
}

.beam--haze {
  stroke: var(--accent);
  stroke-width: 9;
  filter: blur(5px);
}

.beam--tail {
  stroke: var(--accent);
  stroke-width: 1.8;
}

.beam--core {
  stroke: #ffffff;
  stroke-width: 1.6;
}

.connect__inner {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 100%;
}

.connect__icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.ic--clock,
.ic--x,
.ic--check {
  opacity: 0;
}

.ic--check {
  stroke: var(--accent);
  stroke-width: 2;
}

.connect__win {
  display: block;
  height: 22px;
  overflow: hidden;
}

.connect__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.lab {
  display: block;
  height: 22px;
  line-height: 22px;
  font-size: 15.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

/* the line under the button rolls with the state */
.note {
  height: 18px;
  margin-top: 11px;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.note__col {
  display: flex;
  flex-direction: column;
}

.note__line {
  display: block;
  height: 18px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note b {
  color: var(--ink);
  font-weight: 560;
}

/* the drawn pointer of the autopilot */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -4px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 10;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.ghost path {
  fill: #ffffff;
  stroke: #0b0b0d;
  stroke-width: 1.3;
  stroke-linejoin: round;
}

@media (max-height: 460px) {
  .stats {
    display: none;
  }
}
