/* The frame viewer is a layered print. Only the image, type and registration
   marks move; the text and the controls keep their hit areas. */
.frame-hero {
  --stage-night: #091c57;
  --stage-field: #1646c7;
  --stage-print: #45d8f6;
  --stage-paper: #b7fff3;
  --stage-x: 0px;
  --stage-y: 0px;
  --stage-scroll: 0px;
  --stage-turn: 0deg;
  color: #fff;
  background: linear-gradient(114deg, #0a205e 2%, var(--stage-field) 70%, #12379a);
  border-bottom: 6px solid var(--stage-night);
}
.frame-hero[data-frame="valkyr"] {
  --stage-field: #353baf;
  --stage-print: #97abff;
  --stage-paper: #e4eaff;
}
.frame-hero[data-frame="e01"] {
  --stage-field: #134b9b;
  --stage-print: #efae86;
  --stage-paper: #ffe2a8;
}
.stage-backdrop, .stage-backdrop i {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.stage-backdrop {
  background:
    linear-gradient(116deg, transparent 0 33%, #112f9399 33.05% 44%, transparent 44.05%),
    linear-gradient(116deg, transparent 68%, #081e67aa 68.1% 73%, transparent 73.1%);
}
.stage-backdrop i:first-child {
  inset: 0 0 0 46%;
  background: linear-gradient(115deg, transparent 0 20%, #2868f6 20.1% 67%, #173ba7 67.1%);
  opacity: .9;
}
.stage-backdrop i:last-child {
  inset: 0 -5% 0 75%;
  background: repeating-linear-gradient(120deg, transparent 0 15px, #a1deff66 15px 16px, transparent 16px 24px);
  clip-path: polygon(94% 0,100% 0,100% 100%,0 100%);
}
.frame-hero .stage-layout {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: clamp(548px, 44vw, 680px);
  isolation: isolate;
}
.stage-identity {
  z-index: 2;
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  min-width: 0;
  padding: 48px 0 56px;
}
.stage-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--stage-paper);
}
.stage-kicker::before {
  content: "";
  display: block;
  width: 32px;
  height: 5px;
  background: currentColor;
  transform: skewX(-25deg);
}
.frame-hero h1 {
  width: fit-content;
  margin: 24px 0 28px;
  font-size: clamp(96px, 9.45vw, 158px);
  line-height: .76;
  letter-spacing: -.025em;
  text-shadow: 3px 4px 0 #0c207864;
}
.frame-hero .name-dot { color: var(--stage-paper); }
.stage-bio { max-width: 34rem; }
.stage-bio .hero-lede { max-width: 38ch; color: #eff4ff; }
.stage-bio .actions { position: relative; }
.stage-viewport {
  position: relative;
  min-width: 0;
  min-height: 340px;
  grid-column: 2;
  grid-row: 1;
  isolation: isolate;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.stage-print, .stage-cutout, .stage-art-pivot, .stage-shutter {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stage-print {
  transform: translate(calc(var(--stage-x) * -.32), calc(var(--stage-y) * -.32 + var(--stage-scroll) * -.26));
}
.stage-orbit {
  position: absolute;
  display: block;
  width: 82%;
  aspect-ratio: 1;
  left: 11%;
  top: 3%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 38% 31%, #dffbff9c, transparent 57%),
    radial-gradient(#1438a55c 1px, transparent 1.15px) 0 0 / 5px 5px,
    var(--stage-print);
  box-shadow: 0 0 0 2px #092d9d, 0 0 0 4px var(--stage-paper), 0 0 0 14px #07399b44;
}
.stage-orbit::before, .stage-orbit::after {
  content: "";
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  background: conic-gradient(from 14deg, transparent 0deg 36deg, var(--stage-paper) 36deg 90deg, transparent 90deg 187deg, var(--stage-paper) 187deg 224deg, transparent 224deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}
.stage-orbit::before { transform: rotate(var(--stage-turn)); }
.stage-orbit::after {
  inset: -1.5%;
  background: repeating-conic-gradient(#082671aa 0 1deg, transparent 1deg 5deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}
.stage-needle {
  position: absolute;
  z-index: 1;
  top: -2%;
  left: 50%;
  width: 2px;
  height: 52%;
  transform-origin: 50% 100%;
  transform: rotate(-50deg);
}
.stage-needle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -4px;
  width: clamp(16px, 2.1vw, 30px);
  height: 9px;
  background: linear-gradient(90deg, var(--stage-night) 0 64%, #fff 64%);
  border: 1px solid var(--stage-night);
  transform: translateX(-50%) skewX(-25deg);
}
.stage-needle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  width: 2px;
  height: 8px;
  background: var(--stage-night);
}
.stage-striation {
  position: absolute;
  top: 13%;
  right: -3%;
  width: 63%;
  height: 8%;
  transform: skewY(-14deg);
  background: repeating-linear-gradient(0deg, var(--stage-paper) 0 2px, transparent 2px 6px);
}
.stage-code {
  position: absolute;
  bottom: 12%;
  right: -2%;
  color: #efffff;
  opacity: .48;
  font: italic 800 clamp(124px, 14.4vw, 248px)/.8 var(--display);
  letter-spacing: -.045em;
  transform: rotate(-6deg);
}
.stage-cutout { z-index: 1; }
.frame-hero[data-figure-pending] .stage-cutout { opacity: 0; }
.stage-art-pivot { transform: translate(var(--stage-x), calc(var(--stage-y) + var(--stage-scroll))); }
.stage-art {
  position: absolute;
  top: 2.5%;
  left: 14%;
  width: 75%;
  max-width: none;
  height: 130%;
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(-8px 5px 0 #07194385);
  transform: rotate(4deg);
}
.stage-art[data-mech-art]:not([data-mech-art="nemesis"]) {
  top: 4%;
  height: 115%;
  transform: rotate(1deg);
}
.stage-placard {
  position: absolute;
  z-index: 2;
  bottom: 7%;
  left: 3%;
  max-width: 82%;
  transform: rotate(-4deg);
  pointer-events: none;
}
.stage-placard small, .stage-placard strong, .stage-role {
  display: block;
  width: fit-content;
}
.stage-placard small {
  background: var(--stage-paper);
  padding: 3px 8px 4px;
  color: var(--stage-night);
  font: 700 10px/1.15 var(--body);
  text-transform: uppercase;
  letter-spacing: .065em;
}
.stage-placard strong {
  background: var(--stage-night);
  padding: 1px 15px 6px 8px;
  color: #fff;
  font: italic 800 clamp(32px, 4.1vw, 64px)/.95 var(--display);
  letter-spacing: -.015em;
}
.stage-role {
  background: #fff;
  padding: 4px 9px;
  color: var(--stage-night);
  font: 700 11px/1.2 var(--body);
}
.stage-reticle {
  position: absolute;
  z-index: 2;
  right: 5%;
  bottom: 17%;
  width: 20px;
  height: 20px;
  color: var(--stage-paper);
  transform: translate(calc(var(--stage-x) * -.65), calc(var(--stage-y) * -.65));
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
              linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
  pointer-events: none;
}
.stage-reel {
  position: absolute;
  top: 6%;
  right: 2%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 11px;
  background: #f6ffff;
  color: #081f52;
  border-bottom: 3px solid var(--stage-print);
  box-shadow: -4px 4px 0 var(--stage-night);
  font: 700 12px/1.3 var(--body);
  touch-action: manipulation;
}
.stage-reel > span:first-child { font: 12px/1 Arial,sans-serif; color: #1543bc; }
.stage-reel:hover { background: var(--stage-paper); }
.stage-desk {
  position: relative;
  z-index: 4;
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-width: 0;
  padding: 11px 13px 12px 22px;
  background: var(--stage-night);
  border-top: 2px solid var(--stage-paper);
  clip-path: polygon(11px 0,100% 0,100% 100%,0 100%,0 22px);
}
.stage-case-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: white;
}
.stage-case-link strong { font: italic 800 clamp(17px, 1.7vw, 26px)/1 var(--display); }
.stage-case-link > span { color: var(--stage-paper); font: 700 18px/1 Arial,sans-serif; }
.stage-case-link:hover { text-decoration: underline; }
.stage-controls[hidden] { display: none; }
.stage-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 7px; }
.stage-rotation {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 38px; min-height: 42px; padding: 0 8px; border: 0;
  background: transparent; color: #d2e8ff; font: 700 11px/1.3 var(--body); cursor: pointer;
}
.stage-rotation i { width: 10px; height: 12px; background: linear-gradient(90deg,currentColor 35%,transparent 35% 65%,currentColor 65%); }
.stage-rotation[data-paused] i { background: currentColor; clip-path: polygon(10% 0,100% 50%,10% 100%); }
.stage-rotation:hover, .stage-rotation:focus-visible { color: white; background: #213f79; }
.stage-rotation:focus-visible { outline-offset: -3px; }
.stage-rotation:disabled { opacity: .65; cursor: default; }
.stage-options { display: flex; gap: 2px; }
.stage-options button {
  display: inline-grid;
  place-items: center;
  position: relative;
  border: 0;
  color: #f7fcff;
  background: transparent;
  padding: 0 9px;
  min-height: 42px;
  min-width: 40px;
  touch-action: manipulation;
  font: 800 15px/1 var(--display);
}
.stage-options button:hover {
  color: var(--stage-paper);
  background: #213f79;
}
.stage-options button[aria-pressed="true"] {
  background: #fff;
  color: var(--stage-night);
  box-shadow: inset 0 -3px var(--stage-print);
}
.frame-hero[data-rotating] .stage-options [aria-pressed="true"]::after {
  content: ""; position: absolute; inset: auto 0 0; height: 3px; background: #1854ba;
  transform-origin: left; animation: stage-countdown 2s linear both;
}
@keyframes stage-countdown { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.stage-options button[data-loading] { box-shadow: inset 0 -3px var(--stage-print); }
.stage-options button:focus-visible { outline-offset: -3px; }
.stage-notice { width: 100%; font-size: 11px; color: #fff; }
.stage-notice[hidden] { display: none; }
.stage-shutter { z-index: 3; }
.stage-shutter i {
  position: absolute;
  inset: -17% -27%;
  background: #0a245d;
  transform: translateX(-160%) skewX(-18deg);
}
.stage-shutter i:nth-child(2) { background: var(--stage-paper); }
.stage-shutter i:nth-child(3) { background: var(--stage-field); }
@keyframes frame-press-entry {
  from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); transform: translateX(-12px); }
  to { clip-path: polygon(0 0, 115% 0, 100% 100%, 0 100%); transform: translateX(0); }
}
@keyframes frame-plate-entry {
  from { transform: translate(-25px, 7px) rotate(-8deg); opacity: .25; }
  to { transform: translate(0,0) rotate(-4deg); opacity: 1; }
}
@keyframes frame-orbit-entry {
  from { transform: rotate(-48deg) scale(.95); }
  to { transform: rotate(0) scale(1); }
}
@keyframes frame-print-pull {
  from { transform: translateX(0) skewX(-18deg); }
  to { transform: translateX(148%) skewX(-18deg); }
}
@keyframes frame-orbit-scan {
  from { transform: rotate(-50deg); }
  to { transform: rotate(310deg); }
}
html[data-chapter-flow="full"] .frame-hero h1 > span {
  animation: frame-press-entry .62s cubic-bezier(.14,.76,.19,1) both;
}
html[data-chapter-flow="full"] .frame-hero h1 > span + span { animation-delay: 80ms; }
html[data-chapter-flow="full"] .frame-hero .stage-orbit::before { animation: frame-orbit-entry 1.22s cubic-bezier(.13,.76,.16,1) backwards; }
html[data-chapter-flow="full"] .frame-hero .stage-placard { animation: frame-plate-entry .55s .16s cubic-bezier(.16,.78,.2,1) both; }
html[data-chapter-flow="full"] .frame-hero:not([data-engaged]) .stage-shutter i { animation: frame-print-pull .49s .12s cubic-bezier(.52,.03,.22,1) backwards; }
html[data-chapter-flow="full"] .frame-hero:not([data-engaged]) .stage-shutter i:nth-child(2) { animation-delay: 65ms; }
html[data-chapter-flow="full"] .frame-hero:not([data-engaged]) .stage-shutter i:nth-child(3) { animation-delay: 0s; }
html[data-chapter-flow="full"] .frame-hero .stage-needle {
  animation: frame-orbit-scan 9.6s linear infinite;
  animation-play-state: paused;
}
html[data-chapter-flow="full"] .frame-hero[data-scanning] .stage-needle { animation-play-state: running; }

@media (min-width: 1600px) {
  .frame-hero .stage-layout { min-height: min(690px, 77vh); }
}
@media (min-width: 681px) and (max-width: 990px) {
  .frame-hero .stage-layout { grid-template-columns: .94fr 1.06fr; min-height: 505px; }
  .frame-hero h1 { font-size: clamp(76px, 10.2vw, 104px); }
  .stage-bio { padding-right: 14px; }
  .stage-bio .actions { gap: 10px 14px; }
  .stage-bio .button { padding-inline: 13px; column-gap: 10px; }
  .stage-bio .text-button { column-gap: 8px; }
  .stage-desk { justify-content: start; gap: 0 12px; padding: 5px 10px 8px 16px; }
  .stage-rotation-label { display: none; }
  .stage-art { width: 87%; left: 8%; }
}
@media (max-width: 680px) {
  .frame-hero .stage-layout {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 52% minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "name figure" "desk desk" "bio bio";
  }
  .stage-identity { display: contents; }
  .stage-nameblock {
    position: relative;
    z-index: 2;
    grid-area: name;
    align-self: center;
    padding: 24px 0 20px 9.6%;
  }
  .stage-kicker { font-size: 9px; gap: 6px; letter-spacing: .07em; white-space: nowrap; }
  .stage-kicker::before { width: 15px; height: 3px; }
  .frame-hero h1 {
    font-size: clamp(49px, 15vw, 96px);
    margin: 15px 0 0;
    line-height: .77;
  }
  .stage-viewport { grid-area: figure; min-height: clamp(195px, 47vw, 274px); }
  .stage-orbit { width: 93%; top: 9%; left: 5%; }
  .stage-art { left: 4%; top: 13%; width: 96%; height: 112%; filter: drop-shadow(-3px 3px 0 #07194385); }
  .stage-art[data-mech-art]:not([data-mech-art="nemesis"]) { top: 13%; height: 108%; }
  .stage-code { font-size: clamp(52px, 13vw, 82px); bottom: 12%; left: 3%; }
  .stage-striation { top: 15%; width: 69%; }
  .stage-placard { left: 1%; bottom: 4%; }
  .stage-placard small { font-size: 8px; }
  .stage-placard strong { font-size: clamp(23px, 5vw, 32px); padding: 1px 9px 4px 6px; }
  .stage-role { font-size: 9px; padding: 3px 5px; }
  .stage-reticle { width: 10px; height: 10px; right: 7%; bottom: 12%; }
  .stage-reel { top: 4px; right: 5px; min-height: 29px; padding: 3px 7px; gap: 4px; font-size: 10px; border-bottom-width: 2px; box-shadow: -2px 2px 0 var(--stage-night); }
  .stage-reel > span:first-child { font-size: 9px; }
  .stage-bio { grid-area: bio; padding: 20px 5% 23px; max-width: none; }
  .stage-bio .role { font-size: clamp(19px, 4.6vw, 25px); }
  .stage-bio .hero-lede, html[lang^=zh] .stage-bio .hero-lede {
    width: auto; max-width: 41ch; margin-top: 9px; font-size: 14px; line-height: 1.6;
  }
  .stage-bio .actions { margin-top: 16px; gap: 15px; }
  .stage-bio .button, .stage-bio .text-button { gap: 10px; }
  .stage-bio .button { padding-inline: 14px; }
  .stage-backdrop i:first-child { clip-path: polygon(89% 0,100% 0,100% 100%,0 100%); }
  .stage-desk { grid-area: desk; min-height: 55px; gap: 0 8px; padding: 4px 4%; clip-path: none; }
  .stage-rotation-label { display: none; }
  .stage-rotation { min-width: 32px; padding-inline: 6px; }
  .stage-controls { gap: 2px; }
  .stage-options button { padding: 0 7px; min-height: 40px; }
}
@media (max-width: 355px) {
  .stage-nameblock { padding-left: 8%; }
  .frame-hero h1 { font-size: clamp(46px, 15vw, 53px); }
  .stage-desk { padding-inline: 3%; column-gap: 4px; }
  .stage-case-link { gap: 4px; }
  .stage-options button { font-size: 14px; padding-inline: 6px; }
}
@media (max-width: 680px) and (scripting: none) {
  .frame-hero .stage-layout {
    grid-template-areas: "name name" "bio bio" "figure figure" "desk desk";
    grid-template-rows: auto auto auto auto;
  }
  .stage-nameblock { padding: 24px 5% 0; }
  .stage-viewport { min-height: min(70vw,340px); }
}
html[data-motion="off"] .frame-hero *,
html[data-motion="off"] .frame-hero *::before,
html[data-motion="off"] .frame-hero *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) .frame-hero :where(*):not(.flow-word,.flow-row-ink,.flow-line,.flow-copy),
  html:not([data-motion="full"]) .frame-hero *::before, html:not([data-motion="full"]) .frame-hero *::after {
    animation: none !important;
    transition: none !important;
  }
}
