:root {
  --dix-orange: #ff7a18;
  --dix-orange-2: #ffb15f;
  --dix-bg: #121417;
  --dix-panel: rgba(18, 20, 23, 0.86);
  --dix-line: rgba(255, 122, 24, 0.32);
  --dix-text: #f5f7fb;
  --dix-muted: #aeb7c4;
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 30% 0%, rgba(255, 122, 24, 0.16), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(255, 177, 95, 0.08), transparent 28%),
    #121417;
  color: var(--dix-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.demo-page { min-height: 140vh; padding: 72px clamp(20px, 5vw, 80px); }
.hero { max-width: 760px; }
.badge {
  width: fit-content;
  padding: 8px 13px;
  border: 1px solid var(--dix-line);
  border-radius: 999px;
  color: var(--dix-orange-2);
  background: rgba(255, 122, 24, 0.06);
  font-size: 13px;
}
.hero h1 { margin: 18px 0 10px; font-size: clamp(58px, 9vw, 118px); line-height: .88; letter-spacing: -0.08em; }
.hero p { max-width: 620px; color: var(--dix-muted); font-size: 20px; line-height: 1.55; }
.demo-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.demo-actions button {
  border: 1px solid var(--dix-line);
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  color: var(--dix-text);
  padding: 12px 16px;
  cursor: pointer;
}
.demo-actions button:hover { background: rgba(255, 122, 24, 0.12); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 80px; max-width: 980px; }
.cards article { min-height: 170px; padding: 24px; border: 1px solid rgba(255,255,255,0.08); border-radius: 24px; background: rgba(255,255,255,0.035); backdrop-filter: blur(12px); }
.cards p { color: var(--dix-muted); line-height: 1.5; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

/* =========================
   DIXBOT CORE
   ========================= */
.dixbot-root {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 2147483000;
  pointer-events: none;
  font-family: inherit;
}

.dixbot-hitbox {
  position: fixed;
  width: var(--dixbot-size, 92px);
  height: var(--dixbot-size, 92px);
  left: 0;
  top: 0;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform, left, top;
}
.dixbot-hitbox:active { cursor: grabbing; }

.dixbot-character {
  position: absolute;
  inset: 0;
  transform-origin: 50% 78%;
  will-change: transform, filter;
  filter: drop-shadow(0 16px 16px rgba(0,0,0,0.34));
}

.dixbot-sprite {
  width: 100%;
  height: 100%;
  background-image: var(--dixbot-sprite);
  background-repeat: no-repeat;
  background-size: 400% 200%;
  image-rendering: auto;
  transform-origin: 50% 82%;
}

.dixbot-shadow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 62%;
  height: 13%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.36), rgba(0,0,0,0));
  opacity: 0.75;
  pointer-events: none;
  will-change: transform, opacity;
}

.dixbot-bubble {
  position: fixed;
  max-width: min(260px, calc(100vw - 34px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 122, 24, .34);
  border-radius: 16px 16px 16px 5px;
  background: rgba(20, 22, 25, .88);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 18px 40px rgba(0,0,0,.32);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.dixbot-bubble.is-visible { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }

.dixbot-impact {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 177, 95, .8);
  pointer-events: none;
  animation: dixbot-impact .45s ease-out forwards;
}
@keyframes dixbot-impact {
  from { transform: translate(-50%, -50%) scale(.35); opacity: 1; }
  to { transform: translate(-50%, -50%) scale(4); opacity: 0; }
}

.dixbot-dust {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 177, 95, .75);
  pointer-events: none;
  animation: dixbot-dust .52s ease-out forwards;
}
@keyframes dixbot-dust {
  from { transform: translate(-50%, -50%) scale(.8); opacity: .9; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.1); opacity: 0; }
}

.dixbot-hitbox[data-state="walk"] .dixbot-character {
  animation: dixbot-breathe 2.4s ease-in-out infinite;
}
.dixbot-hitbox[data-state="idle"] .dixbot-character,
.dixbot-hitbox[data-state="curious"] .dixbot-character {
  animation: dixbot-idle 3.6s ease-in-out infinite;
}
.dixbot-hitbox[data-state="sleep"] .dixbot-character {
  animation: dixbot-sleep 3.8s ease-in-out infinite;
  filter: drop-shadow(0 12px 14px rgba(0,0,0,0.28)) saturate(.82);
}
.dixbot-hitbox[data-state="grabbed"] .dixbot-character {
  animation: dixbot-annoyed .18s ease-in-out infinite;
}
.dixbot-hitbox[data-state="landed"] .dixbot-character {
  animation: dixbot-land .24s ease-out 1;
}
.dixbot-hitbox[data-state="stuck"] .dixbot-character {
  animation: dixbot-stuck 1.8s ease-in-out infinite;
}
.dixbot-hitbox[data-chat="open"] .dixbot-character {
  animation: dixbot-chat-attention 2.6s ease-in-out infinite;
}

@keyframes dixbot-breathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-1px) scaleY(1.012); }
}
@keyframes dixbot-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  45% { transform: translateY(-1px) rotate(.65deg); }
  65% { transform: translateY(0) rotate(-.35deg); }
}
@keyframes dixbot-sleep {
  0%, 100% { transform: translateY(2px) scaleY(.98); }
  50% { transform: translateY(3px) scaleY(.955); }
}
@keyframes dixbot-annoyed {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(.9px) rotate(.8deg); }
}
@keyframes dixbot-land {
  0% { transform: scaleX(1.16) scaleY(.84); }
  62% { transform: scaleX(.96) scaleY(1.05); }
  100% { transform: scaleX(1) scaleY(1); }
}
@keyframes dixbot-stuck {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
@keyframes dixbot-chat-attention {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.dixbot-chat {
  position: fixed;
  right: 24px;
  bottom: 126px;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid rgba(255, 122, 24, .32);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(17, 18, 21, .9);
  backdrop-filter: blur(20px);
  color: #fff;
  box-shadow: 0 28px 80px rgba(0,0,0,.46);
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(.98);
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}
.dixbot-chat.is-open { opacity: 1; transform: translate3d(0, 0, 0) scale(1); pointer-events: auto; }
.dixbot-chat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 17px; border-bottom: 1px solid rgba(255,255,255,.08); }
.dixbot-chat__title { font-weight: 800; letter-spacing: .02em; }
.dixbot-chat__subtitle { margin-top: 2px; color: var(--dix-muted); font-size: 12px; }
.dixbot-chat__close { border: 0; background: transparent; color: #fff; font-size: 22px; cursor: pointer; }
.dixbot-chat__body { padding: 16px; min-height: 170px; }
.dixbot-msg { width: fit-content; max-width: 88%; padding: 10px 12px; border-radius: 15px; margin-bottom: 10px; line-height: 1.4; font-size: 14px; }
.dixbot-msg--bot { background: rgba(255, 122, 24, .14); border: 1px solid rgba(255, 122, 24, .2); }
.dixbot-chat__input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.dixbot-chat__input input { flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 11px 12px; background: rgba(255,255,255,.05); color: #fff; outline: none; }
.dixbot-chat__input button { border: 0; border-radius: 14px; background: var(--dix-orange); color: #121417; padding: 0 14px; font-weight: 800; cursor: pointer; }
@media (max-width: 520px) { .dixbot-chat { right: 14px; bottom: 112px; } }
