/* ==========================================================================
   § 01 (3.2) · one twin, three faces
   Static (no JavaScript, reduced motion): the three faces side by side (stacked on phones).
   Live ([data-prism-live], js/prism.js): the stage pins and a triangular prism turns one face per
   scroll beat. --turn (0 → 2) is written on .prism; each face gets --shade from its angle.
   ========================================================================== */
.manifesto { padding-bottom: clamp(40px, 6vw, 90px); }
.manifesto-head { display: grid; justify-items: center; text-align: center; gap: clamp(16px, 2vw, 26px); }
.manifesto-head .folio { margin: 0; }
.manifesto-head .ink-text { max-width: 22em; font-size: clamp(19px, 1.9vw, 28px); color: var(--text-2); }
.manifesto h2 { text-align: center; }

/* ---- the faces (shared) ---- */
.prism-face {
  --shade: 0;
  position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 8px;
  padding: clamp(22px, 2.6vw, 34px); border-radius: 26px; overflow: hidden; isolation: isolate;
  border: 1px solid var(--hair-2);
  background:
    radial-gradient(120% 70% at 85% 0%, rgba(76, 139, 255, 0.24), transparent 60%),
    linear-gradient(165deg, #0f2347, #0a1629 55%, #071020);
  box-shadow: 0 40px 80px -40px rgba(0, 4, 14, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.prism-face::after { /* the turning face darkens with its angle */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: linear-gradient(90deg, rgba(3, 7, 15, 0.85), rgba(3, 7, 15, 0.55)); opacity: calc(var(--shade) * 0.9);
}
.prism-face::before { /* a sheen that slides across as it turns */
  content: ""; position: absolute; inset: -40% -60%; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.10) 50%, transparent 58%);
  transform: translateX(calc((var(--turn, 0) - var(--i, 0)) * 40%)); opacity: 0.9;
}
.face-meta { display: flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); letter-spacing: 0.14em; color: var(--text-3); }
.face-meta b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--hair-3); color: var(--blue-soft); font-weight: 500; letter-spacing: 0.04em; }
.face-meta span { font-family: var(--sans); letter-spacing: 0.24em; color: var(--blue-soft); }
.face-title { margin-top: 6px; font: 400 clamp(28px, 3vw, 42px)/1.22 var(--serif); letter-spacing: -0.01em; color: var(--text-1); }
.face-sub { font-size: 14px; color: var(--text-3); letter-spacing: 0.06em; }
.face-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.face-tags i { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--hair-2); font-style: normal; font-size: 12px; color: var(--text-2); }

/* ---- vignettes: tiny looping scenes, transform/opacity only; they play on the active face ---- */
.vignette { position: relative; min-height: 120px; margin: 6px 0; }
.vignette * { animation-play-state: paused; }
.prism-face.is-playing .vignette * { animation-play-state: running; }

/* 帮你干活: a request, the twin thinking, a checklist written and ticked */
.v-ask { position: absolute; right: 0; top: 4px; padding: 8px 14px; border-radius: 16px 16px 4px 16px; background: var(--blue); color: #fff; font-size: 13px; white-space: nowrap; animation: v-in 5.2s var(--ease-out) infinite; }
.v-dots { position: absolute; left: 0; top: 52px; display: flex; gap: 5px; padding: 10px 12px; border-radius: 14px; background: rgba(156, 193, 255, 0.12); animation: v-think 5.2s linear infinite; }
.v-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-soft); animation: v-dot 0.9s ease-in-out infinite; }
.v-dots i:nth-child(2) { animation-delay: 0.15s; } .v-dots i:nth-child(3) { animation-delay: 0.3s; }
.v-doc { position: absolute; left: 0; right: 18%; top: 50px; height: 88px; padding: 12px 14px; border-radius: 10px; background: var(--paper); box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.8); display: grid; grid-template-columns: 1fr 16px; gap: 7px 10px; align-content: start; animation: v-doc 5.2s var(--ease-out) infinite; }
.v-doc i { display: block; height: 5px; border-radius: 3px; background: #9aacc2; transform-origin: left; grid-column: 1; }
.v-doc i.t { height: 7px; width: 46%; background: var(--blue); }
.v-doc i.l { animation: v-line 5.2s var(--ease-out) infinite; }
.v-doc i.l:nth-of-type(3) { animation-delay: 0.15s; } .v-doc i.l:nth-of-type(4) { animation-delay: 0.3s; width: 72%; }
.v-doc b { grid-column: 2; width: 14px; height: 14px; border-radius: 50%; background: var(--blue); animation: v-tick 5.2s var(--ease-out) infinite; }
.v-doc b:nth-of-type(1) { grid-row: 2; } .v-doc b:nth-of-type(2) { grid-row: 3; animation-delay: 0.25s; } .v-doc b:nth-of-type(3) { grid-row: 4; animation-delay: 0.5s; }
@keyframes v-in { 0%, 4% { opacity: 0; transform: translateY(8px); } 10%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes v-think { 0%, 12% { opacity: 0; } 16%, 30% { opacity: 1; } 34%, 100% { opacity: 0; } }
@keyframes v-dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-3px); opacity: 1; } }
@keyframes v-doc { 0%, 32% { opacity: 0; transform: translateY(10px) scale(0.97); } 40%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes v-line { 0%, 40% { transform: scaleX(0); } 56%, 100% { transform: scaleX(1); } }
@keyframes v-tick { 0%, 58% { transform: scale(0); } 66%, 100% { transform: scale(1); } }

/* 帮你获客: the card sends out its signal; visitors arrive, each in their own language */
.v-card { display: grid; place-items: center; }
.v-ring { position: absolute; left: 50%; top: 50%; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 1px solid rgba(124, 172, 255, 0.6); animation: v-ring 3.2s ease-out infinite; }
.v-ring + .v-ring { animation-delay: 1.6s; }
.v-mini { position: relative; z-index: 1; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto auto; gap: 5px 10px; width: 150px; padding: 12px; border-radius: 12px; background: linear-gradient(135deg, #f8fafd, #e1e9f5); box-shadow: 0 18px 30px -16px rgba(0, 0, 0, 0.8); }
.v-mini i { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #4c8bff, #1847b8); color: #fff; font: 500 15px/1 var(--serif); font-style: normal; }
.v-mini b { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: #0e1f3a; width: 70%; }
.v-mini b + b { height: 4px; margin-top: 0; background: #9aacc2; width: 90%; }
.v-mini em { grid-column: 1 / -1; padding: 4px 0; border-radius: 99px; background: var(--blue); color: #fff; font: 600 11px/1.4 var(--sans); font-style: normal; text-align: center; }
.v-guest { position: absolute; z-index: 2; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 99px; background: #0d1d36; border: 1px solid var(--blue-soft); color: var(--blue-mist); font: 600 12px/1 var(--sans); animation: v-guest 4.8s var(--ease-out) infinite; }
.v-guest.g1 { left: 6%; top: 8%; } .v-guest.g2 { right: 4%; top: 30%; animation-delay: 0.6s; } .v-guest.g3 { left: 14%; bottom: 0; animation-delay: 1.2s; }
@keyframes v-ring { from { transform: scale(0.7); opacity: 0.9; } to { transform: scale(2.1); opacity: 0; } }
@keyframes v-guest { 0%, 6% { opacity: 0; transform: scale(0.6); } 14%, 80% { opacity: 1; transform: none; } 92%, 100% { opacity: 0; transform: scale(0.9); } }

/* 越用越懂你: memories connect; a better version replaces the old one */
.v-mind svg { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.v-mind path { fill: none; stroke: var(--blue-soft); stroke-width: 1.4; stroke-dasharray: 420; stroke-dashoffset: 420; animation: v-draw 5s var(--ease-out) infinite; }
.v-mind circle { fill: #0d1d36; stroke: var(--blue-soft); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: v-node 5s var(--ease-out) infinite; }
.v-mind circle:nth-of-type(2) { animation-delay: 0.3s; } .v-mind circle:nth-of-type(3) { animation-delay: 0.6s; } .v-mind circle:nth-of-type(4) { animation-delay: 0.9s; } .v-mind circle:nth-of-type(5) { animation-delay: 1.2s; }
.v-ver { position: absolute; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--hair-3); background: rgba(7, 16, 32, 0.85); font: 500 12px/1 var(--mono); }
.v-ver s { color: var(--text-4); }
.v-ver b { color: #fff; padding: 3px 7px; border-radius: 6px; background: var(--blue); animation: v-tick 5s var(--ease-out) infinite; }
.v-ver em { font-style: normal; font-family: var(--sans); color: var(--blue-soft); }
@keyframes v-draw { 0%, 8% { stroke-dashoffset: 420; } 55%, 100% { stroke-dashoffset: 0; } }
@keyframes v-node { 0%, 10% { transform: scale(0.4); fill: #0d1d36; } 30%, 100% { transform: scale(1); fill: var(--blue); } }

/* Without motion (and before the prism takes over) every vignette shows its finished state. */
.vignette * { animation-fill-mode: both; }
.motion-reduced .vignette *, html:not(.js) .vignette * { animation: none !important; }
html:not(.js) .v-dots, .motion-reduced .v-dots { opacity: 0; }

/* ---- static layout: three faces side by side ---- */
.prism-runway { margin-top: clamp(40px, 5vw, 70px); }
.prism-stage { display: grid; justify-items: center; gap: clamp(18px, 2.4vw, 30px); width: min(1280px, calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.prism-kicker { font: 500 12px/1 var(--mono); letter-spacing: 0.28em; color: var(--text-3); }
.prism-view { width: 100%; }
.prism { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; }
.prism-face { min-height: 400px; }
.prism-dots { display: none; }
.prism-dock { width: min(100%, 520px); }
.prism-dock .paper-dock { --w: 64px; }

@media (max-width: 900px) {
  .prism { grid-template-columns: 1fr; }
  .prism-face { min-height: 0; }
}

/* ---- live: the pinned prism ---- */
[data-prism-live] {
  --runway: 2;
  --face-w: min(860px, 62vw);
  --face-h: min(440px, calc(100svh - var(--header) - 270px));
  --apothem: calc(var(--face-w) * 0.288675); /* w / (2 tan 60°) */
}
[data-prism-live].prism-runway { height: calc(100svh * (1 + var(--runway))); margin-top: clamp(24px, 3vw, 40px); }
[data-prism-live] .prism-stage {
  position: sticky; top: 0; height: 100svh; width: 100%; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(12px, 2vh, 22px); padding: calc(var(--header) + 8px) var(--gutter) 16px; overflow: clip;
}
[data-prism-live] .prism-view { width: var(--face-w); height: var(--face-h); perspective: 2000px; perspective-origin: 50% 45%; }
[data-prism-live] .prism {
  display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: translateZ(calc(var(--apothem) * -1)) rotateX(-3deg) rotateY(calc(var(--turn, 0) * -120deg));
}
[data-prism-live] .prism-face {
  position: absolute; inset: 0; min-height: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  transform: rotateY(calc(var(--i, 0) * 120deg)) translateZ(var(--apothem));
}
[data-prism-live] .prism-dots { display: flex; gap: 6px; margin-top: clamp(16px, 4vh, 40px); position: relative; z-index: 1; }
.prism-dots button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; line-height: 1;
  border-radius: 99px; border: 1px solid var(--hair-2); font-size: 13px; color: var(--text-3);
  transition: color var(--t-base), border-color var(--t-base), background var(--t-base);
}
.prism-dots button b { font: 500 11px/1 var(--mono); color: var(--text-4); }
.prism-dots button:hover { color: var(--text-1); border-color: var(--hair-3); }
.prism-dots button[aria-current="true"] { color: var(--text-1); border-color: var(--hair-3); background: rgba(36, 111, 241, 0.16); }
.prism-dots button[aria-current="true"] b { color: var(--blue-soft); }
[data-prism-live] .prism-dock { display: flex; align-items: center; gap: 16px; padding: 12px 18px 14px 14px; }
[data-prism-live] .prism-dock .paper-dock { --w: 46px; }
[data-prism-live] .prism-dock p { font-size: 16px; }

/* wide screens: the face is a landscape panel — words on the left, the little scene on the right */
@media (min-width: 761px) {
  [data-prism-live] .prism-face { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: auto auto auto 1fr; column-gap: clamp(20px, 3vw, 44px); }
  [data-prism-live] .prism-face > :not(.vignette) { grid-column: 1; }
  [data-prism-live] .prism-face .face-tags { align-self: end; }
  [data-prism-live] .vignette { grid-column: 2; grid-row: 1 / -1; align-self: center; min-height: 200px; }
  [data-prism-live] .face-title { font-size: clamp(32px, 3.3vw, 48px); }
}
@media (max-width: 760px) {
  [data-prism-live] { --face-w: min(84vw, 360px); --face-h: min(460px, calc(100svh - var(--header) - 200px)); --runway: 1.8; }
  [data-prism-live] .prism-kicker { display: none; }
  [data-prism-live] .prism-dock small { display: none; }
  .face-title { font-size: clamp(26px, 7.4vw, 32px); }
  .vignette { min-height: 108px; }
}
/* short screens (the prism is live from 520px tall, js/prism.js → PRISM.minHeight): less chrome, tighter faces */
@media (max-height: 700px) {
  [data-prism-live] { --face-h: min(440px, calc(100svh - var(--header) - 200px)); }
  [data-prism-live] .prism-dots { margin-top: 0; }
}
@media (max-height: 640px) {
  [data-prism-live] .prism-dock small, [data-prism-live] .prism-kicker { display: none; }
  [data-prism-live] .prism-face { padding: 18px 20px; gap: 6px; }
  [data-prism-live] .face-title { font-size: clamp(22px, 2.6vw, 32px); }
  [data-prism-live] .vignette { min-height: 0; transform: scale(0.84); }
  [data-prism-live] .prism-dock { padding-block: 8px 10px; }
  .face-tags { display: none; }
}
@media (max-height: 640px) and (max-width: 760px) {
  [data-prism-live] .face-title { font-size: clamp(22px, 6.6vw, 26px); }
  [data-prism-live] .vignette { transform-origin: 50% 0; }
}
