/* ==========================================================================
   Home hero: the Hall of Lulu (see js/temple.js)
   ========================================================================== */
.temple { position: relative; height: 760vh; height: 760svh; --night: 0; }
.temple-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #120a24; }
#temple-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.temple-live .temple-sticky::after { content: ""; position: absolute; inset: auto 0 0 0; height: 48%; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(8, 5, 18, .78), rgba(8, 5, 18, .35) 55%, transparent); }

/* Poster shown before the hall is ready, and instead of it without WebGL or with reduced motion. */
.temple-poster {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%);
  width: min(70vw, 420px, 52vh); height: auto; aspect-ratio: 784 / 1168; object-fit: cover;
  border: 10px solid #c99a4e; box-shadow: 0 0 0 2px #6b4a1e, 0 0 0 7px #e8c374, 0 30px 90px -10px rgba(232, 195, 116, .45);
  opacity: .9; transition: opacity 1.2s;
}
.temple-live .temple-poster { opacity: 0; pointer-events: none; }
.temple-static { height: auto; }
.temple-static .temple-sticky { position: relative; height: auto; min-height: 100vh; padding: 120px 20px 80px; display: grid; justify-items: center; gap: 28px; background: radial-gradient(ellipse at 50% 30%, #3a1f5e, #120a24 70%); }
.temple-static .temple-poster { position: static; transform: none; opacity: 1; width: min(70vw, 360px); }
.temple-static .temple-intro { position: static; opacity: 1 !important; visibility: visible !important; transform: none !important; }
.temple-static .temple-face, .temple-static .temple-outro, .temple-static .temple-rail, .temple-static .temple-hint, .temple-static .temple-pre, .temple-static #temple-canvas, .temple-static .temple-grain { display: none; }

/* Film grain */
.temple-grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: temple-grain 1s steps(6) infinite;
}
@keyframes temple-grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); } 60% { transform: translate(-3%, 8%); } 80% { transform: translate(7%, 2%); } 100% { transform: translate(0, 0); } }

/* Intro */
.temple-intro {
  position: absolute; left: 0; right: 0; bottom: max(9vh, 64px); padding: 0 24px; text-align: center;
  display: grid; justify-items: center; gap: 18px; z-index: 3; will-change: opacity, transform;
}
.temple-title { font-size: clamp(64px, 11vw, 168px); line-height: .9; letter-spacing: .01em; text-shadow: 0 6px 40px rgba(0, 0, 0, .6); }
.temple-title em { font-style: italic; font-weight: 300; color: #f4ead6; }
.temple-eyebrow { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .42em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; text-shadow: none; }
.temple-lead { font-family: var(--serif); font-style: italic; font-size: clamp(19px, 2.1vw, 25px); color: #e9defa; max-width: 620px; margin: 0; text-shadow: 0 2px 18px rgba(0, 0, 0, .8); }
.temple .hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.temple-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(244, 234, 214, .7); z-index: 3; pointer-events: none; }
.temple-hint i { width: 1px; height: 34px; background: linear-gradient(var(--gold), transparent); animation: temple-drip 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes temple-drip { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* Floating plaques under the side paintings */
.temple-plaques { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.temple-plaque {
  position: absolute; left: 0; top: 0; pointer-events: auto; visibility: hidden; opacity: 0;
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; white-space: nowrap;
  font-family: var(--serif); font-size: clamp(16px, 1.6vw, 22px); color: #f4ead6; text-decoration: none;
  background: rgba(14, 8, 28, .55); border: 1px solid rgba(232, 195, 116, .45); border-radius: 2px; backdrop-filter: blur(6px);
}
.temple-plaque .sym { color: var(--gold); font-size: 1.2em; }
.temple-plaque:hover { border-color: var(--gold); }

/* Face captions while the portrait turns */
.temple-face { position: absolute; left: clamp(20px, 5vw, 72px); bottom: clamp(28px, 8vh, 80px); max-width: min(440px, 80vw); z-index: 3; visibility: hidden; opacity: 0; }
.temple-face-idx { font-size: 12px; letter-spacing: .3em; color: var(--gold); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.temple-face-name { font-size: clamp(34px, 4.2vw, 60px); line-height: 1; color: #fbf3e4; text-shadow: 0 4px 30px rgba(0, 0, 0, .8); }
.temple-face-cap { margin: 12px 0 0; font-family: var(--serif); font-style: italic; font-size: clamp(17px, 1.6vw, 21px); color: #eadff8; text-shadow: 0 2px 14px rgba(0, 0, 0, .9); }

/* Outro */
.temple-outro { position: absolute; left: 0; right: 0; bottom: max(10vh, 60px); padding: 0 24px; text-align: center; display: grid; justify-items: center; gap: 14px; z-index: 3; visibility: hidden; opacity: 0; }
.temple-outro h2 { font-size: clamp(38px, 5.4vw, 80px); color: #fbf3e4; text-shadow: 0 4px 30px rgba(0, 0, 0, .7); }
.temple-outro p { margin: 0 0 8px; max-width: 560px; font-family: var(--serif); font-style: italic; font-size: clamp(18px, 1.8vw, 23px); color: #e4ecff; text-shadow: 0 2px 14px rgba(0, 0, 0, .9); }

/* Chapter rail */
.temple-rail { position: absolute; right: clamp(14px, 2.4vw, 34px); top: 50%; transform: translateY(-50%); z-index: 4; display: grid; gap: 26px; }
.temple-rail-line { position: absolute; right: 5px; top: 6px; bottom: 6px; width: 1px; background: rgba(244, 234, 214, .18); }
.temple-rail-fill { position: absolute; inset: 0; transform-origin: top; transform: scaleY(0); background: linear-gradient(var(--gold), #b98cff); }
.temple-rail button { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 12px; background: none; border: 0; padding: 0; cursor: pointer; color: rgba(244, 234, 214, .55); font: 500 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.temple-rail button i { order: 2; width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(232, 195, 116, .6); background: #120a24; transition: background .3s, box-shadow .3s; }
.temple-rail button span { opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .3s; }
.temple-rail button:hover span, .temple-rail button.on span { opacity: 1; transform: none; }
.temple-rail button.on { color: #fbf3e4; }
.temple-rail button.on i { background: var(--gold); box-shadow: 0 0 12px var(--gold); }

/* Preloader: counts up under "Lulu", then opens from the middle */
.temple-pre { display: none; }
.temple-live .temple-pre { position: absolute; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; gap: 6px; background: #0b0616; transition: clip-path 1.5s cubic-bezier(.7, 0, .2, 1), opacity 1.5s; clip-path: inset(0 0 0 0); }
.temple-live .temple-pre.go { clip-path: inset(0 50% 0 50%); opacity: 0; pointer-events: none; }
.temple-pre-word { font-family: var(--serif); font-size: clamp(60px, 10vw, 130px); color: var(--gold); font-style: italic; font-weight: 300; }
.temple-pre-num { font-family: var(--sans); font-size: 13px; letter-spacing: .4em; color: rgba(244, 234, 214, .7); font-variant-numeric: tabular-nums; }
.temple-pre-sub { font-family: var(--sans); font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: rgba(244, 234, 214, .4); }
.temple-static .temple-pre { display: none; }

/* The sitewide starfield sits under the hall */
body[data-page="home"] .temple ~ * { position: relative; }

@media (max-width: 700px) {
  .temple-rail button span { display: none; }
  .temple-rail { gap: 20px; }
  .temple-intro { bottom: max(11vh, 84px); gap: 14px; }
  .temple-hint { white-space: nowrap; font-size: 10px; letter-spacing: .24em; bottom: 14px; }
  .temple-hint i { height: 22px; }
  .temple .btn { padding: 13px 20px; font-size: 14px; }
  .temple-face { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { .temple-grain { animation: none; } }
