@font-face {
  font-family: WorktualSlab;
  src: url("/static/fonts/WorktualSlab-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: WorktualSlab;
  src: url("/static/fonts/WorktualSlab-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: WorktualSlab;
  src: url("/static/fonts/WorktualSlab-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("/static/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("/static/fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #000;
  --ink: #fff;
  --muted: #d2d3d4;
  --purple: #7423d7;
  --purple-hot: #903af9;
  --cyan: #6eeeff;
  --gold: #f7ce81;
  --pink: #ff91b3;
  --lilac: #c18fff;
  --panel: #0b1120;
  --line: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 80% 0%, rgba(40, 1, 92, 0.85), transparent 70%),
    var(--black);
  color: var(--ink);
  font-family: Inter, sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #000;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: center; }

.nav { display: flex; align-items: center; gap: 32px; }

.nav-link {
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.14px;
  line-height: 28px;
}

.nav-cta,
.send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 12px 32px;
  border: 0;
  border-radius: 0 20px;
  background: var(--purple);
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 14px;
  line-height: 24px;
  text-decoration: none;
  cursor: pointer;
}

.nav-cta:hover,
.send:hover { background: var(--purple-hot); }

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: WorktualSlab, serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

h1 {
  max-width: 16ch;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
}

h2 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
}

.lede {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.topics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.topic {
  min-height: 120px;
  padding: 20px;
  border: 0;
  border-radius: 0 40px;
  color: #000;
  font-family: WorktualSlab, serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

.topic-cyan { background: var(--cyan); }
.topic-purple { background: var(--lilac); }
.topic-gold { background: var(--gold); }
.topic-pink { background: var(--pink); }

.topic:hover { transform: translateY(-2px); }

.stage {
  margin-top: 48px;
  max-width: 720px;
}

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.chat-launcher {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 0 24px;
  background: var(--purple);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(116, 35, 215, 0.45);
}

.chat-launcher svg { width: 30px; height: 30px; }

.chat-launcher:hover,
.chat-launcher[aria-expanded="true"] { background: var(--purple-hot); }

.chat-popup {
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0 28px;
  background: var(--panel);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.chat-popup[hidden] { display: none; }

.chat-popup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #000;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  margin-left: 12px;
  color: var(--muted);
  font-size: 12px;
}

.chat-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6eeeff;
}

.chat-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 0 12px;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.chat-close:hover { background: #1f1f1f; }

.chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 16px;
}

.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}

.bubble {
  max-width: 85%;
  padding: 12px 14px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
}

.bubble p { margin: 0; }

.bubble.agent {
  align-self: flex-start;
  border-radius: 4px 16px 16px 16px;
  background: #1f1f1f;
}

.bubble.user {
  align-self: flex-end;
  border-radius: 16px 4px 16px 16px;
  background: var(--purple);
}

.bubble.typing {
  display: flex;
  gap: 5px;
  width: 64px;
  padding: 14px 16px;
}

.bubble.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: blink 1s infinite ease-in-out;
}

.bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.bubble.error { border: 1px solid #d8613c; }

.sources {
  margin-top: 8px;
  color: var(--cyan);
  font-size: 12px;
  line-height: 1.4;
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.composer input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 0 16px;
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 16px;
}

.composer input:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border-radius: 0 14px;
}

.send svg { width: 18px; height: 18px; }

.send:disabled { opacity: 0.6; cursor: wait; }

.connect {
  padding: 32px 28px;
  border-radius: 0 40px;
  background: #1f1f1f;
}

.connect p { color: var(--muted); }

.connect code {
  color: var(--cyan);
  font-size: 0.95em;
}

.fine { font-size: 14px; }

.site-footer {
  padding: 28px 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 900px) {
  .header-inner { height: 76px; padding: 0 16px; }
  .nav { gap: 12px; }
  .nav-link { display: none; }
  main { padding: 32px 16px 64px; }
  .topics { grid-template-columns: 1fr; }
  .topic { min-height: 88px; font-size: 20px; }
  .chat-widget { right: 12px; bottom: 12px; }
  .chat-popup { height: min(70vh, 560px); }
}
