/* ============================================
   Chat section — live conversation demo
   ============================================ */

.chat-section {
  background: var(--surface);
  color: var(--ink);
  padding: var(--section-y) 0;
  overflow: hidden;
}
.chat-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 72px;
  align-items: center;
}
.chat-text h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 4.4vw, 56px);
  letter-spacing: -0.02em;
  line-height: 1.03;
  margin: 16px 0 18px;
}
.chat-text h2 em { font-style: italic; color: var(--accent); font-weight: 400; }
.chat-text > p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted-2);
  margin: 0 0 24px;
  max-width: 460px;
}

/* Phone frame around the chat */
.chat-phone {
  width: 392px;
  max-width: 100%;
  margin: 0 auto;
  background: #0A0F1E;
  border: 10px solid #1C2742;
  border-radius: 48px;
  box-shadow:
    0 60px 130px -40px rgba(0,0,0,0.75),
    inset 0 0 0 1.5px rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  background: #05080F;
  border-radius: 999px;
  z-index: 5;
}
.chat-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 26px 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(242,235,218,0.75);
  background: #0A0F1E;
  letter-spacing: 0.04em;
}

/* Chat window */
.chat-win {
  background: #0B1224;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 600px;
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #0A0F1E;
  flex-wrap: wrap;
}
.chat-head-avatars { display: flex; }
.chat-head-avatars .av {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  border: 2px solid #0A0F1E;
}
.chat-head-avatars .av + .av { margin-left: -8px; }
.av.gold { background: #C9A86A; color: #1A1407; }
.av.blue { background: #3A4A73; color: #F2EBDA; }
.chat-head-title {
  font-size: 13px;
  font-weight: 500;
  color: #F2EBDA;
}
.chat-head-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: rgba(242,235,218,0.5);
  display: flex; align-items: center; gap: 6px;
}
.chat-head-sub .on {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ADE80;
}
.chat-head-phase {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(201, 168, 106, 0.12);
  border: 1px solid rgba(201, 168, 106, 0.35);
  color: #E2C58A;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.chat-day {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(242,235,218,0.4);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}

.chat-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 92%;
  animation: chat-in .5s cubic-bezier(.2,.9,.3,1.2) both;
}
.chat-row.me { align-self: flex-end; flex-direction: row-reverse; }
@keyframes chat-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.chat-bubble {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(242,235,218,0.92);
}
.chat-row.me .chat-bubble {
  background: #C9A86A;
  border-color: #C9A86A;
  color: #1A1407;
  border-radius: 16px 16px 4px 16px;
}
.chat-meta {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: rgba(242,235,218,0.45);
  margin-bottom: 5px;
}
.chat-row.me .chat-meta { color: rgba(26, 20, 7, 0.55); }
.chat-attach {
  margin-top: 9px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-radius: 9px;
  background: rgba(201, 168, 106, 0.12);
  border: 1px solid rgba(201, 168, 106, 0.35);
  color: #E2C58A;
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.chat-row.me .chat-attach {
  background: rgba(26, 20, 7, 0.12);
  border-color: rgba(26, 20, 7, 0.25);
  color: #1A1407;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 82%;
  animation: chat-in .3s ease both;
}
.chat-typing.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-typing .bub {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px 16px 16px 4px;
  padding: 13px 16px;
  display: flex; gap: 5px;
}
.chat-typing.me .bub { border-radius: 16px 16px 4px 16px; }
.chat-typing .bub span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(242,235,218,0.5);
  animation: typing-dot 1.2s ease-in-out infinite;
}
.chat-typing .bub span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing .bub span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Decision system card */
.chat-decision {
  align-self: center;
  width: 96%;
  background: linear-gradient(135deg, rgba(201, 168, 106, 0.14), rgba(201, 168, 106, 0.05));
  border: 1px solid rgba(201, 168, 106, 0.45);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: decision-in .7s cubic-bezier(.2,.9,.3,1.25) both;
}
@keyframes decision-in {
  from { opacity: 0; transform: scale(0.9); }
  60% { transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}
.chat-decision .dec-ic {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #C9A86A;
  color: #1A1407;
  display: grid; place-items: center;
  flex-shrink: 0;
  animation: dec-pulse 2s ease-out infinite;
}
@keyframes dec-pulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 168, 106, 0.45); }
  100% { box-shadow: 0 0 0 14px rgba(201, 168, 106, 0); }
}
.chat-decision .dec-t {
  font-size: 11.5px;
  font-weight: 600;
  color: #F2EBDA;
}
.chat-decision .dec-s {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: rgba(242,235,218,0.55);
  margin-top: 3px;
}

/* Input bar */
.chat-input {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: #0A0F1E;
}
.chat-input .field-fake {
  flex: 1;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  font-size: 12px;
  color: rgba(242,235,218,0.45);
}
.chat-input .send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #C9A86A;
  color: #1A1407;
  display: grid; place-items: center;
  border: 0;
  flex-shrink: 0;
}

/* Replay */
.chat-replay {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  transition: all .25s;
}
.chat-replay:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 980px) {
  .chat-layout { grid-template-columns: 1fr; gap: 36px; }
  .chat-win { height: 520px; }
  .chat-phone { width: 340px; }
}


/* MOBILE — chat phone */
@media (max-width: 720px) {
  .chat-phone { width: 100%; max-width: 320px; border-width: 8px; border-radius: 40px; }
  .chat-win { height: 480px; }
  .chat-text h2 { font-size: 30px; }
}
