/* Nuka Agjenti — demo chat. Tokens derived from the Nuka dashboard
   (AXO design system, accent = Nuka brand red #ED2224). Light only. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geistmono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #EDE7DC;
  --surface: #F6F2EA;
  --sunken: #E2DACB;
  --ink: #171310;
  --muted: #6B5F52;
  --accent: #ED2224;
  --accent-100: #FDEEEE;
  --accent-600: #C41B1D;
  --divider: color-mix(in srgb, #171310 13%, transparent);
  --divider-strong: color-mix(in srgb, #171310 26%, transparent);
  --font-body: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", monospace;
  --r: 2px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 1px 2px color-mix(in srgb, #171310 8%, transparent),
            0 6px 20px color-mix(in srgb, #171310 7%, transparent);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.lab {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent-600);
}

/* ---------------- header ---------------- */
.top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand-logo { width: 92px; flex: none; display: block; }
.brand-logo .wm { fill: var(--ink); }
.brand-logo .dot { fill: var(--accent); }
.brand-logo .sub { fill: var(--muted); }
.top-txt { display: flex; flex-direction: column; gap: 2px; }
.sub-line { font-size: 12.5px; color: var(--muted); }
.live-dot {
  margin-left: auto;
  width: 9px; height: 9px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

/* ---------------- gate ---------------- */
.gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-top: 2px solid var(--accent);
  border-radius: var(--r);
  padding: 30px 28px;
  box-shadow: var(--shadow);
}
.gate-card h1 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.022em;
  margin: 8px 0 10px;
}
.gate-note { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
#gateForm { display: flex; gap: 8px; }
#gatePass {
  flex: 1;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--divider-strong);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink);
  transition: border-color 120ms var(--ease), background 120ms var(--ease);
}
#gatePass:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.gate-err { margin-top: 12px; font-size: 13px; color: var(--accent-600); }

.btn {
  font: inherit;
  font-weight: 500;
  border: none;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 120ms var(--ease), background 120ms var(--ease);
}
.btn:hover { transform: translateY(-1px); background: #2a231d; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- chat ---------------- */
.chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  margin: 0 auto;
  min-height: 0;
}
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 26px 20px 12px;
}
.chat-intro {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 22px;
}
.chat-intro p:not(.lab) { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--divider-strong);
  border-radius: var(--r);
  cursor: pointer;
  transition: transform 120ms var(--ease), border-color 120ms var(--ease), background 120ms var(--ease);
}
.chip:hover { transform: translateY(-1px); border-color: var(--accent); background: var(--accent-100); }
.chip:active { transform: scale(.98); }

.msgs { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-direction: column; max-width: 82%; animation: rise 180ms var(--ease); }
.row.me { align-self: flex-end; align-items: flex-end; }
.row.ag { align-self: flex-start; align-items: flex-start; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.bubble {
  padding: 10px 14px;
  border-radius: var(--r);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.row.me .bubble { background: var(--ink); color: var(--bg); }
.row.ag .bubble { background: var(--surface); border: 1px solid var(--divider); }
.who {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.staff-card {
  margin-top: 6px;
  padding: 10px 14px;
  background: var(--accent-100);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  font-size: 13px;
  color: var(--ink);
}
.staff-card .lab { display: block; margin-bottom: 4px; }

.typing { display: inline-flex; gap: 5px; padding: 14px; }
.typing i {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--muted);
  animation: blink 1.1s var(--ease) infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink {
  0%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.err-note {
  font-size: 13px;
  color: var(--accent-600);
  padding: 8px 0;
}

/* ---------------- composer ---------------- */
.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 20px 6px;
  border-top: 1px solid var(--divider);
  background: var(--bg);
}
#input {
  flex: 1;
  font: inherit;
  resize: none;
  max-height: 130px;
  padding: 11px 13px;
  border: 1px solid var(--divider-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 120ms var(--ease);
}
#input:focus { outline: none; border-color: var(--accent); }
.send { padding: 11px 14px; flex: none; display: grid; place-items: center; }
.send:disabled { opacity: .45; cursor: default; transform: none; }
.foot {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 4px 16px calc(10px + env(safe-area-inset-bottom));
}

@media (max-width: 480px) {
  .brand-logo { width: 76px; }
  .row { max-width: 92%; }
  .chat-scroll { padding: 18px 14px 10px; }
  .composer { padding: 10px 14px 6px; }
}
