/* ASD G.O.A.T. DANCE — FAQ chat widget (dark/gold) */
.goat-chat-root {
  --gc-bg: #121214;
  --gc-bg2: #1a1a1c;
  --gc-gold: #c9a56a;
  --gc-gold2: #e0c48a;
  --gc-text: #f3efe6;
  --gc-muted: #a39a8c;
  --gc-line: rgba(201, 165, 106, 0.28);
  --gc-bot: rgba(201, 165, 106, 0.12);
  --gc-user: rgba(37, 211, 102, 0.12);
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 70;
  font-family: Outfit, system-ui, sans-serif;
  pointer-events: none;
}
.goat-chat-root * { box-sizing: border-box; }
.goat-chat-fab {
  pointer-events: auto;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 1px solid var(--gc-line);
  background: linear-gradient(180deg, var(--gc-gold2), var(--gc-gold));
  color: #111;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: grid; place-items: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.goat-chat-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,.5); }
.goat-chat-fab[aria-expanded="true"] { background: #1a1a1c; color: var(--gc-gold2); }

.goat-chat-panel {
  pointer-events: auto;
  display: none;
  position: absolute;
  left: 0;
  bottom: 70px;
  width: min(320px, calc(100vw - 28px));
  height: min(440px, calc(100vh - 120px));
  height: min(440px, calc(100dvh - 120px));
  background: linear-gradient(180deg, var(--gc-bg2), var(--gc-bg));
  border: 1px solid var(--gc-line);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  flex-direction: column;
  overflow: hidden;
  color: var(--gc-text);
}
.goat-chat-root.is-open .goat-chat-panel { display: flex; }

.goat-chat-teaser {
  pointer-events: none;
  position: absolute;
  left: 0;
  bottom: 70px;
  width: min(350px, calc(100vw - 28px));
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 12px 14px 14px;
  border: 1px solid var(--gc-line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--gc-bg2), var(--gc-bg));
  color: var(--gc-text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.97);
}
.goat-chat-root.teaser-visible .goat-chat-teaser {
  pointer-events: auto;
  visibility: visible;
  animation: goatChatTeaserIn .45s cubic-bezier(.22, .61, .36, 1) forwards;
}
.goat-chat-root.teaser-visible .goat-chat-fab {
  animation: goatChatFabPulse 1.8s ease-in-out .25s both;
}
.goat-chat-teaser::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -7px;
  width: 13px;
  height: 13px;
  background: var(--gc-bg);
  border-right: 1px solid var(--gc-line);
  border-bottom: 1px solid var(--gc-line);
  transform: rotate(45deg);
}
.goat-chat-teaser-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gc-gold2), var(--gc-gold));
  color: #111;
  font-size: 16px;
  box-shadow: 0 0 0 5px rgba(201, 165, 106, .09);
}
.goat-chat-teaser-copy {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.goat-chat-teaser-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
.goat-chat-teaser-cta {
  margin-top: 9px;
  padding: 6px 11px;
  border: 1px solid var(--gc-line);
  border-radius: 999px;
  background: transparent;
  color: var(--gc-gold2);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.goat-chat-teaser-cta:hover { background: rgba(201, 165, 106, .18); }
.goat-chat-teaser-x {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--gc-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.goat-chat-teaser-x:hover { color: var(--gc-gold2); }

@keyframes goatChatTeaserIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes goatChatFabPulse {
  0%, 100% { transform: scale(1); }
  22% { transform: scale(1.1); }
  42% { transform: scale(1); }
}

.goat-chat-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--gc-line);
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(10, 8, 6, 0.55);
}
.goat-chat-head-text { flex: 1; min-width: 0; }
.goat-chat-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px; font-weight: 500; color: var(--gc-gold2);
  line-height: 1.15;
}
.goat-chat-head p {
  margin: 4px 0 0;
  font-size: 12px; color: var(--gc-muted); letter-spacing: .02em;
}
.goat-chat-x {
  background: transparent; border: 0; color: var(--gc-muted);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px;
}
.goat-chat-x:hover { color: var(--gc-gold2); }

.goat-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.goat-chat-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--gc-line);
}
.goat-chat-msg.bot { align-self: flex-start; background: var(--gc-bot); color: var(--gc-text); }
.goat-chat-msg.user { align-self: flex-end; background: var(--gc-user); border-color: rgba(37,211,102,.35); }
.goat-chat-msg.typing { opacity: .7; font-style: italic; color: var(--gc-muted); }

.goat-chat-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}
.goat-chat-actions a, .goat-chat-actions button {
  pointer-events: auto;
  font: inherit;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #111;
  background: linear-gradient(180deg, var(--gc-gold2), var(--gc-gold));
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.goat-chat-actions a.ghost, .goat-chat-actions button.ghost {
  background: transparent;
  color: var(--gc-gold2);
  border: 1px solid var(--gc-line);
}

.goat-chat-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 14px 10px;
}
.goat-chat-chips button {
  font: inherit;
  font-size: 12px;
  color: var(--gc-gold2);
  background: rgba(10, 8, 6, 0.65);
  border: 1px solid var(--gc-line);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
}
.goat-chat-chips button:hover { background: rgba(201,165,106,.18); }

.goat-chat-form {
  display: flex; gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--gc-line);
  background: rgba(10, 8, 6, 0.45);
}
.goat-chat-form input[type="text"] {
  flex: 1;
  min-width: 0;
  background: #0b0b0c;
  border: 1px solid var(--gc-line);
  border-radius: 12px;
  color: var(--gc-text);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.goat-chat-form input::placeholder { color: var(--gc-muted); }
.goat-chat-form button[type="submit"] {
  background: linear-gradient(180deg, var(--gc-gold2), var(--gc-gold));
  color: #111;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.goat-chat-form button[type="submit"]:disabled { opacity: .5; cursor: wait; }

.goat-chat-hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

@media (max-width: 480px) {
  .goat-chat-root { left: 4px; bottom: 6px; }
  .goat-chat-panel, .goat-chat-teaser {
    width: calc(100vw - 24px);
  }
  .goat-chat-panel {
    height: min(60vh, calc(100vh - 110px));
  }
}

/* MiMi = G.O.A.T. capricorn mascot */
.goat-chat-avatar { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: radial-gradient(circle at 50% 40%, #2a2620, #111); }
.goat-chat-root { --mimi-h: 96px; left: 4px; bottom: 6px; }
.goat-chat-fab.goat-chat-fab--mascot {
  width: auto; height: var(--mimi-h); padding: 0; position: relative;
  background: none; border: 0; border-radius: 0; box-shadow: none;
  display: block; transform-origin: 50% 100%;
  animation: mimiIdle 3.4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.goat-chat-fab--mascot:hover { transform: none; box-shadow: none; }
.goat-chat-fab--mascot:focus-visible { outline: 2px solid var(--gc-gold2); outline-offset: 2px; border-radius: 10px; }
.goat-chat-mascot {
  display: block; height: 100%; width: auto; pointer-events: none; user-select: none;
  filter: drop-shadow(0 0 1px rgba(224,196,138,.55)) drop-shadow(0 6px 10px rgba(0,0,0,.55));
  transition: opacity .2s ease, transform .2s ease;
}
.goat-chat-fab--mascot:hover .goat-chat-mascot { transform: translateY(-3px) rotate(-3deg); }
.goat-chat-fab--mascot.is-hopping { animation: mimiHop .9s cubic-bezier(.3,.7,.4,1.4) 1; }
.goat-chat-fab-x {
  position: absolute; left: 6px; bottom: 6px; width: 46px; height: 46px; border-radius: 50%;
  display: none; place-items: center; font-size: 26px; color: var(--gc-gold2);
  background: #111; border: 1.5px solid var(--gc-gold2); box-shadow: 0 8px 22px rgba(0,0,0,.5);
}
.goat-chat-root.teaser-visible .goat-chat-fab--mascot { animation: mimiIdle 3.4s ease-in-out infinite; }
.goat-chat-fab--mascot[aria-expanded="true"] { animation: none; height: 58px; width: 58px; background: none; }
.goat-chat-fab--mascot[aria-expanded="true"] .goat-chat-mascot { opacity: 0; }
.goat-chat-fab--mascot[aria-expanded="true"] .goat-chat-fab-x { display: grid; }
.goat-chat-panel, .goat-chat-teaser { left: 8px; bottom: 66px; }
.goat-chat-root:not(.is-open) .goat-chat-teaser { bottom: calc(var(--mimi-h) + 10px); }
.goat-chat-hello {
  position: absolute; left: calc(var(--mimi-h) * .62); bottom: calc(var(--mimi-h) * .72);
  padding: 7px 12px; border-radius: 14px 14px 14px 4px; white-space: nowrap;
  background: linear-gradient(180deg, var(--gc-bg2), var(--gc-bg)); color: var(--gc-text);
  border: 1px solid var(--gc-line); box-shadow: 0 10px 24px rgba(0,0,0,.45);
  font-size: 13px; cursor: pointer; pointer-events: none;
  opacity: 0; transform: translateY(6px) scale(.95); transition: opacity .3s ease, transform .3s ease;
}
.goat-chat-root.hello-visible:not(.is-open) .goat-chat-hello { opacity: 1; transform: none; pointer-events: auto; }
@keyframes mimiIdle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-2.5deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-3px) rotate(2.5deg); }
}
@keyframes mimiHop {
  0%, 100% { transform: translateY(0) scale(1,1); }
  15% { transform: translateY(0) scale(1.06,.92); }
  45% { transform: translateY(-16px) scale(.96,1.05) rotate(-4deg); }
  75% { transform: translateY(0) scale(1.05,.95); }
}
@media (min-width: 821px) {
  .goat-chat-root { --mimi-h: 130px; left: 14px; bottom: 8px; }
}
.goat-chat-head { align-items: center; }
.goat-chat-teaser-icon { width: 40px; height: 40px; padding: 0; background: #111; border: 1.5px solid var(--gc-gold2); overflow: hidden; }
.goat-chat-figure { display: block; background: none; border: 0; border-radius: 0; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.goat-chat-figure--head { flex: 0 0 auto; width: 30px; height: 52px; margin: -4px 2px -4px 0; transform-origin: 50% 100%; animation: goat-chat-figure-bob 3.2s ease-in-out infinite; }
@keyframes goat-chat-figure-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px) rotate(-2deg); } }
.goat-chat-msg.bot { position: relative; margin-left: 30px; max-width: calc(92% - 30px); }
.goat-chat-msg.bot::before {
  content: ""; position: absolute; left: -28px; bottom: 0; width: 22px; height: 39px;
  background: url("/assets/mascot/mimi-mini.webp?v=20261013") center bottom / contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

@media (prefers-reduced-motion: reduce) {
  .goat-chat-fab, .goat-chat-teaser, .goat-chat-fab--mascot, .goat-chat-fab--mascot.is-hopping, .goat-chat-mascot, .goat-chat-hello, .goat-chat-figure--head {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile: no iOS auto-zoom (inputs >=16px), panel fits dynamic viewport & keyboard */
@media (max-width: 820px), (pointer: coarse) {
  .goat-chat-form input[type="text"], .goat-chat-form textarea { font-size: 16px; }
  .goat-chat-root { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
}
@media (max-width: 480px) {
  .goat-chat-root.is-open { bottom: calc(6px + var(--gc-kb, 0px)); }
  .goat-chat-panel {
    width: calc(100vw - 24px);
    height: min(70vh, calc(100vh - 90px));
    height: min(70dvh, calc(100dvh - 90px), calc(var(--gc-vvh, 100dvh) - 90px));
    max-height: calc(var(--gc-vvh, 100dvh) - 80px);
    overscroll-behavior: contain;
  }
  .goat-chat-msgs, .goat-chat-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}
