/* ==========================================================================
   Billingham & Co — base styles
   ========================================================================== */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --fg: #16171b;
  --muted: #63666f;
  --border: #e6e4df;
  --primary: #2f5be0;
  --primary-hover: #244bc2;
  --primary-fg: #ffffff;
  --accent: #e7893a;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 17, 22, 0.06);
  --shadow: 0 8px 30px rgba(16, 17, 22, 0.08);
  --shadow-lg: 0 20px 60px rgba(16, 17, 22, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 4vw + 1rem, 3.4rem); }
h2 { font-size: clamp(1.7rem, 2vw + 1rem, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--muted); }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--fg);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 9px 18px; font-size: 0.875rem; }
.btn-primary { background: var(--primary); color: var(--primary-fg); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-outline:hover { border-color: var(--fg); }
.btn-block { width: 100%; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.logo span { color: var(--primary); }

.main-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.main-nav a {
  display: block;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.main-nav a:hover { color: var(--fg); background: rgba(0,0,0,0.04); }
.main-nav a.active { color: var(--fg); background: rgba(0,0,0,0.06); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 18px; margin: 0 auto; background: var(--fg); border-radius: 2px; transition: transform 0.25s var(--ease), opacity 0.25s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Sections ---- */
section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.section-head { max-width: 640px; margin: 0 0 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* ---- Hero ---- */
.hero { padding: 88px 0 60px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero-lede { font-size: 1.15rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 48px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 1.6rem; font-weight: 800; }
.hero-stats .stat span { font-size: 0.85rem; color: var(--muted); }

.hero-art {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, #eef1ff 0%, #f6efe6 100%);
  border: 1px solid var(--border);
  padding: 28px;
  min-height: 420px;
}
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-card + .hero-card { margin-top: 14px; }
.hero-card img { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; }
.hero-card .name { font-weight: 700; font-size: 0.92rem; }
.hero-card .role { font-size: 0.8rem; color: var(--muted); }
.hero-card.floating-1 { transform: translateY(-6px) rotate(-1deg); }
.hero-card.floating-2 { margin-left: 36px; transform: rotate(1deg); }
.hero-card.floating-3 { margin-left: 12px; }

.logo-strip { display: flex; flex-wrap: wrap; gap: 28px 40px; align-items: center; opacity: 0.65; margin-top: 20px; }
.logo-strip span { font-weight: 700; letter-spacing: 0.02em; color: var(--muted); font-size: 0.95rem; }

/* ---- Cards / grids ---- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }

.icon-tile {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(47, 91, 224, 0.1);
  color: var(--primary);
  margin-bottom: 18px;
}
.icon-tile svg { width: 24px; height: 24px; }

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--fg); }
.check-list svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }

/* ---- How it works / steps ---- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 56px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--fg);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ---- Testimonials ---- */
.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.testimonial p.quote { color: var(--fg); font-size: 1.02rem; }
.testimonial-author { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.testimonial-author img { width: 44px; height: 44px; border-radius: 50%; }
.testimonial-author .name { font-weight: 700; font-size: 0.9rem; }
.testimonial-author .role { font-size: 0.8rem; color: var(--muted); }
.stars { color: var(--accent); letter-spacing: 2px; margin-bottom: 10px; }

/* ---- Pricing ---- */
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.pricing-card.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.pricing-badge {
  position: absolute; top: -14px; left: 32px;
  background: var(--primary); color: #fff;
  font-size: 0.75rem; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
}
.price { font-size: 2.6rem; font-weight: 800; margin: 12px 0 4px; }
.price span { font-size: 1rem; font-weight: 600; color: var(--muted); }
.pricing-card .check-list { margin: 24px 0 28px; flex-grow: 1; }

/* ---- FAQ ---- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 0;
  background: none; border: none; text-align: left;
  font-size: 1.05rem; font-weight: 600; color: var(--fg);
  cursor: pointer;
}
.faq-question .plus { flex-shrink: 0; width: 22px; height: 22px; position: relative; }
.faq-question .plus::before, .faq-question .plus::after {
  content: ""; position: absolute; background: var(--fg); border-radius: 2px; transition: transform 0.25s var(--ease);
}
.faq-question .plus::before { top: 50%; left: 0; width: 100%; height: 2px; margin-top: -1px; }
.faq-question .plus::after { left: 50%; top: 0; height: 100%; width: 2px; margin-left: -1px; }
.faq-item[data-open="true"] .plus::after { transform: rotate(90deg); opacity: 0; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease); }
.faq-answer p { padding-bottom: 22px; margin: 0; }

/* ---- CTA band ---- */
.cta-band {
  background: var(--fg);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 56px;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.7); max-width: 50ch; margin-inline: auto; }
.cta-band .btn-outline { color: #fff; border-color: rgba(255,255,255,0.3); }
.cta-band .btn-outline:hover { border-color: #fff; }

/* ---- Forms ---- */
.form-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  color: var(--fg);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 91, 224, 0.15);
}
textarea { resize: vertical; min-height: 120px; }

.form-note { font-size: 0.85rem; margin-top: 14px; }
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 22px; font-size: 0.92rem; }
.alert-success { background: #ecfdf3; color: #04693b; border: 1px solid #b6ecc9; }
.alert-error { background: #fef2f2; color: #a3231d; border: 1px solid #f6c1bd; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); padding: 64px 0 0; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer-brand p { max-width: 30ch; margin-top: 12px; }
.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--muted); font-size: 0.92rem; }
.footer-col a:hover { color: var(--fg); }
.social-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; font-size: 0.85rem; color: var(--muted); }

/* ---- Reveal-on-scroll ---- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ---- Page hero (inner pages) ---- */
.page-hero { padding: 64px 0 40px; text-align: center; }
.page-hero .eyebrow { justify-content: center; }
.page-hero p { max-width: 56ch; margin-inline: auto; }

/* ==========================================================================
   Agent Dock — floating chat widget
   ========================================================================== */
.agent-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  width: min(380px, calc(100vw - 40px));
}
.agent-dock-panel {
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 18px;
  background: #0a0a0c;
  color: #fff;
  padding: 8px;
  box-shadow: var(--shadow-lg);
}
.agent-dock-row { display: flex; align-items: center; gap: 12px; padding: 4px; }
.agent-dock-avatar { width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0; background: #222; }
.agent-dock-info { min-width: 0; flex: 1; }
.agent-dock-name { margin: 0; font-size: 0.85rem; font-weight: 600; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-dock-status {
  margin: 5px 0 0;
  font-size: 0.75rem;
  color: #9a9aa3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.agent-dock-status.is-swapping { opacity: 0; transform: translateY(6px); }

.agent-dock-buttons { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dock-btn {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 8px;
  border-radius: 10px; border: none; background: transparent; color: #fff;
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: background 0.2s ease;
}
.dock-btn:hover { background: rgba(255,255,255,0.1); }
.dock-btn .dock-icon { width: 16px; height: 16px; display: flex; }
.dock-btn .dock-icon svg { width: 100%; height: 100%; }
.dock-btn kbd {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px; background: rgba(255,255,255,0.1);
  font-family: inherit; font-size: 0.7rem;
}
.dock-icon-send { display: none; }
.agent-dock[data-mode="composing"] .dock-icon-chat { display: none; }
.agent-dock[data-mode="composing"] .dock-icon-send { display: flex; }

.agent-dock-composer {
  position: relative;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease), opacity 0.3s var(--ease);
  margin-bottom: 0;
}
.agent-dock[data-mode="composing"] .agent-dock-composer {
  max-height: 130px;
  opacity: 1;
  margin-bottom: 8px;
}
.dock-close {
  position: absolute; right: 6px; top: 6px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: none; background: transparent; color: #9a9aa3; cursor: pointer;
}
.dock-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.dock-close svg { width: 14px; height: 14px; }
#agentDockTextarea {
  width: 100%; height: 112px; resize: none;
  background: transparent; border: none; color: #fff;
  padding: 8px 34px 8px 8px;
  font: inherit; font-size: 0.9rem; line-height: 1.5;
}
#agentDockTextarea::placeholder { color: #6b6b74; }
#agentDockTextarea:focus { outline: none; box-shadow: none; }
.agent-dock[data-mode="working"] .agent-dock-panel { opacity: 0.85; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav { position: fixed; inset: 76px 0 0 0; background: var(--bg); padding: 20px 24px; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
  .main-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { padding: 14px 16px; font-size: 1rem; }
  .nav-toggle { display: flex; }
  .header-actions .btn { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
  .cta-band { padding: 40px 24px; }
  .agent-dock { right: 12px; bottom: 12px; left: 12px; width: auto; }
}
