/* ============================================================================
   article.css — BiWize blog design system
   Technical-minimalism light theme. Reference: Vercel + Linear + Stripe blogs.
   Loaded by /insights/index.html and every article. Overrides the global
   dark-theme tokens from styles.css for blog pages only.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ---- Design tokens, scoped to body so global dark tokens are overridden ---- */
body {
  /* Background and text */
  background: #ffffff !important;
  color: #0a0a0a;

  /* Override dark-theme tokens so existing inline rules using var(--*)
     resolve to light-theme values on blog pages. */
  --bg: #ffffff;
  --fg: #0a0a0a;
  --fg-muted: #6b7280;
  --fg-faint: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --surface: #f7f7f7;
  --surface-2: #fafafa;
  --text: #0a0a0a;
  --text-muted: #6b7280;
  --green: #84ef5a;
  --green-ink: #2f7a14;          /* readable green on white */
  --green-glow: rgba(132,239,90,0.18);
  --black: #ffffff;              /* legacy var used by body bg */
  --black-2: #f7f7f7;

  /* Typography stack */
  --font-sans: "Geist", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  font-family: var(--font-sans);
  font-feature-settings: "ss01", "ss02", "cv11";  /* Geist alt forms when present */
}

/* Strip the dark site-wide matrix rain on blog pages */
#site-ambient-matrix,
.page-hero .matrix-rain,
.page-hero .page-hero-grid {
  display: none !important;
}

/* The hero shell itself was built for dark mode; make it transparent / light */
.page-hero {
  background: transparent !important;
  padding: 96px 5% 32px !important;
  border-bottom: 1px solid var(--border);
}

/* ============================================================================
   Light-mode site nav (applied by nav.js when on /insights/*)
   The base nav rules live in styles.css and assume dark; we override here.
   ============================================================================ */
body.insights nav#main-nav,
nav#main-nav.nav-light {
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
body.insights nav#main-nav .nav-logo-text {
  color: #0a0a0a !important;
}
body.insights nav#main-nav .nav-links a {
  color: #4b5563 !important;
  font-weight: 500;
}
body.insights nav#main-nav .nav-links a:hover,
body.insights nav#main-nav .nav-links a.active {
  color: #0a0a0a !important;
}
body.insights nav#main-nav .btn-login {
  color: #0a0a0a !important;
  border-color: var(--border) !important;
}
body.insights nav#main-nav .btn-login:hover {
  background: var(--surface) !important;
}
body.insights nav#main-nav .hamburger span {
  background: #0a0a0a !important;
}
body.insights .mobile-nav {
  background: #ffffff !important;
  border-color: var(--border) !important;
}
body.insights .mobile-nav a {
  color: #0a0a0a !important;
  border-color: var(--border) !important;
}

/* ============================================================================
   Article reading shell
   ============================================================================ */

.art-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Meta line: mono kicker (Linear's signature) */
.art-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-muted);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.art-meta .stage {
  color: #0a0a0a;
  font-weight: 500;
  position: relative;
  padding-left: 14px;
}
.art-meta .stage::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--green);
  transform: translateY(-50%);
}
.art-meta .author {
  color: var(--fg-muted);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-sans);
  font-size: 13px;
}

/* H1 — display-tight Vercel pattern.
   Scoped to body.insights so it beats styles.css `.page-hero h1` (specificity 0,1,1). */
body.insights .art-h1,
.art-h1 {
  font-family: var(--font-sans) !important;
  font-size: clamp(34px, 5vw, 52px) !important;
  font-weight: 600 !important;
  line-height: 1.08 !important;
  letter-spacing: -0.025em !important;
  color: #0a0a0a !important;
  text-shadow: none !important;
  margin: 0 0 20px !important;
  max-width: 18ch;
}

/* Lede — muted, generous. Same specificity guard as above. */
body.insights .art-lede,
.art-lede {
  font-family: var(--font-sans) !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  color: #374151 !important;
  line-height: 1.55 !important;
  margin: 0 0 40px !important;
  max-width: 640px !important;
  letter-spacing: -0.005em !important;
}

/* ============================================================================
   Article body
   ============================================================================ */

.art-body {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  color: #1f2937;
  max-width: 680px;
  letter-spacing: -0.003em;
}

.art-body p { margin: 0 0 22px; }
.art-body p:last-child { margin-bottom: 0; }

.art-body p strong,
.art-body li strong {
  color: #0a0a0a;
  font-weight: 600;
}

.art-body em { color: #0a0a0a; font-style: italic; }

/* Headings — tight tracking, 600 weight */
.art-body h2 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.018em;
  color: #0a0a0a;
  margin: 56px 0 18px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.art-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.art-body h3 {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: #0a0a0a;
  margin: 38px 0 12px;
}

/* Inline code — flat surface, mono, no nowrap */
.art-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 400;
  background: var(--surface);
  color: #0a0a0a;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* Code blocks — Vercel-style, ultra clean */
.art-body pre {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  background: var(--surface);
  color: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 28px 0;
}
.art-body pre code {
  background: none;
  padding: 0;
  border: none;
  color: inherit;
  white-space: pre;
}

/* Blockquote — Stripe/Linear minimal (no italic, no grey bg) */
.art-body blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid #0a0a0a;
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.55;
  color: #0a0a0a;
  letter-spacing: -0.005em;
}

/* Lists */
.art-body ul,
.art-body ol {
  margin: 0 0 26px 22px;
  padding-left: 4px;
}
.art-body li {
  margin-bottom: 8px;
  line-height: 1.65;
}
.art-body ul li::marker {
  color: var(--green-ink);
  font-size: 1.1em;
}
.art-body ol li::marker {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* Links — underlined, near-black with green hover */
.art-body a {
  color: #0a0a0a;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}
.art-body a:hover {
  text-decoration-color: var(--green);
  color: var(--green-ink);
}

.art-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* Tables (rare; defensive) */
.art-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.art-body th,
.art-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.art-body th {
  background: var(--surface);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.art-body tr:last-child td { border-bottom: none; }

/* ============================================================================
   Author box, related, end-cta — all light, all minimal
   ============================================================================ */

.author-box {
  margin: 64px 0 32px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.author-box strong {
  color: #0a0a0a;
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
.author-box p {
  font-family: var(--font-sans);
  color: #4b5563;
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0;
}
.author-box a {
  color: #0a0a0a;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
}
.author-box a:hover { text-decoration-color: var(--green); }

.related {
  margin-top: 56px;
  padding: 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.related h4 {
  font-family: var(--font-mono);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 18px;
}
.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.related li {
  margin: 0;
  padding: 0;
  border: none;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.5;
}
.related li a {
  color: #0a0a0a;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}
.related li a:hover { border-bottom-color: var(--green); }

.end-cta {
  margin: 56px 0 88px;
  padding: 40px 36px;
  text-align: center;
  background: #0a0a0a;
  color: #ffffff;
  border: none;
  border-radius: 10px;
}
.end-cta h3 {
  color: #ffffff;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.end-cta p {
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.end-cta .btn,
.end-cta .btn-primary {
  background: var(--green) !important;
  color: #0a0a0a !important;
  border: none !important;
  padding: 12px 22px !important;
  font-weight: 600 !important;
  font-family: var(--font-sans) !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  display: inline-block;
}
.end-cta .btn:hover {
  background: #9aff70 !important;
}

/* ============================================================================
   Selection
   ============================================================================ */
::selection {
  background: var(--green);
  color: #0a0a0a;
}

/* ============================================================================
   Mobile
   ============================================================================ */
@media (max-width: 680px) {
  .art-shell { padding: 0 20px; }
  .art-body { font-size: 16.5px; line-height: 1.62; }
  .art-body h2 { font-size: 24px; margin-top: 44px; padding-top: 22px; }
  .art-body h3 { font-size: 18px; margin-top: 30px; }
  .art-lede { font-size: 18px; margin-bottom: 32px; }
  .art-h1 { font-size: clamp(28px, 7vw, 38px); }
  .author-box { padding: 22px; }
  .end-cta { padding: 30px 22px; }
  .end-cta h3 { font-size: 20px; }
  .page-hero { padding: 84px 5% 24px !important; }
}
