.ref-gallery{position:relative;height:270svh;margin-top:24px;color:#303238}
.ref-gallery-sticky{position:sticky;top:0;height:100svh;height:100dvh;min-height:600px;overflow:hidden;isolation:isolate;clip-path:inset(22% 30% round 44px)}
.ref-gallery-surface{position:absolute;inset:0;z-index:-1}
/* The following chapters share the reference gallery canvas. */
.ref-gallery-surface,.ref-gallery + .landing-panel.hub-story{background-color:#f8f5cf;background-image:linear-gradient(#ffffff70 1px,transparent 1px),linear-gradient(90deg,#ffffff70 1px,transparent 1px);background-size:48px 48px}
.ref-gallery-copy{position:relative;text-align:center;padding:clamp(32px,6svh,70px) 24px 0;max-width:800px;margin:auto}
.ref-gallery-label{font-size:12px;letter-spacing:.16em;color:#626771}
.ref-gallery-copy h2{font-size:clamp(32px,3.8vw,56px);font-weight:450;line-height:1.08;letter-spacing:-.04em;margin:20px 0}
.ref-gallery-copy h2 em{font-family:'Playfair Display',Georgia,serif;font-weight:500}
.ref-gallery-copy p{font-size:clamp(14px,1.3vw,17px);line-height:1.6;max-width:660px;margin:0 auto 14px;color:#626771}
.ref-gallery-tag{font-size:12px;color:#626771}
.ref-gallery-cards{position:absolute;inset:0;pointer-events:none}
.ref-gallery-card{position:absolute;left:50%;top:74%;width:clamp(140px,16vw,240px);aspect-ratio:3/4;margin:0;padding:9px 9px 28px;background:#fff;border-radius:24px;box-shadow:0 12px 30px #32455b18;transform:translate(-50%,-50%)}
.ref-gallery-card img{display:block;width:100%;height:100%;object-fit:cover;border-radius:16px}
@media(max-width:700px){.ref-gallery{height:290svh}.ref-gallery-sticky{min-height:540px}.ref-gallery-copy{padding:32px 22px 0}.ref-gallery-copy h2{font-size:34px;margin:15px 0}.ref-gallery-card{width:42vw;max-width:185px;top:78%;padding:6px 6px 20px;border-radius:19px}.ref-gallery-card img{border-radius:13px}.ref-gallery-tag{font-size:11px}}
@media(prefers-reduced-motion:reduce){.ref-gallery{height:auto}.ref-gallery-sticky{position:relative;height:auto;min-height:0;padding-bottom:32px;clip-path:none!important}.ref-gallery-surface{clip-path:none!important}.ref-gallery-cards{position:relative;display:flex;overflow-x:auto;gap:16px;padding:28px 24px;pointer-events:auto}.ref-gallery-card{position:relative;left:auto;top:auto;flex:0 0 180px;transform:none!important}}

.ref-gallery-sticky{clip-path:none}
.ref-gallery-scene{position:absolute;inset:0;isolation:isolate;overflow:hidden;border-radius:44px;transform:scale(.55);opacity:0;transform-origin:center}
.ref-gallery-question{position:absolute;inset:0;display:grid;place-items:center;padding:28px;z-index:2;pointer-events:none}
.ref-message-stack{display:flex;flex-direction:column;gap:30px;width:min(760px,100%);padding:12px}
.ref-message{position:relative;align-self:flex-start;width:min(620px,94%);margin:0;padding:24px 30px;border-radius:30px 30px 30px 8px;background:#fbffbd;color:#303238;box-shadow:0 8px 24px #3032380c;font-size:clamp(21px,2.5vw,34px);line-height:1.35;letter-spacing:-.025em;opacity:0;transform:translateY(36px)}
.ref-message:after{content:'';position:absolute;left:0;bottom:-12px;width:22px;height:24px;background:#fbffbd;clip-path:polygon(0 0,100% 0,0 100%)}
.ref-message:nth-child(2){align-self:flex-end}
@media(max-width:700px){.ref-gallery-question{padding:20px}.ref-message-stack{padding:0;gap:28px}.ref-message{padding:20px 22px;border-radius:25px 25px 25px 8px;font-size:23px}}
@media(prefers-reduced-motion:reduce){.ref-gallery-question{display:none!important}.ref-gallery-scene{position:relative;transform:none!important;opacity:1!important;border-radius:28px}.ref-gallery-sticky{padding-bottom:0}}

.ref-message:nth-child(2){border-radius:30px 30px 8px 30px}
.ref-message:nth-child(2):after{left:auto;right:0;clip-path:polygon(0 0,100% 0,100% 100%)}
@media(max-width:700px){.ref-message:nth-child(2){border-radius:25px 25px 8px 25px}}

.ref-gallery-copy>*{opacity:0}
@media(prefers-reduced-motion:reduce){.ref-gallery-copy>*{opacity:1!important;transform:none!important}}

/* Start the conversation near the previous section, before the stage pins. */
.ref-gallery{margin-top:0}
.ref-gallery-question{align-items:start;padding-top:clamp(32px,8svh,80px)}

.ref-folder-intro{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;opacity:0;z-index:1;padding:32px}
.ref-folder-object{position:relative;width:min(340px,80vw);height:min(350px,65svh);padding-top:66px;isolation:isolate}
.ref-folder-object:before{content:'';position:absolute;inset:24px 0 0;background:#dfb9ce;border-radius:0 32px 32px 32px;z-index:-2}
.ref-folder-object:after{content:'';position:absolute;top:6px;left:0;width:48%;height:45px;background:#dfb9ce;border-radius:24px 24px 0 0;z-index:-2}
.ref-folder-paper{position:absolute;top:37px;left:6%;width:88%;height:180px;background:white;padding:8px;border-radius:22px;transform:rotate(-3deg);z-index:-1}
.ref-folder-paper img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 25%;border-radius:15px}
.ref-folder-face{height:100%;display:flex;flex-direction:column;align-items:flex-start;padding:28px;background:linear-gradient(140deg,#ffffff80,transparent),#f5e1eb;border:1px solid white;border-radius:30px;box-shadow:0 18px 32px #3032380c;color:#303238}
.ref-folder-symbol{font-size:32px;margin-bottom:auto}
.ref-folder-face strong{font-size:26px;line-height:1.2;letter-spacing:-.035em;font-weight:550;margin-bottom:12px}
.ref-folder-face>span:last-child{font-size:16px;color:#626771}
@media(prefers-reduced-motion:reduce){.ref-folder-intro{display:none}}

.ref-folder-face{transform-origin:center bottom}
.ref-folder-cursor{position:absolute;left:72%;top:61%;width:42px;height:56px;z-index:5;opacity:0;transform-origin:5px 3px;pointer-events:none;filter:drop-shadow(0 3px 2px #19426018)}
.ref-folder-cursor svg{display:block;width:100%;height:100%}
.ref-folder-cursor i{position:absolute;left:-13px;top:-14px;width:32px;height:32px;border:2px solid #32b5f5;border-radius:50%;opacity:0}
@media(prefers-reduced-motion:reduce){.ref-folder-cursor{display:none}}

.ref-gallery-scene{overflow:visible}
.ref-gallery-surface{transform-origin:center;overflow:hidden}
@media(prefers-reduced-motion:reduce){.ref-gallery-surface{transform:none!important}}
/* Match the folder photo to the gallery card, including its image crop. */
.ref-folder-paper{width:clamp(140px,16vw,240px);height:auto;aspect-ratio:3/4;left:50%;margin-left:calc(clamp(140px,16vw,240px) / -2);padding:9px 9px 28px;border-radius:24px}
.ref-folder-paper img{object-position:center;border-radius:16px}
@media(max-width:700px){.ref-folder-paper{width:min(42vw,185px);margin-left:calc(min(42vw,185px) / -2);padding:6px 6px 20px;border-radius:19px}.ref-folder-paper img{border-radius:13px}}

@media(max-width:700px){.ref-gallery-card{width:54vw;max-width:240px}.ref-folder-paper{width:min(54vw,240px);margin-left:calc(min(54vw,240px) / -2)}}
@media(prefers-reduced-motion:reduce){.ref-gallery-card{filter:none!important}}
.ref-folder-cursor{width:28px;height:38px}
.ref-folder-cursor i{left:-9px;top:-10px;width:23px;height:23px}

.ref-message strong{font-weight:700}
.ref-message em{font-style:italic}

/* Compact conversation bubbles on desktop. */
@media(min-width:701px){
  .ref-message-stack{width:min(650px,100%);gap:24px}
  .ref-message{width:min(520px,94%);padding:18px 24px;font-size:clamp(21px,1.8vw,26px);border-radius:24px 24px 24px 8px}
  .ref-message:nth-child(2){border-radius:24px 24px 8px 24px}
  .ref-message:after{width:18px;height:20px;bottom:-10px}
}

/* A scalloped edge carries the gallery paper into the moving sky. */
.ref-gallery + .landing-panel.hub-story{margin-top:0;border-radius:0}
.ref-gallery + .hub-story + .lumi-cloud-continuum{position:relative}
.ref-gallery + .hub-story + .lumi-cloud-continuum:before{
  content:'';position:absolute;inset:0 0 auto;height:44px;z-index:0;pointer-events:none;
  background-color:#f8f5cf;
  background-image:linear-gradient(90deg,#ffffff70 1px,transparent 1px);
  background-size:48px 48px;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 44'%3E%3Cpath d='M0 0H120V4A60 38 0 0 1 0 4Z'/%3E%3C/svg%3E") repeat-x top left / 120px 44px;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 44'%3E%3Cpath d='M0 0H120V4A60 38 0 0 1 0 4Z'/%3E%3C/svg%3E") repeat-x top left / 120px 44px;
}
@media(max-width:700px){
  .ref-gallery + .hub-story + .lumi-cloud-continuum:before{height:28px;-webkit-mask-size:80px 28px;mask-size:80px 28px}
}

/* Scroll-drawn ribbon sits behind the conversation, never over its text. */
.ref-message-ribbon{position:absolute;inset:0;width:100%;height:min(800px,100%);pointer-events:none;overflow:visible}
.ref-message-ribbon path{fill:none;stroke:#e5dced;stroke-width:34;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1}
.ref-message-stack{position:relative;z-index:1}
@media(max-width:700px){.ref-message-ribbon{height:100%}.ref-message-ribbon path{stroke-width:46}}
@media(prefers-reduced-motion:reduce){.ref-message-ribbon{display:none}}

/* The ribbon remains visible until the folder opens. */
.ref-message-ribbon{height:100%;z-index:0}
.ref-folder-object:before,.ref-folder-object:after{background:#e5dced}
.ref-folder-face{background:#e5dced}

/* Overlap the paper edge by one pixel to hide the sky at the join. */
.ref-gallery + .landing-panel.hub-story{position:relative;z-index:1}
.ref-gallery + .landing-panel.hub-story:after{content:'';position:absolute;left:0;right:0;bottom:-1px;height:2px;pointer-events:none;background-color:#f8f5cf;background-image:linear-gradient(90deg,#ffffff70 1px,transparent 1px);background-size:48px 48px}

/* Smaller screens get their own path in pixel coordinates, without SVG stretching. */
@media(min-width:701px) and (max-width:1100px){.ref-message-ribbon path{stroke-width:26px}}
@media(max-width:700px){.ref-message-ribbon path{stroke-width:18px}}

/* Keep the rotated photo inside the closed folder, including short screens. */
.ref-folder-paper{max-height:calc(100% - 64px);overflow:hidden;box-sizing:border-box}
