/* The three cards share a single coordinate space with the character. */
.neira-stage {
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  height: clamp(33rem, 69svh, 44rem);
  max-width: 78rem;
  overflow: clip;
  --park-w: min(30.4cqw, 23.75rem);
  --front-w: min(47cqw, 32rem);
  --park-type: clamp(1.02rem, 1.7cqw, 1.37rem);
  --front-type: clamp(1.3rem, 2.34cqw, 2rem);
}
.neira-stage + .services-section { margin-top: clamp(.75rem, 1.8vw, 1.75rem); }
.scene-actor {
  position: absolute; z-index: 1; bottom: 0; left: 50%;
  height: calc(100% - clamp(.75rem, 2.4vh, 1.65rem)); aspect-ratio: 792 / 1100;
  transform: translateX(-50%); pointer-events: none;
}
.scene-actor img, .scene-actor .actor-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.scene-actor video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.scene-actor .actor-film { visibility: hidden; }
.neira-stage.has-film .actor-film { visibility: visible; }
.neira-stage.has-film .scene-actor img { visibility: hidden; }
.scene-links, .scene-particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene-links { z-index: 0; overflow: visible; fill: none; }
.scene-links path { stroke: url(#thought-color); stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.scene-links circle { fill: #ab89f3; stroke: white; stroke-width: 1; }
.scene-particles { z-index: 2; }
.scene-card {
  --card-radius: clamp(1.1rem, 1.8cqw, 1.6rem);
  position: absolute; z-index: 3; isolation: isolate;
  width: var(--park-w); top: 33%; left: 17%; transform: translate(-50%,-50%);
}
.scene-card--help { left: 83%; }
.scene-card--author { --park-w: min(28cqw, 17rem); --park-type: clamp(1.12rem, 1.75cqw, 1.4rem); left: 50%; top: 83.5%; }
.card-float { position: relative; width: 100%; height: 100%; border-radius: var(--card-radius); }
.card-glass { position: absolute; inset: 0; border-radius: inherit; }
.card-surface {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
  background:
    radial-gradient(ellipse at 9% 0%, #ffffffac, transparent 43%),
    linear-gradient(142deg, #ffffff99 10%, #fbfcff8a 52%, #ecebff78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid #ffffffdb;
  box-shadow: inset 0 1px 1px white, inset -1px -1px 2px #b5a8d387,
              inset 2px -2px 6px #cfe5ff52, 0 0 0 1px #b7b7cb87,
              0 4px 7px -5px #32215e40, 0 16px 35px -20px #51457259;
}
.card-surface::before, .card-surface::after {
  content: ''; pointer-events: none; position: absolute; border-radius: inherit;
}
.card-surface::before {
  inset: 1px; padding: 1.35px;
  background: linear-gradient(137deg, white 2%, #c5f1ffde 18%, transparent 36%, #fff9 51%, #d2bdf5ac 74%, #fff 91%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.card-surface::after {
  inset: 0;
  background: linear-gradient(159deg, #ffffff80, transparent 23%),
              linear-gradient(345deg, #cbc5f32e, transparent 27%);
}
.card-copy {
  position: relative; text-align: center; width: var(--park-w);
  padding: .82em 1.04em .86em;
  font-size: var(--park-type); font-weight: 700; line-height: 1.28;
  letter-spacing: -.035em; text-wrap: balance;
}
.card-copy--front { display: none; width: var(--front-w); font-size: var(--front-type); }
.scene-card--author .card-surface {
  border-color: #ff96dc;
  background:
    radial-gradient(ellipse at 5% -20%, #ff83df 0, transparent 45%),
    radial-gradient(ellipse at 106% 97%, #fa29b6, transparent 53%),
    linear-gradient(116deg, #ef006b 1%, #d50073 37%, #c0008b 70%, #f70aa9);
  box-shadow: inset 0 1px 1.5px #fff8, inset 0 -2px 4px #b9006570,
              0 0 0 1px #ef147ac9, 0 8px 27px -9px #fa008e9c;
}
.scene-card--author .card-surface::after {
  background: linear-gradient(166deg, #ffffff47, transparent 20%), linear-gradient(342deg, #ff8cf138, transparent 22%);
}
.scene-card--author .card-copy { color: white; font-weight: 400; letter-spacing: -.015em; text-shadow: 0 1px 3px #89004170; }
.scene-card--author strong { font-weight: 700; }
.card-glint {
  position: absolute; right: 10px; top: -7px; width: 34px; height: 21px;
  pointer-events: none; color: #9069cd; filter: drop-shadow(0 1px 1px #fffc);
}
.scene-card--help .card-glint { color: #72afc4; }
.scene-card--author .card-glint { color: #fff2f9; filter: drop-shadow(0 1px 2px #9d115a64); }
.scene-card { --float-period: 3.7s; --float-height: -4px; }
.scene-card--help { --float-period: 4.3s; --float-height: -4.6px; }
.scene-card--author { --float-period: 4.05s; --float-height: -3.5px; }
.scene-card.is-parked .card-float {
  animation: glass-float var(--float-period) cubic-bezier(.45,0,.55,1) infinite alternate;
  will-change: transform;
}
@keyframes glass-float {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(0,var(--float-height),0); }
}
.neira-stage[data-running="false"] .card-float,
.neira-stage[data-running="false"] .link-pulse { animation-play-state: paused; }
.scene-controls { position: absolute; display: flex; right: .3rem; bottom: .5rem; gap: .25rem; z-index: 5; }
.scene-controls button { border: 1px solid #e2dfe9; border-radius: 50%; background: #ffffffd9; width: 2.5rem; height: 2.5rem; padding: .63rem; display: grid; place-items: center; }
.scene-controls svg { display: block; width: 100%; height: 100%; fill: none; stroke: #514879; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.scene-controls button:hover { border-color: #b19ad0; background: #f5f0ff; }
.scene-controls .play-sign, [data-paused="true"] .pause-sign { display: none; }
[data-paused="true"] .play-sign { display: block; }
.stage-loading .scene-card, .stage-loading .scene-actor { opacity: 0; }
.neira-stage.is-directed .scene-card { top: 0; left: 0; transform-origin: center; will-change: transform; }
.neira-stage.is-directed .card-copy { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.neira-stage.is-directed .card-copy--front { display: block; }
@media (max-width: 46rem) {
  .neira-stage.shell { width: calc(100% - 1rem); }
  .neira-stage { height: clamp(34.75rem, 74svh, 43rem); --park-w: 45cqw; --front-w: min(84cqw, 26rem); --park-type: clamp(.99rem, 3.5cqw, 1.19rem); --front-type: clamp(1.22rem, 4.9cqw, 1.55rem); }
  .scene-actor { height: calc(100% - 1rem); }
  .scene-card { left: 24%; top: 57%; }
  .scene-card--help { left: 76%; top: 64%; }
  .scene-card--author { left: 50%; top: 87%; --park-w: min(62cqw,15rem); --park-type: 1.09rem; }
  .card-copy { padding: .78em .69em; }
  .scene-controls { right: .25rem; top: .6rem; bottom: auto; }
  .scene-controls button { width: 2.35rem; height: 2.35rem; padding: .6rem; }
  .card-glint { right: 8px; top: -6px; width: 29px; height: 18px; }
  .neira-stage + .services-section { margin-top: 1.4rem; }
}
.scene-links--near { z-index: 2; }
@media (min-width: 46.01rem) {
  .scene-card--help .card-copy span { display: block; }
}
@media (max-width: 29rem) {
  .neira-stage { height: clamp(34.75rem, 152vw, 39rem); --park-w: 65cqw; --park-type: 1.01rem; }
  .scene-card { left: 35%; top: 51%; }
  .scene-card--help { left: 65%; top: 70.8%; }
  .scene-card--author { left: 50%; top: 91.2%; --park-w: min(72cqw,15rem); }
  .scene-actor { top: .5rem; bottom: auto; height: min(calc(100% - .6rem), 158cqw); mask-image: linear-gradient(#000 80%, transparent 100%); }
}

.home-main { position: relative; isolation: isolate; }
.neira-background {
  position: fixed; z-index: -1; inset: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(ellipse at 4% 26%, #d4f0ff38, transparent 34%),
              radial-gradient(ellipse at 94% 63%, #f8d9f040, transparent 36%);
}
.pcb-bank {
  position: absolute; top: 0; bottom: 0; left: var(--lane);
  width: min(var(--bank-width), 9vw); color: #8579b9;
}
.pcb-bank:nth-child(3n+1) { color: #5197a6; }
.pcb-bank:nth-child(3n) { color: #a375af; }
.pcb-trace {
  position: absolute; top: var(--origin); left: var(--x);
  max-width: none; fill: none; stroke: currentColor;
  stroke-linejoin: round; stroke-linecap: round; opacity: 0;
  mask-image: linear-gradient(#000 0%, #000 52%, transparent 100%);
  animation: pcb-flight var(--period) linear var(--delay) infinite;
}
.pcb-copper { stroke-width: .95; opacity: .69; }
.pcb-pad { fill: currentColor; stroke-width: .65; }
.pcb-via { stroke-width: 1.05; }
.pcb-signal {
  stroke-width: 1.15; stroke-dasharray: .065 1.1;
  animation: pcb-current 3.3s linear var(--signal-delay) infinite;
}
/* Each trace fades out in mid-flight, spends time invisible, then appears
   in a different band. The position resets only while fully transparent. */
@keyframes pcb-flight {
  0% { opacity: 0; transform: translate3d(0,0,0); }
  8% { opacity: .23; }
  17% { opacity: .21; }
  32% { opacity: 0; transform: translate3d(0,calc(0px - var(--travel)),0); }
  45% { opacity: 0; transform: translate3d(0,var(--next),0); }
  54% { opacity: .22; }
  64% { opacity: .19; }
  79%,100% { opacity: 0; transform: translate3d(0,calc(var(--next) - var(--travel)),0); }
}
@keyframes pcb-current {
  0% { stroke-dashoffset: .07; opacity: 0; }
  15%,65% { opacity: .85; }
  78%,100% { stroke-dashoffset: -1; opacity: 0; }
}
.neira-background.is-paused .pcb-trace, .neira-background.is-paused .pcb-signal { animation-play-state: paused; }
.scene-links .link-pulse, .scene-links circle { opacity: 0; }
.scene-links .link-pulse { stroke: #8484d8; stroke-width: 2.15; stroke-dasharray: .027 1.04; }
.neira-stage.is-linked .link-pulse { animation: thought-trace 8s var(--pulse-delay,0s) linear infinite; }
.neira-stage.is-linked[data-running="false"] .link-pulse { animation-play-state: paused; }
@keyframes thought-trace {
  0% { stroke-dashoffset: .03; opacity: 0; }
  7% { opacity: .65; }
  42% { opacity: .58; }
  50%,100% { stroke-dashoffset: -1; opacity: 0; }
}
@media (max-width: 46rem) {
  .pcb-bank--2, .pcb-bank--3 { display:none; }
  .pcb-bank { width: min(var(--bank-width),13vw); opacity:.86; }
  .pcb-trace:nth-child(3n) { display:none; }
}
@media (prefers-reduced-motion: reduce) {
  .pcb-trace, .pcb-signal { animation-play-state: paused; }
  .neira-stage .card-float, .neira-stage .link-pulse { animation: none; }
}
