/* Motion layer: the pin rail, the Método glyph and the tilt glare. Loaded after style.css. */

/* ---- pin rail: one dot per stop, the active one expands with its label ------- */
.rail { position: fixed; right: clamp(.5rem, 1.4vw, 1.4rem); top: 50%; transform: translateY(-50%); z-index: 6; opacity: 0; visibility: hidden; transition: opacity .9s ease .4s, visibility 0s linear 1.3s; }
.rail[hidden] { display: none; }
html[data-state="open"] .rail { opacity: 1; visibility: visible; transition-delay: .4s, 0s; }
.rail ol { list-style: none; padding: 0; margin: 0; position: relative; display: flex; flex-direction: column; gap: 1.1rem; }
/* track and fill run from the first dot centre to the last one; --p (0..1) is set by motion.js */
.rail ol::before, .rail ol::after { content: ''; position: absolute; right: 4px; top: .85rem; bottom: .85rem; width: 2px; border-radius: 2px; background: var(--line); }
.rail ol::after { background: linear-gradient(180deg, rgba(184, 168, 246, .45), var(--hot)); transform-origin: top; transform: scaleY(var(--p, 0)); box-shadow: 0 0 10px rgba(184, 168, 246, .5); }
.rail a { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-end; height: 1.7rem; min-width: 1.7rem; color: var(--muted); text-decoration: none; }
.rail i { flex: none; width: 10px; height: 10px; border-radius: 6px; background: var(--bg); border: 2px solid var(--line2); transition: height .45s cubic-bezier(.65, 0, .35, 1), background .3s, border-color .3s, box-shadow .3s; }
.rail a.is-past i { border-color: var(--hot); }
.rail a.is-active i { height: 24px; background: var(--hot); border-color: var(--hot); box-shadow: 0 0 14px rgba(184, 168, 246, .7); }
.rail a:hover i, .rail a:focus-visible i { border-color: var(--hot); }
.rail a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.rail-label { position: absolute; right: 1.6rem; top: 50%; translate: 10px -50%; padding: .32rem .75rem; border-radius: 999px; font: 500 .68rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; color: var(--ink); background: rgba(4, 6, 13, .78); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .3s ease, translate .4s cubic-bezier(.2, .8, .2, 1); }
.rail a.is-active .rail-label, .rail a:hover .rail-label, .rail a:focus-visible .rail-label { opacity: 1; translate: 0 -50%; }
.rail a:hover, .rail a:focus-visible { z-index: 2; }
.rail a.is-active .rail-label { border-color: rgba(184, 168, 246, .45); color: var(--hot); }
.rail-sub { font-style: normal; color: var(--muted); }
.rail a:not(.is-active) .rail-sub, .rail-sub:empty { display: none; }
@media (max-width: 719px) { .rail { display: none; } }

/* ---- Método glyph: one shape that morphs per step ---------------------------- */
.constel .glyph { position: absolute; top: .8rem; right: .9rem; width: 3.4rem; height: 3.4rem; pointer-events: none; overflow: visible; filter: drop-shadow(0 0 8px rgba(184, 168, 246, .35)); }
.glyph-ring { fill: rgba(8, 12, 26, .45); stroke: var(--line2); stroke-width: 1; }
.glyph-path { fill: rgba(184, 168, 246, .14); stroke: var(--hot); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; transform: scale(.62); transform-origin: 24px 24px; transform-box: view-box; }
@media (max-width: 719px) { .constel .glyph { width: 2.6rem; height: 2.6rem; } }

/* ---- cursor tilt glare (motion.js adds .tilt and sets --gx/--gy/--ga) -------- */
.tilt { position: relative; }
.tilt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: var(--ga, 0); transition: opacity .5s ease; background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(190, 210, 255, .13), transparent 62%); }

@media (prefers-reduced-motion: reduce) {
  .rail, .rail i, .rail-label { transition: none; }
  .tilt::after { display: none; }
}

/* ---- 01 Método: constellation + page-turning stage cards ----------------------------------------
   The canvas is absolutely positioned inside a box whose height never depends on the canvas
   (flex-basis + min/max), so the backing buffer cannot feed back into layout. */
.sec#metodo { padding-top: 4.2rem; padding-bottom: 1.5rem; gap: 0; }
#metodo > .label, #metodo > h2, #metodo > .sub { position: relative; z-index: 2; pointer-events: none; }
#metodo > h2 { margin-bottom: .35rem; }
.constel { position: relative; z-index: 1; width: 100%; flex: 1 1 0; min-height: 16rem; max-height: 34rem; margin-top: -2.2rem; contain: size layout; }
.constel canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 18px; }
.stars-list { list-style: none; padding: 0; margin: 0; }
/* --cx/--cy: camera offset in px, set from sections.js while the figure glides */
.star-btn { position: absolute; left: calc(var(--x) * 100% + var(--cx, 0px)); top: calc(var(--y) * 100% + var(--cy, 0px)); width: 15rem; height: 5rem; transform: translate(-50%, -1.9rem); display: flex; flex-direction: row; justify-content: center; align-items: flex-start; gap: .5rem; padding-top: 2.55rem; border: 0; border-radius: 14px; background: transparent; color: var(--ink); cursor: pointer; }
.star-btn b { font: 600 .72rem/1.2 var(--mono); letter-spacing: .1em; color: #9db0c8; }
.star-btn span { font: 600 .86rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); white-space: nowrap; text-shadow: 0 0 8px #04060d, 0 0 3px #04060d, 0 1px 2px #000; transition: color .3s; }
.star-btn[aria-current="true"] b, .star-btn[aria-current="true"] span, .star-btn:hover b, .star-btn:hover span { color: var(--hot); }
.star-btn:hover, .star-btn:focus-visible { background: none; outline: none; }   /* the star itself lights up (sections.js), no box */
.constel-hint { position: absolute; left: 50%; bottom: .6rem; transform: translateX(-50%); display: flex; align-items: center; gap: .6rem; font: 500 .74rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--hot); background: rgba(8, 12, 26, .55); border: 1px solid rgba(184, 168, 246, .3); padding: .45rem .8rem; border-radius: 999px; transition: opacity .6s; pointer-events: none; }
.constel-hint i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--hot); animation: ping 1.6s ease-out infinite; }
.constel-hint.done { opacity: 0; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(184, 168, 246, .7); } 100% { box-shadow: 0 0 0 .8rem rgba(184, 168, 246, 0); } }

/* all five stages share one grid cell (the wrapper keeps the tallest height); each stage IS a glass card,
   so a card can slide while the wrapper keeps the tilt (motion.js buildTilt targets #stage-card) */
.stage-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); margin-top: .5rem; }
.stage { grid-area: 1 / 1; min-width: 0; display: grid; grid-template-columns: 1.35fr 1fr; gap: .6rem 2.4rem; align-items: center; visibility: hidden; padding: 1rem 1.5rem 1.1rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px; background: rgba(255, 255, 255, .06); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.stage.is-on, .stage.is-out { visibility: visible; }
.stage.is-out { pointer-events: none; }
.stage p { color: var(--ink2); margin-top: .5rem; }
.stage h3 { margin: .2rem 0 .5rem; }
.quotes { list-style: none; padding: 0; margin: .25rem 0; color: var(--hot); font-style: italic; font-size: .92rem; line-height: 1.35; }
.quotes li { margin: .1rem 0; }
.stage-get { border-left: 1px solid var(--line); padding-left: 1.6rem; }
.gets { list-style: none; padding: 0; margin-top: .6rem; display: grid; gap: .55rem; }
.gets li { position: relative; padding-left: 1.5rem; color: var(--ink2); font-size: .95rem; }
.gets li::before { content: ''; position: absolute; left: 0; top: .5rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--hot); box-shadow: 0 0 10px rgba(184, 168, 246, .7); }
.stage-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .7rem; }
.nav-btn { appearance: none; border: 1px solid var(--line2); background: rgba(8, 12, 26, .45); color: var(--ink); font: 500 .78rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: .6rem 1.1rem; border-radius: 999px; cursor: pointer; transition: border-color .2s, color .2s; }
.nav-btn:hover { color: var(--hot); }   /* hover effects belong to the card, not to its buttons */
.nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pips { list-style: none; padding: 0; margin: 0; display: flex; gap: .5rem; }
.pips li { width: 2.6rem; height: 4px; border-radius: 2px; background: var(--line2); transition: background .4s; }
.pips li.on { background: var(--hot); }

@media (max-width: 920px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .stage-get { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: .7rem; }
}
@media (max-width: 720px) {
  .sec#metodo { padding-top: 5rem; }
  #metodo > .label, #metodo > h2, #metodo > .sub { pointer-events: auto; }
  .constel { flex: none; height: 17rem; min-height: 0; max-height: none; margin-top: .6rem; }
  .star-btn { width: 4rem; }
  .star-btn span { display: none; }
  .star-btn[aria-current="true"] span { display: block; position: absolute; top: 4.1rem; left: 50%; transform: translateX(-50%); }
  .star-btn b { font-size: .8rem; }
  .stage { padding: 1rem 1.1rem; }
  .constel-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .constel-hint i { animation: none; } }

/* ---- hero headline: two ghost phrases reserve the box, the live copy scrambles between them ---- */
.hl { display: grid; }
.hl > * { grid-area: 1 / 1; min-width: 0; }
.hl-ghost { visibility: hidden; font-style: normal; pointer-events: none; user-select: none; }
.hl-live.one-line { white-space: nowrap; }
/* mid-scramble the text can lose its spaces: break inside the word instead of running past the column */
.hl-live { overflow-wrap: anywhere; }

/* ---- far trips (rail jumps, Home / End): the page content hides while only the sky travels ----------- */
html[data-travel="far"] main, html[data-travel="far"] .foot { opacity: 0; transition: opacity .22s ease; pointer-events: none; }
html[data-travel="in"] main, html[data-travel="in"] .foot { transition: opacity .5s ease; }

/* ---- 03 picker: an icon and a short phrase per problem ------------------------------------------------ */
.pk-opt { align-items: center; }
.pk-opt .ic { display: grid; place-items: center; color: var(--muted); transition: color .3s; }
.pk-opt .ic svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pk-opt:hover .ic { color: var(--ink); }
.pk-opt[aria-selected="true"] .ic { color: var(--hot); }
.vis-soft { fill: rgba(184, 168, 246, .3); }

/* ---- 04 solutions and systems: a horizontal rail of cards, each with a small graphic of its potential --- */
.work { position: relative; margin-top: .4rem; }
.work-track { list-style: none; margin: 0; padding: .3rem .2rem 1rem; display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: .2rem;
  overscroll-behavior-x: contain; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
.work-track::-webkit-scrollbar { display: none; }
.work-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 18px; }
.wk { flex: 0 0 min(82vw, 21.5rem); scroll-snap-align: start; display: grid; }
.wk-card { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: .45rem; padding: 1.25rem 1.3rem 1.1rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px;
  background: rgba(255, 255, 255, .06); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.wk-card[data-kind="ia"] { background: rgba(184, 168, 246, .09); border-color: rgba(184, 168, 246, .3); }
.wk-card h3 { font-size: 1.35rem; line-height: 1.15; margin: 0; }
.wk-txt { color: var(--ink2); font-size: .93rem; margin: 0; }
.wk-pot { margin: .5rem 0 0; padding: .7rem .8rem .55rem; border-radius: 12px; background: rgba(4, 6, 13, .45); border: 1px solid rgba(255, 255, 255, .08); }
.wk-pot svg { display: block; width: 100%; height: 3.6rem; }
.wk-pot figcaption { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .4rem; font: 500 .7rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.g-line { fill: none; stroke: #a9b4d0; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.g-fill { fill: rgba(169, 180, 208, .2); stroke: #a9b4d0; stroke-width: 1.1; }
.g-hot { fill: none; stroke: var(--hot); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-bad { fill: rgba(255, 122, 138, .25); stroke: #ff7a8a; stroke-width: 2; stroke-linecap: round; }
.g-alert { fill: rgba(255, 122, 138, .3); stroke: #ff7a8a; stroke-width: 2; }
.g-dot circle { fill: var(--hot); }
.g-flow { stroke-dasharray: 4 6; animation: flow 1.4s linear infinite; }
.work-ctl { display: flex; align-items: center; justify-content: flex-end; gap: .9rem; margin-top: .2rem; }
.work-count { font: 500 .78rem/1 var(--mono); letter-spacing: .1em; color: var(--muted); }
.work-ctl .nav-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 720px) { .work-ctl { justify-content: space-between; } }
@media (prefers-reduced-motion: reduce) { .g-flow { animation: none; } }

/* =====================================================================================================
   Phones (iPhone Safari: ~430 x 760 visible): every stop has to fit one screen, so the Método, IA aplicada and
   "Tu mayor problema" are compacted here. Nothing is removed from desktop.
   ===================================================================================================== */
@media (max-width: 720px) {
  .bar { background: rgba(4, 6, 13, .6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding-bottom: .6rem; }
  .sec { padding: 4.4rem 1.1rem 1.2rem; gap: .4rem; }
  .sec h2 { font-size: clamp(1.35rem, 6.2vw, 1.7rem); margin-bottom: .3rem; }
  .sub { font-size: .88rem; }

  /* 01 Método: a short constellation, one card at a time, tight card */
  .sec#metodo { padding-top: 4.4rem; }
  #metodo > .sub { margin: 0; }
  .constel { height: 10.5rem; margin-top: .2rem; }
  .stage-card { margin-top: .2rem; }
  .stage:not(.is-on):not(.is-out) { display: none; }
  .stage { padding: .8rem .95rem; gap: .4rem; }
  .stage h3 { font-size: 1.02rem; margin: .1rem 0 .3rem; }
  .stage p { margin-top: .25rem; font-size: .86rem; line-height: 1.45; }
  .stage-get { padding-top: .5rem; }
  .gets { gap: .35rem; margin-top: .3rem; }
  .gets li { font-size: .84rem; padding-left: 1.3rem; }
  .stage-nav { margin-top: .5rem; }
  .nav-btn { padding: .5rem .85rem; font-size: .72rem; }
  .pips li { width: 1.8rem; }

  /* 02 IA aplicada: the interaction (terminal) is the star; the principles shrink to a title and the timeline */
  #ia > .sub { display: none; }
  .duo { gap: .5rem; margin-top: .2rem; }
  .links { display: none; }
  .glass { padding: .8rem .9rem; }
  .card-p .checks { display: none; }
  .card-p h3 { margin: .1rem 0 .2rem; font-size: 1.05rem; }
  .tl-wrap { margin-top: .3rem; padding-top: .5rem; border-top: 0; }
  .tl { margin-top: .7rem; }
  .tl li { font-size: .6rem; letter-spacing: .02em; }
  .card-a h3 { font-size: 1.05rem; margin: .15rem 0 .45rem; }
  .card-a .note { display: none; }
  .feed { height: 12.5rem; }
  .fd-l { grid-template-columns: 34px 62px 1fr; padding: 4px 10px; font-size: .78rem; }
  .term-bar { padding: .4rem .6rem; }

  /* 03 Tu mayor problema: six problems as a 2 x 3 grid, a compact answer under it */
  #pick > .sub { display: none; }
  .pk { margin-top: .2rem; gap: .6rem; }
  .pk-list { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; overflow: visible; padding: 0; }
  .pk-opt { flex: none; grid-template-columns: 1.5rem 1fr; gap: .4rem; padding: .5rem .55rem; min-height: 2.9rem; font-size: .8rem; line-height: 1.2; border: 1px solid var(--line); border-radius: 12px; }
  .pk-opt[aria-selected="true"] { border-color: rgba(184, 168, 246, .6); }
  .pk-stage { padding: .8rem .9rem; display: grid; grid-template-columns: 1fr; gap: .4rem; }
  .pk-title { font-size: 1.1rem; }
  .pk-body { font-size: .86rem; }
  .pk-panel .steps, .pk-panel > .label ~ .label { display: none; }
  .pk-side { grid-row: auto; gap: .4rem; }
  .pk-vis { aspect-ratio: 3 / 1; max-height: 5.2rem; }
  .pk-cap { font-size: .7rem; }
  .pk-stat b { font-size: 1.6rem; }
  .pk-stage > .btn { margin-top: .3rem; padding: .6rem 1rem; }
}

/* short phones (iPhone SE / mini with Safari bars): trim a little more */
@media (max-width: 720px) and (max-height: 700px) {
  #metodo > .sub { display: none; }
  .constel { height: 8.5rem; }
  .stage p { font-size: .82rem; }
  .pk-opt { min-height: 2.5rem; padding: .4rem .5rem; }
  .pk-vis { max-height: 4rem; }
  .pk-title { font-size: 1rem; }
}

/* ---- source chip of the picker (real figures, each with its source) ------------------------------------ */
.chip.src { text-decoration: none; text-transform: none; letter-spacing: .02em; font-size: .7rem; width: fit-content; color: var(--ink2); border-style: solid; }
.chip.src:hover { color: var(--hot); border-color: var(--hot); }
.pk-stat { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .75rem; }   /* the text sits beside the number, not under it */
.pk-stat span { max-width: none; line-height: 1.3; }
@media (max-width: 720px) {
  /* the drawing sits beside the figure so the card uses its full width instead of leaving empty sides */
  .pk-side { display: grid; grid-template-columns: 6.8rem 1fr; column-gap: .8rem; row-gap: .35rem; align-items: center; }
  .pk-side .pk-vis { grid-row: 1; aspect-ratio: 1 / 1; max-height: none; height: 6.8rem; }
  .pk-side .pk-cap { grid-column: 2; grid-row: 1; }
  .pk-side .pk-stat { grid-column: 1 / -1; grid-template-columns: auto 1fr; }
  .pk-side .pk-stat b { font-size: 2.2rem; }
  .pk-side .pk-stat span { font-size: .82rem; }
  .pk-side .chip.src { grid-column: 1 / -1; justify-self: start; }
  .pk-cap { font-size: .68rem; }
}


/* ---- 04 carousel: side arrows (the row visibly moves) and the page counter ------------------------------------ */
.work-ctl { display: none; }
.wk-arrow { position: absolute; top: calc(50% - 1.5rem); z-index: 3; width: 3rem; height: 3rem; display: grid; place-items: center; padding: 0; appearance: none; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%; color: var(--ink); font-size: 1.15rem; line-height: 1;
  background: rgba(8, 12, 26, .62); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, opacity .25s ease; }
.wk-arrow-prev { left: -1.3rem; } .wk-arrow-next { right: -1.3rem; }
.wk-arrow:hover { border-color: rgba(255, 207, 138, .75); box-shadow: 0 8px 24px rgba(0, 0, 0, .45), 0 0 18px rgba(255, 190, 120, .35); }
.wk-arrow-next:hover { transform: translateX(3px); } .wk-arrow-prev:hover { transform: translateX(-3px); }
.wk-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wk-arrow:disabled { opacity: 0; pointer-events: none; }
.work-count { position: absolute; right: .4rem; bottom: -.2rem; margin: 0; font: 500 .78rem/1 var(--mono); letter-spacing: .1em; color: var(--muted); }
@media (max-width: 720px) { .wk-arrow { width: 2.6rem; height: 2.6rem; top: calc(50% - 1.3rem); } .wk-arrow-prev { left: -.35rem; } .wk-arrow-next { right: -.35rem; } }

/* ---- 05 specialities: three bigger cards with a live graphic each ------------------------------------------ */
.sp-gal { position: relative; margin-top: .6rem; }
.sp-track { list-style: none; margin: 0; padding: .3rem .2rem 1.5rem; display: flex; gap: 1.2rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: .2rem;
  overscroll-behavior-x: contain; scrollbar-width: none; }
.sp-track::-webkit-scrollbar { display: none; }
.sp-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 20px; }
.sp-slide { flex: 0 0 min(94%, 64rem); scroll-snap-align: start; display: grid; }
.sp-card { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto; column-gap: clamp(1.2rem, 3vw, 2.6rem); row-gap: .5rem;
  align-content: center; padding: clamp(1.1rem, 2.4vw, 1.8rem); overflow: hidden;
  border: 1px solid rgba(184, 168, 246, .3); border-radius: 22px; background: rgba(184, 168, 246, .09);
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); box-shadow: 0 16px 40px rgba(0, 0, 0, .4);
  transition: border-color .35s ease, box-shadow .35s ease, transform .35s ease; }
.sp-card::before { content: ''; position: absolute; left: 14%; right: 14%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 207, 138, .85), transparent); }
.sp-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: var(--ga, 0); transition: opacity .3s ease;
  background: radial-gradient(260px 220px at var(--gx, 50%) var(--gy, 0%), rgba(255, 207, 138, .16), transparent 70%); }
.sp-card:hover { border-color: rgba(255, 207, 138, .5); box-shadow: 0 18px 46px rgba(0, 0, 0, .45), 0 0 40px rgba(184, 168, 246, .2); }
/* the illustration is the star: a big stage on the left, text on the right */
.sp-viz { grid-column: 1; grid-row: 1 / span 5; display: grid; place-items: center; padding: clamp(.8rem, 2vw, 1.4rem); border-radius: 16px;
  background: radial-gradient(70% 70% at 50% 40%, rgba(184, 168, 246, .14), rgba(4, 6, 13, .55)); border: 1px solid rgba(255, 255, 255, .08); }
.sp-viz svg { display: block; width: 100%; height: auto; max-height: min(24rem, 46svh); overflow: visible; }
.sp-card > :not(.sp-viz) { grid-column: 2; }
.sp-card h3 { font-size: clamp(1.4rem, 2.3vw, 2rem); line-height: 1.1; margin: 0; }
.sp-txt { margin: 0; color: var(--ink2); font-size: clamp(.95rem, 1.2vw, 1.08rem); }
.sp-tags { list-style: none; margin: .6rem 0 0; align-self: end; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.sp-tags li { font: 500 .68rem/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 1px 10px; border: 1px solid var(--line2); border-radius: 999px; color: var(--muted); }

/* graphics: pure SVG + CSS, paused while the section is off screen (html .sp-paused) */
.sp-bar-old { fill: rgba(169, 180, 208, .2); stroke: #a9b4d0; stroke-width: 1.1; }
.sp-bar-new { fill: rgba(184, 168, 246, .45); stroke: var(--hot); stroke-width: 1.4; transform-box: fill-box; transform-origin: left center; animation: sp-shrink 4.2s cubic-bezier(.6, 0, .2, 1) infinite; }
@keyframes sp-shrink { 0%, 12% { transform: scaleX(1); } 46%, 84% { transform: scaleX(.3); } 100% { transform: scaleX(1); } }
.sp-pulse { fill: var(--hot); animation: sp-hop 3.4s ease-in-out infinite; }
@keyframes sp-hop { 0% { transform: translateX(0); opacity: 0; } 10% { opacity: 1; } 45% { transform: translateX(80px); } 55% { transform: translateX(80px); } 90% { transform: translateX(160px); opacity: 1; } 100% { transform: translateX(160px); opacity: 0; } }
.sp-check { stroke-dasharray: 40; animation: sp-draw 3.4s ease-in-out infinite; }
@keyframes sp-draw { 0%, 70% { stroke-dashoffset: 40; } 88%, 100% { stroke-dashoffset: 0; } }
.sp-scan { stroke: var(--hot); stroke-width: 2; animation: sp-sweep 3.6s ease-in-out infinite; }
@keyframes sp-sweep { 0%, 100% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 50% { transform: translateY(150px); opacity: 1; } 62% { opacity: 0; } }
.sp-box { fill: none; stroke-width: 2; stroke-dasharray: 5 4; opacity: 0; }
.sp-box-ok { stroke: var(--hot); animation: sp-ok 3.6s ease-in-out infinite; }
.sp-box-bad { stroke: #ff7a8a; animation: sp-bad 3.6s ease-in-out infinite; }
@keyframes sp-ok { 0%, 22% { opacity: 0; } 34%, 64% { opacity: 1; } 78%, 100% { opacity: 0; } }
@keyframes sp-bad { 0%, 40% { opacity: 0; } 52%, 82% { opacity: 1; } 94%, 100% { opacity: 0; } }
.sp-paused .sp-card *, .sp-paused .sp-card { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .sp-bar-new, .sp-pulse, .sp-check, .sp-scan, .sp-box, .sp-trend, .sp-dot, .sp-ring { animation: none; } .sp-trend { stroke-dashoffset: 0; } .sp-bar-new { transform: scaleX(.3); } .sp-box-ok, .sp-box-bad { opacity: 1; } .sp-check { stroke-dashoffset: 0; } }
.sp-lab { fill: var(--muted); font: 500 8.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.sp-lab-hot { fill: var(--hot); } .sp-lab-bad { fill: #ff7a8a; }
.sp-trend { stroke-dasharray: 300; animation: sp-trend 4.2s ease-in-out infinite; }
@keyframes sp-trend { 0%, 10% { stroke-dashoffset: 300; } 55%, 100% { stroke-dashoffset: 0; } }
.sp-dot { fill: var(--hot); animation: sp-dot 4.2s ease-in-out infinite; }
@keyframes sp-dot { 0%, 48% { opacity: 0; } 58%, 100% { opacity: 1; } }
.sp-ring { fill: none; stroke: var(--hot); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: sp-ring 3.4s ease-out infinite; }
@keyframes sp-ring { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(1.7); opacity: 0; } }
@media (max-width: 960px) {
  .sp-slide { flex-basis: 92%; }
  .sp-card { grid-template-columns: 1fr; grid-template-rows: auto; padding: 1rem 1.1rem; }
  .sp-viz { grid-column: 1; grid-row: auto; padding: .5rem; }
  .sp-viz svg { max-height: 28svh; }
  .sp-card > :not(.sp-viz) { grid-column: 1; }
  .sp-tags { align-self: start; margin-top: .2rem; }
}

/* ---- scroll cue: a subtle ring that invites the next stop; its arc fills while the auto-advance timer runs ---- */
.cue { position: fixed; left: 50%; bottom: 1rem; translate: -50% 0; z-index: 5; width: 4.4rem; height: 4.4rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink2);
  opacity: 0; cursor: pointer; transition: opacity .6s ease, color .3s ease, transform .3s ease; -webkit-tap-highlight-color: transparent; }
.cue[hidden] { display: none; }
.cue.is-on { opacity: .62; }
.cue:hover, .cue:focus-visible { opacity: 1; color: var(--gold); transform: translateY(-2px); }
.cue:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cue svg { width: 100%; height: 100%; overflow: visible; }
.cue-track, .cue-prog { fill: none; stroke-width: 1; }
.cue-track { stroke: rgba(255, 255, 255, .1); }
.cue-prog { stroke: rgba(255, 207, 138, .7); stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 283; transform: rotate(-90deg); transform-origin: 50% 50%; }
.cue.is-counting .cue-prog { animation: cue-count var(--dwell, 10s) linear forwards; }
@keyframes cue-count { from { stroke-dashoffset: 283; } to { stroke-dashoffset: 0; } }
.cue-text { transform-origin: 50% 50%; animation: cue-spin 22s linear infinite; }
.cue-text text { fill: currentColor; font: 500 8.2px var(--mono); letter-spacing: .2em; text-transform: uppercase; }
@keyframes cue-spin { to { transform: rotate(360deg); } }
.cue-arrow { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; animation: cue-bob 2.2s ease-in-out infinite; }
@keyframes cue-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
html[data-legal] .cue, html[data-travel] .cue { opacity: 0; pointer-events: none; }
@media (max-width: 720px) { .cue { width: 3.6rem; height: 3.6rem; bottom: .6rem; } }
@media (prefers-reduced-motion: reduce) { .cue-text, .cue-arrow { animation: none; } .cue.is-counting .cue-prog { animation: none; } }


/* ---- phones: the galleries centre their card; the arrows sit in the side gutters and never cover the text ---- */
@media (max-width: 720px) {
  .work-track, .sp-track { padding-inline: 12%; scroll-padding-inline: 12%; -webkit-mask-image: none; mask-image: none; }
  .wk, .sp-slide { flex: 0 0 100%; scroll-snap-align: center; }
  .wk-arrow { width: 2.2rem; height: 2.2rem; font-size: 1rem; top: calc(50% - 1.1rem); }
  .wk-arrow-prev { left: .25rem; } .wk-arrow-next { right: .25rem; }
}


/* ---- while the page flies between stops (html[data-trip], set by nav.js): the expensive effects rest ------------------------
   The big glass panels re-blur the animating WebGL canvas every frame, and the looping SVG graphics repaint; neither is
   readable at hyperspace speed, so both pause for the second or so the trip lasts and come back on arrival. */
html[data-trip] .glass, html[data-trip] .wk-card, html[data-trip] .sp-card, html[data-trip] .wk-arrow, html[data-trip] .legal-card {
  backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-trip] .sp-card *, html[data-trip] .cue-text, html[data-trip] .cue-arrow, html[data-trip] .g-flow { animation-play-state: paused !important; }


/* ---- phones: the problem picker must never be wider than the screen (a long source chip or caption used to stretch it) ---- */
.pk, .pk-list, .pk-stage, .pk-side, .pk-cap, .pk-stat, .pk-stat span { min-width: 0; }
.chip.src { white-space: normal; max-width: 100%; overflow-wrap: anywhere; border-radius: 14px; text-align: left; }
.pk-cap { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .pk { grid-template-columns: minmax(0, 1fr); }
  .pk-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-stage { grid-template-columns: minmax(0, 1fr); }
  .pk-side { grid-template-columns: 6.8rem minmax(0, 1fr); }
  .pk-list > * { min-width: 0; overflow-wrap: anywhere; }
}

/* Product cards that open their live app: the whole card is the hit area */
.wk-go { color: inherit; text-decoration: none; }
.wk-go::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.wk-go span { color: var(--gold, #ffcf8a); font-size: .8em; opacity: .7; transition: opacity .2s, transform .2s; display: inline-block; }
.wk-card:has(.wk-go):hover { border-color: rgba(255, 207, 138, .55); }
.wk-card:has(.wk-go):hover .wk-go span, .wk-go:focus-visible span { opacity: 1; transform: translate(2px, -2px); }
.wk-go:focus-visible { outline: 2px solid rgba(255, 207, 138, .8); outline-offset: 4px; border-radius: 6px; }
