/* tokens
   workspace bg: #E7E9EE flat office-chat grey (the rest of the app, out of focus)
   chat header: #232B3D slate, online dot #35C46A
   bubble: #FFFFFF panel on #E7E9EE, border #D7DBE3
   ink: #1B2230 (sender/caption), #6B7280 (muted/seen line)
   link-preview card: #F4F5F7 fill, #D7DBE3 border, tag colour #3457D5 (office-blue accent,
     solid, not a gradient)
   photo/attachment palette comes from the art itself (mustard hallway, brown doors, pig pink) -
     chat chrome stays cool/neutral on purpose so the candid photo reads as the one warm thing
     dropped into a grey app, the way an office photo actually looks pasted into chat
   type: Karla (UI text, self-hosted woff2) + Overpass Mono (timestamps/CA/link meta,
     self-hosted woff2), no CDN
   corner radius: 6px on the bubble/photo/link-card (real chat-attachment radius, not a
     generic soft-UI 16px+ card), 0 elsewhere
   motion: one three-dot "typing" beat before the message appears, once, on load. prefers-
     reduced-motion skips straight to the message.
*/

@font-face {
  font-family: "Karla";
  src: url("assets/fonts/karla-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("assets/fonts/karla-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Overpass Mono";
  src: url("assets/fonts/overpassmono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Overpass Mono";
  src: url("assets/fonts/overpassmono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #E7E9EE;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 3vh 4vw;
  font-family: "Karla", "Segoe UI", Arial, sans-serif;
  color: #1B2230;
}

.workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.chatpane {
  width: min(94vw, 460px);
  background: #FFFFFF;
  border: 1px solid #D7DBE3;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(27, 34, 48, 0.10);
  overflow: hidden;
}

.chatbar {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.6em 0.9em;
  background: #232B3D;
  color: #DCE1EA;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #35C46A;
  flex-shrink: 0;
}

.channel {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.canary {
  margin-left: auto;
  font-family: "Overpass Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: #8A93A6;
}

.thread {
  padding: 0.9em 0.9em 1em;
}

.typing {
  display: flex;
  gap: 4px;
  padding: 0.4em 0 0.7em 0.2em;
  animation: typing-out 0s 1.1s forwards;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #A7AEBB;
  animation: typing-bounce 0.9s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes typing-out {
  to { opacity: 0; height: 0; padding: 0; overflow: hidden; }
}

.msg {
  display: flex;
  gap: 0.65em;
  opacity: 0;
  animation: msg-in 0.4s 1.05s ease-out forwards;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.pfp {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  flex-shrink: 0;
  border: 1px solid #D7DBE3;
}

.msg-body {
  min-width: 0;
  flex: 1;
}

.msg-head {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}

.sender {
  font-weight: 700;
  font-size: 13px;
}

.stamp {
  font-family: "Overpass Mono", ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  color: #8A93A6;
}

.attach {
  margin: 0.4em 0 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #D7DBE3;
  line-height: 0;
}

.attach img {
  display: block;
  width: 100%;
  height: auto;
}

.caption {
  margin: 0.55em 0 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: #1B2230;
}

.seen {
  margin: 0.35em 0 0;
  font-size: 11px;
  color: #9AA1B0;
}

.linkcard {
  display: block;
  margin: 0.85em 0 0 2.9em;
  padding: 0.65em 0.75em;
  background: #F4F5F7;
  border: 1px solid #D7DBE3;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}

.linkcard:hover {
  border-color: #3457D5;
}

.linkcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6em;
}

.linkcard-tag {
  font-family: "Overpass Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.09em;
  color: #3457D5;
  font-weight: 700;
}

.linkcard-tk {
  font-weight: 700;
  font-size: 12.5px;
  color: #1B2230;
}

.ca {
  display: block;
  width: 100%;
  margin: 0.4em 0 0;
  padding: 0.4em 0.5em;
  font-family: "Overpass Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(10.5px, 3vw, 12.5px);
  color: #1B2230;
  background: #FFFFFF;
  border: 1px solid #D7DBE3;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  word-break: break-all;
}

.ca:hover {
  border-color: #3457D5;
  color: #3457D5;
}

.linkcard-bottom {
  margin-top: 0.4em;
  font-family: "Overpass Mono", ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  color: #9AA1B0;
}

.linkcard-bottom .sep {
  margin: 0 0.4em;
}

.links {
  margin-top: 1.6vh;
  display: flex;
  gap: 1.4em;
}

.links a {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #6B7280;
  text-decoration: none;
}

.links a:hover {
  color: #232B3D;
}

.links svg {
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .typing { display: none; }
  .msg { opacity: 1; animation: none; }
}

@media (max-width: 480px) {
  .chatpane { width: min(96vw, 460px); }
  .linkcard { margin-left: 0; }
  .caption { font-size: 13px; }
}

@media (min-width: 920px) {
  .chatpane { width: 480px; }
}
