/* Thought Line motion, adapted for the static Resty landing page.
   Reference: https://reactbits.dev/micro/thought-line */
html.is-loading .cookie-banner { visibility: hidden; }

.thought-line {
  --thought-ease: cubic-bezier(.23, 1, .32, 1);
  --thought-logo-width: 40px;
  --thought-label-offset: calc(var(--thought-logo-width) + 12px);
  width: min(320px, 100%);
  color: #f5f5f5;
  font: 500 18px/1.4 var(--font-body);
}

.thought-line-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 0 3px 0 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.thought-line-head:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; border-radius: 4px; }
.thought-line-glyph { display: block; flex: 0 0 var(--thought-logo-width); width: var(--thought-logo-width); height: auto; margin-right: 4px; object-fit: contain; }
.thought-line[data-working="true"] .thought-line-glyph { animation: thought-breathe 1.6s cubic-bezier(.77, 0, .175, 1) infinite; }
.thought-line-label { display: inline-grid; min-width: 0; }
.thought-line-working, .thought-line-done { grid-area: 1 / 1; min-width: 0; transition: opacity 350ms var(--thought-ease), filter 350ms var(--thought-ease); }
.thought-line-working {
  background: linear-gradient(100deg, rgb(245 245 245 / 50%) 30%, #f5f5f5 50%, rgb(245 245 245 / 50%) 70%);
  background-size: 250% 100%;
  background-position: 125% 0;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: thought-shimmer 1.8s linear infinite;
}
.thought-line-done { opacity: 0; filter: blur(2px); }
.thought-line-timer { flex: 0 0 auto; min-width: 3.5em; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .55; transition: opacity 350ms ease; }
.thought-line-chevron { flex: 0 0 .8em; width: .8em; height: .8em; opacity: .55; transition: transform 350ms var(--thought-ease); }
.thought-line[data-open="true"] .thought-line-chevron { transform: rotate(180deg); }
.thought-line-trace { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 350ms var(--thought-ease); }
.thought-line[data-open="true"] .thought-line-trace { grid-template-rows: 1fr; }
.thought-line-fold { min-height: 0; overflow: hidden; }
.thought-line-steps { display: flex; flex-direction: column; gap: .55em; margin: 0; padding: .4em 0 .2em var(--thought-label-offset); list-style: none; font-size: 14px; font-weight: 400; }
.thought-line-step { position: relative; display: flex; align-items: baseline; animation: thought-step-in 200ms var(--thought-ease) both; }
.thought-line-step::before { position: absolute; top: .2em; left: -1.65em; width: 1em; height: 1em; content: ""; }
.thought-line-step[data-state="active"]::before { background: radial-gradient(circle, currentColor 0 23%, transparent 26%); animation: thought-breathe 1.6s ease-in-out infinite; }
.thought-line-step[data-state="done"]::before { background: currentColor; clip-path: polygon(13% 48%, 23% 38%, 43% 58%, 77% 24%, 87% 34%, 43% 78%); opacity: .55; }
.thought-line-step[data-state="background"]::before { background: radial-gradient(circle, currentColor 0 18%, transparent 21%); opacity: .55; }
.thought-line-step-text { min-width: 0; overflow-wrap: anywhere; transition: opacity 350ms ease; }
.thought-line-step[data-state="done"] .thought-line-step-text { opacity: .55; }
.thought-line[data-working="false"] .thought-line-glyph { opacity: .55; }
.thought-line[data-working="false"] .thought-line-working { opacity: 0; filter: blur(2px); animation: none; }
.thought-line[data-working="false"] .thought-line-done { opacity: .75; filter: none; }
.thought-line[data-working="false"] .thought-line-timer { opacity: .75; }
.thought-line-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@keyframes thought-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes thought-shimmer { to { background-position: -125% 0; } }
@keyframes thought-step-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  .thought-line { width: min(288px, 100%); }
}

@media (prefers-reduced-motion: reduce) {
  .thought-line *, .thought-line *::before { animation: none !important; transition: none !important; filter: none !important; }
  .thought-line-working { background: none; color: inherit; -webkit-text-fill-color: currentColor; }
}
