body.tsu-case {
  --tsu-black: #050911;
  overflow-x: clip;
  background: radial-gradient(ellipse at 65% 0%, #142b48, transparent 52%), linear-gradient(165deg, #0a1626, var(--tsu-black) 65%) fixed;
}

.tsu-case .case-header {
  position: absolute;
  z-index: 3;
  width: 100%;
  border-color: #c1def52b;
}

.tsu-hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 0;
  margin-inline: calc((100% - 100vw) / 2);
  padding: clamp(118px, 17svh, 172px) max(6vw, calc((100vw - 1260px) / 2)) clamp(36px, 6svh, 68px);
  isolation: isolate;
  overflow: hidden;
}

.tsu-intro h1 {
  max-width: 9ch;
  font-size: clamp(62px, 12vw, 176px);
  line-height: .81;
  text-shadow: 0 10px 44px #0208129c;
}

.tsu-film-link {
  display: inline-block;
  margin-top: 26px;
  padding-bottom: 7px;
  border-bottom: 1px solid currentColor;
  color: var(--project-accent);
}

.tsu-case .case-film {
  position: relative;
  scroll-margin-top: 24px;
  box-shadow: 0 0 44px #448ee326;
}

.tsu-case .case-copy {
  display: block;
  border-color: #8cc6ff40;
}

.tsu-case .case-frames { margin-top: clamp(20px, 4vw, 54px); }

.tsu-panel {
  position: relative;
  background: #070d16;
  border: 1px solid #8cc6ff38;
}

.tsu-panel::after {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: #bde1ff;
  box-shadow: 0 0 12px #59aaff;
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .tsu-panel.is-armed video { clip-path: inset(50% 0); }
  .tsu-panel.is-armed::after { opacity: 1; }
  .tsu-panel.is-visible video { animation: tsu-panel-open 820ms cubic-bezier(.22,.73,.3,1) both; }
  .tsu-panel.is-visible::after { animation: tsu-line-fade 550ms ease-out both; }
}

@keyframes tsu-panel-open {
  from { clip-path: inset(50% 0); }
  to { clip-path: inset(0); }
}

@keyframes tsu-line-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

.tsu-atmosphere {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.tsu-atmosphere::before {
  content: '';
  position: absolute;
  inset: -54px 0 0;
  background:
    linear-gradient(#83b9fa10 1px, transparent 1px),
    linear-gradient(90deg, #83b9fa10 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, #0008, #000 35%, #0008 85%, transparent);
  animation: tsu-grid-drift 16s linear infinite;
}

@keyframes tsu-grid-drift {
  to { background-position: 0 54px; }
}
.tsu-case .case-main, .tsu-case .case-footer { position: relative; }

.tsu-trail {
  position: absolute;
  top: 27%;
  left: -36vw;
  width: clamp(120px, 32vw, 520px);
  height: 2px;
  background: linear-gradient(90deg, transparent, #3a8be54a 48%, #aedfffaf 96%, transparent);
  filter: drop-shadow(0 0 8px #328dff);
  opacity: 0;
  animation: tsu-trail-pass 5.8s linear infinite;
}
.tsu-trail:nth-child(2) { top: 49%; animation-delay: -2.6s; }
.tsu-trail:nth-child(3) { top: 73%; animation-delay: -4.2s; animation-direction: reverse; }
.tsu-trail:nth-child(4) { top: 88%; animation-delay: -1.2s; height: 1px; }

@keyframes tsu-trail-pass {
  0% { opacity: 0; transform: translate3d(0, 5vh, 0) rotate(-11deg); }
  12% { opacity: .58; }
  65%, 100% { opacity: 0; transform: translate3d(144vw, -19vh, 0) rotate(-11deg); }
}

.tsu-beam {
  position: absolute;
  z-index: -1;
  inset: -14% -16% 16%;
  transform-origin: 50% 0;
  background:
    radial-gradient(ellipse at 50% 0%, #a6d9ff91, #498cce30 22%, transparent 52%),
    conic-gradient(from 145deg at 50% 0%, transparent, #498cce25 14deg, #7cbcff72 35deg, #498cce25 56deg, transparent 72deg);
  filter: blur(24px);
  mask-image: linear-gradient(#000 42%, transparent 95%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: tsu-beam-drift 9s ease-in-out infinite alternate;
}

@keyframes tsu-beam-drift {
  from { transform: translateX(-5%) rotate(-7deg); opacity: .6; }
  to { transform: translateX(7%) rotate(8deg); opacity: 1; }
}

.tsu-pointer, .tsu-track-trail { display: none; }
.tsu-track-trail {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9;
}

@media (hover: hover) and (pointer: fine) {
  .tsu-custom-pointer, .tsu-custom-pointer :is(a, button) { cursor: none; }
  .tsu-custom-pointer .tsu-pointer {
    display: block;
    position: fixed;
    z-index: 10;
    top: 0;
    left: 0;
    width: 20px;
    height: 18px;
    transform-origin: 10px 0;
    transform: translate3d(calc(var(--pointer-x) - 10px), var(--pointer-y), 0) rotate(var(--pointer-angle));
    filter: drop-shadow(0 0 6px #71b9ff);
    pointer-events: none;
  }
  .tsu-custom-pointer .tsu-track-trail { display: block; }
  .tsu-pointer::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(#fff 45%, #c4d9ec);
    clip-path: path('M7 2 Q10 -2 13 2 L19 11 Q22 17 16 17 H4 Q-2 17 1 11 Z');
  }
}

@media (prefers-reduced-motion: reduce) {
  .tsu-trail { display: none; }
  .tsu-beam, .tsu-atmosphere::before { animation: none; }
}


.tsu-atmosphere { z-index: 1; }
.tsu-hero { isolation: auto; }
.tsu-intro, .tsu-case .case-film, .tsu-case .case-copy,
.tsu-case .case-next, .tsu-case .case-footer {
  position: relative;
  z-index: 2;
}
.tsu-case .case-main { z-index: auto; }
.tsu-beam { z-index: auto; }

.tsu-custom-pointer .cursor { visibility: hidden; }

.tsu-showcase.tsu-atmosphere {
  position: absolute;
  z-index: 1;
  background: #03050b;
  opacity: var(--tsu-presence, 0);
  mask-image: linear-gradient(90deg, transparent, #000 15% 85%, transparent);
}
.tsu-showcase::before {
  animation-duration: 5s;
  opacity: var(--tsu-light, 1);
}
.tsu-showcase .tsu-beam {
  inset: -16% -28% 15%;
  background:
    radial-gradient(ellipse at 50% 0%, #d1ebffcc, #4d97ed55 24%, transparent 58%),
    conic-gradient(from 137deg at 50% 0%, transparent 9deg, #529dff40 24deg, #adceff99 38deg, #599dff40 51deg, transparent 77deg),
    conic-gradient(from 128deg at 50% 0%, transparent 10deg, #65aaff36 29deg, transparent 42deg, #65aaff29 58deg, transparent 81deg);
  filter: blur(18px);
  scale: 1 calc(.25 + .75 * var(--tsu-light, 1));
}
@media (prefers-reduced-motion: no-preference) {
  .tsu-showcase :is(.tsu-trail, .tsu-beam, .tsu-map-pin) {
    visibility: hidden;
  }
  .work-tsu .tsu-showcase :is(.tsu-trail, .tsu-beam, .tsu-map-pin) {
    visibility: visible;
  }
  .theme-tsu.project-scene:not(:focus-within) > :is(.project, .project-title, .scene-meta) {
    opacity: clamp(.035, (var(--tsu-light, 1) - .44) / .56, 1);
  }
  .tsu-showcase .tsu-map-pin { opacity: var(--tsu-light, 1); }
  .tsu-showcase .tsu-beam {
    animation: tsu-showcase-sweep 7s ease-in-out infinite alternate;
  }
}
@keyframes tsu-showcase-sweep {
  0% { transform: translateX(-20%) rotate(-16deg) scaleX(.85); opacity: calc(.6 * var(--tsu-light, 1)); }
  46% { transform: translateX(0) rotate(0deg) scaleX(1.13); opacity: var(--tsu-light, 1); }
  100% { transform: translateX(19%) rotate(18deg) scaleX(.92); opacity: calc(.72 * var(--tsu-light, 1)); }
}
.tsu-showcase :is(.tsu-trail, .tsu-beam), .tsu-showcase::before { animation-play-state: paused; }
.work-tsu .tsu-showcase :is(.tsu-trail, .tsu-beam),
.work-tsu .tsu-showcase::before { animation-play-state: running; }
.theme-tsu.project-scene .project { z-index: 2; }

.tsu-map-pin {
  position: absolute;
  left: var(--pin-x);
  top: var(--pin-y);
  width: var(--pin-size);
  aspect-ratio: 1;
  border: 1px solid #a1d5ffbf;
  border-radius: 50% 50% 50% 12%;
  background: radial-gradient(circle, #dbf4ff 0 14%, #438ce8 18%, #15315d 56%);
  box-shadow: 0 0 18px #549dff7a;
  transform: translate3d(
    calc(var(--tsu-offset, 0) * var(--pin-depth) * clamp(88px, 20vw, 290px)),
    calc(var(--tsu-offset, 0) * var(--pin-depth) * 13vh), 0
  ) rotate(calc(-45deg + var(--tsu-offset, 0) * var(--pin-depth) * 12deg));
}
.tsu-map-pin:nth-last-child(4) { --pin-x: 17%; --pin-y: 23%; --pin-size: 32px; --pin-depth: 1.1; }
.tsu-map-pin:nth-last-child(3) { --pin-x: 79%; --pin-y: 18%; --pin-size: 23px; --pin-depth: .42; }
.tsu-map-pin:nth-last-child(2) { --pin-x: 82%; --pin-y: 60%; --pin-size: 36px; --pin-depth: 1.35; }
.tsu-map-pin:last-child { --pin-x: 19%; --pin-y: 70%; --pin-size: 19px; --pin-depth: .3; }

.tsu-engine-toggle {
  position: fixed;
  z-index: 8;
  top: 86px;
  right: 5%;
  padding: 8px 12px;
  border: 1px solid #8cc6ff66;
  border-radius: 100px;
  background: #0a1626;
  color: #e2f2ff;
  font: inherit;
  font-size: 12px;
}

.work-tsu .rail > .scene:not(.theme-tsu) .orbit { opacity: 0; }
/* A presença da cena controla o fade, sem corte de visibilidade. */
@media(prefers-reduced-motion:no-preference) {
 .tsu-showcase.tsu-atmosphere :is(.tsu-trail,.tsu-beam,.tsu-map-pin) { visibility:visible; }
}
.tsu-showcase.tsu-atmosphere { mask-image:linear-gradient(90deg,transparent 0%,#0003 9%,#000b 20%,#000 30% 70%,#000b 80%,#0003 91%,transparent 100%); }

.tsu-story p + p { margin-top:20px; }
.tsu-case .case-copy > p { max-width:62ch; }
.tsu-case .case-credits { line-height:1.65; font-size:clamp(14px,1.5vw,18px); }
@media(max-width:600px) { .tsu-case .case-credits dd { flex-basis:100%; } }
