:root {
  --ink: #070708;
  --ink-2: #0e0e10;
  --panel: #121214;
  --panel-2: #18181b;
  --line: rgba(244, 241, 234, 0.08);
  --line-strong: rgba(244, 241, 234, 0.14);
  --text: #f4f1ea;
  --muted: #8d8880;
  --red: #c8102e;
  --red-soft: rgba(200, 16, 46, 0.16);
  --red-glow: rgba(200, 16, 46, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--text);
}

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

.atmosphere {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(200, 16, 46, 0.14), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 255, 255, 0.04), transparent 50%),
    linear-gradient(180deg, #0b0b0d 0%, var(--ink) 40%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 8, 0.72);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.west-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--red-soft);
  background: rgba(200, 16, 46, 0.08);
}

.wordmark {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.divider {
  color: var(--muted);
  opacity: 0.5;
  font-weight: 300;
}

.instance {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.pill {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f4d7dc;
  border: 1px solid var(--red-soft);
  background: rgba(200, 16, 46, 0.1);
  padding: 0.35rem 0.6rem;
}

.ghost {
  appearance: none;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 0 4rem;
}

.kicker {
  color: var(--red);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 0.85rem;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 36rem;
  margin: 0 0 2rem;
}

.search-form {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.search-form.docked {
  position: sticky;
  bottom: 0;
  padding: 0.85rem 0 0.25rem;
  background: linear-gradient(180deg, transparent, var(--ink) 28%);
}

.field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  padding: 0.15rem 0.15rem 0.15rem 1rem;
  box-shadow: 0 0 0 1px rgba(200, 16, 46, 0.04), 0 18px 50px rgba(0, 0, 0, 0.28);
}

.field:focus-within {
  border-color: rgba(200, 16, 46, 0.45);
  box-shadow: 0 0 0 3px var(--red-soft), 0 18px 50px rgba(0, 0, 0, 0.28);
}

.field input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  padding: 0.95rem 0;
}

.field input::placeholder {
  color: #6f6b64;
}

.submit {
  appearance: none;
  border: 0;
  background: var(--red);
  color: white;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 1.15rem;
  cursor: pointer;
}

.submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.chip {
  appearance: none;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.chip:hover {
  color: var(--text);
  border-color: var(--red);
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 0.5rem 0 1rem;
}

.turn {
  display: grid;
  gap: 0.7rem;
}

.question {
  justify-self: end;
  max-width: 85%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
  font-size: 0.98rem;
  line-height: 1.45;
}

.answer {
  background: rgba(18, 18, 20, 0.9);
  border: 1px solid var(--line);
  border-left: 2px solid var(--red);
  padding: 1.05rem 1.1rem 1.15rem;
}

.answer-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.answer-label span {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e8b4bc;
}

.copy {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.answer-body {
  font-size: 1.02rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.answer-body p {
  margin: 0 0 0.75rem;
}

.answer-body p:last-child {
  margin-bottom: 0;
}

.sources {
  display: grid;
  gap: 0.55rem;
}

.sources-title {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.35rem;
}

.source {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
}

.source summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.84rem;
  color: #d9d3c8;
}

.source summary::-webkit-details-marker {
  display: none;
}

.source pre {
  margin: 0.75rem 0 0;
  white-space: pre-wrap;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #bdb7ad;
}

.sim {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.error {
  border-color: rgba(200, 16, 46, 0.45);
  color: #f0c9cf;
}

.pending {
  color: var(--muted);
  font-size: 0.92rem;
}

.dots::after {
  content: "";
  animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
  0% { content: ""; }
  33% { content: "."; }
  66% { content: ".."; }
  100% { content: "..."; }
}

.hidden {
  display: none !important;
}

.disclaimer {
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 1.25rem;
  color: #6a665f;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  .nav {
    padding: 0.9rem 1rem;
  }

  .instance {
    display: none;
  }

  .search-form {
    flex-direction: column;
  }

  .submit {
    padding: 0.85rem;
  }

  .question {
    max-width: 100%;
  }
}
