:root {
  --night: #060608;
  --c1: #6f63ff;          /* violet, the cool light of the field */
  --c2: #ff6f8e;          /* rose, the middle light */
  --c3: #ffb169;          /* apricot, the warm light of the pool and the dawn */
  --ink: #f6f4f2;
  --ink-soft: #8e8b93;
  --ink-lede: #c9c5cc;
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(22, 20, 28, 0.42);
  --send: #f6f4f2;
  --send-ink: #0a090c;
  --font: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  /* what is left without canvas: the same three lights, still, in CSS */
  background:
    radial-gradient(ellipse 60% 45% at 30% 85%, rgba(111, 99, 255, 0.28), transparent 70%),
    radial-gradient(ellipse 50% 40% at 72% 80%, rgba(255, 111, 142, 0.22), transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(255, 177, 105, 0.2), transparent 70%),
    var(--night);
}

.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
}

/* a fine grain over the light, so the gradient never bands */
.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

.hero {
  width: min(560px, 100% - 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(12px, 3.2vh, 28px);
  transform: translateY(-2vh);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: clamp(11px, 1.7vh, 13px);
  color: var(--ink-lede);
  white-space: nowrap;
}

.pill__tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 177, 105, 0.2), rgba(255, 111, 142, 0.2));
  color: #ffd3b0;
  font-weight: 560;
  font-variation-settings: "wdth" 110;
}

.title {
  font-size: clamp(28px, min(7.2vw, 8.4vh), 62px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 620;
  font-variation-settings: "wdth" 92;
  text-shadow: 0 1px 24px rgba(6, 6, 8, 0.35);
}

.title__soft { color: var(--ink-soft); font-weight: 520; transition: color 0.8s ease; }
.stage.is-dawn .title__soft { color: #e8d6cc; }

/* the prompt: smoked glass with a 1px rim; under it the pool of light is blurred by the glass */
.prompt {
  position: relative;
  width: min(500px, 100%);
  height: clamp(46px, 8vh, 58px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 7px 0 18px;
  border-radius: 17px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow:
    0 24px 50px -22px rgba(0, 0, 0, 0.9),
    0 2px 6px -2px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  transition: border-color 0.4s ease;
}

.prompt:focus-within { border-color: rgba(255, 255, 255, 0.2); }

/* the rim where the pool touches it: a radial light at the pointer, masked to the 1px border */
.prompt__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  opacity: var(--pool, 0);
  background: radial-gradient(140px 70px at var(--gx, 50%) var(--gy, 100%), rgba(255, 220, 190, 0.95), rgba(255, 111, 142, 0.4) 45%, transparent 75%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* the light that climbs the edges on Enter */
.prompt__rim {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  overflow: visible;
  pointer-events: none;
}

.prompt__rim path {
  fill: none;
  stroke: url(#rim-grad);
  stroke-linecap: round;
  stroke-dasharray: 0 1;
}

.prompt__rim stop:nth-child(1) { stop-color: var(--c3); }
.prompt__rim stop:nth-child(2) { stop-color: var(--c2); }
.prompt__rim stop:nth-child(3) { stop-color: #fff4ea; }

.rim__line path { stroke-width: 1.4; }
.rim__halo path { stroke-width: 6; opacity: 0.7; }

.prompt__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  font: inherit;
  font-size: clamp(14px, 2.2vh, 16px);
  letter-spacing: -0.01em;
  caret-color: var(--c3);
}

.prompt__input::placeholder { color: #75717c; }

.send {
  flex: none;
  width: clamp(34px, 6vh, 42px);
  height: clamp(34px, 6vh, 42px);
  border-radius: 12px;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--send);
  color: var(--send-ink);
  box-shadow: 0 6px 16px -6px rgba(255, 177, 105, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.12), inset 0 1px 0 #fff;
}

.send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send:focus-visible { outline: 2px solid var(--c3); outline-offset: 3px; }

.hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(11px, 1.7vh, 13px);
  color: var(--ink-soft);
}

.hint__key {
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-lede);
  font-variation-settings: "wdth" 108;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

/* the pointer of the autopilot */
.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.cursor path { fill: #fff; stroke: #111; stroke-width: 1.2; stroke-linejoin: round; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .title__soft { transition: color 0.6s ease; }
}

@media (hover: hover) {
  .send { transition: box-shadow 0.3s ease, filter 0.3s ease; }
  .send:hover {
    filter: brightness(1.04);
    box-shadow: 0 10px 22px -6px rgba(255, 177, 105, 0.75), inset 0 -1px 0 rgba(0, 0, 0, 0.12), inset 0 1px 0 #fff;
  }
}
