:root {
  color-scheme: dark;
  --bg: #0a0b0f;
  --panel: #111319;
  --panel-soft: #171a22;
  --line: #282c37;
  --text: #f7f7f8;
  --muted: #8d919d;
  --accent: #c9ff3f;
  --accent-deep: #91c900;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 15%, rgb(201 255 63 / 9%), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
}

button,
textarea {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  min-height: 100vh;
}

.intro {
  display: flex;
  flex-direction: column;
  padding: 42px clamp(40px, 7vw, 110px);
  border-right: 1px solid rgb(255 255 255 / 6%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #10120b;
  font-size: 14px;
  transform: rotate(-3deg);
}

.intro-copy {
  max-width: 650px;
  margin: auto 0;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

h1 {
  max-width: 620px;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(54px, 7vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.065em;
}

h1 span {
  color: var(--accent);
}

.description {
  max-width: 570px;
  margin: 32px 0 42px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.features {
  display: flex;
  gap: 36px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-icon {
  display: grid;
  flex: 0 0 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #3c4330;
  border-radius: 50%;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.feature strong {
  font-size: 14px;
}

.feature p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.footer-note {
  margin: 0;
  color: #555964;
  font-size: 12px;
}

.chat-panel {
  display: grid;
  place-items: center;
  padding: 34px;
  background:
    linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px);
  background-size: 42px 42px;
}

.chat-card {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  width: min(100%, 530px);
  height: min(760px, calc(100vh - 68px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgb(17 19 25 / 96%);
  box-shadow: 0 35px 100px rgb(0 0 0 / 45%);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.agent-avatar,
.message-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #11140c;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.agent-avatar {
  width: 46px;
  height: 46px;
  font-size: 19px;
}

.chat-header h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.chat-header p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: none;
}

.status-dot.closed {
  background: #8d919d;
  box-shadow: none;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding: 28px 24px;
  scrollbar-color: #353946 transparent;
  scrollbar-width: thin;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 88%;
  animation: message-in 240ms ease-out;
}

.message-row.outgoing {
  align-self: flex-end;
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 12px;
}

.message-author {
  display: block;
  margin: 0 0 6px 3px;
  color: var(--muted);
  font-size: 11px;
}

.message-bubble {
  padding: 13px 16px;
  border-radius: 5px 17px 17px;
  background: var(--panel-soft);
  color: #e9e9ec;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.outgoing .message-bubble {
  border-radius: 17px 17px 5px;
  background: var(--accent);
  color: #15180f;
}

.message-row.error .message-bubble {
  background: #362025;
  color: #ffb4b4;
}

.system-message {
  align-self: center;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.closed-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  margin: 0 20px;
  padding: 16px;
  border: 1px solid #3a3e49;
  border-radius: 18px;
  background: #15171d;
}

.closed-panel[hidden] {
  display: none;
}

.closed-icon {
  display: grid;
  grid-row: span 2;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #2d3127;
  color: var(--accent);
  font-weight: 700;
}

.closed-panel strong {
  font-size: 14px;
}

.closed-panel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.closed-panel button {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 12px 16px;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #10120b;
  font-weight: 700;
}

.closed-panel button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0 20px;
  padding: 10px 10px 10px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d0f14;
  transition: border-color 160ms ease;
}

.composer:focus-within {
  border-color: #5d693c;
}

.composer textarea {
  width: 100%;
  max-height: 120px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: #626672;
}

.composer button {
  display: grid;
  flex: 0 0 42px;
  height: 42px;
  cursor: pointer;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: var(--accent);
  color: #10120b;
  transition: transform 160ms ease, background 160ms ease;
}

.composer button:hover {
  background: #d5ff69;
  transform: translateY(-2px);
}

.composer button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.composer svg {
  width: 20px;
  fill: currentColor;
}

.privacy {
  margin: 12px 0 17px;
  color: #616570;
  font-size: 10px;
  text-align: center;
}

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

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 900px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .intro {
    min-height: auto;
    padding: 28px 24px 54px;
    border: 0;
  }

  .intro-copy {
    margin: 70px 0 0;
  }

  h1 {
    font-size: clamp(52px, 15vw, 82px);
  }

  .footer-note {
    display: none;
  }

  .chat-panel {
    min-height: 720px;
    padding: 20px;
  }

  .chat-card {
    height: 680px;
  }
}

@media (max-width: 560px) {
  .features {
    flex-direction: column;
    gap: 18px;
  }

  .chat-panel {
    min-height: 100svh;
    padding: 0;
  }

  .chat-card {
    width: 100%;
    height: 100svh;
    border: 0;
    border-radius: 0;
  }
}
