/* The pick up in store button that finds the store. A soft warm paper with a light from above and a fine grain, and
   in the middle one pill of satin graphite. Inside, layered in one rounded box (.ps__body, moved only by GSAP): the
   satin fill, a green light that grows from the disc when the store is found, the light under the pointer, the
   reflection that crosses at the end and the satin's edges on top. Then the row: the disc (shop front, the arc that
   searches, the green plate and the check), two lines of words and the chip with the distance. */
:root {
  --page: #ebe8e2;            /* the paper around the button */
  --page-light: #f8f6f2;      /* the light from above on the paper */
  --graphite: #1a1a1c;        /* the button's satin graphite */
  --ink: #f4f3ef;             /* the words on the button */
  --muted: rgba(244, 243, 239, 0.56); /* the small line under the words */
  --accent: #8fdcae;          /* the green of the stock: arc, plate, chip */
  --accent-deep: #2e8a5a;     /* the deep green of the plate's edge */
  --shadow: 38, 30, 22;       /* the colour of the shadows on the paper (r, g, b) */
}

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

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

/* the paper: a soft light from above, a little darker at the edges, a fine grain over everything */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(min(80vw, 620px) min(60vh, 420px) at 50% 38%, var(--page-light), transparent 72%),
    radial-gradient(min(140vw, 1100px) min(110vh, 800px) at 50% 50%, transparent 55%, rgba(var(--shadow), 0.08)),
    var(--page);
}

.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.ps {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

/* the soft contact shadow on the paper */
.ps__floor {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 86%;
  height: 26px;
  margin: -14px 0 0 -43%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--shadow), 0.32), rgba(var(--shadow), 0.1) 60%, transparent);
  filter: blur(8px);
  pointer-events: none;
}

/* the green light the button throws on the paper when the store is found */
.ps__spill {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 104%;
  height: 40px;
  margin: -14px 0 0 -52%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 70%, transparent), color-mix(in srgb, var(--accent) 22%, transparent) 55%, transparent);
  filter: blur(14px);
  opacity: 0;
  pointer-events: none;
}

.ps__btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.ps__btn:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 5px;
}

.ps__body {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  width: min(88vw, 312px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(var(--shadow), 0.35),
    0 3px 6px -2px rgba(var(--shadow), 0.25),
    0 12px 22px -10px rgba(var(--shadow), 0.45),
    0 30px 50px -26px rgba(var(--shadow), 0.55);
}

.ps__fill,
.ps__glow,
.ps__shine,
.ps__sweep,
.ps__satin {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

/* satin graphite: lighter at the top, a soft brushed band across */
.ps__fill {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.02) 48%, rgba(0, 0, 0, 0.22)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    var(--graphite);
}

/* the green light that spreads from the disc when the store is found (GSAP scales it) */
.ps__glow-light {
  position: absolute;
  left: -34px;
  top: -40%;
  width: 150px;
  height: 180%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 36%, transparent), color-mix(in srgb, var(--accent) 10%, transparent) 55%, transparent);
  transform-origin: 34px 50%;
  opacity: 0;
}

/* the light under the pointer */
.ps__shine {
  background: radial-gradient(110px 70px at var(--mx) var(--my), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.035) 50%, transparent 72%);
  opacity: 0;
}

/* the reflection that crosses the satin when the order is reserved */
.ps__sweep-band {
  position: absolute;
  top: -30%;
  left: 0;
  width: 34%;
  height: 160%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 255, 255, 0.04) 70%, transparent 100%);
  transform: translateX(-140%) skewX(-16deg);
}

/* the edges: a 1px line that catches the light at the top, a dark lip at the bottom, a satin highlight */
.ps__satin {
  z-index: 3;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7),
    inset 0 -12px 18px -12px rgba(0, 0, 0, 0.6);
}

.ps__satin::after {
  content: '';
  position: absolute;
  left: 9%;
  right: 9%;
  top: 1px;
  height: 44%;
  border-radius: 999px 999px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

.ps__row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 9px 0 8px;
  gap: 11px;
}

/* the disc on the left: the shop front at rest, the arc that searches, then the green plate and the check */
.ps__disc {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.ps__disc > * {
  grid-area: 1 / 1;
  position: relative;
}

.ps__plate,
.ps__plate-done {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.ps__plate {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.13), transparent 60%),
    linear-gradient(180deg, #2b2b2f, #141416);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.5);
}

.ps__plate-done {
  background:
    radial-gradient(circle at 50% 18%, #e6fbef, var(--accent) 56%, color-mix(in srgb, var(--accent) 70%, var(--accent-deep)));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent-deep) 40%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 8px color-mix(in srgb, var(--accent-deep) 50%, transparent);
  opacity: 0;
}

.ps__ring {
  width: 44px;
  height: 44px;
  overflow: visible;
}

.ps__ring circle {
  fill: none;
  stroke-width: 1.5;
}

.ps__ring-track {
  stroke: rgba(255, 255, 255, 0.1);
  opacity: 0;
}

.ps__ring-arc {
  opacity: 0;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 0.24 1;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 60%, transparent));
}

.ps__shop {
  width: 24px;
  height: 24px;
  overflow: visible;
}

.ps__shop-wall,
.ps__shop-door,
.ps__shop-window,
.ps__shop-awning,
.ps__shop-stripe {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ps__shop-window {
  stroke: color-mix(in srgb, var(--accent) 80%, white);
}

.ps__shop-stripe {
  stroke-width: 1.1;
  opacity: 0.6;
}

.ps__shop-scallop {
  fill: var(--ink);
}

.ps__check {
  width: 22px;
  height: 22px;
  overflow: visible;
}

.ps__check path {
  fill: none;
  stroke: #0f3a24;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.ps__text {
  flex: 1;
  display: grid;
  min-width: 0;
  text-align: left;
}

.ps__state {
  grid-area: 1 / 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ps__state + .ps__state {
  opacity: 0;
}

.ps__title {
  font-size: 15.5px;
  font-weight: 580;
  font-variation-settings: 'wdth' 102;
  letter-spacing: 0.002em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

/* Checking stock shimmers: a light band runs through the letters (GSAP moves background-position) */
.ps__title--busy {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 38%, #ffffff 46%, var(--accent) 50%, #ffffff 54%, var(--ink) 62%, var(--ink) 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.ps__sub {
  font-size: 11.5px;
  font-weight: 460;
  font-variation-settings: 'wdth' 96;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the store being checked rolls in this line: two spans take turns */
.ps__sub--roll {
  display: grid;
  overflow: hidden;
}

.ps__roll {
  grid-area: 1 / 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps__roll + .ps__roll {
  opacity: 0;
}

.ps__roll.is-out {
  text-decoration: line-through;
  text-decoration-color: rgba(244, 243, 239, 0.4);
}

.ps__roll.is-in {
  color: color-mix(in srgb, var(--accent) 85%, white);
}

/* the chip: how many stores at rest, the distance of the store being checked, green when found */
.ps__chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 70px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 1px 2px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.ps__chip-face {
  grid-area: 1 / 1;
  font-size: 12px;
  font-weight: 560;
  font-variation-settings: 'wdth' 94;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ps__chip-face + .ps__chip-face {
  opacity: 0;
}

.ps__chip-face--km {
  display: grid;
  color: var(--ink);
}

.ps__chip.is-found .ps__chip-face--km {
  color: color-mix(in srgb, var(--accent) 85%, white);
}

.ps__km {
  grid-area: 1 / 1;
  text-align: center;
}

.ps__km + .ps__km {
  opacity: 0;
}
