/* The showcase film: a 1080×1920 stage (1920×1080 in the wide format) whose every element
   is positioned from script, one frame at a time. Nothing here may animate on the browser's own clock (no
   transitions, no keyframes): the frame-by-frame render would never see it. */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500 700;
  font-display: block;
  src: url('assets/fonts/cormorant-garamond.woff2') format('woff2');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500 700;
  font-display: block;
  src: url('assets/fonts/cormorant-garamond-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 300 800;
  font-display: block;
  src: url('assets/fonts/source-sans-3.woff2') format('woff2');
}

:root {
  --ink: #06050d;
  --violet: #8b5cf6;
  --violet-light: #a78bfa;
  --violet-deep: #6d28d9;
  --glow: rgba(139, 92, 246, 0.42);
  --text: #ffffff;
  --text-2: #cfc9e3;
  --text-3: #8f89a8;
  --serif: 'Cormorant Garamond', serif;
  --sans: 'Source Sans 3', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: #000;
}

body {
  font-family: var(--sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Stage ---------- */

.viewport {
  position: fixed;
  inset: 0 0 var(--controls-h, 0px) 0;
  overflow: hidden;
}

/* Centred on the viewport and scaled about its own centre to fit it. */
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--stage-w, 1080px);
  height: var(--stage-h, 1920px);
  margin: calc(var(--stage-h, 1920px) / -2) 0 0 calc(var(--stage-w, 1080px) / -2);
  overflow: hidden;
  background: var(--ink);
  transform: scale(var(--fit, 1));
  contain: strict;
}

.render .stage {
  left: 0;
  top: 0;
  margin: 0;
}

.layer {
  position: absolute;
  inset: 0;
  perspective: 2400px;
  perspective-origin: 50% 42%;
  pointer-events: none;
}

.scene-root {
  position: absolute;
  inset: 0;
  perspective: 2400px;
  perspective-origin: 50% 42%;
}

/* The phone and the cards around it, laid out on the tall stage and moved as one onto
   whichever stage is showing. */
.rig {
  position: absolute;
  left: 0;
  top: 0;
  width: 1080px;
  height: 1920px;
  transform: translate(var(--rig-x, 0px), var(--rig-y, 0px)) scale(var(--rig-s, 1));
  transform-origin: 0 0;
}

/* ---------- Sky ---------- */

.sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 70% 8%, #221446 0%, transparent 60%),
    linear-gradient(180deg, #0b0820 0%, #120c2c 45%, #08061a 100%);
}

/* Each photograph is centred and a little larger than the stage, so it can drift without
   showing an edge. */
.sky-photo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1242px;
  height: 2688px;
  margin: -1344px 0 0 -621px;
  will-change: transform, opacity;
}

.sky-photo--wisp {
  height: 2208px;
  margin-top: -1104px;
}

.sky-photo--haze {
  mix-blend-mode: screen;
  opacity: 0.34;
}

/* The cloud bank rises from below; its top fades out so the edge never shows. */
.sky-photo--clouds {
  width: 1080px;
  height: 2336px;
  margin: -1168px 0 0 -540px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
}

/* The wide stage has its own, wide photographs. */
.wide .sky-photo {
  width: 2208px;
  height: 1242px;
  margin: -621px 0 0 -1104px;
}

.sky-stars {
  position: absolute;
  inset: 0;
}

.sky-dim {
  position: absolute;
  inset: 0;
  background: #030209;
  opacity: 0;
}

/* ---------- Phone ---------- */

.phone {
  position: absolute;
  left: calc(50% - var(--phone-w) / 2);
  top: var(--phone-top);
  width: var(--phone-w);
  height: var(--phone-h);
}

.phone-glow {
  position: absolute;
  inset: -18% -40%;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.38), rgba(109, 40, 217, 0.12) 55%, transparent 100%);
}

.phone-body {
  position: absolute;
  inset: 0;
  padding: var(--bezel);
  border-radius: calc(var(--screen-r) + var(--bezel));
  background: linear-gradient(155deg, #5a5375 0%, #2c2840 26%, #1b1828 58%, #3d3654 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
    inset 0 0 0 5px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(170, 150, 235, 0.18),
    0 60px 140px rgba(6, 2, 22, 0.8);
}

.phone-key {
  position: absolute;
  width: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #2a2639, #5a5375);
}

.phone-key--action { left: -5px; top: 15%; height: 4.5%; }
.phone-key--up { left: -5px; top: 22%; height: 7.5%; }
.phone-key--down { left: -5px; top: 31%; height: 7.5%; }
.phone-key--power { right: -5px; top: 24%; height: 11%; transform: scaleX(-1); }

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--screen-r);
  background: #000;
  isolation: isolate;
}

.phone-content {
  position: absolute;
  inset: 0;
}

.phone-status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 54px 0 66px;
  font: 600 31px/1 var(--sans);
  color: #fff;
  pointer-events: none;
}

.phone-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-island {
  position: absolute;
  top: 26px;
  left: 50%;
  width: 178px;
  height: 52px;
  margin-left: -89px;
  border-radius: 26px;
  background: #000;
}

.phone-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 34%);
  pointer-events: none;
}

/* ---------- Preview controls (never rendered into video) ---------- */

.controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--controls-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: #0d0b16;
  border-top: 1px solid #221d33;
  font: 500 14px/1 var(--sans);
  color: var(--text-2);
}

.controls[hidden] {
  display: none;
}

.controls button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  cursor: pointer;
}

.controls button .icon-pause,
.controls.playing button .icon-play {
  display: none;
}

.controls.playing button .icon-pause {
  display: block;
}

.controls-track {
  position: relative;
  flex: 1;
}

.controls-track input {
  width: 100%;
  accent-color: var(--violet);
}

.controls-marks {
  position: absolute;
  inset: -16px 0 auto 0;
  height: 14px;
  font-size: 11px;
  color: var(--text-3);
}

.controls-marks span {
  position: absolute;
  white-space: nowrap;
  border-left: 1px solid #3a3352;
  padding-left: 4px;
}

.controls-time {
  min-width: 112px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
