/* Load after experience.css. The approved composition remains; fixes are additive. */
body { position: relative; isolation: isolate; }
#mobile-neon {
  position: fixed;
  inset: auto;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  contain: strict;
}
/* Legacy engines must also be removed at integration to avoid duplicate CPU work. */
#current, #code-field { display: none !important; }
.ambient {
  z-index: 1;
  background: radial-gradient(ellipse at 83% 27%, rgba(var(--mask), .48), transparent 69%),
    radial-gradient(ellipse at 9% 68%, rgba(var(--scene-rgb), .045), transparent 58%);
}
html[data-theme=day] .ambient {
  background: radial-gradient(ellipse at 83% 27%, rgba(var(--mask), .58), transparent 69%),
    radial-gradient(ellipse at 9% 68%, rgba(var(--scene-rgb), .035), transparent 58%);
}
html[data-scene=closing] .ambient {
  background: radial-gradient(ellipse at 50% 20%, rgba(var(--scene-rgb), .07), transparent 47%),
    linear-gradient(transparent 35%, rgba(var(--mask), .5) 70%);
}
body > main, body > footer { position: relative; z-index: 2; }
body > header { z-index: 8; }
body > .chapter-dock { z-index: 25; }
/* Fail open, including if chapters.js runs but this script fails or is blocked. */
html.has-reveal .reveal,
html.has-reveal .reveal.is-seen,
.fluid-entry {
  opacity: 1;
  clip-path: none;
  transform: none;
  filter: none;
  animation: none;
}
.fluid-entry { transform-origin: 50% 80%; }
.opening h1 { font-size: clamp(2.8rem, 7.4vw, 7.25rem); }
.proof-intro h2 { font-size: clamp(2.5rem, 5.8vw, 5.25rem); }
.chapter h2 { font-size: clamp(2.5rem, 6.2vw, 5.75rem); }
.closing h2 { font-size: clamp(2.45rem, 5vw, 4.375rem); }
.definition { font-size: clamp(1.0625rem, 1.7vw, 1.375rem); }
.chapter-lead { font-size: clamp(1.125rem, 1.85vw, 1.4375rem); }
.opening h1, .proof-intro h2, .chapter h2 {
  overflow-wrap: normal;
  word-break: normal;
}
@media (max-width: 760px) {
  .opening h1 { font-size: clamp(2.75rem, 12.9vw, 4.25rem); line-height: 1.23; }
  .proof-intro h2, .chapter h2 { font-size: clamp(2.15rem, 10.6vw, 3.25rem); line-height: 1.32; }
  .closing h2 { font-size: clamp(2.15rem, 10.2vw, 3.1rem); }
  .definition { font-size: clamp(1.0625rem, 4.6vw, 1.25rem); }
  .chapter-lead { font-size: clamp(1.125rem, 4.85vw, 1.3125rem); }
  .proof-intro > p:last-child { font-size: clamp(.9375rem, 3.85vw, 1.0625rem); }
  .opening-business { font-size: clamp(.75rem, 3.1vw, .875rem); }
  .ambient { background: radial-gradient(ellipse at 83% 26%, rgba(var(--mask), .38), transparent 64%); }
}
/* The preference wins even if a saved UI state says motion is on. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  html.has-reveal .reveal, .fluid-entry {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
    animation: none !important;
    transition: none !important;
  }
}
html[data-motion=off] .fluid-entry {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  clip-path: none !important;
  animation: none !important;
}
@media(max-width:760px){html{scrollbar-width:none}html::-webkit-scrollbar{display:none}}
/* The last scene resolves into the supplied Bithrah mark, in the content layer. */
.brand-finale {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin: clamp(58px, 9vw, 125px) auto 24px;
  padding: 38px 0 28px;
  isolation: isolate;
  text-align: center;
}
.brand-finale::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -20% 5%;
  background: radial-gradient(ellipse, rgba(82,224,191,.17), transparent 66%);
  pointer-events: none;
}
.brand-finale img {
  display: block;
  width: clamp(150px, 19vw, 235px);
  height: auto;
  max-height: 300px;
  object-fit: contain;
  filter: drop-shadow(0 0 19px rgba(82,224,191,.4));
}
.brand-finale > span, .brand-finale figcaption {
  display: block;
  font-size: clamp(24px, 3.7vw, 40px);
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
}
html[data-theme=day] .brand-finale img {
  filter: brightness(0) saturate(100%) drop-shadow(0 0 20px rgba(36,121,108,.15));
}
html[data-theme=day] .brand-finale::before {
  background: radial-gradient(ellipse, rgba(36,121,108,.10), transparent 66%);
}
@media (max-width: 760px) {
  .brand-finale { margin-top: 58px; padding: 26px 0 22px; }
  .brand-finale img { width: 156px; max-height: 205px; }
}
html[data-motion=off] .fluid-entry > span {
  opacity: 1 !important; filter: none !important; text-shadow: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .fluid-entry > span { opacity: 1 !important; filter: none !important; text-shadow: none !important; }
}
