/* The blog (/blog, drawn by backend/lib/blog.php), on top of site.css. Its hero has its own backdrop, like every other
   page: ruled paper in the floor's style (thin brand-blue lines on black), with a margin line and one line lighting up
   as if being written on, slowly. Posts read on a white page in a 720px column. */

.blog .eyebrow a { color: inherit; text-decoration: none; }
.blog .eyebrow a:hover { text-decoration: underline; }
.bl-hero { padding-bottom: clamp(64px, 7vw, 96px); }
.bl-title { font-size: clamp(40px, 6.4vw, 84px); line-height: 1.04; max-width: 1000px; margin: 0 auto; overflow-wrap: anywhere; }
.bl-hero .lede { max-width: 680px; }

/* ---------- ruled paper ---------- */
.bd-ruled {
  background:
    linear-gradient(90deg, transparent calc(18% - 1px), rgba(113, 137, 255, 0.32) calc(18% - 1px), rgba(113, 137, 255, 0.32) 18%, transparent 18%),
    repeating-linear-gradient(180deg, transparent 0 33px, rgba(113, 137, 255, 0.2) 33px 34px);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 70%, #000 30%, transparent 80%); mask-image: radial-gradient(ellipse 85% 75% at 50% 70%, #000 30%, transparent 80%);
  animation: ruled-drift 40s linear infinite;
}
.bd-ruled::after {
  content: ""; position: absolute; left: 18%; right: 0; height: 1px; top: 0;
  background: linear-gradient(90deg, #b4c1ff, rgba(180, 193, 255, 0.5) 40%, transparent 70%);
  transform-origin: left; animation: ruled-write 9s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes ruled-drift { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 0 34px; } }
@keyframes ruled-write {
  0% { top: calc(34px * 6); transform: scaleX(0); opacity: 0; }
  10% { opacity: 1; }
  45% { transform: scaleX(1); opacity: 1; }
  55%, 100% { top: calc(34px * 6); transform: scaleX(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .bd-ruled, .bd-ruled::after { animation: none; } .bd-ruled::after { display: none; } }

/* ---------- the list ---------- */
.bl-list { padding: clamp(56px, 7vw, 96px) 0; }
.bl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.bl-card { background: var(--light); color: var(--ink); border-radius: 26px; overflow: hidden; transition: transform 0.45s var(--out), box-shadow 0.45s var(--out); }
.bl-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08); }
.bl-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.bl-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 26px; }
.bl-cover { aspect-ratio: 1200 / 630; background: #e8e8ed; overflow: hidden; }
.bl-cover img { width: 100%; height: 100%; object-fit: cover; }
.bl-blank { display: grid; place-items: center; }
.bl-blank span { font-size: 64px; font-weight: 700; letter-spacing: -0.04em; color: #c7c7cc; }
.bl-text { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.bl-tag { font-size: 12.5px; font-weight: 600; color: var(--accent-text); margin-bottom: 8px; letter-spacing: 0.01em; }
.bl-card h2 { font-size: 21px; line-height: 1.22; letter-spacing: -0.018em; }
.bl-sum { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-top: 10px; flex: 1; }
.bl-meta { font-size: 13px; color: var(--ink-3); margin-top: 16px; }
.bl-lead { grid-column: 1 / -1; }
.bl-lead .bl-link { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.bl-lead .bl-cover { aspect-ratio: auto; min-height: 320px; height: 100%; }
.bl-lead .bl-text { padding: clamp(26px, 3.4vw, 44px); justify-content: center; }
.bl-lead h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.12; letter-spacing: -0.026em; }
.bl-lead .bl-sum { font-size: 17px; flex: 0; }
.bl-pages { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 40px; }
.bl-count { font-size: 14px; color: var(--ink-3); }
.bl-empty { text-align: center; padding: 30px 0; }
.bl-empty h2 { font-size: clamp(28px, 3.6vw, 40px); }
.bl-empty p { color: var(--ink-2); margin-top: 12px; font-size: 18px; }
.bl-empty a { color: var(--accent-text); }

/* ---------- a post ---------- */
.bl-preview { position: relative; z-index: 2; background: #ff9f0a; color: #1d1d1f; text-align: center; font-size: 14px; font-weight: 600; padding: 12px 16px; margin-top: 70px; }
.bl-article { padding: clamp(48px, 6vw, 80px) 0 clamp(70px, 8vw, 110px); }
.bl-hero-img { margin: 0 0 clamp(36px, 5vw, 56px); }
.bl-hero-img img { width: 100%; border-radius: 24px; background: var(--alt); }
.prose { font-size: 19px; line-height: 1.7; color: var(--ink); letter-spacing: -0.012em; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-size: clamp(26px, 3vw, 32px); line-height: 1.18; letter-spacing: -0.024em; margin-top: 1.9em; scroll-margin-top: 100px; }
.prose h3 { font-size: 22px; line-height: 1.25; letter-spacing: -0.018em; margin-top: 1.6em; scroll-margin-top: 100px; }
.prose h4 { font-size: 19px; margin-top: 1.4em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.55em; }
.prose a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--ink-3); }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 2px 0 2px 22px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose blockquote > * + * { margin-top: 0.8em; }
.prose figure { margin: 1.8em 0; }
.prose img { border-radius: 18px; background: var(--alt); }
.prose figcaption { font-size: 14px; color: var(--ink-3); text-align: center; margin-top: 10px; line-height: 1.45; }
.prose code { font: 0.86em/1.5 ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; background: var(--alt); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #1d1d1f; color: #f5f5f7; padding: 18px 20px; border-radius: 16px; overflow-x: auto; font-size: 15px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose hr { border: 0; border-top: 0.5px solid var(--line); margin: 2.4em 0; }
.prose .table-wrap { overflow-x: auto; margin: 1.6em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; line-height: 1.45; }
.prose th { font-weight: 600; text-align: left; border-bottom: 1px solid var(--ink); padding: 10px 12px 10px 0; white-space: nowrap; }
.prose td { border-bottom: 0.5px solid var(--line); padding: 10px 12px 10px 0; }
.bl-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; padding-top: 28px; border-top: 0.5px solid var(--line); }
.bl-tags a { font-size: 14px; text-decoration: none; color: var(--ink); background: var(--alt); padding: 7px 14px; border-radius: 999px; transition: background-color 0.2s; }
.bl-tags a:hover { background: #e8e8ed; }
.bl-more { padding-top: clamp(56px, 7vw, 90px); }
.bl-more-title { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.026em; margin-bottom: 28px; }
.bl-close { text-align: center; padding: clamp(90px, 11vw, 150px) 0; }
.bl-close h2 { font-size: clamp(34px, 5vw, 60px); }

@media (max-width: 980px) {
  .bl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bl-lead .bl-link { grid-template-columns: minmax(0, 1fr); }
  .bl-lead .bl-cover { aspect-ratio: 1200 / 630; min-height: 0; }
}
@media (max-width: 640px) {
  .bl-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .prose { font-size: 17.5px; }
  .bl-text { padding: 18px 20px 20px; }
  .bl-pages .btn { padding: 0 14px; }
}
