/* The story with the reply you pull up: one story of a pottery studio, nine by sixteen, on a near black floor. The
   story (.st__scene) is a layer of its own that GSAP scales back when the reply sheet (.st__sheet) rises over it; the
   picture is three blurred glaze colours with a gloss and a grain, the words sit on top. The frame (.st) is black, so
   the scene sinking back shows a dark rim like a real phone sheet. Sizes follow the story's own box (container units). */
:root {
  --page: #09080a;            /* the floor */
  --frame: #050405;           /* the black behind the story when it sinks back */
  --ember: #ff6a2b;           /* the ember glaze, and the colour of the send button and of the message */
  --cobalt: #3f55ff;          /* the cobalt glaze */
  --cream: #f7efe4;           /* the words of the story */
  --ink: #f4f1ee;             /* the words on the sheet */
  --muted: rgba(244, 241, 238, 0.58); /* the small words */
  --glass: rgba(24, 20, 22, 0.66);    /* the frosted sheet */
  --chip: rgba(255, 255, 255, 0.07);  /* a quick reply at rest */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  min-height: 100svh;
  background:
    radial-gradient(60% 50% at 50% 55%, rgba(255, 106, 43, 0.07), transparent 70%),
    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 {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

.wrap {
  position: relative;
  height: min(86vh, 600px, 160vw);
  aspect-ratio: 9 / 16;
}

/* the light the story throws on the floor */
.glow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -5%;
  height: 26%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 106, 43, 0.5), rgba(63, 85, 255, 0.22) 60%, transparent);
  filter: blur(26px);
  opacity: 0.7;
  pointer-events: none;
}

.st {
  position: absolute;
  inset: 0;
  container-type: size;
  border-radius: clamp(16px, 3.6vh, 26px);
  overflow: hidden;
  background: var(--frame);
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.5),
    0 10px 24px -8px rgba(0, 0, 0, 0.7),
    0 40px 80px -30px rgba(0, 0, 0, 0.9);
}

/* the 1px edge on top of everything: light above, dark below */
.st__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}

.st__scene {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  cursor: grab;
}

.st__scene:active {
  cursor: grabbing;
}

/* the picture: three glaze colours on dark clay */
.st__img {
  position: absolute;
  inset: -4%;
  background:
    radial-gradient(70% 45% at 30% 85%, #2a120b, transparent 70%),
    linear-gradient(170deg, #140d10 0%, #1b0f0c 55%, #0d0a10 100%);
}

.st__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(9cqw);
}

.st__blob--a {
  width: 92%;
  height: 52%;
  left: -12%;
  top: 30%;
  background: radial-gradient(closest-side, #ff7a35, #d8401a 55%, rgba(120, 30, 10, 0) 100%);
  opacity: 0.95;
}

.st__blob--b {
  width: 80%;
  height: 46%;
  right: -22%;
  top: 4%;
  background: radial-gradient(closest-side, #5a6dff, #2a35c8 55%, rgba(20, 20, 90, 0) 100%);
  opacity: 0.9;
}

.st__blob--c {
  width: 46%;
  height: 26%;
  left: 34%;
  top: 46%;
  background: radial-gradient(closest-side, #ffe6c8, rgba(255, 190, 140, 0.4) 60%, rgba(255, 190, 140, 0) 100%);
  opacity: 0.75;
  mix-blend-mode: screen;
}

/* a glossy streak, as on a fired glaze */
.st__gloss {
  position: absolute;
  left: 18%;
  top: 22%;
  width: 70%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%);
  transform: rotate(-28deg) scaleY(0.32);
  mix-blend-mode: overlay;
}

.st__grain {
  position: absolute;
  inset: 0;
  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.5 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* dark at the top and the bottom so the words read */
.st__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 22%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.18) 38%, rgba(0, 0, 0, 0) 56%);
}

/* the light that follows the finger */
.st__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(42cqw 42cqw at var(--mx, 50%) var(--my, 40%), rgba(255, 236, 214, 0.16), transparent 70%);
  mix-blend-mode: soft-light;
}

.st__bars {
  position: absolute;
  left: 3.6cqw;
  right: 3.6cqw;
  top: 2.6cqw;
  display: flex;
  gap: 1.2cqw;
}

.st__bar {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.st__fill {
  display: block;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

.st__head {
  position: absolute;
  left: 3.6cqw;
  right: 3.6cqw;
  top: 6cqw;
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  font-size: clamp(10px, 3.9cqw, 14px);
}

.st__avatar {
  position: relative;
  width: clamp(24px, 10.5cqw, 36px);
  aspect-ratio: 1;
  flex: none;
}

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

.st__ring circle {
  fill: none;
  stroke: var(--ember);
  stroke-width: 2.2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transform: rotate(-90deg);
  transform-origin: center;
}

.st__face {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background:
    radial-gradient(60% 50% at 35% 30%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(circle at 70% 75%, #3f55ff, transparent 65%),
    radial-gradient(circle at 30% 70%, #ff6a2b, #9b2c10 70%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.st__who {
  display: flex;
  align-items: baseline;
  gap: 1.8cqw;
  color: #fff;
  min-width: 0;
}

.st__who b {
  font-weight: 620;
  letter-spacing: 0.005em;
}

.st__when {
  color: rgba(255, 255, 255, 0.62);
}

.st__close {
  margin-left: auto;
  width: clamp(14px, 5.2cqw, 18px);
  color: #fff;
}

.st__close svg,
.st__hint svg,
.st__sent svg,
.st__send svg {
  display: block;
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.st__copy {
  position: absolute;
  left: 7cqw;
  right: 7cqw;
  bottom: 23cqh;
  color: var(--cream);
}

.st__kicker {
  margin: 0 0 2.4cqw;
  font-size: clamp(9px, 3.5cqw, 13px);
  font-weight: 560;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 239, 228, 0.8);
}

.st__title {
  margin: 0;
  font-size: 19cqw;
  line-height: 0.86;
  font-weight: 780;
  font-stretch: 112%;
  letter-spacing: -0.035em;
  text-shadow: 0 2px 30px rgba(60, 10, 0, 0.35);
}

.st__line {
  margin: 3.6cqw 0 0;
  max-width: 30ch;
  font-size: clamp(10px, 3.9cqw, 14.5px);
  line-height: 1.38;
  color: rgba(247, 239, 228, 0.86);
}

.st__seats {
  display: inline-flex;
  align-items: center;
  gap: 1.4cqw;
  margin-top: 4.4cqw;
  padding: 1.6cqw 3.4cqw;
  border-radius: 999px;
  font-size: clamp(10px, 3.7cqw, 13.5px);
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* the seat count that rolls from 7 to 6: two figures in a column, only one shows */
.st__roll {
  display: inline-block;
  height: 1.15em;
  line-height: 1.15em;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.st__roll span {
  display: block;
}

.st__dim {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.st__foot {
  position: absolute;
  left: 3.6cqw;
  right: 3.6cqw;
  bottom: 3.6cqw;
  display: grid;
  justify-items: center;
  gap: 2.2cqw;
}

.st__hint {
  display: grid;
  justify-items: center;
  gap: 0.6cqw;
  font-size: clamp(9px, 3.3cqw, 12px);
  font-weight: 560;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.86);
}

.st__hint svg {
  width: clamp(12px, 4.6cqw, 16px);
  stroke-width: 1.8;
}

.st__bar-reply {
  appearance: none;
  position: relative;
  width: 100%;
  height: clamp(30px, 12.4cqw, 44px);
  padding: 0 4.4cqw;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: clamp(10px, 3.9cqw, 14px);
  text-align: left;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.st__bar-reply:focus-visible,
.st__chip:focus-visible,
.st__send:focus-visible,
.st__input:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.st__ph,
.st__sent {
  position: absolute;
  left: 4.4cqw;
  right: 4.4cqw;
  top: 50%;
  translate: 0 -50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st__sent {
  display: flex;
  align-items: center;
  gap: 1.6cqw;
  color: #fff;
  opacity: 0;
}

.st__sent svg {
  width: clamp(12px, 4.4cqw, 16px);
  flex: none;
  color: var(--ember);
  stroke-width: 2;
}

.st__sent path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

/* the frosted sheet that rises from the bottom */
.st__sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 53cqh;
  padding: 2.2cqh 5cqw 4.6cqw;
  display: flex;
  flex-direction: column;
  border-radius: clamp(16px, 3.2vh, 24px) clamp(16px, 3.2vh, 24px) 0 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%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.12 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 30%),
    var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 -20px 40px -10px rgba(0, 0, 0, 0.55);
  visibility: hidden;
  touch-action: none;
}

.st__grip {
  align-self: center;
  width: 10cqw;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  flex: none;
}

.st__sheet-title {
  margin: 2.2cqh 0 1.6cqh;
  font-size: clamp(9px, 3.4cqw, 12.5px);
  font-weight: 560;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.st__chips {
  display: grid;
  justify-items: start;
  gap: 1.2cqh;
}

.st__chip {
  appearance: none;
  margin: 0;
  padding: 1.55cqh 4.2cqw;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: clamp(10.5px, 4.1cqw, 14.5px);
  font-weight: 520;
  color: var(--ink);
  background: var(--chip);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 16px -10px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: background-color 0.25s, box-shadow 0.25s;
}

@media (hover: hover) {
  .st__chip:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 18px -10px rgba(0, 0, 0, 0.8);
  }
}

.st__chip.is-picked {
  background: rgba(255, 106, 43, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.55), 0 8px 20px -10px rgba(255, 106, 43, 0.6);
}

.st__field {
  margin: auto 0 0;
  display: flex;
  align-items: center;
  gap: 2.2cqw;
}

.st__input {
  flex: 1;
  min-width: 0;
  height: clamp(30px, 12cqw, 44px);
  padding: 0 4.2cqw;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: clamp(10.5px, 4.1cqw, 14.5px);
  color: var(--ink);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 2px 6px rgba(0, 0, 0, 0.4);
  outline: none;
}

.st__input::placeholder {
  color: rgba(244, 241, 238, 0.42);
  transition: color 0.3s;
}

.st__input.is-quiet::placeholder {
  color: transparent;
}

.st__send {
  appearance: none;
  flex: none;
  width: clamp(30px, 12cqw, 44px);
  height: clamp(30px, 12cqw, 44px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
  cursor: pointer;
}

.st__send:disabled {
  cursor: default;
}

/* the round face of the send button: grey when there is nothing to send, ember when there is */
.st__send-face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.st__send:not(:disabled) .st__send-face {
  background: radial-gradient(circle at 35% 25%, #ff9a63, var(--ember) 60%, #d9481a);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 16px -6px rgba(255, 106, 43, 0.85);
}

.st__send svg {
  width: 44%;
  stroke-width: 2;
}

/* the message on its way up */
.st__bubble {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 8;
  padding: 0 4.2cqw;
  border-radius: 999px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: clamp(10.5px, 4.1cqw, 14.5px);
  font-weight: 560;
  color: #fff;
  background: radial-gradient(circle at 30% 20%, #ff9a63, var(--ember) 55%, #d9481a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 24px -8px rgba(255, 106, 43, 0.8);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
