/* The Compare button of a made-up bike shop, alone on black. The pill and the bar are elements moved by GSAP (width,
   lift, press, rise); their body, grain, light and contents sit in children styled here. The flying thumbnail is a
   copy of the tile, fixed to the window and moved along an arc by GSAP. A GSAP element never has a transform in CSS. */
:root {
  --page: #000000;            /* the page */
  --pill-top: #26252c;        /* the top of the pill's body */
  --pill-bottom: #0f0f13;     /* the bottom of the pill's body */
  --bar-top: #1a1a20;         /* the top of the compare bar */
  --bar-bottom: #0c0c10;      /* the bottom of the compare bar */
  --ink: #f4f3f6;             /* the words */
  --muted: #8e8c98;           /* the small words and the empty slots */
  --accent: #ff8a4c;          /* the check, the slot glow, Compare now */
  --accent-ink: #1a0c04;      /* the words on Compare now */
  --arc-a: #ffb27a;           /* the tile of the Arc 2 bike, light side */
  --arc-b: #c4501f;           /* the tile of the Arc 2 bike, dark side */
}

* { 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: 16px;
}

.wrap {
  position: relative;
  width: min(344px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: min(30px, 6vh);
  padding: 8px 0 10px;
}

/* ---- the pill ---- */
.pill {
  position: relative;
  height: 60px;
  width: 196px;
  border-radius: 30px;
  z-index: 2;
}
.pill__floor {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6), 0 8px 18px rgba(0, 0, 0, 0.55), 0 20px 40px -12px rgba(255, 138, 76, 0.14);
  transition: box-shadow 0.3s ease;
}
.pill.is-hot .pill__floor { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6), 0 10px 22px rgba(0, 0, 0, 0.6), 0 22px 46px -12px rgba(255, 138, 76, 0.24); }
.pill__clip {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pill-top), var(--pill-bottom));
}
.pill__grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.pill__sheen {
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 40px at var(--mx, 50%) 0, rgba(255, 255, 255, 0.1), transparent 70%);
  pointer-events: none;
}
/* the one pixel edge that catches the light, brighter where the pointer is */
.pill__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background:
    radial-gradient(90px 30px at var(--mx, 50%) 0, rgba(255, 214, 186, var(--hot, 0.35)), transparent 75%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04) 45%, rgba(255, 255, 255, 0.07));
  -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 exclude, linear-gradient(#000 0 0);
}

.cmp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 0 10px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 30px;
  outline: none;
}
.cmp:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.cmp.is-off { cursor: default; }

/* the round socket the thumbnail sits in, a little sunk into the pill */
.socket {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.06);
}
.socket::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  opacity: var(--empty, 0);
}

/* a product tile: a gradient, a gloss and the bike drawn in line */
.tile {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.95);
}
.tile svg {
  width: 78%;
  height: 78%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
}
.tile__gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 46%);
  pointer-events: none;
}
.tile--arc { background: radial-gradient(circle at 30% 25%, var(--arc-a), var(--arc-b) 78%); }
.tile--ridge { background: radial-gradient(circle at 30% 25%, #9fb2c8, #34445a 78%); }
.tile--tempo { background: radial-gradient(circle at 30% 25%, #b9d6a6, #3e6040 78%); }
.tile--gravel { background: radial-gradient(circle at 30% 25%, #e6d3a8, #7a6136 78%); }
.tile--fly {
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  width: 40px;
  height: 40px;
  z-index: 6;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.label {
  flex: 1 1 auto;
  min-width: 0;
  height: 22px;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}
.label__in {
  display: block;
  font-size: 16px;
  line-height: 22px;
  font-weight: 580;
  letter-spacing: -0.005em;
  font-stretch: var(--wd, 100%);
  font-variant-numeric: tabular-nums;
}
.label__in .num { display: inline-block; }
.label__in .dot { color: var(--muted); padding: 0 1px; }
.measure { position: absolute; visibility: hidden; left: -999px; top: 0; white-space: nowrap; }

.ic { flex: none; width: 20px; height: 20px; position: relative; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.ic__cmp { color: var(--ink); }
.ic__ring { stroke: var(--accent); stroke-dasharray: 54.1; stroke-dashoffset: 54.1; }
.ic__check { stroke: var(--accent); stroke-width: 1.9; stroke-dasharray: 13; stroke-dashoffset: 13; }
.ic__full { stroke: var(--muted); stroke-dasharray: 16.5; stroke-dashoffset: 16.5; }

/* ---- the compare bar ---- */
.bar {
  position: relative;
  width: 100%;
  height: 72px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: linear-gradient(180deg, var(--bar-top), var(--bar-bottom));
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.7), 0 14px 34px rgba(0, 0, 0, 0.7), 0 30px 60px -20px rgba(255, 138, 76, 0.12);
  visibility: hidden;
  opacity: 0;
  z-index: 1;
}
.bar__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 55%, rgba(255, 255, 255, 0.06));
  -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 exclude, linear-gradient(#000 0 0);
}
.slots { display: flex; gap: 8px; flex: none; }
.slot {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 0;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 1px 3px rgba(0, 0, 0, 0.6);
  color: var(--muted);
  cursor: pointer;
  outline: none;
  font: inherit;
}
.slot:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.slot__plus { position: absolute; inset: 0; display: grid; place-items: center; }
.slot__plus svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; opacity: 0.7; }
.slot .tile { border-radius: 13px; }
.slot__ring {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px 1px rgba(255, 138, 76, 0.4);
  opacity: 0;
  pointer-events: none;
}
/* the little cross that says a filled slot can be taken out */
.slot__x {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #2c2b33;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 4px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}
.slot__x svg { width: 8px; height: 8px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }

.cta {
  position: relative;
  flex: 1 1 auto;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.cta__hint {
  position: absolute;
  right: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.go {
  position: relative;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 15px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffa774, var(--accent));
  color: var(--accent-ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 640;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 16px -4px rgba(255, 138, 76, 0.55);
  visibility: hidden;
  opacity: 0;
  outline: none;
}
.go:focus-visible { box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--accent); }
.go__arrow { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (hover: hover) {
  .slot.is-full:hover .slot__x { opacity: 1; }
  .slot:not(.is-full):hover { color: var(--ink); }
  .go:hover .go__arrow { transform: translateX(2px); }
  .go__arrow { transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1); }
}

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

@media (max-width: 360px) {
  .slots { gap: 6px; }
  .slot { width: 40px; height: 40px; }
  .bar { padding: 0 10px; gap: 8px; }
  .go { padding: 0 10px 0 12px; font-size: 13px; }
}
