/* ============================================
   Rapih AI — Blog stylesheet
   --------------------------------------------
   Self-contained. Tokens mirror the inline
   <style> block in /index.html (the live source
   of truth for the landing page). Do not link
   /styles.css here — that file is orphaned and
   not used by the landing page.
   ============================================ */

:root {
  --bg: #FAF7F2;
  --bg-tint: #F4EFE5;
  --bg-card: #FFFFFF;
  --bg-ink: #16201A;
  --ink: #16201A;
  --ink-soft: #3B453E;
  --ink-mute: #6F7A72;
  --ink-on-dark: #F4EFE5;
  --ink-mute-on-dark: #9DA89F;
  --line: #E5DFD0;
  --line-soft: #EFEAE0;
  --green: #2F6B4F;
  --green-deep: #234E3A;
  --green-soft: #D7E5D5;
  --green-tint: #EAF1E5;
  --peach: #E5B595;
  --gold: #D4A857;
  --gold-soft: rgba(212,168,87,.22);
  --shadow-sm: 0 1px 2px rgba(22,32,26,.04), 0 0 0 1px rgba(22,32,26,.03);
  --shadow-md: 0 4px 18px -6px rgba(22,32,26,.10), 0 1px 3px rgba(22,32,26,.04);
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease-out: cubic-bezier(0.2, 0.65, 0.3, 0.9);
  --glass-bg-strong: rgba(250,247,242,.9);
}

@keyframes mesh-drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(-2.5%,2%,0) scale(1.04); }
  100% { transform: translate3d(1.5%,-1.5%,0) scale(1.02); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 { margin: 0; letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(34px,4.4vw,52px); line-height: 1.08; font-weight: 700; letter-spacing: -.035em; }
h2 { font-size: clamp(25px,2.6vw,32px); line-height: 1.18; font-weight: 700; letter-spacing: -.03em; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 600; }
.serif-em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }

.container { width: 100%; max-width: 1200px; padding: 0 32px; margin: 0 auto; }
.narrow { max-width: 720px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--green);
  letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 12px 5px 10px; border-radius: var(--r-pill);
  background: var(--green-tint); border: 1px solid var(--green-soft);
}
.eyebrow-dot { width: 15px; height: 15px; border-radius: 5px; background-image: url('/rapih_ai_icon_transparant.png'); background-size: cover; background-position: center; flex-shrink: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .15s ease, background .18s ease, box-shadow .18s ease;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(180deg, #263329 0%, var(--bg-ink) 55%); color: var(--ink-on-dark); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.16), inset 0 -3px 4px -1px rgba(0,0,0,.4), 0 8px 20px -8px rgba(22,32,26,.55); }
.btn-primary:hover { background: linear-gradient(180deg, #2c3a30 0%, #1f2c24 55%); transform: translateY(-1px); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.18), inset 0 -3px 4px -1px rgba(0,0,0,.4), 0 12px 26px -10px rgba(22,32,26,.6); }
.btn-primary:active { transform: translateY(0) scale(.96); box-shadow: inset 0 2px 5px rgba(0,0,0,.5); }
.btn-green { background: linear-gradient(180deg, #3a7d5c 0%, var(--green) 55%); color: #fff; box-shadow: inset 0 1.5px 0 rgba(255,255,255,.28), inset 0 -3px 4px -1px rgba(0,0,0,.22), 0 8px 20px -10px rgba(47,107,79,.55); background-size: 100% 220%; background-position: 0% 0%; transition: transform .15s ease, background-position .4s ease, box-shadow .18s ease; }
.btn-green:hover { background-position: 0% 100%; transform: translateY(-1px); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.3), inset 0 -3px 4px -1px rgba(0,0,0,.22), 0 12px 26px -10px rgba(47,107,79,.65); }
.btn-green:active { transform: translateY(0) scale(.96); box-shadow: inset 0 2px 5px rgba(0,0,0,.3); }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.btn-secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-secondary:hover { background: #fff; transform: translateY(-1px); }

/* ---------- Nav — floating dark pill ---------- */
.nav { position: sticky; top: 0; z-index: 50; padding: 18px 20px 0; background: transparent; }
.nav .container.nav-inner {
  max-width: 960px; height: 62px; gap: 20px; padding: 0 10px 0 22px;
  background: var(--bg-ink); border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 20px 45px -18px rgba(22,32,26,.5), 0 2px 10px -4px rgba(22,32,26,.35), inset 0 1px 0 rgba(255,255,255,.06);
  transition: box-shadow .3s ease, transform .3s ease;
}
.nav.scrolled .container.nav-inner { box-shadow: 0 26px 60px -16px rgba(22,32,26,.6), 0 4px 18px -4px rgba(22,32,26,.4), inset 0 1px 0 rgba(255,255,255,.08); transform: translateY(-1px); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link { padding: 8px 13px; font-size: 13.5px; color: var(--ink-mute-on-dark); border-radius: var(--r-pill); transition: background .15s ease, color .15s ease; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15.5px; letter-spacing: -.02em; color: var(--ink-on-dark); }

/* ---------- Header atmosphere — gradient mesh + dot grid ----------
   Mirrors index.html's hero atmosphere so every page carries the same
   gradient/tech texture, not just the homepage. .blog-head/.article-head
   live inside the narrow (720px) content column, not a full-width section,
   so a naive inset-based pseudo-element gets clipped to that column's
   width — a visible hard-edged rectangle instead of a page-wide wash.
   Break out of the column with the standard full-bleed trick (100vw wide,
   offset by -50vw from its own centered midpoint) so the gradient spans
   edge-to-edge like it does on the homepage hero. */
.blog-head, .article-head { position: relative; }
.blog-head::before, .article-head::before {
  content: ""; position: absolute; top: -8%; bottom: -8%; left: calc(-50vw + 50%); width: 100vw; z-index: 0; pointer-events: none;
  background:
    radial-gradient(22% 70% at 18% 0%, rgba(47,107,79,.13), transparent 68%),
    radial-gradient(18% 60% at 84% 0%, rgba(212,168,87,.12), transparent 68%);
  animation: mesh-drift 22s ease-in-out infinite alternate;
}
.blog-head::after, .article-head::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(-50vw + 50%); width: 100vw; z-index: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(22,32,26,.08) 1.5px, transparent 1.5px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 32% 80% at 50% 0%, black 25%, transparent 85%);
  mask-image: radial-gradient(ellipse 32% 80% at 50% 0%, black 25%, transparent 85%);
}
.blog-head > *, .article-head > * { position: relative; z-index: 1; }

/* ---------- Breadcrumb ---------- */
.crumb { font-size: 13.5px; color: var(--ink-mute); padding: 28px 0 0; }
.crumb a:hover { color: var(--green); }
.crumb span { margin: 0 7px; opacity: .6; }

/* ---------- Blog index ---------- */
.blog-head { padding: 44px 0 12px; }
.blog-head h1 { margin: 20px 0 16px; }
.blog-head p { font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 60ch; margin: 0; }

.post-list { display: grid; gap: 20px; padding: 48px 0 96px; }
.post-card {
  display: block; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px 30px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.post-card:hover { box-shadow: var(--shadow-md); border-color: var(--green-soft); transform: translateY(-2px); }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 14px; }
.post-tag { background: var(--green-tint); color: var(--green); border: 1px solid var(--green-soft); border-radius: var(--r-pill); padding: 3px 10px; letter-spacing: .06em; }
.post-card h2 { font-size: 25px; line-height: 1.24; margin-bottom: 10px; }
.post-card p { margin: 0; font-size: 15.5px; line-height: 1.62; color: var(--ink-soft); }
.post-more { display: inline-block; margin-top: 18px; font-size: 14.5px; font-weight: 600; color: var(--green); }

/* ---------- Article ---------- */
.article-head { padding: 36px 0 8px; }
.article-head h1 { margin: 20px 0 20px; }
.article-lede { font-size: 19px; line-height: 1.62; color: var(--ink-soft); margin: 0 0 28px; }
.article-byline { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13.5px; color: var(--ink-mute); padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.article-byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }

.prose { padding: 40px 0 24px; font-size: 17px; line-height: 1.72; color: var(--ink-soft); }
.prose > * { max-width: 68ch; }
.prose h2 { margin: 48px 0 16px; color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 34px 0 12px; font-size: 19px; color: var(--ink); }
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 22px; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--green); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--green-deep); }

/* Buttons and cards inside prose are components, not inline links — the rule
   above outranks .btn-green on specificity and would paint the label green on
   a green fill, underlined. Restore each component's own colours. */
.prose a.btn, .prose a.post-card { text-decoration: none; }
.prose a.btn-green, .prose a.btn-green:hover { color: #fff; }
.prose a.btn-primary, .prose a.btn-primary:hover { color: var(--ink-on-dark); }
.prose a.btn-secondary, .prose a.btn-secondary:hover { color: var(--ink); }
.prose a.post-card, .prose a.post-card:hover { color: inherit; font-weight: 400; }
.prose a.post-card .post-more { color: var(--green); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 44px 0; }

.callout {
  background: var(--green-tint); border: 1px solid var(--green-soft);
  border-radius: var(--r-md); padding: 24px 26px; margin: 0 0 26px;
}
.callout h3 { font-size: 16px; margin: 0 0 8px; color: var(--green-deep); }
.callout p:last-child { margin-bottom: 0; }

.example {
  background: var(--bg-card); border: 1px solid var(--line);
  border-left: 3px solid var(--peach);
  border-radius: var(--r-sm); padding: 22px 24px; margin: 0 0 26px;
  font-size: 15.5px;
}
.example p:last-child { margin-bottom: 0; }
.example .label { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-mute); display: block; margin-bottom: 10px; }

.chat-demo { background: var(--bg-tint); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; margin: 0 0 26px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); white-space: pre-wrap; }

.table-wrap { overflow-x: auto; margin: 0 0 26px; max-width: 100%; }
.prose table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; color: var(--ink); background: var(--bg-tint); font-size: 13.5px; letter-spacing: .01em; }
.prose td.num { font-family: var(--font-mono); font-size: 14px; white-space: nowrap; }

/* ---------- Article CTA ---------- */
.article-cta {
  background: var(--bg-ink); color: var(--ink-on-dark);
  border-radius: var(--r-lg); padding: 44px 40px; margin: 48px 0 0; text-align: center;
}
.article-cta h2 { color: var(--ink-on-dark); font-size: 27px; margin-bottom: 14px; }
.article-cta p { color: #9DA89F; font-size: 16px; line-height: 1.6; margin: 0 auto 26px; max-width: 46ch; }

.next-read { padding: 56px 0 0; }
.next-read h2 { font-size: 20px; margin-bottom: 18px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px 0 40px; margin-top: 96px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer-brand { max-width: 320px; }
.footer-brand p { margin: 14px 0 0; font-size: 14px; color: var(--ink-mute); line-height: 1.5; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 11.5px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .09em; margin: 0 0 14px; font-weight: 600; }
.footer-col a { display: block; font-size: 14.5px; color: var(--ink-soft); padding: 4px 0; transition: color .15s ease; }
.footer-col a:hover { color: var(--green); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-mute); flex-wrap: wrap; gap: 16px; }

@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .nav-links { display: none; }
  .nav { padding: 14px 12px 0; }
  .nav .container.nav-inner { padding: 0 8px 0 14px; gap: 10px; }
  .logo { font-size: 14px; gap: 7px; }
  .nav .container.nav-inner .btn { height: 40px; padding: 0 14px; font-size: 13px; }
  .nav .container.nav-inner .btn .arrow { display: none; }
  .prose { font-size: 16.5px; }
  .article-cta { padding: 36px 26px; }
  .post-card { padding: 26px 22px; }
}
