/* The message notification that corrects itself after sending: a notification of frosted glass on a near black page,
   with two slow pools of colour behind it and a fine grain over everything. Every element moved by GSAP is a wrapper
   (.mover, .w spans, .strike); the look sits on its child, so the transforms never fight. */
:root {
  --page: #08080b;            /* the page */
  --glass: rgba(30, 30, 38, 0.62); /* the frosted glass of the notification */
  --glass-2: rgba(24, 24, 30, 0.55); /* the calendar card, a little darker */
  --edge: rgba(255, 255, 255, 0.09); /* thin edges */
  --edge-top: rgba(255, 255, 255, 0.22); /* the top edge that catches the light */
  --ink: #f2f2f5;             /* the words */
  --muted: #9b9ba8;           /* the small words */
  --accent: #8a9bff;          /* the light on the corrected words */
  --accent-rgb: 138 155 255;  /* the same, as numbers for the wash */
  --struck: #ff7a6b;          /* the strike on the old words */
  --pool-a: #3a46ff;          /* the cold pool behind the glass */
  --pool-b: #ff7a4a;          /* the warm pool behind the glass */
  --chip: #f2f2f5;            /* the main reply */
  --chip-ink: #0b0b0f;        /* the words on the main reply */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  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 {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.035), transparent 60%),
    var(--page);
}

/* two slow pools of colour behind the glass, so the frost has something to blur */
.pool {
  position: absolute;
  z-index: -2;
  width: min(70vw, 70vh, 460px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(min(9vw, 9vh, 70px));
  opacity: 0.5;
  pointer-events: none;
}

.pool--a {
  left: 50%;
  top: 50%;
  margin: calc(min(70vw, 70vh, 460px) * -0.78) 0 0 calc(min(70vw, 70vh, 460px) * -0.18);
  background: radial-gradient(circle, var(--pool-a), transparent 66%);
}

.pool--b {
  left: 50%;
  top: 50%;
  margin: calc(min(70vw, 70vh, 460px) * -0.2) 0 0 calc(min(70vw, 70vh, 460px) * -0.86);
  background: radial-gradient(circle, var(--pool-b), transparent 66%);
  opacity: 0.32;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.5;
  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.85' 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.22 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stack {
  width: min(90vw, 360px);
  display: grid;
  gap: clamp(8px, 2.2vh, 12px);
}

.mover {
  will-change: transform;
}

/* ------------------------------------------------------------------ the notification */
.note {
  position: relative;
  display: block;
  border-radius: 22px;
  padding: clamp(11px, 3vh, 15px) clamp(13px, 4vw, 16px) clamp(12px, 3.2vh, 16px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 40%),
    var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow:
    inset 0 1px 0 var(--edge-top),
    inset 0 0 0 1px var(--edge),
    0 1px 1px rgba(0, 0, 0, 0.3),
    0 10px 24px -8px rgba(0, 0, 0, 0.55),
    0 34px 60px -24px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.note:focus-visible {
  box-shadow:
    inset 0 1px 0 var(--edge-top),
    inset 0 0 0 1px var(--edge),
    0 0 0 3px rgba(var(--accent-rgb) / 0.45),
    0 34px 60px -24px rgba(0, 0, 0, 0.75);
}

/* a soft light inside the glass that follows the pointer */
.note__light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.09), transparent 70%);
  transition: opacity 0.4s ease;
}

@media (hover: hover) {
  .note:hover .note__light {
    opacity: 1;
  }

  .chip:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .chip--main:hover {
    background: #ffffff;
  }
}

.note__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.note__app {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.note__icon {
  width: 18px;
  height: 18px;
  display: block;
}

.note__icon-bg {
  fill: #2f3cff;
}

.note__kite {
  fill: #ffffff;
}

.note__tail {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.1;
  stroke-linecap: round;
}

.note__appname {
  font-weight: 560;
  font-variation-settings: 'wdth' 112;
  letter-spacing: 0.08em;
  font-size: 10.5px;
}

.note__meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.note__edited {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
  height: 19px;
  padding: 0 7px 0 6px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(var(--accent-rgb) / 0.12);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb) / 0.22);
  font-size: 10.5px;
  font-weight: 560;
  width: 0;
  padding: 0;
  opacity: 0;
}

.note__edited svg {
  width: 11px;
  height: 11px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.note__who {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: clamp(8px, 2.2vh, 11px);
}

.note__avatar {
  flex: none;
  width: clamp(32px, 9vh, 38px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 50%),
    linear-gradient(140deg, #ff9a6b, #c2459c 60%, #5a3cff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 4px 10px -4px rgba(0, 0, 0, 0.6);
  font-size: 12px;
  font-weight: 640;
  font-variation-settings: 'wdth' 104;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.note__names {
  display: grid;
  min-width: 0;
}

.note__name {
  font-size: clamp(13.5px, 3.8vh, 15px);
  font-weight: 620;
  letter-spacing: -0.005em;
}

.note__sub {
  position: relative;
  display: grid;
  font-size: 12px;
  color: var(--muted);
  height: 16px;
}

.note__thread,
.note__typing {
  grid-area: 1 / 1;
  white-space: nowrap;
}

/* the words while she edits shimmer, as if being written */
.note__typing {
  opacity: 0;
  color: transparent;
  background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 35%, #ffffff 50%, var(--muted) 65%, var(--muted) 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}

.note__msg {
  position: relative;
  margin: clamp(8px, 2.2vh, 11px) 0 0;
  font-size: clamp(14px, 3.9vh, 15.5px);
  line-height: 1.42;
  letter-spacing: -0.003em;
  color: #e6e6ec;
}

/* a word that can be edited: the wash of light is its background, grown and faded with two CSS variables */
.w {
  --ws: 0%;
  --wa: 0;
  border-radius: 4px;
  padding: 0 1px;
  margin: 0 -1px;
  background: linear-gradient(rgba(var(--accent-rgb) / var(--wa)), rgba(var(--accent-rgb) / var(--wa))) 0 0 / var(--ws) 100% no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.ch {
  display: inline-block;
  white-space: pre;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.12em;
  margin: 0 -1px 0 0;
  border-radius: 2px;
  vertical-align: -0.2em;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb) / 0.8);
}

/* ------------------------------------------------------------------ the opened part */
.note__more {
  position: relative;
  height: 0;
  overflow: hidden;
}

.note__more-in {
  padding-top: clamp(10px, 2.6vh, 13px);
}

.note__rule {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14) 20%, rgba(255, 255, 255, 0.14) 80%, transparent);
}

.note__label {
  margin: clamp(8px, 2.2vh, 11px) 0 3px;
  font-size: 10.5px;
  font-weight: 560;
  font-variation-settings: 'wdth' 112;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.note__orig {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.del {
  position: relative;
  display: inline-block;
  color: #c9c9d2;
}

.strike {
  position: absolute;
  left: -1px;
  right: -1px;
  top: 55%;
  height: 1.5px;
  border-radius: 1px;
  background: var(--struck);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.note__replies {
  display: flex;
  gap: 8px;
  margin-top: clamp(10px, 2.6vh, 13px);
}

.chip {
  position: relative;
  height: clamp(36px, 10vh, 42px);
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.chip--main {
  flex: 1;
  color: var(--chip-ink);
  background: var(--chip);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 6px 16px -8px rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.chip__face,
.chip__sent {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chip__face {
  display: block;
}

.chip__sent {
  opacity: 0;
}

.chip__sent svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------ the calendar card under it */
.cal {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 18px;
  padding: clamp(9px, 2.4vh, 12px) 14px;
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px var(--edge),
    0 18px 40px -22px rgba(0, 0, 0, 0.8);
}

.cal__icon {
  flex: none;
  width: clamp(30px, 8.4vh, 34px);
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 34% 1fr;
  background: #f4f4f6;
  box-shadow: 0 3px 8px -3px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.cal__mon {
  background: #ff5a4a;
  color: #ffffff;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 11px;
}

.cal__day {
  color: #111116;
  font-size: 15px;
  font-weight: 640;
  line-height: 1.35;
}

.cal__text {
  display: grid;
  min-width: 0;
  flex: 1;
}

.cal__title {
  font-size: 13.5px;
  font-weight: 600;
}

.cal__line {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cal__sep {
  width: 1px;
  height: 10px;
  margin: 0 7px;
  background: currentColor;
  opacity: 0.4;
}

/* the time rolls like an odometer: one column of digits per figure */
.cal__clock {
  display: inline-flex;
  height: 1.3em;
  line-height: 1.3em;
  overflow: hidden;
  margin-right: 0.25em;
  color: #d8d8e0;
}

.col {
  display: block;
  width: 0.62em;
  text-align: center;
}

.col > span {
  display: block;
}

.col > span > span {
  display: block;
  height: 1.3em;
}

.colon {
  width: 0.3em;
  text-align: center;
}

.cal__state {
  display: grid;
  justify-items: end;
  font-size: 11px;
  color: var(--muted);
}

.cal__tonight,
.cal__updated {
  grid-area: 1 / 1;
  white-space: nowrap;
}

.cal__updated {
  opacity: 0;
  color: var(--accent);
}
