/* JPtheGeek product illustrations.
   Styles for the drawings built in scripts/sitegen/mockups.py: a request in the client
   portal, a containment decision, and a chat with THEO. Loaded only on pages that use one.

   The colours, sizes, and labels follow the real product, which is dark by default.
   Each drawing sits in a container, so it lays itself out by the room it is given,
   not by the width of the window.

   Contents
   1 Frame and tokens      4 Decision panel
   2 Shared parts          5 THEO chat
   3 Request tracker       6 Motion                                                   */

/* 1 Frame and tokens ------------------------------------------------------ */

.ui-fig {
  container-type: inline-size;
  min-width: 0;
  margin: 0;
}

.ui {
  --u-page: #0b0c12;
  --u-plane: #0f1018;
  --u-card: #151726;
  --u-raised: #181b2b;
  --u-control: #1d2133;
  --u-side: #090a10;
  --u-side-line: #191b2a;
  --u-line: #2b2e42;
  --u-hair: rgb(255 255 255 / .08);
  --u-text: #eceef4;
  --u-muted: #a3a8ba;
  --u-dim: #8a90a6;
  --u-accent: #7452ff;
  --u-accent-text: #baa9ff;
  --u-theo: #8b7cf6;
  --u-theo-wash: rgb(139 124 246 / .12);
  --u-theo-text: #d9d2fc;
  --u-theo-line: rgb(139 124 246 / .34);
  --u-red: #f26d6d;
  --u-green: #34d39e;
  --u-amber: #f5b04d;
  --u-blue: #5ca5f7;
  --u-sky: #38bdf8;
  /* The portal takes its accent from the provider's brand. This is the one stored for JPtheGeek. */
  --u-brand: #0ea5e9;
  position: relative;
  border: 1px solid rgb(255 255 255 / .13);
  border-radius: 14px;
  background: var(--u-page);
  color: var(--u-muted);
  box-shadow: 0 3rem 5rem -2.5rem rgb(0 0 0 / .8);
  font-family: var(--font-text);
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  overflow: hidden;
}

.t-paper .ui,
.t-cyan .ui {
  border-color: rgb(34 40 49 / .5);
  box-shadow: 0 3rem 5rem -2.5rem rgb(34 40 49 / .6);
}

/* :where() keeps this reset at one class of weight, so any part below can override it. */
.ui :where(p, ul, ol, dl, dd) {
  margin: 0;
  padding: 0;
  max-width: none;
  list-style: none;
}

.ui b {
  color: var(--u-text);
  font-weight: 600;
}

.ui em,
.ui i {
  font-style: normal;
}

.ui code,
.ui kbd {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: 0;
}

.ui-note {
  margin-top: 1rem;
}

/* 2 Shared parts ---------------------------------------------------------- */

.u-ico {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.u-ico.is-flip {
  transform: scaleX(-1);
}

/* Window bar */
.u-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  height: 2.25rem;
  padding: 0 .85rem;
  border-bottom: 1px solid var(--u-side-line);
  background: var(--u-side);
}

.u-bar > i {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: rgb(255 255 255 / .17);
}

.u-bar > span {
  margin-left: .6rem;
  padding: .15rem .6rem;
  border-radius: 6px;
  background: rgb(255 255 255 / .05);
  color: var(--u-dim);
  font-family: var(--font-mono);
  font-size: .6875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.u-live {
  position: relative;
  width: .45rem;
  height: .45rem;
  margin-left: auto;
  border-radius: 50%;
  background: var(--u-green);
}

/* The longest title needs the full bar on the narrowest phones. */
@media (max-width: 22rem) {
  .u-bar {
    gap: .3rem;
    padding: 0 .6rem;
  }

  .u-bar > span {
    margin-left: .3rem;
    padding: .15rem .4rem;
  }
}

.u-live::after {
  content: "";
  position: absolute;
  inset: -.3rem;
  border: 1px solid var(--u-green);
  border-radius: 50%;
  opacity: 0;
  animation: u-ping 2.6s ease-out infinite;
}

.u-pad {
  display: grid;
  gap: .9rem;
  padding: 1rem;
}

.u-pad--tight {
  gap: .7rem;
  padding: .85rem;
}

.u-h2 {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.u-eyebrow {
  color: var(--u-dim);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.u-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .5rem;
}

.u-chips > code {
  padding: .1rem .4rem;
  border: 1px solid var(--u-line);
  border-radius: 5px;
  background: var(--u-raised);
  color: var(--u-muted);
}

/* Pills: a 12 percent wash of the tone, with a border of the same tone. */
.u-pill {
  --tone: var(--u-dim);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 1.375rem;
  padding: 0 .5rem;
  border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 13%, transparent);
  color: var(--tone);
  font-size: .6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.u-pill.is-caps {
  letter-spacing: .05em;
  text-transform: uppercase;
}

.u-pill.is-risk {
  height: 1.25rem;
  border-radius: 6px;
}

.u-pill.is-risk::before {
  content: "";
  width: .375rem;
  height: .375rem;
  border-radius: 50%;
  background: currentColor;
}

/* Tones. Two classes deep, so a tone always beats a part's own default. */
.ui .is-red {
  --tone: var(--u-red);
}

.ui .is-amber {
  --tone: var(--u-amber);
}

.ui .is-green {
  --tone: var(--u-green);
}

.ui .is-blue {
  --tone: var(--u-blue);
}

.ui .is-sky {
  --tone: var(--u-sky);
}

.ui .is-accent {
  --tone: var(--u-accent-text);
}

.ui .is-theo {
  --tone: var(--u-theo-text);
}

.ui .is-muted,
.ui .is-neutral {
  --tone: var(--u-muted);
}

/* Status dots, in the colours the portal uses for each state. */
.u-dot {
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: #6b7280;
}

.u-dot.is-open {
  background: #3b82f6;
}

.u-dot.is-progress {
  background: #818cf8;
}

.u-dot.is-waiting {
  background: #f59e0b;
}

.u-dot.is-resolved {
  background: #10b981;
}

.u-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  height: 1.75rem;
  padding: 0 .7rem;
  border: 1px solid var(--u-line);
  border-radius: 7px;
  color: var(--u-text);
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}

.u-btn.is-primary {
  border-color: var(--u-accent);
  background: var(--u-accent);
  color: #fff;
}

.u-btn.is-ghost {
  border-color: transparent;
  color: var(--u-muted);
}

.u-btn.is-small {
  height: 1.5rem;
  padding: 0 .55rem;
  color: var(--u-muted);
  font-size: .6875rem;
}

.u-btn.is-amber {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #0b1222;
  font-weight: 600;
}

.u-card {
  display: grid;
  align-content: start;
  gap: .15rem;
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--u-hair);
  border-radius: 14px;
  background: rgb(255 255 255 / .035);
}

.u-card--flat {
  gap: .5rem;
  border-color: var(--u-line);
  border-radius: 11px;
  background: var(--u-card);
}

.u-card__head {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .25rem;
  color: var(--u-dim);
  font-size: .8125rem;
}

.u-card__head > span {
  margin-left: auto;
  color: var(--u-sky);
  font-size: .75rem;
}

.u-av {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--u-line);
  border-radius: 50%;
  background: var(--u-raised);
  color: var(--u-muted);
  font-size: .6875rem;
  font-weight: 600;
}

.u-av.is-staff {
  border-color: rgb(116 82 255 / .5);
  background: rgb(116 82 255 / .2);
  color: var(--u-accent-text);
}

.u-av.is-brand {
  border-color: transparent;
  background: var(--u-brand);
  color: #fff;
}

.u-av .u-ico {
  font-size: .95rem;
}

/* Confidence meter */
.u-meter {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  color: var(--u-muted);
  font-size: .71875rem;
  white-space: nowrap;
}

.u-meter > i {
  width: 4.5rem;
  height: .375rem;
  border-radius: 999px;
  background: rgb(255 255 255 / .1);
  overflow: hidden;
}

.u-meter i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c6df0, #a79bfa);
  transform-origin: 0 50%;
}

.u-meter em {
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* THEO's mark and the square letter avatar the chat uses. */
.u-theo {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  overflow: visible;
}

.u-theo__shell {
  fill: var(--u-theo);
}

.u-theo__visor {
  fill: #15122b;
}

.u-theo__eye {
  fill: #ece8ff;
}

.u-theo__ant {
  fill: none;
  stroke: #a79bfa;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.u-theo__tip {
  fill: #d9d2fc;
  filter: drop-shadow(0 0 2.5px rgb(167 155 250 / .95));
}

/* 3 Request tracker ------------------------------------------------------- */

.ui--request {
  background:
    radial-gradient(24rem 14rem at 100% 0, rgb(14 165 233 / .1), transparent 70%),
    var(--u-page);
}

.u-back {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
}

.u-fresh {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: rgb(16 185 129 / .1);
  color: #34d399;
  font-size: .6875rem;
}

.u-track {
  margin-top: .35rem;
  padding: .7rem .75rem .75rem;
  border: 1px solid var(--u-hair);
  border-radius: 10px;
  background: rgb(255 255 255 / .03);
}

.u-track__states {
  display: grid;
  margin-top: .35rem;
}

.u-track__state {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 .5rem;
  align-items: center;
  opacity: 0;
}

.u-track__state b {
  font-size: .9375rem;
}

.u-track__state span {
  grid-column: 2;
  font-size: .78125rem;
}

.u-track__state.is-3 {
  opacity: 1;
}

.u-track__bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .3rem;
  margin-top: .7rem;
}

.u-track__bar i {
  height: .25rem;
  border-radius: 999px;
  background: #10b981;
}

.u-msg {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .6rem;
  max-width: 92%;
}

.u-msg.is-me {
  justify-self: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.u-msg.is-me .u-av {
  order: 2;
}

.u-msg.is-me .u-msg__who {
  justify-content: flex-end;
}

.u-msg__who {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  font-size: .71875rem;
}

.u-msg__who b {
  color: #7dd3fc;
  font-weight: 500;
}

.u-msg.is-me .u-msg__who b {
  color: var(--u-muted);
}

.u-bubble {
  margin-top: .25rem;
  padding: .55rem .75rem;
  border: 1px solid var(--u-line);
  border-radius: 4px 14px 14px 14px;
  background: var(--u-raised);
  color: var(--u-text);
}

.u-msg.is-me .u-bubble {
  border-color: rgb(14 165 233 / .35);
  border-radius: 14px 4px 14px 14px;
  background: rgb(14 165 233 / .14);
}

.u-quick {
  display: grid;
  gap: .45rem;
}

.u-quick span {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border: 1px solid var(--u-line);
  border-radius: 11px;
  font-size: .78125rem;
  font-weight: 500;
}

.u-quick .is-green {
  border-color: rgb(16 185 129 / .3);
  color: #6ee7b7;
}

@container (min-width: 26rem) {
  .u-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 4 Decision panel -------------------------------------------------------- */
.ui-fig--decision {
  max-width: 40rem;
}

.u-decide__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .5rem;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--u-line);
  background: rgb(116 82 255 / .07);
}

.u-decide__head > .u-ico {
  color: var(--u-theo);
  font-size: 1rem;
}

.u-decide__head > b {
  font-size: .875rem;
}

.u-decide__why {
  color: var(--u-text);
}

.u-choice {
  display: grid;
  gap: .15rem;
  padding: .6rem .75rem;
  border: 1px solid var(--u-line);
  border-radius: 9px;
  background: var(--u-card);
}

.u-choice.is-rec {
  border-color: var(--u-theo-line);
  background: var(--u-theo-wash);
}

.u-choice p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .5rem;
}

.u-choice p > .u-ico {
  color: var(--u-dim);
  font-size: .95rem;
}

.u-choice.is-rec p > .u-ico {
  color: var(--u-theo);
}

.u-choice b {
  font-size: .84375rem;
  font-weight: 500;
}

.u-choice em {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
  color: var(--tone);
  font-size: .71875rem;
}

.u-choice > span {
  font-size: .75rem;
}

.u-rec {
  padding: .05rem .4rem;
  border: 1px solid var(--u-theo-line);
  border-radius: 999px;
  background: var(--u-card);
  color: var(--u-theo-text);
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.u-next {
  display: grid;
  gap: .3rem;
  padding: .75rem;
  border: 1px solid var(--u-theo-line);
  border-radius: 9px;
  background: var(--u-theo-wash);
}

.u-next .u-eyebrow {
  color: var(--u-theo-text);
}

.u-next > p:not([class]) {
  color: #fff;
  font-size: .875rem;
}

.u-next > span {
  font-size: .75rem;
}

.u-next__btns {
  display: flex;
  gap: .45rem;
  margin-top: .35rem;
}

.u-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .6rem;
  padding: .6rem .75rem;
  border: 1px solid color-mix(in srgb, var(--u-green) 30%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--u-green) 7%, transparent);
}

.u-done b {
  font-size: .8125rem;
  font-weight: 500;
}

.u-done > span:last-child {
  margin-left: auto;
  font-size: .71875rem;
}

.u-foot {
  color: var(--u-dim);
  font-size: .6875rem;
}

/* 5 THEO chat ------------------------------------------------------------- */

.ui-fig--chat {
  max-width: 25.5rem;
}

.ui--chat {
  border-radius: 22px;
  background: #0c1424;
}

.u-dock__head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--u-hair);
}

.u-dock__head div {
  min-width: 0;
}

.u-dock__head b {
  display: block;
  font-size: .875rem;
}

.u-dock__head div span {
  display: block;
  font-size: .71875rem;
}

.u-dock__head .u-btn {
  margin-left: auto;
}

.u-dock__body {
  display: grid;
  gap: .55rem;
  padding: .9rem;
}

.u-say {
  justify-self: start;
  max-width: 88%;
  padding: .55rem .75rem;
  border: 1px solid var(--u-line);
  border-radius: 16px 16px 16px 5px;
  background: var(--u-raised);
  color: var(--u-text);
}

.u-say.is-me {
  justify-self: end;
  border-color: transparent;
  border-radius: 16px 16px 5px 16px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #0b1222;
  font-weight: 500;
}

.u-say code {
  color: var(--u-theo-text);
}

.u-proof {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .6rem;
  border: 1px solid rgb(52 211 158 / .28);
  border-radius: 999px;
  background: rgb(52 211 158 / .1);
  color: var(--u-green);
  font-size: .71875rem;
}

.u-hold {
  display: grid;
  gap: .15rem;
  padding: .6rem .75rem;
  border: 1px solid rgb(245 158 11 / .45);
  border-radius: 12px;
  background: rgb(245 158 11 / .09);
}

.u-hold b {
  font-size: .8125rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.u-hold > span {
  color: #fbbf24;
  font-size: .75rem;
}

.u-hold p {
  display: flex;
  gap: .4rem;
  margin-top: .4rem;
}

/* Runbook card */
.u-run {
  padding: .75rem;
  border: 1px solid var(--u-hair);
  border-radius: 10px;
  background: rgb(15 23 42 / .6);
}

.u-run__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 .5rem;
  align-items: center;
}

.u-run__head span {
  color: rgb(255 255 255 / .6);
  font-size: .71875rem;
}

.u-run__head b {
  grid-column: 1;
  color: #fff;
  font-size: .8125rem;
  font-weight: 700;
}

.u-run__head em {
  grid-area: 1 / 2 / span 2;
  padding: .1rem .5rem;
  border: 1px solid rgb(16 185 129 / .4);
  border-radius: 4px;
  background: rgb(16 185 129 / .15);
  color: #86efac;
  font-size: .71875rem;
  font-weight: 700;
  letter-spacing: .025em;
}

.u-run__steps {
  position: relative;
  display: grid;
  gap: .5rem;
  margin-top: .7rem;
}

.u-run__steps::before {
  content: "";
  position: absolute;
  left: .47rem;
  top: .6rem;
  bottom: .9rem;
  width: 1px;
  background: rgb(255 255 255 / .1);
}

.u-run__steps li {
  position: relative;
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: .55rem;
}

.u-run__steps .u-ico {
  margin-top: .1rem;
  border-radius: 50%;
  background: #0f172a;
  color: #86efac;
  font-size: 1rem;
}

.u-run__steps b {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  color: #fff;
  font-size: .78125rem;
  font-weight: 500;
}

.u-run__steps b i {
  color: rgb(255 255 255 / .6);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 400;
}

.u-run__steps code {
  color: rgb(255 255 255 / .58);
}

.u-run__foot {
  display: flex;
  gap: .9rem;
  margin-top: .7rem;
  padding-top: .55rem;
  border-top: 1px solid var(--u-hair);
  color: rgb(255 255 255 / .62);
  font-size: .71875rem;
}

.u-dock__foot {
  padding: .7rem .9rem .8rem;
  border-top: 1px solid var(--u-hair);
}

.u-compose {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .4rem .4rem .8rem;
  border: 1px solid var(--u-line);
  border-radius: 16px;
  background: rgb(255 255 255 / .04);
}

.u-compose span {
  flex: 1;
}

.u-compose i {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #0b1222;
  font-size: 1rem;
}

.u-dock__foot > p:last-child {
  margin-top: .5rem;
  color: var(--u-dim);
  font-size: .65625rem;
  text-align: center;
}

/* 6 Motion ---------------------------------------------------------------- */
/* The finished picture is the resting state. With JavaScript, the parts of a drawing
   arrive in order when it scrolls into view. Without it, or with reduced motion, the
   whole drawing is simply there. */

@keyframes u-ping {
  0% {
    opacity: .7;
    transform: scale(.5);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

@keyframes u-state-1 {
  0%, 30% { opacity: 1; }
  34%, 100% { opacity: 0; }
}

@keyframes u-state-2 {
  0%, 30% { opacity: 0; }
  34%, 63% { opacity: 1; }
  67%, 100% { opacity: 0; }
}

@keyframes u-state-3 {
  0%, 63% { opacity: 0; }
  67%, 100% { opacity: 1; }
}

@keyframes u-seg-2 {
  0%, 30% { background: rgb(255 255 255 / .12); }
  34%, 100% { background: #818cf8; }
}

@keyframes u-seg-3 {
  0%, 63% { background: rgb(255 255 255 / .12); }
  67%, 100% { background: #10b981; }
}

.u-track.is-looping .u-track__state.is-1 {
  animation: u-state-1 10s linear infinite;
}

.u-track.is-looping .u-track__state.is-2 {
  animation: u-state-2 10s linear infinite;
}

.u-track.is-looping .u-track__state.is-3 {
  animation: u-state-3 10s linear infinite;
}

.u-track.is-looping .u-track__bar i:nth-child(2) {
  animation: u-seg-2 10s linear infinite;
}

.u-track.is-looping .u-track__bar i:nth-child(3) {
  animation: u-seg-3 10s linear infinite;
}

.u-track__bar i:nth-child(1) {
  background: #3b82f6;
}

.u-track__bar i:nth-child(2) {
  background: #818cf8;
}

.js .ui[data-reveal] [data-s] {
  opacity: 0;
  transform: translateY(.45rem);
  transition: opacity .45s ease, transform .6s var(--ease-out);
  transition-delay: calc(.35s + var(--s) * .3s);
}

.js .ui[data-reveal].is-in [data-s],
.js.show-all .ui [data-s] {
  opacity: 1;
  transform: none;
}

.js .ui[data-reveal] .u-meter b {
  transform: scaleX(0);
  transition: transform 1.2s var(--ease-out) 1.1s;
}

.js .ui[data-reveal].is-in .u-meter b,
.js.show-all .ui .u-meter b {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .ui[data-reveal] [data-s],
  .js .ui[data-reveal] .u-meter b {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .js .ui[data-reveal] [data-s],
  .js .ui[data-reveal] .u-meter b {
    opacity: 1;
    transform: none;
  }
}
