/* Local exploration: the original words and section order, with spatial project cards. */
.gallery-spatial .gallery-frame{padding-bottom:90px}
.gallery-spatial .gallery-heading{align-items:center}
.gallery-spatial .gallery-window{overflow:visible;background:transparent;border-radius:0;box-shadow:none;perspective:1500px;isolation:isolate}
.gallery-spatial .gallery-track{display:block;transform:none!important;position:relative;transform-style:preserve-3d}
.gallery-spatial .gallery-panel{position:absolute;inset:0;width:100%;height:100%;overflow:visible;background:transparent;color:var(--ink);pointer-events:none;isolation:auto}
.gallery-spatial .spatial-card{position:absolute;left:0;top:0;width:65%;height:86%;min-height:0;overflow:hidden;isolation:isolate;border:1px solid #ffffffc9;border-radius:28px;background:#25303a;box-shadow:inset 0 1px 2px #ffffff9c,0 18px 60px #31415c26,0 0 0 1px #798aa62b;transform-origin:center;will-change:transform,opacity;backface-visibility:hidden;color:#fff}
.gallery-spatial .spatial-card:after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 0 1px #e0eeff36;background:linear-gradient(125deg,#d6e5ff15,transparent 28%,transparent 75%,#e3cce41a)}
.gallery-spatial .gallery-image img{padding:0;object-fit:cover;object-position:center;transform:scale(1.015);filter:saturate(.9)}
.gallery-spatial .gallery-origin .gallery-image img{object-fit:cover;object-position:center 48%;background:#a9b1b1}
.gallery-spatial .gallery-shade{background:linear-gradient(180deg,#050d208c,transparent 38%,transparent 64%,#091121b8)}
.gallery-spatial .gallery-panel-top{top:26px;left:28px;right:68px;display:block}
.gallery-spatial .gallery-panel-top>span:first-child{display:block;font-size:clamp(23px,2.4vw,36px);letter-spacing:-.035em;line-height:1.2}
.gallery-spatial .gallery-panel-top>span:last-child{display:block;font-size:9px;line-height:1.6;letter-spacing:.11em;text-align:left;margin-top:8px;opacity:.84}
.gallery-spatial .gallery-credit{left:28px;right:26px;bottom:23px;max-width:none;font-size:10px;opacity:.9;letter-spacing:.06em}
.spatial-card-open{position:absolute;inset:0;z-index:4;background:transparent;color:#eef4ff;border:0;border-radius:inherit;pointer-events:none}
.spatial-card-open>span{position:absolute;right:20px;top:22px;display:grid;place-items:center;width:32px;height:32px;border:1px solid #dbe7ff77;border-radius:50%;font-size:19px;background:#0a142738;backdrop-filter:blur(12px)}
.gallery-spatial .gallery-panel[aria-hidden="false"] .spatial-card-open{pointer-events:auto}
.spatial-card-open:hover>span{background:#142238b3;color:#fff}
.gallery-spatial .gallery-copy{left:0;top:50%;bottom:auto;width:27%;max-width:340px;display:block;transform:translateY(-50%);opacity:var(--copy-opacity,1);pointer-events:none}
.gallery-spatial .gallery-copy h3{font-size:clamp(29px,3.25vw,52px);line-height:1.08;letter-spacing:-.048em;font-weight:400;margin:0 0 22px;white-space:pre-line}
.gallery-spatial .gallery-copy>p{font-size:14px;line-height:1.75;max-width:none;opacity:1;color:var(--muted)}
.gallery-spatial .gallery-actions{display:flex;flex-wrap:wrap;gap:10px 19px;margin-top:24px}
.gallery-spatial .gallery-visit{min-height:44px;font-size:12px;padding:10px 17px;color:var(--ink);border-color:#8090a94a;background:var(--glass-surface);box-shadow:var(--glass-shadow)}
.gallery-spatial .gallery-project{min-height:44px;font-size:12px;border-color:#64708b66;color:var(--ink)}
.gallery-spatial .gallery-panel[aria-hidden="false"] .gallery-copy a,.gallery-spatial .gallery-panel[aria-hidden="false"] .gallery-copy button{pointer-events:auto}
.gallery-spatial .gallery-bottom{margin-top:12px;padding-bottom:0;position:relative;z-index:5}
html[lang="zh-HK"] .gallery-spatial .gallery-copy h3{font-size:clamp(27px,2.6vw,40px);line-height:1.27;letter-spacing:0}
html[lang="zh-HK"] .gallery-spatial .gallery-copy>p{font-size:14px;line-height:1.85}
html[data-theme="dark"] .gallery-spatial{background:radial-gradient(ellipse at 48% 38%,#465c7926,transparent 65%),#080c1314}
html[data-theme="dark"] .gallery-spatial .gallery-window{box-shadow:none;background:transparent}
html[data-theme="dark"] .gallery-spatial .spatial-card{border-color:#b9c8e082;box-shadow:inset 0 1px 2px #ffffff70,0 18px 65px #0005,0 0 28px #b2c9f013}
html[data-theme="dark"] .gallery-spatial .gallery-visit{color:#e1e7f3;border-color:#b8c6df62;background:var(--glass-surface)}
html[data-theme="dark"] .gallery-spatial .gallery-project{color:#e1e7f3;border-color:#c4d1e56b}
/* Both palettes retain fine orbital lines with enough contrast to read. */
html[data-theme="light"] .idea-orbit{opacity:.94}
html[data-theme="light"] .idea-ring{border-width:1.5px;border-color:#788aa6a8;box-shadow:0 0 35px #8aaec518,inset 0 0 30px #a6c6d218}
html[data-theme="light"] .idea-orbit:after{border-width:1.5px;border-color:#a18ba5a3;box-shadow:0 0 25px #b3a0c114}
html[data-theme="light"] .idea-orbit>span{color:#9584a5}
html[data-theme="light"] .idea-orbit i{filter:contrast(1.08) saturate(1.08);box-shadow:0 5px 18px #748a9b26}
html[data-theme="dark"] .idea-orbit{opacity:.96}
html[data-theme="dark"] .idea-ring{border-width:1.25px;border-color:#bbd6f28c;box-shadow:0 0 35px #90b9e82b,inset 0 0 32px #99c2f21f}
html[data-theme="dark"] .idea-orbit:after{border-width:1.25px;border-color:#d1bfe57d;box-shadow:0 0 18px #c4adea18}
html[data-theme="dark"] .idea-orbit>span{color:#c1cbe0bd}
html[data-theme="dark"] .idea-orbit i{filter:brightness(1.85);box-shadow:0 0 21px #a4c9f53d;isolation:isolate}
html[data-theme="dark"] .idea-orbit i:after{content:"";position:absolute;inset:2%;border-radius:50%;pointer-events:none;background:radial-gradient(ellipse at 25% 17%,#e7f4ff77,transparent 26%);box-shadow:inset 1px 1px 3px #d6e6ff4d}
.space-motion-toggle{display:none;position:fixed;left:24px;bottom:max(20px,env(safe-area-inset-bottom));z-index:40;min-height:44px;padding:8px 14px;gap:9px;align-items:center;border-radius:99px;color:#c2ccdf;background:linear-gradient(135deg,#29354a9c,#151a28b3);border:1px solid #b7c9e73b;backdrop-filter:blur(16px);font-size:11px;box-shadow:inset 0 1px 1px #f1f5ff24}
html[data-theme="dark"] .space-motion-toggle{display:flex}
.space-motion-toggle svg{width:16px;height:16px;flex:none}
.space-motion-toggle .motion-play,.space-motion-toggle[aria-pressed="true"] .motion-pause{display:none}
.space-motion-toggle[aria-pressed="true"] .motion-play{display:block}
.space-motion-toggle:hover{background:#090e1de8;color:#fff}
@media(max-width:1000px){.gallery-spatial .gallery-copy{width:30%}.gallery-spatial .gallery-copy h3{font-size:32px}.gallery-spatial .gallery-copy>p{font-size:13px}.gallery-spatial .gallery-visit{padding:9px 13px}}
@media(max-width:760px) and (orientation:portrait){
 .gallery-spatial .gallery-frame{min-height:0;padding:24px 24px 86px}
 .gallery-spatial .gallery-heading{display:block;margin-bottom:15px}
 .gallery-spatial .gallery-heading .eyebrow{font-size:9px;margin-bottom:6px}
 .gallery-spatial .gallery-heading h2{font-size:30px}
 .gallery-spatial .gallery-tabs{margin-top:14px;width:fit-content;max-width:100%}
 .gallery-spatial .gallery-tabs button{min-height:44px;padding:9px 18px;font-size:12px}
 .gallery-spatial .spatial-card{width:92%;height:42%;border-radius:22px}
 .gallery-spatial .gallery-panel-top{top:17px;left:18px;right:56px}
 .gallery-spatial .gallery-panel-top>span:first-child{font-size:22px}
 .gallery-spatial .gallery-panel-top>span:last-child{font-size:7px;letter-spacing:.07em;margin-top:5px}
 .gallery-spatial .gallery-credit{font-size:7px;left:18px;bottom:15px;right:18px}
 .spatial-card-open>span{right:14px;top:14px;width:30px;height:30px}
 .gallery-spatial .gallery-copy{top:47%;width:100%;max-width:none;transform:none}
 .gallery-spatial .gallery-copy h3{font-size:28px;line-height:1.08;margin-bottom:13px;white-space:normal;max-width:310px}
 .gallery-spatial .gallery-copy>p{font-size:12px;line-height:1.65}
 .gallery-spatial .gallery-actions{margin-top:14px;gap:17px;flex-wrap:nowrap}
 .gallery-spatial .gallery-visit,.gallery-spatial .gallery-project{font-size:11px;min-height:44px}
 .gallery-spatial .gallery-bottom{font-size:9px;margin-top:9px;gap:15px}
 html[lang="zh-HK"] .gallery-spatial .gallery-copy h3{font-size:26px;line-height:1.28;white-space:pre-line}
 html[lang="zh-HK"] .gallery-spatial .gallery-copy>p{font-size:12px;line-height:1.8}
 html[lang="zh-HK"] .gallery-spatial .gallery-heading h2{font-size:27px}
 .space-motion-toggle{left:auto;right:16px;bottom:calc(78px + env(safe-area-inset-bottom));width:44px;min-height:44px;padding:0;justify-content:center}
 .space-motion-toggle>span{display:none}
}
/* Short viewports use the same cards with direct tabs and normal page scrolling. */
@media(max-width:760px) and (max-height:700px) and (orientation:portrait){
 .gallery-spatial{height:auto!important}
 .gallery-spatial .gallery-frame{height:auto;position:relative;padding-bottom:90px}
 .gallery-spatial .gallery-window{height:510px;flex:none}
 .gallery-spatial .spatial-card{height:40%}
 .gallery-spatial .gallery-copy{top:46%}
 .gallery-spatial .gallery-tabs button{padding-inline:14px}
}
@media(max-height:500px) and (orientation:landscape){
 .gallery-spatial{height:auto!important}
 .gallery-spatial .gallery-frame{position:relative;min-height:460px;height:100svh;padding:18px 24px 76px}
 .gallery-spatial .gallery-heading{margin-bottom:12px;display:flex}
 .gallery-spatial .gallery-heading h2{font-size:27px}
 .gallery-spatial .gallery-tabs button{padding:8px 13px;font-size:11px}
 .gallery-spatial .gallery-copy{width:30%}
 .gallery-spatial .gallery-copy h3,html[lang="zh-HK"] .gallery-spatial .gallery-copy h3{font-size:24px;line-height:1.13;margin-bottom:12px}
 .gallery-spatial .gallery-copy>p,html[lang="zh-HK"] .gallery-spatial .gallery-copy>p{font-size:11px;line-height:1.5}
 .gallery-spatial .gallery-actions{margin-top:10px;gap:4px 15px}
 .gallery-spatial .gallery-visit,.gallery-spatial .gallery-project{font-size:10px}
 .gallery-spatial .gallery-panel-top{top:16px;left:18px;right:52px}
 .gallery-spatial .gallery-panel-top>span:first-child{font-size:23px}
 .gallery-spatial .gallery-panel-top>span:last-child,.gallery-spatial .gallery-credit{font-size:7px}
 .space-motion-toggle{left:auto;right:16px;bottom:14px;width:44px;padding:0;justify-content:center}.space-motion-toggle>span{display:none}
}
@media(prefers-reduced-motion:reduce){.gallery-spatial{height:auto!important}.gallery-spatial .gallery-frame{position:relative}.gallery-spatial .spatial-card{will-change:auto}.space-motion-toggle{display:none!important}}
html:not(.js) .gallery-spatial{height:auto}html:not(.js) .gallery-spatial .gallery-frame{height:auto;position:relative}html:not(.js) .gallery-spatial .gallery-window{overflow:visible}html:not(.js) .gallery-spatial .gallery-panel{position:relative;height:760px;margin-bottom:40px}html:not(.js) .gallery-spatial .spatial-card{left:34%;top:7%}html:not(.js) .gallery-spatial .gallery-copy{opacity:1}

/* Avoid stacked, unpositioned cards while deferred scripts initialise. */
html.js .gallery-spatial .gallery-panel:not([aria-hidden]){visibility:hidden}
