/* The parcel locker notification: two toasts of Kubbo, a parcel locker network, on pure black. .toast is moved only
   by GSAP (x, y, scale, rotation, height, opacity); whatever the CSS shapes or transforms is a child of it. */
:root {
  --page: #000000;           /* the page */
  --card: #15161a;           /* the body of the notification */
  --card-low: #0d0e11;       /* its lower half, a little darker */
  --edge: rgba(255, 255, 255, 0.085); /* its 1px edge */
  --ink: #f2f2f4;            /* the words */
  --muted: #8b8d96;          /* the small words */
  --accent: #c9f45e;         /* the lit locker door, the hold line, Open locker */
  --accent-ink: #11160a;     /* the words on the accent */
  --door: #1d1f24;           /* the locker doors */
}

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

button {
  font: inherit;
  color: inherit;
}

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

/* the slot keeps the room of the open notification plus the peek of the one behind */
.slot {
  position: relative;
  width: min(92vw, 360px);
  height: var(--open, 314px);
}

/* a faint glow of the accent under the front card: on pure black the soft shadows need a light to read */
.halo {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 30px;
  height: var(--halo, 60px);
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 13%, transparent), transparent);
  filter: blur(22px);
  opacity: 0;
  pointer-events: none;
}

.toast {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 70px;
  border-radius: 24px;
  overflow: clip;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 40px),
    linear-gradient(180deg, var(--card), var(--card-low));
  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.5),
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 12px 28px -10px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.9);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  will-change: transform;
}

/* a grain so fine it only takes the plastic look away */
.toast::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  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='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.toast--back {
  pointer-events: none;
}

.toast__face {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 70px;
  padding: 0 16px 0 13px;
}

/* the light under the pointer */
.toast__light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(170px circle at var(--mx, 50%) var(--my, -40%), rgba(255, 255, 255, 0.07), transparent 70%);
}

/* the band of light that crosses the card when it arrives and when the door opens */
.toast__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -50%;
  width: 50%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent) 12%, transparent) 55%, rgba(255, 255, 255, 0.1) 68%, transparent);
  opacity: 0;
}

.toast__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 70px;
  padding: 0 14px 0 13px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.toast:has(.toast__head:focus-visible) {
  box-shadow:
    inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, transparent),
    0 12px 28px -10px rgba(0, 0, 0, 0.9);
}

/* the tile of the app: a small wall of four doors with the bottom right one lit */
.tile {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(160deg, #2b2e35, #16171b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 -2px 4px rgba(0, 0, 0, 0.35), 0 4px 10px -4px rgba(0, 0, 0, 0.9);
}

.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, 0.4), transparent 60%),
    linear-gradient(160deg, #d9fb7c, #8fb52a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 4px 14px -4px color-mix(in srgb, var(--accent) 70%, transparent);
  opacity: var(--done, 0);
}

.tile svg {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl__frame,
.tl__lines {
  stroke: #d8d9de;
  stroke-width: 1.5;
}

.tl__lit {
  fill: var(--accent);
}

.tile__check {
  stroke: var(--accent-ink);
  stroke-width: 2.4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.tile--road svg {
  stroke: #c4c6cc;
  stroke-width: 1.5;
}

.head__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.head__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.head__title {
  min-width: 0;
  font-size: 14.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 104;
  letter-spacing: 0.004em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.head__when {
  flex: none;
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}

.head__sub {
  display: flex;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chev {
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: -2px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* words that roll: the old line and the new one share one grid cell */
.roll {
  display: inline-grid;
  justify-items: start;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.08em 0;
  margin: -0.08em 0;
  white-space: nowrap;
}

.roll > .r {
  grid-area: 1 / 1;
  display: block;
}

/* the hold line: it runs out while nobody looks, and then the notification leaves by itself */
.hold {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 1.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  pointer-events: none;
}

.hold i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 50%, transparent), var(--accent));
  transform-origin: left center;
}

.toast--back .hold i {
  background: rgba(255, 255, 255, 0.4);
}

/* ---- the open part ---- */
.toast__more {
  padding: 0 14px 14px;
}

.rule {
  display: block;
  height: 1px;
  margin: 0 2px 12px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0.1) 80%, transparent);
}

.code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.code__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.code__label {
  font-size: 10.5px;
  font-weight: 540;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.digits {
  display: flex;
  align-items: center;
  height: 26px;
}

.digits .c {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 26px;
  overflow: hidden;
  font-size: 22px;
  font-weight: 600;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.01em;
}

.digits .c:nth-child(3) {
  margin-right: 8px;
}

.digits .r {
  grid-area: 1 / 1;
}

/* a hidden digit: a short soft bar, not a character */
.digits .mask {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

/* the wall of lockers: two rows of doors, number 14 lit */
.wall {
  margin-top: 10px;
}

.wall__grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, #0b0c0e, #08090a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.door {
  position: relative;
  height: min(26px, 4.4vh);
  border-radius: 5px;
  perspective: 160px;
}

/* the inside of a door: dark, and lime light for the open one */
.door__in {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #050506;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9);
}

.door--it .door__in {
  background:
    radial-gradient(120% 100% at 50% 100%, color-mix(in srgb, var(--accent) 80%, transparent), color-mix(in srgb, var(--accent) 20%, #050506) 70%);
  opacity: var(--glow, 0);
}

.door__leaf {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: left center;
  backface-visibility: visible;
}

/* the face of a leaf (the CSS child): metal, a handle on the right */
.door__skin {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #24262c, var(--door));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.door__skin::after {
  content: '';
  position: absolute;
  right: 4px;
  top: 50%;
  width: 1.5px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.door--it .door__skin {
  background: linear-gradient(180deg, #2a2d24, #1d2016);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 75%, transparent), 0 0 10px -2px color-mix(in srgb, var(--accent) 45%, transparent);
}

.door--it .door__skin::after {
  background: var(--accent);
}

.door__num {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9.5px;
  font-weight: 650;
  color: var(--accent);
  font-variation-settings: 'wdth' 90;
}

.wall__note {
  display: flex;
  margin-top: 8px;
  padding: 0 4px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

/* the buttons */
.acts {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 8px;
  margin-top: 12px;
}

.act {
  position: relative;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.act__face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 100%;
  border-radius: inherit;
  font-size: 13.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 102;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, font-variation-settings 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.act--ghost .act__face {
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.act--solid .act__face {
  color: var(--accent-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 50%),
    var(--accent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12),
    0 6px 18px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}

.act--small {
  height: 36px;
  flex: none;
  border-radius: 11px;
}

.act--small .act__face {
  padding: 0 12px;
  font-size: 12.5px;
}

.act__icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

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

.act:focus-visible .act__face {
  box-shadow: 0 0 0 2px var(--page), 0 0 0 3.5px color-mix(in srgb, var(--accent) 80%, transparent);
}

@media (hover: hover) {
  .act--ghost:hover .act__face {
    background: rgba(255, 255, 255, 0.09);
    font-variation-settings: 'wdth' 110;
  }

  .act--solid:hover .act__face {
    font-variation-settings: 'wdth' 110;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.3),
      inset 0 -2px 0 rgba(0, 0, 0, 0.12),
      0 8px 24px -6px color-mix(in srgb, var(--accent) 75%, transparent);
  }

  .toast__head:hover .chev {
    stroke: var(--ink);
  }
}

.act__ico {
  display: grid;
  width: 18px;
  height: 18px;
}

.act__ico svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico__spin circle {
  stroke-dasharray: 0.28 0.72;
}

.ico__spin,
.ico__check {
  opacity: 0;
}

.ico__check path {
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

@media (max-width: 380px) {
  .toast__more {
    padding: 0 11px 11px;
  }

  .wall__grid {
    gap: 3px;
    padding: 5px;
  }
}
