/* Two presences, one rhythm. The landscape carries the explanation. */
.world-threshold {
  --world-poster:url('../assets/world-signal.webp?v=amber-core-2');
  --portrait-poster:url('../assets/world-signal-portrait.webp?v=amber-core-2');
}
@media(min-resolution:1.5dppx),(min-width:1921px),(min-height:1201px) {
  .world-threshold {
    --world-poster:url('../assets/world-signal-4k.webp?v=amber-core-hd-2');
    --portrait-poster:url('../assets/world-signal-portrait-hd.webp?v=amber-core-hd-2');
  }
}
#door.world-threshold { opacity:var(--presence-door,calc(1 - var(--dz,0))); }
.world-threshold .threshold-world {
  transform:scale(calc(1.015 - var(--presence-lift,0)*.035));
  transform-origin:50% 75%;
}
.world-threshold #door-title.presence-heading {
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip-path:inset(50%);white-space:nowrap;animation:none;
}
#presence-field { position:fixed;inset:0;width:100%;height:100%;z-index:81;pointer-events:none; }
.presence-label {
  position:absolute;top:var(--label-y,49%);width:200px;
  color:var(--world-ink);pointer-events:none;
  opacity:var(--presence-copy,1);transform:translateY(-50%);
}
.presence-human { left:var(--human-label-x,23%);text-align:right;transform:translate(-100%,-50%); }
.presence-twin { left:var(--twin-label-x,74%);text-align:left; }
.presence-label>span:first-child { display:block;font:500 clamp(18px,1.6vw,25px)/1.3 Cinzel,serif;letter-spacing:-.02em; }
.presence-label small { display:block;min-height:14px;margin-top:9px;font:400 9px/1.5 'IBM Plex Mono',monospace;letter-spacing:.015em; }
.presence-twin small { color:#735321; }
.presence-trace { display:block;width:85px;height:20px;margin-top:10px;overflow:visible; }
.presence-human .presence-trace { margin-left:auto; }
.presence-twin .presence-trace { margin-right:auto; }
.presence-trace path { stroke:#6c6457;stroke-width:1.1;stroke-linejoin:round;stroke-linecap:round;opacity:calc(.5 + var(--human-pulse,0)*.5); }
.presence-twin .presence-trace path { stroke:#90601f;opacity:.3; }
.presence-twin .presence-receiver .received-packet { stroke-width:2;opacity:var(--received-signal,0); }
.presence-caption { position:absolute;left:50%;top:clamp(108px,14vh,280px);bottom:auto;transform:translateX(-50%);width:340px;max-width:calc(100% - 48px);margin:0;text-align:center;font:500 clamp(15px,1.35vw,20px)/1.65 Cinzel,serif;letter-spacing:-.015em;color:var(--world-ink);opacity:var(--presence-copy,1); }
.presence-caption em { font-style:normal;color:var(--world-gold); }
.world-threshold .threshold-header,.world-threshold .threshold-footer,.world-threshold .threshold-actions { opacity:var(--presence-copy,1); }
.world-threshold .threshold-actions { position:absolute;left:50%;top:clamp(245px,30vh,620px);bottom:auto;transform:translate(-50%,-50%);margin:0; }
.world-threshold #door-play { flex-direction:column;gap:13px;min-width:130px;padding:12px;margin:0;border:0;background:none;box-shadow:none;backdrop-filter:none; }
.world-threshold #door-play svg { width:52px;height:52px; }
.world-threshold #door-play .journey-beat { fill:none;stroke:#895d21;stroke-width:1.3;stroke-linejoin:round;stroke-linecap:round;opacity:calc(.5 + var(--human-pulse,0)*.5); }
.world-threshold #door-play .journey-orbit { stroke:#7b6745;stroke-width:calc(.7 + var(--human-pulse,0)*.45); }
.world-threshold #door-play:hover svg { transform:none; }
.world-threshold #door-play:focus-visible { outline:2px solid var(--world-gold);outline-offset:5px; }
.world-threshold #door-play .play-copy { text-align:center; }
.world-threshold #door-play .play-copy b { font-size:10px; }
.world-threshold #door-play .play-copy i { display:block;margin-top:7px;font-size:7px; }
.world-threshold>.threshold-story { position:absolute;left:var(--edge);bottom:40px;min-height:44px;opacity:var(--presence-copy,1); }
@media(max-width:1200px) and (orientation:portrait) {
  .presence-label { top:var(--label-y,70%);width:145px;text-align:center;transform:translateX(-50%); }
  .presence-human { left:var(--human-label-x,25%); }
  .presence-twin { left:var(--twin-label-x,75%); }
  .presence-label>span:first-child { font-size:clamp(16px,4.4vw,23px); }
  .presence-label small { font-size:8px;margin-top:6px; }
  .presence-label .presence-trace { width:65px;height:15px;margin-top:5px;margin-inline:auto; }
  .presence-caption { top:auto;bottom:108px;font-size:14px;line-height:1.65; }
  .world-threshold .threshold-actions { top:103px; }
  .world-threshold #door-play { min-width:100px;min-height:44px;padding:4px;gap:6px; }
  .world-threshold #door-play svg { width:30px;height:30px; }
  .world-threshold #door-play .play-copy b { font-size:9px; }
  .world-threshold>.threshold-story { display:inline-flex;font-size:9px;bottom:40px; }
}
@media(max-width:760px) and (max-height:670px) and (orientation:portrait) {
  .world-threshold .threshold-world::before { bottom:28%; }
  .world-threshold #door-ambient { height:72%; }
  .world-threshold .threshold-world::after { background:linear-gradient(180deg,rgba(250,244,227,.4),transparent 25%,transparent 54%,rgba(244,237,220,.55) 65%,var(--world-air) 73%); }
  .presence-label { width:135px; }
  .presence-label>span:first-child { font-size:16px; }
  .presence-caption { bottom:97px;font-size:12px; }
  .presence-label small { font-size:7px; }
  .presence-label .presence-trace { height:12px;margin-top:2px; }
  .world-threshold .threshold-actions { top:95px; }
  .world-threshold #door-play { min-width:78px;gap:5px; }
  .world-threshold #door-play svg { width:25px;height:25px; }
  .world-threshold #door-play .play-copy b { font-size:7px;letter-spacing:.01em; }
  .world-threshold>.threshold-story { bottom:23px;font-size:8px; }
}
@media(min-width:761px) and (max-width:1200px) and (orientation:portrait) {
  .presence-label { width:210px; }
  .world-threshold .threshold-actions { top:110px; }
  .world-threshold #door-play svg { width:40px;height:40px; }
  .world-threshold #door-play .play-copy b { font-size:10px; }
}
@media(max-height:600px) and (orientation:landscape) {
  .presence-label { width:125px; }
  .presence-label>span:first-child { font-size:18px; }
  .presence-caption { top:auto;left:24px;bottom:85px;transform:none;width:160px;text-align:left;font-size:11px;line-height:1.6; }
  .world-threshold .threshold-actions { top:45%; }
  .world-threshold #door-play { gap:8px;min-width:110px;padding:8px; }
  .world-threshold #door-play svg { width:38px;height:38px; }
  .world-threshold #door-play .play-copy b { font-size:9px; }
  .world-threshold>.threshold-story { bottom:24px; }
}
@media(min-width:2200px) {
  .presence-label { width:300px; }
  .presence-label>span:first-child { font-size:clamp(28px,1.15vw,40px); }
  .presence-label small { font-size:12px;margin-top:14px; }
  .presence-trace { width:115px;height:25px;margin-top:14px; }
  .presence-caption { width:500px;font-size:28px; }
  .world-threshold #door-play { gap:18px;padding:18px;min-width:180px; }
  .world-threshold #door-play svg { width:72px;height:72px; }
  .world-threshold #door-play .play-copy b { font-size:14px; }
  .world-threshold #door-play .play-copy i { font-size:10px; }
  #door.world-threshold .door-mast { font-size:22px; }
  .world-threshold .threshold-nav button { font-size:14px; }
  .world-threshold>.threshold-story { font-size:13px; }
  .world-threshold .threshold-scroll,.world-threshold #ambient-toggle { font-size:11px; }
}
@media(prefers-reduced-motion:reduce) {
  .world-threshold .threshold-world { transform:none; }
  .presence-trace path { opacity:.6; }
}
/* Keep controls clear of phone notches and home indicators. */
.world-threshold .threshold-header { top:env(safe-area-inset-top,0px);left:max(var(--edge),env(safe-area-inset-left,0px));right:max(var(--edge),env(safe-area-inset-right,0px)); }
.world-threshold .threshold-footer { margin-bottom:env(safe-area-inset-bottom,0px);right:max(var(--edge),env(safe-area-inset-right,0px)); }
.world-threshold>.threshold-story { margin-bottom:env(safe-area-inset-bottom,0px);left:max(var(--edge),env(safe-area-inset-left,0px)); }
.immersive-world #hud .hud-top { padding-top:calc(28px + env(safe-area-inset-top,0px)); }
.immersive-world #hud .transport,.immersive-world #hud #hud-sound { margin-bottom:env(safe-area-inset-bottom,0px); }
.immersive-world #runway { height:1250svh; }
.world-threshold .threshold-footer .site-copyright {
  position:absolute;right:0;bottom:-13px;margin:0;
  color:#625943;white-space:nowrap;
}
.immersive-world #seal .seal-meta { display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap; }
.immersive-world #seal .site-copyright { margin:0; }
.world-dialog-foot .site-copyright { flex-basis:100%;margin:0;text-align:left; }
.story-dialog .site-copyright { margin-top:28px;text-align:left; }

/* Small type stays readable without adding more information to the hero. */
.presence-label small { font-size:10px;line-height:1.6; }
.world-threshold #door-play .play-copy i { font-size:9px; }
@media(max-width:1200px) and (orientation:portrait) {
  .presence-label { width:min(44vw,220px); }
  .presence-label small { font-size:10px;min-height:32px;max-width:19ch;margin-inline:auto; }
  .world-threshold #door-play .play-copy b { font-size:10px; }
  .world-threshold>.threshold-story { font-size:10px; }
  .world-threshold .threshold-scroll,.world-threshold #ambient-toggle { font-size:9px; }
  .world-threshold .threshold-footer { flex-wrap:wrap;justify-content:flex-end;align-content:center;column-gap:14px;row-gap:0;height:auto;max-width:53%; }
  .world-threshold .threshold-scroll { min-height:30px; }
  .world-threshold #ambient-toggle { min-height:44px; }
  .world-threshold .threshold-nav button { font-size:10px; }
  .world-threshold .threshold-footer .site-copyright { font-size:9px;bottom:-18px; }
}
@media(max-width:760px) and (max-height:670px) and (orientation:portrait) {
  .presence-caption { bottom:105px;font-size:13px; }
  .presence-label small { font-size:10px;margin-top:5px; }
  .world-threshold #door-play svg { width:29px;height:29px; }
  .world-threshold #door-play .play-copy b { font-size:10px; }
  .world-threshold>.threshold-story { font-size:10px;bottom:27px; }
  .world-threshold .threshold-footer { bottom:27px; }
}
/* The final dawn continues the film. On short screens its controls have their
   own natural scroll space, with no compressed type or clipped tap targets. */
.immersive-world #seal {
  padding:0 24px;overflow-y:auto;overflow-x:hidden;
  scroll-padding:24px;overscroll-behavior-y:auto;
}
.immersive-world #seal .seal-landscape { position:fixed;inset:0;pointer-events:none; }
.immersive-world #seal .seal-landscape img {
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;
  mask-image:none;
}
.immersive-world #seal .seal-head { flex:0 0 auto;margin:clamp(96px,13vh,160px) 0 0; }
.immersive-world #seal .seal-act { flex:0 0 auto;width:min(620px,100%);margin:clamp(180px,23vh,310px) 0 max(24px,env(safe-area-inset-bottom));padding:0; }
.immersive-world #seal .seal-kicker { font-size:10px;line-height:1.8;letter-spacing:.07em;margin:0 0 18px; }
.immersive-world #seal .seal-line { font-size:13px;line-height:1.8;margin-bottom:20px; }
.immersive-world #seal .interest-note { font-size:11px; }
.immersive-world #seal .world-final-links { gap:28px;margin:22px 0 8px; }
.immersive-world #seal .world-final-links button { font-size:11px; }
.immersive-world #seal .seal-legal { display:flex;justify-content:center;gap:26px;flex-wrap:wrap;margin:0; }
.immersive-world #seal .seal-legal a { font-size:10px;margin:0; }
.immersive-world #seal .seal-meta { gap:8px 20px;margin-top:8px; }
.immersive-world #seal #seal-replay { font-size:10px; }
.immersive-world #seal .site-copyright { font-size:10px;line-height:1.6; }
.immersive-world #seal::before,.immersive-world #seal::after { position:fixed;pointer-events:none; }
.immersive-world #seal::before { height:38vh;background:linear-gradient(180deg,rgba(248,240,221,.85),rgba(248,240,221,.7) 48%,transparent); }
.immersive-world #seal::after { height:45vh;background:linear-gradient(0deg,rgba(248,240,221,.98),rgba(248,240,221,.93) 74%,transparent); }
@media(max-width:1200px) and (orientation:portrait) {
  .immersive-world #seal .seal-head { margin-top:94px; }
  .immersive-world #seal .seal-kicker { max-width:31ch;font-size:10px; }
  .immersive-world #seal .seal-count { font-size:clamp(32px,6vw,54px); }
  .immersive-world #seal .seal-act { margin-top:clamp(180px,27svh,340px); }
  .immersive-world #seal .world-final-links { gap:23px; }
  .immersive-world #seal .seal-landscape img { object-position:50% 50%; }
}
@media(max-width:360px) {
  .immersive-world #seal .seal-head { margin-top:85px; }
  .immersive-world #seal .seal-count { font-size:32px; }
  .immersive-world #seal .seal-act { margin-top:175px; }
  .immersive-world #seal .world-final-links { gap:17px; }
  .immersive-world #seal .world-final-links button { font-size:10px; }
  .immersive-world #seal .seal-legal { gap:20px; }
}
@media(max-height:600px) and (orientation:landscape) {
  .immersive-world #seal .seal-head { margin-top:84px; }
  .immersive-world #seal .seal-count { font-size:36px; }
  .immersive-world #seal .seal-act { margin-top:140px; }
}
@media(max-width:1200px) and (orientation:portrait) {
  .presence-label small { min-height:16px;max-width:none;white-space:nowrap; }
}
@media(max-width:760px) and (max-height:670px) and (orientation:portrait) {
  .presence-caption { bottom:85px; }
  .world-threshold #door-play .play-copy b { display:block;max-width:74px;white-space:normal;line-height:1.4; }
}
.immersive-world #seal .world-final-links button { white-space:nowrap; }
body.immersive-world.sealing #hud .hud-top { background:linear-gradient(180deg,#f8f0dd 65%,rgba(248,240,221,0)); }
@media(min-width:2200px) {
  .presence-label small { font-size:12px; }
  .world-threshold #door-play .play-copy i { font-size:10px; }
  .immersive-world #seal :is(.seal-kicker,.interest-note,.world-final-links button,.seal-legal a,#seal-replay,.site-copyright) { font-size:14px; }
  .immersive-world #seal .seal-line { font-size:18px; }
}
.immersive-world #seal .seal-legal a { min-width:44px;justify-content:center; }
@media(max-width:360px) and (orientation:portrait) {
  .world-threshold #ambient-toggle:not([hidden]) { display:inline-flex;align-items:center;justify-content:flex-end; }
  .world-threshold .threshold-footer { bottom:27px; }
  .presence-caption { bottom:97px; }
}
@media(max-height:360px) and (orientation:landscape) {
  .presence-label { top:max(110px,var(--label-y)); }
}
