html,
body {
  padding: 0;
  margin: 0;
}

body {
  background-color: #ffffff;
  background-image: url("./assets/grid.gif");
  background-repeat: repeat;
  background-attachment: fixed;
  --linkedin: 0;
  --entropy: 0;
  font-family: Times, "Times New Roman", Georgia, serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: calc(0.012 + var(--entropy) * 0.055);
  background-image: url("./assets/rotate.gif");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  z-index: 2;
  animation: time-dust 7.8s linear infinite;
}

/* Corporate infection mask (spreads from top-left). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  background:
    radial-gradient(
      circle at 0 0,
      rgba(10, 102, 194, 0.22) 0%,
      rgba(10, 102, 194, 0.12) 18%,
      rgba(243, 242, 239, 0.92) 48%,
      rgba(243, 242, 239, 0.98) 100%
    );
  -webkit-mask-image:
    radial-gradient(
      circle at 0 0,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 1) calc(var(--linkedin) * 160vmax),
      rgba(0, 0, 0, 0) calc(var(--linkedin) * 160vmax),
      rgba(0, 0, 0, 0) calc(var(--linkedin) * 160vmax + 18vmax)
    );
  mask-image:
    radial-gradient(
      circle at 0 0,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 1) calc(var(--linkedin) * 160vmax),
      rgba(0, 0, 0, 0) calc(var(--linkedin) * 160vmax),
      rgba(0, 0, 0, 0) calc(var(--linkedin) * 160vmax + 18vmax)
    );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

#cube-webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.14;
  mix-blend-mode: multiply;
  filter: saturate(1.05) contrast(1.05);
}

#cube-dust {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

@keyframes time-dust {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 96px -72px;
  }
}

blockquote {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 8px 10px 40px;
  --crush: 0;
  --time-shake-x: 0px;
  --time-shake-y: 0px;
  will-change: transform, filter;
  filter: contrast(calc(1 + var(--crush) * 0.06 + var(--entropy) * 0.1))
    saturate(calc(1 + var(--crush) * 0.08 + var(--entropy) * 0.12))
    hue-rotate(calc(var(--crush) * 8deg + var(--entropy) * 14deg))
    blur(calc(var(--entropy) * 0.28px));
  transform: translate3d(var(--time-shake-x), var(--time-shake-y), 0)
    rotate(calc(var(--entropy) * 0.1deg))
    skewX(calc(var(--crush) * 0.28deg))
    skewY(calc(var(--crush) * 0.12deg))
    scaleX(calc(1 - var(--crush) * 0.012))
    scaleY(calc(1 - var(--crush) * 0.008));
  transform-origin: top center;
}

blockquote::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: calc(var(--entropy) * 0.085);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.05) 0px,
      rgba(0, 0, 0, 0.05) 1px,
      rgba(255, 255, 255, 0) 3px,
      rgba(255, 255, 255, 0) 6px
    );
  mix-blend-mode: multiply;
  filter: contrast(1.06) saturate(1.05);
}

body.linkedin-virus blockquote {
  background: rgba(238, 246, 255, var(--linkedin));
  opacity: calc(1 - var(--linkedin) * 0.98);
  filter: contrast(calc(1.02 + var(--crush) * 0.06 + var(--entropy) * 0.1))
    saturate(calc(1.02 + var(--crush) * 0.08 + var(--entropy) * 0.12))
    hue-rotate(calc(var(--crush) * 8deg + var(--entropy) * 14deg))
    blur(calc(var(--entropy) * 0.28px + var(--linkedin) * 0.95px));
}

body.linkedin-virus blockquote {
  padding-top: calc(8px + var(--linkedin) * 56px);
}

#li-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 4;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  transform: translate3d(0, calc(-56px + var(--linkedin) * 56px), 0);
  opacity: calc(var(--linkedin) * 1);
  filter: saturate(1.05) contrast(1.02);
}

#li-bar .li-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

#li-bar .li-logo {
  font-weight: bold;
  letter-spacing: 0.02em;
  color: #0a66c2;
  font-style: italic;
  border: 2px solid rgba(10, 102, 194, 0.35);
  padding: 2px 6px;
  line-height: 1;
}

#li-bar .li-search {
  flex: 1;
  height: 26px;
  border-radius: 4px;
  background: rgba(10, 102, 194, 0.08);
  border: 1px solid rgba(10, 102, 194, 0.15);
}

#li-bar .li-tabs {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.7);
}

#li-rails {
  position: fixed;
  top: 56px;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  pointer-events: none;
  opacity: calc(var(--linkedin) * 1);
  filter: saturate(1.02) contrast(1.02);
}

#li-rails .rail {
  position: absolute;
  top: 0;
  bottom: 12px;
  width: min(320px, 28vw);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-style: normal;
}

#li-rails .rail.left {
  left: 0;
  transform: translate3d(calc(-360px + var(--linkedin) * 360px), 0, 0);
}

#li-rails .rail.right {
  right: 0;
  transform: translate3d(calc(360px - var(--linkedin) * 360px), 0, 0);
}

.li-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  padding: 10px 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.86);
  font-size: 12px;
  line-height: 1.2;
}

.li-card .li-title {
  font-weight: 700;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.86);
  margin-bottom: 6px;
}

.li-card .li-subtle {
  color: rgba(0, 0, 0, 0.62);
  font-size: 11px;
}

#li-feed {
  position: relative;
  max-width: 760px;
  margin: 10px auto 18px;
  padding: 0 10px;
  z-index: 3;
  opacity: calc(var(--linkedin) * 1);
  transform: translate3d(0, calc(-16px + var(--linkedin) * 16px), 0);
}

.li-post {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-style: normal;
  border-radius: 12px;
  overflow: hidden;
  transform: translateZ(0);
  animation: li-post-in 520ms ease-out both;
}

@keyframes li-post-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.99);
    filter: blur(1px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

.li-post .li-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.li-post .li-name {
  font-weight: 900;
  color: rgba(0, 0, 0, 0.86);
  font-size: 12px;
}

.li-post .li-tag {
  color: rgba(0, 0, 0, 0.58);
  font-size: 11px;
  white-space: nowrap;
}

.li-post .li-body {
  color: rgba(0, 0, 0, 0.78);
  font-size: 12px;
  line-height: 1.25;
}

.li-post .li-cta {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(10, 102, 194, 0.92);
  font-weight: 800;
  font-size: 11px;
}

.li-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid rgba(10, 102, 194, 0.22);
  background: rgba(10, 102, 194, 0.1);
  color: rgba(10, 102, 194, 0.92);
  font-weight: 700;
  font-size: 11px;
}

#li-modal {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: var(--li-modal, 0);
  transform: translate3d(0, calc(10px - var(--li-modal, 0) * 10px), 0);
}

#li-modal .li-dim {
  position: absolute;
  inset: 0;
  background: rgba(243, 242, 239, 0.72);
  backdrop-filter: blur(3px);
}

#li-modal .li-modal-inner {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(520px, 92vw);
  transform: translate3d(-50%, -50%, 0);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  padding: 14px 14px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: rgba(0, 0, 0, 0.86);
}

#li-modal .li-h {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
}

#li-modal .li-p {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.25;
  margin-bottom: 10px;
}

#li-modal .li-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#li-modal .li-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(10, 102, 194, 0.2);
  background: rgba(10, 102, 194, 0.92);
  color: white;
  font-weight: 800;
  font-size: 12px;
}

#li-modal .li-btn.secondary {
  background: rgba(255, 255, 255, 0.96);
  color: rgba(10, 102, 194, 0.92);
}

#li-chat {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  pointer-events: none;
  width: min(320px, 92vw);
  transform: translate3d(0, calc(120px - var(--li-chat, 0) * 120px), 0);
  opacity: var(--li-chat, 0);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#li-chat .li-chat-inner {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

#li-chat .li-chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(10, 102, 194, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#li-chat .li-chat-title {
  font-weight: 800;
  color: rgba(0, 0, 0, 0.82);
  font-size: 12px;
}

#li-chat .li-unread {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(10, 102, 194, 0.92);
  color: white;
  font-weight: 900;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

#li-chat .li-chat-body {
  padding: 8px 10px 10px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.78);
  line-height: 1.2;
}

#li-chat .li-chat-body .li-msg {
  padding: 8px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.07);
}

#cube-flash-stage {
  position: fixed;
  inset: 0;
  z-index: 2147482602;
  pointer-events: none;
  overflow: visible;
  mix-blend-mode: multiply;
}

.cube-flash {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  font-family: Times, "Times New Roman", Georgia, serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 153, 0.92);
  text-shadow:
    0.08em 0 0 rgba(255, 0, 0, 0.45),
    -0.08em 0 0 rgba(0, 0, 153, 0.32),
    0 0.12em 0 rgba(122, 59, 0, 0.22);
  filter: blur(0.06px);
  opacity: 0;
  animation: cube-flash 2.9s ease-out both;
}

@keyframes cube-flash {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.86) rotate(-2deg);
    letter-spacing: 0.22em;
    filter: blur(1.1px) saturate(1.25);
  }
  12% {
    opacity: 1;
    letter-spacing: 0.04em;
    filter: blur(0.06px) saturate(1.05);
  }
  65% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, calc(-50% - 18px), 0) scale(1.18) rotate(2.5deg);
    letter-spacing: 0.12em;
    filter: blur(1.2px) saturate(1.35);
  }
}

#li-toast-stage {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 4;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, 92vw);
}

.li-reaction-stage {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.li-react {
  position: fixed;
  left: 0;
  top: 0;
  font-size: 11px;
  font-weight: bold;
  font-style: italic;
  letter-spacing: 0.06em;
  color: rgba(10, 102, 194, 0.92);
  background: rgba(10, 102, 194, 0.12);
  border: 1px solid rgba(10, 102, 194, 0.22);
  border-radius: 999px;
  padding: 2px 8px;
  transform: translate3d(var(--x, -40px), var(--y, -40px), 0) scale(0.92);
  opacity: 0;
  animation: li-react 2.8s ease-out both;
  filter: blur(0.08px) saturate(1.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

@keyframes li-react {
  0% {
    opacity: 0;
    transform: translate3d(var(--x, -40px), var(--y, -40px), 0) scale(0.9);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(
        calc(var(--x, -40px) + var(--dx, 0px)),
        calc(var(--y, -40px) + var(--dy, -80px)),
        0
      )
      scale(1.18);
    filter: blur(0.8px) saturate(1.3);
  }
}

.li-toast {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(0, 0, 0, 0.82);
  font-size: 12px;
  line-height: 1.15;
  transform: translate3d(0, 8px, 0) scale(0.98);
  opacity: 0;
  animation: li-toast-in 360ms ease-out forwards, li-toast-out 420ms ease-in forwards;
  animation-delay: 0ms, var(--ttl, 3600ms);
}

@keyframes li-toast-in {
  to {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
}

@keyframes li-toast-out {
  to {
    transform: translate3d(0, -10px, 0) scale(0.98);
    opacity: 0;
    filter: blur(1px);
  }
}

a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

a:link {
  color: #53813c;
}

a:visited {
  color: #ff191c;
}

a:hover {
  background: #ffff66;
}

a:active {
  color: #ffffff;
  background: #000000;
}

hr {
  border: 0;
  border-top: 3px double #000;
  margin: 10px 0;
}

pre.codebox {
  margin: 10px 0;
  padding: 10px 12px;
  border: 3px double #000;
  background: #ffffcc;
  color: #000000;
  font-family: inherit;
  font-style: italic;
  font-size: 15px;
  line-height: 1.2;
  white-space: pre;
  overflow-x: auto;
}

@media (max-width: 640px) {
  pre.codebox {
    font-size: 12px;
  }
}

/* Chaotic sizes: sometimes tiny, sometimes huge. */
pre.codebox.tiny {
  font-size: 11px;
}
pre.codebox.small {
  font-size: 13px;
}
pre.codebox.big {
  font-size: 18px;
}
pre.codebox.huge {
  font-size: 24px;
  line-height: 1.1;
}

/* Syntax colors (Time Cube palette-ish). */
pre.codebox .tok-kw {
  color: var(--tok-kw, #ff0000);
  font-weight: bold;
}
pre.codebox .tok-id {
  color: var(--tok-id, #000099);
}
pre.codebox .tok-type {
  color: var(--tok-type, #7a3b00);
  font-weight: bold;
}
pre.codebox .tok-str {
  color: var(--tok-str, #ff191c);
}
pre.codebox .tok-num {
  color: var(--tok-num, #000075);
  font-weight: bold;
}
pre.codebox .tok-com {
  color: var(--tok-com, #666666);
}
pre.codebox .tok-op {
  color: var(--tok-op, #000000);
}
pre.codebox .tok-punc {
  color: var(--tok-punc, #000000);
}

/* “Random” schemes via CSS variables. */
pre.codebox.chaos-a {
  --tok-kw: #ff0000;
  --tok-id: #000099;
  --tok-type: #7a3b00;
  --tok-str: #ff191c;
  --tok-num: #000075;
  --tok-com: #333333;
}
pre.codebox.chaos-b {
  --tok-kw: #000099;
  --tok-id: #7a3b00;
  --tok-type: #ff0000;
  --tok-str: #000075;
  --tok-num: #ff191c;
  --tok-com: #333333;
}
pre.codebox.chaos-c {
  --tok-kw: #7a3b00;
  --tok-id: #000075;
  --tok-type: #000099;
  --tok-str: #ff0000;
  --tok-num: #ff191c;
  --tok-com: #333333;
}
pre.codebox.chaos-d {
  --tok-kw: #ff191c;
  --tok-id: #000099;
  --tok-type: #000000;
  --tok-str: #7a3b00;
  --tok-num: #000075;
  --tok-com: #333333;
}

.blink {
  animation: blink 0.9s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.shake {
  display: inline-block;
  animation: shake 0.12s infinite;
}

@keyframes shake {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(-1px, 1px) rotate(-0.4deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(0.4deg);
  }
  60% {
    transform: translate(-1px, -1px) rotate(0.2deg);
  }
  80% {
    transform: translate(1px, 1px) rotate(-0.2deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

.rainbow {
  animation: rainbow 1.9s linear infinite;
}

@keyframes rainbow {
  0% {
    color: #ff0000;
  }
  16% {
    color: #ff7a00;
  }
  33% {
    color: #ffd000;
  }
  50% {
    color: #00a000;
  }
  66% {
    color: #0066ff;
  }
  83% {
    color: #7a00ff;
  }
  100% {
    color: #ff0000;
  }
}

.invert {
  background: #000000;
  color: #ffffff;
  padding: 0 4px;
}

.time-jiggle,
.time-wobble,
.time-sink,
.time-magnet,
.time-drift {
  display: inline-block;
  position: relative;
  transform: translateZ(0);
  will-change: transform, left, top, filter;
}

.time-jiggle {
  animation: time-jiggle var(--jiggle-dur, 1.25s) ease-in-out infinite;
}

.time-wobble {
  animation: time-wobble var(--twobble-dur, 3.9s) ease-in-out infinite;
}

.time-sink {
  animation: time-sink var(--sink-dur, 2.85s) ease-in-out infinite;
  filter: saturate(1.06);
}

.time-magnet.active {
  z-index: 3;
  filter: saturate(1.12) contrast(1.08);
  text-shadow:
    0.05em 0 0 rgba(255, 0, 0, 0.42),
    -0.05em 0 0 rgba(0, 0, 153, 0.34),
    0 0.09em 0 rgba(122, 59, 0, 0.28);
}

.time-rewrite {
  background: rgba(255, 255, 102, 0.34);
  border: 1px dotted rgba(0, 0, 0, 0.42);
  padding: 0 1px;
}

@keyframes time-jiggle {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-0.6px, 0.4px) rotate(-0.45deg);
  }
  50% {
    transform: translate(0.7px, -0.5px) rotate(0.35deg);
  }
  75% {
    transform: translate(-0.4px, -0.6px) rotate(0.25deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes time-wobble {
  0% {
    transform: translate(0, 0) rotate(0deg) skewX(0deg);
  }
  20% {
    transform: translate(0.6px, -0.3px) rotate(-0.8deg) skewX(0.25deg);
  }
  48% {
    transform: translate(-0.5px, 0.4px) rotate(0.65deg) skewX(-0.2deg);
  }
  70% {
    transform: translate(0.35px, 0.6px) rotate(-0.5deg) skewX(0.2deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg) skewX(0deg);
  }
}

@keyframes time-sink {
  0% {
    transform: translateY(0) scaleY(1);
    letter-spacing: 0;
  }
  40% {
    transform: translateY(0.6px) scaleY(0.98);
    letter-spacing: 0.02em;
  }
  60% {
    transform: translateY(-0.4px) scaleY(1.02);
    letter-spacing: -0.01em;
  }
  100% {
    transform: translateY(0) scaleY(1);
    letter-spacing: 0;
  }
}

.glitch-word {
  display: inline-block;
  position: relative;
  transform: translateZ(0);
  will-change: transform, filter;
  --near: 0;
  --near-scale: 0.65;
  --swap-x: 0px;
  --swap-y: 0px;
  --swap-r: 0deg;
  translate: var(--swap-x) var(--swap-y);
  rotate: var(--swap-r);
  transition: opacity 220ms ease, filter 260ms ease;
  text-shadow:
    0.02em 0 0 rgba(255, 0, 0, 0.18),
    -0.02em 0 0 rgba(0, 0, 153, 0.18),
    0 0.03em 0 rgba(122, 59, 0, 0.14);
}

.plain-word {
  display: inline-block;
  position: relative;
  transform: translateZ(0);
  will-change: opacity, filter, transform;
  --swap-x: 0px;
  --swap-y: 0px;
  --swap-r: 0deg;
  translate: var(--swap-x) var(--swap-y);
  rotate: var(--swap-r);
  transition: opacity 240ms ease, filter 240ms ease;
}

.slop-infected {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  color: rgba(10, 102, 194, 0.92);
  background: rgba(10, 102, 194, 0.12);
  border-radius: 4px;
  padding: 0 1px;
  box-shadow: 0 0 0 1px rgba(10, 102, 194, 0.08) inset;
  filter: saturate(1.12) contrast(1.06);
  transition:
    background-color 260ms ease,
    color 260ms ease,
    box-shadow 260ms ease,
    filter 260ms ease,
    opacity 260ms ease;
}

.slop-infected.slop-pop {
  animation: slop-pop 520ms cubic-bezier(0.18, 0.9, 0.16, 1) both;
}

@keyframes slop-pop {
  0% {
    opacity: 0.68;
    filter: blur(1.1px) saturate(1.35) contrast(1.1);
    scale: 0.92;
    letter-spacing: 0.16em;
  }
  45% {
    opacity: 1;
    filter: blur(0.05px) saturate(1.18) contrast(1.06);
    scale: 1.06;
    letter-spacing: 0.02em;
  }
  100% {
    opacity: 1;
    filter: blur(0) saturate(1.12) contrast(1.06);
    scale: 1;
    letter-spacing: 0;
  }
}

.truth-pop {
  animation: truth-pop 700ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes truth-pop {
  0% {
    opacity: 0.65;
    filter: blur(1.2px) saturate(1.35) contrast(1.08) hue-rotate(-12deg);
    scale: 0.94;
    letter-spacing: 0.18em;
    text-shadow:
      0.1em 0 0 rgba(255, 0, 0, 0.38),
      -0.1em 0 0 rgba(0, 0, 153, 0.28),
      0 0.12em 0 rgba(122, 59, 0, 0.22);
  }
  40% {
    opacity: 1;
    filter: blur(0.06px) saturate(1.12) contrast(1.06) hue-rotate(0deg);
    scale: 1.08;
    letter-spacing: 0.03em;
  }
  100% {
    opacity: 1;
    filter: blur(0) saturate(1.02) contrast(1);
    scale: 1;
    letter-spacing: 0;
  }
}

.slop-infected::selection {
  background: rgba(10, 102, 194, 0.35);
  color: #ffffff;
}

.glitch-word.swap-active {
  filter: contrast(1.18) saturate(1.22);
}

.glitch-word.lang-fade {
  opacity: 0;
  filter: blur(0.9px) saturate(1.8) contrast(1.28) hue-rotate(15deg);
}

#phrase-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2147482402;
  overflow: visible;
  mix-blend-mode: multiply;
}

.phrase-pulse {
  position: fixed;
  left: 0;
  top: 0;
  font-style: italic;
  font-weight: bold;
  letter-spacing: 0.02em;
  color: rgba(0, 0, 153, 0.88);
  text-shadow:
    0.06em 0 0 rgba(255, 0, 0, 0.45),
    -0.06em 0 0 rgba(0, 0, 153, 0.35),
    0 0.09em 0 rgba(122, 59, 0, 0.28);
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotate(var(--pr, 0deg));
  animation: phrase-pulse 1.95s ease-in-out both;
  filter: blur(0.15px);
}

@keyframes phrase-pulse {
  0% {
    opacity: 0;
    transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotate(var(--pr, 0deg)) scale(0.86);
    letter-spacing: 0.22em;
    filter: blur(1.1px) saturate(1.35) contrast(1.15);
  }
  14% {
    opacity: 1;
    letter-spacing: 0.03em;
    filter: blur(0.05px) saturate(1.12) contrast(1.08);
  }
  58% {
    opacity: 0.94;
  }
  100% {
    opacity: 0;
    transform: translate3d(
        calc(var(--px, 0px) + var(--dx, 0px)),
        calc(var(--py, 0px) + var(--dy, 0px)),
        0
      )
      rotate(calc(var(--pr, 0deg) + 9deg))
      scale(1.22);
    letter-spacing: 0.14em;
    filter: blur(0.75px) saturate(1.4) contrast(1.2);
  }
}

.glitch-word.g1 {
  --wobble-dur: 6.1s;
  --flicker-dur: 4.9s;
  --stutter-dur: 6.7s;
}
.glitch-word.g2 {
  --wobble-dur: 7.9s;
  --flicker-dur: 5.6s;
  --stutter-dur: 7.8s;
}
.glitch-word.g3 {
  --wobble-dur: 9.6s;
  --flicker-dur: 6.4s;
  --stutter-dur: 9.1s;
}
.glitch-word.g4 {
  --wobble-dur: 5.2s;
  --flicker-dur: 4.3s;
  --stutter-dur: 5.9s;
}

.glitch-word.mangle {
  filter: contrast(1.08) saturate(1.08);
}

.glitch-word.fx-wobble {
  animation: glitch-wobble var(--wobble-dur, 7.5s) ease-in-out infinite;
}

.glitch-word.fx-flicker {
  animation: glitch-flicker var(--flicker-dur, 5.2s) steps(1, end) infinite;
}

.glitch-word.fx-stutter {
  animation: glitch-stutter var(--stutter-dur, 7.2s) steps(2, end) infinite;
}

.glitch-word.fx-split {
  text-shadow:
    0.05em 0 0 rgba(255, 0, 0, 0.28),
    -0.05em 0 0 rgba(0, 0, 153, 0.28),
    0 0.06em 0 rgba(122, 59, 0, 0.16);
  filter: saturate(1.06) contrast(1.04);
}

.glitch-word.fx-bleed {
  filter: blur(0.18px) saturate(1.05);
  animation: glitch-bleed 8.8s ease-in-out infinite;
}

.glitch-word.fx-scramble {
  border-bottom: 1px dotted rgba(0, 0, 0, 0.55);
  text-shadow:
    0.03em 0 0 rgba(0, 0, 153, 0.22),
    -0.03em 0 0 rgba(255, 0, 0, 0.18);
}

.glitch-word.fx-echo::after {
  content: attr(data-orig);
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: var(--near);
  transform: translate(0.08em, -0.06em) scale(var(--near-scale));
  color: rgba(0, 0, 153, 0.58);
  text-shadow:
    0.06em 0 0 rgba(255, 0, 0, 0.22),
    0 0.08em 0 rgba(122, 59, 0, 0.18);
  filter: blur(0.12px);
}

.glitch-word.fx-aura::before,
.glitch-word.fx-aura::after {
  position: absolute;
  top: 50%;
  pointer-events: none;
  opacity: var(--near);
  transform: translateY(-50%) scale(var(--near-scale));
  font-size: 0.95em;
  letter-spacing: 0.08em;
  filter: blur(0.1px);
  text-shadow:
    0.06em 0 0 rgba(255, 0, 0, 0.22),
    -0.06em 0 0 rgba(0, 0, 153, 0.22),
    0 0.1em 0 rgba(122, 59, 0, 0.16);
}

.glitch-word.fx-aura::before {
  content: attr(data-aura-l);
  right: 100%;
  margin-right: 0.14em;
  color: rgba(255, 0, 0, 0.6);
}

.glitch-word.fx-aura::after {
  content: attr(data-aura-r);
  left: 100%;
  margin-left: 0.14em;
  color: rgba(122, 59, 0, 0.6);
}

.glitch-word.near-mouse,
.glitch-word:hover {
  animation: glitch-jitter 0.32s steps(2, end) infinite;
  text-shadow:
    0.06em 0 0 rgba(255, 0, 0, 0.55),
    -0.06em 0 0 rgba(0, 0, 153, 0.55),
    0 0.09em 0 rgba(122, 59, 0, 0.35);
  filter: contrast(1.14) saturate(1.14);
}

@keyframes glitch-wobble {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  18% {
    transform: translate(0.25px, -0.15px) rotate(-0.15deg);
  }
  37% {
    transform: translate(-0.2px, 0.2px) rotate(0.12deg);
  }
  58% {
    transform: translate(0.18px, 0.25px) rotate(-0.08deg);
  }
  79% {
    transform: translate(-0.22px, -0.18px) rotate(0.1deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes glitch-flicker {
  0% {
    opacity: 1;
  }
  7% {
    opacity: 0.95;
  }
  8% {
    opacity: 1;
  }
  19% {
    opacity: 1;
  }
  20% {
    opacity: 0.9;
  }
  21% {
    opacity: 1;
  }
  53% {
    opacity: 1;
  }
  54% {
    opacity: 0.92;
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

@keyframes glitch-stutter {
  0% {
    transform: translate(0, 0) scaleX(1);
  }
  2% {
    transform: translate(-0.6px, 0.2px) scaleX(1.05);
  }
  3% {
    transform: translate(0, 0) scaleX(1);
  }
  47% {
    transform: translate(0, 0) scaleX(1);
  }
  49% {
    transform: translate(0.7px, -0.3px) scaleX(0.96);
  }
  50% {
    transform: translate(0, 0) scaleX(1);
  }
  88% {
    transform: translate(0, 0) scaleX(1);
  }
  90% {
    transform: translate(-0.5px, 0.4px) scaleX(1.06);
  }
  91% {
    transform: translate(0, 0) scaleX(1);
  }
  100% {
    transform: translate(0, 0) scaleX(1);
  }
}

@keyframes glitch-bleed {
  0% {
    filter: blur(0.18px) saturate(1.05);
  }
  40% {
    filter: blur(0.12px) saturate(1.02);
  }
  55% {
    filter: blur(0.22px) saturate(1.08);
  }
  100% {
    filter: blur(0.18px) saturate(1.05);
  }
}

@keyframes glitch-jitter {
  0% {
    transform: translate(0, 0) rotate(0deg) skewX(0deg);
  }
  12% {
    transform: translate(-1px, 0.5px) rotate(-0.8deg) skewX(0.6deg);
  }
  25% {
    transform: translate(1px, -0.5px) rotate(0.6deg) skewX(-0.4deg);
  }
  50% {
    transform: translate(-0.7px, -1px) rotate(-0.4deg) skewX(0.5deg);
  }
  72% {
    transform: translate(0.8px, 1px) rotate(0.8deg) skewX(-0.6deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg) skewX(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  #cube-webgl {
    display: none;
  }

  .glitch-word,
  .time-jiggle,
  .time-wobble,
  .time-sink,
  .glitch-word.near-mouse,
  .glitch-word:hover {
    animation: none;
  }
}

.link-explosion-stage {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  overflow: visible;
  opacity: 1;
  transition: opacity 260ms ease, filter 260ms ease;
}

.link-explosion-stage.fade-out {
  opacity: 0;
  filter: blur(2px) saturate(1.12) contrast(1.02);
}

.exploding-link {
  position: fixed;
  left: 0;
  top: 0;
  display: inline-block;
  max-width: 92vw;
  white-space: normal;
  line-height: 1.05;
  pointer-events: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  filter: drop-shadow(0.06em 0 rgba(255, 0, 0, 0.28))
    drop-shadow(-0.06em 0 rgba(0, 0, 153, 0.22))
    drop-shadow(0 0.08em rgba(122, 59, 0, 0.16));
}

.exploding-link.burst {
  animation: link-burst 0.22s ease-out both;
}

@keyframes link-burst {
  0% {
    letter-spacing: 0.12em;
    opacity: 0.96;
    filter: drop-shadow(0.09em 0 rgba(255, 0, 0, 0.5))
      drop-shadow(-0.09em 0 rgba(0, 0, 153, 0.36))
      drop-shadow(0 0.12em rgba(122, 59, 0, 0.26));
  }
  100% {
    letter-spacing: 0em;
    opacity: 1;
    filter: drop-shadow(0.06em 0 rgba(255, 0, 0, 0.28))
      drop-shadow(-0.06em 0 rgba(0, 0, 153, 0.22))
      drop-shadow(0 0.08em rgba(122, 59, 0, 0.16));
  }
}

#chatter-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2147482501;
  overflow: hidden;
}

#chatter-cube {
  position: fixed;
  left: 0;
  top: 0;
  width: 66px;
  height: 66px;
  pointer-events: none;
  z-index: 2147482500;
  transform: translate3d(var(--cx, -200px), var(--cy, -200px), 0) rotate(var(--cr, 0deg));
  transform-origin: 50% 50%;
  will-change: transform, filter;
  filter: saturate(1.12) contrast(1.1);
}

#chatter-cube img {
  width: 100%;
  height: 100%;
  display: block;
  border: 3px double #000;
  background: #ffffcc;
}

#chatter-cube.active {
  animation: cube-chatter 0.12s steps(2, end) infinite;
}

#chatter-cube::after {
  content: "CUBE";
  position: absolute;
  left: 50%;
  top: -16px;
  transform: translateX(-50%) rotate(-2deg);
  font-weight: bold;
  font-style: italic;
  color: #ff0000;
  background: rgba(255, 255, 102, 0.36);
  border: 1px dotted rgba(0, 0, 0, 0.45);
  padding: 0 3px;
}

@keyframes cube-chatter {
  0% {
    filter: saturate(1.1) contrast(1.1);
    transform: translate3d(var(--cx, -200px), var(--cy, -200px), 0) rotate(var(--cr, 0deg))
      scale(1);
  }
  50% {
    filter: saturate(1.25) contrast(1.18);
    transform: translate3d(
        calc(var(--cx, -200px) + 1px),
        calc(var(--cy, -200px) - 1px),
        0
      )
      rotate(calc(var(--cr, 0deg) + 2deg))
      scale(1.03);
  }
  100% {
    filter: saturate(1.1) contrast(1.1);
    transform: translate3d(var(--cx, -200px), var(--cy, -200px), 0) rotate(var(--cr, 0deg))
      scale(1);
  }
}

.chatter-word {
  position: fixed;
  left: 0;
  top: 0;
  display: inline-block;
  pointer-events: none;
  white-space: nowrap;
  font-family: inherit;
  font-style: italic;
  font-weight: bold;
  letter-spacing: 0.02em;
  padding: 0 2px;
  text-shadow:
    0.06em 0 0 rgba(255, 0, 0, 0.35),
    -0.06em 0 0 rgba(0, 0, 153, 0.28),
    0 0.09em 0 rgba(122, 59, 0, 0.22);
  will-change: transform, opacity, filter;
}

.chatter-word.cw-a {
  color: #ff0000;
}
.chatter-word.cw-b {
  color: #000099;
}
.chatter-word.cw-c {
  color: #7a3b00;
}
.chatter-word.cw-d {
  color: #ff191c;
}
.chatter-word.cw-e {
  color: #000075;
}

.chatter-word.big {
  font-size: 26px;
}
.chatter-word.mid {
  font-size: 18px;
}
.chatter-word.small {
  font-size: 13px;
}
.chatter-word.tiny {
  font-size: 11px;
}
