/* Open AI composition, with V9's continuous, scroll-linked hand-offs. */
.ai-open-story{--received:1;--core-turn:152;--core-response:0;--outgoing:1}
.ai-open-connections,.ai-open-story .core-label{display:none}
.flow-signal{opacity:0;fill:#f2d475;stroke:#111713;stroke-width:1.5}
@media(min-width:801px){
 .ai-open-story .ai-connections{display:none}
 .ai-open-connections{display:block;position:absolute;inset:0;width:100%;height:100%;fill:none;stroke-width:1;overflow:visible;pointer-events:none}
 .open-path-guides{stroke:#748569;opacity:.19}
 .open-flow-path{stroke:#d8b74c;stroke-width:1.35;stroke-linecap:round;stroke-dasharray:1}
 .flow-enquiry{stroke-dashoffset:calc(1 - var(--knowledge))}
 .flow-knowledge{stroke-dashoffset:calc(1 - var(--knowledge))}
 .flow-process{stroke-dashoffset:calc(1 - var(--knowledge))}
 .flow-draft{stroke-dashoffset:calc(1 - var(--draft));stroke-width:1.7}
 .flow-signal{fill:#f2d475;stroke:#111713;stroke-width:1.5}
 .ai-open-story .knowledge-papers{inset:0;width:100%;max-width:none;height:100%;transform:none;perspective:none;pointer-events:none}
 .ai-open-story .knowledge-paper{inset:auto;box-shadow:none;transform-origin:center center}
 .ai-open-story .paper-front{left:13%;top:50%;width:clamp(175px,17vw,250px);height:220px;padding:25px;transform:translate(-50%,-50%) rotate(calc(-5deg + var(--knowledge)*3deg));background:#e7e9da;border:0;box-shadow:0 18px 45px #0002;z-index:3}
 .ai-open-story .paper-front:after{content:'';position:absolute;inset:8px;border:1px solid #73856428;pointer-events:none}
 .ai-open-story .paper-front small{font-size:7px}.ai-open-story .paper-front b{font-size:clamp(30px,2.5vw,42px);margin-top:25px;line-height:1.03}.ai-open-story .paper-front p{font-size:10px;line-height:1.7;margin-top:18px}.ai-open-story .paper-front .paper-foot{display:none}
 .ai-open-story .paper-back,.ai-open-story .paper-middle{background:#111713;color:#dae2cd;border:0;box-shadow:0 0 0 8px #111713;width:clamp(150px,13vw,210px);height:115px;padding:0;transform:translate(-50%,calc(-50% + (1 - var(--knowledge))*14px));opacity:calc(.5 + var(--knowledge)*.5);z-index:4}
 .ai-open-story .paper-middle{left:31%;top:17%}.ai-open-story .paper-back{left:28%;top:84%;transform:translate(-50%,calc(-50% - (1 - var(--knowledge))*14px))}
 .ai-open-story .paper-middle:before,.ai-open-story .paper-back:before{content:'';display:block;width:5px;height:5px;background:#d6b44a;margin-bottom:12px;border-radius:50%}
 .ai-open-story .paper-middle small,.ai-open-story .paper-back small{font-size:7px;color:#a9b69b;letter-spacing:.09em}
 .ai-open-story .paper-middle b,.ai-open-story .paper-back b{font-size:clamp(22px,1.8vw,29px);line-height:1.13;margin-top:11px;font-weight:450;letter-spacing:-.035em}
 .ai-open-story .paper-middle>i,.ai-open-story .paper-back>i{display:none}
 .ai-open-story .ai-core{left:52%;top:50%;width:clamp(205px,19vw,302px);height:clamp(205px,19vw,302px);background:#111713;box-shadow:0 0 0 3px #111713;z-index:5}
 .ai-open-story .ai-core:after{content:'';position:absolute;inset:14%;border:1px solid #88997516;border-radius:50%;pointer-events:none}
 .ai-open-story .ai-core>b{font-size:clamp(68px,6.8vw,106px);font-weight:400;line-height:.95;margin:13px 0 15px;letter-spacing:-.085em}
 .ai-open-story .ai-core>span:not(.core-label){font-size:8px;letter-spacing:.15em;color:#bdc9ac}.ai-open-story .ai-core>small{font-size:10px;line-height:1.5;color:#adbc9a}
 .ai-open-story .core-label{display:block;position:absolute;bottom:calc(100% + 24px);left:50%;transform:translateX(-50%);font:8px Space,sans-serif;letter-spacing:.13em;color:#9ead8d;white-space:nowrap}
 .ai-open-story .orbit-guide{stroke:#81977545}.ai-open-story .orbit-inner{stroke:#81977536;stroke-dasharray:.5 6}.ai-open-story .orbit-half{stroke-width:1.8;stroke:#e1c356}
 .ai-open-story .reply-paper{right:auto;left:86%;top:50%;width:clamp(200px,19vw,282px);height:260px;max-width:none;background:#17221a;border-color:#7f936554;transform:translate(-50%,calc(-50% + (1 - var(--draft))*22px)) perspective(900px) rotateY(calc((1 - var(--draft))*-12deg)) rotate(calc((1 - var(--draft))*4deg));z-index:4;box-shadow:0 18px 45px #0002}
 .ai-open-story .reply-written,.ai-open-story .reply-empty{padding:28px}
 .ai-open-story .reply-written{background:#eff0e3;clip-path:inset(calc((1 - var(--draft))*100%) 0 0 0)}
 .ai-open-story .reply-written:after{content:'';position:absolute;right:0;top:0;width:20px;height:20px;background:linear-gradient(45deg,#c9d1b9 50%,#111713 50%)}
 .ai-open-story .reply-written>small,.ai-open-story .reply-empty>span{font-size:7px;line-height:1.7;letter-spacing:.05em}
 .ai-open-story .reply-written>b,.ai-open-story .reply-empty>b{font-size:clamp(29px,2.4vw,40px);font-weight:450;line-height:1.06;margin-top:26px}
 .ai-open-story .reply-written>p{font-size:10px;line-height:1.8;margin-top:18px}.ai-open-story .reply-lines{display:none}
 .ai-open-story .review-stamp{bottom:-20px;right:-15px;min-width:195px;padding:14px 18px;transform:translateY(calc((1 - var(--review))*18px)) rotate(calc(-6deg + var(--review)*3deg))}
 .ai-open-story .review-stamp b{font-size:9px}.ai-open-story .review-stamp small{font-size:8px}
}
@media(min-width:801px) and (max-width:1100px){
 .ai-open-connections .flow-draft,.ai-open-connections .open-path-guides>path:last-child,.ai-open-connections [data-flow-dot="draft"]{transform-box:view-box;transform-origin:50% 50%;transform:scaleY(.55)}
 .ai-open-story .paper-front{width:155px;height:195px;padding:19px;left:12%}.ai-open-story .paper-front small{font-size:6px}.ai-open-story .paper-front b{font-size:30px;margin-top:23px}.ai-open-story .paper-front p{font-size:9px;margin-top:15px}.ai-open-story .paper-front .paper-foot{left:19px;font-size:5px}
 .ai-open-story .paper-middle,.ai-open-story .paper-back{width:145px;height:110px}.ai-open-story .paper-middle small,.ai-open-story .paper-back small{font-size:6px}.ai-open-story .paper-middle b,.ai-open-story .paper-back b{font-size:23px}.ai-open-story .paper-middle{top:16%}.ai-open-story .paper-back{top:85%}
 .ai-open-story .ai-core{width:190px;height:190px;box-shadow:0 0 0 3px #111713}.ai-open-story .ai-core>b{font-size:67px}.ai-open-story .ai-core>span:not(.core-label){font-size:6px}.ai-open-story .ai-core>small{font-size:8px}.ai-open-story .core-label{font-size:6px;bottom:calc(100% + 18px)}
 .ai-open-story .reply-paper{width:180px;height:235px;left:86%}.ai-open-story .reply-written,.ai-open-story .reply-empty{padding:22px}.ai-open-story .reply-written>small,.ai-open-story .reply-empty>span{font-size:6px}.ai-open-story .reply-written>b,.ai-open-story .reply-empty>b{font-size:30px}.ai-open-story .reply-written>p{font-size:9px}.ai-open-story .review-stamp{min-width:165px;padding:12px;right:-7px}.ai-open-story .review-stamp b{font-size:8px}.ai-open-story .review-stamp small{font-size:7px}
}
@media(min-width:801px) and (max-height:760px){
 .ai-open-story .paper-middle,.ai-open-story .paper-back{height:92px}.ai-open-story .paper-middle:before,.ai-open-story .paper-back:before{margin-bottom:8px}.ai-open-story .paper-middle b,.ai-open-story .paper-back b{font-size:23px;margin-top:8px}.ai-open-story .paper-middle{top:13%}.ai-open-story .paper-back{top:86%}
 .ai-open-story .ai-core{width:clamp(190px,17.3vw,240px);height:clamp(190px,17.3vw,240px)}.ai-open-story .ai-core>b{font-size:clamp(64px,6vw,84px)}.ai-open-story .core-label{bottom:calc(100% + 15px);font-size:7px}
 .ai-open-story .paper-back{left:32%;top:87%;height:75px}
 .ai-open-story .paper-front{height:205px}.ai-open-story .reply-paper{height:238px}.ai-open-story .reply-written>b,.ai-open-story .reply-empty>b{margin-top:20px}.ai-open-story .reply-lines{margin-top:12px}.ai-open-story .reply-written>p{margin-top:13px}
}
@media(min-width:801px) and (max-width:1100px) and (max-height:760px){.ai-open-story .paper-back{left:35%}}
@media(min-width:801px) and (max-height:649px){.ai-open-story .ai-story-stage{grid-template-rows:auto 460px auto}.ai-open-story .paper-middle{top:15%}.ai-open-story .paper-back{top:85%}}
@media(prefers-reduced-motion:reduce){.ai-open-story .open-flow-path{stroke-dashoffset:0}.ai-open-story .flow-signal{display:none}}

/* Arrivals gently charge the existing orbit; there is no independent pulse loop. */
.ai-open-story .core-orbit{transform:rotate(calc(-70deg + var(--core-turn)*1deg))}
.ai-open-story .orbit-half{stroke-dasharray:calc(.14 + var(--received)*.36) 1;opacity:calc(.45 + var(--received)*.55)}
.ai-open-story .ai-core:before{content:'';position:absolute;inset:3%;border:1px solid #dfc66c;border-radius:50%;opacity:calc(var(--core-response)*.55);transform:scale(calc(1 + var(--core-response)*.09));pointer-events:none}
.ai-open-story .ai-core:after{border-color:rgb(168 185 132 / calc(.08 + var(--core-response)*.22))}
.ai-open-story .ai-core>b{opacity:calc(.75 + var(--received)*.25)}
.ai-open-story .open-flow-path{opacity:.72}
.ai-open-story .flow-draft{stroke-dashoffset:calc(1 - var(--outgoing));opacity:.9}
.ai-open-story .ai-output-path{stroke-dashoffset:calc(1 - var(--outgoing))}

/* The paper receives the flow first. Its words then form in reading order. */
.ai-open-story .reply-written{clip-path:none;opacity:var(--draft)}
.ai-open-story .reply-fragment{--line-reveal:1;display:block;clip-path:inset(0 calc((1 - var(--line-reveal))*100%) -2px 0);opacity:var(--line-reveal);transform:translateY(calc((1 - var(--line-reveal))*5px))}
.ai-open-story .review-stamp{top:calc(100% - 12px);bottom:auto}
@media(min-width:801px){
 .ai-open-story .reply-paper{transform:translate(-50%,calc(-50% + (1 - var(--draft))*10px)) rotate(calc((1 - var(--draft))*1.5deg))}
}
@media(max-width:520px){
 .ai-open-story .reply-written>b,.ai-open-story .reply-empty>b{font-size:clamp(20px,6.1vw,25px)}
}
@media(max-width:520px) and (max-height:720px){
 .ai-open-story .review-stamp{top:calc(100% - 20px);padding:7px 8px;font-size:12px;line-height:1.1}
}
@media(prefers-reduced-motion:reduce){
 .ai-open-story{--received:1!important;--core-turn:152!important;--core-response:0!important;--outgoing:1!important}
 .ai-open-story .reply-fragment{clip-path:none;opacity:1;transform:none}
}
