/* 灵枢阁首页 · 知微 hero 底图（单层 artifact-bg-drift，无双层虚影） */
.lg-home-hero {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}
/* ink-sea.css also layers direct body children; keep this viewport layer fixed. */
html.lg-home-hero-on body > .lg-home-hero {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw;
  height: 100vh;
  z-index: 0 !important;
}
.lg-home-hero__stage {
  position: absolute;
  inset: -6%;
}
.lg-home-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  transform: scale(1.06);
  animation: lg-artifact-bg-drift 14s ease-in-out infinite alternate;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
/* 轻遮罩：保字可读，露出山景 */
.lg-home-hero__wash {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
}
.lg-home-hero__grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.74' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes lg-artifact-bg-drift {
  0% { transform: scale(1.06) translate3d(-4.5%, -3.5%, 0); }
  50% { transform: scale(1.12) translateZ(0); }
  to { transform: scale(1.06) translate3d(4.5%, 3.5%, 0); }
}
html.lg-home-hero-on,
html.lg-home-hero-on body {
  background: transparent !important;
}
html.lg-home-hero-on body > *:not(.lg-home-hero):not(.site-header):not(.lsg-site-header):not(.lsg-tool-back):not(.lsg-home-back):not(#lsg-picker-portal-root){position:relative;z-index:1}
html.lg-home-hero-on .site-header:not(.lsg-site-header){position:absolute;z-index:30}
html.lg-home-hero-on .site-header.lsg-site-header,
html.lg-home-hero-on header.lsg-site-header{
  position:fixed!important;z-index:2147483000!important;display:flex!important;
  visibility:visible!important;opacity:1!important;
}
html.lg-home-hero-on #lingshuge-topbar {
  z-index: 100000 !important;
}
@media (prefers-reduced-motion: reduce) {
  .lg-home-hero__img {
    animation: none !important;
    transform: scale(1.05);
  }
}

/* tools-hero-paper-kill — let mountain show on /tools */
html.lg-home-hero-on,
html.lg-home-hero-on body {
  background: transparent !important;
}
html.lg-home-hero-on body > header:not(.lsg-topbar):not(#lingshuge-topbar) {
  background: rgba(247,241,229,var(--lsg-surface-alpha,.54));
  backdrop-filter: blur(8px);
  border-bottom: 0;
  position: relative;
  z-index: 2;
}
html.lg-home-hero-on main {
  position: relative;
  z-index: 2;
}
/* Tool cards keep their own stable paper surface; the mountain remains visible
   in the page gaps without a post-load gray wash. */
html.lg-home-hero-on .static-site-document.is-tool-document a.card,
html.lg-home-hero-on .static-site-document.is-tool-document a.tool-card {
  background: rgba(251,247,238,.88) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* games / tools: let mountain show through Next white shells */
html.lg-home-hero-on body,
html.lg-home-hero-on #__next,
html.lg-home-hero-on #app-shell,
html.lg-home-hero-on main:not([data-lsg-reading-surface]),
html.lg-home-hero-on .route-loading-shell {
  background: transparent !important;
}
html.lg-home-hero-on .lg-home-hero {
  z-index: 0 !important;
}

/* All migrated tools use the homepage landscape as their page atmosphere.
   Keep their form, result, dialog, and model surfaces intact above it. */
html.lg-home-hero-on .static-site-document.is-tool-document,
html.lg-home-hero-on .static-site-document.is-tool-document > #app-shell,
html.lg-home-hero-on .static-site-document.is-tool-document > main,
html.lg-home-hero-on .static-site-document.is-tool-document > .tool-page-shell,
html.lg-home-hero-on .static-site-document.is-tool-document > .stage {
  background: transparent !important;
}
html.lg-home-hero-on .static-site-document.is-tool-document::before {
  background: transparent !important;
}
html.lg-home-hero-on .static-site-document.is-tool-document .tool-page-shell,
html.lg-home-hero-on .static-site-document.is-tool-document .tool-flow-shell,
html.lg-home-hero-on .static-site-document.is-tool-document .tool-form-atmosphere,
html.lg-home-hero-on .static-site-document.is-tool-document .tool-ritual-hero,
html.lg-home-hero-on .static-site-document.is-tool-document .utility-page {
  background: transparent !important;
}
html.lg-home-hero-on .static-site-document.is-tool-document > .stage.is-dark {
  background: rgba(11, 20, 20, 0.28) !important;
}
html.lg-home-hero-on .static-site-document.is-tool-document .site-bottom-nav {
  background: rgba(247, 241, 229, var(--lsg-surface-alpha, .54)) !important;
}

/* Ordinary static pages share the same landscape atmosphere as the home and
   tools pages; their panels remain opaque or translucent where content needs
   a reading surface. */
html.lg-home-hero-on .static-site-document.is-standard {
  background: transparent !important;
}

/* Keep ordinary tool shells transparent before hydration. */
.static-site-document.is-tool-document:not(.is-hecan-document),
.static-site-document.is-tool-document:not(.is-hecan-document) > #app-shell,
.static-site-document.is-tool-document:not(.is-hecan-document) > main,
.static-site-document.is-tool-document:not(.is-hecan-document) > .stage,
.static-site-document.is-tool-document:not(.is-hecan-document) .stage {
  background: transparent !important;
}
.static-site-document.is-tool-document:not(.is-hecan-document)::before {
  background: transparent !important;
}

/* Homepage: show the original landscape without a white wash over the image. */
html.lg-home-hero-on:has(.static-site-document.is-standard:not(.is-tool-document)) .lg-home-hero__img {
  filter:none;
}
html.lg-home-hero-on:has(.static-site-document.is-standard:not(.is-tool-document)) .lg-home-hero__wash {
  background:transparent;
}

/* The classics catalog is a reading surface. Keep its first frame stable so
   page entry does not combine stylesheet arrival with a moving background. */
html.lg-home-hero-on:has(.static-site-document.is-classics-document) .lg-home-hero__img {
  animation: none !important;
  transform: scale(1.06) translate3d(0, 0, 0);
}

/* The shared footer should sit directly on the same atmosphere on every page
   that uses the homepage hero, including the tools document. */
html.lg-home-hero-on #lsg-site-footer.site-footer {
  width: 100% !important;
  margin: 0 !important;
  padding-inline: clamp(20px, 4vw, 48px) !important;
  background: rgba(255,252,246,var(--lsg-surface-alpha,.54)) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 0;
  box-shadow: 0 -10px 28px rgba(47,40,31,.08) !important;
}

/* games-page-transparent */
html.lg-home-hero-on body,
html.lg-home-hero-on #__next,
html.lg-home-hero-on #app-shell,
html.lg-home-hero-on main:not([data-lsg-reading-surface]),
html.lg-home-hero-on .route-loading-shell {
  background: transparent !important;
}

/* BR-WEB-MOBILE-BG-002: two bounded CSS layers replace the large bitmap on phones. */
@media (max-width: 760px) {
  .lg-home-hero { background: #f5f1e9; }
  .lg-home-hero__stage, .lg-home-hero__wash, .lg-home-hero__grain { display: none; }
  .lg-home-hero::before, .lg-home-hero::after {
    content: '';
    position: absolute;
    width: min(80vw, 320px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, #bad1c95c 0%, #d5e2da36 46%, transparent 70%);
    animation: lg-mobile-cloud 24s ease-in-out infinite alternate;
    pointer-events: none;
  }
  .lg-home-hero::before { top: 12%; left: -12%; }
  .lg-home-hero::after {
    right: -14%; bottom: 8%;
    background: radial-gradient(circle, #dac8ae52 0%, #e7d8c032 46%, transparent 70%);
    animation-delay: -12s;
    animation-direction: alternate-reverse;
  }
  html.lg-home-hero-on body > header:not(.lsg-topbar):not(#lingshuge-topbar),
  html.lg-home-hero-on #lsg-site-footer.site-footer {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@keyframes lg-mobile-cloud {
  from { transform: translate3d(0, 0, 0) scale(.92); opacity: .55; }
  to { transform: translate3d(24px, -20px, 0) scale(1.08); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-home-hero::before, .lg-home-hero::after { animation: none; }
}
@media (max-width: 760px) {
  /* BR-WEB-MOBILE-BG-003: account for the scrollbar at 320px without clipping content. */
  html.lg-home-hero-on, html.lg-home-hero-on body { min-width: 0; }
  html.lg-home-hero-on body > .lg-home-hero { width: 100%; height: 100dvh; }
}
