:root {
  --obsidian: #0a0a0a;
  --obsidian-soft: #111113;
  --obsidian-edge: #1a1a1d;
  --ruby-core: #ff1430;
  --ruby-mid: #b00820;
  --ruby-deep: #3a0209;
  --ruby-ember: #ffb199;
  --platinum: #e6e8ec;
  --silver: #b8b8bd;
  --steel: #6e6e75;
  --graphite: #6a6c72;
  --hairline: rgba(230, 232, 236, 0.08);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--obsidian);
  color: var(--platinum);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui,
    sans-serif;
  line-height: 1.55;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(255, 20, 48, 0.35);
  color: var(--platinum);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  position: relative;
}

.wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(520px, 100%);
  height: 280px;
  transform: translateX(-50%);
  background: radial-gradient(
    circle,
    rgba(255, 20, 48, 0.14) 0%,
    rgba(255, 20, 48, 0.04) 40%,
    transparent 70%
  );
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
}

.wrap > * {
  position: relative;
  z-index: 1;
}

header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}

header.top a.home {
  color: var(--silver);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

header.top a.home:hover {
  color: var(--platinum);
}

.brand {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ruby-ember);
  text-transform: uppercase;
  font-weight: 600;
}

.hero-band {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.gem {
  width: 72px;
  height: 86px;
  filter: drop-shadow(0 0 20px rgba(255, 20, 48, 0.45));
  animation: gem-breathe 6s ease-in-out infinite;
}

@keyframes gem-breathe {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 20px rgba(255, 20, 48, 0.45));
  }
  50% {
    transform: scale(1.03);
    filter: drop-shadow(0 0 28px rgba(255, 20, 48, 0.6));
  }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 10px;
}

h1 {
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.lede {
  color: var(--silver);
  margin-bottom: 12px;
  font-size: 15px;
  max-width: 560px;
}

.context-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--graphite);
  margin-bottom: 20px;
  min-height: 1em;
}

.chat-box {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(17, 17, 19, 0.85);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 20, 48, 0.06);
  backdrop-filter: blur(8px);
}

.chat-log {
  min-height: 280px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 20px;
}

.msg {
  margin-bottom: 16px;
  font-size: 15px;
}

.msg.user p {
  color: var(--ruby-ember);
}

.msg.assistant p {
  color: var(--platinum);
}

.msg .who {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--steel);
  margin-bottom: 6px;
}

.chat-form {
  border-top: 1px solid var(--hairline);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-form textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  background: var(--obsidian);
  border: 1px solid var(--obsidian-edge);
  border-radius: 10px;
  color: var(--platinum);
  padding: 12px;
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-form textarea:focus {
  outline: none;
  border-color: rgba(255, 20, 48, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 20, 48, 0.12);
}

.chat-form button {
  align-self: flex-start;
  background: var(--ruby-core);
  color: var(--platinum);
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(255, 20, 48, 0.4), 0 6px 20px rgba(255, 20, 48, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-form button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(255, 20, 48, 0.12), 0 10px 28px rgba(255, 20, 48, 0.35);
}

.chat-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-actions #chat-send {
  align-self: auto;
}

.icon-btn,
.chat-form .icon-btn {
  align-self: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 20, 48, 0.06);
  border: 1px solid rgba(255, 20, 48, 0.22);
  color: var(--silver);
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--ruby-core);
  color: var(--platinum);
  background: rgba(255, 20, 48, 0.12);
  transform: none;
  box-shadow: none;
}

.icon-btn.on {
  background: rgba(255, 20, 48, 0.18);
  border-color: var(--ruby-core);
  color: var(--ruby-ember);
}

.icon-btn.listening {
  background: var(--ruby-core);
  border-color: var(--ruby-core);
  color: var(--platinum);
  animation: mic-pulse 1.4s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 20, 48, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 20, 48, 0);
  }
}

.mic-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ruby-ember);
}

.disclaimer {
  margin-top: 20px;
  font-size: 12px;
  color: var(--steel);
  line-height: 1.5;
}

.disclaimer a {
  color: var(--ruby-ember);
}

.err {
  color: #ff8a80;
  font-size: 13px;
  min-height: 1.2em;
}

.starter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.starter button {
  background: rgba(255, 20, 48, 0.06);
  border: 1px solid rgba(255, 20, 48, 0.22);
  color: var(--silver);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.starter button:hover {
  border-color: var(--ruby-core);
  color: var(--platinum);
  background: rgba(255, 20, 48, 0.12);
}
