/* Entry 007 — Memory palace files
   Scene art direction: golden hour indoors. A dark warm interior with
   three lit doorways floating in the haze, dust in the light. */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&display=swap");

.palace-scene {
  --serif: "Cormorant Garamond", Georgia, serif;
  display: grid;
  place-items: center;
  min-height: 760px;
  padding: 72px 32px;
  border-color: rgba(46, 26, 16, 0.55);
  /* background-first: warm golden-hour dune, rooms glowing in the dark */
  background-image:
    radial-gradient(70% 50% at 50% 120%, rgba(255, 158, 70, 0.20), transparent 62%),
    linear-gradient(180deg, rgba(20, 12, 7, 0.50) 0%, rgba(30, 18, 10, 0.32) 48%, rgba(16, 9, 5, 0.64) 100%),
    url("../../public/media/backgrounds/dark-warm-19-ruedi.jpg");
  background-size: auto, auto, cover;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
}

/* dust motes in the light */
.dust {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(rgba(255, 214, 150, 0.5) 1px, transparent 1.8px),
    radial-gradient(rgba(255, 190, 120, 0.35) 1.3px, transparent 2.2px);
  background-size: 90px 70px, 140px 110px;
  background-position: 10px 20px, 60px 50px;
  opacity: 0.5;
  filter: blur(0.5px);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 60%, black, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 60%, black, transparent 85%);
}

/* ---- ui --------------------------------------------------------------- */

.palace-ui {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  display: grid;
  gap: 30px;
  justify-items: center;
  font-family: var(--ui-sans);
}

.palace-kicker {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 226, 188, 0.55);
}

/* ---- the corridor: three doorways -------------------------------------- */

.corridor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  width: 100%;
  perspective: 900px;
}

.room {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: end;
  gap: 5px;
  min-height: 320px;
  border: 1px solid rgba(255, 200, 140, 0.35);
  border-radius: 130px 130px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 190, 110, 0.06) 0%, rgba(255, 170, 90, 0.16) 60%, rgba(255, 150, 60, 0.26) 100%),
    linear-gradient(180deg, #271509, #3a1f0c);
  padding: 22px 18px 22px;
  text-align: center;
  cursor: pointer;
  transform: rotateY(var(--ry, 0deg));
  transition: transform 500ms ease, border-color 300ms ease, box-shadow 300ms ease;
  box-shadow: 0 30px 70px rgba(10, 5, 2, 0.55);
  color: #ffe9cf;
}

.corridor .room:first-child { --ry: 7deg; }
.corridor .room:last-child { --ry: -7deg; }

/* warm light inside each doorway */
.room-glow {
  position: absolute;
  inset: 8% 16% 30%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 75%, rgba(255, 186, 100, 0.55), rgba(255, 150, 60, 0.12) 60%, transparent 75%);
  filter: blur(18px);
  transition: opacity 300ms ease, transform 300ms ease;
  opacity: 0.7;
}

.room:hover,
.room:focus-visible {
  transform: rotateY(0deg) translateY(-8px);
  border-color: rgba(255, 214, 150, 0.8);
  box-shadow:
    0 40px 90px rgba(10, 5, 2, 0.65),
    0 0 60px rgba(255, 170, 80, 0.18);
  outline: none;
}

.room:hover .room-glow,
.room:focus-visible .room-glow {
  opacity: 1;
  transform: scale(1.08);
}

.room-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.01em;
  color: #fff3e2;
}

.room-line {
  font-size: 12px;
  color: rgba(255, 226, 188, 0.65);
}

.room-count {
  margin-top: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 196, 130, 0.7);
}

/* ---- inside a room ------------------------------------------------------- */

.room-view {
  width: 100%;
  display: grid;
  gap: 20px;
}

/* the hidden attribute must win over display:grid */
.room-view[hidden],
.corridor[hidden] {
  display: none;
}

.room-view-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
}

.room-view-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 34px;
  font-weight: 500;
  color: #fff3e2;
}

.back-out {
  border: 1px solid rgba(255, 214, 150, 0.4);
  border-radius: 999px;
  background: rgba(30, 16, 8, 0.5);
  padding: 10px 16px;
  font: 600 12px/1 var(--ui-sans);
  color: #ffe9cf;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.back-out:hover { border-color: rgba(255, 214, 150, 0.85); }

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.thing {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 200, 140, 0.28);
  border-radius: 18px;
  background: linear-gradient(170deg, rgba(255, 190, 110, 0.10), rgba(40, 22, 10, 0.6));
  padding: 16px 14px;
  text-align: left;
  color: #ffe9cf;
  box-shadow: 0 18px 44px rgba(10, 5, 2, 0.5);
  animation: settle 480ms ease backwards;
}

.thing:nth-child(2) { animation-delay: 70ms; }
.thing:nth-child(3) { animation-delay: 140ms; }
.thing:nth-child(4) { animation-delay: 210ms; }

@keyframes settle {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .thing { animation: none; }
}

.thing-kind {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 196, 130, 0.75);
}

.thing-name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #fff3e2;
}

.thing-where {
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(255, 226, 188, 0.6);
}

.room-memory {
  margin: 2px auto 0;
  max-width: 52ch;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.45;
  color: rgba(255, 226, 188, 0.75);
}

@media (max-width: 760px) {
  .palace-scene { padding: 44px 16px; min-height: 0; }

  .corridor {
    grid-template-columns: 1fr;
    gap: 16px;
    perspective: none;
  }

  .room {
    --ry: 0deg;
    min-height: 0;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    text-align: left;
    border-radius: 22px;
    padding: 18px;
  }

  .room-count { margin-top: 0; }

  .room-view-head { flex-direction: column; align-items: flex-start; }
}
