/* ===== how-it-works.css — fact extraction visual, callout, chat mock ===== */

.hiw-block {
  margin-top: 56px;
}
.hiw-block + .hiw-block {
  margin-top: 72px;
  padding-top: 72px;
  border-top: 1px solid var(--rule);
}
.hiw-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 56px;
  align-items: center;
}
.hiw-text h3,
.hiw-block-title {
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 14px;
  letter-spacing: -0.005em;
  color: var(--ink);
  max-width: 640px;
}
.hiw-text p,
.hiw-block-sub {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0 0 12px;
  max-width: 640px;
}
.hiw-text p:last-child,
.hiw-block-sub {
  margin-bottom: 0;
}

/* Librarian visual: document → extracted facts */
.hiw-extract {
  display: grid;
  grid-template-columns: 1fr auto 1.3fr;
  gap: 18px;
  align-items: center;
}
.hiw-extract-doc {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 16px 18px;
  position: relative;
  /* Always keep the proportions of a real (US Letter) sheet of paper */
  aspect-ratio: 8.5 / 11;
}
.hiw-doc-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.hiw-doc-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink);
  margin-bottom: 14px;
  padding-right: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hiw-doc-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.hiw-doc-lines span {
  height: 2px;
  background: var(--rule);
  border-radius: 1px;
  display: block;
}
.hiw-doc-lines span:nth-child(1) {
  width: 92%;
}
.hiw-doc-lines span:nth-child(2) {
  width: 78%;
}
.hiw-doc-lines span:nth-child(3) {
  width: 86%;
}
.hiw-doc-lines span:nth-child(4) {
  width: 64%;
}
.hiw-doc-lines span:nth-child(5) {
  width: 80%;
}
.hiw-doc-lines span:nth-child(6) {
  width: 70%;
}
.hiw-doc-lines span:nth-child(7) {
  width: 56%;
}

.hiw-arrow {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.hiw-extract-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 16px 20px;
}
.hiw-extract-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.hiw-fact-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
}
.hiw-fact {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: baseline;
  margin: 0;
}
.hiw-fact dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin: 0;
}
.hiw-fact dd {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  color: var(--ink);
}

/* "More than quoting" callout */
.hiw-callout {
  margin-top: 56px;
  padding: 22px 26px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.hiw-callout-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 720px;
}
.hiw-callout-text strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Build Automations: single-column workflows visual ---------- */
.workflows-visual {
  margin-top: 36px;
}
.workflows-img {
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 0;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

/* ---------- Chat mock ---------- */
.chat-mock {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 36px;
  pointer-events: none;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--bg);
}
.chat-header .mock-brand {
  font-size: 14px;
  gap: 8px;
}
.chat-header .mock-brand-logo {
  width: 22px;
  height: 22px;
}
.chat-context {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.chat-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.chat-message.user {
  align-self: flex-end;
  max-width: 78%;
  background: var(--bg-alt);
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.chat-message.agent {
  align-self: stretch;
  width: 100%;
}
.agent-thinking {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.agent-thinking::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #000000;
  margin-top: -2px;
}
.agent-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 18px;
}
.cite {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--accent);
  vertical-align: super;
  margin-left: 1px;
  font-weight: 500;
}
.agent-body sup.cite {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--accent);
  vertical-align: super;
  margin-left: 1px;
  font-weight: 500;
}
.chat-citations {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-cite {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-left: 2px solid var(--accent);
  align-items: baseline;
}
.chat-cite-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}
.chat-cite-title {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.4;
}
.chat-cite-path {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.4;
}
.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
}
.chat-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: inherit;
}
.chat-action::after {
  content: "→";
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
}
.chat-input-mock {
  display: flex;
  align-items: center;
  padding: 14px 22px;
  border-top: 1px solid var(--rule-soft);
  gap: 12px;
  background: var(--bg);
}
.chat-input-placeholder {
  flex: 1;
  font-size: 14px;
  color: var(--ink-mute);
}
.chat-send {
  width: 30px;
  height: 30px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-mute);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-send svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 800px) {
  .hiw-callout {
    padding: 18px 20px;
    gap: 14px;
  }
  .hiw-callout-text {
    font-size: 14px;
  }
  .hiw-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hiw-extract {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  /* Keep the document sheet from going full-width (and absurdly tall) on mobile */
  .hiw-extract-doc {
    max-width: 50%;
    justify-self: center;
  }
  .hiw-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
  .chat-body {
    padding: 20px;
    gap: 18px;
  }
  .chat-message.user {
    max-width: 100%;
  }
  .chat-cite {
    padding: 8px 12px;
  }
  .chat-context {
    display: none;
  }
  .chat-input-placeholder {
    font-size: 12px;
  }
  .agent-body {
    font-size: 15px;
  }
}
