/* Chilla 3.0 product page
   Extends v3-home.css. Conversation first. Detail only when earned. */

.ch3-hero {
  min-height: 100svh;
  padding: clamp(150px, 18vw, 210px) 0 clamp(84px, 10vw, 130px);
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.ch3-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .62fr);
  align-items: center;
  gap: clamp(52px, 7vw, 96px);
}

.ch3-hero-copy { position: relative; z-index: 2; }
.ch3-hero h1 { max-width: 760px; margin: 0; font-family: var(--font-display); font-size: clamp(3.7rem, 7vw, 6.6rem); font-weight: 520; line-height: .92; letter-spacing: -.064em; }
.ch3-hero-sub { max-width: 580px; margin: 28px 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.65vw, 1.2rem); line-height: 1.62; }

.ch3-mascot {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  justify-self: end;
  pointer-events: none;
  perspective: 900px;
  animation: ch3MascotFloat 8.6s ease-in-out infinite;
}

@keyframes ch3MascotFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

.ch3-mascot-pose {
  width: 100%;
  height: 100%;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: rotateY(0deg) scale(1);
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  transition: opacity 190ms ease, transform 190ms ease;
}

.ch3-mascot[data-pose="neutral"] .ch3-mascot-pose { background-image: url("/attached_assets/chilla/chilla-neutral.webp"); }
.ch3-mascot[data-pose="okay"] .ch3-mascot-pose { background-image: url("/attached_assets/chilla/chilla-okay.webp"); }
.ch3-mascot[data-pose="thinking"] .ch3-mascot-pose { background-image: url("/attached_assets/chilla/chilla-thinking.webp"); }
.ch3-mascot[data-pose="working"] .ch3-mascot-pose { background-image: url("/attached_assets/chilla/chilla-working.webp"); }

.ch3-mascot.is-changing .ch3-mascot-pose {
  opacity: .18;
  transform: rotateY(88deg) scale(.985);
}
.ch3-actions { display: flex; align-items: center; gap: 24px; margin-top: 38px; flex-wrap: wrap; }
.ch3-primary,.ch3-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; text-decoration: none; font-size: .98rem; font-weight: 600; }
.ch3-primary { padding: 0 24px; border-radius: 999px; background: var(--button); color: var(--button-text) !important; }
.ch3-secondary { color: var(--text); border-bottom: 1px solid var(--text); min-height: 36px; }

.ch3-conversation { position: relative; z-index: 2; border: 1px solid var(--line); border-radius: 28px; background: color-mix(in srgb, var(--surface) 78%, transparent); overflow: hidden; }
.ch3-conversation-top { min-height: 48px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--faint); font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ch3-online { display: inline-flex; align-items: center; gap: 7px; }
.ch3-online::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ch3-thread { height: 470px; padding: 24px 22px 18px; display: flex; flex-direction: column; min-height: 0; }
.ch3-message-viewport { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; scroll-behavior: smooth; padding-right: 3px; }
.ch3-message-viewport::-webkit-scrollbar { width: 0; height: 0; }
.ch3-message { max-width: 88%; margin-bottom: 18px; font-size: .95rem; line-height: 1.58; }
.ch3-message p { margin: 0; }
.ch3-message.user { margin-left: auto; padding: 14px 16px; border-radius: 18px 18px 5px 18px; background: var(--text); color: var(--page); }
.ch3-message.chilla { color: var(--text); }
.ch3-message.chilla + .ch3-message.chilla { color: var(--muted); }
.ch3-msg-label { display: block; margin-bottom: 6px; color: var(--faint); font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.ch3-demo-sequenced,
.ch3-demo-dynamic { opacity: 0; transform: translateY(8px); transition: opacity .34s ease, transform .34s ease; }
.ch3-demo-sequenced.is-shown,
.ch3-demo-dynamic.is-shown { opacity: 1; transform: translateY(0); }
.ch3-typing { display: inline-flex; gap: 5px; align-items: center; min-height: 28px; }
.ch3-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: ch3Typing 1s infinite ease-in-out; }
.ch3-typing span:nth-child(2) { animation-delay: .13s; }
.ch3-typing span:nth-child(3) { animation-delay: .26s; }
@keyframes ch3Typing { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.ch3-mini-composer { flex: 0 0 auto; margin-top: 14px; padding: 12px 12px 12px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; color: var(--faint); font-size: .86rem; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.ch3-mini-composer.is-active { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 65%, transparent); transform: translateY(-1px); }
.ch3-mini-composer svg { width: 18px; height: 18px; margin-left: auto; color: var(--text); flex: 0 0 auto; }

.ch3-section { padding: var(--section) 0; border-top: 1px solid var(--line); }
.ch3-section--soft { background: color-mix(in srgb, var(--surface) 35%, var(--page)); }
.ch3-section-grid { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1fr); gap: clamp(60px, 10vw, 150px); align-items: start; }
.ch3-section-copy { max-width: 660px; }
.ch3-section-copy h2,.ch3-big-line { margin: 0; font-family: var(--font-display); font-size: clamp(2.8rem, 6.5vw, 6.3rem); font-weight: 520; line-height: .94; letter-spacing: -.06em; }
.ch3-section-copy > p { margin: 28px 0 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.16rem); line-height: 1.68; }
.ch3-steps { border-top: 1px solid var(--line); }
.ch3-step { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 18px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.ch3-step-num { color: var(--faint); font-size: .78rem; font-weight: 600; }
.ch3-step h3 { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 540; letter-spacing: -.035em; }
.ch3-step p { max-width: 560px; margin: 9px 0 0; color: var(--muted); font-size: .96rem; line-height: 1.62; }
.ch3-demo-statement { max-width: 1020px; }
.ch3-demo-statement .ch3-big-line { max-width: 900px; }
.ch3-demo-statement p { max-width: 620px; margin: 30px 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.2rem); line-height: 1.7; }
.ch3-demo-note { margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--line); max-width: 720px; }
.ch3-demo-note strong { display: block; color: var(--text); font-size: .82rem; }
.ch3-demo-note span { display: block; margin-top: 8px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.ch3-report { max-width: 820px; margin-left: auto; }
.ch3-report-line { padding: 24px 0; border-bottom: 1px solid var(--line); }
.ch3-report-line:first-child { border-top: 1px solid var(--line); }
.ch3-report-label { color: var(--faint); font-size: .73rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.ch3-report-line p { margin: 9px 0 0; color: var(--text); font-family: var(--font-display); font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.25; letter-spacing: -.025em; }
.ch3-source-link { display: inline-flex; margin-top: 24px; color: var(--muted); font-size: .9rem; text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.ch3-mii { position: relative; overflow: hidden; }
.ch3-mii-copy { max-width: 920px; }
.ch3-mii-copy h2 { max-width: 820px; margin: 0; font-family: var(--font-display); font-size: clamp(3.2rem, 7vw, 6.8rem); font-weight: 520; line-height: .91; letter-spacing: -.065em; }
.ch3-mii-copy p { max-width: 650px; margin: 30px 0 0; color: var(--muted); font-size: clamp(1rem, 1.65vw, 1.16rem); line-height: 1.7; }
.ch3-mii-rail { margin-top: 56px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ch3-mii-rail span { padding: 18px 14px 18px 0; color: var(--muted); font-size: .82rem; border-right: 1px solid var(--line); }
.ch3-mii-rail span:not(:first-child) { padding-left: 18px; }
.ch3-mii-rail span:last-child { border-right: 0; }
.ch3-mii-link { display: inline-flex; margin-top: 28px; color: var(--text); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--text); }
.ch3-final { min-height: 82svh; display: flex; align-items: center; padding: var(--section) 0; border-top: 1px solid var(--line); }
.ch3-final h2 { max-width: 820px; margin: 0; font-family: var(--font-display); font-size: clamp(4rem, 9vw, 8.5rem); font-weight: 520; line-height: .88; letter-spacing: -.07em; }
.ch3-final p { margin: 30px 0 0; color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.35rem); }
.ch3-final .ch3-primary { margin-top: 36px; }

@media (prefers-reduced-motion: reduce) {
  .ch3-demo-sequenced,.ch3-demo-dynamic { opacity: 1; transform: none; transition: none; }
  .ch3-typing span { animation: none; }
}

@media (max-width: 900px) {
  .ch3-hero { min-height: auto; padding-top: 132px; }
  .ch3-hero-grid,.ch3-section-grid { grid-template-columns: 1fr; }
  .ch3-hero-grid { gap: 44px; }
  .ch3-section-grid { gap: 52px; }
  .ch3-mascot { width: min(62vw, 360px); justify-self: center; }
  .ch3-mii-rail { grid-template-columns: 1fr 1fr; }
  .ch3-mii-rail span:nth-child(2) { border-right: 0; }
  .ch3-mii-rail span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .ch3-hero { padding-top: 142px; padding-bottom: 80px; }
  .ch3-hero h1 { font-size: clamp(3.4rem, 15vw, 4.8rem); line-height: .92; }
  .ch3-hero-sub { margin-top: 24px; }
  .ch3-mascot { width: min(72vw, 300px); }
  .ch3-actions { margin-top: 32px; gap: 20px; }
  .ch3-primary { min-height: 50px; padding-inline: 22px; }
  .ch3-conversation { border-radius: 22px; }
  .ch3-thread { height: 430px; padding: 22px 18px 16px; }
  .ch3-section { padding: 92px 0; }
  .ch3-section-copy h2,.ch3-big-line,.ch3-mii-copy h2 { font-size: clamp(3rem, 13.5vw, 4.5rem); }
  .ch3-step { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
  .ch3-mii-rail { grid-template-columns: 1fr; }
  .ch3-mii-rail span,.ch3-mii-rail span:not(:first-child) { padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .ch3-mii-rail span:last-child { border-bottom: 0; }
  .ch3-final { min-height: 72svh; }
  .ch3-final h2 { font-size: clamp(4rem, 18vw, 5.4rem); }
}


@media (prefers-reduced-motion: reduce) {
  .ch3-mascot {
    animation: none !important;
    translate: none !important;
  }
}
