/* ============================================================
   Hero → Midnight Journey
   One pinned scene: existing typography globe morphs into WebGL.
   ============================================================ */

:root {
  --mj-bg: #030408;
  --mj-ink: #f2f4f8;
  --mj-ink-dim: #9aa3b2;
  --mj-accent-jp: #6c8cff;
  --mj-accent-lk: #ffb03a;
  --mj-accent: var(--mj-accent-lk);
  --mj-mono: "Outfit", ui-monospace, SFMono-Regular, Menlo, monospace;
  --mj-sans: "Outfit", "M PLUS 1p", sans-serif;
  --mj-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

#hero-journey-section {
  position: relative;
  width: 100%;
  height: 440vh;
  margin: 0;
  padding: 0;
  background: #fff;
  isolation: isolate;
}

.hero-journey-sticky {
  --planet-orbit-opacity: 0;
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
}

.hero-journey-sticky::after {
  content: "";
  position: absolute;
  left: 8%;
  top: 13%;
  z-index: 3;
  width: 84%;
  height: 68%;
  border: 1px solid rgba(126, 165, 235, 0.48);
  border-right-color: rgba(126, 165, 235, 0.08);
  border-bottom-color: rgba(126, 165, 235, 0.18);
  border-radius: 50%;
  opacity: var(--planet-orbit-opacity);
  transform: rotate(-15deg);
  pointer-events: none;
  will-change: opacity;
}

/* 3D Celestial Binary Orbit Plane */
.celestial-orbit-plane {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: var(--orbit-plane-opacity, 0);
  transform: perspective(1200px) rotateX(68deg) rotateY(-14deg) rotateZ(var(--orbit-plane-rot, 0deg));
  transform-origin: 50% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.orbit-ring-track {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orbit-ring-track--outer {
  width: min(1280px, 128vw);
  height: min(1280px, 128vw);
  border: 1.5px dashed rgba(100, 180, 255, 0.38);
  box-shadow:
    0 0 40px rgba(60, 140, 255, 0.25),
    inset 0 0 40px rgba(60, 140, 255, 0.15);
  animation: orbitTrackSpin 70s linear infinite;
}

.orbit-ring-track--inner {
  width: min(960px, 96vw);
  height: min(960px, 96vw);
  border: 1px solid rgba(255, 215, 120, 0.25);
  box-shadow: 0 0 30px rgba(255, 200, 80, 0.18);
  animation: orbitTrackSpin 50s linear infinite reverse;
}

.orbit-dust-node {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px 3px rgba(120, 210, 255, 0.95);
  pointer-events: none;
}

.orbit-dust-node--1 {
  top: 18%;
  left: 28%;
  opacity: 0.85;
}

.orbit-dust-node--2 {
  bottom: 24%;
  right: 26%;
  background: #ffe494;
  box-shadow: 0 0 14px 4px rgba(255, 215, 110, 0.9);
  opacity: 0.95;
}

.orbit-dust-node--3 {
  top: 50%;
  right: 10%;
  opacity: 0.7;
}

@keyframes orbitTrackSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#journey-dark-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  background:
    radial-gradient(circle at 50% 48%, rgba(21, 35, 58, 0.88) 0, rgba(8, 12, 22, 0.96) 48%, #030408 100%);
  background-color: #030408;
  transition: opacity 2.8s cubic-bezier(0.22, 1, 0.36, 1), background-color 2.8s ease;
  will-change: opacity, transform;
}

#journey-dawn-bloom {
  position: absolute;
  inset: -24%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(12%, 8%, 0) scale(.62);
  transform-origin: 68% 52%;
  background:
    radial-gradient(circle at 69% 49%, rgba(255, 255, 255, .98) 0 7%, rgba(220, 235, 255, .74) 16%, rgba(139, 177, 255, .36) 29%, rgba(44, 75, 148, .13) 44%, transparent 68%),
    radial-gradient(circle at 48% 62%, rgba(188, 211, 255, .28) 0, rgba(47, 77, 149, .13) 38%, transparent 70%),
    linear-gradient(135deg, rgba(10, 17, 40, .94) 0%, rgba(19, 36, 78, .78) 46%, rgba(92, 128, 197, .42) 72%, rgba(220, 235, 255, .2) 100%);
  will-change: opacity, transform;
  backface-visibility: hidden;
}

#stage-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: none;
  touch-action: pan-y;
  will-change: opacity;
}

#stage-canvas.is-active {
  pointer-events: none;
}

#stage-canvas.is-active.is-dragging { cursor: grabbing; }

#grain-overlay,
#vignette-overlay,
#scanline-overlay {
  position: absolute;
  pointer-events: none;
  opacity: 0.8;
}

#grain-overlay {
  inset: -50%;
  z-index: 4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='220' height='220' filter='url(%23n)' opacity='.55'/></svg>");
  animation: mj-grain-shift 0.7s steps(4) infinite;
}

#vignette-overlay {
  inset: 0;
  z-index: 5;
  background: radial-gradient(120% 100% at 50% 45%, transparent 38%, rgba(0, 0, 0, 0.55) 78%, rgba(0, 0, 0, 0.88) 100%);
}

#scanline-overlay {
  inset: 0;
  z-index: 6;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.05) 0 1px, transparent 1px 3px);
}

@keyframes mj-grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -2%); }
  100% { transform: translate(3%, 3%); }
}

#hero-initial-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  will-change: opacity;
}

#hero-initial-layer #hero-section {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: transparent;
}

#hero-initial-layer .hero-copy {
  will-change: opacity, transform, filter;
}

#hero-initial-layer .hero-morph-globe-wrap {
  --new-planet-progress: 0;
  --new-planet-glow: 0;
  --new-planet-glow-scale: .72;
  position: relative;
  height: 100%;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
}

#hero-initial-layer .hero-morph-globe-wrap::before {
  content: "";
  position: absolute;
  inset: 8%;
  z-index: 0;
  pointer-events: none;
  opacity: var(--new-planet-glow);
  transform: scale(var(--new-planet-glow-scale));
  background: radial-gradient(circle, rgba(63, 126, 255, .24) 0, rgba(44, 93, 216, .13) 34%, rgba(26, 52, 130, .04) 58%, transparent 74%);
  will-change: opacity, transform;
}

#hero-initial-layer .typography-globe,
.hero-globe-wrap .typography-globe,
.typography-globe {
  opacity: 1 !important;
  filter: none !important;
  clip-path: none !important;
  visibility: visible !important;
  display: block !important;
}

#typography-globe-canvas {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

:root {
  --mj-ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --mj-ease-dissolve: cubic-bezier(0.4, 0, 0.2, 1);
}

#hero-stage {
  position: absolute;
  inset: 0;
  z-index: 15;
  overflow: hidden;
  color: var(--mj-ink);
  font-family: var(--mj-sans);
  opacity: 1;
  pointer-events: none;
  will-change: opacity;
}

#hero-stage.is-visible { opacity: 1; }

/* Top Telemetry Bar & Frameless Skip Button */
.hero-stage-topbar {
  position: absolute;
  top: clamp(18px, 3.2vh, 32px);
  left: clamp(20px, 3.5vw, 56px);
  right: clamp(20px, 3.5vw, 56px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.skip-universe-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 8px 4px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--mj-sans, "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", sans-serif);
  font-size: clamp(12px, 1.0vw, 13px);
  font-weight: 500;
  letter-spacing: 0.14em;
  cursor: pointer;
  pointer-events: auto;
  text-decoration: none;
  transition: color 0.28s ease, opacity 0.28s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.skip-universe-btn::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  height: 1px;
  background: rgba(255, 255, 255, 0.65);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.skip-universe-btn:hover {
  color: #ffffff;
}

.skip-universe-btn:hover::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.skip-universe-btn .skip-btn-text {
  display: inline-block;
  line-height: 1;
}

.skip-universe-btn .skip-btn-icon {
  display: inline-block;
  stroke: currentColor;
  transform: translateY(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.skip-universe-btn:hover .skip-btn-icon {
  transform: translateY(2.5px);
}

/* Left Flank Telemetry */
.hero-telemetry-left {
  position: absolute;
  left: clamp(20px, 3.5vw, 56px);
  top: clamp(76px, 11vh, 130px);
  width: min(480px, 88vw);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  pointer-events: none;
}

.telemetry-header-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 6px;
}

.telemetry-badge {
  font-family: var(--mj-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #ffffff;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0;
  background: rgba(5, 8, 22, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.telemetry-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.hero-country {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 4px 0 10px;
  line-height: 0.95;
  overflow: hidden;
}

.country-word-wrap {
  display: block;
  overflow: hidden;
}

.country-word {
  display: block;
  color: #ffffff;
  font-family: var(--mj-sans, "Outfit", sans-serif);
  font-size: clamp(48px, 6.5vw, 96px);
  font-weight: 800;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.95);
  transition: opacity 2.4s var(--mj-ease-cinematic), transform 2.4s var(--mj-ease-cinematic), letter-spacing 3.2s var(--mj-ease-cinematic);
}

.country-word.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  letter-spacing: 0.04em;
}

.country-word.is-out {
  opacity: 0;
  transform: translate3d(0, -14px, 0);
  letter-spacing: 0.08em;
  transition: opacity 1.6s var(--mj-ease-dissolve), transform 1.6s var(--mj-ease-dissolve);
}

.country-native-wrap {
  display: block;
  overflow: hidden;
}

.country-native {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(14px, 1.25vw, 19px);
  font-weight: 400;
  letter-spacing: 0.22em;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 2s var(--mj-ease-cinematic) 0.2s, transform 2s var(--mj-ease-cinematic) 0.2s;
}

.country-native.is-in {
  opacity: 0.88;
  transform: translate3d(0, 0, 0);
}

.country-native.is-out {
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  transition: opacity 1.4s var(--mj-ease-dissolve);
}

.hero-kicker {
  margin: 2px 0 6px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 400;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9);
  transition: opacity 2s var(--mj-ease-cinematic) 0.3s, transform 2s var(--mj-ease-cinematic) 0.3s;
}

.hero-kicker.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.kicker-strong {
  color: #ffffff;
  font-weight: 600;
}

/* Bottom 3-Step Straight-Line Telemetry Grid */
.hero-mission-steps {
  position: absolute;
  left: clamp(20px, 3.5vw, 56px);
  right: clamp(20px, 3.5vw, 56px);
  bottom: clamp(20px, 3.2vh, 36px);
  z-index: 20;
  pointer-events: auto;
  border-radius: 0;
}

.mission-steps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.steps-label {
  font-family: var(--mj-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  white-space: nowrap;
}

.steps-progress-track {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.steps-progress-seeker {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 33.33%;
  background: #ffffff;
  box-shadow: 0 0 10px #ffffff, 0 0 20px #38bdf8;
  transition: left 0.8s var(--mj-ease-cinematic), width 0.8s var(--mj-ease-cinematic);
}

.mission-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  background: rgba(5, 8, 22, 0.68);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.step-node {
  padding: clamp(12px, 1.5vh, 18px) clamp(12px, 1.5vw, 20px);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  opacity: 0.38;
  text-align: left;
  transition: opacity 0.8s var(--mj-ease-cinematic), background 0.8s var(--mj-ease-cinematic);
  cursor: pointer;
}

.step-node:last-child {
  border-right: none;
}

.step-node:hover {
  opacity: 0.75;
}

.step-node.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

.step-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.step-node-num {
  font-family: var(--mj-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #ffffff;
}

.step-node.is-active .step-node-num {
  color: #38bdf8;
}

.step-node-category {
  font-family: var(--mj-mono, monospace);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
}

.step-node-title {
  font-family: var(--mj-sans, "Outfit", sans-serif);
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px;
  line-height: 1.2;
}

.step-node-desc {
  font-size: clamp(11px, 0.82vw, 12.5px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

/* Header is completely hidden during the Universe First opening screen */
.site-header,
#site-header,
header.site-header {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate3d(0, -100%, 0) !important;
  transition: opacity 0.5s ease, transform 0.5s ease !important;
}

/* Header ONLY appears when scrolling into the white corporate section */
.site-header.is-visible-header,
#site-header.is-visible-header,
header.site-header.is-visible-header {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translate3d(0, 0, 0) !important;
}

@media (max-width: 1024px) {
  #hero-journey-section { height: 400vh; }
  .hero-mission-steps {
    bottom: 24px;
    left: 24px;
    right: 24px;
  }
}

@media (max-width: 900px) {
  #hero-journey-section { height: 380vh; }

  #hero-initial-layer #hero-section {
    height: 100%;
    min-height: 100%;
  }

  #hero-initial-layer .hero-morph-globe-wrap {
    height: auto;
  }

  .hero-telemetry-left {
    top: clamp(60px, 9vh, 90px);
    width: calc(100% - 40px);
    max-width: 100%;
  }

  .country-word {
    font-size: clamp(38px, 9vw, 64px);
  }

  .mission-steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .step-node-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .hero-stage-topbar {
    top: 14px;
    left: 16px;
    right: 16px;
  }

  .hero-telemetry-left {
    left: 16px;
    right: 16px;
    top: 56px;
  }

  .hero-mission-steps {
    left: 12px;
    right: 12px;
    bottom: 14px;
  }

  .mission-steps-grid {
    grid-template-columns: 1fr;
  }

  .step-node {
    display: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 14px;
  }

  .step-node:last-child {
    border-bottom: none;
  }

  .step-node.is-active {
    display: block;
  }

  .step-node-desc {
    -webkit-line-clamp: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  #hero-journey-section { height: 220vh; }
  #grain-overlay { display: none; }
  #scanline-overlay { opacity: .03; }
  #hero-stage,
  .hero-kicker,
  .country-word,
  .country-native,
  .step-node,
  .steps-progress-seeker { transition: none !important; animation: none !important; }
}

