/* =========================================================
   DESIGN TOKENS
   Palette: soft neutral surface + one signature gradient
   ("the Orb"), used sparingly — never as page decoration.
   ========================================================= */
:root {
  /* Color */
  --color-bg: #fafafc;
  --color-surface: #ffffff;
  --color-surface-alt: #f1f3fc;
  --color-text: #1b1c29;
  --color-text-muted: #5b5e72;
  --color-border: #e4e6f2;

  --gradient-brand: linear-gradient(135deg, #4c8df6 0%, #9168f0 55%, #f2618a 100%);
  --color-brand-solid: #6b5ef0; /* fallback for text/borders where a gradient can't render */

  --color-success: #1e9e6b;
  --color-success-bg: #e7f7f0;
  --color-warning: #dd8a1f;
  --color-warning-bg: #fbf1e2;
  --color-danger: #e14f63;
  --color-danger-bg: #fdecef;

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(27, 28, 41, 0.06);
  --shadow-md: 0 8px 24px rgba(27, 28, 41, 0.08);
  --shadow-lg: 0 20px 48px rgba(27, 28, 41, 0.14);

  --max-width: 1120px;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 var(--space-4); color: var(--color-text-muted); }

a { color: var(--color-brand-solid); text-decoration: none; }
a:hover { text-decoration: underline; }

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

button, input, select, textarea { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: 2px solid var(--color-brand-solid);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand-solid);
  display: inline-block;
  margin-bottom: var(--space-2);
}

/* =========================================================
   THE ORB — signature element, used as the AI's identity mark
   wherever it "speaks": nav mark, chat avatar, loading state.
   ========================================================= */
.orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-brand);
  flex-shrink: 0;
  position: relative;
}

.orb--pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: orb-pulse 2.2s ease-out infinite;
}

@keyframes orb-pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn--secondary:hover { border-color: var(--color-brand-solid); }

.btn--sm { padding: 8px 16px; font-size: 0.85rem; }

/* =========================================================
   NAV / FOOTER (site chrome — used by base.html)
   ========================================================= */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: rgba(250, 250, 252, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-6) 0;
  margin-top: var(--space-8);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* =========================================================
   PAGE: CONTACT
   ========================================================= */
.contact-page {
  padding: var(--space-8) 0;
}

.contact-page__inner {
  max-width: 720px;
}

.contact-page__card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.contact-page__card .orb {
  margin-top: 4px;
}

.contact-page__email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .site-header nav .btn--sm:last-child {
    display: none;
  }

  .contact-page__card {
    flex-direction: column;
    gap: var(--space-3);
  }
}

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}
.badge--success { background: var(--color-success-bg); color: var(--color-success); }
.badge--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--muted   { background: var(--color-surface-alt); color: var(--color-text-muted); }

/* =========================================================
   PAGE: INDEX — hero, chat mockup, how-it-works, proof strip
   ========================================================= */
.hero {
  padding: var(--space-8) 0 var(--space-7);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-7);
  align-items: center;
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
}

.hero__actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

/* Live-feeling chat mockup — the hero's real content, not a stat block */
.chat-mock {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chat-mock__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.bubble {
  max-width: 82%;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.45;
  opacity: 0;
  animation: bubble-in 0.5s ease forwards;
}

.bubble--visitor {
  align-self: flex-end;
  background: var(--color-surface-alt);
  color: var(--color-text);
  border-bottom-right-radius: 4px;
}

.bubble--agent {
  align-self: flex-start;
  background: var(--color-text);
  color: #fff;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

.bubble--agent .orb { width: 18px; height: 18px; margin-top: 2px; }

.bubble:nth-child(2) { animation-delay: 0.3s; }
.bubble:nth-child(3) { animation-delay: 1.1s; }
.bubble:nth-child(4) { animation-delay: 1.9s; }

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bubble__lang {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  opacity: 0.6;
  margin-top: 4px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-6);
}

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
}

.step__index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-brand-solid);
  margin-bottom: var(--space-2);
}

.proof-strip {
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-top: var(--space-7);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 760px) {
  .proof-strip { grid-template-columns: 1fr; }
}

.proof-strip blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-text);
}

.proof-strip cite {
  display: block;
  font-style: normal;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* =========================================================
   ERROR PAGES (errors/404.html, errors/500.html)
   ========================================================= */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-5);
}
.error-page__code {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0;
}
