/* Reception kiosk.
   Dark, quiet, emoji-free. This screen sits in a client's foyer next to their
   own branding, so it reads as furniture rather than as a web page: no chrome,
   no scrollbars, nothing tappable that is not meant to be tapped. */

:root {
  --bg: #0b0d10;
  --surface: #14181d;
  --ink: #f4f6f8;
  --ink-dim: #9aa4b1;
  --accent: #c9a227;          /* warm gold — legible on dark, not corporate blue */
  --accent-ink: #14181d;
  --live: #3fb950;
  --radius: 18px;
  --pad: clamp(24px, 5vw, 64px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;              /* no scrollbars, ever */
  overscroll-behavior: none;     /* no rubber-band on a touchscreen */
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  /* Nothing on a kiosk should be selectable, long-pressable or highlight on tap
     — every one of those leaves the screen in a state the next guest inherits. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ─── Screens ──────────────────────────────────────────────────────────────
   100dvh, not 100vh: on a phone, vh includes the browser chrome and clips the
   bottom of the layout — which is exactly where the Done button lives. */
.screen {
  position: fixed;
  inset: 0;
  height: 100dvh;
  display: none;
  align-items: center;
  justify-content: center;
  padding:
    calc(var(--pad) + env(safe-area-inset-top))
    calc(var(--pad) + env(safe-area-inset-right))
    calc(var(--pad) + env(safe-area-inset-bottom))
    calc(var(--pad) + env(safe-area-inset-left));
}
.screen.is-active { display: flex; }

.idle-inner {
  width: min(720px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.2vh, 26px);
}

.venue {
  margin: 0;
  font-size: clamp(13px, 1.5vw, 16px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.headline {
  margin: 0;
  font-size: clamp(40px, 8vw, 88px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.welcome {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(17px, 2.4vw, 24px);
  line-height: 1.5;
  color: var(--ink-dim);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────
   Nothing here is under 64px tall. A foyer kiosk is tapped by people holding
   bags, wearing gloves, or not looking directly at it. */
.btn-primary,
.btn-secondary,
.btn-ptt {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease, background-color .12s ease;
}
.btn-primary:active,
.btn-secondary:active,
.btn-ptt:active { transform: scale(0.97); }

.btn-primary {
  margin-top: clamp(8px, 2vh, 20px);
  min-height: 84px;
  padding: 0 clamp(40px, 6vw, 72px);
  font-size: clamp(19px, 2.6vw, 26px);
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary[disabled] { opacity: .45; cursor: default; }

.btn-secondary {
  min-height: 64px;
  padding: 0 40px;
  font-size: clamp(16px, 2vw, 19px);
  background: rgba(20, 24, 29, .72);
  backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, .16);
  color: var(--ink);
}

/* ─── Live conversation ────────────────────────────────────────────────────
   The guide fills the screen. object-fit: cover crops rather than letterboxes,
   which is right for a portrait kiosk showing a head-and-shoulders replica. */
#pal-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg);
}

/* Self-view. Deliberately small and deliberately present: the guide's perception
   layer is reading this feed, so the guest gets to see what it sees. Mirrored,
   the way every video call does it — an unmirrored self-view reads as wrong to
   anyone who has ever used one. */
#self-video {
  position: absolute;
  right: calc(20px + env(safe-area-inset-right));
  top: calc(20px + env(safe-area-inset-top));
  width: clamp(96px, 13vw, 168px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  transform: scaleX(-1);
  z-index: 2;
}

.live-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: inherit;
  pointer-events: none;          /* the video is not a control; the buttons re-enable */
}
.live-top,
.live-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}
.live-bottom {
  flex-direction: column;
  gap: clamp(14px, 2.5vh, 28px);
}
.live-overlay button { pointer-events: auto; }

.warning {
  padding: 12px 22px;
  border-radius: 999px;
  font-size: clamp(14px, 1.8vw, 17px);
  background: rgba(20, 24, 29, .82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .16);
  color: var(--ink);
}

/* ─── Push to talk ─────────────────────────────────────────────────────────
   With the mic muted by default, a guest who cannot see the state will talk
   into a dead microphone and conclude the thing is broken. The state pill is
   not decoration — it is the whole reason push-to-talk is usable. */
.ptt-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}

.ptt-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: clamp(14px, 1.8vw, 17px);
  background: rgba(20, 24, 29, .82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .16);
  color: var(--ink-dim);
}
.ptt-state::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink-dim);
  flex: none;
}
.ptt-state.is-live { color: var(--ink); }
.ptt-state.is-live::before {
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(63, 185, 80, .7);
  animation: ping 1.6s ease-out infinite;
}

.btn-ptt {
  min-height: 96px;
  padding: 0 clamp(44px, 7vw, 88px);
  font-size: clamp(19px, 2.6vw, 26px);
  background: var(--surface);
  border-color: rgba(255, 255, 255, .22);
  color: var(--ink);
}
.btn-ptt.is-held {
  background: var(--live);
  border-color: var(--live);
  color: #08140c;
}

/* ─── Motion ───────────────────────────────────────────────────────────────*/
.pulse {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .9;
  animation: breathe 1.7s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(.82); opacity: .45; }
  50%      { transform: scale(1);   opacity: .95; }
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0   rgba(63, 185, 80, .7); }
  100% { box-shadow: 0 0 0 14px rgba(63, 185, 80, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .pulse { opacity: .9; transform: none; }
}

/* ─── Short landscape (a laptop, or a tablet turned sideways) ───────────────*/
@media (max-height: 560px) {
  .headline { font-size: clamp(30px, 6vh, 46px); }
  .btn-primary { min-height: 68px; }
  .btn-ptt { min-height: 72px; }
}
