/* Forage — shared design system
   Concept: gather clean data from the wild web.
   Deep-forest ink + chanterelle gold. Green is functional only. */

@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --ink:        #0c120e;   /* deep forest, page bg */
  --ink-2:      #10180f;   /* alt band */
  --panel:      #141d16;   /* raised surface */
  --panel-2:    #182219;   /* raised surface, hover */
  --line:       #26332a;   /* hairline */
  --line-soft:  #1c2820;
  --text:       #e9ede3;   /* birch white */
  --muted:      #93a394;   /* sage */
  --muted-2:    #6c7d6f;   /* dim sage */
  --gold:       #d4ad57;   /* chanterelle — primary accent */
  --gold-soft:  #e6c987;
  --gold-dim:   rgba(212, 173, 87, 0.14);
  --fern:       #79b46f;   /* living green — functional only */
  --fern-dim:   rgba(121, 180, 111, 0.13);
  --danger:     #d98b6a;

  --maxw: 1120px;
  --radius: 14px;
  --radius-sm: 9px;

  --serif: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* faint canopy light from the top */
  background-image:
    radial-gradient(1100px 520px at 78% -12%, rgba(212, 173, 87, 0.07), transparent 60%),
    radial-gradient(760px 420px at 8% -8%, rgba(121, 180, 111, 0.05), transparent 55%);
  background-attachment: fixed;
}

::selection { background: var(--gold); color: #1a1405; }

a { color: var(--gold-soft); text-decoration-color: rgba(230, 201, 135, 0.35); text-underline-offset: 3px; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: -0.02em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(12, 18, 14, 0.72);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--serif); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.mark { flex: none; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-links .navbtn { color: var(--ink); }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: #1a1405; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 10px 30px -12px rgba(212,173,87,.6); }
.btn-primary:hover { background: var(--gold-soft); color: #1a1405; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); background: var(--gold-dim); }
.navbtn { padding: 9px 17px; font-size: 14px; }

/* ---------- sections ---------- */
section { padding: 92px 0; }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 44px); margin-top: 16px; }
.section-head p { color: var(--muted); font-size: 18px; margin: 14px 0 0; }
.band { background: var(--ink-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

/* ---------- hero ---------- */
.hero { padding: 84px 0 76px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6.4vw, 78px); font-weight: 800; letter-spacing: -0.035em; }
.hero h1 .wild { color: var(--gold); font-style: italic; font-weight: 700; }
.hero h1 .clean { position: relative; white-space: nowrap; }
.hero h1 .clean::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.07em; height: 0.13em; background: var(--fern); opacity: .55; border-radius: 2px; }
.hero-sub { color: var(--muted); font-size: 20px; line-height: 1.55; margin: 26px 0 0; max-width: 30ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 22px; margin-top: 30px; color: var(--muted-2); font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; flex-wrap: wrap; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fern); box-shadow: 0 0 10px var(--fern); }

@media (max-width: 860px) {
  .hero { padding: 56px 0 60px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-sub { max-width: none; }
  section { padding: 68px 0; }
  .section-head { margin-bottom: 40px; }
}

.reveal { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal.d1 { animation-delay: .05s; } .reveal.d2 { animation-delay: .13s; }
.reveal.d3 { animation-delay: .21s; } .reveal.d4 { animation-delay: .29s; } .reveal.d5 { animation-delay: .37s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- terminal / code ---------- */
.terminal {
  background: linear-gradient(180deg, #0f160f, #0b110c);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.8), 0 0 0 1px rgba(212,173,87,.05);
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); background: rgba(255,255,255,.015); }
.term-bar .lamp { width: 11px; height: 11px; border-radius: 50%; background: #29352b; }
.term-title { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted-2); }
.term-copy { margin-left: auto; }
.copy-btn {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; cursor: pointer; transition: all .15s ease;
}
.copy-btn:hover { color: var(--gold-soft); border-color: var(--gold); }
.copy-btn.copied { color: var(--fern); border-color: var(--fern); }

pre { margin: 0; }
.term-body { padding: 20px 20px 22px; overflow-x: auto; }
.term-body pre, code { font-family: var(--mono); font-size: 13.5px; line-height: 1.75; }
.term-body pre { color: #cdd8cc; white-space: pre; }
.cl { color: var(--muted-2); }         /* comment / label */
.cmd { color: var(--gold-soft); }       /* command keyword */
.flag { color: #9db9c9; }               /* flags */
.str { color: var(--fern); }            /* strings */
.key { color: #d9c58a; }                /* json keys */
.punc { color: var(--muted-2); }
.prompt { color: var(--gold); }

code.inline { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 6px; font-size: .88em; color: var(--gold-soft); }

/* ---------- pills / meta ---------- */
.pill { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.pill-cost { background: var(--gold-dim); color: var(--gold-soft); border: 1px solid rgba(212,173,87,.28); }
.pill-free { background: var(--fern-dim); color: #a7d69f; border: 1px solid rgba(121,180,111,.3); }
.pill-method { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }

/* ---------- field guide (endpoints) ---------- */
.guide { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.specimen { background: var(--panel); padding: 26px 26px 24px; position: relative; transition: background .2s ease; }
.specimen:hover { background: var(--panel-2); }
.specimen-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.specimen-path { font-family: var(--mono); font-size: 13px; color: var(--gold-soft); }
.specimen-path b { color: var(--muted-2); font-weight: 500; }
.specimen h3 { font-size: 21px; margin: 14px 0 8px; letter-spacing: -0.01em; }
.specimen p { margin: 0 0 16px; color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.specimen .idx { position: absolute; top: 22px; right: 26px; font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--muted-2); }
@media (max-width: 760px) { .guide { grid-template-columns: 1fr; } }

/* ---------- how / steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 26px; background: var(--panel); }
.step .num { font-family: var(--mono); font-size: 12px; color: var(--gold); letter-spacing: .1em; }
.step h3 { font-size: 19px; margin: 12px 0 8px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- pricing ---------- */
.prices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
.price { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; background: var(--panel); display: flex; flex-direction: column; }
.price.feature { border-color: rgba(212,173,87,.45); background: linear-gradient(180deg, rgba(212,173,87,.06), var(--panel)); box-shadow: 0 24px 60px -40px rgba(212,173,87,.5); }
.price .amt { font-family: var(--serif); font-weight: 800; font-size: 40px; letter-spacing: -0.03em; }
.price .amt small { font-size: 16px; font-weight: 500; color: var(--muted); }
.price .credits { font-family: var(--mono); font-size: 14px; color: var(--gold-soft); margin-top: 4px; }
.price .per { color: var(--muted-2); font-size: 13px; margin-top: 6px; }
.price .tag { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; min-height: 14px; }
.price .btn { margin-top: auto; width: 100%; margin-top: 22px; }
@media (max-width: 900px) { .prices { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .prices { grid-template-columns: 1fr; } }
.buy-note { text-align: center; color: var(--muted-2); font-size: 13.5px; margin-top: 22px; font-family: var(--mono); }

/* ---------- signup / try it ---------- */
.tryit { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), #0f160f); padding: 34px; }
.tryit h3 { font-size: 24px; margin-bottom: 6px; }
.tryit p { color: var(--muted); margin: 0 0 22px; }
.key-form { display: flex; gap: 10px; flex-wrap: wrap; }
.key-form input {
  flex: 1 1 240px; min-width: 0; font-family: var(--sans); font-size: 15px; color: var(--text);
  background: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px;
}
.key-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.key-out { margin-top: 18px; display: none; }
.key-out.show { display: block; }
.key-out .keybox { display: flex; align-items: center; gap: 10px; background: var(--ink); border: 1px dashed var(--gold); border-radius: var(--radius-sm); padding: 14px 16px; }
.key-out code { font-family: var(--mono); font-size: 14px; color: var(--gold-soft); word-break: break-all; flex: 1; }
.key-note { color: var(--fern); font-size: 13.5px; margin-top: 10px; font-family: var(--mono); }
.key-err { color: var(--danger); font-size: 14px; margin-top: 12px; display: none; }
.key-err.show { display: block; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 2px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.faq details { background: var(--panel); }
.faq summary { cursor: pointer; list-style: none; padding: 22px 26px; font-family: var(--serif); font-weight: 600; font-size: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-weight: 400; color: var(--gold); font-size: 22px; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .ans { padding: 0 26px 24px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.faq .ans a { }

/* ---------- CTA strip ---------- */
.cta-strip { text-align: center; }
.cta-strip h2 { font-size: clamp(30px, 4.6vw, 48px); }
.cta-strip p { color: var(--muted); font-size: 18px; margin: 16px auto 30px; max-width: 46ch; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-soft); padding: 56px 0 48px; background: var(--ink-2); }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer .brand { margin-bottom: 12px; }
.footer-tag { color: var(--muted-2); font-size: 14px; max-width: 34ch; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; margin-bottom: 14px; }
.footer-col a { display: block; color: var(--muted); text-decoration: none; font-size: 15px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--gold-soft); }
.footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 13px; font-family: var(--mono); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- docs / legal prose ---------- */
.doc-layout { display: grid; grid-template-columns: 232px 1fr; gap: 48px; align-items: start; }
.doc-nav { position: sticky; top: 88px; font-size: 14.5px; max-height: calc(100vh - 110px); overflow-y: auto; }
.doc-nav .grp { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); margin: 22px 0 10px; }
.doc-nav .grp:first-child { margin-top: 0; }
.doc-nav a { display: block; color: var(--muted); text-decoration: none; padding: 5px 0; border-left: 2px solid transparent; padding-left: 12px; margin-left: -2px; }
.doc-nav a:hover { color: var(--text); border-left-color: var(--line); }
.doc-nav a.on { color: var(--gold-soft); border-left-color: var(--gold); }
@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; } .doc-nav { position: static; max-height: none; margin-bottom: 20px; border-bottom: 1px solid var(--line-soft); padding-bottom: 18px; } }

.prose { max-width: 760px; }
.prose h2 { font-size: 30px; margin: 56px 0 8px; scroll-margin-top: 90px; padding-top: 8px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 21px; margin: 34px 0 6px; scroll-margin-top: 90px; }
.prose h4 { font-size: 15px; font-family: var(--mono); font-weight: 500; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; margin: 22px 0 8px; }
.prose p { color: #c3ccbf; margin: 12px 0; }
.prose ul { color: #c3ccbf; padding-left: 20px; }
.prose li { margin: 7px 0; }
.prose strong { color: var(--text); }
.ep { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 18px 0 8px; }
.ep-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--panel); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.ep-head .path { font-family: var(--mono); font-size: 15px; color: var(--text); }
.ep-head .cost { margin-left: auto; }
.codeblock { background: linear-gradient(180deg, #0f160f, #0b110c); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 16px 0; }
.codeblock .cb-bar { display: flex; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); background: rgba(255,255,255,.015); }
.codeblock .cb-title { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); letter-spacing: .04em; }
.codeblock .cb-body { padding: 16px 18px; overflow-x: auto; }
.codeblock pre { color: #cdd8cc; font-family: var(--mono); font-size: 13px; line-height: 1.7; }

table.codes { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14.5px; }
table.codes th, table.codes td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
table.codes th { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; }
table.codes td:first-child { font-family: var(--mono); color: var(--gold-soft); white-space: nowrap; }
table.codes tr:last-child td { border-bottom: none; }

.callout { border-left: 3px solid var(--fern); background: var(--fern-dim); padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 20px 0; color: #c3ccbf; font-size: 15px; }
.callout.gold { border-left-color: var(--gold); background: var(--gold-dim); }
