/* Additive opening scene. Removing this file and its script leaves the LP intact. */
.anim-entrance {
  --anim-entrance-duration: 3800ms;
  --anim-entrance-ease: cubic-bezier(.32, 0, .2, 1);
  --anim-entrance-functional: cubic-bezier(.2, .65, .3, 1);
  position: fixed;
  inset: 0;
  z-index: 1000;
  isolation: isolate;
  overflow: hidden;
  color: #f0e4c6;
  background: #101b17;
  font-family: 'Noto Serif JP', serif;
  animation: anim-entrance-reveal var(--anim-entrance-duration) var(--anim-entrance-functional) both;
}

.anim-entrance *, .anim-entrance *::before, .anim-entrance *::after { box-sizing: border-box; }
.anim-entrance-scene { position: absolute; inset: 0; overflow: hidden; }
.anim-entrance-perspective {
  position: absolute;
  inset: 0;
  perspective: 950px;
  perspective-origin: 50% 47%;
  background: radial-gradient(ellipse at 50% 40%, #3d3a27 0, #1e2b23 40%, #101b17 80%);
}

.anim-entrance-camera {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  animation: anim-entrance-climb var(--anim-entrance-duration) var(--anim-entrance-ease) both;
}

.anim-entrance-backwall {
  position: absolute;
  width: 1800px;
  height: 1100px;
  left: -900px;
  top: -740px;
  transform: translateZ(-24px);
  background:
    linear-gradient(180deg, transparent 80%, #080e0b 100%),
    linear-gradient(90deg, #0e1a15, transparent 32%, transparent 68%, #0e1a15),
    repeating-linear-gradient(90deg, transparent 0 169px, #b39d6520 169px 171px, transparent 171px 174px),
    repeating-linear-gradient(0deg, #af9b6720 0 1px, transparent 1px 170px),
    linear-gradient(180deg, #213629 0 47%, #26382b 47% 48%, #16281f 48% 100%);
  box-shadow: inset 0 -200px 180px #050906;
}

.anim-entrance-wall {
  position: absolute;
  top: -740px;
  width: 1400px;
  height: 1150px;
  transform-origin: 0 50%;
  background:
    linear-gradient(180deg, #080f0b99, transparent 45%, #0c171155),
    repeating-linear-gradient(90deg, transparent 0 198px, #af96693b 199px 201px, #050a0777 203px 208px),
    linear-gradient(180deg, #263b2b 0 66%, #b2965c 66% 66.25%, #111e16 66.5% 100%);
}
.anim-entrance-wall-left { left: -600px; transform: rotateY(-90deg); }
.anim-entrance-wall-right { left: 600px; transform: rotateY(-90deg); background-color: #14221a; }
.anim-entrance-ceiling {
  position: absolute;
  left: -600px;
  top: -500px;
  width: 1200px;
  height: 1500px;
  transform-origin: 50% 0;
  transform: rotateX(90deg);
  background: repeating-linear-gradient(0deg, #0a100d 0 180px, #4b4a3033 181px 185px, #080c09 186px 205px);
}

.anim-entrance-lamp {
  position: absolute;
  top: -180px;
  left: -315px;
  width: 30px;
  height: 88px;
  transform: translateZ(6px);
  border: 5px solid #9e8450;
  border-radius: 3px;
  background: linear-gradient(90deg, #d9b76b, #fff0b8 50%, #ca9f52);
  box-shadow: 0 0 25px #efb967aa, 0 0 100px 45px #d6ad4626, inset 0 0 8px #fffae6;
}
.anim-entrance-lamp::before, .anim-entrance-lamp::after {
  content: '';
  position: absolute;
  left: -8px;
  right: -8px;
  height: 8px;
  background: linear-gradient(90deg, #4f432a, #cbb478 50%, #51432b);
  box-shadow: 0 3px 6px #0008;
}
.anim-entrance-lamp::before { top: -11px; }
.anim-entrance-lamp::after { bottom: -11px; }
.anim-entrance-lamp-right { left: 285px; }

.anim-entrance-doorway {
  position: absolute;
  left: -175px;
  top: -285px;
  width: 350px;
  height: 510px;
  transform-style: preserve-3d;
}
.anim-entrance-room {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #80673e;
  transform: translateZ(-12px);
}
.anim-entrance-room img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 48%;
  opacity: .92;
}
.anim-entrance-room::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #3a231640, transparent 25% 75%, #3a231640);
  box-shadow: inset 0 0 50px 10px #f2c36c20;
}
.anim-entrance-frame {
  position: absolute;
  inset: -19px -20px -8px;
  border: 13px solid #75623e;
  border-bottom-width: 8px;
  outline: 2px solid #bfa770;
  box-shadow: 0 0 0 7px #1a281d, 0 0 0 9px #7a6943, 0 18px 25px #0006, inset 0 0 0 3px #c3aa72;
  transform: translateZ(7px);
  pointer-events: none;
}
.anim-entrance-door {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  border: 2px solid #a58c54;
  background:
    repeating-linear-gradient(90deg, #3441300a 0 2px, #101c1614 3px 5px, transparent 6px 11px),
    linear-gradient(90deg, #1a2c20, #304330 44%, #213420 94%, #425038);
  box-shadow: inset 0 0 0 9px #15271b, inset 0 0 0 10px #a18c5359, 0 0 20px #0008;
  animation: anim-entrance-door-left var(--anim-entrance-duration) var(--anim-entrance-ease) both;
}
.anim-entrance-door-left { left: 0; transform-origin: 0 50%; }
.anim-entrance-door-right {
  right: 0;
  transform-origin: 100% 50%;
  animation-name: anim-entrance-door-right;
}
.anim-entrance-panel {
  position: absolute;
  left: 19px;
  right: 19px;
  top: 29px;
  height: 58%;
  border: 2px solid #8e805346;
  background: linear-gradient(140deg, #111e1655, #29412b44 55%, #16271b55);
  box-shadow: inset 2px 3px 8px #050d0a80, 1px 1px 0 #c9b77745;
}
.anim-entrance-panel::after {
  content: '';
  position: absolute;
  inset: 13px;
  border: 1px solid #a38d5545;
}
.anim-entrance-panel-low { top: 69%; height: 24%; }
.anim-entrance-handle {
  position: absolute;
  right: 13px;
  top: 58%;
  width: 7px;
  height: 55px;
  border-radius: 5px;
  background: linear-gradient(90deg, #866733, #ead396 45%, #a68a4d);
  box-shadow: 2px 4px 3px #0008, 0 0 0 3px #97845133;
}
.anim-entrance-door-right .anim-entrance-handle { left: 13px; right: auto; }
.anim-entrance-door-mark {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 24%;
  text-align: center;
  color: #ddc990;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: .08em;
  text-shadow: 0 2px 1px #0009;
}
.anim-entrance-door-right .anim-entrance-door-mark { font-size: 10px; line-height: 2; top: 25%; letter-spacing: .16em; }
.anim-entrance-sign {
  position: absolute;
  top: -65px;
  left: 25px;
  right: 25px;
  padding: 7px 5px;
  border: 1px solid #9e854d;
  background: #17271e;
  box-shadow: 0 5px 15px #0006;
  text-align: center;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: .35em;
  text-indent: .35em;
  transform: translateZ(4px);
}

.anim-entrance-step {
  position: absolute;
  left: -470px;
  top: 225px;
  width: 940px;
  height: 110px;
  transform-origin: 50% 0;
  transform: translate3d(0, calc(var(--anim-step) * 45px), calc(var(--anim-step) * 110px)) rotateX(90deg);
  background:
    linear-gradient(90deg, #08120b99, transparent 28% 72%, #08120b99),
    repeating-linear-gradient(90deg, transparent 0 230px, #10191077 231px 232px),
    linear-gradient(180deg, #3f4734, #6a6750);
  border-bottom: 3px solid #b49b61;
}
.anim-entrance-riser {
  position: absolute;
  left: -470px;
  top: 225px;
  width: 940px;
  height: 45px;
  transform: translate3d(0, calc(var(--anim-step) * 45px), calc((var(--anim-step) + 1) * 110px));
  background: linear-gradient(90deg, #131e1455, transparent 30% 70%, #131e1455), linear-gradient(180deg, #3a402b, #17231a 87%);
  border-top: 2px solid #a79159;
  box-shadow: inset 0 8px 9px #050d0a55;
}
.anim-entrance-floor {
  position: absolute;
  left: -850px;
  top: 405px;
  width: 1700px;
  height: 1500px;
  transform-origin: 50% 0;
  transform: translateZ(440px) rotateX(90deg);
  background:
    linear-gradient(90deg, #101a10 17%, transparent 45% 55%, #101a10 83%),
    repeating-linear-gradient(0deg, #07120b99 0 2px, transparent 3px 180px),
    repeating-linear-gradient(90deg, #a7956150 0 1px, #303a25 2px 170px);
}
.anim-entrance-stair-light {
  position: absolute;
  left: -160px;
  top: 226px;
  width: 320px;
  height: 540px;
  transform-origin: 50% 0;
  transform: rotateX(74deg);
  pointer-events: none;
  background: linear-gradient(180deg, #ebbd622e, #d3a04a15 65%, transparent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.anim-entrance-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 22%, #050b0640 65%, #040805cc 100%);
  box-shadow: inset 0 0 100px #050b0633;
}
.anim-entrance-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: max(54px, 8vh);
  margin: 0;
  color: #e3d2ab;
  text-align: center;
  font-size: clamp(13px, 1.15vw, 16px);
  letter-spacing: .25em;
  line-height: 2;
  text-shadow: 0 2px 10px #000;
  animation: anim-entrance-caption var(--anim-entrance-duration) var(--anim-entrance-functional) both;
}
.anim-entrance-caption small {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: .23em;
  color: #bca572;
  margin-bottom: 8px;
}
.anim-entrance-skip {
  position: absolute;
  top: max(22px, env(safe-area-inset-top));
  right: max(22px, env(safe-area-inset-right));
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 17px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #bba36e88;
  border-radius: 0;
  color: #f1e8d1;
  background: #0e1b16db;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .06em;
  cursor: pointer;
}
.anim-entrance-skip:hover { background: #314133; border-color: #d0b77d; }
.anim-entrance-skip:focus-visible { outline: 2px solid #f3dba1; outline-offset: 5px; }
.anim-entrance-skip span { font-size: 15px; color: #d1b97e; }
.anim-entrance-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@keyframes anim-entrance-climb {
  0% { transform: translate3d(0, -110px, -420px); }
  16% { transform: translate3d(0, -96px, -330px); }
  29% { transform: translate3d(0, -57px, -220px); }
  42% { transform: translate3d(0, -23px, -110px); }
  53% { transform: translate3d(0, 8px, -35px); }
  65% { transform: translate3d(0, 16px, 10px); }
  80% { transform: translate3d(0, 24px, 285px); }
  94%, 100% { transform: translate3d(0, 28px, 635px); }
}
@keyframes anim-entrance-door-left {
  0%, 49% { transform: translateZ(3px) rotateY(0); }
  76%, 100% { transform: translateZ(3px) rotateY(-106deg); }
}
@keyframes anim-entrance-door-right {
  0%, 51% { transform: translateZ(3px) rotateY(0); }
  78%, 100% { transform: translateZ(3px) rotateY(106deg); }
}
@keyframes anim-entrance-caption {
  0%, 32% { opacity: 1; transform: translateY(0); }
  47%, 100% { opacity: 0; transform: translateY(-8px); }
}
@keyframes anim-entrance-reveal {
  0%, 89% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 600px) {
  .anim-entrance-perspective { perspective: 760px; perspective-origin: 50% 44%; }
  .anim-entrance-camera { top: 44%; }
  .anim-entrance-skip { top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
  .anim-entrance-caption { bottom: max(64px, 10vh); font-size: 13px; }
}
@media (max-height: 540px) and (min-width: 601px) {
  .anim-entrance-perspective { perspective: 620px; }
  .anim-entrance-caption { bottom: 24px; }
}
/* JS also exits immediately on preference changes; this is the paint-level guard. */
@media (prefers-reduced-motion: reduce) {
  .anim-entrance { display: none; }
  .anim-entrance, .anim-entrance * { animation: none !important; }
}
.motion-paused .anim-entrance { display: none; }
