/* Glass cartography, Karaoke's pitch roll and the 5.0 wing rig. */
.hero-track {
  --mast-height: 4.5rem;
  --stage-width: clamp(82rem, calc(60vw + 10rem), 150rem);
  --flight: clamp(22rem, 64svh, 40rem);
  background: var(--stage-base);
  border-bottom: var(--border-width) solid var(--disc-line);
}
.hero-track::after { content: ""; display: block; height: var(--flight); }
.hero {
  display: grid; grid-template-rows: auto minmax(6.25rem, 1fr);
  min-height: calc(100svh - var(--mast-height));
  position: sticky;
  top: min(var(--mast-height), calc(100svh - var(--hero-height, 0px)));
  isolation: isolate;
  overflow: clip;
  background: radial-gradient(ellipse at 76% 44%, var(--stage-edge), transparent 57%),
    linear-gradient(110deg, var(--color-bg) 15%, var(--stage-base) 56%, var(--stage-blue));
}
.hero__inside {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: center;
  width: min(100% - 2 * var(--space-5), var(--stage-width));
  min-height: clamp(34rem, calc(100svh - var(--mast-height) - 9rem), calc(var(--stage-width) * .55));
  margin-inline: auto;
}
.hero__copy { z-index: 2; padding: var(--space-5) 0 var(--space-6); }
.hero__role, .screen__head, .guide__speech strong {
  font: 650 var(--text-xs)/1.4 var(--font-mono);
  letter-spacing: .12em;
}
.hero__role { display: flex; align-items: center; gap: var(--space-2); text-transform: uppercase; color: var(--color-primary-deep); }
.hero__role::before { content: ""; width: 2.25em; height: .17em; background: currentColor; }
.hero__hello { color: var(--color-muted); margin-top: clamp(1rem, 3svh, 2rem); font-size: var(--text-lg); }
.hero h1 { margin-block: .2em .22em; font-size: clamp(4rem, 7.8vw, calc(var(--stage-width) * .095)); font-weight: 700; letter-spacing: -.085em; line-height: .93; }
.hero h1 span, .hero h1 strong { display: block; }
.hero h1 strong { color: var(--color-primary-deep); font-weight: inherit; }
:lang(ja) .hero h1, :lang(zh) .hero h1 { line-height: 1.05; letter-spacing: -.04em; }
.hero__description { max-width: 32rem; color: var(--color-muted); line-height: 1.65; }
.hero .button, .live-action { border-radius: var(--radius); }
.hero .ghost { color: var(--color-fg); background: var(--color-surface-raised); border-color: var(--color-border); }
.hero .ghost:hover { border-color: var(--color-secondary); }
.hero__scene {
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  align-self: end;
  width: 100%;
  aspect-ratio: 1.205;
}
/* The six coastline tiles join at their cube edges. Only the fine rear
   edges show through the glass, keeping the far shore from reading backwards. */
.cube-globe {
  --face-size: 53cqw;
  --half-face: calc(var(--face-size) / 2);
  --etch: color-mix(in srgb, var(--color-secondary-strong) 64%, var(--disc-line));
  --rim: color-mix(in srgb, var(--etch) 58%, transparent);
  position: absolute; left: calc(53% - var(--half-face)); top: calc(41cqw - var(--half-face));
  width: var(--face-size); aspect-ratio: 1; perspective: 200cqw; pointer-events: none;
}
.cube-globe__rotor {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateZ(-7deg) rotateX(-17deg) rotateY(-34deg);
}
.cube-globe__face {
  position: absolute; inset: 0; transform-style: preserve-3d;
  outline: var(--border-width) solid color-mix(in srgb, var(--rim) 34%, transparent);
  transform: var(--turn) translateZ(var(--half-face));
}
.cube-globe__face::before, .cube-globe__face::after {
  content: ""; position: absolute; inset: 0; backface-visibility: hidden;
}
.cube-globe__face::before {
  border: var(--border-width) solid var(--rim);
  background: linear-gradient(130deg, color-mix(in srgb, var(--crystal-cyan) 22%, transparent),
    color-mix(in srgb, var(--color-surface-raised) 18%, transparent) 52%,
    color-mix(in srgb, var(--crystal-rose) 16%, transparent));
  box-shadow: inset 0 0 2.5cqw color-mix(in srgb, var(--color-surface-raised) 40%, transparent);
}
.cube-globe__face::after {
  background: var(--etch); transform: translateZ(.1px);
  mask: url("/assets/world-cube.webp") var(--tile) / 300% 200% no-repeat;
}
.cube-globe__face[data-face="front"] { --turn: rotateY(0deg); --tile: 0% 0%; }
.cube-globe__face[data-face="east"]  { --turn: rotateY(90deg); --tile: 50% 0%; }
.cube-globe__face[data-face="back"]  { --turn: rotateY(180deg); --tile: 100% 0%; }
.cube-globe__face[data-face="west"]  { --turn: rotateY(-90deg); --tile: 0% 100%; }
.cube-globe__face[data-face="north"] { --turn: rotateX(90deg); --tile: 50% 100%; }
.cube-globe__face[data-face="south"] { --turn: rotateX(-90deg); --tile: 100% 100%; }
.cube-globe__face[data-face="east"]::after {
  background: radial-gradient(ellipse 24% 20% at 45% 63%,
    color-mix(in srgb, var(--color-primary-deep) 58%, var(--etch)) 48%, var(--etch));
}
.performer {
  position: absolute; z-index: 2; width: 108%; aspect-ratio: 5/6; left: -1%; top: 4%; pointer-events: none;
  filter: drop-shadow(0 .5rem .8rem color-mix(in srgb, var(--stage-ink) 14%, transparent));
}
/* All three instruments share an origin. At the middle keyframe the units
   dock on a single vertical edge and lose their perspective tilt together. */
.dock {
  --pose: dock-flight; position: absolute; left: 2.4cqw; top: calc(24.7cqw + var(--dock-offset, 0cqw));
  width: 29.2cqw; height: 43cqw; z-index: 2; opacity: 0;
  border: var(--border-width) solid var(--disc-line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--stage-blue), var(--stage-edge));
  box-shadow: inset .25cqw 0 var(--crystal-cyan), inset -.25cqw 0 var(--crystal-rose);
}
@keyframes dock-flight {
  0%, 31%, 71%, 100% { opacity: 0; transform: scale(.86,.04); }
  46%, 58% { opacity: 1; transform: scale(1); }
}
.screen { position: absolute; left: 0; top: 0; width: 28cqw; z-index: 3; font-size: clamp(.54rem, 1.65cqw, .82rem); pointer-events: none; }
.screen__surface {
  overflow: hidden; border: var(--border-width) solid color-mix(in srgb, var(--screen-muted) 64%, transparent);
  border-radius: var(--radius); color: var(--screen-fg); background: var(--stage-ink);
  box-shadow: 0 .75em 2em color-mix(in srgb, var(--stage-ink) 25%, transparent);
}
.screen__head {
  display: flex; align-items: center; gap: .6em; padding: .55em .8em; font-size: .86em; letter-spacing: .035em;
  border-bottom: var(--border-width) solid color-mix(in srgb, var(--screen-muted) 24%, transparent);
}
.screen__head .icon { width: 1.1em; height: 1.1em; color: var(--crystal-cyan); }
.screen__head i { margin-left: auto; width: .5em; height: .5em; border: 1px solid var(--crystal-rose); border-radius: 50%; }
.screen__queue { padding: .48em .7em; }
.queue-row, .recording { display: flex; align-items: center; gap: .55em; }
.queue-row { padding-block: .16em; }
.queue-row img { display: block; width: 2.1em; height: 1.48em; border-radius: .23em; object-fit: cover; }
.queue-row b, .recording b { font-size: .94em; line-height: 1.25; }
.queue-row i { margin-left: auto; width: .8em; height: .65em; background: repeating-linear-gradient(90deg, var(--crystal-cyan) 0 18%, transparent 18% 39%); }
.screen--pitch .screen__surface { background: color-mix(in srgb, var(--stage-ink) 89%, var(--crystal-cyan)); }
.pitch-roll { position: relative; height: 6.35cqw; margin: .55em .8em;
  background: repeating-linear-gradient(0deg, transparent 0 23%, color-mix(in srgb, var(--screen-muted) 27%, transparent) 24% 25%),
    repeating-linear-gradient(90deg, transparent 0 9.3%, color-mix(in srgb, var(--screen-muted) 17%, transparent) 9.4% 10%);
}
.pitch-roll span { position: absolute; width: 14%; height: 8%; top: 70%; left: 1%; border-radius: var(--radius-pill); background: var(--crystal-cyan); }
.pitch-roll span:nth-child(2) { left: 16%; top: 53%; width: 20%; }
.pitch-roll span:nth-child(3) { left: 37%; top: 32%; width: 10%; }
.pitch-roll span:nth-child(4) { left: 48%; top: 15%; width: 21%; }
.pitch-roll span:nth-child(5) { left: 70%; top: 32%; width: 14%; background: var(--crystal-rose); }
.pitch-roll span:nth-child(6) { left: 85%; top: 52%; background: var(--crystal-rose); }
.pitch-roll i { position: absolute; inset-block: 0; left: 52%; border-left: var(--border-width) solid var(--screen-fg); box-shadow: 0 0 .5em var(--crystal-cyan); }
.recording { padding: .65em .8em; }
.recording img { width: 31%; aspect-ratio: 1.25; border-radius: .35em; object-fit: cover; }
.recording small { display: block; font: .85em var(--font-mono); color: var(--screen-muted); margin-top: .3em; }

/* Paused one-second animations form a seekable clock, including on mobile.
   Static transforms double as the reduced-motion composition. */
.screen--queue { transform: translate(var(--queue-start, 0cqw), 29cqw) rotate(-6deg); }
.screen--pitch { transform: translate(71cqw, 11cqw) rotate(6deg); }
.screen--song { transform: translate(70cqw, var(--song-start, 62cqw)) rotate(-4deg); }
@media (prefers-reduced-motion: no-preference) {
  .scrub { animation: var(--pose) 1s linear both paused; }
  .cube-globe { --pose: globe-drift; }
  .cube-globe__rotor { animation: globe-spin 96s linear infinite; }
  .performer { --pose: guide-flight; }
  .wing--cyan { --pose: left-flight; }
  .wing--rose { --pose: right-flight; }
  .screen--queue { --pose: queue-flight; }
  .screen--pitch { --pose: pitch-flight; }
  .screen--song { --pose: song-flight; }
  .screen__surface { animation: popup .72s var(--ease-out) .1s backwards; }
  .screen--pitch .screen__surface { animation-delay: .26s; }
  .screen--song .screen__surface { animation-delay: .42s; }
  .pitch-roll i { animation: scan 2.75s linear .7s 2; }
}
@keyframes popup {
  from { opacity: 0; clip-path: inset(46% 42% round .5em); transform: translateY(1em) scale(.88); }
  55% { opacity: 1; clip-path: inset(0 4% round .5em); }
  to { clip-path: inset(0 round .5em); transform: none; }
}
@keyframes scan { 0% { left: 4%; } 100% { left: 98%; } }
@keyframes globe-drift { from { transform: none; } to { transform: translate(4%, -5%) scale(1.06); } }
@keyframes globe-spin {
  from { transform: rotateZ(-7deg) rotateX(-17deg) rotateY(-34deg); }
  to { transform: rotateZ(-7deg) rotateX(-17deg) rotateY(-394deg); }
}
@keyframes guide-flight { 0% { transform: translate(0,0); } 46%, 57% { transform: translate(6%, -1.8%) scale(.96); } 100% { transform: translate(-2%, 5%) scale(1.06); } }
@keyframes left-flight {
  0% { transform: perspective(80cqw) rotateY(-9deg) rotate(-5deg); }
  40% { transform: perspective(80cqw) rotateY(-73deg) rotate(11deg); }
  65% { transform: perspective(80cqw) rotateY(12deg) rotate(2deg); }
  100% { transform: perspective(80cqw) rotateY(36deg) rotate(14deg) translateY(-4%); }
}
@keyframes right-flight {
  0% { transform: perspective(80cqw) rotateY(12deg) rotate(3deg); }
  47% { transform: perspective(80cqw) rotateY(78deg) rotate(-12deg); }
  70% { transform: perspective(80cqw) rotateY(-11deg) rotate(-3deg); }
  100% { transform: perspective(80cqw) rotateY(-34deg) rotate(-17deg) translateY(-5%); }
}
@keyframes queue-flight {
  0% { transform: translate(var(--queue-start, 0cqw), 29cqw) perspective(60cqw) rotateY(15deg) rotate(-6deg); }
  46%, 58% { transform: translate(3cqw, calc(38cqw + var(--dock-offset, 0cqw))) scale(.95); }
  100% { transform: translate(-5cqw, 56cqw) perspective(60cqw) rotateY(30deg) rotate(-13deg) scale(.87); }
}
@keyframes pitch-flight {
  0% { transform: translate(71cqw, 11cqw) perspective(60cqw) rotateY(-16deg) rotate(6deg); }
  23% { transform: translate(37cqw, 0cqw) perspective(60cqw) rotateY(-10deg) rotate(-3deg) scale(.91); }
  46%, 58% { transform: translate(3cqw, calc(25cqw + var(--dock-offset, 0cqw))) scale(.95); }
  80% { transform: translate(48cqw, -3cqw) rotate(4deg); }
  100% { transform: translate(77cqw, 3cqw) perspective(60cqw) rotateY(-32deg) rotate(13deg) scale(.82); }
}
@keyframes song-flight {
  0% { transform: translate(70cqw, var(--song-start, 62cqw)) perspective(60cqw) rotateY(-8deg) rotate(-4deg); }
  46%, 58% { transform: translate(3cqw, calc(53cqw + var(--dock-offset, 0cqw))) scale(.95); }
  100% { transform: translate(76cqw, var(--song-end, 70cqw)) perspective(60cqw) rotateY(-24deg) rotate(10deg) scale(.86); }
}

@media (max-width: 64rem) {
  .hero-track { --mast-height: 5.75rem; }
  .hero__inside { grid-template-columns: .85fr 1.15fr; min-height: 30rem; width: calc(100% - 2 * var(--space-3)); }
}
@media (max-width: 48rem) {
  .hero-track { --flight: clamp(11rem, 31svh, 18rem); }
  .hero { display: flex; flex-direction: column; min-height: calc(100svh - var(--mast-height)); }
  .hero__inside { width: 100%; min-height: 0; flex: 1; display: flex; flex-direction: column-reverse; }
  .hero__scene { width: min(100%, 29rem); align-self: center; aspect-ratio: 1.42; --dock-offset: -4cqw; --queue-start: 2cqw; }
  .performer { width: 95%; left: 6%; top: 3%; }
  .cube-globe { --face-size: 48cqw; top: calc(36cqw - var(--half-face)); }
  .screen--song { --song-start: 49cqw; --song-end: 58cqw; }
  .hero__copy { position: relative; flex: 1; width: 100%; padding: clamp(1rem, 3svh, 1.75rem) var(--space-4) var(--space-4); background: linear-gradient(var(--stage-base), var(--color-bg)); border-top: var(--border-width) solid var(--disc-line); }
  .hero__role { font-size: .7rem; }
  .hero__hello { margin-top: var(--space-2); font-size: var(--text-md); }
  .hero h1 { font-size: clamp(2.5rem, 10.8vw, 4.2rem); letter-spacing: -.075em; }
  .hero h1 span, .hero h1 strong { display: inline; }
  :lang(en) .hero h1 span::after { content: " "; }
  .actions, .social-links { margin-top: var(--space-3); }

}
@media (max-height: 35rem) {
  .hero-track { --flight: 8rem; }
  .hero { top: min(0px, calc(100svh - var(--hero-height, 0px))); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-track { --flight: 0rem; }
  .hero { position: relative; top: auto; }
}
