/*
 * Styles for Motif's static blog pages (generated by scripts/build-blog.mjs).
 * Self-contained on purpose: the blog HTML is generated outside the React/Vite
 * bundle, so it cannot rely on the hashed app CSS. Tokens mirror tailwind.config.js
 * (ink, cream, brand, sun, muted) and the pixel/retro brand: 3px ink borders,
 * hard offset shadows, Press Start 2P for display, Nunito for body.
 */

:root {
  --ink: #2a2140;
  --muted: #8a82a0;
  --cream: #fdf6e3;
  --brand: #7c5cff;
  --sun: #ffd23f;
  --bubble: #ff6b9d;
  --mint: #3dd68c;
  --paper: #ffffff;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

.px,
.brand-name,
h1,
h2 {
  font-family: "Press Start 2P", monospace;
}

.wrap {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--brand);
  border-bottom: 4px solid var(--ink);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  background: var(--sun);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
}

.brand-name {
  font-size: 11px;
  letter-spacing: -0.02em;
  color: #fff;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-nav a {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

.header-nav a:hover {
  color: var(--sun);
  text-decoration: none;
}

.header-cta {
  font-family: "Press Start 2P", monospace;
  font-size: 9px !important;
  color: var(--ink) !important;
  background: var(--sun);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 10px;
}

.header-cta:hover {
  filter: brightness(1.05);
  color: var(--ink) !important;
}

/* --- article -------------------------------------------------------------- */

.article,
.index {
  padding-top: 32px;
  padding-bottom: 64px;
}

.crumbs {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 20px;
}

.crumbs a {
  color: var(--muted);
}

.crumbs span[aria-hidden] {
  margin: 0 6px;
  opacity: 0.6;
}

.post-head {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 3px solid rgba(42, 33, 64, 0.12);
}

.post-hero {
  margin: 24px 0 0;
}

.post-hero img,
.card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.post-hero img {
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--ink);
}

.post-head h1,
.index-head h1 {
  font-size: 20px;
  line-height: 1.6;
  margin: 0 0 14px;
  color: var(--ink);
}

.post-meta,
.card-meta {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 14px 0 0;
}

.tag-list li {
  font-size: 11px;
  font-weight: 800;
  text-transform: lowercase;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 4px 8px;
}

/* --- prose (rendered markdown) -------------------------------------------- */

.prose h2 {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  margin: 40px 0 14px;
}

.prose h3 {
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 30px 0 10px;
}

.prose p {
  margin: 0 0 18px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin: 0 0 8px;
}

.prose a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose strong {
  font-weight: 800;
  color: var(--ink);
}

.prose img {
  max-width: 100%;
  height: auto;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  border-radius: 10px;
}

.prose figure {
  margin: 28px 0;
}

.prose figure img {
  display: block;
  margin: 0;
}

.prose figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.prose blockquote {
  margin: 24px 0;
  padding: 4px 18px;
  border-left: 4px solid var(--brand);
  background: rgba(124, 92, 255, 0.07);
  font-weight: 600;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(42, 33, 64, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
}

.prose pre {
  background: #1a1333;
  color: #f4f1ff;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 18px;
  overflow-x: auto;
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.prose hr {
  border: none;
  border-top: 3px solid rgba(42, 33, 64, 0.12);
  margin: 34px 0;
}

/* --- tables --------------------------------------------------------------- */

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  display: block;
  overflow-x: auto;
  font-size: 15px;
}

.prose th,
.prose td {
  border: 2px solid var(--ink);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: rgba(124, 92, 255, 0.1);
  font-weight: 800;
  white-space: nowrap;
}

/* --- author bio ----------------------------------------------------------- */

.author-bio {
  margin: 40px 0 0;
  padding: 18px 20px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: rgba(42, 33, 64, 0.04);
}

.author-bio p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

/* --- CTA + related -------------------------------------------------------- */

.cta-card {
  margin: 44px 0 0;
  background: var(--brand);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 28px 24px;
  text-align: center;
}

.cta-card h2 {
  font-size: 14px;
  line-height: 1.7;
  color: var(--sun);
  margin: 0 0 12px;
}

.cta-card p {
  margin: 0 auto 18px;
  max-width: 34rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.cta-btn {
  display: inline-block;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  color: var(--ink);
  background: var(--sun);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 14px 20px;
}

.cta-btn:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.related {
  margin: 44px 0 0;
  padding-top: 24px;
  border-top: 3px solid rgba(42, 33, 64, 0.12);
}

.related h2 {
  font-size: 13px;
  color: var(--ink);
  margin: 0 0 14px;
}

.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related li {
  margin: 0 0 10px;
  font-weight: 800;
}

/* --- blog index ----------------------------------------------------------- */

.index-head {
  margin-bottom: 32px;
}

.index-head p {
  font-weight: 700;
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
}

.post-card a {
  display: block;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card-image {
  border-bottom: 3px solid var(--ink);
}

.card-body {
  padding: 22px;
}

.post-card a:hover {
  text-decoration: none;
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.post-card h2 {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 10px;
  color: var(--ink);
}

.card-desc {
  margin: 12px 0 14px;
  font-weight: 600;
  color: var(--ink);
}

.card-more {
  font-weight: 800;
  color: var(--brand);
}

/* --- footer --------------------------------------------------------------- */

.site-footer {
  background: var(--brand);
  color: #fff;
  border-top: 4px solid var(--ink);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.site-footer p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-nav a {
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.footer-nav a:hover {
  color: var(--sun);
  text-decoration: none;
}

/* --- responsive ----------------------------------------------------------- */

@media (min-width: 640px) {
  body {
    font-size: 18px;
  }
  .post-head h1,
  .index-head h1 {
    font-size: 26px;
    line-height: 1.55;
  }
  .prose h2 {
    font-size: 17px;
  }
  .prose h3 {
    font-size: 22px;
  }
  .article,
  .index {
    padding-top: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card a {
    transition: none;
  }
}
