/* ---------- "Try Sample Agent": hero button and the animated handoff into Ty (assets/ty-launch.js) ---------- */

/* Hero button: a small "live" signal so it reads as something you can try, not a page link. */
.btn.ty-try { position: relative; overflow: hidden; gap: 10px; }
.btn.ty-try .spark { position: relative; width: 8px; height: 8px; flex: none; border-radius: 50%; background: #9FE3C1; box-shadow: 0 0 0 0 rgba(159,227,193,.6); animation: tySpark 2.4s ease-out infinite; }
.btn.ty-try::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(248,247,244,.22) 50%, transparent 65%);
  transform: translateX(-120%); animation: tySheen 5s 1.5s ease-in-out infinite;
}
.btn.ty-try:hover .spark { background: #3E8F69; }
@keyframes tySpark { 0% { box-shadow: 0 0 0 0 rgba(159,227,193,.6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(159,227,193,0); } }
@keyframes tySheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* Phones: mobile-declutter turns the secondary hero action into a text link. Keep this one a real button,
   because trying Ty is the most direct way to see what Worksmith builds. */
@media (max-width: 760px) {
  .scene-flow.tall .scene-copy .ctas .btn.line-light.ty-try {
    width: min(100%, 20rem); min-height: 46px; padding: 0 22px; margin-top: 8px;
    border: 1px solid rgba(248,247,244,.6); background: rgba(15,31,43,.35); color: var(--ivory);
    text-decoration: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
}

/* ---------- Launch overlay ---------- */
.ty-launch {
  position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 40%, #16303F 0%, var(--midnight) 60%, #0A1720 100%);
  color: var(--ivory); overflow: hidden; touch-action: none;
  clip-path: circle(0 at var(--lx, 50%) var(--ly, 50%));
  transition: clip-path .7s cubic-bezier(.7, 0, .2, 1), opacity .45s ease;
}
.ty-launch.is-open { clip-path: circle(150vmax at var(--lx, 50%) var(--ly, 50%)); }
.ty-launch.is-leaving { opacity: 0; }
.ty-launch canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .8s ease .15s; }
.ty-launch.is-open canvas { opacity: 1; }

.tl-core { position: relative; display: grid; justify-items: center; gap: 28px; width: min(88vw, 400px); text-align: center; padding-bottom: env(safe-area-inset-bottom, 0px); }

/* The Ty mark, with rings that settle in and a slow orbit. */
.tl-orb { position: relative; width: 132px; height: 132px; display: grid; place-items: center; opacity: 0; transform: scale(.7); transition: opacity .5s ease .25s, transform .7s cubic-bezier(.2,.9,.2,1.15) .25s; }
.ty-launch.is-open .tl-orb { opacity: 1; transform: none; }
.tl-orb .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(248,247,244,.16); }
.tl-orb .ring.r2 { inset: 14px; border-color: rgba(159,227,193,.28); border-style: dashed; animation: tlSpin 9s linear infinite; }
.tl-orb .ring.r3 { inset: -14px; border-color: rgba(248,247,244,.08); }
.tl-orb .orbit { position: absolute; inset: 0; animation: tlSpin 2.6s linear infinite; }
.tl-orb .orbit i { position: absolute; top: -3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #9FE3C1; box-shadow: 0 0 12px 2px rgba(159,227,193,.7); }
.tl-orb .orbit.o2 { animation-duration: 4.2s; animation-direction: reverse; inset: -14px; }
.tl-orb .orbit.o2 i { width: 4px; height: 4px; margin-left: -2px; background: var(--ivory); box-shadow: 0 0 10px rgba(248,247,244,.6); }
.tl-orb .pulse { position: absolute; inset: 30px; border-radius: 50%; background: radial-gradient(circle, rgba(159,227,193,.35), transparent 70%); animation: tlBreathe 1.8s ease-in-out infinite; }
.tl-badge { position: relative; width: 58px; height: 58px; display: grid; place-items: center; background: var(--ivory); color: var(--midnight); border-radius: 4px; font-family: var(--display); font-weight: 600; font-size: 1.375rem; letter-spacing: -0.03em; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.ty-launch.is-ready .tl-badge { animation: tlPop .5s cubic-bezier(.2,.9,.2,1.3); }
.ty-launch.is-ready .tl-orb .orbit { animation-duration: .9s; }
@keyframes tlSpin { to { transform: rotate(360deg); } }
@keyframes tlBreathe { 0%, 100% { transform: scale(.85); opacity: .6; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes tlPop { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }

.tl-title { font-family: var(--display); font-size: clamp(1.25rem, 1rem + 1.2vw, 1.6rem); font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; opacity: 0; transform: translateY(8px); transition: opacity .5s ease .45s, transform .5s var(--ease) .45s; }
.ty-launch.is-open .tl-title { opacity: 1; transform: none; }
.tl-title small { display: block; margin-top: 6px; font-family: var(--body); font-size: .8125rem; font-weight: 400; letter-spacing: .02em; color: var(--on-dark-muted); }

/* Status steps, revealed one at a time. */
.tl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; width: 100%; text-align: left; font-size: .9375rem; }
.tl-steps li { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 12px; color: var(--on-dark-muted); opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s var(--ease), color .3s; }
.tl-steps li.on { opacity: 1; transform: none; color: var(--ivory); }
.tl-steps li.done { color: #C3CCD2; }
.tl-steps .ic { position: relative; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(248,247,244,.25); border-top-color: #9FE3C1; animation: tlSpin .8s linear infinite; }
.tl-steps li.done .ic { animation: none; border-color: #9FE3C1; background: #9FE3C1; }
.tl-steps li.done .ic::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 3.5px; height: 7px; border: solid var(--midnight); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }

.tl-bar { width: 100%; height: 2px; background: rgba(248,247,244,.12); border-radius: 2px; overflow: hidden; }
.tl-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5E6F7A, #9FE3C1); box-shadow: 0 0 10px rgba(159,227,193,.6); transition: width .5s var(--ease); }

.tl-skip { position: absolute; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); min-height: 40px; padding: 0 14px; background: none; border: 1px solid rgba(248,247,244,.22); border-radius: 2px; color: var(--on-dark-muted); font: inherit; font-size: .8125rem; cursor: pointer; }
.tl-skip:hover, .tl-skip:focus-visible { color: var(--ivory); border-color: rgba(248,247,244,.6); }
.tl-fine { position: absolute; left: max(18px, env(safe-area-inset-left, 0px)); bottom: calc(28px + env(safe-area-inset-bottom, 0px)); margin: 0; font-size: .75rem; color: rgba(169,180,187,.7); }

/* Ty's workspace arrives out of the glow instead of the old centre wipe. */
dialog.ty-app.ty-arrive[open] { animation: tyArrive .6s var(--ease); }
dialog.ty-app.ty-arrive .ty-top, dialog.ty-app.ty-arrive .ty-tabs { animation: tyRise .55s var(--ease) .08s backwards; }
dialog.ty-app.ty-arrive .ty-body { animation: tyRise .6s var(--ease) .16s backwards; }
@keyframes tyArrive { from { opacity: 0; transform: scale(1.03); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes tyRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 520px) {
  .tl-core { gap: 22px; }
  .tl-orb { width: 112px; height: 112px; }
  .tl-badge { width: 50px; height: 50px; font-size: 1.2rem; }
  .tl-steps { font-size: .875rem; }
  .tl-fine { left: 50%; transform: translateX(-50%); bottom: calc(70px + env(safe-area-inset-bottom, 0px)); white-space: nowrap; }
  .tl-skip { left: 50%; right: auto; transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .btn.ty-try .spark, .btn.ty-try::after, .tl-orb .ring.r2, .tl-orb .orbit, .tl-orb .pulse, .tl-steps .ic { animation: none !important; }
  .ty-launch { clip-path: none; opacity: 0; transition: opacity .2s ease; }
  .ty-launch.is-open { clip-path: none; opacity: 1; }
  .ty-launch.is-leaving { opacity: 0; }
  dialog.ty-app.ty-arrive[open], dialog.ty-app.ty-arrive .ty-top, dialog.ty-app.ty-arrive .ty-tabs, dialog.ty-app.ty-arrive .ty-body { animation: none; }
}

/* The "Scroll" cue is decorative and fades out, but it still sat on top of the hero buttons on phones and swallowed taps. */
.scroll-cue { pointer-events: none; }
