:root {
  --neutral: #e9e4dc;
  --neutral-warm: #efeae2;
  --panel: #ece7df;
  --ink: #1c1a17;
  --muted: #8c8576;
  --gold: #c8a45c;
  --gold-soft: #d9be86;
  --gold-deep: #9c7726;   /* richer, readable on beige */
  --black: #14110d;
}

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

html, body {
  height: 100%;
  background: var(--neutral);
  color: var(--ink);
  font-family: 'Jost', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Full-bleed ambient palm-loop video; concierge content floats on a frosted card */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* poster frame is the fallback before the video plays / if autoplay is blocked */
  background: #14110d center / cover no-repeat url('/media/qualia_palm_landscape_poster.jpg');
}
.bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .bg-video { display: none; }   /* honour reduced-motion: keep the still poster */
}

/* Concierge content - sits centered over the warm wall */
/* Concierge content - mounts on the sunlit wall (right of frame), as composed */
.panel {
  position: relative;
  z-index: 2;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(440px, 86vw);
  padding:
    calc(clamp(20px, 4vh, 44px) + env(safe-area-inset-top, 0px))
    clamp(20px, 4vh, 44px)
    calc(clamp(20px, 4vh, 44px) + env(safe-area-inset-bottom, 0px));
  /* bias toward the wall side of the scene */
  margin-left: auto;
  margin-right: clamp(6px, 7vw, 150px);
  gap: clamp(10px, 2vh, 22px);
}
/* soft warm light-halo behind the content: follows the panel in any orientation,
   nearly invisible on the bright landscape wall, lifts text over the portrait
   palm-shadow so the brand + bell stay legible. Sits between video and content. */
.panel::before {
  content: ''; position: absolute; z-index: -1; inset: -6% -8%;
  pointer-events: none;
  background: radial-gradient(58% 52% at 50% 46%, rgba(248,244,237,.62), rgba(248,244,237,.26) 52%, transparent 76%);
  filter: blur(8px);
}

/* Language */
/* Frosted-glass pill - Apple liquid-glass *approximation* per taste-skill's
   honesty rule (real liquid-glass-js is vendored under /vendor for reference). */
.lang.glass {
  position: fixed;
  top: calc(28px + env(safe-area-inset-top, 0px));
  right: calc(28px + env(safe-area-inset-right, 0px));
  z-index: 6;
  min-width: 38px; height: 34px; padding: 0 11px;
  display: grid; place-items: center;
  color: #5f5848;
  cursor: pointer;
  border-radius: 11px;
  background: rgba(255,255,255,.35);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow:
    0 6px 20px -8px rgba(20,16,10,.25),
    inset 0 1px 1px rgba(255,255,255,.75),
    inset 0 -8px 16px -10px rgba(20,16,10,.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
  transition: background .25s, color .25s, transform .25s;
}
.lang.glass:hover { background: rgba(255,255,255,.6); color: var(--ink); transform: translateY(-1px); }
.lang-code { font-size: 11px; font-weight: 500; letter-spacing: 2px; }
@media (prefers-reduced-transparency: reduce) { .lang.glass { background: #f3efe7; backdrop-filter: none; } }
.lang-menu {
  position: fixed; top: 70px; right: 22px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 12px;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.35);
  padding: 6px;
  z-index: 5;
  min-width: 150px;
}
.lang-menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border: 0; background: none;
  font: inherit; color: var(--ink); border-radius: 8px; cursor: pointer;
}
.lang-menu button:hover { background: var(--neutral-warm); }

/* Refined entrance - premium, restrained (taste-skill MOTION ~5) */
@media (prefers-reduced-motion: no-preference) {
  .brand, .title, .bell-wrap, .privacy { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
  .title { animation-delay: .08s; }
  .bell-wrap { animation-delay: .16s; }
  .privacy { animation-delay: .26s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* Brand */
.brand { text-align: center; margin-top: clamp(8px, 4vh, 40px); }
.monogram {
  position: relative;
  width: 58px; height: 58px;
  margin: 0 auto;
}
/* drop-shadow lifts the gold Q off the warm wall (confidently visible, not loud) */
.monogram canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 2px rgba(60,40,10,.28)); }
.monogram .q-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 50px; font-weight: 600; line-height: 1;
  color: var(--gold-deep); letter-spacing: 1px;
}
.wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 27px; font-weight: 600; letter-spacing: 6px;
  color: var(--gold-deep);
  text-shadow: 0 1px 1px rgba(255,255,255,.4), 0 1px 3px rgba(60,40,10,.18);
  margin-top: 2px;
}
.wordmark-sub {
  font-size: 10.5px; font-weight: 500; letter-spacing: 5px;
  color: #8a6e2e;
  margin-top: 4px;
}

/* Title */
.title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(38px, 5.6vh, 60px);
  color: #221f1a;
  text-shadow: 0 1px 1px rgba(255,255,255,.35);
  margin-top: clamp(12px, 3vh, 30px);
  letter-spacing: .5px;
}

/* Bell button */
.bell-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  margin: clamp(6px, 2vh, 18px) 0;
}
.bell {
  position: relative;
  width: clamp(220px, 30vh, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gold-soft);
  -webkit-tap-highlight-color: transparent;
}
/* warm golden halo bloom behind the bell (matches the canon's glow) */
.bell::after {
  content: '';
  position: absolute; inset: -28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,196,120,.45) 0%, rgba(216,190,134,.22) 38%, transparent 68%);
  filter: blur(8px);
  z-index: -1;
  animation: halo 5.5s ease-in-out infinite;
}
@keyframes halo { 0%,100% { opacity: .65; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.04); } }
.bell-glow {
  position: absolute; inset: -6px;
  border-radius: 50%;
  box-shadow:
    0 0 0 1.5px var(--gold-soft),
    0 0 30px 6px rgba(230,196,120,.8),
    0 0 90px 22px rgba(216,190,134,.5);
  transition: box-shadow .5s ease, inset .5s ease;
}
/* liquid-gold ring - slowly rotating conic sheen (liquid-metal essence,
   adapted from liquid-logo). Pure CSS so it's robust on a kiosk. */
.bell-glow::before {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 0deg,
    rgba(216,190,134,.25), #f0dcab 12%, #c8a45c 26%, rgba(216,190,134,.35) 42%,
    #e7cf9b 60%, #b88f3e 76%, rgba(216,190,134,.25) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: ringspin 14s linear infinite;
  filter: drop-shadow(0 0 6px rgba(216,190,134,.5));
}
@keyframes ringspin { to { transform: rotate(360deg); } }
/* idle breathing - restrained luxury motion (MOTION ~5) */
.bell:not(.is-connecting):not(.is-connected) .bell-glow { animation: breathe 5.5s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 1.5px var(--gold-soft), 0 0 28px 6px rgba(230,196,120,.7), 0 0 75px 16px rgba(216,190,134,.4); }
  50%      { box-shadow: 0 0 0 1.75px var(--gold), 0 0 42px 10px rgba(235,200,128,.95), 0 0 110px 26px rgba(216,190,134,.55); }
}
@media (prefers-reduced-motion: reduce) { .bell-glow::before, .bell .bell-glow { animation: none !important; } }
.bell-face {
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(80% 60% at 50% 22%, rgba(216,190,134,.10), transparent 60%),
    radial-gradient(120% 120% at 50% 32%, #211d17 0%, #0d0b08 72%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: clamp(10px, 1.6vh, 16px);
  padding: 6% 15%;            /* keep contents off the rounded edges */
  overflow: hidden;          /* safety: never let text spill the disk */
  box-shadow: inset 0 2px 22px rgba(0,0,0,.65), inset 0 0 0 1px rgba(216,190,134,.06);
}
.bell-icon { color: var(--gold-soft); filter: drop-shadow(0 0 6px rgba(216,190,134,.4)); flex: none; }
.bell-label {
  font-size: clamp(12px, 1.55vh, 15px);
  letter-spacing: 2px;
  line-height: 1.3;
  color: var(--gold-soft);
  font-weight: 400;
  max-width: 100%;
  text-align: center;
  white-space: normal;        /* allow wrapping in long languages (e.g. FR) */
  text-wrap: balance;
  word-break: break-word;
}

/* States */
.bell.is-connecting .bell-glow {
  animation: pulse 1.4s ease-in-out infinite;
}
.bell.is-connected .bell-glow {
  box-shadow:
    0 0 0 1.5px #7fcf9e,
    0 0 26px 6px rgba(127,207,158,.55),
    0 0 70px 16px rgba(127,207,158,.3);
}
.bell.is-connected .bell-icon,
.bell.is-connected .bell-label { color: #aee6c2; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 1.5px var(--gold-soft), 0 0 22px 4px rgba(216,190,134,.5), 0 0 50px 10px rgba(216,190,134,.25); }
  50%      { box-shadow: 0 0 0 2px var(--gold), 0 0 34px 10px rgba(216,190,134,.85), 0 0 90px 26px rgba(216,190,134,.5); }
}

.confirm {
  max-width: 360px; text-align: center;
  color: #4a463d; font-size: 16px; line-height: 1.5;
  margin-top: 8px; min-height: 1.5em;
}

/* Privacy footer */
.privacy {
  display: flex; align-items: center; gap: 7px;
  color: #6f6857; font-size: 12px; letter-spacing: .5px;
  padding-top: 8px;
}

/* Narrow phones: center content over the wall, tighter spacing */
/* Mobile: rebalance - smaller bell so logo/title/button share the hierarchy */
@media (max-width: 560px) {
  .panel { margin-right: auto; width: min(420px, 92vw); gap: clamp(8px, 1.6vh, 16px); }
  .bell { width: clamp(190px, 56vw, 250px); }
  .title { font-size: clamp(34px, 8vw, 46px); }
  .wordmark { font-size: 24px; letter-spacing: 5px; }
}

/* Desktop/landscape: center the content on screen (placed last so it wins
   over the base .panel right-bias on equal specificity) */
@media (orientation: landscape) {
  .panel { margin-right: auto; }
}

/* Recording-consent notice (guardrails: consent before capture) */
.recording { max-width: 320px; margin: 6px auto 0; text-align: center; font-size: 10px; line-height: 1.4; color: var(--muted); opacity: .85; }
