/* Popcorn chip: "how we built it" scroll story. One deck, four panels that swap as you scroll. */
#pcFlow[data-story] { height: 440vh; }
#pcFlow .fr-line { transition: opacity .5s ease, transform .5s ease; }
#pcFlow .fr-line.cur { text-shadow: 0 0 22px rgba(126,232,255,.35); }
.fd { position: relative; justify-self: center; width: 100%; max-width: 700px; height: min(80svh, 640px); border-radius: 18px; background: #0a1222; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(126,232,255,.35), 0 0 0 7px #050812, 0 0 0 8px rgba(126,232,255,.25), 0 30px 90px rgba(0,0,0,.65), 0 0 70px rgba(139,92,246,.25); }
.fp { position: absolute; inset: 0; display: none; padding: 16px 16px 40px; flex-direction: column; gap: 10px; min-height: 0; }
#pcFlow[data-stage="0"] .fp0, #pcFlow[data-stage="1"] .fp1, #pcFlow[data-stage="2"] .fp2, #pcFlow[data-stage="3"] .fp3 { display: flex; animation: fpIn .45s ease both; }
@keyframes fpIn { from { opacity: 0; transform: scale(.985); } }
.fp-tag { position: absolute; left: 16px; bottom: 12px; font: 600 11px 'JetBrains Mono', monospace; letter-spacing: 2px; text-transform: uppercase; color: #ffd9a0; }
.fp figure { margin: 0; }
.fp figcaption { font: 500 10.5px 'JetBrains Mono', monospace; color: #8fa3c0; text-align: center; padding-top: 4px; }

/* 0: cartoon standard cells pop in, then their poly gates draw */
.fp-cells { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: flex-end; gap: 14px 12px; --ch: clamp(100px, 25svh, 200px); }
.cc { display: flex; flex-direction: column; align-items: center; opacity: 0; animation: cellPop .6s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--d); }
.cc svg { height: var(--ch); width: auto; overflow: visible; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); }
.cc figcaption { font: 700 10.5px 'JetBrains Mono', monospace; color: #ffd9a0; padding-top: 5px; }
.cc-body { fill: #fff8ea; stroke: #1b2238; stroke-width: 2.5; }
.cc-well { fill: #ffd6e4; }
.cc-rail { fill: #5aa9ff; stroke: #1b2238; stroke-width: 2; }
.cc-pdiff { fill: #c4f08f; stroke: #5d9a2e; stroke-width: 1.5; } .cc-ndiff { fill: #b6ecc9; stroke: #3f9a64; stroke-width: 1.5; }
.cc-m1 { fill: none; stroke: #3b82f6; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.cc-poly { stroke: #ff4f5e; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .5s ease forwards; animation-delay: var(--pd); }
.cc-ct { fill: #1b2238; }
.cc-pin { fill: #fff; stroke: #1b2238; stroke-width: 2; } .cc-pin.out { fill: #ffd479; }
.cc-pt { font: 700 7.5px 'JetBrains Mono', monospace; fill: #1b2238; text-anchor: middle; }
.cc-shine { fill: #fff; opacity: .9; }
@keyframes cellPop { 0% { opacity: 0; transform: translateY(26px) scale(.7); } 100% { opacity: 1; transform: none; } }

/* 1: place & route images + python */
.fp-pnr { display: flex; gap: 12px; justify-content: center; height: 34%; min-height: 0; flex: none; }
.fp-pnr figure { height: 100%; display: flex; flex-direction: column; min-width: 0; opacity: 0; animation: cellPop .6s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--d); }
.fp-pnr img { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; background: #fff; border-radius: 8px; }
.code { flex: 1; min-height: 0; margin: 0; padding: 10px 12px; border-radius: 10px; background: #060b16; border: 1px solid rgba(126,232,255,.18); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  font: 500 11.5px/1.5 'JetBrains Mono', monospace; color: #cfe0f5; white-space: pre; text-align: left; }
.code .ct { white-space: pre; }
.code .k { color: #ff7ab2; } .code .c { color: #6c7f9b; } .code .n { color: #ffd479; } .code .f { color: #7ee8ff; } .code .s { color: #5dffa6; }
.code .cur { display: inline-block; width: 7px; height: 1em; background: #7ee8ff; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 2: verilog + gates snapping together */
.tree { width: 100%; flex: 1.05; min-height: 0; }
.fp2 .code { flex: 1; }
.tree .pill rect { fill: #14325a; stroke: #5aa9ff; stroke-width: 1.2; }
.tree .pill text { font: 700 9px 'JetBrains Mono', monospace; fill: #dbe9ff; }
.tree .pill.g2 rect { fill: #3a1f55; stroke: #b79cff; } .tree .pill.g3 rect { fill: #4a3410; stroke: #ffb454; } .tree .pill.g4 rect { fill: #0f4a36; stroke: #5dffa6; }
.tree .pill { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.tree .w { stroke-dasharray: 1; stroke-dashoffset: 1; }
.tree .ins, .tree .outl { opacity: 0; }
.go .tree .pill { animation: jump .9s cubic-bezier(.3,1.4,.5,1) both; animation-delay: var(--d); }
.go .tree .w { animation: draw .45s ease forwards; animation-delay: var(--d); }
.go .tree .ins { animation: fade .4s ease .05s forwards; } .go .tree .outl { animation: fade .5s ease 2.9s forwards; }
@keyframes jump { 0% { opacity: 0; transform: translateY(-70px) rotate(-12deg) scale(.5); } 55% { opacity: 1; transform: translateY(6px) scale(1.12, .88); } 75% { transform: translateY(-9px); } 100% { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } } @keyframes fade { to { opacity: 1; } }

/* 3: signoff */
.fp-sign { flex: 1; min-height: 0; display: flex; background: #fbfbfd; border-radius: 10px; overflow: hidden; }
.fp-sign img { width: 100%; height: 100%; object-fit: contain; animation: reveal 1.6s ease both; }
@keyframes reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.fp-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.fp-chips span { font: 700 12px 'JetBrains Mono', monospace; color: #03180d; background: #5dffa6; padding: 6px 12px; border-radius: 999px; box-shadow: 0 0 14px rgba(93,255,166,.4); opacity: 0; animation: cellPop .5s ease 1.4s both; }
.fp-chips span:nth-child(2) { animation-delay: 1.7s; } .fp-chips span:nth-child(3) { animation-delay: 2s; background: #ffd9a0; }

@media (max-width: 820px) {
  .fd { height: 100%; max-height: 560px; max-width: 420px; }
  .fp { padding: 10px 10px 34px; gap: 8px; } .code { font-size: 9.5px; padding: 8px; } .fp-tag { font-size: 10px; left: 12px; bottom: 9px; }
  .fp-pnr { height: 30%; } .fp-cells { gap: 10px 8px; --ch: clamp(80px, 16svh, 130px); } .cc figcaption { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  #pcFlow[data-story] { height: auto; }
  .fd { height: auto; max-height: none; } .fp { position: relative; display: flex !important; height: 440px; animation: none !important; margin-bottom: 8px; }
  .cc, .fp-pnr figure, .fp-chips span, .tree .pill { opacity: 1 !important; animation: none !important; } .tree .w, .cc-poly { stroke-dashoffset: 0; animation: none !important; } .tree .ins, .tree .outl { opacity: 1; }
}

/* ===== Shuttle die: a scroll story. Die -> layout over it -> my block outlined -> zoom in -> my full render ===== */
.die { position: relative; height: 520vh; background: radial-gradient(80% 70% at 75% 40%, #10203d, #02030a 70%); }
.die-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.die-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 64px clamp(16px, 4vw, 40px) 20px; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(22px, 5vw, 64px); align-items: center; }
.die-k { display: inline-block; font: 600 12px 'JetBrains Mono', monospace; letter-spacing: 2.5px; text-transform: uppercase; color: #7ee8ff; padding: 6px 14px; border: 1px solid rgba(126,232,255,.45); border-radius: 999px; background: rgba(0,212,255,.1); }
.die h2 { margin: 14px 0 14px; font: 800 clamp(1.8rem, 5vw, 3.4rem)/1.06 Poppins, sans-serif; letter-spacing: -.02em; color: #fff; }
.die h2 span { background: linear-gradient(100deg, #7ee8ff, #b79cff 55%, #ffb454); -webkit-background-clip: text; background-clip: text; color: transparent; }
.die-lines { position: relative; min-height: 4.2em; }
.die-line { position: absolute; left: 0; top: 0; margin: 0; max-width: 34ch; font: 600 clamp(1.05rem, 2.2vw, 1.45rem)/1.35 Poppins, sans-serif; color: #dbe6f6; opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s; }
.die-line b { color: #ffd9a0; } .die-line.on { opacity: 1; transform: none; }
.die-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.die-steps span { font: 600 10.5px 'JetBrains Mono', monospace; letter-spacing: 1px; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); color: #6f7f99; transition: all .3s; }
.die-steps span.done { color: #9fb4d0; border-color: rgba(126,232,255,.35); }
.die-steps span.on { color: #2b1700; border-color: #ffd27a; background: #ffd27a; }
.die-fig { position: relative; margin: 0; width: min(100%, 72svh); justify-self: center; aspect-ratio: 1200 / 1190; border-radius: 18px; overflow: hidden; background: #0d1426;
  box-shadow: 0 0 0 1px rgba(126,232,255,.35), 0 30px 90px rgba(0,0,0,.65), 0 0 80px rgba(139,92,246,.2); }
.die-zoom { position: absolute; inset: 0; transform-origin: 0 0; transform: translate(var(--tx, 0%), var(--ty, 0%)) scale(var(--zs, 1)); will-change: transform; }
.die-zoom img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.die-layout { opacity: var(--lay, 0); }
.die-dim { position: absolute; box-shadow: 0 0 0 9999px rgba(2,3,10, var(--dim, 0)); border-radius: 4px; pointer-events: none; }
.die-box { position: absolute; opacity: var(--bx, 0); }
.die-box svg { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); overflow: visible; }
.die-box rect { fill: none; stroke: #ffd27a; stroke-width: 4; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: var(--draw, 1); filter: drop-shadow(0 0 6px #ffb454); }
.die-tag { position: absolute; left: 50%; top: -10px; transform: translate(-50%, -100%) scale(calc(.6 + .4 * var(--tag, 0))); opacity: var(--tag, 0); font: 700 12px 'JetBrains Mono', monospace; letter-spacing: 1.5px; text-transform: uppercase; color: #2b1700; background: #ffd27a; padding: 4px 10px; border-radius: 999px; white-space: nowrap; box-shadow: 0 0 18px rgba(255,180,84,.6); }
.die-render { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: var(--ren, 0); transform: scale(calc(1.18 - .18 * var(--ren, 0))); }
.die-flash { position: absolute; inset: 0; background: #fff; opacity: var(--fl, 0); pointer-events: none; mix-blend-mode: screen; }
.die-cap { position: absolute; left: 12px; bottom: 12px; font: 600 11px 'JetBrains Mono', monospace; letter-spacing: 1.5px; text-transform: uppercase; color: #fff; background: rgba(2,3,10,.65); padding: 5px 10px; border-radius: 999px; opacity: var(--ren, 0); backdrop-filter: blur(6px); }
.die-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.06); } .die-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, #7ee8ff, #b79cff, #ffb454); }
@media (max-width: 820px) {
  .die-wrap { grid-template-columns: 1fr; gap: 12px; padding-top: 66px; align-content: start; }
  .die h2 { font-size: clamp(1.5rem, 7vw, 2rem); margin: 8px 0; } .die-lines { min-height: 3em; } .die-line { font-size: 1rem; max-width: none; } .die-steps { margin-top: 8px; }
  .die-fig { width: min(100%, 52svh); }
}
@media (prefers-reduced-motion: reduce) {
  .die { height: auto; } .die-stage { position: relative; height: auto; padding: 40px 0; }
  .die-line { position: static; opacity: 1; transform: none; margin-bottom: 6px; } .die-lines { min-height: 0; }
}
.ds-collage.one { grid-template-columns: 1fr; max-width: 420px; justify-self: center; width: 100%; }
.ds-collage.one .ds-tile { --r: 0deg; }

/* ===== Full flow diagram (tall) ===== */
#fullFlow .ff-card { aspect-ratio: 1100 / 1848; }
@media (max-width: 820px) { #fullFlow .ff-card { width: auto; height: 100%; max-width: 100%; } }
