/* Heartland AI Works — Cloudflare Pages landing page
   Single-file CSS, system font stack + one serif heading family.
   Mirrors the post-fix Carrd visual: warm minimal, mobile-first, no horizontal overflow. */

:root {
  --bg: #fdfbf7;
  --fg: #161444;
  --fg-soft: #4a4a5e;
  --accent: #8a3ffc;
  --accent-2: #ff7a59;
  --rule: #e7e3d8;
  --max: 720px;
  --pad: 1.25rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Header */
.site-header {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem var(--pad) 0.5rem;
  display: flex;
  justify-content: center;
}
.brand-logo {
  display: block;
  max-width: 360px;
  width: 100%;
  height: auto;
}

/* Hero */
.hero {
  text-align: center;
  padding: 2.5rem 0 2.25rem;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-family: "Libre Baskerville", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--fg);
}
.hero-sub {
  font-family: "Libre Baskerville", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.05rem, 3.4vw, 1.2rem);
  margin: 0 0 1.25rem;
  color: var(--fg);
}
.hero-body {
  margin: 0 auto 1.75rem;
  max-width: 56ch;
  color: var(--fg-soft);
}
.hero-micro {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: var(--fg-soft);
}

/* Sections */
section {
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--rule);
}
section:last-of-type {
  border-bottom: none;
}
section h2 {
  font-family: "Libre Baskerville", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  margin: 0 0 1.1rem;
  text-align: center;
}

/* How it works */
.how ol {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  max-width: 56ch;
  margin-inline: auto;
}
.how li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
  margin: 0 0 1rem;
  color: var(--fg-soft);
}
.how li strong { color: var(--fg); }
.how li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0.05rem;
  width: 1.7rem; height: 1.7rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}

/* Pricing */
.pricing-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 56ch;
  text-align: center;
}
.pricing-list li {
  margin: 0.6rem 0;
  color: var(--fg);
}
.pricing-list li em {
  color: var(--fg-soft);
}

/* CTA buttons */
.cta {
  display: inline-block;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.06s ease, box-shadow 0.15s ease;
}
.cta-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 6px 20px rgba(138, 63, 252, 0.18);
}
.cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(138, 63, 252, 0.22);
}
.cta-primary[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

/* Self-serve demo */
.demo-launcher { margin: 1.5rem 0 0; }

.demo-panel {
  margin: 1.5rem auto 0;
  max-width: 56ch;
  text-align: left;
}

.demo-url-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 6px 20px rgba(22, 20, 68, 0.05);
}
.demo-url-form label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--fg);
}
.demo-url-form input[type="url"] {
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  outline: none;
  font-family: inherit;
}
.demo-url-form input[type="url"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 63, 252, 0.15);
}
.demo-note {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  color: var(--fg-soft);
}

.demo-chat {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(22, 20, 68, 0.05);
  display: flex;
  flex-direction: column;
  height: 460px;
  max-height: 70vh;
  overflow: hidden;
}
.demo-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--fg-soft);
}
.demo-chat-reset {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.demo-chat-reset:hover { text-decoration: underline; }

.demo-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.demo-msg {
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  max-width: 85%;
  line-height: 1.45;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.demo-msg-assistant {
  background: #f4efe6;
  color: var(--fg);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.demo-msg-user {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.demo-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.demo-chat-form input {
  flex: 1;
  font-size: 0.95rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  outline: none;
  font-family: inherit;
  background: white;
}
.demo-chat-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 63, 252, 0.15);
}
.demo-chat-form button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  font-weight: 600;
}
.demo-chat-form button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.cta-final {
  text-align: center;
  padding: 2.5rem 0 3.25rem;
}
.cta-aside {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--fg-soft);
  max-width: 50ch;
  margin-inline: auto;
}

/* Footer */
.site-footer {
  padding: 1.5rem var(--pad) 4rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--fg-soft);
  border-top: 1px solid var(--rule);
}
.site-footer a {
  color: var(--fg-soft);
  text-decoration: underline;
}

/* Mobile-specific */
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero { padding: 1.75rem 0 1.5rem; }
  .cta { padding: 0.85rem 1.2rem; font-size: 0.95rem; }
}

/* Don't let Chatbase widget cover the CTA on small screens */
@media (max-width: 480px) {
  .cta-final { padding-bottom: 5.5rem; }
}
