/* RotoSight page, "The problem": four animated scenes. Only transform / opacity / stroke-dashoffset animate,
   and only once a scene has scrolled into view (.in). */
.problem { background: #fff; }
.prob-head { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.prob-head h2 { max-width: 640px; font-size: clamp(30px, 3.6vw, 48px); }
.prob-head p { margin: 16px 0 0; max-width: 560px; color: var(--mute); font-size: 17px; line-height: 1.65; }
.squig { position: relative; display: inline-block; white-space: nowrap; color: var(--orange); }
.squig svg { position: absolute; left: 0; bottom: -12px; width: 100%; height: 14px; overflow: visible; }
.squig path { fill: none; stroke: var(--orange); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.in .squig path { animation: sqdraw 1.4s cubic-bezier(.65,0,.35,1) .7s forwards; }
@keyframes sqdraw { to { stroke-dashoffset: 0; } }

.pq-cloud { position: relative; height: 230px; }
.pq { position: absolute; left: var(--x); top: var(--y); font-size: var(--sz); line-height: 1; font-weight: 800; color: transparent; -webkit-text-stroke: 2px rgba(247,134,30,.55); transform: translate(-50%, -50%); animation: pqfloat 6s ease-in-out var(--d) infinite; user-select: none; }
.pq:nth-child(odd) { -webkit-text-stroke-color: rgba(11,32,54,.22); }
@keyframes pqfloat { 0%,100% { transform: translate(-50%, -50%) rotate(-6deg); } 50% { transform: translate(-50%, calc(-50% - 14px)) rotate(6deg); } }

.scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 64px 56px; margin-top: 64px; }
.sc { display: grid; gap: 22px; align-content: start; }
.sc-art { position: relative; overflow: hidden; display: grid; aspect-ratio: 16 / 10; border-radius: 28px; }
.sc-art.warm { background: radial-gradient(circle at 30% 25%, #fff6ea 0%, #ffe6c9 60%, #ffd9ae 100%); }
.sc-art.cool { background: radial-gradient(circle at 70% 25%, #f7fafd 0%, #e6edf5 60%, #d6e1ee 100%); }
.sc-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%); }
.sc-svg { position: relative; display: block; width: 100%; height: 100%; padding: 4% 5%; overflow: visible; }
.sc-svg text { font-family: Inter, sans-serif; }
.sc-t { font-size: 9.5px; font-weight: 700; fill: #4d5d6c; }
.s-ring-bg { fill: #fff; stroke: rgba(11,32,54,.12); stroke-width: 6; }
.s-axis { stroke: rgba(11,32,54,.25); stroke-width: 2; stroke-linecap: round; }
.sc-meta { display: grid; grid-template-columns: 38px 1fr; gap: 6px 14px; align-items: start; }
.sc-n { padding-top: 6px; font-size: 13px; font-weight: 800; letter-spacing: .1em; color: #c25e00; }
.sc-meta h3 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.sc-meta p { margin: 8px 0 0; max-width: 460px; font-size: 16px; line-height: 1.65; color: var(--mute); }

/* scene 1: fixed oven time, guessed mould air */
.s1-ring { fill: none; stroke: var(--orange); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: .3; }
.s1-hand { stroke: #0b2036; stroke-width: 3; stroke-linecap: round; transform-box: fill-box; transform-origin: 50% 100%; }
.s1-mould { fill: #fff; stroke: #0b2036; stroke-width: 3; }
.s1-cavity { fill: #fdf3e6; stroke: rgba(11,32,54,.25); stroke-width: 1.5; stroke-dasharray: 4 4; }
.s1-tbg { fill: #e3e8ee; }
.s1-tfill { fill: var(--orange); transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(.6); }
.s1-bulb { fill: var(--orange); }
.s1-q { font-size: 30px; font-weight: 800; fill: #c25e00; transform-box: fill-box; transform-origin: center; }
.sc.in .s1-ring { animation: s1ring 6s linear infinite; }
.sc.in .s1-hand { animation: s1hand 6s linear infinite; }
.sc.in .s1-tfill { animation: s1therm 5s steps(1, end) infinite; }
.sc.in .s1-q { animation: s1q 1.6s ease-in-out infinite; }
@keyframes s1ring { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes s1hand { to { transform: rotate(360deg); } }
@keyframes s1therm { 0% { transform: scaleY(.3); } 14% { transform: scaleY(.85); } 31% { transform: scaleY(.45); } 48% { transform: scaleY(1); } 63% { transform: scaleY(.55); } 80% { transform: scaleY(.75); } 100% { transform: scaleY(.3); } }
@keyframes s1q { 0%,100% { opacity: .35; transform: scale(.85) rotate(-8deg); } 50% { opacity: 1; transform: scale(1.15) rotate(8deg); } }

/* scene 2: unbalanced arms */
.s2-arm { stroke: #0b2036; stroke-width: 5; stroke-linecap: round; }
.s2-target { stroke: #0b2036; stroke-width: 1.6; stroke-dasharray: 4 4; opacity: .5; }
.s2-bar { transform-box: fill-box; transform-origin: 50% 100%; }
.sc.in .s2-spin { animation: s2spin 22s linear infinite; transform-origin: 0 0; }
.sc.in .s2-bar { animation: s2bar 3.6s cubic-bezier(.45,0,.3,1) infinite alternate; }
.sc.in .s2-bar.b2 { animation-duration: 4.4s; animation-delay: -1s; }
.sc.in .s2-bar.b3 { animation-duration: 3.2s; animation-delay: -2s; }
.sc.in .s2-bar.b4 { animation-duration: 5s; animation-delay: -.5s; }
@keyframes s2spin { to { transform: rotate(360deg); } }
@keyframes s2bar { from { transform: scaleY(.2); } to { transform: scaleY(1); } }

/* scene 3: found at the very end */
.s3-line { stroke: #c4cfdb; stroke-width: 3; stroke-linecap: round; }
.s3-node { fill: #fff; stroke: #9aa9b8; stroke-width: 2.5; }
.s3-node.last { stroke: #e5484d; }
.s3-gap { font-size: 8px; font-weight: 700; fill: #8a99a8; }
.s3-dot { fill: var(--orange); filter: drop-shadow(0 4px 6px rgba(247,134,30,.5)); }
.s3-part { transform-box: fill-box; transform-origin: center; }
.s3-good { fill: #4ade80; }
.s3-bad { fill: #e5484d; opacity: 0; }
.s3-stamp { opacity: 0; transform-box: fill-box; transform-origin: center; transform: rotate(-10deg); }
.s3-stamp rect { fill: rgba(255,255,255,.92); stroke: #e5484d; stroke-width: 2.5; }
.s3-stamp text { font-size: 11px; font-weight: 800; letter-spacing: .08em; fill: #e5484d; }
.sc.in .s3-dot { animation: s3dot 8s cubic-bezier(.45,0,.3,1) infinite; }
.sc.in .s3-part { animation: s3part 8s ease-in-out infinite; }
.sc.in .s3-bad { animation: s3bad 8s ease-in-out infinite; }
.sc.in .s3-stamp { animation: s3stamp 8s cubic-bezier(.34,1.56,.64,1) infinite; }
.sc.in .s3-gap { animation: s3gap 8s ease-in-out infinite; }
@keyframes s3dot { 0% { transform: translateX(0); } 62% { transform: translateX(260px); } 100% { transform: translateX(260px); } }
@keyframes s3part { 0%,62% { transform: none; } 70%,92% { transform: skewX(-16deg) scaleY(.78) rotate(4deg); } 100% { transform: none; } }
@keyframes s3bad { 0%,62% { opacity: 0; } 70%,92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes s3stamp { 0%,66% { opacity: 0; transform: rotate(-10deg) scale(2.4); } 74%,92% { opacity: 1; transform: rotate(-10deg) scale(1); } 100% { opacity: 0; transform: rotate(-10deg) scale(1); } }
@keyframes s3gap { 0%,10% { opacity: .2; } 30%,60% { opacity: 1; } 100% { opacity: .2; } }

/* scene 4: one flat average hides the real cost */
.s4-bar { fill: var(--orange); transform-box: fill-box; transform-origin: 50% 100%; }
.s4-avg { stroke: #0b2036; stroke-width: 2; stroke-dasharray: 6 5; }
.s4-tag rect { fill: #0b2036; }
.s4-tag text { font-size: 10px; font-weight: 800; fill: #fff; }
.s4-tag { transform-box: fill-box; transform-origin: center; }
.sc.in .s4-bar { animation: s4bar var(--t) ease-in-out var(--d) infinite alternate; }
.sc.in .s4-tag { animation: s4tag 2.4s ease-in-out infinite; }
@keyframes s4bar { from { transform: scaleY(.4); } to { transform: scaleY(1.08); } }
@keyframes s4tag { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* hand-off to the next section */
.pturn { margin: 76px auto 0; max-width: 640px; text-align: center; font-size: clamp(20px, 2.4vw, 28px); line-height: 1.3; font-weight: 800; letter-spacing: -.02em; }
.pturn-ar { position: relative; display: block; width: 2px; height: 56px; margin: 20px auto 0; background: linear-gradient(var(--orange), transparent); }
.pturn-ar::after { content: ""; position: absolute; left: -4px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); animation: pturn 1.8s ease-in infinite; }
@keyframes pturn { from { transform: translateY(0); opacity: 1; } to { transform: translateY(46px); opacity: 0; } }

@media (max-width: 860px) {
  .prob-head { grid-template-columns: 1fr; }
  .pq-cloud { height: 120px; }
  .scenes { grid-template-columns: 1fr; gap: 48px; margin-top: 44px; }
  .pturn { margin-top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .problem *, .problem *::before, .problem *::after { animation: none !important; }
  .squig path { stroke-dashoffset: 0; }
  .s3-stamp { opacity: 1; }
}
