/* =========================================================================
   AutoFlow Chat — marketing landing page
   Framework-free. Premium design system recreated from spec (no Studio repo
   access). Bricolage Grotesque headings + Plus Jakarta Sans body, forest-green
   + gold + mint palette, green-tinted shadows, mint→gold hero wash, gradient
   text, frosted nav, scroll-progress, typewriter, scroll-reveal, 3D tilt,
   hover/tap flip cards. NO blue anywhere.
   ========================================================================= */

/* ----- Tokens ------------------------------------------------------------ */
:root {
  --green-900: #0c3524;
  --green-800: #155e44;
  --green-600: #159a63;
  --green-50:  #edf7f1;
  --gold:      #caa15a;
  --gold-soft: #e6cf9f;
  --mint:      #34d399;
  --text:      #0f1c17;
  --muted:     #4e6059;
  --border:    #ddeae3;
  --offwhite:  #f8faf9;
  --white:     #ffffff;

  /* Green-tinted shadows — three tiers, never neutral grey */
  --sh-sm: 0 2px 10px rgba(21, 94, 68, 0.07);
  --sh-md: 0 10px 30px rgba(21, 94, 68, 0.10);
  --sh-lg: 0 30px 70px rgba(12, 53, 36, 0.18);
  --sh-gold: 0 16px 40px rgba(202, 161, 90, 0.30);

  --grad-text: linear-gradient(100deg, #155e44 0%, #159a63 45%, #34d399 100%);
  --grad-btn:  linear-gradient(135deg, #159a63 0%, #12b277 100%);
  --grad-dark: linear-gradient(150deg, #0c3524 0%, #124a35 60%, #155e44 120%);
  --grad-hero: linear-gradient(135deg, rgba(52, 211, 153, 0.20) 0%, rgba(237, 247, 241, 0) 42%, rgba(202, 161, 90, 0.18) 100%);

  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --maxw: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--offwhite);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: "Bricolage Grotesque", "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--green-900);
}

/* ----- Layout helpers ---------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(64px, 9vw, 124px); position: relative; }
.section.tint { background: var(--green-50); }

.label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--green-600);
}
.head { max-width: 760px; margin-bottom: 56px; }
.head.center { margin-inline: auto; text-align: center; }
.head h2 { font-size: clamp(28px, 4.6vw, 48px); margin: 16px 0 14px; }
.head p { font-size: clamp(15px, 1.7vw, 18.5px); color: var(--muted); max-width: 62ch; }
.head.center p { margin-inline: auto; }
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 15.5px; padding: 14px 26px;
  border-radius: var(--radius-pill);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), color 0.25s var(--ease);
}
.btn-primary { color: #fff; background: var(--grad-btn); box-shadow: var(--sh-md); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }
.btn-ghost { color: var(--green-800); background: var(--white); border: 1px solid var(--border); box-shadow: var(--sh-sm); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--green-600); }
.btn-lg { padding: 16px 30px; font-size: 16.5px; }
.btn-block { width: 100%; }

/* ----- Scroll progress bar ---------------------------------------------- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--green-800), var(--green-600), var(--mint));
  z-index: 200; transition: width 0.08s linear;
}

/* ----- Nav --------------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 150;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(248, 250, 249, 0.72);
  backdrop-filter: saturate(170%) blur(16px);
  -webkit-backdrop-filter: saturate(170%) blur(16px);
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px -18px rgba(12, 53, 36, 0.5);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
/* AF› wordmark — the AutoFlow Labs logo with "chat" appended (AF›chat) */
.brand { display: inline-flex; flex-direction: column; line-height: 1; }
.brand-top {
  display: inline-flex; align-items: center;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800;
  font-size: 26px; letter-spacing: -0.01em; color: var(--green-800);
}
.brand-top .arw { width: 14px; height: 18px; margin: 0 2px 0 1px; color: var(--gold); }
.brand-top .chat { color: var(--green-800); margin-left: 5px; }
.brand-sub {
  font-family: "Plus Jakarta Sans", sans-serif; font-weight: 600;
  font-size: 9.5px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted); margin-top: 5px;
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 15px; font-weight: 600; color: var(--muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--green-800); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; align-items: center; justify-content: center; color: var(--green-800); }
.nav-toggle svg { width: 24px; height: 24px; }
.mobile-menu { display: none; }

/* ----- Hero -------------------------------------------------------------- */
.hero { position: relative; padding-top: 140px; padding-bottom: clamp(60px, 8vw, 110px); overflow: hidden; }
.hero-wash { position: absolute; inset: 0; z-index: -2; background: var(--grad-hero); }
.blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: 0.5; pointer-events: none; }
.blob.b1 { width: 460px; height: 460px; top: -120px; left: -100px; background: radial-gradient(circle, rgba(52,211,153,0.55), transparent 70%); }
.blob.b2 { width: 520px; height: 520px; top: -60px; right: -140px; background: radial-gradient(circle, rgba(202,161,90,0.5), transparent 70%); }

.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 600;
  color: var(--green-800); background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border); box-shadow: var(--sh-sm); backdrop-filter: blur(6px);
}
.pill .spark { color: var(--gold); }

.hero h1 { font-size: clamp(34px, 6.5vw, 72px); margin: 22px 0 0; }
.hero h1 .l2 { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
#typewriter::after {
  content: ""; display: inline-block; width: 3px; height: 0.92em; margin-left: 3px;
  vertical-align: -0.07em; background: var(--mint); animation: caret 0.9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.hero p.sub { font-size: clamp(16px, 1.9vw, 19px); color: var(--muted); margin: 24px 0 30px; max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-feats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.feat {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px;
  font-size: 13.5px; font-weight: 600; color: var(--green-800);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-pill); box-shadow: var(--sh-sm);
}

/* Hero visual — floating WhatsApp teaser with 3D tilt */
.hero-visual { perspective: 1100px; display: flex; justify-content: center; }
.tilt { transition: transform 0.2s var(--ease); transform-style: preserve-3d; will-change: transform; }
.phone {
  position: relative; width: min(380px, 100%);
  background: linear-gradient(180deg, #ffffff, #f4f8f6);
  border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 30px; padding: 12px; box-shadow: var(--sh-lg);
}
.phone::before {
  content: ""; position: absolute; inset: -10% -7% -12% -7%; z-index: -1;
  background: var(--grad-dark); filter: blur(48px); opacity: 0.28; border-radius: 40px;
}
.screen { background: #e9efe9; border-radius: 22px; overflow: hidden; }
.wa-top { display: flex; align-items: center; gap: 11px; padding: 14px 16px; background: var(--grad-dark); color: #fff; }
.wa-top .ava { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.18); font-weight: 800; font-family: "Bricolage Grotesque", sans-serif; }
.wa-top .who b { font-size: 15px; font-weight: 700; display: block; }
.wa-top .who span { font-size: 11.5px; opacity: 0.85; }
.wa-body {
  padding: 16px 13px 18px; display: flex; flex-direction: column; gap: 9px; min-height: 320px;
  background: radial-gradient(circle at 16% 10%, rgba(21,94,68,0.05), transparent 42%), #e3ebe4;
}
.bub { max-width: 82%; padding: 9px 12px; font-size: 13.5px; line-height: 1.42; border-radius: 14px; box-shadow: var(--sh-sm); }
.bub.cust { align-self: flex-start; background: #fff; border-top-left-radius: 5px; color: var(--text); }
.bub.saathi { align-self: flex-end; background: #d6f3e3; border-top-right-radius: 5px; color: var(--green-900); }
.bub .t { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 3px; font-size: 10px; color: var(--green-600); }
.bub .tick { color: var(--green-600); }
.typing { display: inline-flex; gap: 3px; align-items: center; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--green-600); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* ----- Generic card ------------------------------------------------------ */
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--sh-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: #c9e0d4; }

/* ----- Flip cards (section 3) ------------------------------------------- */
.flip-row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.flip-card { perspective: 1600px; min-height: 430px; cursor: pointer; }
.flip-inner { position: relative; width: 100%; height: 100%; min-height: inherit; transition: transform 0.75s var(--ease); transform-style: preserve-3d; }
.flip-card:hover .flip-inner, .flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg); padding: 34px 30px; display: flex; flex-direction: column;
  border: 1px solid var(--border); box-shadow: var(--sh-md);
}
.flip-front { background: var(--white); justify-content: space-between; align-items: flex-start; }
.flip-front .ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 31px; background: var(--green-50); box-shadow: inset 0 0 0 1px rgba(21,94,68,0.06); }
.flip-front h3 { font-size: 26px; margin-top: 22px; }
.flip-front .hint { margin-top: 18px; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--gold); }
.flip-back { transform: rotateY(180deg); background: var(--grad-dark); color: rgba(255,255,255,0.92); overflow-y: auto; }
.flip-back h3 { color: #fff; font-size: 21px; margin-bottom: 6px; }
.flip-back .lead { font-size: 13.5px; opacity: 0.82; margin-bottom: 16px; }
.flip-back .grp { margin-bottom: 14px; }
.flip-back .grp b { display: block; font-size: 13px; font-weight: 700; color: var(--gold-soft); margin-bottom: 7px; }
.flip-back ul { display: flex; flex-direction: column; gap: 7px; }
.flip-back li { font-size: 13.5px; line-height: 1.45; }
.flip-back li b { display: inline; color: #fff; }

/* ----- Solve grid (section 4) ------------------------------------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; perspective: 1100px; }
.solve { padding: 30px 28px; }
.solve .ic { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; font-size: 26px; background: var(--green-50); margin-bottom: 18px; }
.solve h3 { font-size: 19.5px; margin-bottom: 9px; }
.solve p { font-size: 14.5px; color: var(--muted); }

/* ----- Saathi mockup (section 5) ---------------------------------------- */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.checks { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.checks li { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; font-weight: 600; color: var(--green-800); }
.checks .ck { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--green-50); color: var(--green-600); font-size: 14px; margin-top: 1px; }
.feature-mock { display: flex; justify-content: center; }
.feature-mock .phone { width: min(392px, 100%); }

/* ----- Why grid (section 6 — ghosted numbers) --------------------------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; perspective: 1100px; }
.why { position: relative; padding: 32px 28px 28px; overflow: hidden; }
.why .num {
  position: absolute; top: -16px; right: 8px; font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800; font-size: 110px; line-height: 1; color: var(--green-50); z-index: 0; user-select: none;
}
.why .body { position: relative; z-index: 1; }
.why h3 { font-size: 20px; margin-bottom: 9px; }
.why p { font-size: 14.5px; color: var(--muted); }

/* ----- Steps (section 7) ------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { padding: 34px 28px; }
.step .n {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 22px;
  color: #fff; background: var(--grad-btn); box-shadow: var(--sh-md); margin-bottom: 20px;
}
.step h3 { font-size: 21px; margin-bottom: 8px; }
.step p { font-size: 14.5px; color: var(--muted); }

/* ----- FAQ (section 8) --------------------------------------------------- */
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.faq {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--sh-sm); overflow: hidden; transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.faq[open] { border-color: var(--green-600); box-shadow: var(--sh-md); }
.faq summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 20px 22px; font-size: 16px; font-weight: 700; color: var(--green-900); cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green-50); color: var(--green-600); transition: transform 0.3s var(--ease); font-size: 15px; }
.faq[open] summary .chev { transform: rotate(45deg); }
.faq .a { padding: 0 22px 20px; font-size: 14.5px; color: var(--muted); }

/* ----- Waitlist band (section 9) ---------------------------------------- */
.cta-band { background: var(--grad-dark); position: relative; overflow: hidden; }
.cta-band::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(40% 60% at 88% 0%, rgba(202,161,90,0.34), transparent 60%),
              radial-gradient(42% 55% at 4% 100%, rgba(52,211,153,0.20), transparent 60%);
}
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
.cta-copy .label { color: var(--gold-soft); }
.cta-copy h2 { color: #fff; font-size: clamp(28px, 4vw, 44px); margin: 14px 0 14px; }
.cta-copy p { color: rgba(255,255,255,0.85); font-size: 17px; max-width: 46ch; }
.trust { margin-top: 22px; font-size: 14.5px; font-weight: 600; color: var(--gold-soft); }

.form-card { background: rgba(255, 255, 255, 0.98); border-radius: var(--radius-lg); padding: 34px 30px; box-shadow: var(--sh-lg); border: 1px solid rgba(255,255,255,0.6); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--green-900); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; padding: 13px 15px; font-size: 15px; font-family: inherit; color: var(--text);
  background: var(--offwhite); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input:focus, .field select:focus { outline: none; background: #fff; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(21, 154, 99, 0.16); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 14px; font-size: 14px; font-weight: 600; display: none; padding: 12px 14px; border-radius: 12px; }
.form-status.show { display: block; }
.form-status.ok { background: var(--green-50); color: var(--green-800); }
.form-status.err { background: #fbeae5; color: #a23b1e; }
.form-note { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ----- Footer ------------------------------------------------------------ */
.footer { background: var(--green-900); color: rgba(255,255,255,0.78); padding-block: 64px 30px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 44px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer .brand-top, .footer .brand-top .chat { color: #fff; }
.footer .brand-sub { color: var(--gold-soft); }
.footer-about p { margin-top: 16px; font-size: 14.5px; max-width: 34ch; color: rgba(255,255,255,0.7); }
.footer-col h4 { color: #fff; font-family: "Plus Jakarta Sans", sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col a { font-size: 14.5px; color: rgba(255,255,255,0.72); transition: color 0.2s; }
.footer-col a:hover { color: var(--gold-soft); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-top: 26px; font-size: 13.5px; color: rgba(255,255,255,0.6); }
.footer-bottom .links { display: flex; gap: 20px; }
.footer-bottom a:hover { color: var(--gold-soft); }

/* ----- Scroll reveal ----------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
.reveal[data-d="5"] { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .flip-card:hover .flip-inner { transform: none; }
  .tilt { transform: none !important; }
  #typewriter::after { display: none; }
}

/* ----- Responsive -------------------------------------------------------- */
@media (max-width: 980px) {
  .hero-grid, .feature-grid, .cta-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-visual, .feature-mock { order: -1; }
  .grid-3, .why-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-right .btn { display: none; }
  .nav-toggle { display: flex; }
  .brand-top { font-size: 23px; }
  .mobile-menu {
    position: fixed; inset: 74px 0 auto 0; background: rgba(248,250,249,0.97);
    backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); box-shadow: var(--sh-md);
    padding: 18px 24px 26px; display: none; flex-direction: column; gap: 4px; z-index: 140;
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu a { padding: 13px 6px; font-size: 16px; font-weight: 600; color: var(--green-800); border-bottom: 1px solid var(--border); }
  .mobile-menu .btn { margin-top: 14px; }
  .flip-row { grid-template-columns: 1fr; }
  .flip-card { min-height: 0; }
  .flip-inner { min-height: 450px; }
  .grid-3, .why-grid, .steps, .faq-grid, .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-about { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 460px) {
  .container { padding-inline: 18px; }
  .hero { padding-top: 122px; }
  .hero-actions .btn { width: 100%; }
  .why .num { font-size: 92px; }
}
@media (hover: none) { .flip-front .hint::before { content: "👆 "; } }
