/* Caster Tech Vietnam — homepage v2 (index-motion-v2.html), on top of site.css.
   New in v2: the reuse flow (02 / Our focus), a proof line under each service, and 04 / Why us. */

/* ---------- Small details ---------- */
/* Line icons draw themselves as their block arrives (icons.js gives every shape pathLength 1). */
.motion-ok :is([data-reveal], [data-stagger] > *) .ico > * { stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s var(--ease-io) calc(var(--rd, 0ms) + 250ms); }
.motion-ok :is([data-reveal].is-in, [data-stagger].is-in > *) .ico > * { stroke-dashoffset: 0; }
.motion-ok .ico circle[r=".6"] { stroke-dasharray: none; }

/* 01 About: three lines, each on its own */
.title-3 { font-size: clamp(34px, 4.2vw, 62px); }
.title-3 .ln > * { white-space: nowrap; }
/* The photo sits in the logo's C, and a route runs from Ho Chi Minh City to Tokyo, two hours ahead. */
.about-c { position: absolute; z-index: -1; right: -2%; top: -6%; width: 76%; height: auto; aspect-ratio: 56 / 66; overflow: visible; fill: #FFF0E7; }
.route { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.route-line { fill: none; stroke: var(--orange); stroke-opacity: .7; stroke-width: .45; stroke-linecap: round; stroke-dasharray: .2 1.3; }
.route-ship { filter: drop-shadow(0 .6px .8px rgba(242, 101, 34, .45)); }
html:not(.motion-ok) .route-ship { display: none; }
.tag-tokyo { left: 2%; top: 1%; }
.about-photo .tag-ai { left: auto; right: -3%; top: 50%; }
.motion-ok .about-photo .about-c { opacity: 0; transform: scale(.92); transform-origin: 60% 50%; transition: opacity 1s var(--ease-out), transform 1.4s var(--ease-out); }
.motion-ok .about-photo.is-in .about-c { opacity: 1; transform: none; }
.motion-ok .about-photo .route { opacity: 0; transition: opacity .8s var(--ease-io) 1.5s; }
.motion-ok .about-photo.is-in .route { opacity: 1; }
.motion-ok .about-photo.is-in .tag-tokyo { transition-delay: 1.5s; animation-delay: 3.4s; }
.motion-ok .about-photo.is-in .tag-tokyo .tag-ic { animation: tyo-ping 5s ease-out 2.4s infinite; }
@keyframes tyo-ping { 0%, 58% { box-shadow: 0 0 0 0 rgba(242, 101, 34, 0); } 62% { box-shadow: 0 0 0 0 rgba(242, 101, 34, .45); } 80%, 100% { box-shadow: 0 0 0 12px rgba(242, 101, 34, 0); } }

/* 01 About: two ways on from the intro */
.about-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 34px; }
.about-ctas .btn-cta, .about-ctas .text-link { margin-top: 0; }

/* ---------- 02 How we work: one project through five steps, AI and team at each ----------
   Static everywhere by default. On wide screens with motion (site.js adds .is-live) it plays by itself and loops:
   the project travels along the line, each step lights up as it arrives, its AI line types out, then the team signs off.
   A bar in the current card shows how long until the next step; hovering the cards pauses, clicking one jumps there.
   Everything that moves is transform or opacity, so it stays smooth. */
.flow { overflow-x: clip; }
.flow-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 72px); align-items: end; max-width: none; margin-bottom: 0; }
.flow-head .label, .flow-head .sec-title { grid-column: 1; }
.flow-head .sec-title { font-size: clamp(36px, 3.8vw, 56px); }
.flow-head .sec-sub { grid-column: 2; grid-row: 1 / 3; align-self: end; max-width: 560px; margin: 0; font-size: clamp(16px, 1.2vw, 18px); }

.fl-rail { display: none; position: relative; height: 84px; margin-top: clamp(24px, 3vw, 40px); }
.fl-line { position: absolute; left: var(--l0, 10%); width: var(--lw, 80%); top: 50%; height: 2px; margin-top: -1px;
  background: radial-gradient(circle, #CFC8C1 1px, transparent 1.4px) 0 50% / 7px 2px repeat-x; }
.fl-line i { position: absolute; inset: 0; border-radius: 2px; background: var(--orange); transform-origin: 0 50%; transform: scaleX(var(--fq, 0)); transition: transform 1.1s var(--ease-io); }
.fl-token { position: absolute; left: 0; top: 50%; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 18px; background: #fff; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(70, 35, 10, .08), 0 22px 44px -18px rgba(120, 60, 20, .45); transform: translate(calc(var(--tx, 0px) - 50%), -50%); transition: transform 1.1s var(--ease-io); }
.fl-thumb { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--orange); color: #fff; }
.fl-thumb .ico { width: 22px; height: 22px; stroke-width: 2; }
.fl-name { display: flex; flex-direction: column; gap: 4px; }
.fl-name b { font: 700 15px/1 var(--text); }
.fl-name small { color: var(--muted); font: 500 12px/1 var(--text); letter-spacing: .02em; }
/* One width for every status (site.js measures them), so the token never jumps when its text changes. */
.fl-st { margin-left: 6px; padding: 8px 12px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-deep); font: 700 13px/1 var(--text); text-align: center; }
.fl-st.is-new { animation: fl-swap .6s var(--ease-out); }
@keyframes fl-swap { from { color: rgba(212, 81, 26, 0); } }

.fl-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: clamp(32px, 3.4vw, 48px) 0 0; padding: 0; list-style: none; }
.fl-stage { position: relative; display: flex; flex-direction: column; padding: 22px 20px; border: 1px solid #F2ECE6; border-radius: 22px; background: #fff;
  box-shadow: 0 22px 44px -36px rgba(120, 60, 20, .4); transition: transform .7s var(--ease-out), border-color .5s, opacity .6s var(--ease-io); }
/* The current card's glow is its own layer that fades, rather than an animated box-shadow. */
.fl-stage::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 32px 60px -34px rgba(242, 101, 34, .6); opacity: 0; transition: opacity .6s; pointer-events: none; }
.fl-top { display: flex; align-items: center; gap: 10px; }
.fl-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--orange-soft); color: var(--orange); transition: background-color .5s, color .5s; }
.fl-ic .ico { width: 22px; height: 22px; stroke-width: 2; }
.fl-top b { color: var(--orange); font: 700 14px/1 var(--display); letter-spacing: .04em; }
.fl-top em { margin-left: auto; padding: 7px 10px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font: 600 14px/1 var(--text); font-style: normal; letter-spacing: .08em; }
.fl-top em { white-space: nowrap; }
.fl-stage h3 { margin-top: 18px; font: 700 clamp(18px, 1.45vw, 21px)/1.15 var(--display); letter-spacing: -.02em; }
/* At each step: what the AI does, then what the team decides. */
.fl-row { display: grid; gap: 6px; margin-top: 14px; font-size: 14.5px; line-height: 1.5; }
.fl-row b { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 4px 9px 4px 6px; border-radius: 999px; font: 700 11.5px/1 var(--text); letter-spacing: .1em; text-transform: uppercase; }
.fl-ai b { background: var(--orange-soft); color: var(--orange-deep); }
.fl-ai b .spark { width: 15px; height: 15px; }
.fl-ai span { color: var(--ink-2); }
.fl-team { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.fl-ai { padding-bottom: 14px; }
.fl-team b { background: var(--fill); color: var(--ink-2); }
.fl-team b i { display: grid; }
.fl-team b .ico { width: 13px; height: 13px; stroke-width: 2.4; }
.fl-team span { color: var(--ink); font-weight: 600; }
/* Live: when a step is reached, the AI's line comes in, then the team's. */
.flow.is-live .fl-row span { opacity: 0; transform: translateY(8px); transition: opacity .35s var(--ease-io), transform .35s var(--ease-io); }
.flow.is-live .fl-stage.is-on .fl-row span { opacity: 1; transform: none; transition: opacity .8s var(--ease-out) .3s, transform .9s var(--ease-out) .3s; }
.flow.is-live .fl-stage.is-on .fl-team span { transition-delay: 1.1s; }
.flow.is-live .fl-stage.is-current .fl-ai b .spark { animation: fl-think 1.1s var(--ease-io) .2s 2; }
@keyframes fl-think { 50% { transform: scale(1.22); } }
.fl-ic .ico > * { stroke-dasharray: 1 1; transition: stroke-dashoffset .8s var(--ease-io) .1s; }
.flow.is-live .fl-stage:not(.is-on) .fl-ic .ico > * { stroke-dashoffset: 1; }
.fl-ic .ico { transition: opacity .2s; }
.flow.is-live .fl-stage:not(.is-on) .fl-ic .ico { opacity: 0; }
.fl-note { margin-top: 22px; color: #A39C95; font-size: 13px; }

.flow.is-live .fl-rail { display: block; }
.flow.is-live .fl-stages { margin-top: 18px; }
.flow.is-live .fl-stage:not(.is-on) { opacity: .55; }
.flow.is-live .fl-stage:not(.is-on) .fl-ic { background: var(--fill); color: #A39C95; }
.flow.is-live .fl-stage.is-current { transform: translateY(-8px); border-color: rgba(242, 101, 34, .45); }
.flow.is-live .fl-stage.is-current::before { opacity: 1; }
.flow.is-live .fl-stage.is-current .fl-ic { background: var(--orange); color: #fff; }
.flow.is-live .fl-stage { cursor: pointer; }
/* The bar is the clock: when it fills, site.js moves the project on. Pausing the section pauses it (and so the clock). */
.fl-bar { display: none; }
.flow.is-live .fl-bar { display: block; position: absolute; left: 20px; right: 20px; bottom: 9px; height: 3px; border-radius: 3px; background: var(--orange); opacity: 0;
  transform-origin: 0 50%; transform: scaleX(0); }
.flow.is-live .fl-stage.is-current .fl-bar { opacity: .85; animation: fl-bar var(--dur, 3600ms) linear both; }
.flow.is-live .fl-stage:last-child { --dur: 5600ms; }
.flow.is-live.is-kickoff .fl-rail { animation: fl-wait 1400ms linear both; }
.flow.is-paused .fl-bar, .flow.is-paused .fl-rail { animation-play-state: paused !important; }
@keyframes fl-bar { to { transform: scaleX(1); } }
@keyframes fl-wait { from, to { opacity: 1; } }

/* 03 Services: one line of proof under the copy */
.svc-copy .svc-proof { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--ink); font: 600 15px/1.4 var(--text); }
.proof-ic { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.proof-ic .ico { width: 14px; height: 14px; stroke-width: 2.6; }

/* ---------- 04 Why us: four reasons, then the company profile ---------- */
.why { overflow-x: clip; background: linear-gradient(180deg, #FFF8F3, #FFFFFF 80%); }
.dots-why { right: 9%; top: 84px; width: 112px; height: 96px; }
.why-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.why-grid li { padding: 26px 24px 28px; border: 1px solid #F2ECE6; border-radius: 24px; background: #fff; box-shadow: 0 22px 44px -36px rgba(120, 60, 20, .4); }
.why-grid h3 { margin-top: 20px; font: 700 clamp(19px, 1.5vw, 21px)/1.2 var(--display); letter-spacing: -.02em; }
.why-grid p { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.why .profile { margin-top: clamp(56px, 6vw, 88px); }
/* The clock reads 2:00, two hours ahead; on arrival it winds forward from 12:00 to get there. */
.ic-clock .hand-h, .ic-clock .hand-m { transform-box: view-box; transform-origin: 12px 12px; }
.ic-clock .hand-h { transform: rotate(60deg); }
.motion-ok .why-grid .ic-clock .hand-h { transform: none; transition: transform 1.8s var(--ease-io) calc(var(--rd, 0ms) + .5s); }
.motion-ok .why-grid .ic-clock .hand-m { transform: rotate(-720deg); transition: transform 1.8s var(--ease-io) calc(var(--rd, 0ms) + .5s); }
.motion-ok .why-grid.is-in .ic-clock .hand-h { transform: rotate(60deg); }
.motion-ok .why-grid.is-in .ic-clock .hand-m { transform: none; }
.ic-clock .hand-h, .ic-clock .hand-m { stroke-dasharray: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .fl-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .why-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .flow-head { grid-template-columns: 1fr; }
  .flow-head .sec-sub { grid-column: 1; grid-row: auto; margin-top: 22px; }
  .fl-stages { grid-template-columns: 1fr 1fr; }
  .fl-stage:last-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .fl-stages, .why-grid { grid-template-columns: 1fr; }
  .tag-tokyo { left: 0; top: 0; }
  .about-photo .tag-date { top: auto; right: 0; bottom: 20%; }
  .about-ctas { gap: 16px 24px; }
}
