/* PiatIQ case study: an animated cycle chart (heating, PIAT peak, cooling) with a steps list that lights up in sync,
   plus three small evidence charts. Pure CSS, starts when a block is in view (.in), 12s / 8s loops. */
.pcase { background: #fff; }
.pcase .phead h2 { font-size: clamp(30px, 3.6vw, 48px); max-width: 760px; }

.pc { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; margin-top: 52px; isolation: isolate; }
.pc-art { margin: 0; padding: 22px 22px 14px; border-radius: 30px; background: linear-gradient(160deg, #fff, #fff6ea); box-shadow: 0 40px 70px -46px rgba(16,33,47,.45), 0 0 0 1px rgba(16,33,47,.05); }
.pc-art figcaption { margin-top: 4px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--mute); }
.pc-svg, .mc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pc-svg text, .mc-svg text { font-family: Inter, sans-serif; }
.pc-t { font-size: 11px; font-weight: 700; fill: #4d5d6c; }
.pc-ax { fill: #8a99a8; letter-spacing: .12em; font-size: 10px; }
.pc-axes line, .mc-axes line { stroke: rgba(11,32,54,.3); stroke-width: 2; stroke-linecap: round; }
.pc-zone-h { fill: rgba(247,134,30,.12); }
.pc-zone-c { fill: rgba(59,155,255,.12); }
.pc-window { fill: rgba(34,197,94,.1); stroke: rgba(34,197,94,.55); stroke-width: 1.4; stroke-dasharray: 5 5; }
.pc-win-t { fill: #15803d; font-size: 10px; }
.pc-gold { fill: none; stroke: #15803d; stroke-width: 2.4; stroke-dasharray: 7 6; stroke-linecap: round; opacity: .7; }
.pc-gold-t { fill: #15803d; }
.pc-fill { fill: url(#pcg); opacity: .12; }
.pc-line { fill: none; stroke: url(#pcg); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.pc-drop { stroke: #0b2036; stroke-width: 1.6; stroke-dasharray: 4 5; opacity: .45; }
.pc-peak-r { fill: rgba(247,134,30,.18); stroke: #f7861e; stroke-width: 3; }
.pc-peak-d { fill: #f7861e; }
.pc-peak, .pc-peaklab, .pc-slow, .pc-ok { transform-box: fill-box; transform-origin: center; }
.pc-peaklab rect { fill: #0b2036; } .pc-peaklab text { font-size: 11px; font-weight: 800; letter-spacing: .06em; fill: #fff; }
.pc-slow rect { fill: #fff; stroke: #e5484d; stroke-width: 1.8; } .pc-slow text { font-size: 11px; font-weight: 800; fill: #d1313a; }
.pc-ok rect { fill: #15803d; } .pc-ok text { font-size: 11px; font-weight: 800; fill: #fff; }
.pc-dot { fill: #fff; stroke: var(--orange); stroke-width: 4; filter: drop-shadow(0 4px 6px rgba(11,32,54,.3)); offset-path: path("M70 250 C140 246 230 170 340 70 C390 70 430 170 470 205 C510 235 560 242 610 246"); offset-distance: 0%; }

.pc.in .pc-line { animation: pcline 12s linear infinite; }
.pc.in .pc-fill { animation: pcfill 12s linear infinite; }
.pc.in .pc-dot { animation: pcdot 12s linear infinite; }
.pc.in .pc-drop { animation: pcdrop 12s linear infinite; }
.pc.in .pc-peak { animation: pcpeak 12s cubic-bezier(.34,1.56,.64,1) infinite; }
.pc.in .pc-peaklab { animation: pcpeak 12s cubic-bezier(.34,1.56,.64,1) infinite; }
.pc.in .pc-slow { animation: pcslow 12s ease-in-out infinite; }
.pc.in .pc-ok { animation: pcok 12s ease-in-out infinite; }
.pc.in .pc-gold { animation: pcgold 12s ease-out infinite; }
@keyframes pcline { 0% { stroke-dashoffset: 1; opacity: 1; } 80% { stroke-dashoffset: 0; } 95% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes pcfill { 0%,8% { opacity: 0; } 80%,95% { opacity: .14; } 100% { opacity: 0; } }
@keyframes pcdot { 0% { offset-distance: 0%; opacity: 1; } 80% { offset-distance: 100%; } 95% { offset-distance: 100%; opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes pcdrop { 0%,38% { opacity: 0; } 42%,95% { opacity: .45; } 100% { opacity: 0; } }
@keyframes pcpeak { 0%,38% { opacity: 0; transform: scale(.3); } 44%,95% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes pcslow { 0%,12% { opacity: 0; transform: scale(.6); } 18%,32% { opacity: 1; transform: scale(1); } 38%,100% { opacity: 0; transform: scale(.9); } }
@keyframes pcok { 0%,62% { opacity: 0; transform: scale(.6); } 70%,95% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes pcgold { 0%,3% { opacity: 0; } 12%,95% { opacity: .7; } 100% { opacity: 0; } }

.pc-side h3 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.pc-side > p { margin: 10px 0 0; font-size: 16px; line-height: 1.65; color: var(--mute); }
.pc-steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 6px; }
.pc-steps li { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 18px 18px 18px 4px; border-radius: 18px; }
.pc-steps li::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: #fff3e3; opacity: 0; }
.pc-steps b { display: grid; place-items: center; width: 44px; height: 44px; margin-left: 12px; border-radius: 50%; background: #fff; border: 2px solid rgba(247,134,30,.45); font-size: 13px; font-weight: 800; color: #c25e00; }
.pc-steps strong { display: block; font-size: 19px; line-height: 1.3; letter-spacing: -.01em; }
.pc-steps span { display: block; margin-top: 4px; font-size: 15px; line-height: 1.6; color: var(--mute); }
.pc.in .pc-steps li::before { animation: pcs0 12s ease-in-out infinite; }
.pc.in .pc-steps li:nth-child(2)::before { animation-name: pcs1; }
.pc.in .pc-steps li:nth-child(3)::before { animation-name: pcs2; }
.pc.in .pc-steps li b { animation: pcb0 12s ease-in-out infinite; }
.pc.in .pc-steps li:nth-child(2) b { animation-name: pcb1; }
.pc.in .pc-steps li:nth-child(3) b { animation-name: pcb2; }
@keyframes pcs0 { 0%,1% { opacity: 0; } 4%,36% { opacity: 1; } 40%,100% { opacity: 0; } }
@keyframes pcs1 { 0%,36% { opacity: 0; } 40%,50% { opacity: 1; } 54%,100% { opacity: 0; } }
@keyframes pcs2 { 0%,50% { opacity: 0; } 54%,92% { opacity: 1; } 97%,100% { opacity: 0; } }
@keyframes pcb0 { 0%,1%,40%,100% { background: #fff; color: #c25e00; } 4%,36% { background: var(--orange); color: #fff; } }
@keyframes pcb1 { 0%,36%,54%,100% { background: #fff; color: #c25e00; } 40%,50% { background: var(--orange); color: #fff; } }
@keyframes pcb2 { 0%,50%,97%,100% { background: #fff; color: #c25e00; } 54%,92% { background: var(--orange); color: #fff; } }

/* evidence charts */
.pe-head { margin-top: 96px; max-width: 700px; }
.pe-head h3 { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.12; font-weight: 800; letter-spacing: -.025em; }
.pe-head p { margin: 12px 0 0; font-size: 17px; line-height: 1.65; color: var(--mute); }
.pe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px; margin-top: 40px; }
.mc { margin: 0; }
.mc-art { position: relative; overflow: hidden; border-radius: 26px; background: radial-gradient(circle at 70% 20%, #f7fafd 0%, #e6edf5 65%, #d6e1ee 100%); padding: 22px 20px 12px; transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s; }
.mc-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(16,33,47,.09) 1px, transparent 1.2px); background-size: 18px 18px; -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 85%); mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 85%); }
.mc:hover .mc-art { transform: translateY(-4px); box-shadow: 0 30px 50px -34px rgba(16,33,47,.5); }
.mc-svg { position: relative; }
.mc-t { font-size: 10px; font-weight: 700; fill: #4d5d6c; }
.mc-gold-t { fill: #15803d; }
.mc-line { fill: none; stroke: #f7861e; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.mc-fill { fill: rgba(247,134,30,.16); }
.mc-gold { fill: none; stroke: #15803d; stroke-width: 2.4; stroke-dasharray: 6 5; stroke-linecap: round; opacity: .75; }
.mc-ch { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.mc-ch.c1 { stroke: #f7861e; } .mc-ch.c2 { stroke: #3b9bff; } .mc-ch.c3 { stroke: #8b5cf6; } .mc-ch.c4 { stroke: #e5484d; stroke-width: 3.2; }
.mc-tag { transform-box: fill-box; transform-origin: center; opacity: 0; }
.mc-tag rect { fill: #fff; stroke: #15803d; stroke-width: 1.6; } .mc-tag text { font-size: 10px; font-weight: 800; fill: #15803d; }
.mc-tag.m3 rect { stroke: #e5484d; } .mc-tag.m3 text { fill: #d1313a; }
.mc-pk { transform-box: fill-box; transform-origin: center; opacity: 0; }
.mc figcaption { margin-top: 16px; font-size: 15px; line-height: 1.6; color: var(--mute); }
.mc figcaption b { color: var(--ink); font-weight: 800; }

.mc.in .mc-line.m1 { animation: mcl 8s linear infinite; }
.mc.in .mc-fill.m1 { animation: mcf 8s linear infinite; }
.mc.in .mc-pk.m1 { animation: mcp 8s cubic-bezier(.34,1.56,.64,1) infinite; }
.mc.in .mc-gold { animation: mcg 8s ease-out infinite; }
.mc.in .mc-line.m2 { animation: mcl2 8s linear infinite; }
.mc.in .mc-tag.m2 { animation: mct 8s cubic-bezier(.34,1.56,.64,1) infinite; }
.mc.in .mc-ch { animation: mcch 8s ease-in-out infinite; }
.mc.in .mc-ch.c2 { animation-delay: .12s; } .mc.in .mc-ch.c3 { animation-delay: .24s; } .mc.in .mc-ch.c4 { animation-delay: .5s; }
.mc.in .mc-tag.m3 { animation: mct3 8s cubic-bezier(.34,1.56,.64,1) infinite; }
@keyframes mcl { 0% { stroke-dashoffset: 1; opacity: 1; } 55% { stroke-dashoffset: 0; } 92% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes mcf { 0%,10% { opacity: 0; } 55%,92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes mcp { 0%,24% { opacity: 0; transform: scale(.3); } 30%,92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes mcg { 0%,3% { opacity: 0; } 14%,92% { opacity: .75; } 100% { opacity: 0; } }
@keyframes mcl2 { 0%,12% { stroke-dashoffset: 1; opacity: 1; } 62% { stroke-dashoffset: 0; } 92% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes mct { 0%,62% { opacity: 0; transform: scale(.5); } 70%,92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes mcch { 0% { stroke-dashoffset: 1; opacity: 1; } 55% { stroke-dashoffset: 0; } 92% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes mct3 { 0%,55% { opacity: 0; transform: scale(.5); } 62% { opacity: 1; transform: scale(1.1); } 68%,92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

@media (max-width: 1000px) { .pc { gap: 36px; } .pe { gap: 28px; } }
@media (max-width: 900px) {
  .pc { grid-template-columns: 1fr; margin-top: 36px; }
  .pe { grid-template-columns: 1fr; gap: 40px; }
  .pe-head { margin-top: 64px; }
}
@media (max-width: 560px) {
  .pc-art { padding: 14px 12px 8px; }
  .pc-svg .pc-t { font-size: 17px; }
  .pc-peaklab text { font-size: 13px; }
  .pc-slow, .pc-ok { display: none; }
  .pc-svg .pc-ax, .pc-gold-t, .pc-win-t { display: none; }
  .mc-svg .mc-t, .mc-tag text { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .pcase *, .pcase *::before, .pcase *::after { animation: none !important; transition: none !important; }
  .pc-dot { offset-distance: 100%; } .pc-peak, .pc-peaklab, .pc-ok, .pc-drop, .mc-tag, .mc-pk { opacity: 1; } .pc-slow { opacity: 0; }
  .pc-fill { opacity: .14; } .pc-steps li::before { opacity: 0; }
}
