/* ========================================
   游神 YÓUSHÉN — 三维神殿
   Loaded last: brings the immersive hall onto the homepage palette and
   typefaces (style.css) — near-black ground, white serif text, vermilion for
   accents and hover, gold not used for interface text.
   ======================================== */

:root {
  --bg: #080000;
  --deep-red: #8b0000;
  --vermilion: #c0392b;
  --text: #fff;
  --text-muted: rgba(255, 255, 255, .5);
  --text-faint: rgba(255, 255, 255, .52);
  --serif-cn: 'Noto Serif SC', 'Songti SC', serif;
  --serif-en: 'Playfair Display', Georgia, serif;
  /* names used by temple-space.css */
  --ink: var(--text);
  --muted: var(--text-muted);
  --line: rgba(192, 57, 43, .3);
  --red: var(--vermilion);
}

*, *::before, *::after { text-shadow: none !important; box-shadow: none !important; }

body { background: var(--bg); color: var(--text); font: 300 14px/1.7 var(--serif-cn); -webkit-font-smoothing: antialiased; }
body, button, a, dialog { font-family: var(--serif-cn); }

/* The hall rises out of black instead of popping in half-textured. */
#scene { animation: temple-reveal 2.6s ease-out both; }
@keyframes temple-reveal { from { opacity: 0; } }

.vignette { background: linear-gradient(rgba(8, 0, 0, .72), transparent 18%, transparent 70%, rgba(8, 0, 0, .86)); }

/* ---- top bar: the site's own logo and link style ---- */
.topbar { padding: 20px clamp(24px, 6vw, 56px); }
.topbar .brand { display: flex; align-items: baseline; gap: .5rem; padding: 0; font: 700 1.05rem/1.5 var(--serif-cn); letter-spacing: .05em; color: var(--text); }
.topbar .brand .cn { border: 0; padding: 0; color: var(--text); font: inherit; letter-spacing: inherit; }
.topbar .brand .en { border: 0; padding: 0; color: var(--vermilion); font: italic 400 .75rem var(--serif-en); letter-spacing: .1em; }
.topbar nav { gap: clamp(1rem, 2vw, 2rem); }
.topbar nav a, .topbar nav button, .topbar nav #audioToggle {
  width: auto; height: auto; min-width: 0; padding: 8px 0; border-radius: 0;
  font: 700 .72rem/1.5 var(--serif-cn); letter-spacing: .3em; color: var(--text); opacity: .85;
  transition: color .3s, opacity .3s;
}
.topbar nav #audioToggle[aria-pressed="false"] { color: var(--text-muted); }
.topbar nav a:hover, .topbar nav button:hover { color: var(--vermilion); opacity: 1; text-decoration: none; }

/* ---- text controls ---- */
a:hover, button:hover, #deityList button.active { color: var(--vermilion); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 6px; }
.eyebrow { color: var(--vermilion); font-size: 11px; letter-spacing: .22em; }
.location strong { font: 400 24px/1.5 var(--serif-cn); letter-spacing: .16em; }
.dock button { font: 400 14px/1.5 var(--serif-cn); letter-spacing: .14em; transition: color .2s ease; }
.dock #count, #deityList button span { color: var(--text-muted); font: 300 11px var(--serif-en); letter-spacing: .1em; }
.dock #altar { color: var(--vermilion); }
.dock #altar:hover { color: var(--text); }
.move-pad button { color: var(--text-muted); }
/* The index drawer covers the bottom-left corner; don't print the location through it. */
.directory:not([hidden]) ~ .location { visibility: hidden; }

/* ---- panels: flat black, no frame ---- */
.detail, .directory, dialog { background: rgba(8, 0, 0, .9); border: 0; border-radius: 0; backdrop-filter: none; color: var(--text); }
.detail { width: 360px; padding: 40px; max-height: calc(100dvh - 160px); overflow-y: auto; }
.detail h2 { font: 400 36px/1.4 var(--serif-cn); letter-spacing: .12em; margin: 14px 0 26px; }
.detail p, dialog p { font: 300 15px/2 var(--serif-cn); color: rgba(255, 255, 255, .86); }
.detail summary { color: var(--text-muted); font-size: 12px; letter-spacing: .22em; cursor: pointer; }
.detail small { border: 0; color: var(--text-muted); font-size: 12px; line-height: 1.8; }
.detail #modelStatus { color: var(--text-faint); font-size: 12px; letter-spacing: .08em; }
.detail button { font-size: 14px; letter-spacing: .14em; padding-left: 0; }
.detail .close, .close { padding: 8px; color: var(--text-muted); }
.detail button:hover, .close:hover { color: var(--vermilion); text-decoration: none; }
.drawer-title h2, dialog h2 { font: 400 24px/1.5 var(--serif-cn); letter-spacing: .16em; }
#deityList button { font: 300 15px/1.6 var(--serif-cn); letter-spacing: .1em; }
#deityList button.active { background: none; border: 0; color: var(--vermilion); }
dialog { max-width: 460px; padding: 40px; }
dialog::backdrop { background: rgba(8, 0, 0, .8); backdrop-filter: none; }
dialog .primary { color: var(--vermilion); font-size: 16px; letter-spacing: .3em; }
dialog .primary:hover { color: var(--text); }
.fatal { background: rgba(8, 0, 0, .96); }
.fatal a { color: var(--vermilion); }

/* ---- prologue ---- */
.entrance { color: var(--text); background: linear-gradient(rgba(8, 0, 0, .3), transparent 22%, transparent 58%, rgba(8, 0, 0, .92)); }
.entrance-copy p { font: 300 clamp(18px, 2vw, 24px)/1.9 var(--serif-cn); letter-spacing: .12em; }
.entrance-copy small { color: var(--text-muted); font-size: 11px; letter-spacing: .22em; }
.entrance-actions button { border: 0; color: var(--text-muted); font: 300 13px/1.5 var(--serif-cn); letter-spacing: .16em; transition: color .2s ease; }
.entrance-actions .entrance-skip { color: var(--vermilion); }
.entrance-actions button:hover { color: var(--text); }

@media (max-width: 600px) {
  .topbar { padding: 16px 24px; }
  .topbar .brand .en { font-size: .68rem; }
  .detail { width: auto; padding: 28px; max-height: 55dvh; }
  .detail h2 { font-size: 28px; margin: 10px 0 18px; }
  .detail p { font-size: 14px; }
  .dock button { font-size: 12px; letter-spacing: .08em; }
  .location strong { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  #scene { animation: none; }
  .topbar nav a, .topbar nav button, .dock button, .entrance-actions button { transition: none; }
}

/* The logo stays on phones, as it does on every other page. */
.topbar .brand span { display: inline; }

/* Latin text: the wide tracking above is tuned for Chinese characters. */
:lang(en) .topbar nav a, :lang(en) .topbar nav button, :lang(en) .topbar nav #audioToggle, :lang(en) .dock button, :lang(en) .eyebrow,
:lang(en) .detail h2, :lang(en) .detail summary, :lang(en) .detail button, :lang(en) .location strong,
:lang(en) #deityList button, :lang(en) .drawer-title h2, :lang(en) dialog h2, :lang(en) dialog .primary,
:lang(en) .entrance-copy p, :lang(en) .entrance-copy small, :lang(en) .entrance-actions button { letter-spacing: .04em; }

/* ---- opening globe shot ---- */
.intro-veil { position: fixed; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; }
.intro-veil.is-lifting { transition: opacity 2.2s ease; }
.intro-label { position: fixed; left: 0; top: 0; width: 0; height: 0; opacity: 0; pointer-events: none; white-space: nowrap; }
/* A soft dark ground keeps the name readable over city lights. */
.intro-label-text { position: absolute; transform: translate(-50%, -50%); text-align: center; padding: 34px 64px;
  background: radial-gradient(closest-side, rgba(8, 0, 0, .86), rgba(8, 0, 0, .6) 62%, transparent); }
.intro-label strong { display: block; font: 400 clamp(30px, 3.4vw, 46px)/1.3 var(--serif-cn); letter-spacing: .3em; text-indent: .3em; color: var(--text); }
.intro-label span { display: block; margin-top: 8px; font: italic 400 13px/1.5 var(--serif-en); letter-spacing: .22em; color: var(--vermilion); }
/* Fuzhou: the name stands out at sea, joined to its mark by a thin line. */
.intro-label.is-led .intro-label-text { left: var(--lead, 160px); transform: translate(0, -50%); text-align: left; padding: 30px 56px 30px 22px;
  background: radial-gradient(closest-side, rgba(8, 0, 0, .8), transparent); }
.intro-label.is-led strong { text-indent: 0; }
.intro-label.is-led::before { content: ""; position: absolute; left: 46px; top: 0; width: calc(var(--lead, 160px) - 34px); height: 1px; background: rgba(255, 255, 255, .55); }
.globe-intro .entrance { background: none; }
.globe-intro .entrance-copy, .globe-intro .vignette, .globe-intro .entrance-voice { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .intro-veil.is-lifting { transition: none; } }
.intro-prompt { position: fixed; left: 0; right: 0; bottom: 13.5vh; margin: 0; text-align: center; pointer-events: none; opacity: 0;
  font: 300 15px/1.5 var(--serif-cn); letter-spacing: .5em; text-indent: .5em; color: var(--text); transition: opacity 1.2s ease; }
.intro-prompt.is-visible { opacity: .85; animation: intro-breathe 3.2s ease-in-out infinite; }
@keyframes intro-breathe { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .intro-prompt.is-visible { animation: none; } }
