/* =========================================================
   Clara — speak.final.css (LOAD LAST)
   Typography + Desktop Layout + Romantic Header
   ========================================================= */

/* =========================================================
   TYPOGRAPHY - MOBILE FIRST (applies to all screens)
   ========================================================= */

/* Ensure proper z-index stacking */
.top-menu {
  z-index: 200;
}

.embers {
  z-index: 100;
}

/* Base dialogue font */
.chat-dialogue {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: #f4e8d5;
  text-shadow: 0 1px 4px rgba(0,0,0,.55);
}

/* User messages - mobile optimized */
.chat-dialogue .message {
  font-size: clamp(1.05rem, 4.5vw, 1.2rem);
  line-height: 1.7;
  margin: 0.9rem 0;
}

/* Clara's messages - slightly larger and warmer */
.chat-dialogue .message.clara,
.chat-dialogue .message.ai,
.chat-dialogue .message.assistant {
  font-size: clamp(1.1rem, 4.8vw, 1.3rem);
  color: #f7ecd7;
}

/* Input placeholder styling */
#input-box::placeholder {
  color: rgba(244,232,213,.75);
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: .02em;
}

/* =========================================================
   ROMANTIC HEADER - ALL SCREENS
   ========================================================= */

.chat-header .title {
  font-family: "Great Vibes", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 500;
  color: #d6b35f;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-shadow:
    0 1px 4px rgba(0,0,0,.65),
    0 0 10px rgba(255,220,120,.35);
  animation: titleGlow 2.6s ease-out 1;
}

@keyframes titleGlow {
  0% {
    text-shadow: 0 0 0 rgba(255,220,120,0);
    opacity: 0;
  }
  25% {
    text-shadow: 0 0 20px rgba(255,220,120,.8);
    opacity: 1;
  }
  60% {
    text-shadow: 0 0 10px rgba(255,220,120,.4);
  }
  100% {
    text-shadow: 0 0 4px rgba(255,220,120,.25);
  }
}

.chat-header .tagline {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  color: rgba(255,245,225,.88);
  letter-spacing: .04em;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  margin-top: .25rem;
}

/* =========================================================
   TABLET ADJUSTMENTS (768px+)
   ========================================================= */

@media (min-width: 768px) {
  .chat-header {
    margin-top: 4rem;
  }
  
  .chat-dialogue .message {
    font-size: 1.15rem;
  }
  
  .chat-dialogue .message.clara,
  .chat-dialogue .message.ai,
  .chat-dialogue .message.assistant {
    font-size: 1.25rem;
  }
}

/* =========================================================
   DESKTOP LAYOUT (1100px+)
   ========================================================= */

@media (min-width: 1100px) {
  :root {
    --col-inner: 820px;
    --col-pad: 24px;
    --col-total: calc(var(--col-inner) + 2 * var(--col-pad));
  }

  /* Center-align the page container */
  .chat-page {
    align-items: center;
  }

  /* Clamp header and dialogue to fixed width */
  .chat-header,
  .chat-dialogue {
    width: var(--col-total);
    max-width: var(--col-total);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--col-pad);
    padding-right: var(--col-pad);
    box-sizing: border-box;
  }

  /* Desktop header spacing */
  .chat-header {
    margin-top: 3rem;
  }

  /* Desktop typography - larger for readability */
  .chat-dialogue .message {
    font-size: 1.18rem;
    line-height: 1.75;
    max-width: 66ch;
  }

  .chat-dialogue .message.clara,
  .chat-dialogue .message.ai,
  .chat-dialogue .message.assistant {
    font-size: 1.28rem;
  }

  /* Fixed input bar - same width as content */
  .input-area {
    position: fixed;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: var(--col-total);
    max-width: var(--col-total);
    padding-left: var(--col-pad);
    padding-right: var(--col-pad);
    box-sizing: border-box;
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-bottom: none;
    background: rgba(0,0,0,0.50);
  }

  /* Ensure chat content doesn't hide behind fixed input */
  .chat-dialogue {
    padding-bottom: calc(6rem + 32px);
    scroll-padding-bottom: calc(6rem + 32px);
  }


}

/* =========================================================
   ACCESSIBILITY - Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .chat-header .title {
    animation: none;
  }
  
  .embers i {
    animation: none;
    opacity: 0;
  }
}
/* =========================================================
   Fix navigation alignment + raise nav + lower header
   ========================================================= */

/* --- Center navigation links and raise nav bar --- */
body.speak-page nav.top-menu {
  display: flex !important;
  justify-content: center !important;
  gap: 1.25rem !important;
  padding: 0.6rem 1rem !important;
  position: fixed !important;
  top: 0.25rem !important;      /* raise it upward */
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: max-content !important;
  z-index: 9999 !important;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border-radius: 12px;
}

/* prevent nav from stretching full width on mobile */
body.speak-page nav.top-menu a {
  white-space: nowrap !important;
}

/* --- Lower Clara header block --- */
body.speak-page .chat-header {
  margin-top: 8.5rem !important;   /* lower the title/tagline */
}

/* On desktop, lower it slightly less (because nav is smaller visually) */
@media (min-width: 768px) {
  body.speak-page .chat-header {
    margin-top: 6.8rem !important;
  }
}

/* Strong feathered edges for Clara image on Speak page */
body.speak-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  /* Two layers:
     1) dark side gradient on top
     2) Clara painting underneath
  */

  background-image:
    linear-gradient(
      to right,
      rgba(0, 0, 0, 0.95) 0%,   /* very dark at far left */
      rgba(0, 0, 0, 0.70) 8%,   /* still quite dark */
      rgba(0, 0, 0, 0.10) 22%,  /* almost gone by here */
      rgba(0, 0, 0, 0.00) 38%,  /* fully clear middle band */
      rgba(0, 0, 0, 0.00) 62%,  /* fully clear middle band */
      rgba(0, 0, 0, 0.10) 78%,  /* start darkening again */
      rgba(0, 0, 0, 0.70) 92%,  /* dark near right edge */
      rgba(0, 0, 0, 0.95) 100%  /* very dark at far right */
    ),
    url("../images/clara_on_stage.png");

   
    url("../images/clara_on_stage.png");
  background-position: center top, center top;
  background-repeat: no-repeat, no-repeat;
  background-size: auto 100vh, auto 100vh;

  /* Same entrance + shimmer animations as before */
  opacity: 0;
  animation:
    claraSlowFadeIn 4s ease-out forwards,
    shimmerOnce 5s ease-out 4s;
}
