/* The stacked notifications: white cards piling up at the bottom of a black page, the newest in front and the others
   smaller behind it; a light button to send them. */
:root {
  --page: #000000;          /* the page */
  --card: #ffffff;          /* a notification */
  --ink: #111114;
  --muted: #6c6c74;
  --height: 70px;           /* every notification is this tall, so the pile lines up */
  --gap: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

/* quick taps on the button never become a double tap that zooms the page */
html {
  touch-action: manipulation;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--card);
  font-family: 'Inter Tight Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the button sits just above the pile, at the bottom of the window */
.stage {
  min-height: 100svh;
  display: grid;
  justify-items: center;
  align-items: end;
  padding: 40px 16px 200px;
}

/* ---------------------------------------------------------------- the button */
.bell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 26px 0 22px;
  border: 0;
  border-radius: 999px;
  background: #f4f3ef;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 620;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: background-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .bell:hover {
    background: #ffffff;
  }
}

.bell:focus-visible {
  outline: 2px solid #f4f3ef;
  outline-offset: 4px;
}

.bell svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* ---------------------------------------------------------------- the pile */
.floor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: 72px;
  background: var(--page);
  pointer-events: none;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  width: min(380px, calc(100vw - 32px));
  height: var(--height);
  translate: -50% 0;
}

.toasts__list {
  position: relative;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* the room the open pile takes above the front notification, so the pointer can move up into it without closing it */
.toasts.is-open::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: var(--reach, 0px);
}

.toast {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--height);
  padding: 0 12px 0 16px;
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform-origin: 50% 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.toast__icon {
  flex: none;
  width: 24px;
  height: 24px;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast__text {
  flex: 1;
  min-width: 0;
}

.toast__title,
.toast__body {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast__title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.toast__body {
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
}

.toast__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9b9ba3;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .toast__close:hover {
    background: #f1f1f3;
    color: var(--ink);
  }
}

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

.toast__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
