:root {
  --bg: #f7f9fc;
  --ink: #111827;
  --muted: #5b677a;
  --line: #d8dee8;
  --brand: #145184;
  --brand-2: #1767aa;
  --panel: #ffffff;
  --dark: #0f172a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input {
  font: inherit;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  padding: 2rem clamp(1rem, 4vw, 3rem);
}

h1, h2, h3, p { margin: 0; }

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  margin-top: 0.4rem;
}

h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); }
h3 { font-size: 1.05rem; }

.eyebrow {
  color: var(--brand-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-top: 1rem;
  max-width: 56rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

button {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  padding: 0.7rem 0.9rem;
}

button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.button-link {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-height: 2.75rem;
  padding: 0.7rem 1.25rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.button-link:hover {
  border-color: var(--brand-2);
  color: var(--brand-2);
}

.button-link.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.button-link.primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(20, 81, 132, 0.25);
  transform: translateY(-1px);
}

/* Hero header: keep the text fluid and the two CTAs as an aligned,
   equal-width pair instead of ragged, mid-floating buttons. */
.public-hero {
  gap: 2rem;
}

.public-hero > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.public-hero .actions {
  align-items: stretch;
  align-self: center;
  flex: 0 0 auto;
  flex-direction: column;
  min-width: 12rem;
}

main {
  margin: 0 auto;
  max-width: 1240px;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem;
}

.metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics article,
.panel,
.card,
.answer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics article {
  padding: 1.1rem;
}

.metrics span {
  color: var(--brand);
  display: block;
  font-size: 2rem;
  font-weight: 800;
}

.metrics p {
  color: var(--muted);
  margin-top: 0.25rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.tabs button.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #ffffff;
}

.panel {
  display: none;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.panel.active { display: block; }

.section-head {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-head > p {
  color: var(--muted);
  line-height: 1.6;
  max-width: 30rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 0.8rem;
}

.card {
  padding: 1rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.card p {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 0.45rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}

.meta {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  margin-top: 0.65rem;
}

pre {
  background: #0f172a;
  border-radius: 6px;
  color: #dbeafe;
  overflow: auto;
  padding: 0.9rem;
}

.split {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split h3 {
  margin-bottom: 0.75rem;
}

.chat-form {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chat-form div {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr auto;
}

input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.8rem;
  width: 100%;
}

.answer {
  color: var(--muted);
  line-height: 1.65;
  min-height: 5rem;
  padding: 1rem;
}

.guide {
  color: var(--muted);
  line-height: 1.8;
}

code {
  background: #eef6ff;
  border-radius: 4px;
  color: var(--brand);
  padding: 0.1rem 0.3rem;
}

footer {
  align-items: center;
  background: var(--dark);
  color: #cbd5e1;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 3rem);
}

footer a {
  color: #ffffff;
  font-weight: 800;
}

@media (max-width: 860px) {
  .topbar,
  .section-head,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .grid,
  .split {
    grid-template-columns: 1fr;
  }

  .chat-form div {
    grid-template-columns: 1fr;
  }

  .public-hero .actions {
    align-self: stretch;
    min-width: 0;
  }
}
