/* The drone-drop toast: a white notification on a white page, brought and taken away by a small graphite drone
   with an orange band. The drone, its cables and its clips are drawn by script.js in the colours below. */
:root {
  --page: #ffffff;          /* the page */
  --card: #ffffff;          /* a notification */
  --edge: rgba(17, 19, 24, 0.09);    /* its hairline edge */
  --ink: #15171b;           /* the title */
  --muted: #6c7079;         /* the line under it */
  --button: #15171b;        /* the action button */
  --button-hover: #30333a;  /* the action button under the pointer */
  --button-ink: #ffffff;    /* its word */
  --kraft: #c99a62;         /* the parcel in the icon */
  --kraft-light: #ddb582;   /* its top */
  --kraft-dark: #a97c48;    /* its side */
  --accent: #ff5b2e;        /* the tape on the parcel and the band on the drone */
  --drone: #2a2d33;         /* the drone's shell */
  --drone-light: #575c66;   /* its top, in the light */
  --drone-dark: #16171b;    /* its underside */
  --rotor: #3a3e46;         /* the blur of the spinning propellers */
  --cable: #2b2e34;         /* the cables */
  --steel: #8d939d;         /* the clips */
  --air: 230px;             /* the room above the notification where the drone flies */
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap, no zoom */
html {
  touch-action: manipulation;
}

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

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the drones come in from beyond the window and leave the same way: nothing they carry makes the page scroll */
.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  overflow: clip;
}

/* the air above and the place of the notification at the bottom */
.dock {
  position: relative;
  width: min(380px, 100%);
  height: calc(var(--air) + 70px);
}

.shelf {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
}

/* the drones and their cables: above the notification, never in the way of the pointer */
.sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* ---------------------------------------------------------------- a notification */
.toast {
  --lift: 0;
  --hover: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 0 14px;
  border-radius: 18px;
  background: var(--card);
  box-shadow:
    0 0 0 1px var(--edge),
    0 1px 2px rgba(17, 19, 24, 0.06),
    0 calc(10px + 18px * var(--lift) + 3px * var(--hover)) calc(26px + 26px * var(--lift) + 6px * var(--hover)) -14px rgba(17, 19, 24, calc(0.2 + 0.08 * var(--lift)));
  transform-origin: 50% 50%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .toast:hover {
    --hover: 1;
  }
}

.toast__icon {
  flex: none;
  width: 36px;
  height: 36px;
  overflow: visible;
}

.toast__icon .top {
  fill: var(--kraft-light);
}

.toast__icon .front {
  fill: var(--kraft);
}

.toast__icon .side {
  fill: var(--kraft-dark);
}

.toast__icon .tape {
  fill: var(--accent);
}

.toast__icon .mark {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast__icon .label {
  fill: #ffffff;
  opacity: 0.85;
}

.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: 620;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.toast__body {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.3;
  color: var(--muted);
}

.toast__action {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.2s ease, scale 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) and (pointer: fine) {
  .toast__action:hover {
    background: var(--button-hover);
  }
}

.toast__action:active {
  scale: 0.94;
}

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

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

/* a bigger area for a finger than the drawn one */
.toast__close::after {
  content: '';
  position: absolute;
  inset: -6px;
}

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

.toast__close:active {
  background: #e9eaed;
}

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

/* ---------------------------------------------------------------- the drone (drawn by script.js) */
.drone__arm {
  fill: none;
  stroke: var(--drone);
  stroke-width: 4.5;
  stroke-linecap: round;
}

.drone__motor {
  fill: var(--drone-dark);
}

.drone__disc {
  fill: url(#drone-disc);
}

.drone__blade {
  fill: none;
  stroke: var(--drone-dark);
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0.75;
}

.drone__hub {
  fill: var(--drone-light);
}

.drone__leg {
  fill: none;
  stroke: var(--drone-dark);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drone__body {
  fill: url(#drone-shell);
}

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

.drone__visor {
  fill: #0d0e11;
}

.drone__glint {
  fill: none;
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.drone__shine {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.drone__winch {
  fill: var(--drone-dark);
}

.cable {
  fill: none;
  stroke: var(--cable);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clip {
  fill: none;
  stroke: var(--steel);
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* ---------------------------------------------------------------- the phone */
@media (max-width: 420px) {
  .toast {
    gap: 10px;
    padding: 0 8px 0 12px;
  }

  .toast__title {
    font-size: 14.5px;
  }

  .toast__body {
    font-size: 12.5px;
  }

  .toast__action {
    padding: 0 12px;
  }
}
