/* The scene stays inside the existing archive main and adds no document height. */
.archive-empty { position:relative; overflow:hidden; }
.archive-scene { position:absolute; inset:0; display:grid; place-items:center; isolation:isolate; perspective:1100px; }
/* Decoration shares the existing cover dimensions; JS animates only transform/opacity. */
.archive-scene { --archive-cover-width:min(78vw,330px,42svh); --archive-cover-height:calc(var(--archive-cover-width) * 1.428571); }
.archive-aura { position:absolute; width:calc(var(--archive-cover-width) * 1.95); height:calc(var(--archive-cover-height) * 1.85); border-radius:50%; pointer-events:none; opacity:.55; background:radial-gradient(ellipse,rgba(193,241,219,.06) 12%,rgba(168,230,201,.32) 40%,rgba(195,241,220,.15) 59%,transparent 76%); filter:blur(28px); }
.archive-shadow { position:absolute; top:calc(50% + var(--archive-cover-height) / 2 - 4px); left:calc(50% - var(--archive-cover-width) * .35); width:calc(var(--archive-cover-width) * .7); height:20px; border-radius:50%; background:#777; opacity:.17; filter:blur(24px); pointer-events:none; transform-origin:center; }
.archive-sparkles { position:absolute; inset:0; pointer-events:none; }
.archive-sparkle { position:absolute; display:block; width:var(--size,6px); height:var(--size,6px); opacity:0; background:#b4e9d2; filter:drop-shadow(0 0 5px rgba(164,229,199,.6)); }
.archive-sparkle.star { clip-path:polygon(50% 0,55% 44%,100% 50%,55% 56%,50% 100%,45% 56%,0 50%,45% 44%); }
.archive-sparkle.dot { border-radius:50%; background:#d2f3e4; }
.archive-sparkle.diamond { clip-path:polygon(50% 0,85% 50%,50% 100%,15% 50%); }
.star-one { left:calc(50% - var(--archive-cover-width) * .66); top:calc(50% - var(--archive-cover-height) * .3); --size:22px; }
.star-two { left:calc(50% + var(--archive-cover-width) * .59); top:calc(50% - var(--archive-cover-height) * .42); --size:14px; }
.star-three { left:calc(50% + var(--archive-cover-width) * .62); top:calc(50% + var(--archive-cover-height) * .24); --size:10px; }
.dot-one { left:calc(50% - var(--archive-cover-width) * .6); top:calc(50% - var(--archive-cover-height) * .48); --size:5px; }
.dot-two { left:calc(50% + var(--archive-cover-width) * .65); top:calc(50% - var(--archive-cover-height) * .08); --size:6px; }
.dot-three { left:calc(50% - var(--archive-cover-width) * .72); top:calc(50% + var(--archive-cover-height) * .32); --size:6px; }
.dot-four { left:calc(50% + var(--archive-cover-width) * .6); top:calc(50% + var(--archive-cover-height) * .45); --size:4px; }
.diamond-one { left:calc(50% - var(--archive-cover-width) * .64); top:calc(50% + var(--archive-cover-height) * .03); --size:9px; }
.diamond-two { left:calc(50% + var(--archive-cover-width) * .72); top:calc(50% - var(--archive-cover-height) * .27); --size:12px; }
.archive-zine-float { position:relative; z-index:1; }
.archive-zine-control { --w:var(--archive-cover-width); --h:calc(var(--w) * 1.428571); --d:4px; display:block; width:var(--w); height:var(--h); position:relative; cursor:grab; touch-action:none; outline:none; }
.archive-zine-control:active { cursor:grabbing; }
.archive-zine-control:focus-visible:not([data-pointer-focus]) { outline:2px solid #82a592; outline-offset:10px; }
.archive-zine { width:100%; height:100%; position:relative; transform-style:preserve-3d; will-change:transform; }
.archive-zine-face { position:absolute; backface-visibility:hidden; }
.archive-zine-front,.archive-zine-back { inset:0; border:1px solid rgba(23,39,28,.4); background-size:cover; background-position:center; }
.archive-zine-front { background-image:url('/zine-3d/assets/front-with-sticker.webp'); transform:translateZ(calc(var(--d) / 2)); }
.archive-zine-back { background-image:url('/zine-3d/assets/back.webp'); transform:rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.archive-zine-front::before,.archive-zine-back::before { content:''; position:absolute; top:0; bottom:0; width:5px; background:linear-gradient(90deg,rgba(17,33,23,.43),rgba(232,242,217,.26),transparent); }
.archive-zine-front::before { left:0; }
.archive-zine-back::before { right:0; transform:scaleX(-1); }
.archive-zine-fold,.archive-zine-pages { width:var(--d); height:var(--h); top:0; left:calc((var(--w) - var(--d)) / 2); }
.archive-zine-fold { background:linear-gradient(90deg,#657966,#a8b99e 38%,#5b715c); transform:translateX(calc(var(--w) / -2)) rotateY(-90deg); }
.archive-zine-fold::before,.archive-zine-fold::after { content:''; position:absolute; left:-1px; width:6px; height:13px; border-radius:2px; background:linear-gradient(90deg,#657169,#e2e8de 35%,#a4ada6 75%,#59655d); box-shadow:0 0 1px rgba(0,0,0,.55); }
.archive-zine-fold::before { top:29%; }
.archive-zine-fold::after { top:68%; }
.archive-zine-pages { background:repeating-linear-gradient(0deg,#d6e1c7 0 2px,#9eaf96 2px 2.6px,#d5dec4 2.6px 4px); transform:translateX(calc(var(--w) / 2)) rotateY(90deg); }
.archive-zine-top,.archive-zine-bottom { width:var(--w); height:var(--d); left:0; top:calc((var(--h) - var(--d)) / 2); background:repeating-linear-gradient(90deg,#d8e3c9 0 3px,#9eaf96 3px 3.7px,#d8e3c9 3.7px 6px); }
.archive-zine-top { transform:translateY(calc(var(--h) / -2)) rotateX(90deg); }
.archive-zine-bottom { transform:translateY(calc(var(--h) / 2)) rotateX(-90deg); }
@media(max-width:600px) { .archive-zine-control { --d:3px; } }
@media(prefers-reduced-motion:reduce) { .archive-aura,.archive-sparkle,.archive-zine-float { animation:none; } .archive-zine { will-change:auto; } }
/* Mobile archive: title, cover, actions, then a static back link. */
@media(max-width:809.98px) {
 .archive-page { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto auto 1fr; align-content:start; justify-items:center; }
 .archive-page > .archive-header { display:contents; }
 .archive-page > .archive-header > h1 { grid-column:1; grid-row:1; padding:16px 24px 12px; justify-self:center; }
 .archive-page > .archive-header > .archive-flame { display:none; }
 .archive-page > .archive-empty { grid-column:1; grid-row:2; min-height:0; width:100%; padding:40px 0 12px; overflow:hidden; }
 .archive-page .archive-scene { position:relative; inset:auto; width:100%; }
 .archive-page .archive-scene { --archive-cover-width:min(66.3vw,280.5px,35.7svh); }
 .archive-page > .archive-header > .archive-back { grid-column:1; grid-row:4; justify-self:center; display:flex; align-items:center; justify-content:center; min-height:44px; margin:4px 0 24px; position:static; transform:none !important; }
 .archive-page > .archive-mobile-actions { grid-column:1; grid-row:3; display:flex; flex-direction:column; align-items:center; margin-top:16px; }
 .archive-page .archive-mobile-actions button { display:flex; align-items:center; justify-content:center; min-height:44px; padding:8px 24px; border:0; background:transparent; color:inherit; font:16px/1.2 "Instrument Serif",serif; }
 .archive-page > .archive-footer { grid-column:1; grid-row:5; align-self:end; width:100%; box-sizing:border-box; font-family:"UFO!","UFO! Placeholder",sans-serif; }
}

/* Arrival uses a separate transform from the interactive 3D rotation. */
@media(prefers-reduced-motion:no-preference) {
 .archive-zine-entering .archive-zine-control { opacity:0; transform:scale(.28); filter:blur(12px); }
}
/* Let the halo and floor shadow fade vertically instead of cutting them at the card edge. */
.archive-page > .archive-empty { overflow:clip visible; }
/* One reusable scene; fixed action slots prevent jumps between the two volumes. */
.archive-header h1 { grid-column:2; }
.archive-empty { --archive-cover-width:min(78vw,330px,42svh); --archive-cover-height:calc(var(--archive-cover-width) * 1.428571); display:grid; justify-items:center; align-content:center; }
.archive-scene { position:relative; inset:auto; width:100%; height:var(--archive-cover-height); }
.archive-page .archive-mobile-actions { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:88px; margin:28px 0 0; font:16px/1.2 "Instrument Serif",serif; }
.archive-page .archive-mobile-actions :is(button,a) { box-sizing:border-box; display:flex; align-items:center; justify-content:center; min-height:44px; padding:8px 24px; border:0; background:transparent; color:inherit; font:inherit; text-decoration:none; }
.archive-page .archive-empty > .archive-back { display:flex; align-items:center; justify-content:center; justify-self:center; min-height:44px; margin:4px 0 24px; position:static; transform:none !important; font:16px/1.2 "Instrument Serif",serif; }
.archive-selector { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); display:flex; justify-content:space-between; align-items:center; width:calc(35% + var(--archive-cover-width) * .65 + 83.2px); max-width:calc(100% - 48px); height:64px; pointer-events:none; z-index:3; }
.archive-arrow { position:relative; display:block; width:64px; height:64px; min-width:44px; min-height:44px; padding:0; border:0; background:transparent; color:#000; opacity:.7; cursor:pointer; pointer-events:auto; border-radius:18px; touch-action:manipulation; }
.archive-arrow svg { display:block; width:100%; height:100%; stroke:currentColor; stroke-width:1.4px; stroke-linecap:round; stroke-linejoin:round; }
.archive-arrow svg :is(rect,path) { vector-effect:non-scaling-stroke; }
.archive-arrow rect { fill:#fff; }
.archive-arrow-press { position:absolute; inset:2px; border-radius:16px; background:#888; opacity:0; pointer-events:none; }
.archive-arrow:focus-visible { outline:2px solid #111; outline-offset:5px; }
.archive-arrow[aria-disabled="true"] { cursor:default; }
.archive-volume-status { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media(min-width:1200px) { .archive-page .archive-empty > .archive-back { font-size:19px; } }
@media(max-width:809.98px) {
 .archive-page { grid-template-rows:auto auto auto auto auto 1fr; }
 .archive-page > .archive-header > h1 { grid-column:1; }
 .archive-page > .archive-empty { padding-bottom:0; align-content:start; --archive-cover-width:min(66.3vw,280.5px,35.7svh); }
 .archive-page .archive-scene { height:var(--archive-cover-height); }
 .archive-page .archive-mobile-actions { margin-top:28px; }
 .archive-page .archive-empty > .archive-selector { position:relative; inset:auto; transform:none; pointer-events:auto; width:var(--archive-cover-width); max-width:none; height:56px; margin:0 0 24px; }
 .archive-page .archive-arrow { width:56px; height:56px; }
 .archive-page > .archive-footer { grid-row:6; }
}
/* A bounded viewport; compress spacing first, then fit the unchanged cover ratio. */
.archive-page {
 --archive-viewport:100vh;
 --archive-actions-height:88px;
 --archive-action-gap:clamp(8px,calc(var(--archive-viewport) * .03318),28px);
 --archive-main-top:0px; --archive-back-height:0px; --archive-back-bottom:0px;
 --archive-back-top:0px; --archive-selector-height:0px; --archive-selector-bottom:0px;
 height:100vh; height:100dvh; min-height:0; overflow:hidden; contain:paint; box-sizing:border-box;
 display:flex; flex-direction:column; align-items:stretch;
}
@supports(height:100dvh) { .archive-page { --archive-viewport:100dvh; } }
.archive-page > .archive-header { flex:0 0 auto; height:clamp(52px,calc(var(--archive-viewport) * .09),76px); }
.archive-page > .archive-empty {
 --archive-base-width:min(78vw,330px,42vh);
 --archive-space-budget:calc(var(--archive-actions-height) + var(--archive-action-gap) + var(--archive-main-top) + var(--archive-back-height) + var(--archive-back-top) + var(--archive-back-bottom) + var(--archive-selector-height) + var(--archive-selector-bottom));
 --archive-fit-width:min(var(--archive-base-width),max(1px,calc((var(--archive-viewport) - 260px) * .7)));
 --archive-cover-width:var(--archive-fit-width);
 --archive-cover-height:calc(var(--archive-cover-width) * 1.428571);
 container-type:size; flex:1 1 0px; height:auto; min-height:0;
 display:flex; flex-direction:column; align-items:center; justify-content:center;
 box-sizing:border-box; width:100%; padding:var(--archive-main-top) 0 0;
}
@supports(height:1cqh) {
 .archive-page > .archive-empty { --archive-fit-width:min(var(--archive-base-width),max(1px,calc((100cqh - var(--archive-space-budget) + var(--archive-main-top) - 10px) * .7))); }
}
.archive-page .archive-scene {
 --archive-cover-width:var(--archive-fit-width);
 --archive-cover-height:calc(var(--archive-cover-width) * 1.428571);
 height:var(--archive-cover-height); flex:0 0 var(--archive-cover-height); min-height:0;
}
.archive-page .archive-mobile-actions { flex:0 0 var(--archive-actions-height); height:var(--archive-actions-height); min-height:var(--archive-actions-height); margin:var(--archive-action-gap) 0 0; }
.archive-page .archive-mobile-actions :is(button,a) { height:calc(var(--archive-actions-height) / 2); min-height:calc(var(--archive-actions-height) / 2); padding-block:0; }
.archive-action-line { display:flex; align-items:center; justify-content:center; height:calc(var(--archive-actions-height) / 2); flex:none; white-space:nowrap; }
.archive-page .archive-action-line :is(button,a) { padding-inline:8px; }
.archive-action-separator { padding-inline:8px; }
.archive-page .archive-mobile-actions [data-action] { transform-origin:center; }
.archive-page .archive-mobile-actions [data-action]:not([aria-disabled="true"]) { cursor:pointer; }
@media(hover:hover) and (prefers-reduced-motion:no-preference) {
 .archive-page .archive-mobile-actions [data-action] { transition:transform 160ms ease-out; }
 .archive-page .archive-mobile-actions [data-action]:hover { transform:scale(1.04); }
}
.archive-page > .archive-footer { flex:0 0 auto; padding-block:clamp(6px,calc(var(--archive-viewport) * .02844),24px); }
.archive-numbers { position:absolute; inset:0; z-index:0; pointer-events:none; user-select:none; --archive-number-color:var(--framer-link-hover-text-color,#ff33f8); }
.archive-bg-number { position:absolute; color:var(--archive-number-color); font-family:"Instrument Serif",serif; line-height:1; font-weight:400; opacity:0; pointer-events:none; }
.number-one { left:calc(50% - var(--archive-cover-width) * .72); top:calc(50% - var(--archive-cover-height) * .4); font-size:calc(var(--archive-cover-width) * .15); }
.number-two { left:calc(50% + var(--archive-cover-width) * .64); top:calc(50% - var(--archive-cover-height) * .04); font-size:calc(var(--archive-cover-width) * .114); }
.number-three { left:calc(50% - var(--archive-cover-width) * .68); top:calc(50% + var(--archive-cover-height) * .36); font-size:calc(var(--archive-cover-width) * .084); }
@media(max-width:809.98px) {
 .archive-page {
  --archive-main-top:clamp(8px,calc(var(--archive-viewport) * .0474),40px);
  --archive-back-height:44px; --archive-back-top:4px;
  --archive-back-bottom:clamp(8px,calc(var(--archive-viewport) * .02844),24px);
  --archive-selector-height:56px; --archive-selector-bottom:clamp(6px,calc(var(--archive-viewport) * .02844),24px);
 }
 .archive-page > .archive-header { display:contents; }
 .archive-page > .archive-header > h1 { flex:none; padding-top:clamp(6px,calc(var(--archive-viewport) * .01896),16px); padding-bottom:clamp(4px,calc(var(--archive-viewport) * .01422),12px); }
 .archive-page > .archive-empty { --archive-base-width:min(66.3vw,280.5px,35.7vh); justify-content:flex-start; }
 .archive-page .archive-empty > .archive-back { flex:0 0 var(--archive-back-height); height:var(--archive-back-height); min-height:var(--archive-back-height); margin:var(--archive-back-top) 0 var(--archive-back-bottom); }
 .archive-page .archive-empty > .archive-selector { flex:0 0 var(--archive-selector-height); height:var(--archive-selector-height); width:max(112px,var(--archive-cover-width)); margin:0 0 var(--archive-selector-bottom); }
}
@media(max-height:740px) {
 .archive-page { --archive-action-gap:12px; }
 .archive-page > .archive-footer { padding-block:8px; }
}
@media(max-width:809.98px) and (max-height:740px) {
 .archive-page { --archive-main-top:16px; --archive-back-bottom:12px; --archive-selector-bottom:12px; }
}
@media(max-height:420px) {
 .archive-page { --archive-action-gap:4px; }
 .archive-page > .archive-header { height:52px; }
 .archive-page > .archive-footer { padding-block:4px; }
}
@media(max-width:809.98px) and (max-height:420px) {
 .archive-page { --archive-main-top:4px; --archive-back-bottom:4px; --archive-selector-bottom:4px; --archive-selector-height:44px; }
 .archive-page .archive-arrow { width:44px; height:44px; }
 .archive-page > .archive-header > h1 { padding-block:4px; }
}
@media(max-height:300px) {
 .archive-page { --archive-actions-height:56px; }
 .archive-page .archive-mobile-actions { font-size:14px; }
 .archive-page > .archive-header { height:48px; }
 .archive-page > .archive-footer { padding-block:2px; }
}
@media(max-width:809.98px) and (max-height:300px) {
 .archive-page { --archive-back-height:28px; --archive-main-top:2px; --archive-back-top:2px; --archive-back-bottom:2px; --archive-selector-bottom:2px; }
 .archive-page .archive-empty > .archive-back { font-size:14px; }
 .archive-page > .archive-header > h1 { padding-block:2px; }
}
