/* Owner-directed, bounded revision: torn paper transitions, compact comparison,
   no rounded one-sided rules. Approved hero, imagery and copy stay unchanged. */
.paper-story :is(.how,.night,.start,.final) { position:relative; }
.paper-story .how, .paper-story .start { background:#D6DCE4; padding-top:clamp(64px,7.5vw,108px); }
.paper-story .night { background:#0D111B; padding-top:clamp(64px,7.5vw,108px); }
.paper-story .final { background:#172342; padding-top:clamp(64px,7.5vw,108px); }
.paper-story :is(.how,.night,.start,.final)::before {
  content:""; position:absolute; inset:-28px 0 auto; height:40px;
  background-repeat:no-repeat; background-position:top; background-size:100% 40px;
  pointer-events:none; z-index:1;
}
.paper-story .how::before { background-image:url("assets/paper-edge-how.svg?v=20261015T022320Z"); }
.paper-story .night::before { background-image:url("assets/paper-edge-night.svg?v=20261015T022320Z"); }
.paper-story .start::before { background-image:url("assets/paper-edge-start.svg?v=20261015T022320Z"); }
.paper-story .final::before { background-image:url("assets/paper-edge-final.svg?v=20261015T022320Z"); }
.paper-story .final-grid { padding-top:0; }

/* A border on one side must not inherit a rounded card perimeter. */
.paper-story.daylight-story main > :not(.hero) :is(.route,.case,.feat-showcase,.app-group,.grow-col) {
  border-radius:0;
}
.paper-story.daylight-story .how .routes { gap:48px; }
.paper-story.daylight-story .how .route { border:0; }
.paper-story.daylight-story .how .route-direct { border:0; }
.paper-story.daylight-story .feat-showcase + .feat-showcase { border-left:0; padding-left:0; }

/* Restore the original compact MCP/A2A/A4A composition, not the expanded rows. */
.paper-story .compare { padding-block:clamp(64px,7.5vw,108px); }
.paper-story .compare .scale { grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.paper-story .compare .scale .proto {
  display:flex; flex-direction:column; align-items:stretch;
  grid-template-columns:none; grid-template-areas:none; gap:0;
  border:1px solid var(--line); border-radius:24px;
  background:var(--card); padding:24px 24px 22px;
}
.paper-story .compare .proto-top { flex-direction:row; justify-content:space-between; align-items:baseline; gap:12px; }
.paper-story .compare .proto-name { font-size:26px; }
.paper-story .compare .proto-q { text-align:right; font-size:13px; max-width:none; }
.paper-story .compare .proto-art { margin:18px 0 16px; aspect-ratio:16/9; background:var(--paper-2); border-radius:18px; }
.paper-story .compare .proto-like { font:600 12px/1.3 var(--mono); letter-spacing:.06em; text-transform:uppercase; }
.paper-story .compare .proto-text { margin-top:8px; font-size:16px; line-height:1.45; }
.paper-story .compare .proto-pair { margin-top:auto; padding-top:18px; }
.paper-story .compare .scale .proto-a4a { background:var(--accent-soft); border-color:var(--line-strong); grid-column:auto; }
.paper-story .compare .proto-a4a .proto-art { background:var(--card); }
.paper-story .compare .compare-foot { margin-top:clamp(36px,4vw,52px); padding-top:0; border-top:0; }
.paper-story .compare .split-head h2 { max-width:15em; }

@media (max-width:1100px) {
  .paper-story .compare .scale { grid-template-columns:1fr 1fr; }
  .paper-story .compare .scale .proto-a4a { grid-column:1/-1; }
  .paper-story .compare .proto-a4a .proto-art { aspect-ratio:21/9; }
}
@media (max-width:700px) {
  .paper-story :is(.how,.night,.start,.final) { padding-top:72px; }
  .paper-story :is(.how,.night,.start,.final)::before { top:-24px; height:32px; background-size:100% 32px; }
  .paper-story.daylight-story .how .routes { gap:20px; }
  .paper-story.daylight-story .feat-showcase + .feat-showcase { border-top:1px solid var(--line); }
  .paper-story .compare { padding-block:72px; }
  .paper-story .compare .scale { grid-template-columns:minmax(0,1fr); gap:14px; }
  .paper-story .compare .scale .proto { padding:20px 18px 18px; border-radius:20px; }
  .paper-story .compare .scale .proto-a4a { grid-column:auto; }
  .paper-story .compare .proto-a4a .proto-art { aspect-ratio:16/9; }
  .paper-story .compare .proto-text { font-size:15.5px; }
}
@media (forced-colors:active) {
  .paper-story :is(.how,.night,.start,.final)::before { display:none; }
  .paper-story :is(.how,.night,.start,.final) { background:Canvas; border-top:1px solid CanvasText; }
}

/* City and speaker stay together below their own painted workspace.
   Offsets follow the actual panorama's opaque lower contours, not equal rows. */
.paper-story .team-art { max-width:1180px; margin-inline:auto; container-type:inline-size; }
.paper-story .team-art figcaption { margin-top:0; }
.paper-story .team-art .team-talk { margin-top:0; gap:24px; align-items:start; }
.paper-story .team-art .team-msg { margin-top:16px; }
.paper-story .team-art .team-msg:first-child { margin-top:calc(16px - 6.1cqw); }
.paper-story .team-art .team-msg:nth-child(2) { margin-top:calc(16px - 1.3cqw); }
.paper-story .team-art .team-msg:last-child { margin-top:calc(16px - 13.1cqw); }
.paper-story .team-art .team-where { color:var(--ink); font-weight:600; }
.paper-story #net .split-head { grid-template-columns:minmax(0,1fr); }

/* Only the night story gets a second quiet field. Original hero code is intact. */
.paper-story .night {
  isolation:isolate;
  background:radial-gradient(ellipse 46% 42% at 75% 54%,#243A73,transparent 90%),#0D111B;
}
.paper-story .night > .wrap { position:relative; z-index:2; }
.paper-story .night-sky { position:absolute; inset:0; width:100%; height:100%; overflow:hidden; z-index:0; pointer-events:none; }
.paper-story .night-points { fill:#9FB5FF; opacity:.5; }
.paper-story .night-packets path { fill:none; stroke-width:1.2; stroke-linecap:round; }
.paper-story .night-packets circle { fill:#E7EEFF; stroke:#A7BFFF; stroke-width:.4; }
@media (max-width:700px) {
  /* Preserve readable chronological dialogue on narrow screens, without overlap. */
  .paper-story .team-art .team-talk { margin-top:16px; gap:14px; }
  .paper-story .team-art .team-msg:nth-child(n) { margin-top:0; }
  .paper-story .night { background:radial-gradient(ellipse 95% 45% at 55% 72%,#243A73,transparent 90%),#0D111B; }
}
@media (prefers-reduced-motion:reduce) { .paper-story .night-packets { display:none; } }
@media (forced-colors:active) {
  .paper-story .night-sky { display:none; }
  .paper-story .night { background:Canvas; }
}

/* Scenario selection stays inside the light diagram area, at its upper right. */
.paper-story #how .how-head { display:block; }
.paper-story #how .how-switch { width:max-content; max-width:100%; margin-inline-start:auto; }
.paper-story #how .how-switch:not([hidden]) { display:flex; }
.paper-story #how .how-heading-copy { min-width:0; }
.paper-story #how:has(.how-switch:not([hidden])) .how-fallback-title { display:none; }
.paper-story #how .how-own { margin-top:22px; }
.paper-story #how .route-title {
  display:inline-flex; align-self:center; padding:6px 10px; border-radius:6px;
  font:700 18px/1.35 "Manrope",sans-serif; letter-spacing:0; text-transform:none;
}
.paper-story #how .route-manual .route-title { color:var(--ink); background:var(--paper-2); }
.paper-story #how .route-direct .route-title { color:var(--accent-ink); background:var(--accent-soft); }
@media (max-width:700px) {
  .paper-story #how .how-switch button { padding-inline:16px; }
}
@media (min-width:701px) {
  .paper-story #how .how-scenarios { display:flow-root; }
  .paper-story #how .how-switch:not([hidden]) { float:right; margin-inline-start:24px; margin-bottom:12px; }
  .paper-story #how .how-scenarios:has(.how-switch:not([hidden])) .how-panel { margin-top:0; }
}


/* Network explanations share one collapsed group below the delivery diagram. */
.paper-story #net .network-more { margin-top:32px; }
@media (max-width:700px) {
  /* Keep the labels and avatars readable; remove unused vertical space. */
  .paper-story #how .how-scenarios { padding-block:16px 20px; }
  .paper-story #how .how-panel { margin-top:16px; }
  .paper-story.daylight-story #how .routes { margin-top:24px; gap:24px; }
  .paper-story.daylight-story #how .route { padding:8px 4px 12px; }
  .paper-story #how .team-topology { height:224px; }
  .paper-story #how .own-topology { height:288px; }
  .paper-story #how .route-note { margin-top:16px; }
  .paper-story #how .own-requirements { margin-top:16px; }
  .paper-story #net .network-more { margin-top:24px; }
  .paper-story #net .acks { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
  .paper-story #net .acks li { min-width:0; padding:8px 12px; }
}
