/* TextForAgents — v8 design system.
   Pure CSS, system font stack, no external assets. The apex CSP is
   default-src 'self' with no 'unsafe-inline', so all styling lives
   here and all behavior in /connect.js. */

:root {
  --ink: #0a1122;
  --ink-soft: #131f3a;
  --text: #1c2735;
  --muted: #5b6b82;
  --faint: #8593a9;
  --bg: #ffffff;
  --bg-alt: #f5f7fc;
  --line: #e2e8f2;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-dark: #4338ca;
  --success: #047857;
  --success-bg: #ecfdf5;
  --code-bg: #0b1226;
  --code-text: #d7e3ff;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(10, 17, 34, 0.05), 0 4px 14px rgba(10, 17, 34, 0.05);
  --shadow-md: 0 2px 4px rgba(10, 17, 34, 0.06), 0 14px 34px rgba(10, 17, 34, 0.10);
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #c7d2fe; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--brand-dark); }
a:hover { color: var(--brand); }

:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; border-radius: 4px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.5rem 1.6rem; padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em;
  color: var(--ink); margin: 0;
}
.brand-mark { width: 1.7rem; height: 1.7rem; border-radius: 6px; flex: none; }
nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-left: auto; font-size: 0.97rem; }
nav a { text-decoration: none; color: var(--text); font-weight: 500; }
nav a:hover { color: var(--brand-dark); text-decoration: none; }

/* ---------- Sections ---------- */

main > section { padding: 3.4rem 0; }
main > section.alt { background: var(--bg-alt); }
section p, section li { max-width: 48rem; }
h2 {
  font-size: 1.85rem; line-height: 1.2; letter-spacing: -0.02em;
  color: var(--ink); margin: 0 0 0.9rem; font-weight: 800;
}
h3 { font-size: 1.08rem; color: var(--ink); margin: 1.4rem 0 0.25rem; font-weight: 700; }
section ol, section ul { padding-left: 1.3rem; }
section li { margin-bottom: 0.55rem; }
section li::marker { color: var(--brand); font-weight: 700; }

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(52rem 26rem at 85% -10%, rgba(124, 58, 237, 0.38), transparent 60%),
    radial-gradient(44rem 24rem at 8% 110%, rgba(79, 70, 229, 0.35), transparent 60%),
    linear-gradient(160deg, #0d1730 0%, var(--ink) 55%, #0a0f22 100%);
  color: #e7ecf7;
  padding: 5rem 0 4.4rem;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.7rem);
  line-height: 1.08; letter-spacing: -0.03em; font-weight: 800;
  color: #fff; margin: 0 0 1.1rem; max-width: 22ch;
}
.hero .subhead { font-size: 1.18rem; line-height: 1.6; color: #c3cfe4; max-width: 44rem; margin: 0; }
.hero a { color: #c7d2fe; }
.launch-note { color: #93a3c0; font-size: 0.97rem; margin-top: 1.8rem; }
.launch-note a { color: #c7d2fe; }

/* ---------- CTAs / one-click connect ---------- */

.cta-block { margin-top: 1.6rem; }
.cta-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.75rem; margin: 0; max-width: none;
}
.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0.8rem 1.6rem;
  background: var(--grad); color: #fff;
  font-weight: 700; font-size: 1.02rem; letter-spacing: 0.005em;
  border-radius: 999px; text-decoration: none;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.cta:hover {
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.42);
}
.cta:active { transform: translateY(0); }
.cta.copied { background: linear-gradient(135deg, #059669, #047857); box-shadow: 0 8px 22px rgba(4, 120, 87, 0.35); }
.cta-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0.8rem 1.4rem;
  border: 1.5px solid var(--brand); color: var(--brand-dark);
  background: #fff; font-weight: 600; font-size: 1.02rem;
  border-radius: 999px; text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cta-secondary:hover { background: #eef2ff; color: var(--brand-dark); transform: translateY(-1px); }
.hero .cta-secondary { background: transparent; border-color: #8ea2cc; color: #e7ecf7; }
.hero .cta-secondary:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.cta-tertiary {
  font-weight: 600; font-size: 1.0rem; color: var(--brand-dark);
  text-decoration: underline; text-underline-offset: 3px; padding: 0.6rem 0.2rem;
}
.hero .cta-tertiary { color: #c7d2fe; }
.band .cta-tertiary { color: #c7d2fe; }
.cta-status { margin: 0.8rem 0 0; font-weight: 600; color: var(--success); max-width: none; }
.hero .cta-status, .band .cta-status { color: #6ee7b7; }
.copy-fallback { margin-top: 0.9rem; max-width: 44rem; }
.copy-fallback label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; }
.copy-fallback input {
  width: 100%; padding: 0.7rem 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--brand); border-radius: 10px;
}
.copy-fallback .copy-hint { margin: 0.45rem 0 0; font-size: 0.92rem; color: var(--muted); max-width: none; }
.hero .copy-fallback .copy-hint, .band .copy-fallback .copy-hint { color: #aebadd; }

/* ---------- Cards ---------- */

.cards {
  display: grid; gap: 1rem; margin-top: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}
.card {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.25rem 1.15rem; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card h3 { margin-top: 0.1rem; font-size: 1.12rem; }
.card p { margin-bottom: 0; max-width: none; }

/* ---------- Code ---------- */

pre {
  background: var(--code-bg); color: var(--code-text);
  border-radius: 12px; padding: 1rem 1.1rem; overflow-x: auto;
  box-shadow: var(--shadow-sm); max-width: 52rem;
}
pre code { font-size: 0.88rem; color: inherit; }
p code, li code {
  background: #eceff8; border-radius: 5px; padding: 0.08em 0.34em;
}

/* ---------- Pricing ---------- */

.table-wrap {
  overflow-x: auto; margin: 1.2rem 0 1rem; max-width: 52rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); background: #fff;
}
table.pricing { border-collapse: collapse; width: 100%; min-width: 26rem; }
table.pricing th, table.pricing td {
  padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--line);
}
table.pricing thead th {
  background: var(--ink); color: #fff; font-size: 0.92rem;
  letter-spacing: 0.04em; text-transform: uppercase; border-bottom: none;
}
table.pricing tbody tr:last-child th, table.pricing tbody tr:last-child td { border-bottom: none; }
table.pricing tbody tr { transition: background 0.12s ease; }
table.pricing tbody tr:hover { background: #f2f5fd; }
table.pricing tbody th { white-space: nowrap; font-size: 1.12rem; font-weight: 800; color: var(--ink); }

/* ---------- Closing band ---------- */

.band-section { padding-top: 0.5rem; }
.band {
  background:
    radial-gradient(38rem 16rem at 90% -20%, rgba(124, 58, 237, 0.45), transparent 60%),
    linear-gradient(150deg, var(--ink-soft) 0%, var(--ink) 70%);
  color: #e7ecf7; border-radius: 20px;
  padding: 2.6rem 2.2rem 2.4rem; box-shadow: var(--shadow-md);
}
.band h2 { color: #fff; margin-top: 0; }
.band p { color: #c3cfe4; }
.band .cta-block { margin-top: 1.4rem; }

/* ---------- Technical ---------- */

.flow {
  background: var(--code-bg); color: var(--code-text);
  border-radius: 12px; padding: 0.85rem 1.05rem; max-width: 52rem;
}
.flow code { color: #a5b4fc; font-weight: 700; }

/* ---------- Footer ---------- */

footer {
  background: var(--ink); color: #aebadd;
  margin-top: 0; padding: 2.4rem 0 2.2rem;
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 2rem; }
.footer-brand { font-weight: 800; color: #fff; font-size: 1.05rem; margin: 0; }
footer p { margin: 0; }
footer a { color: #c7d2fe; }
footer a:hover { color: #fff; }
small { color: #93a3c0; }

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  main > section { padding: 2.5rem 0; }
  .hero { padding: 3.4rem 0 3rem; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta, .cta-secondary { width: 100%; }
  .cta-tertiary { text-align: center; }
  .band { padding: 2rem 1.3rem 1.8rem; }
  .header-inner { gap: 0.4rem 1rem; }
  nav { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cta, .cta-secondary, .card, table.pricing tbody tr { transition: none; }
}
