/* The pre-order counter with the batch that fills up: the pre-order card of a small batch of stoneware, alone on
   white. A soft card with a 1px edge and layered shadows; a big rolling number; one mark per piece of the batch; a
   button that changes shape when the batch is full; a toast lane above the card so the toast never covers a word. */
:root {
  --page: #ffffff;            /* the page */
  --card: #fdfcfa;            /* the body of the card */
  --edge: rgba(28, 22, 14, 0.08); /* its 1px edge */
  --ink: #17140f;             /* the words and the lit marks */
  --muted: #8b847a;           /* the small words */
  --off: #ece8e1;             /* a mark still waiting */
  --accent: #e0870f;          /* amber: the last few, and the batch full */
  --accent-soft: #fdf3e3;     /* the amber wash of the full button */
  --button: #17140f;          /* the pre-order button */
  --button-ink: #fbfaf7;      /* the words on it */
}

* {
  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: 12px;
  overflow: hidden;
}

.po {
  position: relative;
  width: min(90vw, 352px);
}

/* the lane over the card where the toast lives */
.po__toast-lane {
  position: relative;
  z-index: 0;
  height: clamp(36px, 9vh, 46px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.po__toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 11px 0 4px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--edge), 0 6px 14px -6px rgba(30, 20, 8, 0.22), 0 1px 2px rgba(30, 20, 8, 0.06);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
  will-change: transform, opacity;
}

.po__toast b {
  color: var(--ink);
  font-weight: 600;
}

.po__avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(160deg, #f3dcb8, #e2b47a);
  box-shadow: inset 0 0 0 1px rgba(120, 70, 10, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: #6b4110;
  font-size: 10.5px;
  font-weight: 650;
}

.po__toast-time {
  font-size: 11px;
  color: #b3aca2;
}

.po__card {
  position: relative;
  z-index: 1;
  border-radius: 22px;
  padding: clamp(14px, 4vh, 22px) clamp(16px, 5vw, 22px) clamp(14px, 3.6vh, 20px);
  background: linear-gradient(180deg, #ffffff 0%, var(--card) 60%, #faf8f4 100%);
  box-shadow:
    0 0 0 1px var(--edge),
    inset 0 1px 0 #ffffff,
    0 1px 2px rgba(30, 20, 8, 0.05),
    0 8px 18px -8px rgba(30, 20, 8, 0.12),
    0 30px 50px -28px rgba(30, 20, 8, 0.24);
  overflow: hidden;
  isolation: isolate;
}

/* a soft light that follows the pointer over the card */
.po__sheen {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(260px 200px at var(--mx, 70%) var(--my, -20%), rgba(255, 236, 205, 0.7), transparent 70%);
  opacity: 0.6;
  transition: opacity 0.5s ease;
}

/* the amber glow behind the number when the batch is nearly full */
.po__glow {
  position: absolute;
  left: -40px;
  top: 30px;
  width: 260px;
  height: 180px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  opacity: 0;
}

.po__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.po__mark {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(160deg, #f6f1ea, #ebe3d7);
  box-shadow: inset 0 0 0 1px rgba(60, 40, 10, 0.07), inset 0 1px 0 #ffffff;
  display: grid;
  place-items: center;
}

.po__mark svg {
  width: 30px;
  height: 30px;
  overflow: visible;
}

.po__mark-body {
  fill: #fffdf9;
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.po__mark-rim,
.po__mark-steam {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-linecap: round;
}

.po__mark-steam {
  stroke: var(--muted);
  stroke-width: 1.1;
}

.po__mark-glaze {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.3;
  stroke-linecap: round;
}

.po__title {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.po__name {
  font-size: 14.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.po__maker {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

/* «Almost there», then «Batch full»: it slides in from the right inside its own clip */
.po__chip {
  flex: none;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  width: 0;
}

.po__chip-in {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  color: color-mix(in srgb, var(--accent) 70%, #3a2306);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.po__chip-check {
  width: 12px;
  height: 12px;
  display: none;
}

.po__chip-check path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-full .po__chip-check {
  display: block;
}

.po__count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: clamp(10px, 3.4vh, 20px);
}

.po__num {
  margin: 0;
  display: inline-flex;
  font-size: clamp(56px, min(19vw, 15.5vh), 84px);
  line-height: 1;
  font-weight: 620;
  font-variation-settings: 'wdth' 88;
  letter-spacing: -0.045em;
  color: var(--ink);
}

/* every digit is a slot: the texts share one grid cell, so the old and the new can cross */
.po__slot {
  display: inline-grid;
  overflow: hidden;
  padding: 0.06em 0.015em;
  margin: -0.06em 0;
}

.po__slot > span {
  grid-area: 1 / 1;
  justify-self: center;
  text-align: center;
  will-change: transform;
}

.po__of {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.po__sub {
  margin: 4px 0 0;
  display: grid;
  font-size: 13px;
  color: var(--muted);
}

.po__sub-t {
  grid-area: 1 / 1;
}

.po__sub-t[data-sub="full"] {
  opacity: 0;
  color: color-mix(in srgb, var(--accent) 70%, #3a2306);
}

/* one mark per piece: the shell is for GSAP's hop, the fill inside grows from the bottom */
.po__marks {
  display: flex;
  gap: clamp(2px, 1vw, 4px);
  height: clamp(16px, 4.6vh, 22px);
  margin-top: clamp(12px, 3.6vh, 20px);
}

.po__m {
  position: relative;
  flex: 1;
  border-radius: 3px;
  background: var(--off);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(60, 40, 10, 0.05);
}

.po__m-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ink);
  transform-origin: 50% 100%;
  transform: scaleY(0);
}

/* the little highlight a lit mark catches on top */
.po__m-fill::after {
  content: '';
  position: absolute;
  left: 22%;
  right: 22%;
  top: 2px;
  height: 1px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.po__meta {
  margin: 10px 0 0;
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.po__left {
  color: var(--ink);
  font-weight: 600;
}

.po__sep {
  color: #c9c2b7;
}

.po__btn {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(44px, 11vh, 50px);
  margin-top: clamp(12px, 3.6vh, 20px);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  color: var(--button-ink);
  -webkit-tap-highlight-color: transparent;
}

.po__btn:focus-visible {
  outline: none;
}

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

.po__btn-bg {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--button);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(20, 14, 6, 0.2), 0 10px 20px -10px rgba(20, 14, 6, 0.55);
}

/* a highlight across the top of the dark pill */
.po__btn-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 55%);
  pointer-events: none;
  transition: opacity 0.4s;
}

.is-full .po__btn-bg::before {
  opacity: 0;
}

.po__btn-labels {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  overflow: hidden;
}

.po__btn-l {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  white-space: nowrap;
  opacity: 0;
}

.po__btn-l[data-l="order"] {
  opacity: 1;
}

.po__btn-price {
  font-weight: 500;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.po__btn-icon {
  width: 16px;
  height: 16px;
  overflow: visible;
}

.po__btn-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.po__btn-l[data-l="wait"],
.po__btn-l[data-l="listed"] {
  color: color-mix(in srgb, var(--accent) 72%, #3a2306);
}

@media (hover: hover) {
  .po__card:hover .po__sheen {
    opacity: 1;
  }
  .po__btn:hover .po__btn-bg {
    filter: brightness(1.18);
  }
  .is-full .po__btn:hover .po__btn-bg {
    filter: brightness(0.98);
  }
}
