/* Tamrin · the tutor's chat as a mind at work (js/chat.js). The section is paper; the night rules stay for a later choice. */

  .chat { position: relative; overflow: hidden; }
  /* the section's edge (the owner, 2026-10-11): a living shade. Soft lights ride along the edge and
     breathe in and out of the section at their own pace, like a slow tide washing in from outside the
     frame; they surge while Sage speaks. Drawn on a canvas (js below). */
  .chat.night .edge { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
  .chat .edge canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: auto; }
  .chat .edge { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
  /* paper: the lights become watercolour washes, multiplied into the paper */
  .chat.paper .edge canvas { mix-blend-mode: multiply; }
  .chat.paper .mindfield { mix-blend-mode: multiply; }
  .chat.paper .chat-card { position: relative; overflow: hidden; background: rgba(255,253,249,.72); border: 1px solid var(--hairline); box-shadow: 0 24px 60px rgba(47,58,143,.14); }
  .chat.paper .glow i { mix-blend-mode: multiply; }
  .chat.paper .glow .g1 { background: #C3CAFF; } .chat.paper .glow .g2 { background: #F7C9AE; } .chat.paper .glow .g3 { background: #D9C9FF; }
  .chat.paper .chat-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2; box-shadow: inset 0 0 40px rgba(47,58,143,.08); animation: rimP 4.5s ease-in-out infinite; }
  .chat.paper .chat-card.talking::after { animation: rimPTalk .32s ease-in-out infinite alternate; }
  @keyframes rimP { 0%, 100% { box-shadow: inset 0 0 40px rgba(47,58,143,.07); } 50% { box-shadow: inset 0 0 56px rgba(232,113,60,.12); } }
  @keyframes rimPTalk { 0% { box-shadow: inset 0 0 34px rgba(47,58,143,.1); } 100% { box-shadow: inset 0 0 70px rgba(232,113,60,.26); } }
  .chat.paper .chat-log .wait { font-family: var(--f-hand); font-size: 18px; opacity: .7; }
  .chat.paper .bars i { transition: height .12s ease; }
  .chat.night { background: var(--night); color: var(--on-primary); }
  .chat.night .lab { color: var(--primary-light); } .chat.night .p { color: var(--on-primary-secondary); } .chat.night .aside { color: var(--accent-soft); }
  .chat.night .aside svg path { stroke: var(--accent-soft); }
  .chat.night .h2 { color: var(--on-primary); }
  .chat > .wrap { display: grid; grid-template-columns: 1fr 480px; gap: 64px; align-items: center; position: relative; z-index: 1; }
  /* the field behind everything: a canvas the size of the section */
  .mindfield, .edge { opacity: 1 !important; animation: none; }
  .mindfield { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
  .chat.paper { min-height: 640px; }

  /* ---- the box: night glass, the glow inside its edge ---- */
  .chat.night .chat-card { position: relative; overflow: hidden; background: rgba(28, 35, 86, .72); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 30px 80px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04); }
  .chat-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }
  .glow { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
  .glow i { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: var(--o, .55); transform: translate(var(--x, 0), var(--y, 0)) scale(var(--s, 1)); transition: transform 1.4s cubic-bezier(.3,.7,.3,1), opacity .9s ease; }
  .glow .g1 { left: -80px; top: -60px; width: 300px; height: 300px; background: var(--primary-mid); --o: .35; }
  .glow .g2 { right: -90px; top: 30%; width: 260px; height: 260px; background: var(--accent-soft); --o: .22; }
  .glow .g3 { left: 20%; bottom: -110px; width: 280px; height: 280px; background: #B48CFF; --o: .3; }
  /* the inner rim: a soft light that breathes along the edge; it beats while she speaks */
  .chat.night .chat-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2; box-shadow: inset 0 0 40px rgba(142,155,255,.18), inset 0 0 90px rgba(142,155,255,.06); animation: rim 4.5s ease-in-out infinite; }
  .chat-card.talking::after { animation: rimTalk .32s ease-in-out infinite alternate; }
  @keyframes rim { 0%, 100% { box-shadow: inset 0 0 40px rgba(142,155,255,.16), inset 0 0 90px rgba(142,155,255,.05); } 50% { box-shadow: inset 0 0 56px rgba(142,155,255,.28), inset 0 0 120px rgba(242,176,137,.08); } }
  @keyframes rimTalk { 0% { box-shadow: inset 0 0 34px rgba(142,155,255,.22), inset 0 0 80px rgba(242,176,137,.06); } 100% { box-shadow: inset 0 0 70px rgba(142,155,255,.5), inset 0 0 150px rgba(242,176,137,.16); } }
  .chat.night .chat-head .name { color: var(--on-primary); } .chat.night .chat-head .live { color: var(--primary-light); }
  .chat.night .chat-log .them { background: rgba(255,255,255,.1); color: var(--on-primary); }
  .chat.night .chat-log .me { background: var(--primary-light); color: var(--ink); }
  .chat.night .chat-input input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: var(--on-primary); }
  .chat.night .chat-input input::placeholder { color: #8C93B8; }
  .chat.night .chat-input .mic { background: var(--primary-light); } .chat.night .chat-input .mic svg { stroke: var(--ink); }
  .chat.night .chat-foot { color: #8C93B8; }
  .chat.night .bars i { background: var(--primary-light); transition: height .12s ease; }
  .chat-log { height: 300px; overflow-y: auto; scrollbar-width: none; } .chat-log::-webkit-scrollbar { display: none; }
  .chat.night { min-height: 640px; } .chat > .wrap { min-height: 448px; }
  .chat-log .wait { font-family: var(--f-hand); font-size: 18px; opacity: .7; }
  .chat-log p.typing::after { content: ""; display: inline-block; width: 2px; height: .9em; margin-left: 2px; background: currentColor; vertical-align: -0.1em; animation: caret 1s steps(1) infinite; }
  @media (max-width: 1023px) { .chat > .wrap { grid-template-columns: 1fr; } }

/* the chat section's canvases and glow are ground: the entrance leaves them in place */
.chat.paper > .mindfield, .chat.paper > .edge { opacity: 1 !important; animation: none !important; }
.chat.paper .chat-card > .glow { opacity: 1 !important; animation: none !important; }
@media (max-width: 1023px) { .chat.paper { min-height: 0; } .chat.paper > .wrap { min-height: 0; } .chat-log { height: 240px; } }

.glow-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
