/* ── Hero demo ───────────────────────────────────────────────────
   A scripted example conversation in place of the old video loop. The
   finished conversation is in the HTML, so JS-off and reduced-motion
   visitors see the end state; js/hero-demo.js replays it when motion is OK.
   It sits in a device: a monitor on wider screens, a phone at 640px and
   below. The bezel flips with the theme so it always contrasts the page;
   the screen stays dark green in both. */
.hero-loop.hero-demo{--stand:#B8BCB3;--stand-2:#8F948A;--chin:rgba(0,0,0,.16);--cam:#8A8F86;
  aspect-ratio:auto;overflow:visible;border-radius:22px;margin-bottom:62px;padding:12px 12px 26px;
  background:linear-gradient(180deg,#ECEFEA 0%,#C9CDC4 100%);
  box-shadow:0 40px 90px rgba(0,0,0,.45),0 14px 30px rgba(0,0,0,.3),
    inset 0 1.5px 0 rgba(255,255,255,.7),inset 0 -2px 0 rgba(0,0,0,.18),0 0 0 1px rgba(0,0,0,.35);
  color:#E9F7EF;font-family:var(--sans)}
html[data-theme="light"] .hero-loop.hero-demo{--stand:#1A221E;--stand-2:#0A0F0C;--chin:rgba(255,255,255,.1);--cam:#2E3833;
  background:linear-gradient(180deg,#1C2520 0%,#0B100D 100%);
  box-shadow:0 40px 90px rgba(14,42,29,.26),0 14px 30px rgba(14,42,29,.18),
    inset 0 1.5px 0 rgba(255,255,255,.08),inset 0 -2px 0 rgba(0,0,0,.4),0 0 0 1px rgba(0,0,0,.6)}
/* Neck and base */
.hero-loop.hero-demo::before{content:"";position:absolute;top:100%;left:50%;width:16%;height:42px;transform:translateX(-50%);
  background:linear-gradient(180deg,var(--stand-2) 0%,var(--stand) 30%,var(--stand-2) 100%);
  clip-path:polygon(6% 0,94% 0,100% 100%,0 100%)}
.hero-loop.hero-demo::after{content:"";position:absolute;top:calc(100% + 41px);left:50%;width:40%;height:10px;transform:translateX(-50%);
  border-radius:6px 6px 10px 10px;background:linear-gradient(180deg,var(--stand) 0%,var(--stand-2) 100%);
  box-shadow:0 14px 26px rgba(0,0,0,.28)}

.hd-screen{position:relative;display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:14px;padding:14px;min-height:380px;
  border-radius:10px;background:radial-gradient(120% 90% at 85% 0%,#14402C 0%,#0A1F16 58%,#071710 100%);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.45)}
/* Camera in the top bezel, logo bar in the chin */
.hd-screen::before{content:"";position:absolute;top:-8px;left:50%;width:4px;height:4px;margin-left:-2px;border-radius:50%;background:var(--cam)}
.hd-screen::after{content:"";position:absolute;top:calc(100% + 11px);left:50%;width:28px;height:4px;margin-left:-14px;border-radius:2px;background:var(--chin)}

/* Website chat card */
.hd-chat{display:flex;flex-direction:column;min-height:0;border-radius:14px;background:#F6FBF8;color:#0E2A1D;
  box-shadow:0 18px 44px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.06)}
.hd-chat-head{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid #E1ECE5}
.hd-biz{position:relative;width:28px;height:28px;border-radius:8px;background:#1F5FA8;color:#fff;display:grid;place-items:center;
  font-weight:700;font-size:13px;flex:none}
.hd-biz::after{content:"";position:absolute;right:-3px;bottom:-3px;width:9px;height:9px;border-radius:50%;
  background:#2FBF71;box-shadow:0 0 0 2px #F6FBF8}
.hd-chat-head b{display:block;font-size:13.5px;font-weight:600;letter-spacing:-.01em}
.hd-chat-head small{display:block;font-size:11.5px;color:#5C7466}
.hd-tag{margin-left:auto;font-family:var(--mono);font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;
  color:#5C7466;border:1px solid #D6E3DB;border-radius:999px;padding:3px 8px}
.hd-thread{position:relative;flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;gap:8px;padding:12px 14px}
.hd-msg{max-width:88%;font-size:12.5px;line-height:1.42;padding:8px 11px;border-radius:14px}
.hd-msg.v{align-self:flex-end;background:#1F5FA8;color:#fff;border-bottom-right-radius:5px}
.hd-msg.a{align-self:flex-start;background:#fff;border:1px solid #E1ECE5;border-bottom-left-radius:5px}
.hd-time{align-self:center;font-family:var(--mono);font-size:10px;letter-spacing:.08em;color:#7D9387}
.hd-link{display:flex;align-items:center;gap:10px;margin-top:8px;padding:8px 10px;border-radius:10px;
  background:#EEF6F1;border:1px solid #D6E3DB;font-size:12.5px;font-weight:600;color:#0E2A1D}
.hd-link i{font-style:normal;margin-left:auto;color:#1F5FA8}
.hd-link small{display:block;font-weight:400;color:#5C7466;font-size:11px}
/* Message box: what makes it read as a real website chat. */
.hd-compose{display:flex;align-items:center;gap:8px;margin:0 12px 12px;padding:7px 7px 7px 12px;border-radius:12px;
  background:#fff;border:1px solid #DCE8E0;font-size:12px;color:#8AA295}
.hd-compose i{margin-left:auto;width:24px;height:24px;border-radius:8px;display:grid;place-items:center;background:#1F5FA8;color:#fff}
.hd-compose svg{width:12px;height:12px}
.hd-typing{position:absolute;left:14px;display:none;gap:4px;padding:11px 12px;background:#fff;border:1px solid #E1ECE5;border-radius:14px}
.hd-typing span{width:6px;height:6px;border-radius:50%;background:#8FB3A0;animation:hdDot 1s infinite}
.hd-typing span:nth-child(2){animation-delay:.15s}.hd-typing span:nth-child(3){animation-delay:.3s}
@keyframes hdDot{50%{opacity:.25;transform:translateY(-2px)}}

/* Rail: the live eye, then a timeline of what it did and why. */
.hd-rail{display:flex;flex-direction:column;min-height:0;gap:16px;padding:10px 4px 4px}
.hd-eye{display:flex;align-items:center;gap:12px;padding-bottom:14px;border-bottom:1px solid rgba(233,247,239,.09)}
/* Square box, canvas fills it: eye.js renders a square, so any other shape squashes the eye. */
.hd-orb{position:relative;width:64px;height:64px;flex:none;border-radius:50%;
  background:radial-gradient(circle at 38% 32%,#E8FFF1 0,#A6F2CC 25%,#5EDCA0 55%,#2A9F70 85%,#114F38 100%);
  box-shadow:0 0 36px rgba(94,220,160,.35)}
.hd-orb:has(canvas){background:none;box-shadow:none}
.hd-eye b{display:block;font-family:var(--display);font-size:17px;font-weight:600;letter-spacing:-.02em}
.hd-eye small{display:flex;align-items:center;gap:6px;font-family:var(--mono);font-size:10px;letter-spacing:.14em;
  text-transform:uppercase;color:#8FD9B4}
.hd-eye small::before{content:"";width:6px;height:6px;border-radius:50%;background:#5EDCA0;box-shadow:0 0 8px #5EDCA0}
.hd-label{font-family:var(--mono);font-size:9.5px;font-weight:500;letter-spacing:.16em;text-transform:uppercase;color:#7FAF95}
.hd-log{list-style:none;margin:-4px 0 0;padding:0;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.hd-log li{position:relative;display:grid;grid-template-columns:15px minmax(0,1fr);column-gap:11px;padding-bottom:18px;
  font-size:12.5px;line-height:1.3;color:#E9F7EF}
.hd-log li:last-child{padding-bottom:0}
/* The thread line joins each step to the next. */
.hd-log li:not(:last-child)::before{content:"";position:absolute;left:7px;top:17px;bottom:2px;width:1px;background:rgba(143,217,180,.24)}
.hd-node{width:15px;height:15px;margin-top:1px;border-radius:50%;display:grid;place-items:center;
  border:1.5px solid #5EDCA0;background:#0B2419;color:#5EDCA0}
.hd-node svg{width:8px;height:8px}
.hd-log li.is-handoff .hd-node{background:#5EDCA0;color:#0A1F16;box-shadow:0 0 10px rgba(94,220,160,.45)}
.hd-log em{display:block;margin-bottom:3px;font-family:var(--mono);font-style:normal;font-size:9.5px;letter-spacing:.1em;
  text-transform:uppercase;color:#7FAF95;font-variant-numeric:tabular-nums}
.hd-log b{display:block;font-weight:600;letter-spacing:-.005em;text-wrap:balance}
.hd-log small{display:block;margin-top:2px;font-size:11px;color:#9DBBAA}

/* Replay states, set by js/hero-demo.js */
.hero-demo [data-step]{transition:opacity .45s var(--ease-out),transform .45s var(--ease-out)}
.hero-demo.is-playing .hd-stream .w{opacity:0;transition:opacity .2s}
.hero-demo.is-playing .hd-stream .w.in{opacity:1}
/* Hidden steps keep their space, so the panel never changes height mid-replay. */
.hero-demo.is-playing [data-step]:not(.on){opacity:0;transform:translateY(8px);visibility:hidden}

/* The headline needs the left column, so on wide screens the monitor grows
   into the empty page margin instead (capped so 48px+ of margin stays). */
@media(min-width:1300px){
  .hero-loop.hero-demo{--grow:clamp(0px,calc((100vw - var(--frame))/2 + 8px),150px);
    width:calc(100% + var(--grow) + 24px);margin-left:-24px}
}
/* 960-1299px: the side column is too narrow for a landscape monitor, so stack
   like the tablet layout instead of drawing a tall portrait screen. */
@media(min-width:960px) and (max-width:1299px){
  .hero-grid{grid-template-columns:minmax(0,1fr);gap:48px}
  .hero-loop.hero-demo{width:100%;max-width:720px;margin-top:0}
}
@media(max-width:1299px){.hero-loop.hero-demo{margin-inline:auto}}
/* Phone: the chat fills the screen like an app; the rail and the stand go. */
@media(max-width:640px){
  .hero-loop.hero-demo{width:min(360px,100%);margin:0 auto 8px;padding:10px;border-radius:48px}
  .hero-loop.hero-demo::before,.hero-loop.hero-demo::after,.hd-screen::after{display:none}
  .hd-screen{grid-template-columns:1fr;padding:0;min-height:600px;border-radius:38px;overflow:hidden;background:#F6FBF8}
  .hd-screen::before{top:10px;width:88px;height:24px;margin-left:-44px;border-radius:999px;background:#050806;z-index:2}
  .hd-chat{position:relative;border-radius:0;box-shadow:none}
  .hd-chat::after{content:"";position:absolute;bottom:8px;left:50%;width:108px;height:4px;margin-left:-54px;border-radius:2px;background:#0E2A1D}
  .hd-chat-head{padding:46px 18px 12px}
  .hd-thread{padding:14px 14px 10px}
  .hd-compose{margin:0 14px 26px}
  .hd-rail{display:none}
}
@media(prefers-reduced-motion:reduce){.hd-typing span{animation:none}}
