/* fx.css: the scene layer that fx-scene.js and fx-ui.js build on every page (and on the login page):
   the two full-window canvases, the hologram's call-outs, the ticker, Nefi and its speech bubble,
   the hearth, the scene switches, the pointer light, the start-up curtain. No page data lives here. */
:root { --fx-cy: #62e0ff; --fx-am: #ffb35c; --fx-ink: #eaf2ff; --fx-ink2: #a9b9d2; --fx-ink3: #72839f; --fx-line: rgba(150, 196, 255, .2);
  --fx-display: "Jura", system-ui, sans-serif; --fx-text: "Geist", system-ui, sans-serif; --fx-mono: "Geist Mono", ui-monospace, monospace; }

.fx-canvas { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; display: block; }
#fx-orb { z-index: 1; }
html.fx-nogl body { background: radial-gradient(1200px 700px at 72% 18%, rgba(40, 110, 160, .28), transparent 60%), radial-gradient(900px 600px at 8% 100%, rgba(255, 130, 40, .16), transparent 60%), #04070e; background-attachment: fixed; }

/* ---------------------------------------------------------------- call-outs around the hologram */
.fx-hud { position: fixed; inset: 0; z-index: 1; pointer-events: none; transition: opacity .4s; }
.fx-hud svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fx-hud svg path { fill: none; stroke: var(--fx-cy); stroke-width: 1; opacity: .55; }
.fx-hud svg circle { fill: var(--fx-cy); }
.fx-call { position: absolute; left: 0; top: 0; padding-left: 10px; border-left: 1px solid var(--fx-cy); white-space: nowrap; opacity: 0; animation: fx-call .7s cubic-bezier(.2, .7, .2, 1) forwards; }
.fx-call:nth-of-type(2) { animation-delay: .12s; } .fx-call:nth-of-type(3) { animation-delay: .24s; } .fx-call:nth-of-type(4) { animation-delay: .36s; }
.fx-call b { display: block; font: 500 21px/1.1 var(--fx-display); letter-spacing: .04em; color: var(--fx-ink); text-shadow: 0 0 16px rgba(98, 224, 255, .7); font-variant-numeric: tabular-nums; }
.fx-call span { display: block; font: 400 12px/1.4 var(--fx-text); color: var(--fx-ink2); margin-top: 2px; }
.fx-call.warn { border-left-color: var(--fx-am); } .fx-call.warn b { text-shadow: 0 0 16px rgba(255, 179, 92, .8); color: #ffd9a8; }
@keyframes fx-call { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 -20% 0 0); } }
.fx-pin { position: absolute; left: 0; top: 0; padding: 7px 11px; border: 1px solid var(--fx-cy); border-radius: 10px; background: rgba(6, 12, 24, .9); white-space: nowrap;
  opacity: 0; transition: opacity .18s; box-shadow: 0 0 22px rgba(98, 224, 255, .35); z-index: 3; }
.fx-pin.on { opacity: 1; }
.fx-pin.short { border-color: var(--fx-am); box-shadow: 0 0 22px rgba(255, 179, 92, .35); }
.fx-pin b { display: block; font: 600 15px/1.2 var(--fx-display); letter-spacing: .05em; color: var(--fx-ink); }
.fx-pin span { display: block; font: 400 12px/1.35 var(--fx-text); color: var(--fx-ink2); }
.fx-ring { position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 1px solid var(--fx-cy); border-radius: 50%; opacity: 0; transition: opacity .18s; animation: fx-spin 4s linear infinite; border-top-color: transparent; }
.fx-ring.on { opacity: 1; } .fx-ring.short { border-color: var(--fx-am); border-top-color: transparent; }
@keyframes fx-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- the tape: every coin held, drifting by */
.fx-tape { position: relative; overflow: hidden; height: 34px; border: 1px solid rgba(150, 196, 255, .11); border-radius: 999px; background: rgba(8, 14, 27, .5);
  -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.fx-tape-in { display: flex; width: max-content; height: 100%; align-items: center; animation: fx-tape linear infinite; }
.fx-tape:hover .fx-tape-in { animation-play-state: paused; }
.fx-tape button { all: unset; display: inline-flex; align-items: baseline; gap: 7px; padding: 0 16px; font: 500 13px/34px var(--fx-display); letter-spacing: .05em; color: var(--fx-ink2); cursor: pointer; white-space: nowrap; transition: color .15s, text-shadow .15s; }
.fx-tape button i { width: 6px; height: 6px; border-radius: 50%; background: var(--fx-cy); align-self: center; box-shadow: 0 0 8px var(--fx-cy); }
.fx-tape button.short i { background: var(--fx-am); box-shadow: 0 0 8px var(--fx-am); }
.fx-tape button b { font: 500 12.5px var(--fx-text); font-variant-numeric: tabular-nums; }
.fx-tape button b.up { color: #5fe8a8; } .fx-tape button b.down { color: #ff6f82; }
.fx-tape button:hover, .fx-tape button:focus-visible { color: #fff; text-shadow: 0 0 14px var(--fx-cy); }
@keyframes fx-tape { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- the cabin's lower half: Nefi, the hearth, the switches */
.fx-side { order: 3; flex: 1 0 auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; min-height: 0; }
.fx-warm { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; pointer-events: none; opacity: 0;
  background: radial-gradient(120% 70% at 50% 100%, rgba(255, 122, 40, .34), rgba(255, 122, 40, .08) 45%, transparent 75%); mix-blend-mode: screen; }
.fx-pal { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 4px; align-items: end; }
.fx-nefi { width: 78px; cursor: pointer; -webkit-tap-highlight-color: transparent; outline-offset: 2px; border-radius: 16px; }
.fx-nefi svg { display: block; width: 100%; height: auto; overflow: visible; }
.nf-float { animation: nf-bob 3.4s ease-in-out infinite; transform-box: fill-box; }
@keyframes nf-bob { 50% { transform: translateY(-4px); } }
.nf-head { fill: #16243f; stroke: rgba(98, 224, 255, .7); stroke-width: 1.2; }
.nf-visor { fill: #040913; stroke: rgba(98, 224, 255, .35); stroke-width: 1; }
.nf-body { fill: #132038; stroke: rgba(98, 224, 255, .55); stroke-width: 1.2; }
.nf-eye { fill: var(--fx-cy); filter: drop-shadow(0 0 4px var(--fx-cy)); transform-box: fill-box; transform-origin: center; transition: transform .09s; }
.nf-eye-h, .nf-eye-z { fill: none; stroke: var(--fx-cy); stroke-width: 2.6; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--fx-cy)); display: none; }
.nf-smile { fill: none; stroke: var(--fx-cy); stroke-width: 1.6; stroke-linecap: round; opacity: .85; }
.nf-cheek { fill: #ff8fa8; opacity: 0; transition: opacity .3s; }
.nf-tip { fill: var(--fx-am); filter: drop-shadow(0 0 5px var(--fx-am)); animation: nf-tip 2.2s ease-in-out infinite; }
@keyframes nf-tip { 50% { opacity: .45; } }
.nf-ant, .nf-arm { fill: none; stroke: rgba(98, 224, 255, .7); stroke-width: 2.4; stroke-linecap: round; }
.nf-heart { fill: var(--fx-cy); filter: drop-shadow(0 0 6px var(--fx-cy)); animation: nf-tip 1.4s ease-in-out infinite; }
.nf-jet { fill: var(--fx-cy); opacity: .35; filter: blur(2px); animation: nf-jet 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes nf-jet { 50% { transform: scaleX(.7); opacity: .2; } }
.nf-umb { display: none; }
.nf-umb path { fill: rgba(98, 224, 255, .16); stroke: var(--fx-cy); stroke-width: 1.2; }
.nf-umb line { stroke: var(--fx-cy); stroke-width: 1.6; stroke-linecap: round; }
.nf-zzz { font: 600 11px var(--fx-display); fill: var(--fx-ink2); display: none; animation: nf-zzz 3s ease-in-out infinite; }
@keyframes nf-zzz { 0% { opacity: 0; transform: translate(0, 4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(5px, -8px); } }
.fx-nefi.rain .nf-umb { display: block; }
.fx-nefi.blink .nf-eye { transform: scaleY(.08); }
.fx-nefi.happy .nf-eye, .fx-nefi.sleepy .nf-eye, .fx-nefi.shy .nf-eye { display: none; }
.fx-nefi.happy .nf-eye-h { display: block; } .fx-nefi.happy .nf-cheek { opacity: .55; }
.fx-nefi.sleepy .nf-eye-z, .fx-nefi.shy .nf-eye-z { display: block; } .fx-nefi.sleepy .nf-zzz { display: block; }
.fx-nefi.alert .nf-eye, .fx-nefi.alert .nf-heart { fill: var(--fx-am); filter: drop-shadow(0 0 5px var(--fx-am)); }
.fx-nefi.jump svg { animation: nf-jump .7s cubic-bezier(.2, .7, .2, 1); }
@keyframes nf-jump { 30% { transform: translateY(-16px) rotate(-8deg); } 60% { transform: translateY(0) rotate(6deg); } 100% { transform: none; } }
.fx-nefi:hover .nf-cheek { opacity: .55; }
.fx-bubble { position: relative; border: 1px solid var(--fx-line); border-radius: 14px 14px 14px 4px; background: rgba(8, 14, 27, .72); padding: 10px 12px; min-height: 76px; margin-bottom: 14px;
  font: 400 12.5px/1.5 var(--fx-text); color: var(--fx-ink2); cursor: pointer; transition: border-color .25s, box-shadow .25s; }
.fx-bubble:hover { border-color: var(--fx-cy); box-shadow: 0 0 18px rgba(98, 224, 255, .2); }
.fx-bubble b { display: block; font: 600 11.5px/1.2 var(--fx-display); letter-spacing: .08em; color: var(--fx-cy); margin-bottom: 3px; }
.fx-bubble p { margin: 0; }
.fx-bubble p::after { content: ""; display: inline-block; width: 6px; height: 12px; margin-left: 2px; background: var(--fx-cy); vertical-align: -2px; animation: fx-caret 1s steps(2) infinite; }
@keyframes fx-caret { 50% { opacity: 0; } }

.fx-hearth { position: relative; border-radius: 80px 80px 14px 14px; padding: 7px 7px 0; background: linear-gradient(180deg, #2a2019, #15100d); border: 1px solid rgba(255, 179, 92, .25);
  box-shadow: 0 0 34px rgba(255, 120, 40, .16), inset 0 1px 0 rgba(255, 220, 180, .12); cursor: pointer; }
.fx-hearth canvas { display: block; width: 100%; aspect-ratio: 1.3; border-radius: 74px 74px 6px 6px; background: #0a0705; }
.fx-hearth span { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 500 11.5px/1 var(--fx-display); letter-spacing: .08em; color: #c9a57f; padding: 8px 6px 9px; }
.fx-hearth span i { font: 400 10.5px/1 var(--fx-text); font-style: normal; color: #8a7460; letter-spacing: 0; white-space: nowrap; }
.fx-hearth.off canvas { opacity: .25; filter: grayscale(.6); }

.fx-ctl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fx-ctl button { all: unset; box-sizing: border-box; display: grid; justify-items: center; gap: 4px; padding: 8px 2px 7px; border: 1px solid rgba(150, 196, 255, .14); border-radius: 12px; cursor: pointer;
  font: 500 10.5px/1.2 var(--fx-display); letter-spacing: .04em; color: var(--fx-ink3); text-align: center; transition: color .2s, border-color .2s, background .2s, box-shadow .2s; }
.fx-ctl button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fx-ctl button:hover { color: var(--fx-ink); border-color: var(--fx-line); }
.fx-ctl button:focus-visible { outline: 2px solid #a3eeff; outline-offset: 2px; }
.fx-ctl button.on { color: var(--fx-cy); border-color: rgba(98, 224, 255, .45); background: rgba(98, 224, 255, .08); box-shadow: 0 0 14px rgba(98, 224, 255, .15); }
.fx-ctl button.on.warm { color: var(--fx-am); border-color: rgba(255, 179, 92, .45); background: rgba(255, 179, 92, .08); box-shadow: 0 0 14px rgba(255, 179, 92, .15); }

/* narrow screens: Nefi floats in a corner, the hearth closes the page */
.fx-float { position: fixed; z-index: 28; right: 10px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: 58px; }
.fx-float .fx-bubble { position: absolute; right: 64px; bottom: 6px; width: min(240px, 68vw); margin: 0; border-radius: 14px 14px 4px 14px; opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .25s, transform .25s; }
.fx-float.say .fx-bubble { opacity: 1; pointer-events: auto; transform: none; }
.fx-hearth-card { max-width: 440px; margin-inline: auto; width: 100%; display: grid; gap: 10px; justify-self: center; }

/* ---------------------------------------------------------------- pointer light, tilt, the click ripple */
.fx-cursor { position: fixed; left: 0; top: 0; z-index: 90; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 1px solid rgba(98, 224, 255, .7); pointer-events: none;
  transition: width .2s, height .2s, margin .2s, background .2s, border-color .2s, opacity .3s; opacity: 0; box-shadow: 0 0 14px rgba(98, 224, 255, .35); }
.fx-cursor.on { opacity: 1; }
.fx-cursor.hot { width: 46px; height: 46px; margin: -23px 0 0 -23px; background: rgba(98, 224, 255, .1); border-color: #a3eeff; }
.fx-cursor.grab { width: 60px; height: 60px; margin: -30px 0 0 -30px; border-style: dashed; }
.fx-ripple { position: fixed; z-index: 89; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 1px solid var(--fx-cy); pointer-events: none; animation: fx-ripple .6s ease-out forwards; }
@keyframes fx-ripple { to { transform: scale(7); opacity: 0; } }
.fx-progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 80; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--fx-cy), var(--fx-am)); box-shadow: 0 0 12px var(--fx-cy); pointer-events: none; }

/* sections rise once as they enter */
.fx-enter { animation: fx-enter .8s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes fx-enter { from { opacity: 0; transform: translateY(22px) scale(.985); filter: blur(6px); } }
.fx-rise { opacity: 0; transform: translateY(22px) scale(.985); filter: blur(6px); }
.fx-rise.in { opacity: 1; transform: none; filter: none; transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1), filter .7s; }
body.fx-tick main::after { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 30vh; pointer-events: none; z-index: 70;
  background: linear-gradient(180deg, transparent, rgba(98, 224, 255, .07) 70%, rgba(98, 224, 255, .22)); animation: fx-scan 1.1s ease-in forwards; }
@keyframes fx-scan { from { transform: translateY(-30vh); } to { transform: translateY(100vh); opacity: 0; } }

/* ---------------------------------------------------------------- the start-up curtain (once per visit) */
.fx-boot { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: #04070e; transition: opacity .7s ease, visibility 0s .7s; }
.fx-boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.fx-boot div { width: min(340px, 78vw); font: 400 12.5px/1.9 var(--fx-mono); color: var(--fx-ink2); }
.fx-boot b { display: block; font: 500 20px/1.2 var(--fx-display); letter-spacing: .12em; color: var(--fx-ink); margin-bottom: 14px; text-shadow: 0 0 18px rgba(98, 224, 255, .6); }
.fx-boot p { margin: 0; display: flex; justify-content: space-between; opacity: 0; animation: fx-line .3s forwards; }
.fx-boot p:nth-of-type(2) { animation-delay: .22s; } .fx-boot p:nth-of-type(3) { animation-delay: .44s; } .fx-boot p:nth-of-type(4) { animation-delay: .66s; }
.fx-boot p i { font-style: normal; color: var(--fx-cy); }
.fx-boot span { display: block; height: 2px; margin-top: 14px; background: rgba(150, 196, 255, .15); overflow: hidden; }
.fx-boot span::after { content: ""; display: block; height: 100%; background: linear-gradient(90deg, var(--fx-cy), var(--fx-am)); transform-origin: 0 50%; animation: fx-load 1.1s cubic-bezier(.3, .7, .2, 1) forwards; }
@keyframes fx-line { to { opacity: 1; } }
@keyframes fx-load { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* moving between pages: the cabin stays, the stage cross-fades */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fx-vt-out .22s ease both; }
::view-transition-new(root) { animation: fx-vt-in .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes fx-vt-out { to { opacity: 0; filter: blur(6px); } }
@keyframes fx-vt-in { from { opacity: 0; transform: scale(1.012); filter: blur(8px); } }

@media (max-width: 1099px) { .fx-hud .fx-call, .fx-hud svg { display: none; } .fx-cursor { display: none; } }
@media (hover: none) { .fx-cursor { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .nf-float, .nf-tip, .nf-heart, .nf-jet, .fx-tape-in, .fx-ring, .fx-call { animation: none; }
  .fx-call { opacity: 1; }
  .fx-rise { opacity: 1; transform: none; filter: none; } .fx-enter { animation: none; }
  .fx-cursor, .fx-ripple { display: none; }
  body.fx-tick main::after { display: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
