/* ============================================================
   AutoInvent — Redesign design system (production)
   Ported from the Claude design handoff (_ds tokens + inline patterns).
   Single source of truth for the redesigned marketing site.
   Consolidates: tokens/colors.css, tokens/typography.css,
   tokens/spacing.css, components/fig-tokens.css + shared components.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Fira+Mono:wght@400;500;700&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* ---- Brand: Primary (Orange) ---- */
  --ai-orange:            #EF6939;
  --ai-orange-hover:      #E2552A;
  --ai-orange-soft:       #F0774C;
  --ai-orange-tint:       #FF9375;
  --ai-orange-wash:       #FFF0EC;

  /* ---- Brand: Secondary (Black / ink) ---- */
  --ai-black:             #1A1A1A;
  --ai-ink-900:           #1E1E1E;
  --ai-ink-800:           #2C2C2C;

  /* ---- Brand: Tertiary (Beige) + surfaces ---- */
  --ai-beige:             #EBE4DA;
  --ai-beige-deep:        #ECEAE7;
  --ai-bg:                #F5F3F0;
  --ai-bg-warm:           #FEFBF4;
  --ai-card:              #FFFFFF;

  /* ---- AI accent (Teal) ---- */
  --ai-cyan:              #31C8DF;
  --ai-cyan-deep:         #14919B;   /* AI action / pressed — the teal accent */
  --ai-cyan-wash:         #EAFCFF;

  /* ---- Neutral ramp ---- */
  --ai-neutral-0:         #FFFFFF;
  --ai-neutral-50:        #F9F9F9;
  --ai-neutral-100:       #F3F3F3;
  --ai-neutral-200:       #ECEAE7;
  --ai-neutral-300:       #E5E7EB;
  --ai-neutral-400:       #D9D9D9;
  --ai-neutral-500:       #BCBFC5;
  --ai-neutral-600:       #8A8A8A;
  --ai-neutral-700:       #6B6B6B;
  --ai-neutral-800:       #4A4A4A;
  --ai-neutral-900:       #1A1A1A;

  /* ---- Semantic ---- */
  --ai-success:           #239B6E;
  --ai-success-wash:      #E4F4EC;
  --ai-danger:            #EF4444;

  /* ---- Semantic aliases ---- */
  --color-bg:             var(--ai-bg);
  --color-surface:        var(--ai-card);
  --color-surface-warm:   var(--ai-bg-warm);

  --text-primary:         var(--ai-neutral-900);
  --text-secondary:       var(--ai-neutral-800);
  --text-muted:           var(--ai-neutral-600);
  --text-on-brand:        #FFFFFF;

  --border-subtle:        var(--ai-neutral-200);
  --border-default:       var(--ai-neutral-300);
  --border-strong:        var(--ai-neutral-500);

  --brand-primary:        var(--ai-orange);
  --brand-primary-hover:  var(--ai-orange-hover);
  --brand-accent:         var(--ai-beige);
  --brand-ai:             var(--ai-cyan-deep);

  /* ---- Type ---- */
  --font-display: 'Red Hat Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body:    'Red Hat Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'Fira Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;

  /* ---- Spacing (4px grid) ---- */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;

  /* ---- Radius ---- */
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --radius-xl: 24px; --radius-2xl: 32px; --radius-pill: 999px;

  /* ---- Shadows ---- */
  --shadow-xs: 0 1px 2px rgba(26,26,26,0.05);
  --shadow-sm: 0 1px 3px rgba(26,26,26,0.08), 0 1px 2px rgba(26,26,26,0.04);
  --shadow-md: 0 4px 12px rgba(26,26,26,0.08);
  --shadow-lg: 0 12px 32px rgba(26,26,26,0.10);
  --shadow-card: 0 2px 10px rgba(26,26,26,0.06);
  --shadow-orange: 0 8px 20px rgba(239,105,57,0.28);
  --shadow-focus: 0 0 0 3px rgba(239,105,57,0.22);

  /* ---- Layout ---- */
  --container-max: 1120px;
  --topbar-h: 70px;

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 320ms;
}

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
/* Scale the whole site up a touch on larger screens — the fixed-px type
   scale reads small on wide monitors. Mobile keeps its tuned sizes. */
@media (min-width: 900px) {
  body { zoom: 1.08; }
}
body { overflow-x: clip; }
body {
  margin: 0;
  background: #fff;
  font-family: var(--font-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--text-secondary); text-decoration: none; }
a:hover { color: var(--text-primary); }
img { max-width: 100%; }
iconify-icon { display: inline-block; vertical-align: middle; }
h1, h2, h3, h4 { font-family: var(--font-display); }

.wrap { max-width: var(--container-max); margin: 0 auto; padding-left: 32px; padding-right: 32px; }

/* ============================================================
   NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,243,240,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header__inner {
  max-width: 100%; margin: 0; padding: 0 40px;
  height: var(--topbar-h); position: relative;
  display: flex; align-items: center; justify-content: space-between;
}
.site-header__logo img { height: 40px; width: auto; display: block; }
.nav-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500;
}
.nav-center a {
  padding: 7px 14px; border-radius: 6px; border: 1px solid transparent;
  color: var(--text-secondary); transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.nav-center a:hover { background: var(--ai-orange-wash); color: var(--brand-primary); }
.nav-center a.is-active { color: var(--text-primary); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-right .nav-login {
  font-weight: 600; color: var(--text-primary);
  padding: 8px 18px; border-radius: var(--radius-pill); border: 1px solid transparent;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.nav-right .nav-login:hover {
  background: var(--ai-orange-wash);
  color: var(--brand-primary);
  border-color: var(--ai-orange-tint);
}
.nav-toggle {
  display: none; background: transparent; border: none; cursor: pointer;
  padding: 6px; color: var(--text-primary); font-size: 24px; line-height: 1;
}
.mobile-nav { display: none; }

/* ============================================================
   BUTTONS  (ports the DS "Button" component)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; line-height: 1;
  border-radius: var(--radius-pill); border: 1.5px solid transparent;
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: background var(--dur-base) ease, color var(--dur-base) ease,
              box-shadow var(--dur-base) ease, transform var(--dur-base) ease, border-color var(--dur-base) ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 0 18px; height: 38px; font-size: 14px; }
.btn-md { padding: 0 22px; height: 46px; font-size: 15px; }
.btn-lg { padding: 0 26px; height: 54px; font-size: 16px; }

.btn-primary { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.btn-primary:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); color: #fff; box-shadow: var(--shadow-orange); }

.btn-secondary { background: #fff; color: var(--text-primary); border-color: var(--border-default); }
.btn-secondary:hover { background: var(--ai-neutral-50); color: var(--text-primary); border-color: var(--border-strong); }

/* ============================================================
   SECTION HELPERS
   ============================================================ */
.eyebrow {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--brand-primary); margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display); font-weight: 500; font-size: 44px;
  letter-spacing: -0.02em; margin: 0; line-height: 1.1;
}
.section-lead {
  font-size: 18px; color: var(--text-secondary); line-height: 1.5;
  margin: 16px auto 0; max-width: 560px;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
/* Elements start hidden (JS adds .reveal-init only when motion is allowed),
   then .is-revealed animates them into place as they scroll into view. */
.reveal-init {
  opacity: 0;
  transform: translateY(32px);
  will-change: opacity, transform;
  transition: opacity 0.75s cubic-bezier(.16,1,.3,1), transform 0.75s cubic-bezier(.16,1,.3,1);
}
.reveal-init.is-revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero-h1, .hero-f1, .hero-f2, .hero-f3, .hero-f4 { animation: none !important; }
  .hero-underline::after { animation: none !important; transform: scaleX(1) !important; }
}

/* ---- Hero entrance animations (ported from Home <style>) ---- */
@keyframes heroRise { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
@keyframes heroUnderline { from { transform:scaleX(0); } to { transform:scaleX(1); } }
@keyframes heroFade { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
.hero-h1 { animation: heroRise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.hero-f1 { animation: heroFade 0.7s cubic-bezier(.2,.7,.2,1) 0.45s both; }
.hero-f2 { animation: heroFade 0.7s cubic-bezier(.2,.7,.2,1) 0.6s both; }
.hero-f3 { animation: heroFade 0.7s cubic-bezier(.2,.7,.2,1) 0.75s both; }
.hero-f4 { animation: heroFade 0.7s cubic-bezier(.2,.7,.2,1) 0.95s both; }
.hero-underline { position: relative; white-space: nowrap; }
.hero-underline::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.02em;
  height: 0.055em; background: var(--text-primary); border-radius: 999px;
  transform: scaleX(0); transform-origin: left;
  animation: heroUnderline 1.1s cubic-bezier(.2,.7,.2,1) 0.85s both;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-bg); border-top: 1px solid var(--border-subtle);
  padding: 56px 32px 44px;
}
.site-footer__inner {
  max-width: var(--container-max); margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center;
}
.site-footer__logo img { height: 40px; width: auto; }
.site-footer__social { display: flex; gap: 18px; }
.site-footer__social a { color: var(--text-muted); font-size: 20px; }
.site-footer__social a:hover { color: var(--brand-primary); }
.site-footer__links {
  display: flex; gap: 20px; font-size: 13px; flex-wrap: wrap; justify-content: center;
}
.site-footer__links a { color: var(--text-muted); }
.site-footer__links a:hover { color: var(--text-primary); }
.site-footer__copy { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   SHARED COMPONENTS: pill toggle, FAQ accordion, help tooltip
   (used across Home, Pricing, Learn …)
   ============================================================ */
.toggle-pills { display:inline-flex; gap:4px; padding:5px; background:var(--ai-neutral-200); border-radius:var(--radius-pill); }
.toggle-pills button {
  padding:11px 22px; border-radius:var(--radius-pill); border:none; cursor:pointer;
  font-family:var(--font-body); font-size:15px; font-weight:600; transition:all 140ms ease;
  background:transparent; color:var(--text-muted);
}
.toggle-pills button.is-active { background:#fff; color:var(--text-primary); box-shadow:var(--shadow-card); }

.faq-item { background:var(--color-bg); border:1px solid var(--border-subtle); border-radius:var(--radius-lg); overflow:hidden; }
.faq-item__q {
  width:100%; background:transparent; border:none; cursor:pointer; padding:22px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:16px; text-align:left;
  font-family:var(--font-display); font-size:18px; font-weight:600; color:var(--text-primary);
}
.faq-item__a { padding:0 24px 22px; font-size:16px; color:var(--text-secondary); line-height:1.6; }
.faq-item__a[hidden] { display:none; }

.fee-tip-wrap { position:relative; display:inline-flex; vertical-align:middle; margin-left:6px; cursor:help; }
.fee-tip {
  position:absolute; bottom:calc(100% + 10px); left:-14px; width:250px; background:#fff;
  border:1px solid var(--border-subtle); border-radius:var(--radius-md); box-shadow:var(--shadow-card);
  padding:13px 15px; font-size:13px; color:var(--text-secondary); line-height:1.45; text-align:left;
  z-index:30; opacity:0; transform:translateY(4px); pointer-events:none;
  transition:opacity 140ms ease, transform 140ms ease; font-family:var(--font-body); font-weight:400;
}
.fee-tip-wrap:hover .fee-tip, .fee-tip-wrap:focus-within .fee-tip { opacity:1; transform:translateY(0); }

/* ============================================================
   LEGAL PAGES (Disclaimer / Privacy / Terms)
   ============================================================ */
.legal p { font-size:16px; color:var(--text-secondary); line-height:1.7; margin:0 0 16px; }
.legal h2 { font-family:var(--font-display); font-weight:600; font-size:24px; letter-spacing:-0.01em; color:var(--text-primary); margin:44px 0 14px; }
.legal ul { margin:0 0 16px; padding-left:22px; }
.legal li { font-size:16px; color:var(--text-secondary); line-height:1.7; margin:0 0 8px; }
.legal strong { color:var(--text-primary); font-weight:600; }
.legal a { color:var(--brand-primary); font-weight:600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .nav-center { display: none; }
  .nav-right .nav-login { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-nav {
    display: none; border-top: 1px solid var(--border-subtle);
    background: rgba(245,243,240,0.98); backdrop-filter: blur(10px);
  }
  .mobile-nav.open { display: block; }
  .mobile-nav a {
    display: block; padding: 14px 32px; font-size: 16px; font-weight: 500;
    color: var(--text-primary); border-bottom: 1px solid var(--border-subtle);
    text-align: center;
  }
  /* Login + Get Started rendered as distinct pill buttons, set apart from nav links */
  .mobile-nav a[href*="/login"],
  .mobile-nav a.mobile-cta {
    border-bottom: none; border-radius: var(--radius-pill);
    margin: 0 24px; padding: 13px 24px; font-weight: 700;
  }
  .mobile-nav a[href*="/login"] {
    margin-top: 18px; border: 1.5px solid var(--border-default); color: var(--text-primary);
  }
  .mobile-nav a[href*="/login"]:hover { background: var(--ai-orange-wash); border-color: var(--ai-orange-tint); color: var(--brand-primary); }
  .mobile-nav a.mobile-cta {
    margin-top: 10px; margin-bottom: 18px;
    background: var(--brand-primary); color: #fff;
  }
  .mobile-nav a.mobile-cta:hover { background: var(--brand-primary-hover); color: #fff; }
}

@media (max-width: 720px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .site-header__inner { padding: 0 20px; }
  .section-title { font-size: 32px; }
  .section-lead { font-size: 16px; }
  .site-footer { padding: 44px 20px 36px; }
}
