/* "Cómo trabajo contigo": a timeline that fills as you scroll (flow.js).
   Each step lights up when it reaches the reading line and plays its small scene once. */
.flow { position: relative; list-style: none; margin: 0; padding: 0 0 0 88px; counter-reset: none; }
.flow::before, .flow::after { content: ""; position: absolute; left: 23px; top: var(--rt, 64px); height: var(--rh, calc(100% - 128px)); width: 1px; background: var(--line); }
.flow::after { background: linear-gradient(180deg, var(--blue), color-mix(in srgb, var(--blue) 40%, var(--ink))); transform: scaleY(var(--p, 1)); transform-origin: top; }
.fs { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 56px; align-items: center; padding: 40px 0; }
.fs + .fs { border-top: 1px solid var(--line); }
.fs-n { position: absolute; left: -88px; top: 40px; display: grid; place-items: center; width: 47px; height: 47px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.05rem;
  transition: color .5s var(--ease), border-color .5s var(--ease), box-shadow .6s var(--ease), background-color .5s; z-index: 1; }
.fs-tx h3 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.05; }
.fs-tx p { margin-top: 14px; max-width: 38ch; color: var(--muted); font-size: 1.02rem; }
.fs-tx { transition: opacity .6s var(--ease); }

.fs-vis { position: relative; height: 176px; padding: 20px 0; overflow: visible;
  transition: box-shadow .6s var(--ease), opacity .6s var(--ease), transform .8s var(--ease); font-size: .86rem; }
:root[data-theme="light"] .fs-n { background: #fff; }

/* states (only once flow.js runs; without JS everything shows finished) */
.flow.live .fs:not(.seen) .fs-tx h3 { color: var(--muted); }
.fs-tx h3 { transition: color .6s var(--ease); }
.flow.live .fs:not(.seen) .fs-vis { transform: translateY(14px); }
.fs.seen .fs-n { color: var(--ink); border-color: var(--blue); }
.fs.on .fs-n { background: var(--blue); color: #03090f; border-color: var(--blue); box-shadow: 0 0 0 7px color-mix(in srgb, var(--blue) 18%, transparent); }

/* 01 chat */
.v-chat { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.v-chat .b { align-self: flex-start; max-width: 82%; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--accent-soft); color: var(--ink); line-height: 1.35;
  transition: opacity .5s var(--ease), transform .6s var(--ease); }
.v-chat .b-out { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--blue); color: #03090f; }
.v-chat .b-dots { display: inline-flex; gap: 4px; padding: 12px 14px; }
.v-chat .b-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.fs.on .v-chat .b-dots i { animation: fl-dot 1.2s infinite ease-in-out; }
.v-chat .b-dots i:nth-child(2) { animation-delay: .15s; } .v-chat .b-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes fl-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.flow.live .fs:not(.seen) .v-chat .b { opacity: 0; transform: translateY(10px); }
.v-chat .b:nth-child(2) { transition-delay: .55s; } .v-chat .b:nth-child(3) { transition-delay: 1.1s; }

/* 02 wireframe that gets its design */
.v-wire > span { position: absolute; border-radius: 4px; background: var(--line); transition: background-color .7s var(--ease), width .9s var(--ease), opacity .7s; }
.v-wire .w-nav { left: 0; right: 0; top: 18px; height: 10px; display: flex; justify-content: flex-end; gap: 8px; background: none; }
.v-wire .w-nav::before { content: ""; width: 34px; margin-right: auto; border-radius: 4px; background: var(--ink); opacity: .8; }
.v-wire .w-nav i { width: 22px; border-radius: 4px; background: var(--line); }
.v-wire .w-h { left: 0; top: 56px; height: 14px; width: 42%; }
.v-wire .w-h2 { top: 78px; width: 30%; }
.v-wire .w-btn { left: 0; top: 112px; height: 22px; width: 64px; border-radius: 6px; }
.v-wire .w-img { right: 0; top: 50px; bottom: 6px; width: 38%; border-radius: 8px; }
.fs.seen .v-wire .w-h { background: var(--ink); width: 46%; transition-delay: .2s; }
.fs.seen .v-wire .w-h2 { background: color-mix(in srgb, var(--ink) 55%, transparent); width: 34%; transition-delay: .35s; }
.fs.seen .v-wire .w-btn { background: var(--blue); transition-delay: .55s; }
.fs.seen .v-wire .w-img { background: linear-gradient(135deg, var(--c2), var(--c4) 55%, var(--c5)); transition-delay: .7s; }
.flow.live .fs:not(.seen) .v-wire .w-nav::before { opacity: .25; }

/* 03 checks */
.v-check { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.v-check .ck { display: flex; align-items: center; gap: 12px; color: var(--ink); transition: color .5s; }
.v-check .ck b { position: relative; flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line); transition: background-color .4s var(--ease), border-color .4s; }
.v-check .ck b::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #03090f; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .4s var(--ease); }
.fs.seen .v-check .ck b { background: var(--ok); border-color: var(--ok); }
.fs.seen .v-check .ck b::after { transform: rotate(45deg) scale(1); }
.flow.live .fs:not(.seen) .v-check .ck { color: var(--muted); }
.v-check .ck:nth-child(2) b, .v-check .ck:nth-child(2) b::after { transition-delay: .45s; }
.v-check .ck:nth-child(3) b, .v-check .ck:nth-child(3) b::after { transition-delay: .9s; }

/* 04 live */
.v-live { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.v-live .l-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--ink); }
.v-live .l-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background-color .5s .3s; }
.v-live .l-bar em { margin-left: auto; font-style: normal; font-size: .76rem; color: var(--ok); opacity: 0; transition: opacity .5s .5s; }
.fs.seen .v-live .l-bar i { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.fs.seen .v-live .l-bar em { opacity: 1; }
.fs.on .v-live .l-bar i { animation: fl-ping 2s infinite ease-out .8s; }
@keyframes fl-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.v-live .l-ch { flex: 1; width: 100%; height: auto; overflow: visible; }
.v-live .l-ch path { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease-io) .5s; }
.flow.live .fs:not(.seen) .v-live .l-ch path { stroke-dashoffset: 100; }
html:not(.js) .v-live .l-bar em { opacity: 1; }

@media (max-width: 1023px) {
  .fs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .fs-tx p { max-width: 52ch; }
}
@media (max-width: 759px) {
  .flow { padding-left: 54px; }
  .flow::before, .flow::after { left: 18px; }
  .fs { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 30px 0; }
  .fs-n { left: -54px; top: 28px; width: 37px; height: 37px; font-size: .92rem; }
  .fs-vis { height: 150px; padding: 10px 0; }
  .fs-vis.v-chat, .fs-vis.v-check, .fs-vis.v-live { height: auto; }
  .fs-tx p { margin-top: 10px; font-size: .98rem; }
}
