/* 路燈橘光招牌（11/16 本人選）：589nm＝鈉燈路燈的波長。首頁與內頁共用；音樂室、讀書室不載入。
   ① 按鈕的圓形箭頭＝燈泡：滑過／按下像鈉燈暖機（暗紅→橘、發光），按下有橘光暈開
   ② 換頁像走過路燈：暗下再亮起
   ③ 展廳門與首頁展廳上方一盞燈，捲到才亮 */
:root{--sodium:#e4702e;--sodium-hot:#ff8a45;--sodium-cold:#6e2416}

/* 鈉燈暖機：剛開是暗紅，閃一下，慢慢變成橘色 */
@keyframes sodium-warm{
  0%{background:var(--sodium-cold);box-shadow:0 0 0 rgba(228,112,46,0);color:#f2ede3}
  18%{background:#a83a22;box-shadow:0 0 10px rgba(200,70,40,.5)}
  26%{background:#5a1d12;box-shadow:none}
  40%{background:#c9582c;box-shadow:0 0 16px rgba(220,100,50,.55)}
  100%{background:var(--sodium);box-shadow:0 0 18px rgba(228,112,46,.75),0 0 48px rgba(228,112,46,.35);color:#120a04}
}

/* ① 燈泡：各種主按鈕的圓形箭頭 */
.button-link::after,.close-cta .ico,.room-go .ico,.door .door-go [aria-hidden]{position:relative}
@media (hover:hover){
  body.inner .button-link:hover::after,
  .close-cta:hover .ico,.room-copy:hover .room-go .ico,
  body.inner .door:hover .door-go [aria-hidden]{animation:sodium-warm .9s cubic-bezier(.3,.7,.2,1) forwards}
}
body.inner .button-link:active::after,.close-cta:active .ico,.room-copy:active .room-go .ico,body.inner .door-main:active .door-go [aria-hidden]{background:var(--sodium-hot);color:#120a04;box-shadow:0 0 22px rgba(255,138,69,.9),0 0 70px rgba(228,112,46,.5)}
body.inner .button-link:focus-visible::after,.close-cta:focus-visible .ico{background:var(--sodium);color:#120a04}

/* 主／次分清楚：次按鈕（玻璃）左邊一顆沒開的小燈，滑過才亮 */
body.inner .text-link,body.inner .doors404 li:not(:first-child) a,body.inner .door-sub,.room-sub{gap:10px}
body.inner .text-link::before,body.inner .doors404 li:not(:first-child) a::before,body.inner .door-sub::before,.room-sub::before{content:"";flex:0 0 auto;width:7px;height:7px;border-radius:50%;background:rgba(242,237,227,.28);transition:background .3s,box-shadow .3s}
@media (hover:hover){
  body.inner .text-link:hover::before,body.inner .doors404 li:not(:first-child) a:hover::before,body.inner .door-sub:hover::before,.room-sub:hover::before{background:var(--sodium);box-shadow:0 0 10px var(--sodium)}
}
body.inner .text-link:active::before,body.inner .door-sub:active::before,.room-sub:active::before,body.inner .doors404 a:active::before{background:var(--sodium-hot);box-shadow:0 0 12px var(--sodium-hot)}

/* 按下去的橘光暈開（lamp.js 在按的位置放一顆） */
.lamp-burst{position:absolute;left:0;top:0;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:50%;pointer-events:none;z-index:0;
  background:radial-gradient(circle,rgba(255,138,69,.55),rgba(228,112,46,.18) 45%,transparent 70%);animation:lamp-burst .7s cubic-bezier(.2,.7,.2,1) forwards}
@keyframes lamp-burst{from{transform:scale(1);opacity:1}to{transform:scale(var(--burst,22));opacity:0}}
.lamp-host{position:relative;overflow:hidden;isolation:isolate}
.lamp-host>*{position:relative;z-index:1}

/* ③ 門上方的燈：燈頭＋往下的光錐，捲到才暖機亮起 */
body.inner .door::before,.room-frame::before{content:"";position:absolute;left:50%;top:0;width:min(78%,560px);height:min(70%,520px);transform:translateX(-50%);pointer-events:none;z-index:-1;opacity:0;
  background:radial-gradient(50% 100% at 50% 0%,rgba(255,128,60,.42),rgba(228,112,46,.12) 45%,transparent 75%);mix-blend-mode:screen}
.room-frame::before{z-index:2;height:min(60%,480px)}
body.inner .door .lamp-head,.room-frame .lamp-head{position:absolute;left:50%;top:0;z-index:2;width:64px;height:5px;margin-left:-32px;border-radius:0 0 6px 6px;background:#2a2622;box-shadow:inset 0 -2px 0 #55331d;transition:background .4s,box-shadow .4s}
.is-lit::before{animation:lamp-cone 1.6s ease-out forwards}
.is-lit .lamp-head{background:var(--sodium-hot);box-shadow:0 0 14px var(--sodium),0 6px 30px rgba(228,112,46,.6);animation:lamp-head 1.6s ease-out}
@keyframes lamp-cone{0%{opacity:0;filter:hue-rotate(-18deg) saturate(1.4)}14%{opacity:.6}22%{opacity:.08}36%{opacity:.75}100%{opacity:1;filter:none}}
@keyframes lamp-head{0%{background:var(--sodium-cold);box-shadow:none}14%{background:#c44a2a}22%{background:#3a1a10;box-shadow:none}36%{background:#d9662f}100%{background:var(--sodium-hot)}}

/* ② 換頁：走過一盞路燈，舊頁暗下，新頁從暖光亮起（支援的瀏覽器才有，不支援就是一般換頁） */
@view-transition{navigation:auto}
::view-transition-old(root){animation:vt-out .32s cubic-bezier(.4,0,1,1) both}
::view-transition-new(root){animation:vt-in .55s cubic-bezier(.1,.7,.2,1) both}
@keyframes vt-out{to{opacity:0;filter:brightness(.35) sepia(.6) saturate(2) hue-rotate(-12deg)}}
@keyframes vt-in{from{opacity:0;filter:brightness(1.6) sepia(.8) saturate(1.6) hue-rotate(-14deg)}}

/* 減少動態：全部改成直接亮著，不閃 */
@media (prefers-reduced-motion:reduce){
  @view-transition{navigation:none}
  .button-link::after,.close-cta .ico,.room-go .ico,.door .door-go [aria-hidden],.is-lit::before,.is-lit .lamp-head{animation:none!important}
  .is-lit::before{opacity:1}
  .lamp-burst{display:none}
}
html.motion-off .is-lit::before,html.motion-off .is-lit .lamp-head,html.motion-off .close-cta .ico,html.motion-off .room-go .ico{animation:none!important}
html.motion-off .is-lit::before{opacity:1}
html.motion-off .lamp-burst{display:none}
.room-sub.lamp-host,.door-sub.lamp-host{position:absolute}
/* 光錐加強（第一版太淡看不出來） */
body.inner .door::before,.room-frame::before{background:radial-gradient(42% 100% at 50% 0%,rgba(255,130,64,.78),rgba(228,112,46,.28) 38%,rgba(228,112,46,.06) 62%,transparent 80%)}
body.inner .door .lamp-head,.room-frame .lamp-head{width:92px;height:7px;margin-left:-46px}
.is-lit .lamp-head{box-shadow:0 0 18px var(--sodium-hot),0 0 40px var(--sodium),0 10px 60px rgba(228,112,46,.7)}
body.inner .door.is-lit .lamp-head,.room-frame.is-lit .lamp-head{background:var(--sodium-hot);box-shadow:0 0 18px var(--sodium-hot),0 0 40px var(--sodium),0 10px 60px rgba(228,112,46,.7)}
