/* The Subscribe and save button with the price that drops: one pill of smoked glass on black. The pill is a stack of
   thin layers (grain, the light under the pointer, the edge that catches it, the amber run around the edge, the beam)
   and over them two real buttons: the round glass key of the refill switch and the add to bag button. */
:root {
  --page: #000000;            /* the page */
  --glass: #16171b;           /* the body of the pill */
  --key: #1d1e23;             /* the round glass key */
  --ink: #f2f2f4;             /* the words */
  --muted: #8b8c96;           /* the small words */
  --line: rgba(255, 255, 255, 0.08); /* thin lines */
  --accent: #f5b25f;          /* the amber of the subscription */
  --accent-soft: rgba(245, 178, 95, 0.55); /* its haze */
}

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

.sub {
  position: relative;
  width: min(380px, calc(100vw - 32px));
  padding-top: 42px;
  opacity: 0;
}

/* ---------------------------------------------------------------- the chip that rises over the pill */
.sub__tag {
  position: absolute;
  left: 4px;
  top: 0;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 520;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)), rgba(24, 25, 30, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 22px -10px #000;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
}

.sub__tag-icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sub__tag-save {
  color: var(--accent);
  padding-left: 7px;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.1);
}

/* ---------------------------------------------------------------- the pill */
.sub__pill {
  position: relative;
  height: 60px;
  display: flex;
  align-items: center;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.015) 48%, rgba(0, 0, 0, 0.25)),
    var(--glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 1px 1px rgba(0, 0, 0, 0.7),
    0 14px 26px -12px rgba(0, 0, 0, 0.95);
  isolation: isolate;
  --mx: 70%;
  --my: 0%;
  --gi: 0.6;
}

/* the amber haze under the pill, on while subscribed */
.sub__pill::before {
  content: '';
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -10px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  filter: blur(20px);
  opacity: var(--haze, 0);
  z-index: -1;
  pointer-events: none;
}

.sub__grain,
.sub__glow,
.sub__edge,
.sub__run,
.sub__beam {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

/* a very fine grain, drawn by an SVG filter */
.sub__grain {
  opacity: 0.12;
  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%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the light under the pointer, inside the glass */
.sub__glow {
  background: radial-gradient(140px 70px at var(--mx) var(--my), rgba(255, 255, 255, calc(0.09 * var(--gi))), transparent 70%);
}

/* the edge: a 1px ring brighter where the pointer is */
.sub__edge {
  padding: 1px;
  background:
    radial-gradient(110px 60px at var(--mx, 70%) var(--my, 0%), rgba(255, 255, 255, calc(0.5 * var(--gi, 0.6))), transparent 75%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03) 60%, 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);
}

/* the amber light that runs once around the edge when the item goes in the bag */
.sub__run {
  --a: 0deg;
  padding: 1.5px;
  opacity: 0;
  background: conic-gradient(from var(--a), transparent 0 62%, var(--accent-soft) 80%, var(--accent) 90%, #fff4e4 94%, transparent 97%);
  -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);
}

/* the beam that crosses the glass on press */
.sub__beam {
  overflow: hidden;
}

.sub__beam::after {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 70px;
  background: linear-gradient(100deg, transparent, rgba(255, 238, 214, 0.16) 45%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 238, 214, 0.16) 55%, transparent);
  transform: translateX(var(--bx, -120px)) skewX(-14deg);
}

/* ---------------------------------------------------------------- the refill key */
.sub__toggle {
  position: relative;
  z-index: 2;
  flex: none;
  width: 60px;
  height: 60px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

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

.sub__key {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02) 62%),
    radial-gradient(circle at 50% 120%, rgba(245, 178, 95, calc(0.35 * var(--on, 0))), transparent 70%),
    var(--key);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -3px 6px rgba(0, 0, 0, 0.55),
    0 2px 4px rgba(0, 0, 0, 0.7),
    0 0 18px rgba(245, 178, 95, calc(0.28 * var(--on, 0)));
}

@media (hover: hover) {
  .sub__toggle:hover .sub__key {
    background:
      radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03) 62%),
      radial-gradient(circle at 50% 120%, rgba(245, 178, 95, calc(0.35 * var(--on, 0))), transparent 70%),
      var(--key);
  }
}

.sub__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  fill: none;
  stroke-width: 1.5;
}

.sub__ring-track {
  stroke: rgba(255, 255, 255, 0.05);
}

.sub__ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.sub__loop {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #cfd0d7;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.sub__rule {
  position: relative;
  z-index: 2;
  flex: none;
  width: 1px;
  height: 26px;
  background: linear-gradient(180deg, transparent, var(--line) 25%, var(--line) 75%, transparent);
}

/* ---------------------------------------------------------------- add to bag */
.sub__cta {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  height: 60px;
  margin: 0;
  padding: 0 clamp(16px, 5vw, 24px) 0 clamp(12px, 3.6vw, 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 0 999px 999px 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sub__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sub__window {
  position: relative;
  display: block;
  height: 20px;
  overflow: hidden;
}

.sub__words {
  display: block;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.005em;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .sub__cta:hover .sub__words {
    font-variation-settings: 'wdth' 110;
  }
}

.sub__small {
  display: block;
  font-size: 11px;
  line-height: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.sub__price {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  height: 40px;
}

.sub__was {
  position: relative;
  font-size: 11px;
  line-height: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  height: 0;
}

.sub__strike {
  position: absolute;
  left: -1px;
  right: -1px;
  top: 50%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
}

.sub__now {
  display: inline-flex;
  font-size: 17px;
  line-height: 22px;
  font-weight: 620;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wdth' 96;
}

.sub__d {
  display: inline-block;
  height: 22px;
  overflow: hidden;
}

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

.sub__col span {
  display: block;
  height: 22px;
}

.sub__done {
  position: absolute;
  right: -6px;
  top: 50%;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 60%),
    radial-gradient(circle at 50% 110%, rgba(245, 178, 95, 0.32), transparent 70%),
    var(--key);
  box-shadow:
    inset 0 0 0 1px rgba(245, 178, 95, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 16px rgba(245, 178, 95, 0.22),
    0 2px 4px rgba(0, 0, 0, 0.7);
  opacity: 0;
}

.sub__check {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.sub__check path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
