/* The agent card with liquid light in the glass. The card is a slab of thick dark glass: the WebGL canvas draws the
   light that moves inside it, a CSS bevel and a slow sheen make the surface, and the agent's words sit on top. Under the
   slab the same light spills on the page as a soft glow. The page is near black with a fine grain. */
:root {
  --page: #07080a;             /* the page */
  --page-lift: #10131a;        /* the soft light on the page, behind the card */
  --glass: #0b0e13;            /* the glass, where no light reaches */
  --ink: #eef1f6;              /* the words */
  --muted: #8b93a3;            /* the small words */
  --faint: #4b5262;            /* the steps still to come */
  --accent: #7fd8ff;           /* the colour of the liquid light */
  --accent-2: #b59bff;         /* the second colour of its iridescence */
  --accent-3: #ffd2a8;         /* the warm glint on its crests */
  --done: #9ff0d0;             /* the ticks */
  --edge: rgba(255, 255, 255, 0.1); /* the edge of the glass */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  min-height: 100svh;
  background:
    radial-gradient(60% 55% at 50% 52%, var(--page-lift), transparent 70%),
    var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the grain over the whole page */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%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 1 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

/* the light of the slab, spilled on the page under it */
.glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(760px, 110vw);
  height: min(420px, 70vh);
  margin: calc(min(420px, 70vh) / -2) 0 0 calc(min(760px, 110vw) / -2);
  border-radius: 50%;
  background:
    radial-gradient(closest-side at 38% 60%, color-mix(in srgb, var(--accent) 34%, transparent), transparent),
    radial-gradient(closest-side at 66% 42%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent);
  filter: blur(44px);
  opacity: 0.35;
  pointer-events: none;
}

.slab {
  --pad: clamp(16px, 3.6vmin, 30px);
  position: relative;
  width: min(660px, 92vw, 100%, 150vh);
  border-radius: clamp(18px, 3vmin, 26px);
  background: var(--glass);
  isolation: isolate;
  overflow: hidden;
  opacity: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 18px 40px -16px rgba(0, 0, 0, 0.85),
    0 50px 90px -40px rgba(0, 0, 0, 0.9);
}

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

/* without WebGL: the same light as two slow CSS gradients */
.no-gl .slab__light {
  background:
    radial-gradient(70% 90% at 72% 70%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%),
    radial-gradient(50% 70% at 88% 30%, color-mix(in srgb, var(--accent-2) 34%, transparent), transparent 70%);
}

/* the thickness of the glass: a lit top edge, a darker bottom, a hairline all round */
.slab__bevel {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px var(--edge),
    inset 1px 0 0 rgba(255, 255, 255, 0.05),
    inset 0 -14px 26px -18px rgba(0, 0, 0, 0.9),
    inset 0 14px 30px -24px rgba(255, 255, 255, 0.14);
}

/* the words need calm glass behind them: the light is quieter on the left, where they start */
.slab__bevel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg, rgba(7, 9, 13, 0.62) 0%, rgba(7, 9, 13, 0.34) 48%, rgba(7, 9, 13, 0.06) 78%);
}

/* a slow specular sheen on the top surface of the glass */
.slab__sheen {
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: 0;
  width: 34%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 58%, transparent 100%);
  transform: translateX(-120%) rotate(8deg);
  mix-blend-mode: screen;
}

.slab__body {
  position: relative;
  z-index: 4;
  padding: var(--pad);
  display: grid;
  gap: clamp(10px, 2.2vmin, 18px);
}

/* the head: the mark, the name, the state */
.head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.head__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(30px, 5.4vmin, 38px);
  height: clamp(30px, 5.4vmin, 38px);
  border-radius: 11px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 14px -6px rgba(0, 0, 0, 0.8);
}

.head__mark svg {
  width: 62%;
  height: 62%;
  overflow: visible;
}

.head__drop {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

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

.head__who {
  display: grid;
  line-height: 1.15;
  min-width: 0;
}

.head__name {
  font-size: clamp(15px, 2.5vmin, 18px);
  font-weight: 620;
  font-stretch: 104%;
  letter-spacing: -0.01em;
}

.head__role {
  font-size: clamp(11.5px, 1.9vmin, 13px);
  color: var(--muted);
}

.state {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: clamp(28px, 4.6vmin, 32px);
  padding: 0 12px;
  border-radius: 999px;
  font-size: clamp(11.5px, 1.9vmin, 13px);
  font-weight: 560;
  white-space: nowrap;
  background: rgba(8, 11, 16, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 14px -6px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
}

.state__words {
  display: inline-block;
  background: linear-gradient(90deg, var(--muted) 0%, var(--ink) 45%, var(--accent) 55%, var(--muted) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.is-done .state__words {
  background: none;
  color: var(--ink);
}

.state__time {
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 0.92em;
  font-weight: 450;
  color: #aab2c0;
  font-variant-numeric: tabular-nums;
}

.task {
  margin: 0;
  font-size: clamp(14px, 2.6vmin, 19px);
  font-weight: 520;
  font-stretch: 100%;
  letter-spacing: -0.012em;
  line-height: 1.3;
  max-width: 30ch;
}

/* the steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  height: clamp(30px, 5.2vmin, 38px);
  font-size: clamp(13px, 2.2vmin, 15.5px);
  color: var(--faint);
}

.step__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.4s ease;
}

.step.is-now .step__name {
  color: var(--ink);
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 40%, #ffffff 50%, var(--accent) 56%, var(--ink) 66%, var(--ink) 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 1.6s linear infinite;
}

.step.is-done .step__name {
  color: #c3c9d4;
}

@keyframes shine {
  from { background-position: 100% 0; }
  to { background-position: -60% 0; }
}

.step__took {
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 0.86em;
  color: #c9d0db;
  opacity: 0;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(8, 11, 16, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}

.tick {
  display: grid;
  place-items: center;
  width: clamp(18px, 3vmin, 21px);
  height: clamp(18px, 3vmin, 21px);
}

.tick svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tick__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.3;
}

.tick__spin {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 0.28 1;
  opacity: 0;
  transform-origin: 10px 10px;
}

.tick__fill {
  fill: var(--done);
}

.tick__check {
  fill: none;
  stroke: #06231a;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

/* the foot: what the agent is doing, then what it found */
.foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: clamp(34px, 5.6vmin, 40px);
  padding-top: clamp(10px, 2vmin, 14px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.foot__line {
  font-size: clamp(12.5px, 2.1vmin, 14px);
  color: var(--muted);
  white-space: nowrap;
}

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

.foot__say > * {
  grid-area: 1 / 1;
}

.foot__line--done {
  color: var(--ink);
  font-weight: 540;
  opacity: 0;
}

.foot__btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: clamp(30px, 5vmin, 34px);
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: clamp(12.5px, 2.1vmin, 14px);
  font-weight: 600;
  color: #071018;
  background: linear-gradient(180deg, #f6f8fb, #d9dfe7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

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

.is-done .foot__btn {
  pointer-events: auto;
}

@media (hover: hover) {
  .foot__btn:hover svg {
    transform: translateX(2px);
    transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
  }
}

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

@media (max-width: 420px) {
  .task {
    max-width: none;
  }
  .head__role {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step.is-now .step__name {
    animation: none;
    background: none;
    color: var(--ink);
  }
  .slab__sheen {
    display: none;
  }
}
