/* ==========================================================================
   gravity.css — Hero greeting enlargement + (later) physics styles
   ========================================================================== */

/* Hero-size greeting — applied from the start (typewriter preserves span structure) */
.gpt-chat-msg.assistant .gpt-msg-text {
  max-width: min(960px, 92vw);
}

/* Hero emoji images — sized to match the cap-height of the characters they sit next to.
   Heights stay close to 1em so the line box doesn't stretch significantly. */

/* Wrapper kept so physics can treat the wave as a single unit */
.hero-wave-wrap {
  display: inline-block;
  position: relative;
  vertical-align: -0.22em;
  margin: 0 0.04em;
  line-height: 1;
}

.hero-wave {
  display: inline-block;
  height: 1.1em;
  width: auto;
  vertical-align: baseline;
  margin: 0;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transform-origin: 70% 90%;
  animation: hero-wave-tilt 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* Within the chat-sized greeting, wave matches default 1.1em height. */
.greet-hello .hero-wave {
  height: 1.15em;
}

@keyframes hero-wave-tilt {
  0%, 60%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-10deg); }
  30% { transform: rotate(12deg); }
  40% { transform: rotate(-6deg); }
  50% { transform: rotate(4deg); }
}

.hero-sprout {
  display: inline-block;
  height: 1.1em;
  width: auto;
  vertical-align: -0.15em;
  margin: 0 0.04em;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transform-origin: 50% 100%;
  animation: hero-sprout-sway 4.2s ease-in-out infinite;
}

@keyframes hero-sprout-sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.hero-bear {
  display: inline-block;
  height: 1.8em;
  width: auto;
  vertical-align: -0.45em;
  /* Negative left margin pulls the bear visually closer to the preceding
     word, compensating for the PNG's transparent side padding. */
  margin: 0 -0.2em 0 -0.25em;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transform-origin: 50% 85%;
  animation: hero-bear-bob 5s ease-in-out infinite;
}

@keyframes hero-bear-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-0.04em) rotate(-2deg); }
}

/* Custom TikTok logo — sized to match letter height of "TikTok" */
.hero-tiktok {
  display: inline-block;
  height: 1.4em;
  width: auto;
  vertical-align: -0.35em;
  margin: 0 -0.15em 0 -0.1em;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: hero-tiktok-pulse 3.6s ease-in-out infinite;
}

@keyframes hero-tiktok-pulse {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-wave, .hero-sprout, .hero-bear, .hero-tiktok { animation: none; }
}

/* Hero: "Hello" is the only display-sized line. Everything else is the same
   size (LLM-output feel), with weight/color providing the small variation. */
.gpt-chat-msg.assistant .greet-hello {
  display: inline;
  font-family: 'Supreme', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 64px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--clay-text, #1A1A1A);
}

.gpt-chat-msg.assistant .greet-bold,
.gpt-chat-msg.assistant .greet-light,
.gpt-chat-msg.assistant .greet-now {
  display: inline;
  font-family: 'Supreme', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 30px;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.gpt-chat-msg.assistant .greet-bold {
  font-weight: 700;
  color: var(--clay-text, #1A1A1A);
}

.gpt-chat-msg.assistant .greet-light {
  font-weight: 400;
  color: var(--clay-text-secondary, #5A5A5A);
}

.gpt-chat-msg.assistant .greet-now {
  font-weight: 500;
  color: var(--clay-text, #1A1A1A);
}

/* Tablet */
@media (max-width: 1024px) {
  .gpt-chat-msg.assistant .greet-hello {
    font-size: 52px;
    letter-spacing: -0.03em;
  }
  .gpt-chat-msg.assistant .greet-bold,
  .gpt-chat-msg.assistant .greet-light,
  .gpt-chat-msg.assistant .greet-now {
    font-size: 24px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .gpt-chat-msg.assistant .greet-hello {
    font-size: 38px;
    letter-spacing: -0.025em;
  }
  .gpt-chat-msg.assistant .greet-bold,
  .gpt-chat-msg.assistant .greet-light,
  .gpt-chat-msg.assistant .greet-now {
    font-size: 19px;
  }
}

/* ==========================================================================
   Status line — "Currently @ TikTok"
   ========================================================================== */

.greet-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  font-family: 'Geist Mono', 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--clay-text-secondary, #5A5A5A);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1) 400ms,
              transform 500ms cubic-bezier(0.22, 1, 0.36, 1) 400ms;
}

.gpt-chat-msg.assistant.greeting-enlarged .greet-status {
  opacity: 1;
  transform: translateY(0);
}

.greet-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: greet-status-pulse 2.4s ease-out infinite;
  flex-shrink: 0;
}

@keyframes greet-status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.greet-status-text {
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .greet-status { transition: none; opacity: 1; transform: none; }
  .greet-status-dot { animation: none; }
}

/* ==========================================================================
   Physics state (Part B — scaffolded, not yet active)
   ========================================================================== */

/* Per-word spans wrapped by gravity.js so each word can be a physics body.
   Default cursor is grab to signal interactivity. will-change keeps GPU
   composition sharp while physics drives the transform every frame. */
.greeting-word {
  display: inline-block;
  white-space: pre;
  will-change: transform;
  cursor: grab;
  transform-origin: center center;
}

.greeting-word:active {
  cursor: grabbing;
}

/* While physics is active, strip overflow-clipping from the hero's ancestors
   so words can fall off the viewport edges visibly. */
body.physics-active .desktop-app,
body.physics-active .desktop-app.chatgpt-style,
body.physics-active .gpt-main,
body.physics-active .gpt-center,
body.physics-active .chat-thread,
body.physics-active .gpt-chat-msg,
body.physics-active .gpt-msg-text,
body.physics-active #chatUserHello,
body.physics-active #chatAiGreeting,
body.physics-active #chatAiProjects,
body.physics-active #chatThread {
  overflow: visible !important;
}
