/*
  Ulysess Ortiz Living Author House
  Enchanted Presence Pass 04
  Surgical atmospheric, memory, map, and room-signature layer.
*/

:root{
  --enchanted-warmth:1;
  --enchanted-window:rgba(240,217,156,.09);
  --enchanted-shadow:rgba(5,3,3,.76);
  --enchanted-duration:680ms;
}

html[data-house-daypart="morning"]{
  --enchanted-warmth:.78;
  --enchanted-window:rgba(225,229,219,.105);
}
html[data-house-daypart="afternoon"]{
  --enchanted-warmth:1;
  --enchanted-window:rgba(240,217,156,.105);
}
html[data-house-daypart="evening"]{
  --enchanted-warmth:1.12;
  --enchanted-window:rgba(214,183,114,.12);
}
html[data-house-daypart="night"]{
  --enchanted-warmth:.9;
  --enchanted-window:rgba(144,126,174,.075);
}

@view-transition{navigation:auto}
::view-transition-old(root){animation:enchantedRoomOut 180ms ease both}
::view-transition-new(root){animation:enchantedRoomIn 260ms ease both}
@keyframes enchantedRoomOut{to{opacity:.82;filter:brightness(.86)}}
@keyframes enchantedRoomIn{from{opacity:.82;filter:brightness(.86)}}

body[data-enchanted-presence="ready"]{
  isolation:isolate;
}
body[data-enchanted-presence="ready"]::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:
    radial-gradient(ellipse at 78% 8%,var(--enchanted-window),transparent 32%),
    linear-gradient(180deg,transparent 0 70%,rgba(5,3,3,.12));
  opacity:calc(.65 * var(--enchanted-warmth));
}

/* A single restrained room-weather layer. */
.enchanted-room-weather{
  position:fixed;
  inset:0;
  z-index:1;
  overflow:hidden;
  pointer-events:none;
  contain:strict;
  opacity:.7;
}
.enchanted-room-weather::before,
.enchanted-room-weather::after{
  content:"";
  position:absolute;
  opacity:0;
}

body[data-house-theme="threshold"] .enchanted-room-weather::before,
body[data-house-theme="guide"] .enchanted-room-weather::before{
  left:50%;
  top:0;
  width:min(42vw,420px);
  height:72vh;
  transform:translateX(-50%);
  background:linear-gradient(90deg,transparent,rgba(240,217,156,.06),transparent);
  clip-path:polygon(42% 0,58% 0,75% 100%,25% 100%);
  opacity:.7;
}
body[data-house-theme="bookshop"] .enchanted-room-weather::before{
  right:7vw;
  top:9vh;
  width:1px;
  height:44vh;
  background:linear-gradient(transparent,rgba(240,217,156,.48),transparent);
  box-shadow:-18px 0 40px rgba(214,183,114,.12);
  opacity:.6;
}
body[data-house-theme="serial"] .enchanted-room-weather::before{
  left:7vw;
  bottom:13vh;
  width:72vw;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(209,105,69,.42),rgba(240,217,156,.12),transparent);
  opacity:.65;
}
body[data-house-theme="library"] .enchanted-room-weather::before{
  right:9vw;
  top:12vh;
  width:100px;
  height:100px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(240,217,156,.15),transparent 67%);
  filter:blur(4px);
  opacity:.8;
}
body[data-house-theme="letter"] .enchanted-room-weather::before{
  left:8vw;
  top:15vh;
  width:220px;
  height:300px;
  transform:rotate(-6deg);
  border:1px solid rgba(240,217,156,.07);
  background:linear-gradient(145deg,rgba(255,255,255,.018),transparent 60%);
  opacity:.55;
}
body[data-house-theme="desk"] .enchanted-room-weather::before{
  right:3vw;
  top:2vh;
  width:min(38vw,430px);
  aspect-ratio:1;
  border-radius:50%;
  background:radial-gradient(circle,rgba(240,217,156,.11),transparent 70%);
  filter:blur(8px);
  opacity:.8;
}
body[data-house-theme="beyond"] .enchanted-room-weather::before{
  inset:0;
  background-image:
    radial-gradient(circle at 18% 28%,rgba(240,217,156,.42) 0 1px,transparent 1.7px),
    radial-gradient(circle at 72% 19%,rgba(240,217,156,.32) 0 1px,transparent 1.8px),
    radial-gradient(circle at 84% 62%,rgba(225,229,219,.25) 0 1px,transparent 1.6px),
    radial-gradient(circle at 34% 73%,rgba(240,217,156,.25) 0 1px,transparent 1.6px);
  opacity:.5;
}

/* Foyer recognition. */
.enchanted-arrival-whisper{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  margin:18px 0 0;
  padding:12px 14px 12px 38px;
  border:1px solid rgba(214,183,114,.22);
  border-radius:16px;
  background:linear-gradient(90deg,rgba(214,183,114,.07),rgba(255,255,255,.018));
  color:var(--cream,#e8dac0);
  font-size:13px;
  line-height:1.5;
}
.enchanted-arrival-whisper::before{
  content:"";
  position:absolute;
  left:14px;
  top:50%;
  width:10px;
  height:14px;
  transform:translateY(-50%);
  border-radius:7px 7px 3px 3px;
  background:linear-gradient(#f8e8b8,#c99142);
  box-shadow:0 0 18px rgba(240,217,156,.46);
}
.enchanted-arrival-whisper a{
  color:var(--gold2,#f0d99c);
  text-decoration:underline;
  text-decoration-color:rgba(240,217,156,.35);
  text-underline-offset:3px;
}
html.enchanted-foyer-awake .hero-panel{
  position:relative;
  overflow:hidden;
}
html.enchanted-foyer-awake .hero-panel::after{
  content:"";
  position:absolute;
  left:-35%;
  top:0;
  width:32%;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(240,217,156,.85),transparent);
  box-shadow:0 0 13px rgba(240,217,156,.32);
  animation:enchantedThresholdSeam 1700ms cubic-bezier(.2,.72,.2,1) 220ms both;
}
html.enchanted-foyer-awake .three-house-mark{
  animation:enchantedMarkWake 1100ms ease 280ms both;
}
@keyframes enchantedThresholdSeam{to{left:104%}}
@keyframes enchantedMarkWake{0%,100%{filter:none}42%{filter:drop-shadow(0 0 12px rgba(240,217,156,.28))}}

/* Homepage hierarchy without removing any destination. */
.hero-panel .actions.enchanted-entry-actions{
  align-items:center;
}
.hero-panel .actions .enchanted-quiet-door{
  border-color:transparent;
  background:transparent;
  padding-inline:8px;
  color:var(--cream,#e8dac0);
  opacity:.82;
}
.hero-panel .actions .enchanted-quiet-door:hover,
.hero-panel .actions .enchanted-quiet-door:focus-visible{
  opacity:1;
  border-color:rgba(240,217,156,.32);
  background:rgba(214,183,114,.06);
}

/* The newest work keeps a lamp burning. */
.enchanted-lamp-lit{
  position:relative;
  border-color:rgba(240,217,156,.38)!important;
  box-shadow:0 24px 70px rgba(0,0,0,.38),0 0 48px rgba(240,217,156,.075)!important;
}
.enchanted-lamp-lit::before{
  content:"";
  position:absolute;
  right:20px;
  top:16px;
  width:10px;
  height:15px;
  border-radius:8px 8px 3px 3px;
  background:linear-gradient(#fff1bd,#bd7d31);
  box-shadow:0 0 20px rgba(240,217,156,.55);
  z-index:2;
}
.author-desk-card.enchanted-lamp-lit{scroll-margin-top:110px}

/* Room signatures. */
body[data-house-signature="cover-glint"] .book-card img,
body[data-house-signature="cover-glint"] .catalog-card img{
  transition:transform 280ms ease,filter 280ms ease,box-shadow 280ms ease;
}
body[data-house-signature="cover-glint"] .book-card:hover img,
body[data-house-signature="cover-glint"] .book-card:focus-within img,
body[data-house-signature="cover-glint"] .catalog-card:hover img,
body[data-house-signature="cover-glint"] .catalog-card:focus-within img{
  transform:translateY(-3px) rotate(.15deg);
  filter:brightness(1.035) saturate(1.02);
  box-shadow:0 24px 56px rgba(0,0,0,.45),0 0 30px rgba(240,217,156,.08);
}
body[data-house-signature="ember-thread"] .door-card,
body[data-house-signature="reading-progress"] .serial-paper{
  position:relative;
}
body[data-house-signature="ember-thread"] .door-card::before{
  content:"";
  position:absolute;
  left:20px;
  right:20px;
  top:0;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(209,105,69,.52),rgba(240,217,156,.2),transparent);
}
body[data-house-signature="shelf-lamp"] .panel,
body[data-house-signature="shelf-lamp"] .door-card{
  background-image:linear-gradient(145deg,rgba(255,255,255,.016),transparent 55%);
}
body[data-house-signature="paper-breath"] .letter-room-product-card{
  box-shadow:0 28px 78px rgba(0,0,0,.42),0 0 36px rgba(240,217,156,.045);
}
body[data-house-signature="distant-stars"] .door-card{
  position:relative;
  overflow:hidden;
}
body[data-house-signature="distant-stars"] .door-card::after{
  content:"";
  position:absolute;
  right:18px;
  top:18px;
  width:3px;
  height:3px;
  border-radius:50%;
  background:rgba(240,217,156,.75);
  box-shadow:-21px 17px 0 rgba(240,217,156,.22),-42px -4px 0 rgba(225,229,219,.18);
  opacity:.65;
}

/* The Letter Room seal is tactile but never blocks the actual content. */
.enchanted-letter-seal{
  display:inline-flex;
  align-items:center;
  gap:9px;
  margin-top:16px;
  border:1px solid rgba(240,217,156,.28);
  border-radius:999px;
  padding:9px 13px;
  background:rgba(91,27,30,.3);
  color:var(--cream,#e8dac0);
  font:inherit;
  font-size:12px;
  font-weight:750;
  cursor:pointer;
}
.enchanted-letter-seal::before{
  content:"✦";
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#6d2327;
  color:#f0d99c;
  box-shadow:0 0 0 1px rgba(240,217,156,.28) inset;
}
.enchanted-letter-seal[aria-pressed="true"]{
  background:rgba(214,183,114,.09);
}
.enchanted-letter-inscription{
  max-height:0;
  overflow:hidden;
  margin:0;
  color:var(--gold2,#f0d99c);
  font-family:Georgia,"Times New Roman",serif;
  font-style:italic;
  line-height:1.6;
  opacity:0;
  transition:max-height 420ms ease,opacity 420ms ease,margin 420ms ease;
}
.enchanted-letter-inscription.is-open{
  max-height:120px;
  margin-top:13px;
  opacity:1;
}

/* An attentive-reader secret. It does not unlock or bypass protected areas. */
.enchanted-shelf-secret{
  display:flex;
  justify-content:center;
  margin:-3px auto 26px;
  padding:0 18px;
}
.enchanted-shelf-secret button{
  width:34px;
  height:34px;
  border:0;
  border-radius:50%;
  background:transparent;
  color:rgba(240,217,156,.28);
  font:inherit;
  cursor:pointer;
  transition:color 220ms ease,transform 220ms ease,filter 220ms ease;
}
.enchanted-shelf-secret button:hover,
.enchanted-shelf-secret button:focus-visible{
  color:rgba(240,217,156,.85);
  transform:rotate(12deg);
  filter:drop-shadow(0 0 8px rgba(240,217,156,.32));
  outline:2px solid rgba(240,217,156,.45);
  outline-offset:3px;
}
.enchanted-shelf-secret p{
  max-width:650px;
  margin:0;
  color:var(--gold2,#f0d99c);
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(15px,2vw,18px);
  font-style:italic;
  line-height:1.65;
  text-align:center;
}
.enchanted-shelf-secret [hidden]{display:none!important}

/* Living map: a compact floor plan before the detailed room directory. */
.house-floor-plan{
  position:relative;
  overflow:hidden;
  padding:17px;
  border:1px solid rgba(240,217,156,.24);
  border-radius:22px;
  background:
    linear-gradient(rgba(240,217,156,.035) 1px,transparent 1px),
    linear-gradient(90deg,rgba(240,217,156,.035) 1px,transparent 1px),
    radial-gradient(circle at 50% 46%,rgba(214,183,114,.08),transparent 50%);
  background-size:24px 24px,24px 24px,auto;
}
.house-floor-plan::before{
  content:"";
  position:absolute;
  left:50%;
  top:18px;
  bottom:18px;
  width:1px;
  background:linear-gradient(transparent,rgba(240,217,156,.22),transparent);
}
.house-floor-plan-summary{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:15px;
}
.house-floor-plan-summary strong{
  display:block;
  font-family:Georgia,"Times New Roman",serif;
  font-size:18px;
}
.house-floor-plan-summary span{
  color:var(--muted,#b7a78b);
  font-size:12px;
  line-height:1.45;
}
.house-floor-plan-wings{
  position:relative;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.house-floor-wing{
  position:relative;
  min-height:72px;
  padding:12px 13px 12px 35px;
  border:1px solid rgba(214,183,114,.14);
  border-radius:15px;
  background:rgba(5,3,3,.32);
}
.house-floor-wing::before{
  content:"";
  position:absolute;
  left:14px;
  top:16px;
  width:8px;
  height:8px;
  border:1px solid rgba(240,217,156,.38);
  border-radius:50%;
  background:#120908;
}
.house-floor-wing.has-footsteps::before{
  background:rgba(240,217,156,.58);
  box-shadow:0 0 11px rgba(240,217,156,.24);
}
.house-floor-wing.is-current::before{
  background:#f0d99c;
  box-shadow:0 0 17px rgba(240,217,156,.52);
}
.house-floor-wing strong{
  display:block;
  font-family:Georgia,"Times New Roman",serif;
  font-size:15px;
}
.house-floor-wing small{
  display:block;
  margin-top:4px;
  color:var(--muted,#b7a78b);
  font-size:11px;
  line-height:1.45;
}
.house-floor-plan-last{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:13px;
  color:var(--cream,#e8dac0);
  font-size:12px;
}
.house-floor-plan-last::before{
  content:"";
  width:22px;
  height:1px;
  background:linear-gradient(90deg,rgba(240,217,156,.75),transparent);
}
.house-room-link{
  position:relative;
}
.house-room-link.is-visited::before{
  content:"";
  position:absolute;
  left:-7px;
  top:50%;
  width:5px;
  height:5px;
  transform:translateY(-50%);
  border-radius:50%;
  background:rgba(240,217,156,.5);
  box-shadow:0 0 9px rgba(240,217,156,.18);
}
.house-room-link.is-lamp-lit::after,
.house-pulse-item.is-current-event::after{
  content:"";
  flex:0 0 auto;
  width:8px;
  height:12px;
  border-radius:7px 7px 2px 2px;
  background:linear-gradient(#fff0bd,#bd7c2f);
  box-shadow:0 0 14px rgba(240,217,156,.42);
}
.house-pulse-item.is-current-event{
  border-color:rgba(240,217,156,.38);
  background:linear-gradient(90deg,rgba(214,183,114,.09),rgba(255,255,255,.025));
}

/* Do not let the pass create a crowded mobile foyer. */
@media(max-width:760px){
  .hero-panel .actions.enchanted-entry-actions .enchanted-quiet-door{
    width:auto;
    min-height:38px;
    align-self:flex-start;
  }
  .house-floor-plan-wings{grid-template-columns:1fr}
  .house-floor-plan::before{display:none}
  .house-floor-plan-summary{flex-direction:column;gap:5px}
  .enchanted-arrival-whisper{align-items:flex-start;flex-direction:column;padding-left:38px}
}

body[data-house-comfort="true"] .enchanted-room-weather,
body[data-house-system-reduced="true"] .enchanted-room-weather,
body[data-house-low-power="true"] .enchanted-room-weather{
  display:none!important;
}
body[data-house-comfort="true"] *,
body[data-house-system-reduced="true"] *{
  animation-duration:.001ms!important;
  animation-iteration-count:1!important;
  transition-duration:.001ms!important;
  scroll-behavior:auto!important;
}

@media(prefers-reduced-motion:reduce){
  @view-transition{navigation:none}
  .enchanted-room-weather{display:none!important}
  html.enchanted-foyer-awake .hero-panel::after,
  html.enchanted-foyer-awake .three-house-mark{animation:none!important}
}

@media print{
  .enchanted-room-weather,
  .enchanted-arrival-whisper,
  .enchanted-letter-seal,
  .enchanted-shelf-secret,
  .house-floor-plan{display:none!important}
}
