#stage {
  width: 50vw;
  height: 100vh;
  perspective: 650px;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  z-index: 10; /* above Three.js background */
  padding: clamp(16px, 3vh, 32px) clamp(10px, 2vw, 16px) clamp(20px, 4vh, 44px) clamp(16px, 2vw, 28px);
  box-sizing: border-box;
}

.right-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ascii-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(10px, 2vh, 20px);
  padding: 0;
  margin-top: clamp(30px, 8vh, 80px);
  flex-shrink: 0;
}

.ascii-text {
  /* static (no perspective/cursor tilt) */
  display: block;
  font-family: 'Courier New', monospace;
  font-size: clamp(4px, 0.6vw, 7px);
  line-height: 1;
  color: #000; /* Black text */
  white-space: pre;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  opacity: 1;
  filter: none; /* Removed blur to make it clearer */
  mix-blend-mode: normal; /* Changed from multiply to normal */
}

.ascii-copy {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1vh, 14px);
  text-align: center;
  font-family: 'Courier New', monospace;
  color: #000;
}

.ascii-tagline {
  font-size: clamp(11px, 1.3vw, 15px);
  line-height: 1.2;
}

.ascii-link {
  display: inline-block;
  margin-top: 0;
  color: #000;
  text-decoration: underline;
}

.ascii-link:visited {
  color: #000;
}

.ascii-link--btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  margin-top: 2px;
}

.ascii-link--btn:hover {
  opacity: 0.7;
}

.bot-log {
  width: clamp(70%, 80%, 90%);
  margin-left: auto;
  margin-right: clamp(20px, 4vw, 70px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 18px;
  padding: clamp(12px, 2vh, 20px);
  text-align: left;
  margin-top: auto; /* pin to bottom of the right panel */
  box-sizing: border-box;
  flex-shrink: 1;
  min-height: 0;
  max-height: clamp(150px, 40vh, 400px);
  overflow: hidden;
}

.bot-log__title {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.75);
  margin-bottom: 10px;
}

.bot-log__body {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: clamp(9px, 1vw, 11px);
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.75);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: clamp(80px, 25vh, 280px);
  overflow: auto;
  padding-right: 6px;
}

/* Status line */
.bot-log__status {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.5);
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-log__status-dot {
  width: 6px;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Patterns section */
.bot-log__patterns {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  color: rgba(0, 0, 0, 0.45);
  padding: 6px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 8px;
}

.bot-log__pattern {
  padding: 2px 0;
  display: flex;
  gap: 6px;
}

.bot-log__pattern-tag {
  color: rgba(0, 0, 0, 0.35);
}

/* Thinking state */
.thinking-line {
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
}

/* Behavior tag */
.behavior-tag {
  color: rgba(0, 0, 0, 0.5);
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  #stage {
    width: 100%;
    height: auto;
    min-height: 60vh;
    padding: 20px;
    order: 1;
  }

  .right-panel {
    height: auto;
  }

  .ascii-stack {
    margin-top: 30px;
    gap: 14px;
  }

  .bot-log {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 30px;
    max-height: none;
  }

  .bot-log__body {
    max-height: 40vh;
  }
}

/* Adjust for smaller screens */
@media (max-width: 768px) {
  #stage {
    padding: 16px;
  }

  .ascii-text {
    font-size: 5px;
    opacity: 1;
  }

  .ascii-tagline {
    font-size: 12px;
  }

  .ascii-stack {
    margin-top: 20px;
  }

  .ascii-copy {
    gap: 6px;
  }

  .ascii-link {
    font-size: 12px;
  }

  .bot-log {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 20px;
  }

  .bot-log__title {
    font-size: 11px;
  }

  .bot-log__body {
    font-size: 11px;
    max-height: 35vh;
  }
}

/* Small mobile (max 480px) */
@media (max-width: 480px) {
  #stage {
    padding: 12px;
  }

  .ascii-text {
    font-size: 4px;
    opacity: 1;
  }

  .ascii-tagline {
    font-size: 11px;
  }

  .ascii-copy {
    gap: 8px;
  }

  .ascii-link {
    font-size: 11px;
  }

  .bot-log {
    padding: 12px;
  }

  .bot-log__title {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .bot-log__body {
    font-size: 10px;
    line-height: 1.4;
    max-height: 30vh;
  }
}
