/* Motion layer: reveal, hero orb, capability ticker, call simulator, card spotlight. */

/* Reveal on scroll (only applied by fx.js when motion is allowed) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* Hero, two columns with the voice orb */
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; align-items: center; }
.hero-grid h1 { font-size: clamp(2.3rem, 4.8vw, 3.9rem); }
.orb-wrap { position: relative; aspect-ratio: 1; max-width: 560px; width: 100%; justify-self: center; }
.orb-wrap::before { content: ''; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(45, 212, 191, .22), rgba(37, 99, 235, .12) 45%, transparent 70%); filter: blur(30px); }
#orb { position: relative; width: 100%; height: 100%; display: block; }
.orb-ring { position: absolute; inset: 6%; border-radius: 50%; border: 1px dashed rgba(199, 204, 230, .18); animation: spin 60s linear infinite; }
.orb-ring.r2 { inset: 0; border-style: solid; border-color: rgba(199, 204, 230, .07); animation-duration: 90s; animation-direction: reverse; }
.orb-ring::after { content: ''; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }
.orb-chip { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%) translateY(6px); opacity: 0; display: inline-flex; align-items: center; gap: 10px; max-width: 92%; padding: 10px 16px; border-radius: 999px; background: rgba(20, 18, 71, .85); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(8px); color: #fff; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .3s, transform .3s; }
.orb-chip.on { opacity: 1; transform: translateX(-50%); }
.orb-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex: none; animation: blink 1.4s infinite; }
.orb-chip span { overflow: hidden; text-overflow: ellipsis; }
@keyframes blink { 50% { opacity: .3; } }
.orb-tag { position: absolute; font: 500 .7rem var(--mono); letter-spacing: .08em; color: var(--on-night); padding: 6px 10px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; background: rgba(11, 10, 46, .6); animation: float 6s ease-in-out infinite; }
.orb-tag b { color: var(--teal); font-weight: 500; }
.orb-tag.t1 { top: 12%; left: 0; }
.orb-tag.t2 { top: 30%; right: -2%; animation-delay: -2s; }
.orb-tag.t3 { top: 62%; left: -4%; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-10px); } }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .orb-wrap { max-width: 400px; margin-top: 12px; }
}

/* Capability ticker */
.ticker { background: var(--night); border-top: 1px solid rgba(255, 255, 255, .07); overflow: hidden; padding: 16px 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker ul { display: flex; gap: 40px; list-style: none; margin: 0; padding: 0; width: max-content; animation: tick 40s linear infinite; }
.ticker li { display: flex; align-items: center; gap: 10px; color: var(--on-night); font-weight: 500; white-space: nowrap; }
.ticker li .i { color: var(--teal); }
@keyframes tick { to { transform: translateX(-50%); } }

/* Call simulator */
.sim { display: grid; grid-template-columns: 1.35fr .65fr; gap: 0; background: var(--night); border-radius: 22px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 40px 80px -30px rgba(11, 10, 46, .55); }
.sim-main { display: flex; flex-direction: column; min-height: 520px; border-right: 1px solid rgba(255, 255, 255, .08); }
.sim-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); flex-wrap: wrap; }
.sim-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sim-tabs button { font: 600 .88rem var(--body); color: var(--on-night); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.sim-tabs button[aria-selected="true"] { background: var(--teal); color: var(--ink); border-color: var(--teal); }
.sim-status { display: inline-flex; align-items: center; gap: 8px; font: 500 .74rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--on-night); }
.sim-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #F43F5E; animation: blink 1.4s infinite; }
.sim-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; max-height: 470px; scroll-behavior: smooth; }
.sim-row { max-width: 88%; padding: 10px 14px; border-radius: 14px; animation: pop .3s ease both; }
.sim-row small { display: block; font: 500 .66rem var(--mono); letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-bottom: 4px; }
.sim-row p { margin: 0; line-height: 1.5; }
.sim-row.caller { align-self: flex-start; background: rgba(255, 255, 255, .07); color: #E4E8F7; border-bottom-left-radius: 4px; }
.sim-row.agent { align-self: flex-end; background: linear-gradient(135deg, #1D4ED8, #0E7FC0); color: #fff; border-bottom-right-radius: 4px; }
.sim-row.think, .sim-row.tool { align-self: center; max-width: 96%; background: transparent; border: 1px dashed rgba(45, 212, 191, .35); color: var(--on-night); font-size: .88rem; }
.sim-row.tool { border-color: rgba(129, 140, 248, .45); }
.sim-row code { font: .82rem var(--mono); color: var(--teal); }
.sim-row.tool code { color: #A5B4FC; }
.sim-row span { display: block; font: .8rem var(--mono); color: #E4E8F7; margin-top: 3px; }
.interim { color: #9AA3C7; }
.interim::after { content: '▍'; margin-left: 2px; animation: blink 1s infinite; color: var(--teal); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.sim-side { padding: 22px; display: flex; flex-direction: column; gap: 22px; color: var(--on-night); }
.sim-side h3 { color: #fff; font-size: 1rem; font-family: var(--body); }
.sim-pipeline { display: grid; gap: 10px; }
.sim-pipeline div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .08); transition: background .25s, border-color .25s; }
.sim-pipeline div b { font: 500 .74rem var(--mono); letter-spacing: .08em; color: var(--teal); width: 34px; }
.sim-pipeline div span { font-size: .92rem; }
.sim-pipeline div.on { background: rgba(45, 212, 191, .12); border-color: rgba(45, 212, 191, .5); }
.sim-pipeline div.on b::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--teal); animation: blink 1s infinite; vertical-align: middle; }
.sim-meter { display: grid; grid-template-columns: 40px 1fr 64px; align-items: center; gap: 10px; font: 500 .74rem var(--mono); }
.sim-meter > span { color: var(--on-night); }
.sim-meter > b { color: #fff; font-weight: 500; text-align: right; }
.sim-meter div { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 6px; overflow: hidden; }
.sim-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--sky)); border-radius: 6px; transition: width .5s; }
.sim-note { font-size: .82rem; opacity: .75; margin-top: auto; }
.sim-replay { align-self: flex-start; }
@media (max-width: 900px) {
  .sim { grid-template-columns: 1fr; }
  .sim-main { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .08); min-height: 440px; }
}

/* Spotlight that follows the cursor on cards */
.card, .card-post, .ind-card { position: relative; }
.card::before, .ind-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(14, 165, 233, .10), transparent 60%); }
.card:hover::before, .ind-card:hover::before { opacity: 1; }

/* Animated gradient border on the agent panel */
.agent-panel { position: relative; isolation: isolate; }
.agent-panel::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1; background: conic-gradient(from var(--ang, 0deg), transparent 0 60%, var(--teal) 75%, var(--sky) 85%, transparent 100%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ang 6s linear infinite; }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ang { to { --ang: 360deg; } }

/* Industry cards with photos */
.ind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ind-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.ind-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.ind-card:hover img { transform: scale(1.04); }
.ind-card > div { padding: 22px 24px 26px; }
.ind-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin-bottom: 8px; }
.ind-card h3 .i { color: var(--blue); }
.ind-card p { color: var(--slate); font-size: 1rem; }
@media (max-width: 960px) { .ind-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .ind-grid { grid-template-columns: 1fr; } }

/* Soft glowing blobs behind navy sections */
.glow { position: relative; overflow: hidden; }
.glow::before, .glow::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(90px); opacity: .22; pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
.glow::before { background: var(--teal); top: -220px; left: -160px; }
.glow::after { background: var(--indigo); bottom: -240px; right: -160px; animation-delay: -9s; }
.glow > * { position: relative; z-index: 1; }
@keyframes drift { to { transform: translate(80px, 40px) scale(1.1); } }


/* ---------- Calmer motion for visitors who prefer reduced motion ---------- */
.calm .reveal { transform: none; transition-duration: .9s; }
.calm .ticker ul { animation-duration: 90s; }
.calm .orb-ring { animation-duration: 180s; }
.calm .orb-tag { animation: none; }
.calm .glow::before, .calm .glow::after { animation: none; }
.calm .card-link:hover .cover img, .calm .ind-card:hover img { transform: none; }

/* ---------- Hero headline words ---------- */
.words .word { display: inline-block; opacity: 0; transform: translateY(.45em); animation: wordIn .7s cubic-bezier(.2, .7, .2, 1) forwards; }
.calm .words .word { transform: none; }
@keyframes wordIn { to { opacity: 1; transform: none; } }

/* ---------- Header after scrolling ---------- */
.mast { transition: background .3s, box-shadow .3s; }
.mast.scrolled { background: rgba(11, 10, 46, .88); backdrop-filter: blur(14px); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6); }
.mast.scrolled .mast-row { height: 64px; }
.mast-row { transition: height .3s; }

/* ---------- Reading progress (articles) ---------- */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.read-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--sky), var(--blue)); transform: scaleX(0); transform-origin: left; }

/* ---------- Back to top ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 24px -8px rgba(11, 10, 46, .5); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s, transform .3s, background .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--blue); }
.to-top .i { width: 20px; height: 20px; }

/* ---------- Simulator captions and controls ---------- */
.sim-caption { border-top: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
.sim-progress { height: 3px; background: rgba(255, 255, 255, .06); }
.sim-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--sky)); transform: scaleX(0); transform-origin: left; transition: transform .6s ease; }
.sim-caption-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px 16px; min-height: 76px; }
.sim-count { flex: none; font: 500 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: var(--teal); padding: 4px 8px; border-radius: 6px; margin-top: 2px; }
.sim-caption-row p { margin: 0; color: #E4E8F7; font-size: 1.02rem; line-height: 1.5; opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s; }
.sim-caption-row p.show { opacity: 1; transform: none; }
.sim-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.sim-controls .btn { padding: .5rem .8rem; font-size: .88rem; }
.sim.paused .sim-status::before { animation: none; background: #F59E0B; }
.sim-row span.pending { color: #9AA3C7; }
.sim-row span.pending::after { content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border: 2px solid var(--teal); border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: spin .8s linear infinite; }
.sim-row.think { border-style: solid; background: rgba(45, 212, 191, .06); }
.sim-row:last-child { box-shadow: 0 0 0 2px rgba(45, 212, 191, .25); }
.sim-row.caller:last-child, .sim-row.agent:last-child { box-shadow: 0 0 0 2px rgba(45, 212, 191, .35), 0 10px 30px -10px rgba(45, 212, 191, .35); }

/* ---------- Agent tabs: conversation bubbles appear one by one ---------- */
.agent-panel:not([hidden]) .convo p { animation: bubble .5s cubic-bezier(.2, .7, .2, 1) both; }
.agent-panel:not([hidden]) .convo p:nth-child(1) { animation-delay: .15s; }
.agent-panel:not([hidden]) .convo p:nth-child(2) { animation-delay: .9s; }
.agent-panel:not([hidden]) .convo p:nth-child(3) { animation-delay: 1.65s; }
.agent-panel:not([hidden]) > h3, .agent-panel:not([hidden]) > p { animation: bubble .45s ease both; }
@keyframes bubble { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- "How a call works": colored lines draw in ---------- */
.step { position: relative; border-top-color: var(--line) !important; }
.step::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; height: 3px; background: var(--c, var(--teal)); transform: scaleX(0); transform-origin: left; transition: transform 1.1s cubic-bezier(.2, .7, .2, 1) .25s; }
.step:nth-child(2) { --c: var(--sky); }
.step:nth-child(3) { --c: var(--blue); }
.step.in::before, .step:not(.reveal)::before { transform: none; }

/* ---------- FAQ opens smoothly ---------- */
.faq details[open] > div { animation: faqIn .35s ease both; }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Button sheen ---------- */
.btn-teal { position: relative; overflow: hidden; }
.btn-teal::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); transition: left .6s; }
.btn-teal:hover::after { left: 130%; }

/* ---------- Share row on articles ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2.4em !important; padding-top: 22px; border-top: 1px solid var(--line); }
.share span { font-weight: 600; color: var(--ink); margin-right: 6px; font-size: .95rem; }
.share a, .share button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font: 500 .9rem var(--body); text-decoration: none; cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--blue); color: var(--blue); }
.share .i { width: 16px; height: 16px; }
