/* The Add protection button with the seal that closes the shield. A graphite glass button on a black page: a
   gradient with a line of light along the top, a 1px border that catches the light, a fine grain and a soft light
   that follows the pointer, no big blur. GSAP moves the elements marked data-*; the CSS styles their children. */
:root {
  --page: #000000;                        /* the page */
  --glass-top: rgba(44, 47, 48, 0.96);    /* the glass, at the top */
  --glass-bottom: rgba(20, 21, 22, 0.98); /* the glass, at the bottom */
  --edge: rgba(236, 248, 242, 0.11);      /* the 1px border */
  --ink: #f1f4f2;                         /* the words */
  --muted: #8d9692;                       /* the small words */
  --track: rgba(236, 248, 242, 0.1);      /* the empty ring */
  --silver: #c8d0cc;                      /* the empty shield */
  --mint: #8fe6c1;                        /* the only accent: the cover */
  --mint-ink: #07150f;                    /* marks on the mint */
}

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

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

.cover {
  position: relative;
  width: min(372px, 92vw);
  opacity: 0;
}

/* ------------------------------------------------------------------ the button and its glass */
.add {
  --mx: 50%;
  --my: 0%;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 60px;
  padding: 0 9px 0 8px;
  border: 0;
  border-radius: 30px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(90% 140% at 8% 50%, rgba(143, 230, 193, var(--lit, 0)) 0%, transparent 60%),
    linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    0 1px 1px rgba(0, 0, 0, 0.7),
    0 10px 22px -8px rgba(0, 0, 0, 0.9),
    0 30px 60px -26px rgba(70, 160, 125, var(--halo, 0.12));
  transition: box-shadow 0.35s ease;
}

/* grain on the glass */
.add::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 4;
}

/* the line of light along the top of the glass */
.add::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28) 30%, rgba(255, 255, 255, 0.28) 70%, transparent);
  opacity: 0.55;
  z-index: 4;
}

/* a soft light that follows the pointer */
.add__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(140px 90px at var(--mx) var(--my), rgba(220, 255, 238, 0.09), transparent 70%);
  transition: opacity 0.3s ease;
  z-index: 0;
}

/* the sheen that crosses the button when the cover is sealed */
.add__shine {
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 0;
  width: 46%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(214, 255, 236, 0.16) 48%, rgba(255, 255, 255, 0.24) 52%, transparent 80%);
  opacity: 0;
  z-index: 3;
}

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

@media (hover: hover) {
  .add:hover {
    box-shadow:
      inset 0 0 0 1px rgba(236, 248, 242, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      inset 0 -1px 0 rgba(0, 0, 0, 0.55),
      0 1px 1px rgba(0, 0, 0, 0.7),
      0 14px 28px -8px rgba(0, 0, 0, 0.95),
      0 34px 70px -24px rgba(70, 160, 125, calc(var(--halo, 0.12) + 0.1));
  }

  .add:hover .add__glow {
    opacity: 1;
  }

  .add:hover .badge__svg {
    transform: rotate(-8deg) translateY(-1px);
  }

  .add:hover .chip__face {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(236, 248, 242, 0.2), 0 4px 10px -4px rgba(0, 0, 0, 0.8);
  }
}

/* ------------------------------------------------------------------ the photo, the ring and the shield */
.thumb {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  z-index: 2;
}

.thumb__ring {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  overflow: visible;
}

.thumb__track,
.thumb__arc {
  fill: none;
  stroke-width: 1.5;
}

.thumb__track {
  stroke: var(--track);
}

.thumb__arc {
  stroke: var(--mint);
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(143, 230, 193, 0.5));
}

.thumb__photo {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  overflow: hidden;
  background: #d9d8d4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.thumb__photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.16);
  filter: saturate(0.85) brightness(0.96);
}

/* a little dome of light on the photo */
.thumb__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 -6px 10px rgba(0, 0, 0, 0.28);
  background: radial-gradient(70% 50% at 35% 15%, rgba(255, 255, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.badge {
  position: absolute;
  right: -7px;
  bottom: -6px;
  width: 22px;
  height: 24px;
}

.badge__svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7));
}

.badge__base {
  fill: #232627;
  stroke: rgba(200, 208, 204, 0.55);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.badge__fill {
  fill: var(--mint);
  opacity: 0;
}

.badge__edge {
  fill: none;
  stroke: #e9fff5;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.badge__plus,
.badge__check {
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge__plus {
  stroke: var(--silver);
  transform-origin: 11px 11.4px;
}

.badge__check {
  stroke: var(--mint-ink);
}

/* ------------------------------------------------------------------ the words */
.add__text {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.add__title,
.add__sub {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.add__title {
  font-size: clamp(13px, 1.6vw + 8px, 15px);
  font-weight: 560;
  font-stretch: 96%;
  letter-spacing: -0.005em;
}

.add__sub {
  font-size: clamp(11px, 0.8vw + 8px, 12px);
  color: var(--muted);
  font-weight: 440;
}

.add__words {
  display: inline-block;
}

/* the words that shimmer while the cover is activated */
.is-working .add__title .add__words {
  color: transparent;
  background: linear-gradient(90deg, #8a938f 0%, #8a938f 35%, #f4fff9 50%, #8a938f 65%, #8a938f 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 1.1s linear infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -150% 0; }
}

/* ------------------------------------------------------------------ the price chip */
.chip {
  position: relative;
  z-index: 2;
  flex: none;
}

.chip__face {
  display: grid;
  place-items: center;
  min-width: 64px;
  height: 36px;
  padding: 0 13px;
  border-radius: 18px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px rgba(236, 248, 242, 0.12), 0 2px 6px -3px rgba(0, 0, 0, 0.8);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.chip__words {
  display: inline-block;
  white-space: nowrap;
}

.is-on .chip__face {
  color: var(--mint);
  background: linear-gradient(180deg, rgba(143, 230, 193, 0.16), rgba(143, 230, 193, 0.07));
  box-shadow: inset 0 0 0 1px rgba(143, 230, 193, 0.28), 0 2px 6px -3px rgba(0, 0, 0, 0.8);
}

.is-on.is-undo .chip__face {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(236, 248, 242, 0.2), 0 2px 6px -3px rgba(0, 0, 0, 0.8);
}

/* ------------------------------------------------------------------ the total and the tag */
.sum {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 6px 0 18px;
  height: 30px;
  font-size: 13px;
  color: var(--muted);
}

.sum::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -7px;
  height: 1px;
  background: linear-gradient(90deg, rgba(236, 248, 242, 0.1), rgba(236, 248, 242, 0.04));
}

.sum__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tag-slot {
  position: relative;
  display: block;
  min-width: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px 0 6px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 560;
  white-space: nowrap;
  color: var(--mint);
  background: rgba(143, 230, 193, 0.09);
  box-shadow: inset 0 0 0 1px rgba(143, 230, 193, 0.22), 0 6px 14px -8px rgba(0, 0, 0, 0.9);
  transform-origin: 12% 0%;
  opacity: 0;
}

.tag__icon {
  width: 11px;
  height: 12px;
  flex: none;
}

.tag__icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.odo {
  display: inline-flex;
  align-items: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
  transition: color 0.4s ease;
}

.odo.is-flash {
  color: var(--mint);
}

.odo__drum {
  position: relative;
  display: inline-block;
  width: 0.6em;
  height: 1.2em;
  overflow: hidden;
  text-align: center;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 24%, #000 76%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 24%, #000 76%, transparent 100%);
}

.odo__col {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: block;
}

.odo__col span {
  display: block;
  height: 1.2em;
  line-height: 1.2em;
}

.odo__fix {
  display: inline-block;
  line-height: 1.2em;
}

.odo__fix--dot {
  width: 0.3em;
  text-align: center;
}

/* the price that falls into the total */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mint);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(143, 230, 193, 0.45);
}

/* ------------------------------------------------------------------ small screens */
@media (max-width: 360px) {
  .add {
    gap: 10px;
  }

  .chip__face {
    min-width: 56px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .sum {
    margin-left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-working .add__title .add__words {
    animation: none;
    color: var(--muted);
    background: none;
  }

  .badge__svg,
  .chip__face {
    transition: none;
  }

  @media (hover: hover) {
    .add:hover .badge__svg,
    .add:hover .chip__face {
      transform: none;
    }
  }
}
