/* Holent · full-screen conversation. Tokens: DESIGN.md V1, dark theme (same as Clarity).
   Loaded on the site too (the overlay prefetches it while the visitor reads), so it must not restyle the page itself:
   fonts, html and body live in page.css, which only the standalone page loads. */
:root {
  --surface: #0B0D0C; --raised: #161A19; --line: #262B29; --line-strong: #646A67;
  --ink: #F1F2EE; --muted: #A3A8A5; --accent: #287A70; --accent-strong: #1E5C55; --wire: #6FC2B6;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html.t-page body::before, .chat-overlay::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; background: radial-gradient(60% 45% at 50% 38%, rgba(40,122,112,.16), rgba(40,122,112,0) 70%); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.t-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: linear-gradient(var(--surface) 78%, rgba(11,13,12,0)); }
.t-brand { display: inline-flex; min-height: 44px; align-items: center; }
.t-brand img { width: 96px; height: auto; display: block; }
.t-mode { font-size: 12px; font-weight: 500; color: var(--muted); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); margin-right: auto; }
.t-close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.t-close:hover { color: var(--ink); background: var(--raised); }
.t-close svg { width: 22px; height: 22px; }
/* privacy notice: an info icon beside the close button, labelled by a tooltip on hover or keyboard focus */
.t-info-wrap { position: relative; margin-left: auto; }
/* Start new chat: shown only while a conversation is on screen; its confirmation opens under the header */
.t-new { margin-left: auto; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: 500 13px/1.2 "Instrument Sans", system-ui, sans-serif; cursor: pointer; }
.t-new:hover, .t-new[aria-expanded="true"] { background: var(--raised); }
.t-new + .t-info-wrap { margin-left: 0; }
.t-top.has-new .t-mode { display: none; }
.t-new-pop { position: absolute; top: calc(100% - 2px); right: 16px; z-index: 6; width: min(340px, calc(100vw - 32px)); padding: 16px 18px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font-size: 13.5px; line-height: 1.5; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.t-new-pop p { margin: 0 0 12px; color: #c6ccc7; }
.t-new-pop .t-pop-title { color: var(--ink); margin-bottom: 6px; }
@media (pointer: coarse) { .t-new { min-height: 44px; } }
.t-info { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.t-info-wrap + .t-close { margin-left: -8px; }
.t-info { border: 0; background: transparent; cursor: pointer; padding: 0; }
.t-info:hover, .t-info:focus-visible { color: var(--ink); background: var(--raised); }
.t-info svg { width: 20px; height: 20px; }
.t-info::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font-size: 12.5px; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s; }
.t-info:hover::after, .t-info:focus-visible::after { opacity: 1; transform: none; }
.t-info[aria-expanded="true"] { color: var(--ink); background: var(--raised); }
.t-info[aria-expanded="true"]::after { display: none; }
/* the privacy summary: a small panel under the icon, with a link to the full notice */
.t-pop { position: absolute; top: calc(100% + 8px); right: -52px; z-index: 6; width: min(340px, calc(100vw - 32px)); padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font-size: 13.5px; line-height: 1.5; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.t-pop[hidden] { display: none; }
.t-pop-title { margin: 0 0 8px; font-weight: 500; }
.t-pop ul { margin: 0 0 12px; padding-left: 18px; color: #c6ccc7; }
.t-pop li + li { margin-top: 6px; }
.t-pop-more { display: inline-block; padding: 6px 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .t-info::after { transition: none; } }

.t-root { position: relative; z-index: 1; color: var(--ink); font: 400 16px/1.55 "Instrument Sans", system-ui, sans-serif; }
.t-main { position: relative; width: min(720px, 100%); margin: 0 auto; min-height: calc(100vh - 66px); min-height: calc(100dvh - 66px); padding: 8px 16px 0; display: flex; flex-direction: column; }

/* open: everything centred, the visitor can start writing right away */
.t-open { text-align: center; padding-top: 6vh; transition: opacity .35s, transform .35s; }
.t-root.is-open .t-main { justify-content: center; padding-bottom: 8vh; }
.t-mark { width: 64px; height: auto; margin: 0 auto 22px; display: block; overflow: visible; }
.t-mark .part { animation: t-part .9s cubic-bezier(.2,.8,.2,1) both; }
.t-mark .part-r { --dx: 22px; --dy: -14px; }
.t-mark .part-l { --dx: -24px; --dy: -10px; animation-delay: .08s; }
.t-mark .part-s { --dx: 0px; --dy: 18px; animation-delay: .16s; }
/* the 3D symbol (talk/mark3d.js) takes the flat symbol's place: same footprint, a larger canvas so the swing is not clipped */
.t-mark3d { display: block; width: 96px; height: 96px; margin: -21px auto 1px; }
.t-open.has-3d .t-mark { display: none; }
@keyframes t-part { from { opacity: 0; transform: translate(var(--dx), var(--dy)); } }
.t-hello { margin: 0; font-size: clamp(36px, 9vw, 56px); line-height: 1.04; font-weight: 500; letter-spacing: -.03em; }
.t-sub { margin: 14px auto 0; max-width: 46ch; font-size: 17px; color: var(--muted); text-wrap: pretty; }
.t-root.is-chatting .t-open { display: none; }

.t-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.t-root.is-open .t-thread { display: none; }
.t-root.is-chatting .t-thread { flex: 1; padding: 12px 0 24px; align-content: end; }
.m { max-width: 92%; animation: t-in .35s cubic-bezier(.2,.7,.2,1) both; scroll-margin-top:78px; }
@keyframes t-in { from { opacity: 0; transform: translateY(8px); } }
.m p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.m-out { justify-self: start; }
.m-out p { font-size: 17px; line-height: 1.55; }
.m-out p + p { margin-top: 12px; }
.m-out ul, .m-out ol { margin: 10px 0; padding-left: 1.35em; }
.m-out li + li { margin-top: 4px; }
.m-who { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.m-in { justify-self: end; }
.m.m-instant { animation: none; }
.m-in p { background: var(--raised); border: 1px solid var(--line); padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-size: 16px; }
.m-typing p { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 8px 0; }
.m-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: t-dot 1s infinite; }
.m-typing i:nth-child(2) { animation-delay: .15s; }
.m-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes t-dot { 50% { opacity: .25; } }

/* the composer: centre of the screen at first, docked to the bottom while talking */
.t-dock { padding: 22px 0 max(14px, env(safe-area-inset-bottom)); }
.t-root.is-chatting .t-dock { position: sticky; bottom: 0; background: linear-gradient(rgba(11,13,12,0), var(--surface) 26%); padding-top: 28px; }
.t-compose { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 20px; border-radius: 26px; background: rgba(22,26,25,.92); border: 1px solid #2E3532; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 40px -18px rgba(0,0,0,.85); transition: border-color .15s; }
.t-compose:focus-within { border-color: var(--wire); }
.t-compose textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: none; color: var(--ink); font: 400 17px/1.45 "Instrument Sans", sans-serif; padding: 11px 0; max-height: 180px; }
.t-compose textarea::placeholder { color: var(--muted); }
.t-send { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color .15s, opacity .15s; }
.t-send:hover { background: var(--accent-strong); }
.t-send svg { width: 20px; height: 20px; }
.t-compose.is-busy .t-send { opacity: .5; pointer-events: none; }
.t-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.t-chips[hidden], .t-root.is-chatting .t-chips:empty { display: none; }
.t-chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid #34403C; background: transparent; color: var(--ink); font: 400 14px/1.3 "Instrument Sans", sans-serif; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.t-chip:hover { border-color: var(--wire); background: rgba(40,122,112,.08); }
.t-preview { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.t-preview { margin-top: 4px; }
.t-noscript { position: fixed; inset: auto 16px 24px; text-align: center; color: var(--muted); }

@media (max-width: 640px) {
  .t-open { padding-top: 0; }
  .t-sub { font-size: 16px; }
  .t-chips { justify-content: flex-start; }
  .t-chip { font-size: 13.5px; }
  /* Privacy and mode disclosures remain visible during the conversation. */
}
@media (prefers-reduced-motion: reduce) {
  .t-mark .part, .m, .m-typing i { animation: none; }
}
.m { scroll-margin-bottom: 190px; }
@media (max-width: 520px) {
  .t-compose textarea { min-height: 70px; font-size: 16px; }
}

/* full-screen overlay on the site: the same conversation, without leaving the page */
.chat-overlay { position: fixed; inset: 0; z-index: 100; background: var(--surface); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; opacity: 0; transform: translateY(14px); transition: opacity .28s ease, transform .28s cubic-bezier(.2,.7,.2,1); }
.chat-overlay.is-shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .chat-overlay { transition: none; transform: none; } }

.t-compose [disabled] { cursor: not-allowed; opacity: .55; }

/* Small functional controls share the existing conversation typography and color. */
.t-gate, .t-contact { margin: 12px 0; padding: 12px 0; font: inherit; }
.t-gate[hidden], .t-contact form[hidden] { display: none; }
.t-gate p, .t-contact p { color: var(--muted, #b6bcb7); font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.t-action { font: inherit; font-size: 14px; color: inherit; border: 1px solid #49544c; border-radius: 5px; padding: 10px 14px; background: transparent; cursor: pointer; margin: 0 8px 8px 0; }
.t-action:focus-visible, .t-contact input:focus-visible { outline: 2px solid #61c5af; outline-offset: 3px; }
.t-action:disabled { opacity: .55; cursor: wait; }
.t-contact-actions { display: flex; flex-wrap: wrap; gap: 0; }
.t-contact-actions .t-action { min-height: 44px; }
.t-contact-actions .t-action:disabled { cursor: default; }
.m-out p a { text-decoration: underline; text-underline-offset: 2px; }
.t-contact label { display: block; font-size: 14px; line-height: 1.5; margin: 12px 0; }
.t-contact input:not([type=checkbox]) { display: block; box-sizing: border-box; width: 100%; padding: 10px; margin-top: 4px; font: inherit; color: inherit; background: #151b17; border: 1px solid #49544c; border-radius: 5px; }
.t-contact .t-consent { display: flex; gap: 10px; align-items: flex-start; }

/* CRO v1 */
.t-consent input { flex: none; margin-top: 5px; accent-color: #61c5af; }
.t-challenge { max-width: 100%; margin: 8px 0; }

/* CRO v2 */
.t-contact-links { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:8px; }
.t-email { margin:0; color:var(--muted); font-size:12.5px; }.t-email a { color:var(--wire); }
.t-quote { flex:none; min-height:40px; padding:8px 13px; border:1px solid var(--wire); border-radius:999px; background:transparent; color:var(--ink); font:500 13px/1.2 "Instrument Sans", system-ui, sans-serif; cursor:pointer; }
.t-quote:hover { background:rgba(40,122,112,.16); }.t-quote:disabled { cursor:wait; opacity:.6; }
.t-footer { display:flex; flex-wrap:wrap; justify-content:center; gap:6px 14px; padding:0 16px max(16px,env(safe-area-inset-bottom)); color:var(--muted); font-size:12.5px; }.t-footer a { color:var(--ink); }
@media (max-width:360px) { .t-contact-links { align-items:flex-start; flex-direction:column; gap:8px; }.t-quote { width:100%; } }

/* QA v3 (Playwright) */
/* touch: suggested questions reach the 44px target */
@media (pointer: coarse) { .t-chip { min-height: 44px; } }
