/* Build My Scent — local voice-call prototype. Tokens match the chat UI. */
:root {
  --m: #1B2933;
  --iv: #F5F1E9;
  --br: #BE956E;
  --brd: #7A5530;
  --ink: #17212A;
  --focus: #1F6E8A;
  --card: #FBF9F4;
  --mute-l: #4A5560;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: Jost, "Helvetica Neue", Arial, sans-serif;
  --footer-dark: #141F27;
  --hover-mid: #223442;
  --r: 4px;
  --shadow: 0 12px 40px rgba(23, 33, 42, 0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--iv); color: var(--ink); font-family: var(--sans); }
body { min-height: 100dvh; }
.banner {
  background: #FFF4D6; color: var(--ink); font-size: 0.8rem; letter-spacing: 0.02em;
  text-align: center; padding: 0.5rem 1rem; border-bottom: 1px solid #e6d7a8;
}
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.5rem; background: var(--m); color: var(--iv);
}
.wordmark { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin: 0; letter-spacing: 0.02em; }
.hero { max-width: 40rem; margin: 0 auto; padding: 3rem 1.25rem 6rem; }
.hero h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; margin: 0 0 0.75rem; }
.hero p { color: var(--mute-l); line-height: 1.5; margin: 0 0 1.75rem; }
.btn {
  appearance: none; border: 0; cursor: pointer; font-family: var(--sans);
  font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.9rem 1.4rem; border-radius: var(--r); text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px;
}
.btn-call { background: var(--br); color: var(--m); }
.btn-call:hover { background: #CDA884; }
.btn-ghost { background: transparent; color: var(--brd); border: 1px solid #8E6640; }
.btn-dark { background: var(--m); color: var(--iv); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.btn-call:focus-visible, .btn-dark:focus-visible { outline-color: var(--br); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Panel */
.voice-overlay {
  position: fixed; inset: 0; background: rgba(23, 33, 42, 0.45); z-index: 180;
  display: none; align-items: flex-end; justify-content: center;
}
.voice-overlay.is-open { display: flex; }
.voice-panel {
  width: min(26rem, 100%); max-height: min(40rem, calc(100dvh - 1.5rem));
  background: var(--card); color: var(--ink); border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
@media (min-width: 700px) {
  .voice-overlay { align-items: center; }
  .voice-panel { border-radius: 12px; margin: 1.5rem; }
}
.voice-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; min-height: 3.5rem; padding: 0.65rem 1rem; background: var(--m); color: var(--iv);
}
.voice-head h2 { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 0; }
.voice-head .sub { display: block; font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--br); margin-top: 0.15rem; }
.iconbtn {
  appearance: none; border: 0; background: transparent; color: var(--iv);
  width: 44px; height: 44px; font-size: 1.4rem; cursor: pointer; border-radius: var(--r);
}
.iconbtn:focus-visible { outline: 3px solid var(--br); outline-offset: 2px; }
.voice-body { padding: 1.1rem 1.15rem 1rem; overflow: auto; flex: 1 1 auto; min-height: 0; }
.disclosure {
  background: #FFF4D6; border-left: 3px solid var(--brd); padding: 0.75rem 0.85rem; margin: 0 0 1rem;
  font-size: 0.92rem; line-height: 1.45;
}
.notice { font-size: 0.88rem; line-height: 1.5; color: var(--mute-l); margin: 0 0 1rem; }
.status {
  display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mute-l); margin-bottom: 0.85rem;
}
.pulse {
  width: 10px; height: 10px; border-radius: 50%; background: #6B7580;
}
.voice-panel.is-listening .pulse { background: #2a7a4b; box-shadow: 0 0 0 6px rgba(42,122,75,0.18); }
.voice-panel.is-speaking .pulse { background: var(--br); box-shadow: 0 0 0 6px rgba(190,149,110,0.25); }
.bubble { margin: 0 0 0.75rem; padding: 0.75rem 0.9rem; border-radius: 8px; line-height: 1.45; font-size: 0.95rem; }
.bubble.ai { background: #eef1f3; }
.bubble.user { background: var(--m); color: var(--iv); margin-left: 1.5rem; }
.timer { font-variant-numeric: tabular-nums; margin-left: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.ptt {
  width: 100%; min-height: 52px; background: var(--m); color: var(--iv);
  border: 0; border-radius: var(--r); font-family: var(--sans); font-size: 1rem;
  letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
}
.ptt:focus-visible { outline: 3px solid var(--br); outline-offset: 3px; }
.ptt[disabled] { opacity: 0.5; cursor: not-allowed; }
.transfer {
  display: none; margin-top: 1rem; padding: 0.9rem; border: 1px solid #8E6640; border-radius: var(--r); background: var(--iv);
}
.transfer.is-on { display: block; }
.transfer h3 { margin: 0 0 0.4rem; font-family: var(--serif); font-size: 1.15rem; }
.transfer p { margin: 0 0 0.8rem; font-size: 0.9rem; color: var(--mute-l); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.fallback { display: none; margin-top: 0.75rem; font-size: 0.9rem; color: var(--mute-l); }
.fallback.is-on { display: block; }
.chat-fallback {
  display: none; position: fixed; right: 1rem; bottom: 1rem; z-index: 170;
  width: min(24.5rem, calc(100vw - 2rem)); background: var(--card); border-radius: 12px;
  box-shadow: var(--shadow); padding: 1rem;
}
.chat-fallback.is-open { display: block; }
.chat-fallback h2 { font-family: var(--serif); margin: 0 0 0.5rem; font-size: 1.2rem; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.voice-foot { padding: 0.85rem 1.15rem 1.15rem; border-top: 1px solid #e6e1d6; background: var(--card); }
.voice-foot .ptt { margin-top: 0; }
.voice-foot .transfer { margin-top: 0.75rem; }
#log { min-height: 4rem; }

.voice-head, .voice-foot { flex-shrink: 0; }
.voice-overlay { max-height: 100dvh; }

/* 1.5.0-direct: one combined "Tap to agree & start" action + gold text link to the video-call request. */
#consent-step .actions { flex-direction: column; align-items: center; gap: .15rem; margin-top: 1.1rem; }
a.voice-video-link {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 .3em;
  min-height: 44px; margin-top: .75rem; padding: .25rem 0; text-align: center;
  font-size: .95rem; line-height: 1.4; color: var(--brd); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
a.voice-video-link:hover { color: #5C3F22; }
a.voice-video-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.voice-video-link__cta { white-space: nowrap; }
/* 1.5.0-direct: /connect/ transcript bubbles were light-on-light after the tap (inherited page text colour). */
body.bmscn-connect-page #overlay .bubble.ai { color: #17212A; }
body.bmscn-connect-page #overlay .bubble.user { color: #F5F1E9; background: #1B2933; }

/* 1.5.1-circle: circular gold-ring mic (1.4.0-speak style) for "Tap to agree & start" (#agree) and the in-call
   talk control (#ptt). The label sits under the circle; listening / speaking show on the circle itself. */
.voice-mic {
  appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 4px 8px; margin: 0;
  display: inline-flex; flex-direction: column; align-items: center; gap: .7rem; cursor: pointer;
  color: var(--m); font-family: var(--sans); -webkit-tap-highlight-color: transparent; min-height: 44px; min-width: 44px;
}
.voice-mic__circle {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 112px; height: 112px; border-radius: 50%; box-sizing: border-box;
  background: #1B2933; color: #E2B26A; border: 3px solid #E2B26A;
  box-shadow: 0 0 0 6px rgba(226,178,106,.16), 0 10px 26px rgba(23,33,42,.28);
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.voice-mic--ptt .voice-mic__circle { width: 96px; height: 96px; }
.voice-mic__ring {
  position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(226,178,106,0); pointer-events: none;
}
.voice-mic__icon { position: relative; z-index: 1; display: block; }
.voice-mic__wave { display: none; position: relative; z-index: 1; align-items: center; gap: 4px; height: 36px; }
.voice-mic__wave i { display: block; width: 4px; height: 12px; border-radius: 2px; background: currentColor; animation: voice-mic-wave 0.9s ease-in-out infinite; }
.voice-mic__wave i:nth-child(2) { animation-delay: .12s; }
.voice-mic__wave i:nth-child(3) { animation-delay: .24s; }
.voice-mic__wave i:nth-child(4) { animation-delay: .36s; }
.voice-mic__wave i:nth-child(5) { animation-delay: .48s; }
.voice-mic__cap {
  display: block; font: 500 .9rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--brd);
}
.voice-mic:hover .voice-mic__circle { background: #22323D; }
.voice-mic:focus { outline: none; }
.voice-mic:focus-visible .voice-mic__circle { outline: 3px solid var(--focus); outline-offset: 6px; }
.voice-mic.is-listening .voice-mic__circle { box-shadow: 0 0 0 6px rgba(226,178,106,.3), 0 0 26px rgba(226,178,106,.45); }
.voice-mic.is-listening .voice-mic__ring { border-color: rgba(190,149,110,.75); animation: voice-mic-pulse 1.7s ease-out infinite; }
.voice-mic.is-speaking .voice-mic__circle { background: #E2B26A; color: #1B2933; border-color: #F3D7A6; }
.voice-mic.is-speaking .voice-mic__icon { display: none; }
.voice-mic.is-speaking .voice-mic__wave { display: inline-flex; }
.voice-mic[disabled] { cursor: not-allowed; }
.voice-mic[disabled] .voice-mic__circle { opacity: .5; }
@keyframes voice-mic-pulse { 0% { transform: scale(.92); opacity: 1; } 70% { transform: scale(1.14); opacity: 0; } 100% { transform: scale(1.14); opacity: 0; } }
@keyframes voice-mic-wave { 0%, 100% { height: 10px; } 50% { height: 30px; } }
@media (prefers-reduced-motion: reduce) {
  .voice-mic.is-listening .voice-mic__ring { border-color: rgba(190,149,110,.8); transform: none; opacity: 1; }
  .voice-mic__wave i { height: 20px; }
}
.voice-foot #ptt.voice-mic {
  width: auto; min-height: 44px; background: none; color: var(--m); border: 0; border-radius: 0;
  display: flex; margin: 0 auto; letter-spacing: normal; text-transform: none; font-size: inherit;
}
.voice-foot #ptt.voice-mic[disabled] { opacity: 1; }
.voice-foot { text-align: center; }
.voice-foot .fallback, .voice-foot .transfer { text-align: left; }
/* "No thanks" is a small text link, not a boxed button. */
.voice-textlink {
  appearance: none; -webkit-appearance: none; background: none; border: 0; padding: .5rem .75rem; margin: 0;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  font: 400 .88rem/1.3 var(--sans); color: var(--mute-l); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px; letter-spacing: normal; text-transform: none;
}
.voice-textlink:hover { color: var(--ink); }
.voice-textlink:focus { outline: none; }
.voice-textlink:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
#consent-step .notice { margin-bottom: 0; text-align: center; }
#consent-step a.voice-video-link { margin-top: .1rem; }

/* 1.5.1-circle on /connect/: consent above the circle, label under it, small "No thanks" text link. */
body.bmscn-connect-page .bmscn-speak .bmscn-speak__consent { margin-bottom: 22px; }
body.bmscn-connect-page .bmscn-speak .bmscn-mic { margin-top: 8px; }
body.bmscn-connect-page .bmscn-speak .bmscn-mic__cap { margin-top: 18px; }
body.bmscn-connect-page .bmscn-nothanks {
  appearance: none; -webkit-appearance: none; background: none; border: 0; margin: 6px 0 0; padding: 10px 12px;
  min-height: 44px; cursor: pointer; font: 400 14px/1.3 var(--bmscn-sans, Jost, "Helvetica Neue", Arial, sans-serif);
  color: #E4DDD1; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
body.bmscn-connect-page .bmscn-nothanks:hover { color: #F5F1E9; }
body.bmscn-connect-page .bmscn-nothanks:focus { outline: none; }
body.bmscn-connect-page .bmscn-nothanks:focus-visible { outline: 3px solid #E2B26A; outline-offset: 2px; border-radius: 4px; }
body.bmscn-connect-page .bmscn-nothanks[hidden] { display: none; }
body.bmscn-connect-page .bmscn-speak a.bmscn-video-link { margin-top: 4px; }
body.bmscn-connect-page .bmscn-mic.is-speaking .bmscn-mic__ring { opacity: 1; border-color: rgba(226,178,106,.45); }
body.bmscn-connect-page .bmscn-mic.is-listening { background: #22323D; box-shadow: 0 0 0 6px rgba(226,178,106,.22), 0 0 40px rgba(226,178,106,.55); }
