/* The coffee ready notification with the cup that fills. One dark glass pill on a black page: the glass is a
   gradient with a sheen along the top edge, a 1px border that catches the light and a fine grain, no big blur.
   GSAP moves .note (enter and leave) and .note__shell (height and corners); the CSS styles their children. */
:root {
  --page: #000000;                       /* the page */
  --glass-top: rgba(46, 41, 37, 0.92);   /* the glass, at the top */
  --glass-bottom: rgba(19, 17, 16, 0.96);/* the glass, at the bottom */
  --edge: rgba(255, 244, 232, 0.11);     /* the 1px border */
  --ink: #f5efe8;                        /* the words */
  --muted: #a39a90;                      /* the small words */
  --dim: rgba(245, 239, 232, 0.3);       /* the steps still to come */
  --track: rgba(255, 244, 232, 0.09);    /* the empty bar and ring */
  --caramel: #d79a5a;                    /* the only accent */
  --caramel-ink: #1d130b;                /* the words on the button */
}

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

p {
  margin: 0;
}

.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;
}

/* ------------------------------------------------------------------ the pill and its glass */
.note {
  position: relative;
  width: min(400px, 92vw);
  opacity: 0;
}

.note__shell {
  --r: 38px;
  position: relative;
  height: 76px;
  border-radius: var(--r);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(215, 154, 90, var(--warm, 0)) 0%, transparent 55%),
    linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 248, 240, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 10px 24px -8px rgba(0, 0, 0, 0.8),
    0 34px 70px -24px rgba(120, 72, 30, 0.28);
  transition: box-shadow 0.4s ease;
}

/* grain on the glass */
.note__shell::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.16;
  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: 3;
}

/* the sheen: light from above, caught by the top of the glass */
.note__shell::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 44px;
  pointer-events: none;
  background: radial-gradient(55% 100% at 50% 0%, rgba(255, 246, 236, 0.075), transparent 72%);
  z-index: 3;
}

@media (hover: hover) {
  .note:hover .note__shell {
    box-shadow:
      inset 0 0 0 1px rgba(255, 244, 232, 0.17),
      inset 0 1px 0 rgba(255, 248, 240, 0.16),
      inset 0 -1px 0 rgba(0, 0, 0, 0.5),
      0 1px 1px rgba(0, 0, 0, 0.6),
      0 14px 30px -8px rgba(0, 0, 0, 0.85),
      0 40px 80px -24px rgba(120, 72, 30, 0.36);
  }
}

.note__head {
  position: relative;
  z-index: 2;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 20px 0 9px;
}

/* ------------------------------------------------------------------ the cup: photo, ring, steam */
.cup {
  position: relative;
  flex: none;
  width: 58px;
  height: 58px;
}

.cup__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.cup__track,
.cup__arc {
  fill: none;
  stroke-width: 1.5;
}

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

.cup__arc {
  stroke: var(--caramel);
  stroke-linecap: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 3px rgba(215, 154, 90, 0.45));
}

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

.cup__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 -6px 10px rgba(0, 0, 0, 0.35);
  background: radial-gradient(70% 50% at 35% 18%, rgba(255, 255, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.cup__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* the cup before it is poured: the same photo, without colour and in shadow */
.cup__empty {
  filter: grayscale(1) brightness(0.42) contrast(0.9);
}

.cup__full {
  clip-path: inset(100% 0 0 0);
}

.cup__surface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.cup__surface path {
  fill: none;
  stroke: rgba(255, 238, 214, 0.75);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

/* a thread of steam over the cup: three soft wisps that rise and sway, only while it brews */
.cup__steam {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 22px;
  height: 30px;
  margin-left: -11px;
  pointer-events: none;
  opacity: 0;
}

.cup__steam i {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 3px;
  height: 18px;
  margin-left: -1.5px;
  border-radius: 3px;
  background: linear-gradient(0deg, rgba(255, 246, 236, 0), rgba(255, 246, 236, 0.78) 45%, rgba(255, 246, 236, 0));
  filter: blur(0.9px);
  opacity: 0;
  animation: rise 2.4s cubic-bezier(0.35, 0, 0.4, 1) infinite;
}

.cup__steam i:nth-child(2) {
  left: 28%;
  height: 14px;
  animation-delay: 0.8s;
  animation-duration: 2.8s;
}

.cup__steam i:nth-child(3) {
  left: 72%;
  height: 15px;
  animation-delay: 1.5s;
  animation-duration: 2.6s;
}

@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(8px) scaleY(0.6) skewX(0deg);
  }
  30% {
    opacity: 1;
  }
  60% {
    transform: translateY(-6px) scaleY(1.1) skewX(-14deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-16px) scaleY(1.3) skewX(10deg);
  }
}

/* ------------------------------------------------------------------ the words and the three steps */
.note__body {
  flex: 1;
  min-width: 0;
}

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

.note__name {
  font-size: 15px;
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note__when {
  position: relative;
  flex: none;
  font-size: 12px;
  color: var(--muted);
  min-width: 34px;
  text-align: right;
}

.note__when-words {
  display: inline-block;
}

.note__done {
  position: absolute;
  right: -2px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -9px;
  overflow: visible;
}

.note__done path {
  fill: none;
  stroke: var(--caramel);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

.steps {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.steps__seg {
  position: relative;
  height: 3px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}

.steps__seg i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #b9783e, var(--caramel) 70%, #f0c38f);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.steps__labels {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  font-size: 10.5px;
  font-variation-settings: 'wdth' 100;
  letter-spacing: 0.01em;
}

.steps__labels span {
  color: var(--dim);
  transition: color 0.45s ease;
}

.steps__labels span.is-done {
  color: var(--muted);
}

.steps__labels span.is-now {
  color: var(--ink);
}

/* ------------------------------------------------------------------ the card when it is ready */
.note__more {
  position: relative;
  z-index: 2;
  padding: 2px 14px 14px;
}

.note__more::before {
  content: '';
  display: block;
  height: 1px;
  margin: 0 4px 14px;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 232, 0.12) 20%, rgba(255, 244, 232, 0.12) 80%, transparent);
}

.ready {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px;
}

.ready__text {
  min-width: 0;
}

.ready__title {
  font-size: clamp(19px, min(5.4vw, 4.6vh), 22px);
  font-weight: 620;
  font-variation-settings: 'wdth' 106;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.ready__sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ready__order {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.ready__label {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* the order number on drums: each digit is a column of figures moved by GSAP (yPercent) */
.odo {
  display: flex;
  height: 1em;
  margin-top: 4px;
  font-size: clamp(28px, min(8vw, 7vh), 34px);
  line-height: 1;
  font-weight: 640;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.02em;
  color: var(--caramel);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

.odo__drum {
  display: block;
  width: 0.6em;
  text-align: center;
}

.odo__col {
  display: block;
}

.odo__col span {
  display: block;
  height: 1em;
}

/* the button: caramel, pressed by GSAP on the button, lit by the CSS on its face */
.go-wrap {
  margin-top: 14px;
}

.go {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--caramel-ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.go__face {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: inherit;
  background: linear-gradient(180deg, #e8b47a, var(--caramel) 55%, #c38246);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 220, 0.6),
    inset 0 -1px 0 rgba(90, 50, 15, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 8px 20px -8px rgba(215, 154, 90, 0.55);
  font-size: 14.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 104;
  overflow: hidden;
  transition: filter 0.25s ease, box-shadow 0.25s ease;
}

/* a soft light that crosses the button once, when the card opens */
.go__face::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 248, 238, 0.45), transparent);
  transform: translateX(var(--shine, -120%)) skewX(-18deg);
  pointer-events: none;
}

@media (hover: hover) {
  .go:hover .go__face {
    filter: brightness(1.06);
    box-shadow:
      inset 0 1px 0 rgba(255, 240, 220, 0.7),
      inset 0 -1px 0 rgba(90, 50, 15, 0.35),
      0 1px 2px rgba(0, 0, 0, 0.5),
      0 12px 26px -8px rgba(215, 154, 90, 0.7);
  }
}

.go__words {
  display: inline-block;
}

.go__icon {
  width: 16px;
  height: 16px;
  overflow: visible;
}

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

.go__check {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
