/* =========================================================
   OCR Engine — styles
   Palette: white base, indigo accent, slate text
   ========================================================= */

:root {
  --indigo:        #4f46e5;
  --indigo-dark:   #4338ca;
  --indigo-soft:   #eef2ff;
  --indigo-tint:   #f5f6ff;
  --accent:        #06b6d4; /* secondary cyan accent */
  --ink:           #0f172a;
  --slate:         #475569;
  --slate-light:   #64748b;
  --line:          #e9ebf2;
  --white:         #ffffff;
  --bg:            #ffffff;
  --bg-alt:        #f8f9fc;
  --code-bg:       #0f172a;
  --ok:            #16a34a;
  --danger:        #dc2626;

  --radius:        14px;
  --radius-lg:     20px;
  --shadow-sm:     0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow-md:     0 10px 30px -12px rgba(15,23,42,.18);
  --shadow-lg:     0 24px 60px -20px rgba(79,70,229,.30);
  --container:     1140px;
  --ease:          cubic-bezier(.16,.84,.44,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; font-weight: 800; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
code, pre { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: .95rem; line-height: 1;
  padding: .8rem 1.3rem; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s, color .18s, border-color .18s;
  white-space: nowrap;
}
.btn-sm  { padding: .6rem 1rem; font-size: .9rem; }
.btn-lg  { padding: .95rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--indigo); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(79,70,229,.6);
}
.btn-primary:hover { background: var(--indigo-dark); transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(79,70,229,.7); }
.btn-ghost {
  background: #fff; color: var(--ink); border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: #cdd2e4; transform: translateY(-1px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--indigo);
  /* No divider so header flows seamlessly into the hero's first fold */
  border-bottom: 1px solid transparent;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: #fff; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: #fff; color: var(--indigo); box-shadow: 0 6px 14px -6px rgba(0,0,0,.35);
}
.brand-accent { color: #c7d2fe; }
.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a { color: rgba(255,255,255,.82); font-weight: 500; font-size: .95rem; transition: color .15s; }
.site-nav a:hover { color: #fff; }
/* "Get API key" button: invert to white-on-blue so it stands out on the header */
.site-nav .btn-primary {
  background: #fff; color: var(--indigo);
  box-shadow: 0 8px 20px -10px rgba(0,0,0,.45);
}
.site-nav .btn-primary:hover { background: var(--indigo-soft); color: var(--indigo-dark); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: .25s; }
.mobile-nav { display: none; flex-direction: column; gap: .25rem; padding: 0 24px 16px; background: var(--indigo); }
.mobile-nav a { padding: .7rem 0; color: rgba(255,255,255,.9); border-bottom: 1px solid rgba(255,255,255,.14); font-weight: 500; }
.mobile-nav .btn { margin-top: .6rem; }
.mobile-nav .btn-primary { background: #fff; color: var(--indigo); }

/* ---------- Hero ---------- */
/* The hero shares the header's indigo so header + hero form one solid-blue
   "first fold". */
.hero {
  position: relative; overflow: hidden;
  padding: 88px 0 72px;
  color: #fff;
  background:
    radial-gradient(900px 440px at 88% -12%, rgba(255,255,255,.16), transparent 60%),
    radial-gradient(760px 400px at -8% 0%, rgba(6,182,212,.28), transparent 55%),
    linear-gradient(180deg, var(--indigo) 0%, var(--indigo-dark) 100%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--indigo); background: var(--indigo-soft); padding: .35rem .7rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); margin-bottom: 1.1rem; }
.hero .eyebrow { color: #fff; background: rgba(255,255,255,.16); }
.lead { font-size: 1.15rem; color: var(--slate); max-width: 30rem; }
.hero .lead { color: rgba(255,255,255,.88); }
.hero-actions { display: flex; gap: .8rem; margin: 1.8rem 0 2rem; flex-wrap: wrap; }
/* On the blue hero, invert the CTAs: white solid + white outline */
.hero .btn-primary {
  background: #fff; color: var(--indigo);
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.45);
}
.hero .btn-primary:hover { background: var(--indigo-soft); color: var(--indigo-dark); }
.hero .btn-ghost {
  background: transparent; color: #fff; border-color: rgba(255,255,255,.5);
  box-shadow: none;
}
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.hero-stats { display: flex; gap: 2.4rem; list-style: none; padding: 0; margin: 0; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.hero-stats span { font-size: .85rem; color: var(--slate-light); }
.hero .hero-stats span { color: rgba(255,255,255,.72); }

/* Hero visual cards */
.hero-visual { position: relative; }
.code-card {
  background: var(--code-bg); color: #e2e8f0; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid #1e293b; overflow: hidden;
}
.code-card-head {
  display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem;
  border-bottom: 1px solid #1e293b; background: #111a2e;
}
.code-card-head .dot { width: 11px; height: 11px; border-radius: 50%; background: #334155; }
.code-card-head .dot:nth-child(1){ background:#ef4444aa; }
.code-card-head .dot:nth-child(2){ background:#eab308aa; }
.code-card-head .dot:nth-child(3){ background:#22c55eaa; }
.code-card-title { margin-left: auto; font-size: .78rem; color: #94a3b8; font-family: "JetBrains Mono", monospace; }
.code-block { margin: 0; padding: 1.1rem 1.2rem; font-size: .85rem; line-height: 1.65; overflow-x: auto; }
.code-block code { color: #cbd5e1; white-space: pre; }
.c-key { color: #93c5fd; }
.c-str { color: #86efac; }
.c-num { color: #fca5a5; }
.c-comment { color: #64748b; font-style: italic; }
.badge-ok { font-family:"JetBrains Mono",monospace; font-size:.72rem; font-weight:600; color:#86efac; background:#14331f; padding:.2rem .5rem; border-radius:6px; }
.method-badge { font-family:"JetBrains Mono",monospace; font-size:.72rem; font-weight:700; color:#fff; background:var(--indigo); padding:.22rem .5rem; border-radius:6px; }
.code-card-result { margin-top: 1.1rem; margin-left: 2.2rem; }

/* ---------- Strip ---------- */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.strip-text { text-align: center; padding: 1.1rem 0; color: var(--slate-light); font-size: .95rem; font-weight: 500; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 42rem; margin: 0 auto 3rem; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: .9rem; }
.section-head p { color: var(--slate); font-size: 1.08rem; }

/* Features grid */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #dfe3f1; }
.feature-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--indigo-soft); color: var(--indigo); margin-bottom: 1.1rem;
}
.feature-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.feature-card p { color: var(--slate); font-size: .96rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.9rem; position: relative; box-shadow: var(--shadow-sm);
}
.step-num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  background: var(--indigo); color: #fff; font-weight: 800; font-size: 1.05rem; margin-bottom: 1rem;
}
.step h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.step p { color: var(--slate); font-size: .96rem; }

/* API section */
.api-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 52px; align-items: center; }
.api-copy h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: .9rem 0 1rem; }
.api-copy > p { color: var(--slate); font-size: 1.08rem; }
.check-list { list-style: none; padding: 0; margin: 1.4rem 0 1.8rem; display: grid; gap: .65rem; }
.check-list li { padding-left: 1.7rem; position: relative; color: var(--slate); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .5rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--indigo-soft);
  box-shadow: inset 0 0 0 3px var(--indigo);
}
.check-list code, .api-copy code {
  font-size: .85em; background: var(--indigo-tint); color: var(--indigo-dark);
  padding: .12rem .4rem; border-radius: 6px;
}

/* ---------- Contact ---------- */
.section-contact { background: linear-gradient(180deg, var(--bg-alt), #fff); }
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 52px; align-items: start; }
.contact-copy h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: .9rem 0 1rem; }
.contact-copy > p { color: var(--slate); font-size: 1.08rem; }
.contact-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .8rem; }
.contact-points li { display: flex; align-items: center; gap: .65rem; color: var(--ink); font-weight: 500; }
.contact-points svg { color: var(--indigo); flex: none; }

.contact-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow-md);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.form-field label { font-size: .88rem; font-weight: 600; color: var(--ink); }
.form-field input,
.form-field select,
.form-field textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem;
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
.form-field textarea { resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none; border-color: var(--indigo);
  box-shadow: 0 0 0 4px rgba(79,70,229,.14);
}
.form-field.invalid input,
.form-field.invalid textarea { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(220,38,38,.12); }
.error-text { font-size: .8rem; color: var(--danger); min-height: 0; }
.form-note { font-size: .8rem; color: var(--slate-light); margin-top: .9rem; text-align: center; }
.form-success {
  display: flex; align-items: center; gap: .6rem; margin-top: 1.1rem;
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
  padding: .9rem 1rem; border-radius: 12px; font-weight: 500; font-size: .95rem;
}
.form-success svg { color: var(--ok); flex: none; }
.form-error {
  display: flex; align-items: center; gap: .6rem; margin-top: 1.1rem;
  background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
  padding: .9rem 1rem; border-radius: 12px; font-weight: 500; font-size: .95rem;
}
.form-error svg { color: var(--danger); flex: none; }
/* `hidden` must win over the display:flex above so these only show after submit */
.form-success[hidden], .form-error[hidden] { display: none; }
.btn[disabled] { opacity: .65; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* ---------- Footer (simple, no menu links) ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-copy { color: var(--slate-light); font-size: .9rem; }

/* ---------- Docs page ---------- */
.docs-hero { padding: 64px 0 32px; background: var(--indigo-tint); border-bottom: 1px solid var(--line); }
.docs-hero h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); margin-bottom: .8rem; }
.docs-hero p { color: var(--slate); font-size: 1.1rem; max-width: 40rem; }
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 48px; padding: 56px 0; }
.docs-toc { position: sticky; top: 92px; align-self: start; }
.docs-toc h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-light); margin: 0 0 .8rem; }
.docs-toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .15rem; }
.docs-toc a { display: block; padding: .4rem .6rem; border-radius: 8px; color: var(--slate); font-size: .92rem; }
.docs-toc a:hover { background: var(--indigo-soft); color: var(--indigo-dark); }
.docs-content h2 { font-size: 1.6rem; margin: 0 0 1rem; scroll-margin-top: 90px; }
.docs-content h3 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
.docs-content p { color: var(--slate); margin-bottom: 1rem; }
.docs-block { margin-bottom: 3rem; }
.docs-content .code-card { margin: 1.2rem 0; }
.docs-content code:not(.code-block code) {
  font-size: .85em; background: var(--indigo-tint); color: var(--indigo-dark);
  padding: .12rem .4rem; border-radius: 6px;
}
.param-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .92rem; }
.param-table th, .param-table td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
.param-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-light); }
.param-table td code { background: var(--indigo-tint); color: var(--indigo-dark); padding: .1rem .35rem; border-radius: 5px; font-size: .9em; }
.tag-req { font-size: .72rem; font-weight: 700; color: var(--indigo); }
.tag-opt { font-size: .72rem; font-weight: 600; color: var(--slate-light); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .api-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; max-width: 520px; }
  .card-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; }
}
@media (max-width: 680px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .site-header.open .mobile-nav { display: flex; }
  .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); }
  .card-grid, .steps, .form-row { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 60px 0; }
  .hero-stats { gap: 1.6rem; }
  .code-card-result { margin-left: 0; }
  .contact-form { padding: 1.4rem; }
}
