/* Motion & interaction layer. Every animated element rests in its visible, final state. */

/* Scroll progress + header shrink */
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--amber-fill), var(--green-fill)); pointer-events: none; }
.site-header .nav { transition: height .25s ease; }
.site-header.scrolled .nav { height: 60px; }
.site-header.scrolled { box-shadow: var(--shadow); }
.brand img { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.brand:hover img { transform: rotate(-90deg) scale(1.06); }
.nav-links a { position: relative; transition: color .2s ease, background .2s ease; }
.nav-links a::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--green-fill); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
#theme-toggle { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
#theme-toggle:hover { transform: rotate(40deg); }

/* Page enter / leave */
main { animation: pageIn .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pageIn { from { opacity: .001; transform: translateY(14px); } to { opacity: 1; transform: none; } }
body.leaving main { opacity: 0; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease; }

/* Hero canvas + glow */
.hero { position: relative; overflow: hidden; isolation: isolate; }
#net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::before { content: ""; position: absolute; z-index: -2; width: 620px; height: 620px; border-radius: 50%; right: -160px; top: -200px; background: radial-gradient(circle, color-mix(in srgb, var(--green-fill) 26%, transparent), transparent 65%); filter: blur(10px); animation: drift 14s ease-in-out infinite alternate; }
.hero::after { content: ""; position: absolute; z-index: -2; width: 520px; height: 520px; border-radius: 50%; left: -180px; bottom: -220px; background: radial-gradient(circle, color-mix(in srgb, var(--amber-fill) 22%, transparent), transparent 65%); filter: blur(10px); animation: drift 18s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-60px, 50px) scale(1.12); } }

/* Headline word cascade */
.words .w { display: inline-block; animation: wordIn .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms + 80ms); }
@keyframes wordIn { from { opacity: .001; transform: translateY(.45em) rotate(2deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.hero h1 .hl, .hero h1 .hl2 { background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; }
.hero h1 .hl { background-image: linear-gradient(90deg, var(--green), color-mix(in srgb, var(--green) 55%, var(--amber)), var(--green)); color: transparent; animation: wordIn .7s cubic-bezier(.2,.8,.2,1) both, sheen 6s linear infinite; animation-delay: calc(var(--i) * 70ms + 80ms), 1.2s; }
.hero h1 .hl2 { background-image: linear-gradient(90deg, var(--amber), color-mix(in srgb, var(--amber) 60%, var(--green)), var(--amber)); color: transparent; animation: wordIn .7s cubic-bezier(.2,.8,.2,1) both, sheen 6s linear infinite; animation-delay: calc(var(--i) * 70ms + 80ms), 1.2s; }
@keyframes sheen { to { background-position: -200% 0; } }

/* Typed rotator */
.rotator { font-family: var(--f-mono); font-size: .98rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rotator .typed { color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; min-height: 1.9em; }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--green); margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Run log sequence */
.runlog { transition: transform .4s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.runlog li { transition: opacity .4s ease, transform .4s ease; }
.runlog.seq li { opacity: .3; transform: translateX(-6px); }
.runlog.seq li.on { opacity: 1; transform: none; }
.runlog li.on .ok { animation: pop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }
.runbar { height: 4px; border-radius: 4px; background: #1d2a23; overflow: hidden; margin-top: 12px; }
.runbar i { display: block; height: 100%; width: var(--rb, 100%); background: linear-gradient(90deg, #ffa200, #82e645); transition: width .6s ease; }
.float { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 50% { translate: 0 -10px; } }

/* Scroll reveal (only below-the-fold elements are dimmed, and only after JS runs) */
.rv { transition: opacity .75s cubic-bezier(.2,.8,.2,1), transform .75s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0ms); }
.rv.pre { opacity: .18; transform: translateY(26px) scale(.985); }

/* Spotlight + tilt cards */
.spot { background-image: radial-gradient(420px circle at var(--mx, -500px) var(--my, -500px), color-mix(in srgb, var(--green-fill) 16%, transparent), transparent 45%); }
.tilt { transition: transform .25s ease, border-color .2s ease, box-shadow .25s ease; will-change: transform; }
.tilt:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.card h3, .case h3 { transition: color .2s ease; }
a.card:hover h3 { color: var(--green); }
.card .more { transition: letter-spacing .2s ease; }
a.card:hover .more { letter-spacing: .02em; }

/* Buttons */
.btn { position: relative; overflow: hidden; transition: transform .2s cubic-bezier(.2,.8,.2,1), background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.btn-primary { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-fill) 45%, transparent); }
.btn-primary:hover { box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--green-fill) 70%, transparent); }
.btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg); }
.btn-primary:hover::after { animation: shine .7s ease; }
@keyframes shine { to { left: 130%; } }
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(4px); }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.45); animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* Stats */
.stat { transition: background .25s ease; }
.stat:hover { background: var(--surface-2); }
.stat b { background: linear-gradient(90deg, var(--ink), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Pipeline interactivity */
.pipeline { position: relative; }
.pipe { cursor: pointer; transition: background .3s ease, transform .3s ease; border-radius: 0 0 12px 12px; }
.pipe::after { content: ""; position: absolute; left: 0; top: -3px; height: 3px; width: 0; background: var(--ink); }
.pipe.active { background: var(--surface); }
.pipe.active::after { animation: fillbar var(--cycle, 3.2s) linear forwards; }
@keyframes fillbar { to { width: 100%; } }
.pipe.active h3 { color: var(--green); }
.pipe-detail { margin-top: 18px; min-height: 64px; padding: 18px 22px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line); font-family: var(--f-mono); font-size: .86rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.pipe-detail b { color: var(--ink); font-weight: 600; }
.pipe-detail span { animation: fadeUpSm .4s ease both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes fadeUpSm { from { opacity: .001; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding-block: 18px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee .chip { font-size: .85rem; padding: 8px 14px; background: var(--surface); white-space: nowrap; }
.marquee .chip::before { content: "◆"; color: var(--amber-fill); margin-right: 8px; font-size: .7em; vertical-align: 1px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Industries */
.ind { transition: transform .2s ease, border-color .2s ease, background .2s ease; cursor: default; }
.ind:hover { transform: translateY(-3px); border-color: var(--green); background: color-mix(in srgb, var(--green-fill) 10%, var(--surface)); }

/* Interactive matcher demo */
.demo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.demo > * { min-width: 0; }
.demo-in { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: grid; gap: 14px; align-content: start; }
.demo-in textarea { font: inherit; font-size: 1rem; width: 100%; min-height: 120px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }
.demo-in textarea:focus { outline: 2px solid var(--green); border-color: transparent; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.ex { font: 500 .82rem var(--f-body); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer; transition: border-color .2s ease, color .2s ease, transform .2s ease; }
.ex:hover { border-color: var(--green); color: var(--ink); transform: translateY(-2px); }
.demo-out { background: #0f1813; color: #dfe9d9; border-radius: 18px; padding: 24px; font-family: var(--f-mono); font-size: .86rem; border: 1px solid #22302a; display: grid; gap: 14px; align-content: start; min-height: 320px; }
.demo-out .k { color: #9fb3a5; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.demo-out .v { color: #fff; font-family: var(--f-display); font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
.demo-out .row { display: grid; gap: 4px; animation: fadeUpSm .45s ease both; animation-delay: calc(var(--i, 0) * 110ms); }
.demo-out .bar { height: 6px; border-radius: 6px; background: #1d2a23; overflow: hidden; }
.demo-out .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffa200, #82e645); width: 0; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.thinking { color: #ffa200; display: flex; gap: 10px; align-items: center; }
.dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #82e645; margin-right: 4px; animation: bounce 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-6px); opacity: .5; } }
@media (max-width: 820px) { .demo { grid-template-columns: 1fr; } }

/* Band glyph */
.band::after { animation: glyph 9s ease-in-out infinite alternate; }
@keyframes glyph { to { transform: translate(-30px, -18px) rotate(-6deg); opacity: .14; } }
.band::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, var(--green-fill), var(--amber-fill), transparent); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spinang 6s linear infinite; pointer-events: none; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spinang { to { --ang: 360deg; } }

/* Team */
.avatar { position: relative; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.person:hover .avatar { transform: rotate(-8deg) scale(1.06); background: var(--green-fill); color: var(--on-fill); border-color: transparent; }

/* Approach */
.stage .big { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.stage:hover .big { transform: translateX(6px) scale(1.05); }
.fact { transition: border-color .25s ease; }
.stage:hover .fact { border-left-color: var(--green-fill); }

/* Filters */
.filter { transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
.filter:hover { transform: translateY(-2px); border-color: var(--ink); }
[data-ind].show { animation: fadeUpSm .45s ease both; animation-delay: calc(var(--i, 0) * 70ms); }

/* Quiz */
.opt label { transition: border-color .2s ease, background .2s ease, transform .15s ease; }
.opt label:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--green) 50%, var(--line)); }
.q { transition: border-color .3s ease; }
.q.done { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.q.done legend .qn { color: var(--green); }
.burst { position: absolute; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; animation: burst 1s cubic-bezier(.1,.8,.3,1) forwards; }
@keyframes burst { to { transform: translate(var(--bx), var(--by)) rotate(var(--br)); opacity: 0; } }
.result { overflow: visible; }

/* Back to top */
.totop { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.1rem; cursor: pointer; box-shadow: var(--shadow); z-index: 40; transition: opacity .3s ease, transform .3s ease; display: grid; place-items: center; }
.totop[data-off="true"] { opacity: 0; transform: translateY(16px); pointer-events: none; }
.totop:hover { border-color: var(--green); transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  .rv.pre { opacity: 1; transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .runlog.seq li { opacity: 1; transform: none; }
}
