/* Blog pages: static HTML, same palette and type as the app (see src/styles.css tokens). */
:root {
  --bg: #f6f6fb;
  --surface: #ffffff;
  --surface-hover: #f1f0f8;
  --border: #e7e5f1;
  --border-strong: #d4d1e4;
  --text: #15142b;
  --muted: #6a6986;
  --muted-strong: #43425f;
  --accent: #5b47f5;
  --accent-hover: #4b37e8;
  --accent-text: #4b37e8;
  --accent-2: #ff7a59;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.7 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
::selection {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
h1,
h2,
h3 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
p,
li {
  text-wrap: pretty;
}
svg {
  flex: none;
}

/* Top bar: the landing page's header (src/landing.css .lp-nav), so the menu is the same everywhere. */
.b-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  line-height: 1.55;
}
.b-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.b-wise {
  color: var(--accent-text);
}
.b-links {
  display: flex;
  gap: 4px;
  margin-left: 18px;
}
.b-links a {
  color: var(--muted-strong);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.45em 0.8em;
  border-radius: 999px;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}
.b-links a:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.b-links a[aria-current] {
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.b-spacer {
  flex: 1;
}
.b-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.55em 1.1em;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
  transition:
    background-color 150ms ease,
    transform 160ms var(--ease-out);
}
.b-button:hover {
  background: var(--accent-hover);
}
.b-button:active {
  transform: scale(0.97);
}
.b-button.b-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: none;
}
.b-button.b-ghost:hover {
  background: var(--surface-hover);
}
.b-button-big {
  padding: 0.85em 1.5em;
  font-size: 1rem;
  font-weight: 600;
}
.b-button-big svg {
  transition: transform 200ms var(--ease-out);
}
.b-button-big:hover svg {
  transform: translateX(3px);
}
/* Reading progress, driven by the page scroll where the browser supports it. */
.b-progress {
  display: none;
}
@supports (animation-timeline: scroll()) {
  .b-progress {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform-origin: 0 50%;
    animation: b-progress linear both;
    animation-timeline: scroll(root);
  }
  @keyframes b-progress {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }
}

/* Layout */
.b-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}
.b-crumbs {
  font-size: 0.9rem;
  color: var(--muted);
}
.b-crumbs a {
  color: var(--muted-strong);
}
.b-hero,
.b-article > header {
  margin: 28px 0 36px;
  animation: b-enter 700ms var(--ease-out) backwards;
}
.b-main h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  margin: 0 0 14px;
}
.b-lead {
  font-size: 1.2rem;
  color: var(--muted-strong);
  margin: 0 0 14px;
}
.b-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.b-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.b-meta svg {
  color: color-mix(in srgb, var(--accent) 70%, var(--muted));
}

/* Article body: a readable measure and clear rhythm */
.b-prose {
  max-width: 68ch;
}
.b-prose h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.55rem;
  margin: 2.2em 0 0.7em;
  scroll-margin-top: 80px;
}
/* Section badge: an icon, or the step number for numbered sections. */
.b-h-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}
.b-h-num {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.b-prose h3 {
  font-size: 1.2rem;
  margin: 1.8em 0 0.5em;
}
.b-prose p,
.b-prose ul,
.b-prose ol {
  margin: 0 0 1.1em;
}
.b-prose ul,
.b-prose ol {
  list-style: none;
  padding: 0;
}
.b-prose li {
  position: relative;
  margin-bottom: 0.55em;
  padding-left: 2em;
}
.b-prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.45em;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
  transform: rotate(45deg);
  opacity: 0.85;
}
.b-prose ol {
  counter-reset: b-step;
}
.b-prose ol > li {
  counter-increment: b-step;
}
.b-prose ol > li::before {
  content: counter(b-step);
  position: absolute;
  left: 0;
  top: 0.18em;
  width: 1.45em;
  height: 1.45em;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-text);
  font-size: 0.85em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.b-prose strong {
  color: var(--text);
}
.b-prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 1.4em;
  font-size: 0.97rem;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.b-prose th,
.b-prose td {
  text-align: left;
  padding: 0.7em 1em;
  border-bottom: 1px solid var(--border);
}
.b-prose tr:last-child td {
  border-bottom: 0;
}
.b-prose th {
  font-weight: 600;
  color: var(--muted-strong);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.b-prose tbody tr {
  transition: background-color 150ms ease;
}
.b-prose tbody tr:hover {
  background: var(--surface-hover);
}

/* Key takeaway (a Markdown blockquote) */
.b-callout {
  display: flex;
  gap: 14px;
  margin: 1.6em 0;
  padding: 18px 20px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent-2) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, transparent);
}
.b-callout-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #c2410c;
  background: color-mix(in srgb, var(--accent-2) 18%, var(--surface));
}
.b-callout p {
  margin: 0;
  color: var(--text);
}
.b-callout p + p {
  margin-top: 0.6em;
}

/* Call to action */
.b-cta {
  position: relative;
  overflow: hidden;
  margin: 48px 0 0;
  padding: 28px 28px 30px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.b-cta h2 {
  font-size: 1.45rem;
  margin: 0 0 8px;
}
.b-cta p {
  margin: 0 0 18px;
  color: var(--muted-strong);
}

/* Article cards */
.b-related {
  margin-top: 48px;
}
.b-related h2 {
  font-size: 1.3rem;
  margin: 0 0 16px;
}
.b-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.b-cards-index {
  grid-template-columns: minmax(0, 1fr);
}
.b-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms var(--ease-out);
}
.b-card a:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 14px 34px -20px rgb(40 30 90 / 0.4);
  transform: translateY(-2px);
}
.b-card-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 12px;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  transition: transform 260ms var(--ease-out);
}
.b-card a:hover .b-card-icon {
  transform: rotate(-6deg) scale(1.06);
}
.b-card h2,
.b-card h3 {
  font-size: 1.2rem;
  margin: 0 0 6px;
}
.b-card p {
  margin: 0 0 14px;
  color: var(--muted-strong);
  font-size: 0.98rem;
}
.b-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}
.b-card-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-text);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}
.b-card-go svg {
  transition: transform 200ms var(--ease-out);
}
.b-card a:hover .b-card-go svg {
  transform: translateX(3px);
}

/* Footer */
.b-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  padding: 28px 20px 36px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}
.b-foot a {
  color: var(--muted-strong);
}

/* Motion: the page header enters once; below the fold, blocks fade up as they arrive (scripts/blog.js). */
@keyframes b-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
.b-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 600ms var(--ease-out) var(--d, 0ms),
    transform 600ms var(--ease-out) var(--d, 0ms);
}
.b-reveal.is-in {
  opacity: 1;
  transform: none;
}
/* Section badges pop in a beat after their heading. */
h2.b-reveal .b-h-badge {
  transform: scale(0.6) rotate(-12deg);
  transition: transform 520ms cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--d, 0ms) + 120ms);
}
h2.b-reveal.is-in .b-h-badge {
  transform: none;
}
.b-callout.b-reveal .b-callout-icon {
  transform: scale(0.5);
  transition: transform 520ms cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--d, 0ms) + 160ms);
}
.b-callout.b-reveal.is-in .b-callout-icon {
  transform: none;
}
/* Reduced motion: keep the fades, drop the movement. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .b-hero,
  .b-article > header {
    animation-name: b-fade;
  }
  .b-reveal,
  .b-reveal.is-in,
  h2.b-reveal .b-h-badge,
  .b-callout.b-reveal .b-callout-icon,
  .b-card a,
  .b-card a:hover,
  .b-card a:hover .b-card-icon {
    transform: none;
  }
  .b-reveal {
    transition-property: opacity;
  }
  @keyframes b-fade {
    from {
      opacity: 0;
    }
  }
}

@media (max-width: 960px) {
  .b-links {
    display: none;
  }
}
@media (max-width: 640px) {
  .b-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .b-cta {
    padding: 22px 20px 24px;
  }
  .b-lead {
    font-size: 1.08rem;
  }
  .b-prose h2 {
    gap: 12px;
    font-size: 1.35rem;
  }
  .b-h-badge {
    width: 36px;
    height: 36px;
  }
}
@media (max-width: 560px) {
  .b-nav {
    padding: 10px 16px;
  }
  .b-nav .b-ghost,
  .b-brand-name {
    display: none;
  }
}
