/* Shared stage for all UX-pattern "videos".
   The stage is a fixed 1080×1080 canvas (Figma "mood" frame) that is scaled
   to fit its container, so every pattern can use exact Figma pixel values. */

:root {
  /* HiveEnergy design system — blue scale */
  --blue-50: #eff6ff;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --white: #ffffff;

  --stage-bg: var(--blue-300);
  --frame: var(--blue-200);

  /* page around the stage (only for the test room) */
  --page-bg: #f4f6fa;
  --page-fg: #1e293b;
  --page-muted: #64748b;
  --ctrl-bg: #ffffff;
  --ctrl-border: #dbe3ee;

  --font-ui: "Google Sans Flex", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page-bg: #0b1120;
    --page-fg: #e2e8f0;
    --page-muted: #94a3b8;
    --ctrl-bg: #131c2e;
    --ctrl-border: #24324a;
  }
}
:root[data-theme="dark"] {
  --page-bg: #0b1120;
  --page-fg: #e2e8f0;
  --page-muted: #94a3b8;
  --ctrl-bg: #131c2e;
  --ctrl-border: #24324a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--page-fg);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}
.page h1 { font-size: 22px; font-weight: 500; margin: 0 0 4px; }
.page p.lead { margin: 0 0 20px; color: var(--page-muted); font-size: 15px; line-height: 1.5; }

/* ---------- Stage (the "video") ---------- */

.stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  background: var(--stage-bg);
}

.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1080px;
  transform-origin: 0 0;
  background: var(--stage-bg);
  font-family: var(--font-ui);
  font-variation-settings: "GRAD" 0, "ROND" 0, "wdth" 100;
}

.camera {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* Light frame instead of a phone mockup: 402×874 screen + 31px outside border */
.device {
  position: absolute;
  left: 308px;
  top: 72px;
  width: 464px;
  height: 936px;
  padding: 31px;
  border-radius: 55px;
  background: var(--frame);
}

.screen {
  position: relative;
  width: 402px;
  height: 874px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--white);
}

/* Layer with the same origin as .screen, not clipped, for the touch indicator */
.touch-layer {
  position: absolute;
  left: 339px;
  top: 103px;
  width: 402px;
  height: 874px;
  pointer-events: none;
}

/* ---------- Touch indicator (Figma: Ellipse 1) ---------- */

.touch {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  visibility: hidden;
}
.touch > * {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.touch .halo {
  width: 102px;
  height: 102px;
  background: rgb(59 130 246 / 0.1);
}
.touch .ripple {
  width: 60px;
  height: 60px;
  border: 3px solid var(--blue-500);
  opacity: 0;
}
.touch .dot {
  width: 60px;
  height: 60px;
  background: var(--blue-400);
}

/* ---------- Controls (outside the video) ---------- */

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.controls button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--ctrl-border);
  background: var(--ctrl-bg);
  color: var(--page-fg);
  cursor: pointer;
}
.controls button:focus-visible,
.controls input:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.controls svg { width: 18px; height: 18px; }
.controls input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--blue-500);
}
.controls .time {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--page-muted);
  min-width: 70px;
  text-align: right;
}

/* ---------- Embed (Playground-Karte auf der Website) ----------
   Nur die Animation, randlos und transparent: die Kartenfarbe (inkl. Hover) scheint durch. */

.embed body { background: transparent; }
.embed .page {
  display: grid;
  place-items: center;
  max-width: none;
  height: 100vh;
  padding: 0;
}
.embed .page > h1,
.embed .page > .lead,
.embed .controls { display: none; }
.embed .stage-wrap,
.embed .stage { background: transparent; border-radius: 0; }
.embed .stage-wrap { width: min(100vw, 100vh); }
