/* ============================================================
   built by alish_ — the PLAYER: a full-screen, immersive stage
   for a live embedded prototype. On-brand chrome, an ambient
   glow that drifts with the cursor, a cinematic load-in, and a
   real way back to the case study.
   ============================================================ */

html, body { height: 100%; overflow: hidden; background: var(--paper); }
body { display: flex; }

/* ambient glow — a soft blue spotlight that drifts toward the pointer,
   giving the stage depth without costing a real-time canvas */
.player__glow {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(680px 680px at var(--gx, 50%) var(--gy, 42%),
    color-mix(in srgb, var(--blue) 16%, transparent), transparent 68%);
  transition: background-position .6s ease;
}

.player { position: relative; z-index: 2; width: 100%; min-height: 100svh; min-height: 100vh;
  display: flex; flex-direction: column; padding: 22px var(--mx) calc(env(safe-area-inset-bottom, 0px) + 20px); }

/* ---------- top bar ---------- */
.player__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.player__back { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); display: inline-flex;
  align-items: center; gap: 8px; transition: color .2s; }
.player__back:hover { color: var(--blue-ink); }
.player__brand { font-family: var(--serif); font-size: 1.1rem; letter-spacing: -.01em; }
.player__brand em { font-style: italic; color: var(--ink-2); }
.player__brand i { color: var(--blue-ink); font-style: normal; }
.player__tools { display: flex; gap: 8px; }

/* ---------- meta / title ---------- */
.player__meta { text-align: center; margin: clamp(14px, 3vh, 30px) 0 0; }
.player__k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--blue-ink); display: inline-block; margin-bottom: 10px; }
.player__title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1; margin: 0 0 8px; letter-spacing: -.01em; }
.player__sub { font-family: var(--serif); font-style: italic; color: var(--ink-2);
  font-size: clamp(1rem, 2vw, 1.2rem); margin: 0; }

/* ---------- stage ---------- */
.player__stage { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; min-height: 0; }

.player__loading { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.player__spinner { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line);
  border-top-color: var(--blue); animation: playerSpin 0.9s linear infinite; }
@keyframes playerSpin { to { transform: rotate(360deg); } }
.player__loading-txt { font-family: var(--mono); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin: 0; }
.player__loading-txt i { color: var(--blue-ink); font-style: normal; animation: playerBlink 1s step-end infinite; }
@keyframes playerBlink { 50% { opacity: 0; } }
.player__loading.gone { display: none; }

/* the device wrapper: fixed 402x934 content, scaled + centered, revealed with a
   soft rise+fade once the runtime has actually loaded (not before) */
.player__device { position: relative; opacity: 0; transform: translateY(18px) scale(.98);
  transition: opacity .55s cubic-bezier(.2,.8,.2,1), transform .55s cubic-bezier(.2,.8,.2,1); }
.player__device.in { opacity: 1; transform: none; }
.player__if { position: absolute; top: 0; left: 0; width: 402px; height: 934px; border: 0;
  background: transparent; transform-origin: top left;
  filter: drop-shadow(0 50px 100px rgba(10,16,40,.35)); }

/* ---------- bottom bar ---------- */
.player__ctrl { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(14px, 3vh, 26px); }
.player__btn { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); cursor: pointer; background: transparent;
  border: 1px solid var(--line); border-radius: 100px; padding: 9px 18px; transition: border-color .2s, color .2s, opacity .2s; }
.player__btn:hover { border-color: var(--blue); color: var(--blue-ink); }
.player__btn:disabled { opacity: .4; cursor: not-allowed; }
.player__hint { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .03em; text-align: center; }

@media (max-width: 560px) {
  .player__bar { justify-content: center; text-align: center; }
  .player__ctrl { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .player__glow { transition: none; }
  .player__device { transition: opacity .2s linear; transform: none !important; }
  .player__spinner { animation-duration: 1.6s; }
}
