/* "Every layer. One experience." A scroll-scrubbed scene in four beats:
   1 the layers fly in, 2 they light up bottom to top while a pulse climbs through them,
   3 they fold into one screen, 4 that screen turns to face you. All driven by vars set in assembly.js. */
.folio .assembly { --p: 0; --c: 0; --pulse: 0; --gap: 150px; --tx: 0deg; --ty: 0deg;
  position: relative; min-height: 300svh; padding: 0; overflow: clip;
  background: radial-gradient(60% 50% at 70% 50%, rgb(217 119 87 / calc(.06 + .12 * var(--c))), transparent 70%), #17130f; }
.folio .assembly-sticky { position: sticky; top: 68px; height: calc(100svh - 68px); min-height: 0;
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(24px, 4vw, 64px); }

/* Copy: the active layer's line lights up as the scene reaches it. */
.folio .assembly-copy { padding: 0; position: relative; z-index: 2; }
.folio .assembly-copy h2 { font-size: clamp(40px, 4.4vw, 64px); margin: 0 0 20px; }
.folio .assembly-copy .assembly-intro { color: var(--soft); font-size: 18px; max-width: 34ch; margin: 0 0 28px; }
.folio .assembly-steps { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 4px; counter-reset: step; }
.folio .assembly-steps li { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: baseline;
  padding: 12px 0 12px 18px; color: var(--soft); opacity: .38; transition: opacity .45s var(--jd-ease), color .45s; }
.folio .assembly-steps li::before { content: ''; position: absolute; left: 0; top: 15%; bottom: 15%; width: 3px; border-radius: 3px;
  background: linear-gradient(#f0b08f, #d97757); box-shadow: 0 0 14px #d97757; transform: scaleY(0); transition: transform .45s var(--jd-spring); }
.folio .assembly-steps b { color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.folio .assembly-steps span { font-size: 15px; line-height: 1.5; }
.folio .assembly-steps li.is-on { opacity: 1; color: var(--ink); }
.folio .assembly-steps li.is-on::before { transform: scaleY(1); }
.folio .assembly.is-whole .assembly-steps li { opacity: .9; }

/* Stage and rig: real 3D. The rig turns; planes only move along their own depth. */
.folio .assembly-stage { position: relative; height: min(80svh, 780px); perspective: 1600px; perspective-origin: 50% 35%; isolation: isolate; }
/* Warm light pooling under the stack, brighter as it lights up. */
.folio .assembly-stage::before { content: ''; position: absolute; z-index: -1; inset: 10% 0 0; border-radius: 50%; filter: blur(50px); pointer-events: none;
  background: radial-gradient(closest-side, rgb(217 119 87 / calc(.14 + .3 * var(--pulse) + .2 * var(--c))), transparent);
  transform: scale(calc(.8 + .3 * var(--p))); }
.folio .assembly-rig { position: absolute; inset: 0; transform-style: preserve-3d;
  transform: translateY(calc(-7% * (1 - var(--c)))) rotateX(calc(55deg * (1 - var(--c)) + var(--tx))) rotateZ(calc(-30deg * (1 - var(--c)))) rotateY(var(--ty)) scale(calc(.94 + .2 * var(--c))); }
.folio .assembly-stage .system-plane { --e: 0; --lit: 0; --z: 0; --hide: 1;
  position: absolute; left: 7%; top: 50%; width: 86%; aspect-ratio: 16 / 10; margin-top: calc(86% * -10 / 32); border-radius: 18px;
  border: 1px solid rgb(240 176 143 / calc(.18 + .6 * var(--lit)));
  background: linear-gradient(150deg, rgb(255 255 255 / 7%), rgb(255 255 255 / 1%) 45%), rgb(36 29 24 / 92%);
  box-shadow: 0 0 calc(8px + 70px * var(--lit)) rgb(217 119 87 / calc(.45 * var(--lit))), inset 0 1px rgb(255 255 255 / 14%), 0 30px 60px rgb(0 0 0 / 35%);
  transform: translate3d(0, calc((1 - var(--e)) * 220px), calc((var(--z) * var(--gap) + (1 - var(--e)) * -260px) * (1 - var(--c))));
  opacity: calc(var(--e) * (1 - var(--c) * var(--hide)));
  transform-style: preserve-3d; animation: none !important; will-change: transform, opacity; }
.folio .assembly-stage .plane-hardware { --z: -1.5; background: linear-gradient(150deg, #ffffff0d, #ffffff02 45%), #2c3529; }
.folio .assembly-stage .plane-system { --z: -.5; }
.folio .assembly-stage .plane-services { --z: .5; }
.folio .assembly-stage .plane-interface { --z: 1.5; --hide: 0; overflow: hidden; background: #1d1612; }
.folio .assembly-stage .system-plane > span { position: absolute; right: 14px; bottom: 12px; z-index: 2; padding: 5px 10px; border-radius: 20px;
  font: 500 12px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: #ffd9c4;
  background: rgb(23 19 15 / 70%); opacity: calc((.45 + .55 * var(--lit)) * (1 - var(--c))); }

/* Layer details react to their own beat. */
.folio .plane-hardware svg { width: 100%; height: 100%; stroke: #d9c38f; stroke-width: 2; opacity: .75; }
.folio .plane-hardware svg :is(path, rect) { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--e) * (.35 + .65 * min(1, var(--lit) * 3 + var(--c)))); }
.folio .plane-system .system-slots { position: absolute; inset: 22% 18%; display: flex; gap: 16px; }
.folio .plane-system .system-slots i { flex: 1; border: 1px solid #df987c88; border-radius: 8px;
  background: repeating-linear-gradient(0deg, transparent 0 12px, rgb(223 152 124 / calc(.1 + .3 * var(--lit))) 13px 14px); }
.folio .plane-system .system-trace { position: absolute; inset: 50% 8% auto; height: 2px; background: #f0b08f; box-shadow: 0 0 18px #df987c;
  transform-origin: left; transform: scaleX(calc(.1 + .9 * var(--lit))); }
.folio .plane-services .service-nodes { position: absolute; inset: 30% 12%; display: flex; align-items: center; justify-content: space-between; }
.folio .plane-services .service-nodes::before { content: ''; position: absolute; inset: 50% 0 auto; height: 1px; background: rgb(223 152 124 / calc(.25 + .6 * var(--lit))); }
.folio .plane-services .service-nodes i { position: relative; width: 30px; aspect-ratio: 1; border-radius: 50%; border: 1px solid #df987caa; background: #594135;
  box-shadow: 0 0 calc(6px + 26px * var(--lit)) rgb(217 119 87 / calc(.2 + .6 * var(--lit))); }
.folio .plane-services .service-nodes i::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid #f0b08f; opacity: 0; animation: node-ping 2.4s var(--jd-ease) infinite; }
.folio .plane-services .service-nodes i:nth-child(2)::after { animation-delay: .3s; } .folio .plane-services .service-nodes i:nth-child(3)::after { animation-delay: .6s; }
.folio .plane-services .service-nodes i:nth-child(4)::after { animation-delay: .9s; } .folio .plane-services .service-nodes i:nth-child(5)::after { animation-delay: 1.2s; }
@keyframes node-ping { 0% { opacity: .8; transform: scale(.7); } 70%, 100% { opacity: 0; transform: scale(1.6); } }
.folio .plane-interface img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: calc(.55 + .45 * max(var(--lit), var(--c))); filter: saturate(calc(.6 + .4 * var(--c))); }
/* A glass sheen sweeps across the finished screen. */
.folio .plane-interface::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 22%) 45%, transparent 60%);
  transform: translateX(calc(-120% + 240% * var(--c))); opacity: calc(var(--c) * (1 - var(--c)) * 4); }

/* The beam runs straight through the stack; the pulse climbs it. */
.folio .assembly-beam, .folio .assembly-pulse { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.folio .assembly-beam { width: 2px; height: calc(var(--gap) * 3.4); margin: calc(var(--gap) * -1.7) 0 0 -1px;
  background: linear-gradient(transparent, rgb(240 176 143 / 70%), transparent); transform: rotateX(90deg); opacity: calc(min(1, var(--p) * 4) * (1 - var(--c))); }
.folio .assembly-pulse { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 20%, #f0b08f 35%, rgb(217 119 87 / 0) 70%); box-shadow: 0 0 30px 8px rgb(217 119 87 / 60%);
  transform: translateZ(calc((var(--pulse) * 3.2 - 1.6) * var(--gap) * (1 - var(--c)))) rotateX(-58deg);
  opacity: calc(min(1, var(--pulse) * 8) * min(1, (1 - var(--pulse)) * 8) * (1 - var(--c))); }

/* ---------- About: principles, a short timeline, the toolbox ---------- */
.folio .about-more { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); padding-top: clamp(48px, 6vw, 88px); }
.folio .about-principles { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.folio .about-principles li { position: relative; padding: 28px 26px 26px; border-radius: 24px; overflow: hidden; isolation: isolate;
  background: linear-gradient(150deg, rgb(255 255 255 / 7%), rgb(255 255 255 / 1.5%) 45%, rgb(217 119 87 / 7%));
  box-shadow: inset 0 1px rgb(255 255 255 / 16%), inset 0 -1px rgb(0 0 0 / 30%), 0 20px 50px -30px rgb(0 0 0 / 80%);
  transition: transform .5s var(--jd-spring), box-shadow .4s; }
.folio .about-principles li::before { content: ''; position: absolute; z-index: -1; width: 220px; height: 220px; right: -80px; top: -90px; border-radius: 50%;
  background: radial-gradient(circle, rgb(217 119 87 / 30%), transparent 65%); transition: transform .6s var(--jd-ease); }
.folio .about-principles li:hover { transform: translateY(-4px); }
.folio .about-principles li:hover::before { transform: translate(-30px, 30px) scale(1.2); }
.folio .ap-num { display: block; font: 600 13px/1 var(--body); letter-spacing: .1em; color: #eda083; margin-bottom: 36px; }
.folio .about-principles h3 { font-size: 22px; line-height: 1.2; margin: 0 0 10px; }
.folio .about-principles p { color: var(--soft); font-size: 15px; line-height: 1.6; margin: 0; }
.folio .about-timeline { grid-column: 1 / span 7; }
.folio .about-timeline h3, .folio .about-tools h3 { font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); margin: 0 0 18px; }
.folio .about-timeline ol { list-style: none; margin: 0; padding: 0; position: relative; }
.folio .about-timeline ol::before { content: ''; position: absolute; left: 92px; top: 10px; bottom: 10px; width: 1px; transform-origin: top;
  background: linear-gradient(#d97757, rgb(217 119 87 / 10%)); }
@supports (animation-timeline: view()) {
  .folio .about-timeline ol::before { animation: line-draw linear both; animation-timeline: view(); animation-range: entry 10% cover 50%; }
  @keyframes line-draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}
.folio .about-timeline li { display: grid; grid-template-columns: 76px 1fr; gap: 32px; padding: 14px 0; position: relative; }
.folio .about-timeline li::after { content: ''; position: absolute; left: 88px; top: 21px; width: 9px; height: 9px; border-radius: 50%; background: #d97757; box-shadow: 0 0 0 4px rgb(217 119 87 / 18%), 0 0 16px #d97757; }
.folio .about-timeline time { font: 500 13px/1.6 var(--body); color: var(--soft); white-space: nowrap; }
.folio .about-timeline b { display: block; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.folio .about-timeline span { color: var(--soft); font-size: 15px; line-height: 1.55; }
.folio .about-tools { grid-column: 8 / -1; }
.folio .about-tools ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.folio .about-tools li { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--ink);
  background: rgb(255 255 255 / 5%); box-shadow: inset 0 1px rgb(255 255 255 / 12%), inset 0 0 0 1px rgb(255 255 255 / 6%); transition: background .2s, transform .3s var(--jd-spring); }
.folio .about-tools li:hover { background: rgb(217 119 87 / 18%); transform: translateY(-2px); }

@media (max-width: 820px) {
  .folio .about-principles { grid-template-columns: 1fr; }
  .folio .about-timeline, .folio .about-tools { grid-column: 1 / -1; }
  .folio .ap-num { margin-bottom: 18px; }
  .folio .about-timeline li { grid-template-columns: 64px 1fr; gap: 24px; }
  .folio .about-timeline ol::before { left: 76px; } .folio .about-timeline li::after { left: 72px; }
}

@media (max-width: 820px) {
  .folio .assembly { --gap: 70px; min-height: 260svh; }
  .folio .assembly-sticky { top: 60px; height: calc(100svh - 60px); grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; gap: 0; padding-top: 20px; }
  .folio .assembly-copy h2 { font-size: clamp(30px, 8vw, 44px); margin-bottom: 10px; }
  .folio .assembly-copy .assembly-intro { font-size: 15px; margin-bottom: 10px; }
  .folio .assembly-steps { margin-bottom: 0; gap: 0; }
  .folio .assembly-steps li { grid-template-columns: 82px 1fr; padding-block: 6px; }
  .folio .assembly-steps b, .folio .assembly-steps span { font-size: 13px; }
  .folio .assembly-copy .text-link { display: none; }
  .folio .assembly-stage { height: 100%; min-height: 260px; }
}
@media (max-width: 820px) and (max-height: 700px) {
  .folio .assembly-steps span { display: none; }
}
