/* ==========================================================================
   Chiario — landing page styles (mobile-first)
   Palette: deep emerald on warm stone. Display/headings: Lora. Body: Inter.
   Matches the in-app brand (tailwind.config.js) so the marketing site and
   the product feel like one thing.
   ========================================================================== */

:root {
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-700: #44403c;
  --stone-900: #1c1917;

  --primary-50: #ecfdf5;
  --primary-100: #d3f4e4;
  --primary-200: #a8e8c7;
  --primary-400: #4cc88a;
  --primary-500: #26a96c;
  --primary-600: #0f6b4c;
  --primary-700: #0b5a3f;
  --primary-800: #084a33;
  --primary-900: #063826;

  --font-display: "Lora", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --wrap: 72rem;
  --gutter: 1.25rem;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--stone-50);
  color: var(--stone-900);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--primary-700); text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--primary-600);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  z-index: 20;
}
.skip-link:focus { left: 0.5rem; }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-700);
  margin: 0 0 0.75rem;
}
.eyebrow-on-dark { color: var(--primary-400); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 250, 249, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stone-200);
}
.site-header > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--stone-900);
  text-decoration: none;
}
.logo-mark { width: 1.5rem; height: 1.5rem; color: var(--primary-600); flex-shrink: 0; }

.nav { display: none; align-items: center; gap: 1.75rem; }
.nav a:not(.btn) { color: var(--stone-500); text-decoration: none; font-size: 0.95rem; }
.nav a:not(.btn):hover { color: var(--stone-900); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stone-200);
  background: #fff;
  color: var(--stone-700);
  cursor: pointer;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem var(--gutter) 1.25rem;
  border-top: 1px solid var(--stone-200);
  background: var(--stone-50);
}
.mobile-nav.open { display: flex; }
.mobile-nav a:not(.btn) {
  padding: 0.6rem 0.25rem;
  color: var(--stone-700);
  text-decoration: none;
  border-bottom: 1px solid var(--stone-100);
}
.mobile-nav .btn { margin-top: 0.75rem; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 0.95rem/1 var(--font-body);
  padding: 0.75rem 1.3rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary-600); color: #fff; }
.btn-primary:hover { background: var(--primary-700); }
.btn-ghost { border: 1px solid var(--stone-300); color: var(--stone-900); }
.btn-ghost:hover { border-color: var(--stone-400); background: var(--stone-100); }
.btn-lg { padding: 0.9rem 1.6rem; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: 3.5rem 3rem; overflow: hidden; }
.hero-glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 34rem;
  background: radial-gradient(60% 60% at 30% 20%, var(--primary-100) 0%, rgba(236, 253, 245, 0) 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  gap: 2.5rem;
}
.hero-copy { max-width: 36rem; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
}
.hero-sub { color: var(--stone-500); font-size: 1.08rem; margin: 0 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-note { color: var(--stone-400); font-size: 0.85rem; margin: 0.9rem 0 0; }

/* ---------- Hero visual: chat mockup ---------- */
.hero-visual { display: flex; justify-content: center; }
.mock-window {
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px -24px rgba(28, 25, 23, 0.25);
  overflow: hidden;
}
.mock-titlebar {
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--stone-100);
}
.mock-dot { width: 0.6rem; height: 0.6rem; border-radius: 999px; background: var(--stone-200); }
.mock-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; }
.mock-bubble { font-size: 0.85rem; line-height: 1.5; border-radius: var(--radius-lg); padding: 0.75rem 1rem; }
.mock-bubble p { margin: 0; }
.mock-bubble-user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--stone-900);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.mock-bubble-ai {
  background: var(--stone-50);
  border: 1px solid var(--stone-200);
  border-bottom-left-radius: 6px;
}
.mock-cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--primary-100);
  color: var(--primary-700);
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 0.15rem;
}
.mock-sources { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.mock-source-chip {
  font-size: 0.7rem;
  color: var(--stone-500);
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}
.mock-typing {
  align-self: flex-start;
  display: flex;
  gap: 0.25rem;
  padding: 0.6rem 0.9rem;
}
.mock-typing span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--stone-300);
  animation: mock-bounce 1.2s infinite ease-in-out;
}
.mock-typing span:nth-child(2) { animation-delay: 0.15s; }
.mock-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mock-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- Trust strip ---------- */
.trust { border-top: 1px solid var(--stone-200); border-bottom: 1px solid var(--stone-200); background: #fff; }
.trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding-block: 1.1rem;
}
.trust-label { color: var(--stone-400); font-size: 0.85rem; margin-right: 0.25rem; }
.trust-chip {
  font-size: 0.82rem;
  color: var(--stone-700);
  background: var(--stone-100);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

/* ---------- Sections ---------- */
.section { padding-block: 4rem; }
.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
  line-height: 1.18;
  margin: 0 0 0.85rem;
  max-width: 24ch;
}
.section-intro { color: var(--stone-500); max-width: 40rem; margin: 0 0 2.5rem; }

.section-dark { background: var(--stone-900); color: var(--stone-100); }
.section-dark h2 { color: #fff; }
.section-intro-on-dark { color: var(--stone-400); }

/* Feature cards */
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.feature-card {
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--primary-50);
  color: var(--primary-700);
  margin-bottom: 1rem;
}
.feature-icon svg { width: 1.3rem; height: 1.3rem; }
.feature-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; margin: 0 0 0.4rem; }
.feature-card p { color: var(--stone-500); margin: 0; font-size: 0.95rem; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 2rem; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--stone-900);
  background: var(--primary-400);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
}
.steps h3 { margin: 0 0 0.35rem; font-size: 1.1rem; color: #fff; }
.steps p { margin: 0; color: var(--stone-400); }

/* CTA band */
.cta-band { background: var(--primary-600); color: #fff; }
.cta-band-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
  padding-block: 3rem;
}
.cta-band h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 0.5rem; }
.cta-band p { margin: 0; color: var(--primary-100); }
.cta-band .btn-primary { background: #fff; color: var(--primary-700); }
.cta-band .btn-primary:hover { background: var(--primary-50); }

/* FAQ */
.faq-list { display: grid; gap: 0.75rem; max-width: 42rem; }
.faq-item { border: 1px solid var(--stone-200); border-radius: var(--radius-lg); background: #fff; overflow: hidden; }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  background: none;
  border: none;
  padding: 1.1rem 1.25rem;
  font: 600 0.98rem var(--font-body);
  color: var(--stone-900);
  cursor: pointer;
}
.faq-caret { width: 1.1rem; height: 1.1rem; color: var(--stone-400); transition: transform 0.2s ease; flex-shrink: 0; }
.faq-item[data-open="true"] .faq-caret { transform: rotate(180deg); color: var(--primary-600); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-item[data-open="true"] .faq-answer { max-height: 20rem; }
.faq-answer p { margin: 0 1.25rem 1.1rem; color: var(--stone-500); font-size: 0.95rem; }

/* ---------- Legal pages (shared look, used by privacy/terms if hosted here) --- */
.legal { padding-block: 3rem 4rem; max-width: 46rem; }
.legal h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 6vw, 2.4rem); margin: 0 0 0.5rem; }
.legal .updated { color: var(--stone-400); margin: 0 0 2.5rem; }
.legal h2 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
.legal p, .legal li { color: var(--stone-700); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--stone-200); padding-block: 2.5rem 1.5rem; color: var(--stone-500); font-size: 0.9rem; }
.footer-grid { display: flex; flex-direction: column; gap: 1.5rem; padding-bottom: 1.5rem; }
.footer-brand p { margin: 0.5rem 0 0; }
.footer-brand .logo { color: var(--stone-900); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer a { color: var(--stone-500); }
.site-footer a:hover { color: var(--stone-900); }
.copyright { display: block; padding-top: 1.5rem; border-top: 1px solid var(--stone-100); }

/* ---------- Tablet and up ---------- */
@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
  .hero { padding-block: 5.5rem 4.5rem; }
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 2rem; }
  .section { padding-block: 6rem; }
  .features { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  .cta-band-inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .footer-grid { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
