:root {
  --bg: #000;
  --ink: #f3f4f6;
  --muted: rgba(243, 244, 246, 0.55);
  --glass: rgba(255, 255, 255, 0.08);
  --accent: #3b82f6;
  --radius: 16px;
  --size: 70; /* how much of the screen the face takes up, in % of width and of height */
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; background: var(--bg); color: var(--ink); }

body {
  font: 500 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Main screen: the face in the middle, black all around ---------- */

.call {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr calc(var(--size) * 1dvh) 1fr;
  justify-items: center;
}

.tile {
  grid-row: 2;
  position: relative;
  width: calc(var(--size) * 1vw);
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
}

.clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.clip.is-live { opacity: 1; }

/* Controls sit centred in the black band under the face. */
.controls {
  grid-row: 3;
  align-self: center;
  display: flex;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: var(--glass);
}

.btn {
  border: 0;
  border-radius: 999px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible, .about-link:focus-visible, .back:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.btn-next {
  min-width: 132px;
  padding: 12px 28px;
  background: var(--accent);
  font-weight: 650;
  font-size: 16px;
}
.btn-next:hover { background: #2f6fe0; }

.btn-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.1);
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.2); }

.about-link {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  padding: 6px 4px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.about-link:hover { color: var(--ink); }

/* Full screen: the face fills the whole screen, controls float over it. */
.call.is-full .tile {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.call.is-full .controls {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}
.call.is-full .about-link { display: none; }

/* Fade the controls away when idle; any movement brings them back. */
.controls, .about-link { transition: opacity 0.6s ease; }
.call.is-idle .controls,
.call.is-idle .about-link { opacity: 0; }
.call.is-idle { cursor: none; }

@media (prefers-reduced-motion: reduce) {
  .clip, .controls, .about-link { transition: none; }
}

/* ---------- About page ---------- */

.page { display: grid; place-items: center; min-height: 100dvh; padding: 32px 22px; }
.about { max-width: 34rem; }
.about h1 { font-size: 22px; font-weight: 650; margin-bottom: 18px; }
.about p { font-size: 17px; line-height: 1.6; color: rgba(243, 244, 246, 0.85); margin-bottom: 14px; }
.back { display: inline-block; margin-top: 18px; padding: 6px 0; color: var(--ink); text-decoration: none; }
.back:hover { text-decoration: underline; }
