/* HANDOVER — hero walkthrough animation. Pure CSS + tiny JS timeline (js/demo.js). No video, no third parties. */
.hx-hero.has-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hx-hero.has-demo h1 { font-size: clamp(2.3rem, 4.6vw, 4.4rem); }
@media (max-width: 940px) { .hx-hero.has-demo { grid-template-columns: 1fr; } }

.demo { position: relative; }
.demo-stage {
  position: relative; aspect-ratio: 16 / 13; width: 100%; overflow: hidden; border-radius: 14px;
  background: radial-gradient(120% 90% at 85% 0%, var(--pop) 0%, var(--paper-warm) 45%, #fff 100%);
  border: 1px solid var(--rule); box-shadow: 0 30px 60px -30px rgba(42, 27, 94, 0.35);
  font-family: var(--font-body); color: var(--ink);
}
.demo-bar { position: absolute; inset: 0 0 auto 0; height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 12px;
  border-bottom: 1px solid var(--rule); background: rgba(255,255,255,0.75); backdrop-filter: blur(6px); z-index: 5; }
.demo-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }
.demo-bar span { margin-left: 8px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; transition: opacity .4s; }

.sc { position: absolute; inset: 34px 0 0 0; padding: 6% 6% 5%; opacity: 0; visibility: hidden; transition: opacity .55s var(--ease), visibility 0s .55s; }
.sc.on { opacity: 1; visibility: visible; transition: opacity .55s var(--ease); }
.sc.out { opacity: 0; visibility: visible; transition: opacity .45s var(--ease); }
.sc .a { opacity: 0; }
.sc:is(.on,.out) .a { animation: d-in .6s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes d-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes d-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes d-blink { 50% { opacity: 0; } }
@keyframes d-draw { to { stroke-dashoffset: 0; } }
@keyframes d-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(91,75,196,.35); } 50% { box-shadow: 0 0 0 8px rgba(91,75,196,0); } }

/* shared bits */
.chip { position: absolute; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px; background: #fff;
  border: 1px solid var(--rule); font-size: clamp(10px, 1.15vw, 13px); font-weight: 600; white-space: nowrap; box-shadow: 0 8px 18px -12px rgba(26,22,51,.35); }
.chip b { font-family: var(--font-mono); font-size: .78em; font-weight: 500; color: #fff; background: var(--accent); border-radius: 4px; padding: 2px 5px; }
.chip b.pdf { background: var(--coral); } .chip b.md { background: var(--ink-soft); } .chip b.ai { background: var(--violet); }
.sc:is(.on,.out) .chip.fl { animation: d-in .6s var(--ease) both, d-float 4s ease-in-out infinite; animation-delay: var(--d,0s), calc(var(--d,0s) + .6s); }
.tag { font-family: var(--font-mono); font-size: clamp(9px, .95vw, 11px); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.big { font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; font-size: clamp(1.25rem, 2.6vw, 2.1rem); }
.big em { font-style: normal; color: var(--accent); }

/* chat window */
.chat { position: absolute; inset: 7% 7% 7% 7%; background: #fff; border: 1px solid var(--rule); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.chat-h { padding: 9px 14px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; }
.chat-b { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: clamp(10.5px, 1.2vw, 14px); line-height: 1.45; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--paper-warm); border-bottom-left-radius: 4px; }
.msg.ai.bad { border: 1px dashed var(--coral); }
.chat-in { margin: 0 12px 12px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 10px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; min-height: 38px; }
.typing::after { content: "▍"; animation: d-blink 1s steps(1) infinite; color: var(--accent); }

/* map */
.map { position: absolute; inset: 7% 9% 24% 9%; }
.map svg { width: 100%; height: 100%; overflow: visible; }
.map line { stroke: var(--violet); stroke-width: 1.6; stroke-dasharray: 260; stroke-dashoffset: 260; opacity: .8; }
.sc:is(.on,.out) .map line { animation: d-draw 1.2s var(--ease) forwards; animation-delay: var(--d, 0s); }
.map circle { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.map .hub { fill: var(--accent); }
.node-l { position: absolute; transform: translate(-50%, -50%); font-family: var(--font-mono); font-size: clamp(8px, .9vw, 10.5px); color: var(--ink-soft); background: rgba(255,255,255,.85); padding: 2px 5px; border-radius: 4px; white-space: nowrap; }
.lock { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 5%; display: flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: clamp(10px, 1.1vw, 12.5px); font-weight: 600; white-space: nowrap; }
.sc:is(.on,.out) .lock { animation: d-in .6s var(--ease) both, d-pulse 2.2s ease-in-out infinite; animation-delay: var(--d,0s), calc(var(--d,0s) + .6s); }

/* findings */
.cards { position: absolute; inset: 5% 6%; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.card { background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 10px; padding: 9px 14px; }
.card.dec { border-left-color: var(--coral); }
.card .tag { display: block; line-height: 1.2; }
.card p { margin: 2px 0 0 !important; line-height: 1.3; font-size: clamp(10.5px, 1.2vw, 14px); font-weight: 650; letter-spacing: -0.01em; }
.card .src { line-height: 1.2; margin-top: 3px; font-family: var(--font-mono); font-size: clamp(8.5px, .9vw, 10.5px); color: var(--muted); }

/* choose */
.rows { position: absolute; inset: 9% 8%; display: flex; flex-direction: column; gap: 3%; }
.row { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--rule); border-radius: 9px; padding: 2.6% 4%; font-size: clamp(10.5px, 1.2vw, 14px); font-weight: 600; transition: opacity .5s; }
.tg { width: 32px; height: 18px; border-radius: 999px; background: var(--accent); position: relative; flex: none; transition: background .4s; }
.tg::after { content: ""; position: absolute; top: 2px; left: 16px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .4s var(--ease); }
.sc:is(.on,.out) .row.off { animation: d-in .6s var(--ease) both, d-dim .4s linear forwards; animation-delay: var(--d,0s), var(--t, 2.2s); }
.sc:is(.on,.out) .row.off .tg { animation: d-tg-bg .01s linear forwards; animation-delay: var(--t, 2.2s); }
.sc:is(.on,.out) .row.off .tg::after { animation: d-tg-k .4s var(--ease) forwards; animation-delay: var(--t, 2.2s); }
@keyframes d-dim { to { opacity: .45; } } @keyframes d-tg-bg { to { background: var(--rule); } } @keyframes d-tg-k { to { left: 2px; } }
.redact { font-family: var(--font-mono); font-size: .92em; display: inline-grid; }
.redact .was, .redact .now { grid-area: 1 / 1; transition: opacity .3s; }
.redact .now { opacity: 0; background: var(--ink); color: #fff; border-radius: 4px; padding: 0 5px; justify-self: start; }
.sc:is(.on,.out) .redact .was { animation: d-hide .3s forwards; animation-delay: 3.4s; }
.sc:is(.on,.out) .redact .now { animation: d-show .3s forwards; animation-delay: 3.4s; }
@keyframes d-hide { to { opacity: 0; } } @keyframes d-show { to { opacity: 1; } }

/* pack */
.pack { position: absolute; left: 0; right: 0; margin: 0 auto; top: 22%; width: 62%; background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 4% 5%;
  box-shadow: 0 24px 40px -24px rgba(42,27,94,.5); }
.sc:is(.on,.out) .pack { animation: d-in .6s var(--ease) both, d-drop 1.1s var(--ease) 2.6s forwards; }
@keyframes d-drop { to { top: 64%; transform: scale(.55); opacity: 0; } }
.pack .ttl { font-weight: 800; font-size: clamp(12px, 1.6vw, 18px); letter-spacing: -0.02em; }
.pack .meter { height: 6px; border-radius: 99px; background: var(--rule-soft); margin: 10px 0 6px; overflow: hidden; }
.pack .meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--violet)); }
.sc:is(.on,.out) .pack .meter i { animation: d-fill 1.4s var(--ease) .7s forwards; } @keyframes d-fill { to { width: 74%; } }
.sent { position: absolute; left: 10%; right: 10%; bottom: 10%; }
.sc:is(.on,.out) .sent { animation: d-in .5s var(--ease) both; animation-delay: 3.4s; }

/* blueprint */
.doc { position: absolute; inset: 5% 7%; background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 4% 6%; overflow: hidden; }
.doc h4 { margin: 0 0 2%; font-size: clamp(14px, 2vw, 22px); letter-spacing: -0.02em; font-weight: 800; }
.doc .ln { display: flex; justify-content: space-between; align-items: center; padding: 1.6% 0; border-bottom: 1px solid var(--rule-soft); font-size: clamp(10.5px, 1.25vw, 14.5px); font-weight: 600; }
.doc .ln s { text-decoration: none; color: var(--accent); font-weight: 800; }
.doc .reply { margin-top: 3.5%; }

/* end card */
.end { display: flex; flex-direction: column; justify-content: center; gap: 5%; text-align: left; padding: 8% 9%; }
.end .big { font-size: clamp(1.5rem, 3.6vw, 2.9rem); }
.end .pills { display: flex; flex-wrap: wrap; gap: 8px; }
.end .pills span { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--rule); font-size: clamp(10px, 1.1vw, 13px); font-weight: 600; }
.end .btn { align-self: flex-start; }

/* caption + controls (outside the stage, real text) */
.demo-cap { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; min-height: 3.2em; }
.demo-cap p { margin: 0; flex: 1; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.demo-cap p b { color: var(--ink); }
.demo-ctl { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.demo-dots { display: flex; gap: 6px; flex: 1; }
.demo-dots button { flex: 1; height: 4px; border: 0; border-radius: 99px; background: var(--rule); padding: 0; cursor: pointer; position: relative; overflow: hidden; }
.demo-dots button i { position: absolute; inset: 0; width: 0; background: var(--accent); }
.demo-dots button.done i { width: 100%; }
.demo-play { border: 1px solid var(--rule); background: #fff; border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 12px; color: var(--ink); flex: none; }
.demo-play:focus-visible, .demo-dots button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .sc, .sc.on, .sc .a, .sc:is(.on,.out) .a, .chip.fl, .lock, .pack, .sent { animation: none !important; transition: opacity .2s !important; }
  .sc .a { opacity: 1; } .map line { stroke-dashoffset: 0; } .pack .meter i { width: 74%; }
  .pack { display: none; } .sent { opacity: 1; }
  .row.off { opacity: .45; } .row.off .tg { background: var(--rule); } .row.off .tg::after { left: 2px; }
  .redact .was { opacity: 0; } .redact .now { opacity: 1; }
}

/* opening scene: why switch */
.sc.why { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: auto 1fr auto; gap: 3%; padding: 6% 6% 6%; }
.why-h { grid-column: 1 / -1; }
.why-c { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 10% 9%; display: flex; flex-direction: column; gap: 4px; align-self: center; }
.why-c b { font-size: clamp(11.5px, 1.45vw, 16px); letter-spacing: -0.01em; }
.why-c span:last-child { font-size: clamp(9.5px, 1vw, 12px); color: var(--muted); }
.why-c:first-of-type b { color: var(--coral-ink); }
.why-q { grid-column: 1 / -1; font-weight: 700; font-size: clamp(11.5px, 1.45vw, 16px); color: var(--accent); }

/* landing: why + example sections */
.hx-why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.5rem; }
.hx-why > div { border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.2rem; background: #fff; }
.hx-why h3 { margin: 0 0 .4rem; font-size: 1.05rem; letter-spacing: -0.01em; }
.hx-why p { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; }
.hx-case { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.hx-case-col { border: 1px solid var(--rule); border-radius: 12px; padding: 1.2rem 1.3rem; background: #fff; }
.hx-case-col.pro { background: var(--paper-warm); border-color: var(--pop); }
.hx-case-col ul, .hx-case-col ol { margin: .6rem 0 0 1.1rem; padding: 0; }
.hx-case-col li { font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); margin: .45rem 0; }
.hx-case-col li b { color: var(--ink); }
@media (max-width: 940px) { .hx-why { grid-template-columns: 1fr 1fr; } .hx-case { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .hx-why { grid-template-columns: 1fr; } }

/* two worlds: the old way (strained) vs the HANDOVER way (calm, fast) */
.demo-stage { --green: #2E9E6B; transition: background .8s var(--ease), border-color .8s; }
.demo-stage[data-theme="hard"] { background: radial-gradient(120% 90% at 85% 0%, #FFD9DB 0%, #FFF1EF 45%, #fff 100%); border-color: #F6C9CB; }
.demo-stage[data-theme="hard"] .demo-bar span { color: var(--coral-ink); }
.demo-stage[data-theme="tool"] { background: radial-gradient(120% 90% at 85% 0%, var(--pop) 0%, var(--paper-warm) 45%, #fff 100%); }
.demo-stage[data-theme="easy"] { background: radial-gradient(120% 90% at 85% 0%, #C9F2DD 0%, #EEFBF4 45%, #fff 100%); border-color: #BFE9D3; }
.demo-stage[data-theme="easy"] .demo-bar span { color: var(--green); }
.demo-stage .demo-bar span { transition: color .6s; }

.clock { font-family: var(--font-mono); font-size: clamp(9px, .95vw, 11px); font-weight: 600; color: var(--coral-ink); background: #FFE7E8; padding: 3px 8px; border-radius: 99px; }
.clock.good { color: var(--green); background: #E1F6EC; }
.msg.ai.bad { background: #FFF1F1; }
.sc:is(.on,.out) .msg.ai.bad:last-child { animation: d-in .6s var(--ease) both, d-shake .45s ease-in-out both; animation-delay: var(--d,0s), calc(var(--d,0s) + .6s); }
@keyframes d-shake { 20%,60% { transform: translateX(-4px); } 40%,80% { transform: translateX(4px); } }
.x { display: inline-block; margin-left: 4px; font-weight: 700; color: var(--coral-ink); }
.msg.ai.good { background: #E9F8F0; border: 1px solid #BFE9D3; }
.v, .ok { font-weight: 700; color: var(--green); }
.msg .v { margin-left: 4px; }

.file { position: absolute; left: 7%; right: 7%; top: 7%; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #BFE9D3; border-radius: 12px; padding: 3.5% 4%; box-shadow: 0 18px 30px -22px rgba(46,158,107,.6); }
.file-ic { flex: none; width: 38px; height: 46px; border-radius: 6px; background: var(--green); color: #fff; font-family: var(--font-mono); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.file .ttl { font-weight: 800; font-size: clamp(12px, 1.6vw, 18px); letter-spacing: -0.02em; }
.file .ok { margin-left: auto; font-size: clamp(10px, 1.1vw, 13px); }
.chat.mini { inset: 38% 7% 6% 7%; }
.attach { align-self: flex-end; background: #fff; border: 1px solid #BFE9D3; border-radius: 10px; padding: 8px 12px; font-size: clamp(10.5px, 1.2vw, 14px); font-weight: 600; }
.attach .ok { margin-left: 6px; }

.outs { display: flex; flex-direction: column; gap: 8px; }
.out { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; background: #F4FBF7; border: 1px solid #BFE9D3; border-radius: 10px; padding: 8px 12px; }
.out b { font-size: clamp(11px, 1.35vw, 15px); letter-spacing: -0.01em; }
.out span { grid-column: 1; font-family: var(--font-mono); font-size: clamp(8.5px, .9vw, 10.5px); color: var(--muted); }
.out s { grid-row: 1 / span 2; grid-column: 2; text-decoration: none; color: var(--green); font-weight: 800; font-size: 1.1em; }
.sc.end .btn-primary { background: var(--green); border-color: var(--green); }

/* landing: what you get */
.hx-get { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.hx-get > div { border: 1px solid var(--rule); border-radius: 12px; padding: 1.2rem 1.3rem; background: #fff; }
.hx-get .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; }
.hx-get h3 { margin: .7rem 0 .4rem; font-family: var(--font-mono); font-size: .95rem; letter-spacing: 0; word-break: break-word; }
.hx-get p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.hx-get p b { color: var(--ink); }
@media (max-width: 940px) { .hx-get { grid-template-columns: 1fr; } }

.chat.tight { inset: 5% 6%; }
.chat.tight .chat-b { gap: 7px; padding: 10px 12px; }
.chat.tight .msg { padding: 6px 10px; font-size: clamp(10px, 1.1vw, 13px); line-height: 1.38; }
.doc-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.doc .reply { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.doc .reply .msg { padding: 7px 11px; font-size: clamp(10px, 1.15vw, 13.5px); line-height: 1.4; }
