/* Living Logi — the product face. Teal circle, two eyes. Reusable. */

.logi-hd {
  --logi-teal: #5cf0de;
  --logi-ink: #071112;
  --logi-size: 300px;
  width: min(100%, 640px);
  margin-inline: auto;
}

.logi-hd-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(var(--logi-size) + 168px);
  padding: 64px 16px 56px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(92, 240, 222, 0.2), transparent 62%),
    radial-gradient(ellipse 90% 40% at 50% 100%, rgba(92, 240, 222, 0.1), transparent 70%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.04), transparent 42%),
    #071112;
  border: 1px solid rgba(92, 240, 222, 0.22);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.45);
}

.logi-hd-glow,
.logi-hd-glow-deep {
  position: absolute;
  left: 50%;
  top: 46%;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.logi-hd-glow {
  width: calc(var(--logi-size) * 1.35);
  height: calc(var(--logi-size) * 1.35);
  background: radial-gradient(circle, rgba(92, 240, 222, 0.72) 0%, rgba(92, 240, 222, 0.22) 38%, rgba(20, 196, 178, 0.05) 62%, transparent 74%);
  filter: blur(22px);
  animation: logi-hd-breathe 3.4s ease-in-out infinite;
}

.logi-hd-glow-deep {
  width: calc(var(--logi-size) * 1.85);
  height: calc(var(--logi-size) * 1.85);
  background: radial-gradient(circle, rgba(92, 240, 222, 0.28) 0%, rgba(8, 80, 74, 0.12) 46%, transparent 70%);
  filter: blur(36px);
  animation: logi-hd-breathe 3.4s ease-in-out infinite;
  animation-delay: -1.4s;
  opacity: 0.85;
}

.logi-hd-face {
  position: relative;
  z-index: 1;
  width: min(var(--logi-size), 72vw);
  height: min(var(--logi-size), 72vw);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 68% 78%, rgba(4, 48, 46, 0.28), rgba(4, 48, 46, 0) 36%),
    radial-gradient(circle at 50% 42%, #e7fffa 0%, #8ff7ea 18%, #5cf0de 46%, #14c4b2 78%, #087f74 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 -22px 34px rgba(4, 36, 34, 0.32),
    inset 0 14px 20px rgba(255, 255, 255, 0.28),
    0 28px 48px rgba(0, 0, 0, 0.5);
}

.logi-hd-eyes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.logi-hd-eye {
  position: absolute;
  top: 38%;
  width: 10%;
  height: 24%;
  border-radius: 999px;
  background: var(--logi-ink);
  transform-origin: center;
  animation: logi-hd-blink 5.6s ease-in-out infinite;
  box-shadow:
    inset 0 1px 0 rgba(92, 240, 222, 0.22),
    0 1px 1px rgba(0, 0, 0, 0.25);
}

.logi-hd-eye:first-child {
  left: 35%;
}

.logi-hd-eye:last-child {
  left: 55%;
  animation-delay: 0.05s;
}

.logi-hd-floor {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: calc(var(--logi-size) * 0.72);
  height: 22px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%);
  filter: blur(2px);
  pointer-events: none;
}

@keyframes logi-hd-breathe {
  0%,
  100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.96);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes logi-hd-blink {
  0%,
  88%,
  100% {
    transform: scaleY(1);
  }
  92% {
    transform: scaleY(0.08);
  }
  95.5% {
    transform: scaleY(1);
  }
}

body:has(.logi-float) {
  padding-bottom: 96px;
}

.logi-float.is-held {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.logi-float.is-in {
  animation: logi-arrive 0.95s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.logi-hello:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(18rem, calc(100vw - 108px));
  margin: 0;
  padding: 8px 8px 8px 14px;
  border-radius: 16px 16px 6px 16px;
  background: #0e1c1f;
  border: 1px solid rgba(92, 240, 222, 0.45);
  color: #f3f7f6;
  font-size: 1.0625rem;
  line-height: 1.4;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(92, 240, 222, 0.16);
  cursor: pointer;
}

.logi-hello[hidden] {
  display: none !important;
}

.logi-hello.is-zip {
  animation: logi-hello-in 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.logi-hello.is-out {
  animation: logi-hello-out 0.35s ease forwards;
}

.logi-hello-dismiss {
  flex: none;
  min-width: 48px;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #5cf0de;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

@keyframes logi-hello-in {
  0% {
    opacity: 0;
    transform: translate(28px, 18px) scale(0.82);
  }
  62% {
    opacity: 1;
    transform: translate(-6px, -4px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes logi-hello-out {
  to {
    opacity: 0;
    transform: translate(16px, 10px) scale(0.92);
  }
}

.logi-email .waitlist-form {
  display: flex;
  flex-direction: column;
}

@keyframes logi-arrive {
  0% {
    opacity: 0;
    transform: translate(72px, 110px) scale(0.35);
  }
  58% {
    opacity: 1;
    transform: translate(-14px, -16px) scale(1.08);
  }
  78% {
    transform: translate(5px, 6px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.logi-float {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.logi-float > * {
  pointer-events: auto;
}

.logi-panel {
  width: min(22.5rem, calc(100vw - 32px));
  max-height: min(32rem, calc(100dvh - 8.5rem));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  text-align: left;
  background: #0e1c1f;
  border: 1px solid rgba(92, 240, 222, 0.4);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.logi-panel[hidden] {
  display: none;
}

.logi-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logi-panel-name {
  margin: 0;
  font-family: "Familjen Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.logi-close {
  min-height: 48px;
  min-width: 48px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 2px solid rgba(92, 240, 222, 0.45);
  background: transparent;
  color: #5cf0de;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.logi-bubble {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #5cf0de url("/brand/logi-face.svg") center / cover no-repeat;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 0 0 3px rgba(92, 240, 222, 0.45),
    0 0 28px rgba(92, 240, 222, 0.7);
}

.logi-bubble-bob {
  display: block;
  width: 72px;
  height: 72px;
  animation: logi-invite 4.2s ease-in-out infinite;
}

.logi-float.is-open .logi-bubble-bob {
  animation: none;
}

.logi-bubble .logi-hd {
  width: 72px;
  height: 72px;
  margin: 0;
}

.logi-bubble .logi-hd-stage {
  min-height: 0;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.logi-bubble .logi-hd-floor,
.logi-bubble .logi-hd-glow-deep {
  display: none;
}

.logi-bubble .logi-hd-face {
  width: 72px;
  height: 72px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 -8px 14px rgba(4, 36, 34, 0.28);
}

.logi-bubble .logi-hd-eye {
  top: 40%;
  width: 18%;
  height: 20%;
  border-radius: 50%;
}

.logi-bubble .logi-hd-eye::after {
  content: "";
  position: absolute;
  top: 18%;
  left: 22%;
  width: 36%;
  height: 36%;
  border-radius: 50%;
  background: #ffffff;
}

.logi-bubble .logi-hd-eye:first-child {
  left: 28%;
}

.logi-bubble .logi-hd-eye:last-child {
  left: 54%;
}

.logi-chat {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.logi-greet,
.logi-line {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px 16px 6px 16px;
  background: #0e1c1f;
  border: 1px solid rgba(92, 240, 222, 0.35);
  font-size: 1.0625rem;
  line-height: 1.45;
}

.logi-greet[hidden] {
  display: none;
}

.logi-greet.is-in {
  animation: logi-greet-in 0.4s ease;
}

.logi-line.is-in {
  animation: logi-greet-in 0.4s ease;
}

.logi-line-you {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.16);
  color: #c9dbd7;
  border-radius: 16px 16px 16px 6px;
}

.logi-thread {
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: min(16rem, calc(100dvh - 18rem));
  overflow: auto;
  overscroll-behavior: contain;
}

.logi-thread:empty {
  display: none;
}

.logi-ask {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.logi-ask input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid rgba(92, 240, 222, 0.28);
  background: #0e1c1f;
  color: #f3f7f6;
  font: inherit;
  font-size: 1.0625rem;
}

.logi-ask .btn {
  flex: none;
}

.logi-line a {
  color: #5cf0de;
}

@keyframes logi-greet-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes logi-invite {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logi-hd-glow,
  .logi-hd-glow-deep,
  .logi-hd-eye,
  .logi-bubble-bob,
  .logi-greet.is-in {
    animation: none;
  }

  .logi-hd-glow {
    opacity: 0.72;
  }

  .logi-hd-eyes {
    transform: none !important;
  }
}
