.boot-loader {
  --tl-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --tl-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --tl-font: 16px;
  --tl-color: #242522;
  --tl-glyph: #242522;
  --tl-settle: 350ms;
  --tl-blur: 2px;
  --tl-shimmer: 1.8s;
  --tl-done: 0.9;
  --tl-timer: 0.85;

  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 48px);
  background: #fafaf8;
  color: #242522;
  transform: translateY(0);
  transition: transform 900ms var(--tl-ease-out);
  will-change: transform;
  overflow: hidden;
}

.boot-loader.is-leaving {
  transform: translateY(-100%);
  pointer-events: none;
}

.boot-loader[hidden] {
  display: none !important;
}

.boot-loader__brand {
  position: absolute;
  top: clamp(56px, 14vh, 120px);
  left: 50%;
  z-index: 5;
  margin: 0;
  transform: translateX(-50%);
  font-family: var(--font, "Archivo", ui-sans-serif, system-ui, sans-serif);
  font-size: clamp(48px, 12vw, 96px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.95;
  color: #242522;
  white-space: nowrap;
  pointer-events: none;
}

.boot-loader__brand span {
  font-weight: 800;
  color: #3dd6c6;
}

.boot-loader__inner {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vw, 36px);
  text-align: center;
  width: min(36rem, 92vw);
  margin-top: clamp(72px, 16vh, 140px);
  pointer-events: none;
}

.web-threads {
  z-index: 0;
}

body.is-booting {
  overflow: hidden;
}

/* ThoughtLine (vanilla) */
.thought-line {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  color: #242522;
  font-family: inherit;
  font-size: var(--tl-font);
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  text-shadow: none;
}

.thought-line__head {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

.thought-line__glyph {
  display: inline-flex;
  flex: none;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.2em;
  color: var(--tl-glyph);
  opacity: 0.55;
}

.thought-line__glyph svg {
  display: block;
  width: 100%;
  height: 100%;
}

.thought-line[data-working] .thought-line__glyph {
  animation: thought-line-breath 1.6s var(--tl-ease-in-out) infinite;
}

.thought-line__label {
  display: inline-grid;
}

.thought-line__text {
  grid-area: 1 / 1;
  width: max-content;
  opacity: 0;
  transition: opacity var(--tl-settle) var(--tl-ease-out);
}

.thought-line__text[data-active] {
  opacity: 1;
}

.thought-line__text--done[data-active] {
  opacity: 1;
}

.thought-line__breath {
  display: inline-block;
}

.thought-line[data-working] .thought-line__breath[data-shimmer] {
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--tl-color) 50%, transparent) 30%,
    var(--tl-color) 50%,
    color-mix(in srgb, var(--tl-color) 50%, transparent) 70%
  );
  background-size: 250% 100%;
  background-position: 125% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: thought-line-shimmer var(--tl-shimmer) linear infinite;
}

@keyframes thought-line-shimmer {
  to { background-position: -125% 0; }
}

@keyframes thought-line-breath {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.thought-line__timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  opacity: 1;
  color: #242522;
}

.thought-line__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.thought-line__trace {
  display: grid;
  grid-template-rows: 1fr;
  width: 0;
  min-width: 100%;
  margin-top: 0.2em;
}

.thought-line__fold {
  min-height: 0;
  overflow: hidden;
}

.thought-line__steps {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  width: max-content;
  max-width: min(92vw, 28rem);
  padding: 0.7em 0 0.2em 1.6em;
  font-size: 0.875em;
  font-weight: 400;
  white-space: nowrap;
}

.thought-line__step {
  display: flex;
  align-items: center;
  gap: 0.5em;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 280ms var(--tl-ease-out),
    transform 280ms var(--tl-ease-out);
}

.thought-line__step[data-visible] {
  opacity: 1;
  transform: translateY(0);
}

.thought-line__mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 1em;
  height: 1em;
  opacity: 0.55;
}

.thought-line__pulse {
  display: block;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: currentColor;
  animation: thought-line-pulse 1.6s var(--tl-ease-in-out) infinite;
}

@keyframes thought-line-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.thought-line__check {
  width: 0.85em;
  height: 0.85em;
}

.thought-line__step-text {
  transition: opacity var(--tl-settle) ease;
  white-space: normal;
}

.thought-line__step[data-done] .thought-line__step-text {
  opacity: 1;
}

.boot-loader .thought-line,
.boot-loader .thought-line__step-text,
.boot-loader .thought-line__timer,
.boot-loader .thought-line__breath,
.boot-loader .thought-line__mark,
.boot-loader .thought-line__glyph {
  color: #242522 !important;
  -webkit-text-fill-color: #242522 !important;
}

.boot-loader .thought-line__glyph {
  opacity: 1;
  color: #3dd6c6 !important;
  -webkit-text-fill-color: #3dd6c6 !important;
}

.boot-loader .thought-line[data-working] .thought-line__glyph {
  animation: none;
}

.boot-loader .thought-line__steps {
  font-weight: 600;
  font-size: 0.95em;
  white-space: normal;
  width: min(100%, 22rem);
  padding-top: 0.45em;
  gap: 0.35em;
}

.boot-loader .thought-line__step-text {
  text-align: left;
}

@media (max-width: 760px) {
  .boot-loader__brand {
    top: clamp(48px, 10vh, 88px);
    font-size: clamp(40px, 11vw, 56px);
  }

  .boot-loader__inner {
    margin-top: clamp(64px, 14vh, 110px);
  }

  .boot-loader .thought-line__steps {
    max-height: 34vh;
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-loader {
    transition-duration: 200ms;
  }

  .thought-line__text {
    filter: none !important;
  }

  .thought-line[data-working] .thought-line__breath[data-shimmer] {
    animation: none;
    color: inherit;
    -webkit-text-fill-color: currentColor;
    background: none;
  }

  .thought-line[data-working] .thought-line__glyph,
  .thought-line__pulse {
    animation: none;
  }
}
