/* Blog: same tokens, type and dark hero look as the home page (style.css loads first). */

.blog-body { background: #000; color: #f5f5f7; }
.blog-body .footer { border-color: rgba(255, 255, 255, .08); }
.blog-body .footer-inner { color: #86868b; }
.blog-body .footer-inner strong, .blog-body .footer .brand { color: #f5f5f7; }
.blog-body .footer a:hover { color: #fff; }

/* ---------- Reading progress ---------- */
.read-progress { position: fixed; inset: 0 0 auto; z-index: 60; height: 3px; pointer-events: none; }
.read-progress span { display: block; width: 100%; height: 100%; transform: scaleX(var(--p, 0)); transform-origin: 0 50%; background: linear-gradient(90deg, #3499ff, #9d7bff); }

/* ---------- Blog home ---------- */
.blog-hero { padding: 150px 0 72px; text-align: center; background: radial-gradient(1000px 560px at 50% -12%, #0d2f5c 0%, #04070f 55%, #000 80%); }
.blog-hero h1 { font-size: clamp(46px, 7.4vw, 96px); }
.blog-hero .lede { max-width: 620px; }

.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; padding-bottom: clamp(88px, 10vw, 140px); }
.post-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 28px; background: #0d0d10; border: 1px solid rgba(255, 255, 255, .08); transition: transform .4s cubic-bezier(.2, .7, .2, 1), border-color .3s, box-shadow .4s; }
.post-card:hover { transform: translateY(-4px); border-color: rgba(52, 153, 255, .45); box-shadow: 0 34px 80px -44px rgba(52, 153, 255, .6); }
.post-card .art { flex: none; }
.post-card--featured { grid-column: 1 / -1; flex-direction: row; }
.post-card--featured .art { width: 56%; aspect-ratio: auto; min-height: 380px; }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 26px 28px 30px; }
.post-card--featured .card-body { justify-content: center; padding: 44px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: #86868b; }
.tag { color: var(--accent); font-weight: 600; }
.card-title { font-size: 24px; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; }
.post-card--featured .card-title { font-size: clamp(30px, 3.2vw, 42px); line-height: 1.08; letter-spacing: -.03em; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-excerpt { font-size: 16px; line-height: 1.55; color: #a1a1a6; }
.card-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; font-size: 14px; color: #d2d2d7; }
.card-foot .avatar-badge { width: 30px; height: 30px; font-size: 13px; }

/* ---------- Cover art: a notch on a wallpaper ---------- */
.art { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: radial-gradient(60% 85% at 18% 105%, var(--a1) 0%, transparent 62%), radial-gradient(55% 75% at 92% 92%, var(--a2) 0%, transparent 62%), linear-gradient(160deg, #0b1d3a, #1c1250 60%, #12081f); }
.art--blue { --a1: #2476ff; --a2: #8a5cff; }
.art--sunset { --a1: #ff7b54; --a2: #8a5cff; }
.art--teal { --a1: #13b3a6; --a2: #2476ff; }
.art--violet { --a1: #9d7bff; --a2: #ff5c8a; }
.art::before { content: ""; position: absolute; inset: 0 0 auto; height: 7%; background: rgba(0, 0, 0, .14); }
.art-notch { position: absolute; top: 0; left: 50%; display: grid; place-items: center; width: 36%; max-width: 300px; aspect-ratio: 1.12; background: #000; border-radius: 0 0 26% 26% / 0 0 23% 23%; transform: translateX(-50%); box-shadow: 0 26px 60px rgba(0, 0, 0, .45); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.art-notch::before, .art-notch::after { content: ""; position: absolute; top: 0; width: 16px; height: 16px; }
.art-notch::before { left: -16px; background: radial-gradient(circle at 0 100%, transparent 15.5px, #000 16px); }
.art-notch::after { right: -16px; background: radial-gradient(circle at 100% 100%, transparent 15.5px, #000 16px); }
.art-notch img, .art-notch svg { width: 50%; height: auto; }
.art-notch svg { color: var(--accent); }
.art-glyph { font-size: clamp(40px, 7vw, 92px); font-weight: 700; line-height: 1; color: var(--accent); }
.post-card:hover .art-notch { transform: translateX(-50%) scale(1.04); }

/* ---------- Post ---------- */
.post-hero { position: relative; overflow: hidden; padding: 132px 0 0; text-align: center; background: radial-gradient(1000px 600px at 50% -4%, #0d2f5c 0%, #04070f 55%, #000 80%); }
.post-hero-inner { max-width: 880px; }
.crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 26px; font-size: 13px; color: #86868b; }
.crumbs a { transition: color .2s; }
.crumbs a:hover { color: #fff; }
.post-title { font-size: clamp(40px, 6.2vw, 80px); line-height: 1.02; letter-spacing: -.042em; font-weight: 700; }
.post-lede { max-width: 690px; margin: 22px auto 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.5; color: #a1a1a6; }
.byline { display: inline-flex; align-items: center; gap: 12px; margin-top: 32px; text-align: left; }
.byline b { display: block; font-size: 15px; }
.byline span { font-size: 13px; color: #86868b; }
.avatar-badge { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #3499ff, #9d7bff); color: #fff; font-size: 17px; font-weight: 700; }
.post-hero .art { max-width: 1100px; margin: 56px auto 0; aspect-ratio: 21 / 9; border-radius: 28px 28px 0 0; }

.post-layout { display: grid; grid-template-columns: 210px minmax(0, 720px); justify-content: center; gap: 64px; padding: 64px 0 24px; }
.toc { position: sticky; top: 96px; align-self: start; font-size: 14px; }
.toc p { margin-bottom: 12px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #86868b; }
.toc a { display: block; padding: 7px 0 7px 14px; border-left: 2px solid rgba(255, 255, 255, .1); color: #a1a1a6; line-height: 1.35; transition: color .2s, border-color .2s; }
.toc a:hover { color: #fff; }
.toc a.is-active { color: #fff; border-color: var(--accent); }

.prose { font-size: 18px; line-height: 1.75; color: #d2d2d7; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 60px 0 16px; font-size: clamp(28px, 3vw, 36px); line-height: 1.15; letter-spacing: -.025em; color: #f5f5f7; scroll-margin-top: 90px; }
.prose h3 { margin: 36px 0 10px; font-size: 22px; color: #f5f5f7; scroll-margin-top: 90px; }
.prose p { margin: 0 0 22px; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 22px; }
.prose li { margin-bottom: 10px; padding-left: 4px; }
.prose li::marker { color: var(--accent); }
.prose a { color: #62b0ff; text-decoration: underline; text-decoration-color: rgba(98, 176, 255, .4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: #fff; font-weight: 600; }
.prose kbd { padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); font: 600 14px/1.4 -apple-system, BlinkMacSystemFont, sans-serif; color: #fff; }

.steps-list { padding: 0 !important; list-style: none; counter-reset: step; }
.steps-list li { position: relative; margin-bottom: 22px; padding-left: 54px !important; counter-increment: step; }
.steps-list li::before { content: counter(step); position: absolute; top: 1px; left: 0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(52, 153, 255, .14); color: #62b0ff; font-size: 15px; font-weight: 700; }

.callout { display: flex; gap: 14px; margin: 30px 0; padding: 20px 22px; border-radius: 18px; background: rgba(52, 153, 255, .08); border: 1px solid rgba(52, 153, 255, .26); font-size: 16px; line-height: 1.6; }
.callout .icon { margin-top: 3px; color: var(--accent); }
.callout p { margin: 0; }
.callout--warn { background: rgba(255, 159, 10, .08); border-color: rgba(255, 159, 10, .3); }
.callout--warn .icon { color: #ff9f0a; }

.table-wrap { overflow-x: auto; margin: 28px 0 32px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .1); }
.prose table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); text-align: left; vertical-align: top; }
.prose th { background: rgba(255, 255, 255, .04); color: #fff; font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }

.prose details { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.prose summary { position: relative; padding: 18px 36px 18px 0; list-style: none; cursor: pointer; font-size: 18px; font-weight: 600; color: #fff; }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: ""; position: absolute; top: 50%; right: 6px; width: 9px; height: 9px; border-right: 2px solid #86868b; border-bottom: 2px solid #86868b; transform: translateY(-75%) rotate(45deg); transition: transform .25s; }
.prose details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.prose details p { font-size: 16px; }

.cta-card { display: flex; align-items: center; gap: 22px; margin: 52px 0; padding: 30px; border-radius: 24px; background: linear-gradient(135deg, rgba(52, 153, 255, .16), rgba(157, 123, 255, .12)); border: 1px solid rgba(255, 255, 255, .1); }
.cta-card img { flex: none; width: 76px; height: 76px; }
.cta-card h3 { margin: 0 0 6px; font-size: 22px; }
.cta-card p { margin: 0; font-size: 16px; line-height: 1.5; color: #a1a1a6; }
.cta-card .btn { flex: none; margin-left: auto; text-decoration: none; color: #fff; }

.author-box { display: flex; gap: 18px; margin-top: 56px; padding: 28px; border-radius: 24px; background: #0d0d10; border: 1px solid rgba(255, 255, 255, .08); }
.author-box .avatar-badge { width: 58px; height: 58px; font-size: 23px; }
.author-box b { display: block; font-size: 18px; color: #fff; }
.author-box small { display: block; margin-bottom: 8px; font-size: 13px; color: var(--accent); }
.author-box p { margin: 0; font-size: 15px; line-height: 1.6; color: #a1a1a6; }

.related { padding: 72px 0 clamp(88px, 10vw, 140px); }
.related h2 { margin-bottom: 30px; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.03em; }
.related .post-grid { grid-template-columns: repeat(3, 1fr); padding-bottom: 0; }
.related .card-title { font-size: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .post-layout { grid-template-columns: minmax(0, 720px); gap: 0; }
  .toc { display: none; }
  .post-card--featured { flex-direction: column; }
  .post-card--featured .art { width: 100%; min-height: 0; aspect-ratio: 16 / 9; }
  .post-card--featured .card-body { padding: 28px; }
  .related .post-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .post-grid, .related .post-grid { grid-template-columns: 1fr; }
  .post-hero .art { aspect-ratio: 16 / 10; border-radius: 20px 20px 0 0; }
  .art-notch::before, .art-notch::after { width: 10px; height: 10px; }
  .art-notch::before { left: -10px; background: radial-gradient(circle at 0 100%, transparent 9.5px, #000 10px); }
  .art-notch::after { right: -10px; background: radial-gradient(circle at 100% 100%, transparent 9.5px, #000 10px); }
  .prose { font-size: 17px; }
  .cta-card { flex-direction: column; align-items: flex-start; }
  .cta-card .btn { margin-left: 0; }
  .author-box { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .post-card, .art-notch { transition: none; }
}
