/* The Notify me when it's back button: a small product card of an invented running shoe shop on white. The card has
   a real photo, the size row (39 to 45, 42 sold out) and the button. The button is two layers: .cta__body is moved by
   GSAP (the spring squash), its child .cta__skin takes the colour of each state from CSS. */
:root {
  --page: #ffffff;           /* the page */
  --card: #ffffff;           /* the card */
  --ink: #141416;            /* the words and the Add to bag button */
  --muted: #74747c;          /* the small words */
  --faint: #a8a8b0;          /* the sold out size */
  --line: rgba(20, 20, 22, 0.09); /* the hairline borders */
  --photo: #f2f0eb;          /* behind the shoe */
  --accent: #f0531c;         /* the one accent: Notify me, the ring on 42, the check */
  --accent-rgb: 240, 83, 28; /* the same accent, for the soft rings and shadows (the script keeps it in step) */
  --accent-soft: #fff1eb;    /* the button once you are on the list */
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  height: 100%;
}

html {
  touch-action: manipulation;
}

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.4vh, 16px);
}

/* ---------- the card ---------- */
.shoe {
  position: relative;
  width: min(340px, 92vw);
  padding: clamp(8px, 1.6vh, 10px) clamp(8px, 1.6vh, 10px) clamp(10px, 2.4vh, 14px);
  border-radius: 22px;
  background: var(--card);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 1px rgba(20, 20, 22, 0.03),
    0 3px 6px -2px rgba(20, 20, 22, 0.05),
    0 14px 28px -12px rgba(20, 20, 22, 0.1),
    0 34px 60px -28px rgba(20, 20, 22, 0.16);
  opacity: 0;
}

.shoe__pic {
  position: relative;
  height: clamp(96px, 27vh, 196px);
  border-radius: 15px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #fefdfb 0%, var(--photo) 75%);
  isolation: isolate;
}

.shoe__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
  mix-blend-mode: multiply; /* the white studio of the photo takes the warm grey of the frame */
  filter: contrast(1.06) brightness(1.03);
}

/* a soft sheen over the photo and its own hairline, so the photo sits in the card like glass */
.shoe__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(20, 20, 22, 0.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}

.shoe__info {
  padding: clamp(8px, 1.8vh, 12px) 6px 0;
}

.shoe__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.shoe__brand {
  font-size: 11.5px;
  font-weight: 560;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.shoe__price {
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.shoe__name {
  margin-top: 1px;
  font-size: 16px;
  font-weight: 650;
  font-variation-settings: 'wdth' 104;
  letter-spacing: -0.012em;
}

.shoe__colour {
  font-weight: 450;
  color: var(--muted);
  font-variation-settings: 'wdth' 100;
}

/* ---------- the sizes ---------- */
.sizes {
  padding: clamp(8px, 1.8vh, 12px) 6px 0;
}

.sizes__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 11.5px;
}

.sizes__label {
  font-weight: 600;
}

.sizes__unit {
  font-weight: 450;
  color: var(--muted);
  margin-left: 2px;
}

.sizes__read {
  position: relative;
  display: inline-grid;
  justify-items: end;
  color: var(--muted);
  font-weight: 480;
}

.sizes__read > span {
  grid-area: 1 / 1;
  white-space: nowrap;
}

.sizes__read .is-accent {
  color: var(--accent);
}

.sizes__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 17px;
}

.size {
  position: relative;
  height: clamp(30px, 6.6vh, 38px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 1.5px rgba(20, 20, 22, 0.04);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 540;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.25s ease, background-color 0.25s ease, font-variation-settings 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.size[aria-checked='true'] {
  font-weight: 640;
  font-variation-settings: 'wdth' 112;
}

.size.is-out {
  color: var(--faint);
  background: #fafaf9;
  box-shadow: inset 0 0 0 1px rgba(20, 20, 22, 0.06);
}

.size.is-out[aria-checked='true'] {
  color: var(--muted);
}

.size__n {
  position: relative;
}

/* the hairline across the sold out size */
.size__strike {
  position: absolute;
  inset: 7px 6px;
  width: calc(100% - 12px);
  height: calc(100% - 14px);
  overflow: visible;
  pointer-events: none;
}

.size__strike line {
  stroke: rgba(20, 20, 22, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

@media (hover: hover) {
  .size:hover {
    box-shadow: inset 0 0 0 1px rgba(20, 20, 22, 0.22), 0 2px 4px rgba(20, 20, 22, 0.06);
  }
}

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

/* the frame of the chosen size, one for all, it slides from size to size */
.sizes__sel {
  position: absolute;
  left: 0;
  top: 0;
  height: clamp(30px, 6.6vh, 38px);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  pointer-events: none;
  z-index: 2;
}

/* the ring that stays on 42 while you are on the list, with its small Watching tag */
.sizes__watch {
  position: absolute;
  left: 0;
  top: 0;
  height: clamp(30px, 6.6vh, 38px);
  pointer-events: none;
  z-index: 3;
  visibility: hidden;
}

.sizes__ring {
  position: absolute;
  inset: -3px;
  border-radius: 13px;
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px rgba(var(--accent-rgb), 0.08);
}

.sizes__tag {
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  translate: -50% 0;
  font-size: 9.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 108;
  letter-spacing: 0.02em;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------- the button ---------- */
.cta {
  position: relative;
  height: 56px;
  margin: 0 2px;
}

.cta__body {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cta__skin {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    0 1px 2px rgba(20, 20, 22, 0.16),
    0 8px 18px -8px rgba(20, 20, 22, 0.45);
  transition: background-color 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cta.is-notify .cta__skin {
  background: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 0 1px rgba(0, 0, 0, 0.14),
    0 1px 2px rgba(var(--accent-rgb), 0.2),
    0 10px 22px -8px rgba(var(--accent-rgb), 0.55);
}

.cta.is-field .cta__skin {
  background: #ffffff;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 1px rgba(20, 20, 22, 0.14),
    inset 0 1px 2px rgba(20, 20, 22, 0.05),
    0 0 0 4px rgba(var(--accent-rgb), 0.1),
    0 6px 14px -8px rgba(20, 20, 22, 0.18);
}

.cta.is-done .cta__skin {
  background: var(--accent-soft);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(var(--accent-rgb), 0.08),
    0 6px 14px -8px rgba(var(--accent-rgb), 0.25);
}

.cta__btn {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.35s ease;
}

.cta.is-done .cta__btn {
  color: var(--ink);
}

.cta.is-field .cta__btn {
  pointer-events: none;
}

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

.cta__words {
  display: grid;
  place-items: center;
}

.cta__word {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -0.005em;
  visibility: hidden;
}

.cta__text {
  display: inline-block;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .cta__btn:hover .cta__text {
    font-variation-settings: 'wdth' 110;
  }
  .cta:not(.is-field):hover .cta__skin {
    filter: brightness(1.06);
  }
}

.ic {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

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

.ic--check path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.ic--bell {
  width: 16px;
  height: 16px;
  color: var(--accent);
  margin-left: 2px;
}

/* ---------- the email field the button opens into ---------- */
.cta__field {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 7px 0 15px;
  visibility: hidden;
}

.cta.is-field .cta__field {
  visibility: visible;
}

.cta__mail {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cta__input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.cta__input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  caret-color: var(--accent);
}

.cta__input::placeholder {
  color: var(--faint);
}

/* the mirror measures the typed text, so the drawn caret can sit right after it */
.cta__mirror {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  white-space: pre;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.cta__caret {
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.5px;
  height: 19px;
  margin-top: -9.5px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}

.cta__send {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(var(--accent-rgb), 0.25), 0 6px 12px -6px rgba(var(--accent-rgb), 0.6);
  -webkit-tap-highlight-color: transparent;
}

.cta__send:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.cta__send-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.cta__arrow,
.cta__spin {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cta__spin {
  opacity: 0;
}

/* ---------- the drawn pointer of the autopilot ---------- */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: var(--ink);
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}

@media (max-height: 470px) {
  .cta {
    height: 50px;
  }
  .sizes__grid {
    margin-bottom: 15px;
  }
  .cta__send {
    width: 38px;
    height: 38px;
  }
}
