/* Ask Hemmie: Hemingway AI assistant widget. Uses the site's existing tokens (with fallbacks) and Montserrat / Trajan Pro only.
   Loaded after css/style.css. Everything is namespaced .hbta- so it cannot affect other page styles. */
.hbta-root{
  --a-accent:var(--rust-dim,#C45A20);
  --a-accent-hi:var(--rust-bright,#E88A4A);
  --a-ink:var(--ink,#EDE7DA);
  --a-muted:var(--concrete,#B7AF9D);
  --a-dim:var(--steel,#736C5C);
  --a-panel:var(--card,#1B1813);
  --a-head:var(--surface,#1E1B15);
  --a-field:var(--field,#100E0B);
  --a-line:var(--line-mid,rgba(237,231,218,0.14));
  --a-soft:var(--line-soft,rgba(237,231,218,0.07));
  font-family:'Montserrat',sans-serif;font-weight:500;color:var(--a-ink);
  position:fixed;right:20px;bottom:20px;z-index:9000;line-height:1.5;
  right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));
}
.hbta-root *{box-sizing:border-box;}
.hbta-root button,.hbta-root input,.hbta-root select,.hbta-root textarea{font-family:'Montserrat',sans-serif;font-weight:500;}

/* ---------- launcher ---------- */
.hbta-mascot{display:block;flex:none;border-radius:50%;object-fit:cover;user-select:none;-webkit-user-drag:none;}
.hbta-launcher{
  display:flex;align-items:center;gap:14px;cursor:pointer;border:0;
  background:var(--a-accent);color:#fff;border-radius:999px;padding:6px 30px 6px 6px;
  font-size:1.08rem;font-weight:600;letter-spacing:0.02em;white-space:nowrap;
  box-shadow:0 14px 38px rgba(196,90,32,0.40),0 2px 8px rgba(0,0,0,0.55);
  transition:background .18s,transform .18s,box-shadow .18s;
}
.hbta-launcher:hover{background:var(--a-accent-hi);transform:translateY(-2px);}
.hbta-launcher:focus-visible,.hbta-root button:focus-visible,.hbta-root a:focus-visible{outline:2px solid var(--a-accent-hi);outline-offset:2px;}
.hbta-launch-img{width:72px;height:72px;background:#fff;box-shadow:0 0 0 2px rgba(255,255,255,0.92);}
.hbta-root.hbta-open .hbta-launcher{display:none;}

/* ---------- panel ---------- */
.hbta-panel{
  display:none;flex-direction:column;
  width:400px;height:min(640px,calc(100vh - 40px));height:min(640px,calc(100dvh - 40px));
  background:var(--a-panel);border:1px solid var(--a-line);border-radius:8px;overflow:hidden;
  box-shadow:0 24px 70px rgba(0,0,0,0.6);
}
.hbta-root.hbta-open .hbta-panel{display:flex;}

.hbta-head{display:flex;align-items:center;gap:12px;padding:12px 14px 12px 14px;background:var(--a-head);border-bottom:1px solid var(--a-line);}
.hbta-head-img{width:48px;height:48px;}
.hbta-title{flex:1;min-width:0;}
.hbta-brand{font-family:'Trajan Pro',serif;font-weight:400;font-size:1.12rem;line-height:1.1;color:var(--a-ink);}
.hbta-brand span{display:block;font-family:'Montserrat',sans-serif;font-weight:600;font-size:0.6rem;letter-spacing:0.16em;color:var(--a-accent);margin-top:3px;text-transform:uppercase;}
.hbta-iconbtn{background:none;border:1px solid transparent;color:var(--a-muted);width:34px;height:34px;border-radius:4px;cursor:pointer;display:grid;place-items:center;font-size:0.7rem;}
.hbta-iconbtn:hover{color:var(--a-ink);border-color:var(--a-line);}
.hbta-iconbtn svg{width:18px;height:18px;}

.hbta-notice{padding:9px 18px;font-size:0.72rem;line-height:1.5;color:var(--a-muted);background:rgba(196,90,32,0.08);border-bottom:1px solid var(--a-soft);}
.hbta-notice button{background:none;border:0;padding:0;color:var(--a-accent-hi);cursor:pointer;font-size:inherit;text-decoration:underline;}
.hbta-privacy{display:none;padding:12px 18px;font-size:0.74rem;line-height:1.55;color:var(--a-muted);background:var(--a-field);border-bottom:1px solid var(--a-soft);}
.hbta-privacy.hbta-show{display:block;}
.hbta-privacy p{margin:0 0 6px;}

/* ---------- messages ---------- */
.hbta-log{flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:14px;scroll-behavior:smooth;overscroll-behavior:contain;}
.hbta-msg{max-width:92%;font-size:0.88rem;line-height:1.6;}
.hbta-msg .hbta-who{display:flex;align-items:center;gap:8px;font-size:0.64rem;letter-spacing:0.14em;text-transform:uppercase;color:var(--a-dim);margin-bottom:5px;font-weight:600;}
.hbta-avatar{width:22px;height:22px;}
.hbta-tag{border:1px solid var(--a-accent);color:var(--a-accent-hi);border-radius:3px;padding:1px 6px;letter-spacing:0.12em;}
.hbta-bubble{padding:11px 14px;border-radius:8px;overflow-wrap:anywhere;}
.hbta-bubble p{margin:0 0 8px;}.hbta-bubble p:last-child{margin-bottom:0;}
.hbta-bubble ul{margin:6px 0 8px;padding-left:18px;}.hbta-bubble li{margin:3px 0;}
.hbta-bubble a{color:var(--a-accent-hi);text-decoration:underline;text-underline-offset:2px;}
.hbta-bubble a:hover{color:#fff;}
.hbta-ai .hbta-bubble{background:#221E18;border:1px solid var(--a-soft);border-top-left-radius:2px;}
.hbta-user{align-self:flex-end;}
.hbta-user .hbta-who{justify-content:flex-end;}
.hbta-user .hbta-bubble{background:rgba(196,90,32,0.16);border:1px solid rgba(196,90,32,0.45);border-top-right-radius:2px;white-space:pre-wrap;}
.hbta-error .hbta-bubble{border-color:rgba(232,138,74,0.5);}
.hbta-typing .hbta-bubble{color:var(--a-muted);}
.hbta-dots span{display:inline-block;width:5px;height:5px;margin-right:3px;border-radius:50%;background:var(--a-muted);animation:hbta-b 1.1s infinite ease-in-out;}
.hbta-dots span:nth-child(2){animation-delay:.15s}.hbta-dots span:nth-child(3){animation-delay:.3s}
@keyframes hbta-b{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

/* ---------- suggested questions ---------- */
.hbta-chips{display:flex;flex-direction:column;gap:8px;align-items:flex-start;}
.hbta-chip{background:transparent;border:1px solid var(--a-line);color:var(--a-ink);border-radius:4px;padding:9px 13px;font-size:0.8rem;text-align:left;cursor:pointer;transition:border-color .15s,background .15s;}
.hbta-chip:hover{border-color:var(--a-accent);background:rgba(196,90,32,0.1);}

/* ---------- human follow-up card (visually distinct from AI replies) ---------- */
.hbta-human{align-self:stretch;max-width:100%;background:var(--a-field);border:1px solid var(--a-line);border-left:3px solid var(--a-accent);border-radius:4px;padding:14px;font-size:0.82rem;}
.hbta-human h3{font-family:'Montserrat',sans-serif;font-weight:600;font-size:0.64rem;letter-spacing:0.16em;text-transform:uppercase;color:var(--a-accent-hi);margin:0 0 6px;}
.hbta-human p{margin:0 0 10px;color:var(--a-muted);line-height:1.55;}
.hbta-human .hbta-contact{color:var(--a-ink);margin:0 0 10px;}
.hbta-human .hbta-contact a{color:var(--a-accent-hi);}
.hbta-form label{display:block;font-size:0.7rem;color:var(--a-muted);margin:10px 0 4px;}
.hbta-form input[type=text],.hbta-form input[type=email],.hbta-form input[type=tel],.hbta-form select,.hbta-form textarea{
  width:100%;background:#0C0A08;border:1px solid var(--a-soft);border-radius:5px;padding:10px 12px;color:var(--a-ink);font-size:0.84rem;
}
.hbta-form input:focus,.hbta-form select:focus,.hbta-form textarea:focus{outline:none;border-color:var(--a-accent);}
.hbta-form textarea{resize:vertical;min-height:70px;}
.hbta-form .hbta-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.hbta-form .hbta-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden;}
.hbta-check{display:flex;gap:9px;align-items:flex-start;margin:12px 0 0;font-size:0.74rem;color:var(--a-muted);line-height:1.5;}
.hbta-check input{margin-top:3px;accent-color:var(--a-accent);flex:none;width:16px;height:16px;}
.hbta-form .hbta-actions{display:flex;gap:10px;margin-top:14px;}
.hbta-btn{border-radius:4px;border:1px solid transparent;padding:11px 18px;font-size:0.82rem;cursor:pointer;transition:background .15s,border-color .15s;}
.hbta-btn-primary{background:var(--a-accent);color:#fff;}.hbta-btn-primary:hover{background:var(--a-accent-hi);}
.hbta-btn-ghost{background:transparent;border-color:var(--a-line);color:var(--a-ink);}.hbta-btn-ghost:hover{border-color:var(--a-accent);}
.hbta-btn[disabled]{opacity:.55;cursor:default;}
.hbta-ferr{color:var(--a-accent-hi);font-size:0.76rem;margin-top:10px;min-height:1em;}

/* ---------- composer ---------- */
.hbta-composer{border-top:1px solid var(--a-line);background:var(--a-head);padding:12px 14px 10px;}
.hbta-inputrow{display:flex;gap:10px;align-items:flex-end;}
.hbta-input{flex:1;resize:none;max-height:120px;min-height:42px;background:var(--a-field);border:1px solid var(--a-soft);border-radius:5px;padding:11px 13px;color:var(--a-ink);font-size:0.88rem;line-height:1.4;}
.hbta-input::placeholder{color:#6b6456;}
.hbta-input:focus{outline:none;border-color:var(--a-accent);}
.hbta-send{flex:none;width:42px;height:42px;border-radius:4px;border:0;background:var(--a-accent);color:#fff;cursor:pointer;display:grid;place-items:center;}
.hbta-send:hover{background:var(--a-accent-hi);}.hbta-send[disabled]{opacity:.5;cursor:default;}
.hbta-send svg{width:18px;height:18px;}
.hbta-foot{display:flex;justify-content:space-between;gap:12px;margin-top:9px;font-size:0.7rem;color:var(--a-dim);}
.hbta-foot button{background:none;border:0;padding:0;color:var(--a-accent-hi);cursor:pointer;font-size:inherit;text-decoration:underline;text-underline-offset:2px;}
.hbta-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}

/* ---------- mobile: full-screen sheet ---------- */
@media (max-width:640px){
  .hbta-root{right:max(14px,env(safe-area-inset-right));bottom:max(14px,env(safe-area-inset-bottom));}
  .hbta-launcher{padding:0;background:none;box-shadow:none;border-radius:50%;}
  .hbta-launcher:hover{background:none;}
  .hbta-launcher .hbta-label{display:none;}
  .hbta-launch-img{width:68px;height:68px;box-shadow:0 8px 22px rgba(0,0,0,0.55),0 0 0 2px rgba(255,255,255,0.92);}
  .hbta-root.hbta-open{inset:0;right:0;bottom:0;}
  .hbta-panel{width:100vw;height:100vh;height:100dvh;border:0;border-radius:0;}
  .hbta-head{padding-top:max(14px,env(safe-area-inset-top));}
  .hbta-composer{padding-bottom:max(10px,env(safe-area-inset-bottom));}
  .hbta-input,.hbta-form input,.hbta-form select,.hbta-form textarea{font-size:16px;}   /* prevents iOS zoom on focus */
  .hbta-form .hbta-row{grid-template-columns:1fr;gap:0;}
  .hbta-msg{max-width:96%;}
  .hbta-foot button,.hbta-notice button{padding:10px 6px;margin:-10px -6px;min-height:36px;}   /* larger tap targets for text links */
  .hbta-foot{align-items:center;}
}
html.hbta-lock,html.hbta-lock body{overflow:hidden;}

/* ---------- attention nudge (once per visit) ---------- */
.hbta-launcher.hbta-nudge{animation:hbta-bounce 1.1s ease 2;}
.hbta-launcher.hbta-nudge .hbta-launch-img{animation:hbta-ring 1.6s ease-out 3;}
@keyframes hbta-bounce{0%,100%{transform:translateY(0);}30%{transform:translateY(-12px);}55%{transform:translateY(0);}75%{transform:translateY(-5px);}}
@keyframes hbta-ring{0%{box-shadow:0 0 0 2px rgba(255,255,255,0.92),0 0 0 0 rgba(232,138,74,0.75);}100%{box-shadow:0 0 0 2px rgba(255,255,255,0.92),0 0 0 22px rgba(232,138,74,0);}}
.hbta-tip{position:absolute;right:0;bottom:calc(100% + 14px);width:270px;display:flex;align-items:flex-start;gap:4px;
  background:#FBF7EF;color:#1B1813;border-radius:10px;padding:12px 8px 12px 14px;box-shadow:0 16px 40px rgba(0,0,0,0.45);
  opacity:0;transform:translateY(8px);transition:opacity .3s,transform .3s;pointer-events:none;}
.hbta-tip.hbta-tip-show{opacity:1;transform:none;pointer-events:auto;}
.hbta-tip::after{content:"";position:absolute;right:46px;bottom:-7px;width:14px;height:14px;background:#FBF7EF;transform:rotate(45deg);}
.hbta-tip-text{flex:1;background:none;border:0;padding:0;text-align:left;color:#1B1813;font-size:0.92rem;font-weight:600;line-height:1.4;cursor:pointer;}
.hbta-tip-x{flex:none;background:none;border:0;color:#736C5C;cursor:pointer;width:26px;height:26px;padding:4px;margin:-4px 0 0;}
.hbta-tip-x svg{width:16px;height:16px;}
.hbta-root.hbta-open .hbta-tip{display:none;}
@media (max-width:640px){.hbta-tip{width:230px;}.hbta-tip::after{right:24px;}}

@media print{.hbta-root{display:none;}}
@media (prefers-reduced-motion:reduce){.hbta-root *{transition:none!important;animation:none!important;scroll-behavior:auto!important;}}

/* ---------- homepage feature band ---------- */
.hemmie-band{background:#F4EEE2;color:#1B1813;padding:64px 0;position:relative;overflow:hidden;}
.hemmie-band::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 18% 50%,rgba(232,138,74,0.22),transparent 55%);pointer-events:none;}
.hemmie-band .wrap{position:relative;display:grid;grid-template-columns:260px minmax(0,1fr);gap:48px;align-items:center;}
.hemmie-avatar{position:relative;width:220px;height:220px;margin:0 auto;}
.hemmie-avatar img{position:relative;z-index:2;width:220px;height:220px;border-radius:50%;background:#fff;object-fit:cover;
  box-shadow:0 0 0 6px #fff,0 0 0 9px #E8650A,0 24px 50px rgba(27,24,19,0.28);animation:hemmie-float 4.5s ease-in-out infinite;}
.hemmie-avatar span{position:absolute;inset:0;border-radius:50%;border:2px solid #E8650A;opacity:0;animation:hemmie-pulse 3.2s ease-out infinite;}
.hemmie-avatar span:nth-child(2){animation-delay:1.06s;}
.hemmie-avatar span:nth-child(3){animation-delay:2.13s;}
@keyframes hemmie-float{0%,100%{transform:translateY(0);}50%{transform:translateY(-10px);}}
@keyframes hemmie-pulse{0%{transform:scale(1);opacity:0.7;}100%{transform:scale(1.55);opacity:0;}}
.hemmie-band .eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:0.74rem;letter-spacing:0.16em;text-transform:uppercase;color:#B8500F;font-weight:700;margin:0 0 12px;}
.hemmie-band .eyebrow i{width:9px;height:9px;border-radius:50%;background:#2E9E5B;box-shadow:0 0 0 0 rgba(46,158,91,0.6);animation:hemmie-live 2s ease-out infinite;}
@keyframes hemmie-live{0%{box-shadow:0 0 0 0 rgba(46,158,91,0.6);}100%{box-shadow:0 0 0 10px rgba(46,158,91,0);}}
.hemmie-band h2{color:#1B1813;font-size:clamp(1.9rem,3.6vw,2.6rem);margin:0 0 12px;line-height:1.15;}
.hemmie-band h2 em{font-style:normal;color:#C45A20;}
.hemmie-band p.lead{color:#4A443A;font-size:1.06rem;max-width:620px;margin:0 0 20px;}
.hemmie-qs{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 22px;padding:0;list-style:none;}
.hemmie-qs button{background:#fff;border:1px solid rgba(27,24,19,0.16);color:#1B1813;border-radius:999px;padding:9px 16px;font:inherit;font-size:0.9rem;font-weight:600;cursor:pointer;transition:border-color .15s,transform .15s,box-shadow .15s;}
.hemmie-qs button:hover,.hemmie-qs button:focus-visible{border-color:#E8650A;transform:translateY(-2px);box-shadow:0 6px 16px rgba(27,24,19,0.12);}
.hemmie-band .btn-hemmie{display:inline-flex;align-items:center;gap:10px;background:#1B1813;color:#fff;border:0;border-radius:6px;padding:14px 26px;font:inherit;font-weight:700;font-size:1rem;cursor:pointer;transition:background .15s;}
.hemmie-band .btn-hemmie:hover{background:#C45A20;}
.hemmie-band .fine{color:#736C5C;font-size:0.82rem;margin:12px 0 0;}
@media (max-width:820px){.hemmie-band .wrap{grid-template-columns:1fr;gap:28px;text-align:center;}.hemmie-avatar,.hemmie-avatar img{width:160px;height:160px;}.hemmie-qs{justify-content:center;}.hemmie-band p.lead{margin-left:auto;margin-right:auto;}}
@media (prefers-reduced-motion:reduce){.hemmie-avatar img,.hemmie-avatar span,.hemmie-band .eyebrow i{animation:none!important;}}
