/* GW AI — the website voice assistant (launcher button + full-screen "talk" view).
   Same palette as the site (deep navy, champagne gold) pushed toward a futuristic look: a living particle orb,
   glass controls, live captions. Everything is namespaced .gwai-* so the site styles are untouched. */

:root {
  --gwai-bg: #04070d;
  --gwai-bg-2: #0b1424;
  --gwai-gold: #e6c88f;
  --gwai-gold-2: #b08d57;
  --gwai-aqua: #8fd8d2;
  --gwai-ivory: #f5f1e8;
  --gwai-text: #ece6d9;
  --gwai-muted: #9a978f;
  --gwai-glass: rgba(255, 255, 255, .06);
  --gwai-glass-line: rgba(230, 200, 143, .22);
  --gwai-red: #d4544a;
}

html.gwai-open, html.gwai-open body { overflow: hidden; }

/* ---------- launcher (floating orb) ---------- */
.gwai-launch {
  position: fixed; z-index: 900;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px; border: 1px solid var(--gwai-glass-line); border-radius: 999px;
  background: rgba(6, 11, 20, .82); color: var(--gwai-text);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .2);
  font: 500 14px/1 var(--sans, system-ui, sans-serif); letter-spacing: .02em;
  cursor: pointer; transition: transform .35s cubic-bezier(.2, .7, .2, 1), opacity .3s;
}
.gwai-launch:hover { transform: translateY(-2px); }
.gwai-launch:focus-visible { outline: 2px solid var(--gwai-gold); outline-offset: 3px; }
.gwai-launch[hidden] { display: none; }
.gwai-launch .gwai-mini {
  position: relative; width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 45%, #fff6dd 0, #e6c88f 22%, #8a6a35 52%, #1a1407 74%);
  box-shadow: 0 0 22px rgba(230, 200, 143, .55);
  animation: gwai-breathe 3.2s ease-in-out infinite;
}
.gwai-launch .gwai-mini::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(230, 200, 143, .9) 75%, transparent 90%);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%); mask: radial-gradient(circle, transparent 60%, #000 62%);
  animation: gwai-spin 2.8s linear infinite;
}
.gwai-launch .gwai-mini::after {
  content: ""; position: absolute; inset: 13px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0, rgba(255, 246, 221, .4) 45%, transparent 70%);
  mix-blend-mode: screen;
}
.gwai-launch .gwai-lbl { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.gwai-launch .gwai-lbl b { font-weight: 600; font-size: 14px; }
.gwai-launch .gwai-lbl small { font-size: 11px; color: var(--gwai-muted); letter-spacing: .04em; }
.gwai-hint {
  position: fixed; z-index: 899;
  right: max(16px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px);
  max-width: 250px; padding: 12px 14px; border-radius: 14px;
  background: rgba(6, 11, 20, .9); color: var(--gwai-text); border: 1px solid var(--gwai-glass-line);
  font: 400 13px/1.55 var(--sans, system-ui, sans-serif);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; pointer-events: none;
}
.gwai-hint.on { opacity: 1; transform: none; }
@media (max-width: 560px) {
  .gwai-launch { padding: 5px; }
  .gwai-launch .gwai-lbl { display: none; }
  .gwai-launch .gwai-mini { width: 50px; height: 50px; }
  .gwai-hint { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 66px); }
}

/* in-page button (AI section) */
.addon .gwai-cta { margin-right: 12px; }
.gwai-cta .gwai-dot { /* sits on the gold button, so it is navy with a navy ping */
  width: 9px; height: 9px; border-radius: 50%; background: #0b1220;
  box-shadow: 0 0 0 0 rgba(11, 18, 32, .55); animation: gwai-ping 1.8s ease-out infinite;
}

/* ---------- full-screen talk view ---------- */
.gwai {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto auto auto;
  height: 100vh; height: 100dvh;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--gwai-bg); color: var(--gwai-text);
  font: 400 16px/1.6 var(--sans, system-ui, sans-serif);
  overflow: hidden; isolation: isolate;
  opacity: 0; transition: opacity .45s ease;
}
.gwai[hidden] { display: none; }
.gwai.is-in { opacity: 1; }
.gwai * { box-sizing: border-box; }
.gwai button { font: inherit; color: inherit; }

.gwai-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.gwai-bg::before { /* deep space + warm centre */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 45% at 50% 40%, rgba(176, 141, 87, .18), transparent 70%),
    radial-gradient(90% 70% at 50% 110%, rgba(40, 70, 110, .35), transparent 70%),
    linear-gradient(180deg, #060b15 0%, var(--gwai-bg) 60%);
}
.gwai-bg::after { /* perspective grid fading out from the centre */
  content: ""; position: absolute; inset: -20% -20% 0;
  background-image:
    linear-gradient(rgba(230, 200, 143, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 200, 143, .07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask: radial-gradient(55% 45% at 50% 42%, #000 0, transparent 75%);
  mask: radial-gradient(55% 45% at 50% 42%, #000 0, transparent 75%);
  animation: gwai-drift 24s linear infinite;
}

.gwai-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 980px; width: 100%; margin: 0 auto; }
.gwai-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gwai-id svg { width: 34px; height: 34px; flex: none; }
.gwai-id b { display: block; font: 600 15px/1.2 var(--sans, system-ui, sans-serif); letter-spacing: .08em; }
.gwai-id small { display: block; color: var(--gwai-muted); font-size: 12px; line-height: 1.3; }
.gwai-live {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font: 600 10px/1.6 var(--sans, system-ui, sans-serif); letter-spacing: .14em; color: var(--gwai-gold);
  border: 1px solid var(--gwai-glass-line); vertical-align: 2px;
}
.gwai-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: gwai-blink 1.4s infinite; }
.gwai-top-right { display: flex; align-items: center; gap: 10px; }
.gwai-timer {
  font: 500 13px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em;
  padding: 8px 12px; border-radius: 999px; background: var(--gwai-glass); border: 1px solid var(--gwai-glass-line);
}
.gwai-timer.low { color: #ffb4a8; border-color: rgba(212, 84, 74, .5); }
.gwai-x {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--gwai-glass); border: 1px solid var(--gwai-glass-line); cursor: pointer;
}
.gwai-x svg { width: 18px; height: 18px; }
.gwai-x:focus-visible, .gwai-side:focus-visible, .gwai-main:focus-visible, .gwai-chip:focus-visible,
.gwai-after a:focus-visible, .gwai-after button:focus-visible { outline: 2px solid var(--gwai-gold); outline-offset: 3px; }

.gwai-stage { position: relative; min-height: 0; }
/* absolute: a canvas in a grid track otherwise sizes itself from its pixel buffer and spills over the captions */
.gwai-orb { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.gwai-status {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 26px;
  font: 500 13px/1.4 var(--sans, system-ui, sans-serif); letter-spacing: .16em; text-transform: uppercase;
  color: var(--gwai-muted);
}
.gwai-status .gwai-sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--gwai-gold-2); box-shadow: 0 0 12px currentColor; color: var(--gwai-gold-2); }
.gwai[data-mode="listening"] .gwai-sdot { background: var(--gwai-aqua); color: var(--gwai-aqua); animation: gwai-blink 1.2s infinite; }
.gwai[data-mode="thinking"] .gwai-sdot { background: var(--gwai-ivory); color: var(--gwai-ivory); animation: gwai-blink .5s infinite; }
.gwai[data-mode="speaking"] .gwai-sdot { background: var(--gwai-gold); color: var(--gwai-gold); }
.gwai-status .gwai-stxt { letter-spacing: .04em; text-transform: none; font-size: 14px; }

.gwai-captions {
  max-width: 760px; width: 100%; margin: 6px auto 0; min-height: 96px; text-align: center;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
}
.gwai-cap-user { margin: 0; color: var(--gwai-muted); font-size: 14px; line-height: 1.5; min-height: 1.5em; }
.gwai-cap-user:not(:empty)::before { content: attr(data-who) "  "; color: var(--gwai-aqua); font-size: 11px; letter-spacing: .14em; }
.gwai-cap-agent {
  margin: 0; font: 400 clamp(18px, 2.6vw, 24px)/1.55 var(--serif, Georgia, serif); color: var(--gwai-ivory);
  min-height: 1.55em; text-wrap: balance; overflow-wrap: anywhere;
  /* long answers keep scrolling up as words appear (ai.js keeps it pinned to the newest line) */
  max-height: 4.65em; overflow: hidden;
}
.gwai-cap-agent.gwai-over { -webkit-mask: linear-gradient(to bottom, transparent 0, #000 1.1em); mask: linear-gradient(to bottom, transparent 0, #000 1.1em); }
/* "backwards": words are visible by default and only fade in if the animation actually runs */
.gwai-cap-agent .gwai-w { animation: gwai-word .35s ease backwards; }
.gwai-cap-msg { color: var(--gwai-text); font: 400 15px/1.6 var(--sans, system-ui, sans-serif); }

.gwai-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; max-width: 760px; margin: 12px auto 0; }
.gwai-chip {
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; line-height: 1.3;
  background: var(--gwai-glass); border: 1px solid var(--gwai-glass-line); color: var(--gwai-text);
  transition: background .2s, border-color .2s;
}
.gwai-chip:hover { background: rgba(230, 200, 143, .12); border-color: rgba(230, 200, 143, .5); }

.gwai-type { display: flex; gap: 8px; max-width: 620px; width: 100%; margin: 12px auto 0; }
.gwai-type input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--gwai-glass-line); color: var(--gwai-ivory);
  font: 400 16px/1 var(--sans, system-ui, sans-serif); outline: none;
}
.gwai-type input:focus { border-color: var(--gwai-gold); box-shadow: 0 0 0 3px rgba(230, 200, 143, .15); }
.gwai-type button {
  height: 48px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 600;
  background: linear-gradient(135deg, #f1dcae, #c9a464 55%, #9c7637); color: #1a1205;
}
.gwai-type button:disabled { opacity: .45; cursor: default; }

.gwai-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 16px auto 0; }
.gwai-side {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--gwai-glass); border: 1px solid var(--gwai-glass-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .2s, opacity .2s;
}
.gwai-side svg { width: 22px; height: 22px; }
.gwai-side[aria-pressed="true"] { background: rgba(230, 200, 143, .18); border-color: var(--gwai-gold); }
.gwai-side[data-act="mute"][aria-pressed="true"] { background: rgba(212, 84, 74, .2); border-color: var(--gwai-red); }
.gwai-side:disabled { opacity: .3; cursor: default; }
.gwai-side[hidden] { display: none; }
.gwai-main {
  position: relative; min-width: 210px; height: 64px; padding: 0 28px; border-radius: 999px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 16px/1 var(--sans, system-ui, sans-serif); letter-spacing: .02em; color: #1a1205;
  background: linear-gradient(135deg, #f6e6c0 0%, #e2c287 40%, #b08d57 100%);
  box-shadow: 0 10px 40px rgba(230, 200, 143, .25), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .2s, box-shadow .3s, background .3s;
}
.gwai-main:hover { transform: translateY(-1px); box-shadow: 0 14px 50px rgba(230, 200, 143, .35), inset 0 1px 0 rgba(255, 255, 255, .6); }
.gwai-main svg { width: 22px; height: 22px; }
.gwai-main::after { /* soft halo that pulses while waiting for a tap */
  content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 1px solid rgba(230, 200, 143, .5);
  animation: gwai-halo 2.4s ease-out infinite; pointer-events: none;
}
.gwai-main:disabled { cursor: progress; filter: saturate(.6) brightness(.85); }
.gwai-main:disabled::after { animation: none; opacity: 0; }
.gwai[data-state="live"] .gwai-main, .gwai[data-state="connecting"] .gwai-main, .gwai[data-state="ending"] .gwai-main {
  min-width: 64px; width: 64px; padding: 0; color: #fff;
  background: linear-gradient(135deg, #e3685d, #b8392f); box-shadow: 0 10px 34px rgba(212, 84, 74, .35);
}
.gwai[data-state="live"] .gwai-main::after, .gwai[data-state="connecting"] .gwai-main::after,
.gwai[data-state="ending"] .gwai-main::after { display: none; }
.gwai[data-state="live"] .gwai-main .gwai-mlabel, .gwai[data-state="connecting"] .gwai-main .gwai-mlabel,
.gwai[data-state="ending"] .gwai-main .gwai-mlabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.gwai-after { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px auto 0; max-width: 620px; }
.gwai-after a, .gwai-after button {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; cursor: pointer;
  font: 500 14px/1.2 var(--sans, system-ui, sans-serif); text-decoration: none;
  background: var(--gwai-glass); border: 1px solid var(--gwai-glass-line); color: var(--gwai-text);
}
.gwai-after .gwai-primary { background: rgba(230, 200, 143, .14); border-color: var(--gwai-gold); color: var(--gwai-ivory); }
.gwai-after svg { width: 16px; height: 16px; }

.gwai-note { margin: 14px auto 0; max-width: 640px; text-align: center; color: #77756f; font-size: 11.5px; line-height: 1.6; }
.gwai-diag { margin: 6px auto 0; max-width: 640px; color: #77756f; font-size: 11px; text-align: center; }
.gwai-diag summary { cursor: pointer; }
.gwai-diag code { display: block; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; color: #a39f96; }

.gwai-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 560px) {
  .gwai-captions { min-height: 84px; }
  .gwai-controls { gap: 16px; }
  .gwai-main { min-width: 180px; height: 60px; font-size: 15px; }
  .gwai-chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: none; }
  .gwai-chips::-webkit-scrollbar { display: none; }
  .gwai-chip { flex: none; }
  .gwai-id small { display: none; }
}
@media (max-height: 640px) {
  .gwai-note { display: none; }
  .gwai-captions { min-height: 70px; }
}

@keyframes gwai-spin { to { transform: rotate(360deg); } }
@keyframes gwai-breathe { 0%, 100% { box-shadow: 0 0 18px rgba(230, 200, 143, .45); } 50% { box-shadow: 0 0 30px rgba(230, 200, 143, .8); } }
@keyframes gwai-ping { 0% { box-shadow: 0 0 0 0 rgba(11, 18, 32, .55); } 100% { box-shadow: 0 0 0 10px rgba(11, 18, 32, 0); } }
@keyframes gwai-blink { 50% { opacity: .35; } }
@keyframes gwai-halo { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.18, 1.45); opacity: 0; } }
@keyframes gwai-word { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: none; } }
@keyframes gwai-drift { from { background-position: 0 0, 0 0; } to { background-position: 0 46px, 46px 0; } }

@media (prefers-reduced-motion: reduce) {
  .gwai-launch .gwai-mini, .gwai-launch .gwai-mini::before, .gwai-bg::after, .gwai-main::after, .gwai-cta .gwai-dot { animation: none; }
  .gwai-cap-agent .gwai-w { animation-duration: .01s; }
}

/* ---------- AI-first contact card (contact section, dark · 27 Oct 2026) ---------- */
.gwai-desk {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start;
  margin: 28px 0 34px; padding: 24px; border: 1px solid var(--gwai-glass-line); border-radius: 14px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(230, 200, 143, .11), rgba(255, 255, 255, .02) 62%);
}
.gwai-desk h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.35; color: var(--gwai-ivory); margin: 6px 0 8px; }
.gwai-desk p { color: var(--on-dark-muted, #a7a194); margin: 0 0 18px; }
.gwai-desk .gwai-desk-live { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; letter-spacing: .02em; color: var(--gwai-aqua); }
.gwai-desk-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--gwai-aqua); box-shadow: 0 0 0 0 rgba(143, 216, 210, .6); animation: gwai-desk-ping 1.8s ease-out infinite; }
.gwai-desk-orb {
  position: relative; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6dd 0%, var(--gwai-gold) 22%, var(--gwai-gold-2) 56%, #2a2214 100%);
  box-shadow: 0 0 28px rgba(230, 200, 143, .35); animation: gwai-desk-breathe 3.2s ease-in-out infinite;
}
.gwai-desk-orb span { position: absolute; inset: -8px; border-radius: 50%; border: 1px solid rgba(230, 200, 143, .35); animation: gwai-desk-ring 3.2s ease-out infinite; }
@keyframes gwai-desk-ping { to { box-shadow: 0 0 0 10px rgba(143, 216, 210, 0); } }
@keyframes gwai-desk-breathe { 50% { transform: scale(1.06); box-shadow: 0 0 40px rgba(230, 200, 143, .5); } }
@keyframes gwai-desk-ring { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@media (max-width: 1040px) { .gwai-desk { grid-template-columns: 1fr; gap: 14px; } }  /* the contact column is narrow up to ~1040px (Fable 🟢9) */
@media (max-width: 560px) { .gwai-desk { padding: 20px; } .gwai-desk-orb { width: 52px; height: 52px; } }
@media (prefers-reduced-motion: reduce) { .gwai-desk-orb, .gwai-desk-orb span, .gwai-desk-pulse { animation: none; } }
