/* RCIP Points — blog: animated post header, reading progress, card motion. Loaded on posts, /blog/ and home. */

/* Reading progress */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 300; pointer-events: none; }
.read-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber-deep), var(--amber)); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

/* Post header card */
.entry-content .post-hero { margin: 10px 0 36px; }
.ph-stage {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px;
  padding: 44px 48px 44px 38px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 150% at 88% 8%, #2d6a4f 0%, #1b4332 46%, #12301f 100%);
  box-shadow: var(--shadow-lift);
}
.ph-topo { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .16; z-index: -1; pointer-events: none; }
.ph-topo path { stroke-dasharray: 900; stroke-dashoffset: 900; animation: ph-draw 2.4s cubic-bezier(.2,.7,.2,1) .15s forwards; }
.ph-topo path:nth-child(2n) { animation-delay: .45s; }
.ph-copy { display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; animation: ph-rise .7s cubic-bezier(.2,.7,.2,1) .1s both; }
.ph-kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-weight: 500; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.ph-kicker::before { content: ""; width: 24px; height: 2px; background: var(--amber); }
.ph-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.05rem); line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; }

.ph-cardwrap { position: relative; width: 268px; animation: ph-in .8s cubic-bezier(.2,.8,.2,1) .2s both; }
.ph-back { position: absolute; inset: 8px -8px -8px 8px; border-radius: 16px; background: var(--amber); transform: rotate(-5deg); animation: ph-back .9s cubic-bezier(.2,.8,.2,1) .35s both; }
.ph-card { position: relative; background: var(--snow); color: var(--ink); border-radius: 16px; padding: 20px 22px 16px; transform: rotate(2deg); box-shadow: 0 24px 50px -18px rgba(0,0,0,.55); animation: ph-float 7s ease-in-out 1.4s infinite; }
.ph-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 2px solid var(--pine); padding-bottom: 11px; }
.ph-label { font-family: var(--font-mono); font-weight: 600; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fern); line-height: 1.35; }
.ph-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--pine); display: grid; place-items: center; }
.ph-icon svg { width: 21px; height: 21px; fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ph-big { font-family: var(--font-mono); font-weight: 600; font-size: 3.7rem; line-height: 1; letter-spacing: -.04em; color: var(--pine-deep); margin-top: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ph-big-s { font-size: 3.05rem; }
.ph-strike { font-family: var(--font-mono); font-size: 1.05rem; color: var(--clay); text-decoration: line-through; margin: 14px 0 -10px; }
.ph-sub { font-size: .82rem; line-height: 1.35; color: var(--ink-soft); margin-top: 7px; }
.ph-rows { margin-top: 14px; }
.ph-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px dashed #b8c8bc; font-size: .8rem; font-weight: 600; line-height: 1.3; opacity: 0; animation: ph-row .5s ease-out forwards; }
.ph-row:nth-child(1) { animation-delay: .75s; } .ph-row:nth-child(2) { animation-delay: .9s; } .ph-row:nth-child(3) { animation-delay: 1.05s; }
.ph-row b { font-family: var(--font-mono); font-weight: 600; color: var(--fern); white-space: nowrap; }
.ph-row b.ph-x { color: var(--clay); }
.ph-letter { display: grid; gap: 9px; margin-top: 18px; }
.ph-letter i { display: block; height: 7px; border-radius: 4px; background: var(--moss); transform-origin: 0 50%; animation: ph-grow-x .6s ease-out both; }
.ph-letter i:nth-child(1) { width: 45%; animation-delay: .5s; } .ph-letter i:nth-child(2) { animation-delay: .58s; } .ph-letter i:nth-child(3) { animation-delay: .66s; }
.ph-letter i:nth-child(4) { width: 92%; animation-delay: .74s; } .ph-letter i:nth-child(5) { animation-delay: .82s; } .ph-letter i:nth-child(6) { width: 60%; animation-delay: .9s; }
.ph-bars { display: flex; align-items: flex-end; gap: 9px; height: 96px; margin-top: 18px; }
.ph-bars i { flex: 1; display: block; border-radius: 6px 6px 0 0; background: var(--fern); transform-origin: 50% 100%; animation: ph-grow-y .7s cubic-bezier(.2,.8,.2,1) both; }
.ph-bars i:nth-child(1) { height: 32%; animation-delay: .45s; } .ph-bars i:nth-child(2) { height: 46%; animation-delay: .55s; } .ph-bars i:nth-child(3) { height: 60%; animation-delay: .65s; }
.ph-bars i:nth-child(4) { height: 78%; animation-delay: .75s; } .ph-bars i:nth-child(5) { height: 100%; background: var(--amber); animation-delay: .85s; }

@keyframes ph-draw { to { stroke-dashoffset: 0; } }
@keyframes ph-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes ph-in { from { opacity: 0; transform: translateY(26px) rotate(4deg) scale(.96); } }
@keyframes ph-back { from { opacity: 0; transform: rotate(2deg); } }
@keyframes ph-float { 0%, 100% { transform: rotate(2deg) translateY(0); } 50% { transform: rotate(1.4deg) translateY(-5px); } }
@keyframes ph-row { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes ph-grow-x { from { transform: scaleX(0); } }
@keyframes ph-grow-y { from { transform: scaleY(0); } }

/* Article polish */
.entry-header h1 { text-wrap: balance; }
.entry-content h2 { position: relative; padding-top: .5em; }
.entry-content h2::before { content: ""; position: absolute; top: 0; left: 0; width: 34px; height: 3px; border-radius: 2px; background: var(--amber); transform-origin: 0 50%; transition: transform .6s cubic-bezier(.2,.8,.2,1) .1s; }
.js-blog .entry-content h2:not(.is-seen)::before { transform: scaleX(0); }
.entry-content .wp-block-table { -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
.entry-content a { transition: color .15s, text-decoration-color .15s; }

/* Blog cards */
.post-card .post-thumb { overflow: hidden; display: block; }
.post-card .post-thumb img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.post-card:hover .post-thumb img { transform: scale(1.045); }
.post-grid .post-card.reveal:nth-child(3n+2) { transition-delay: .08s; }
.post-grid .post-card.reveal:nth-child(3n) { transition-delay: .16s; }

@media (max-width: 640px) {
  .entry-content .post-hero { margin: 4px 0 28px; }
  .ph-stage { grid-template-columns: 1fr; justify-items: center; gap: 22px; padding: 26px 22px 34px; border-radius: 16px; }
  .ph-copy { justify-self: start; padding: 0; gap: 8px; }
  .ph-title { font-size: 1.42rem; }
  .ph-cardwrap { width: min(100%, 300px); }
  .ph-big { font-size: 3.4rem; } .ph-big-s { font-size: 2.8rem; }
  .entry-header { padding-top: 36px; }
  .entry-content table { font-size: .86rem; }
  .entry-content th, .entry-content td { padding: 9px 10px; }
  .post-grid .post-card.reveal { transition-delay: 0s !important; }
}
@media (prefers-reduced-motion: reduce) {
  .ph-topo path, .ph-copy, .ph-cardwrap, .ph-back, .ph-card, .ph-row, .ph-letter i, .ph-bars i { animation: none !important; }
  .ph-topo path { stroke-dashoffset: 0; } .ph-row { opacity: 1; }
  .entry-content h2::before, .post-card .post-thumb img { transition: none; }
  .js-blog .entry-content h2:not(.is-seen)::before { transform: none; }
}
