html:has(body.experience){scroll-behavior:auto}
/* Walk-in-the-house experience. Loaded after site.css and overrides layout only. */

body.experience{
  padding-top:0;
  padding-bottom:0;
  background:#07080d;
  overflow-x:hidden;
}

body.experience .nav{
  background:rgba(10,8,7,.88);
  border-bottom:1px solid rgba(244,236,226,.22);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}
body.experience .wordmark{
  color:#f7f0e6;
  text-shadow:0 1px 14px rgba(0,0,0,.7);
}
body.experience .nav-links a{
  color:#efe6d8;
  text-shadow:0 1px 12px rgba(0,0,0,.65);
}
body.experience .nav-links a[aria-current="page"],
body.experience .nav-links a:hover{
  color:#fffaf3;
  border-bottom-color:#c9a36a;
}
body.experience .nav-consult{
  color:#e8c48a !important;
  border-color:rgba(232,196,138,.85) !important;
  background:rgba(20,16,12,.75);
  text-shadow:none;
}
body.experience .nav-consult:hover{
  background:rgba(201,163,106,.22);
  color:#f3d7a4 !important;
}

#experience{
  position:relative;
}
.viewport{
  position:sticky;
  top:0;
  height:100vh;
  width:100%;
  overflow:hidden;
  background:#07080d;
}
#stage{
  display:block;
  width:100%;
  height:100%;
  touch-action:none;
}
body.is-overview #stage{touch-action:none}

.intro-card{
  position:absolute;
  left:50%;
  top:calc(var(--nav-h, 64px) + clamp(1.4rem,6vh,3.6rem));
  transform:translateX(-50%);
  z-index:6;
  width:min(28rem, calc(100% - 2.4rem));
  text-align:center;
  pointer-events:none;
  opacity:0;
  transition:opacity .55s ease;
  text-shadow:0 2px 22px rgba(0,0,0,.7);
}
body.is-intro .intro-card{opacity:1}
body.is-intro .caption{opacity:0}
.intro-position{
  margin:0 0 .7rem;
  color:rgba(244,236,226,.92);
  font-size:clamp(.92rem,1.6vw,1.08rem);
  letter-spacing:.06em;
  line-height:1.55;
}
.intro-line{
  font-family:var(--serif);
  font-size:clamp(1.12rem,2.2vw,1.55rem);
  font-weight:600;
  letter-spacing:.02em;
  margin:0 0 .85rem;
  color:#f7f0e6;
}
.intro-links{
  margin:0 0 .85rem;
  font-size:.95rem;
  letter-spacing:.08em;
}
.intro-links a{
  pointer-events:auto;
  color:#f0e6d6;
  text-decoration:none;
  border-bottom:1px solid rgba(201,163,106,.9);
  padding:.12rem .08rem;
}
.intro-links a:hover{color:#fffaf3}
.intro-hint{
  margin:0;
  color:rgba(244,236,226,.84);
  font-size:.8rem;
  letter-spacing:.08em;
}

.scroll-track{
  display:none;
  height:0;
  pointer-events:none;
}

.caption{
  position:absolute;
  left:clamp(1.2rem,5vw,4rem);
  bottom:clamp(1.6rem,7vh,4.2rem);
  z-index:5;
  max-width:22rem;
  pointer-events:none;
  text-shadow:0 2px 24px rgba(0,0,0,.55);
}
.caption .eyebrow{
  min-height:1em;
}
.caption p{
  font-family:var(--serif);
  font-size:clamp(1.35rem,2.6vw,2.05rem);
  line-height:1.3;
  letter-spacing:.01em;
  margin:0;
  font-weight:600;
}

#hover-label{
  position:absolute;
  left:50%;
  top:calc(var(--nav-h) + 1.2rem);
  transform:translateX(-50%);
  z-index:6;
  margin:0;
  padding:.35rem .85rem;
  border-radius:999px;
  background:rgba(12,10,9,.62);
  border:1px solid rgba(244,236,226,.14);
  color:var(--ink);
  font-size:.78rem;
  letter-spacing:.12em;
  backdrop-filter:blur(8px);
  pointer-events:none;
}

.interact-hint{
  position:absolute;
  left:50%;
  bottom:clamp(1.2rem,5vh,2.8rem);
  transform:translateX(-50%);
  z-index:5;
  margin:0;
  color:rgba(244,236,226,.72);
  font-size:.84rem;
  letter-spacing:.08em;
  opacity:0;
  pointer-events:none;
  white-space:normal;
  text-align:center;
  max-width:min(36rem, calc(100% - 2rem));
}
body.is-ready:not(.is-intro) .interact-hint{opacity:1}
body.is-overview .interact-hint{opacity:1}
body.is-overview .caption{opacity:.9}

.scenes{
  display:none;
  position:absolute;
  left:50%;
  bottom:clamp(2.8rem,9vh,4.8rem);
  transform:translateX(-50%);
  z-index:7;
  gap:.5rem;
  flex-wrap:wrap;
  justify-content:center;
}
body.is-overview .scenes{display:flex}
body.is-overview .jumps{display:none}
body.is-overview .overview-tools{display:flex}

.overview-tools{
  display:none;
  position:absolute;
  right:clamp(1rem,3vw,2.2rem);
  top:calc(var(--nav-h, 4.2rem) + 1.1rem);
  z-index:8;
  flex-direction:column;
  gap:.85rem;
  width:min(17.5rem, 42vw);
  pointer-events:auto;
}
.tool-block{
  padding:.75rem .85rem .85rem;
  border-radius:14px;
  background:rgba(12,10,9,.62);
  border:1px solid rgba(244,236,226,.16);
  backdrop-filter:blur(10px);
}
.tool-label{
  margin:0 0 .55rem;
  font-size:.72rem;
  letter-spacing:.16em;
  color:rgba(244,236,226,.72);
}
#clock-now{
  float:right;
  letter-spacing:.08em;
  font-variant-numeric:tabular-nums;
  color:rgba(244,236,226,.92);
}
.voice-heard{
  margin:0 0 .5rem;
  font-family:var(--serif);
  font-size:1.05rem;
  letter-spacing:.04em;
  color:var(--ink);
}
.voice-phrases,
.schedule-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.35rem;
}
.overview-tools button{
  appearance:none;
  border:1px solid rgba(244,236,226,.22);
  background:rgba(12,10,9,.35);
  color:var(--ink);
  padding:.32rem .65rem;
  border-radius:999px;
  font-size:.78rem;
  letter-spacing:.06em;
  cursor:pointer;
}
.overview-tools button.is-active,
.overview-tools button.is-listening,
.voice-phrases button:focus-visible{
  border-color:rgba(244,236,226,.66);
  background:rgba(244,236,226,.16);
}
.voice-listen{margin-top:.45rem}
body.is-overview .interact-hint{
  bottom:clamp(1.05rem,4.2vh,2.3rem);
  font-size:.8rem;
  letter-spacing:.1em;
}
.scenes button{
  appearance:none;
  border:1px solid rgba(244,236,226,.28);
  background:rgba(12,10,9,.62);
  color:var(--ink);
  padding:.48rem 1.15rem;
  border-radius:999px;
  font-size:.88rem;
  letter-spacing:.16em;
  backdrop-filter:blur(8px);
  cursor:pointer;
}
.scenes button.is-active,
.scenes button[aria-pressed="true"]{
  border-color:rgba(244,236,226,.66);
  background:rgba(244,236,226,.16);
}

.place-actions{
  display:flex;
  position:absolute;
  left:50%;
  bottom:clamp(3.4rem,11vh,5.6rem);
  transform:translateX(-50%);
  z-index:8;
  gap:.55rem;
  justify-content:center;
  pointer-events:none;
}
.place-actions button{
  pointer-events:auto;
  appearance:none;
  border:1px solid rgba(244,236,226,.55);
  background:rgba(12,10,9,.78);
  color:#f7f0e6;
  padding:.55rem 1.4rem;
  border-radius:999px;
  font-size:.95rem;
  letter-spacing:.16em;
  backdrop-filter:blur(10px);
  cursor:pointer;
}
.place-actions button[hidden]{display:none}
body.is-overview .place-actions{display:none}

.jumps{
  display:flex;
  position:absolute;
  left:50%;
  bottom:clamp(1rem,4vh,2.2rem);
  transform:translateX(-50%);
  z-index:6;
  gap:.4rem;
  flex-wrap:wrap;
  justify-content:center;
}
.jumps button{
  appearance:none;
  border:1px solid rgba(244,236,226,.22);
  background:rgba(12,10,9,.55);
  color:var(--ink);
  padding:.4rem .85rem;
  border-radius:999px;
  font-size:.8rem;
  letter-spacing:.08em;
  backdrop-filter:blur(8px);
}

@media (prefers-reduced-motion:reduce){
  .jumps{display:flex}
  .interact-hint{display:none}
  .scroll-track{display:none;height:0}
  body.is-overview .jumps{display:none}
  body.is-overview .scenes{display:flex}
}

.after{
  position:relative;
  z-index:3;
  background:var(--bg);
  padding:clamp(3rem,9vh,6.5rem) clamp(1.3rem,6vw,5rem) 3rem;
  max-width:42rem;
}
.after h2{
  margin:0 0 1.1rem;
}
.after .prose{margin:0 0 1.2rem}
.after .note-line{
  color:var(--ink-soft);
  font-size:.92rem;
  margin:1.6rem 0 0;
}

#loader{
  position:fixed;inset:0;
  z-index:300;
  background:#0c0a09;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:opacity .6s ease;
}
#loader.is-done{opacity:0;pointer-events:none}
#loader-msg{
  font-family:var(--serif);
  letter-spacing:.12em;
  color:var(--ink-soft);
  font-size:1rem;
  margin:0;
}

body.experience .dock{z-index:210}

@media (max-width:839px){
  body.experience{padding-bottom:var(--dock-h)}
  .intro-card{top:calc(var(--nav-h, 56px) + 1rem)}
  /* Bottom band must not sit on the caption. Same controls, stacked
     above the dock: jumps, then caption; or caption, then scenes, then tools.
     The hint sentence is already on the intro card. */
  .interact-hint{display:none}
  .jumps{bottom:calc(var(--dock-h) + 0.8rem);width:92%}
  .caption{
    left:1.15rem;
    right:1.15rem;
    bottom:calc(var(--dock-h) + 3.4rem);
    max-width:none;
  }
  .place-actions{bottom:calc(var(--dock-h) + 7.1rem);width:92%}
  body.is-overview .caption{bottom:calc(var(--dock-h) + 1.15rem)}
  .scenes{bottom:calc(var(--dock-h) + 4.3rem);width:92%}
  .overview-tools{
    right:auto;
    left:1.1rem;
    top:auto;
    bottom:calc(var(--dock-h) + 7.2rem);
    width:calc(100% - 2.2rem);
    flex-direction:row;
    flex-wrap:wrap;
    gap:.5rem;
  }
  /* 9.5rem lets 語音 and 定時 sit in one row at 390, so they do not
     stack over the house. They still wrap on a very narrow screen. */
  .tool-block{flex:1 1 9.5rem}
}

/* Preview / screenshot: hide loader instantly when already ready */
html[data-shot] #loader{display:none!important;transition:none}
html[data-shot] .grain{display:none}
