/*
Theme Name: MoonToTop Final Scroll
Theme URI: https://moontotop.xyz/
Author: MoonToTop
Description: Scroll-driven 3D Earth-to-Moon homepage for MoonToTop AI Studio.
Version: 7.1.1
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Text Domain: moontotop-final-scroll
*/

:root {
  --bg: #01060a;
  --text: #f8fbff;
  --muted: rgba(248, 251, 255, 0.86);
  --soft: rgba(248, 251, 255, 0.66);
  --dim: rgba(248, 251, 255, 0.38);
  --cyan: #63edff;
  --cyan-soft: rgba(99, 237, 255, 0.64);
  --rail-progress: 0;
  --page-x: clamp(22px, 5vw, 84px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  margin-top: 0 !important;
  overflow-x: clip;
  background: #000;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: #000;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.admin-bar {
  margin-top: 0 !important;
}

#wpadminbar {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px var(--page-x) 0;
  pointer-events: none;
}

.site-header a,
.site-header button {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  color: var(--text);
  text-shadow: 0 16px 42px rgba(0, 0, 0, 0.82);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.78);
}

.brand-mark svg {
  display: block;
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.1;
}

.brand > span:last-child {
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  font-weight: 540;
  white-space: nowrap;
}

.brand b {
  color: var(--cyan);
  font-weight: 540;
}

.top-nav {
  display: inline-flex;
  align-items: center;
  gap: 23px;
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 16px 42px rgba(0, 0, 0, 0.82);
}

.top-nav a {
  opacity: 0.94;
}

.top-nav i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
}

.menu-button {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  border: 1px solid rgba(99, 237, 255, 0.78);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
}

.menu-button span {
  display: block;
  width: 14px;
  height: 1px;
  margin: 2px 0;
  background: currentColor;
}

.section-rail {
  position: fixed;
  z-index: 38;
  top: 19vh;
  bottom: 8vh;
  left: clamp(14px, 1.35vw, 24px);
  width: 100px;
  pointer-events: none;
}

.rail-line {
  position: absolute;
  top: 78px;
  bottom: 150px;
  left: 10px;
  width: 1px;
  background: rgba(255, 255, 255, 0.3);
}

.rail-line::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, var(--cyan), rgba(99, 237, 255, 0.76), rgba(99, 237, 255, 0.2));
  box-shadow: 0 0 14px rgba(99, 237, 255, 0.78);
  transform: scaleY(var(--rail-progress));
  transform-origin: top;
}

.rail-item {
  position: absolute;
  left: 0;
  display: grid;
  gap: 5px;
  min-width: 94px;
  padding-left: 18px;
  opacity: 0.46;
  color: var(--soft);
  pointer-events: auto;
  text-shadow: 0 14px 35px rgba(0, 0, 0, 0.86);
  transition: opacity 220ms ease, transform 220ms ease;
}

.rail-item::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 77px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(99, 237, 255, 0.9);
}

.rail-item strong {
  color: var(--cyan);
  font-size: 29px;
  line-height: 0.92;
  font-weight: 520;
}

.rail-item span {
  color: rgba(255, 255, 255, 0.79);
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-item em {
  color: var(--soft);
  font-size: 11px;
  line-height: 1;
  font-style: normal;
}

.rail-item.is-active {
  opacity: 1;
  transform: translateX(2px);
}

.rail-begin {
  top: 0;
}

.rail-about {
  top: calc(50% - 44px);
}

.rail-projects {
  bottom: 4vh;
}

.scroll-sign {
  position: fixed;
  z-index: 36;
  top: 52vh;
  right: clamp(24px, 3vw, 52px);
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--soft);
  pointer-events: none;
  transition: opacity 180ms ease;
}

.scroll-sign.is-hidden {
  opacity: 0;
}

.scroll-sign span {
  position: relative;
  display: block;
  width: 25px;
  height: 39px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 15px;
}

.scroll-sign i {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--text);
  animation: scroll-dot 1.7s ease-in-out infinite;
}

.scroll-sign b {
  font-size: 12px;
  font-weight: 400;
}

.scroll-sign em {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 11px rgba(99, 237, 255, 0.92);
}

@keyframes scroll-dot {
  0%,
  100% {
    opacity: 0.48;
    transform: translate(-50%, 0);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, 14px);
  }
}

.journey {
  position: relative;
  min-height: 300vh;
  background: #000;
}

.journey-stage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #010509;
  isolation: isolate;
}

.star-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 70% 4%, rgba(255, 255, 255, 0.34) 0 1px, transparent 1.4px),
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1.4px),
    radial-gradient(circle at 58% 21%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1.4px),
    radial-gradient(circle at 46% 10%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1.4px),
    radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.24) 0 1px, transparent 1.4px),
    radial-gradient(circle at 31% 68%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1.4px),
    radial-gradient(circle at 90% 62%, rgba(255, 255, 255, 0.25) 0 1px, transparent 1.4px),
    radial-gradient(circle at 63% 10%, rgba(160, 210, 255, 0.12), transparent 16%),
    radial-gradient(circle at 52% 73%, rgba(255, 255, 255, 0.07), transparent 19%),
    linear-gradient(90deg, #01070b 0%, #02080e 46%, #020407 100%);
  background-size: 233px 191px, 311px 257px, 389px 313px, 431px 349px, 503px 397px, 557px 463px, 617px 521px, 100% 100%, 100% 100%, 100% 100%;
}

.space-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 1;
  transition: opacity 300ms ease;
}

.space-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.mtas-loading .space-canvas {
  opacity: 0.01;
}

.stage-shade {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.32), transparent 24%, transparent 68%, rgba(0, 0, 0, 0.74)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.46), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.5));
}

.lunar-surface {
  position: absolute;
  z-index: 6;
  left: -8vw;
  right: -8vw;
  bottom: -8vh;
  height: 34vh;
  min-height: 250px;
  border-radius: 50% 50% 0 0 / 18% 18% 0 0;
  opacity: 0;
  transform: translate3d(-34vw, 16vh, 0) perspective(980px) rotateX(55deg);
  transform-origin: bottom;
  background-image:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.62), rgba(185, 191, 194, 0.56) 14%, rgba(50, 52, 55, 0.88) 58%, rgba(0, 0, 0, 0.98) 100%),
    radial-gradient(circle at 18% 40%, rgba(0, 0, 0, 0.42) 0 2.1%, transparent 2.4%),
    radial-gradient(circle at 38% 44%, rgba(0, 0, 0, 0.4) 0 1.8%, transparent 2.2%),
    radial-gradient(circle at 63% 36%, rgba(0, 0, 0, 0.48) 0 2.3%, transparent 2.8%),
    radial-gradient(circle at 79% 47%, rgba(0, 0, 0, 0.38) 0 1.7%, transparent 2.2%),
    url("assets/moon_1024.jpg");
  background-size: 100% 100%, 420px 180px, 510px 190px, 620px 210px, 480px 180px, 380px 190px;
  background-position: center top, 0 20px, 70px 44px, 30px 18px, 120px 60px, center top;
  filter: grayscale(1) contrast(1.28) brightness(0.95);
  box-shadow: inset 0 26px 65px rgba(255, 255, 255, 0.18), 0 -18px 65px rgba(255, 255, 255, 0.08);
  will-change: opacity, transform;
}

.earth-ghost {
  position: absolute;
  z-index: 7;
  right: 7.2vw;
  bottom: 29vh;
  width: min(12vw, 188px);
  min-width: 142px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  transform: translate3d(10vw, 4vh, 0) scale(0.82);
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.55), transparent 0 25%, transparent 50%),
    radial-gradient(circle at 30% 68%, rgba(0, 0, 0, 0.62), transparent 0 44%, rgba(0, 0, 0, 0.88) 74%),
    url("assets/earth_atmos_2048.jpg");
  background-size: 100% 100%, 100% 100%, 145% 72%;
  background-position: center, center, 54% 50%;
  box-shadow: inset -24px -14px 55px rgba(0, 0, 0, 0.84), 0 0 18px rgba(122, 214, 255, 0.16);
  pointer-events: none;
  will-change: opacity, transform;
}

.copy,
.project-map {
  position: absolute;
  z-index: 12;
  will-change: opacity, transform;
}

.copy {
  text-shadow: 0 16px 45px rgba(0, 0, 0, 0.86);
}

.copy-hero {
  left: 47vw;
  top: 45.8vh;
  width: min(37vw, 510px);
  transform: translate3d(0, -50%, 0);
  text-align: center;
}

.copy-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(38px, 3.1vw, 56px);
  line-height: 1.02;
  font-weight: 430;
}

.copy-hero p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.05vw, 17px);
  line-height: 1.45;
}

.cyan-stem,
.section-stroke {
  display: block;
  background: var(--cyan);
  box-shadow: 0 0 13px rgba(99, 237, 255, 0.76);
}

.cyan-stem {
  width: 1px;
  height: 44px;
  margin: 19px auto 0;
}

.section-stroke {
  width: 24px;
  height: 2px;
  margin: 0 0 20px;
}

.copy-about {
  top: 21vh;
  right: 8.6vw;
  width: min(27vw, 390px);
  opacity: 0;
  transform: translate3d(54px, 22px, 0);
}

.copy-projects {
  top: 18vh;
  left: 64vw;
  width: min(30vw, 450px);
  opacity: 0;
  transform: translate3d(72px, 24px, 0);
}

.copy h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(31px, 2.25vw, 40px);
  line-height: 1.05;
  font-weight: 400;
}

.copy > p {
  max-width: 345px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.copy-projects > p {
  max-width: 390px;
}

.focus-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 29px;
  margin-top: 29px;
}

.focus-row article {
  min-width: 0;
}

.focus-row span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  color: var(--text);
}

.focus-row svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.focus-row h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.1;
  font-weight: 620;
}

.focus-row p {
  margin: 6px 0 0;
  color: var(--soft);
  font-size: 10px;
  line-height: 1.2;
}

.project-map {
  left: 38vw;
  right: 8vw;
  bottom: 9vh;
  height: 204px;
  opacity: 0;
  transform: translate3d(16vw, 7vh, 0);
}

.project-pin {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 210px;
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 14px 36px rgba(0, 0, 0, 0.95), 0 0 18px rgba(0, 0, 0, 0.9);
}

.project-pin > span {
  display: block;
  order: 3;
  width: 1px;
  height: 82px;
  margin: 15px auto 0;
  background: linear-gradient(to bottom, rgba(99, 237, 255, 0.08), rgba(99, 237, 255, 0.58), var(--cyan));
  box-shadow: 0 0 12px rgba(99, 237, 255, 0.74);
}

.project-pin > span::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 80px 0 0 -3px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 13px rgba(99, 237, 255, 0.92);
}

.project-pin h3 {
  order: 1;
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 430;
}

.project-pin p {
  order: 2;
  margin: 8px auto 0;
  max-width: 196px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.34;
}

.pin-filepilot {
  left: 16%;
  top: 38px;
}

.pin-vision {
  left: 49%;
  top: 13px;
}

.pin-voice {
  left: 82%;
  top: 36px;
}

.journey-step {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  pointer-events: none;
}

.no-webgl .space-canvas::before,
.no-webgl .space-canvas::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.no-webgl .space-canvas::before {
  left: -10vw;
  top: -8vh;
  width: min(64vw, 860px);
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.48), transparent 0 24%, transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(0, 0, 0, 0.68), transparent 0 44%, rgba(0, 0, 0, 0.92) 72%),
    url("assets/earth_atmos_2048.jpg");
  background-size: 100% 100%, 100% 100%, 145% 72%;
  background-position: center, center, 55% 50%;
  box-shadow: 0 0 42px rgba(112, 211, 255, 0.32), inset -70px -30px 120px rgba(0, 0, 0, 0.86);
}

.no-webgl .space-canvas::after {
  right: 24vw;
  top: 15vh;
  width: min(8.4vw, 116px);
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 33% 28%, rgba(255, 255, 255, 0.62), transparent 0 27%, rgba(0, 0, 0, 0.58) 72%),
    url("assets/moon_1024.jpg");
  background-size: 100% 100%, 150% 150%;
  filter: grayscale(1) contrast(1.13) brightness(0.9);
  box-shadow: inset -18px -8px 30px rgba(0, 0, 0, 0.72);
}

@media (min-width: 1280px) and (max-height: 820px) {
  .copy-hero {
    top: 49vh;
  }

  .copy-about {
    top: 27vh;
  }

  .copy-projects {
    top: 17vh;
  }

  .project-map {
    bottom: 7.5vh;
  }
}

@media (max-width: 920px) {
  .site-header {
    padding: 20px 22px 0;
  }

  .brand-mark {
    display: none;
  }

  .brand > span:last-child {
    display: grid;
    gap: 4px;
    font-size: 14px;
    line-height: 1.15;
  }

  .top-nav a,
  .top-nav i {
    display: none;
  }

  .section-rail,
  .scroll-sign {
    display: none;
  }

  .journey {
    min-height: 360vh;
  }

  .journey-step {
    height: 120vh;
  }

  .journey-stage {
    height: 100svh;
  }

  .copy-hero,
  .copy-about,
  .copy-projects {
    left: 24px;
    right: 24px;
    width: auto;
    text-align: left;
  }

  .copy-hero {
    top: 55vh;
    transform: none;
  }

  .copy-hero h1 {
    max-width: 340px;
    font-size: clamp(34px, 10vw, 48px);
  }

  .copy-hero p {
    max-width: 300px;
    font-size: 14px;
  }

  .cyan-stem {
    margin-left: 0;
  }

  .copy-about {
    top: 19vh;
    transform: translate3d(28px, 22px, 0);
  }

  .copy-projects {
    top: 13vh;
    transform: translate3d(28px, 22px, 0);
  }

  .copy h2 {
    font-size: 31px;
  }

  .copy > p {
    max-width: 320px;
    font-size: 13px;
  }

  .focus-row {
    max-width: 330px;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 22px;
  }

  .focus-row article {
    display: grid;
    grid-template-columns: 38px 1fr;
    column-gap: 8px;
    align-items: center;
  }

  .focus-row span {
    grid-row: span 2;
    margin-bottom: 0;
  }

  .lunar-surface {
    left: -36vw;
    right: -62vw;
    bottom: -9vh;
    height: 27vh;
    min-height: 210px;
  }

  .earth-ghost {
    left: 7vw;
    bottom: 23vh;
    width: 34vw;
    min-width: 112px;
  }

  .project-map {
    left: 22px;
    right: 22px;
    bottom: 8.5vh;
    height: 250px;
    transform: translate3d(55px, 44px, 0);
  }

  .project-pin {
    align-items: flex-start;
    width: min(76vw, 300px);
    text-align: left;
  }

  .project-pin > span {
    order: 0;
    height: 36px;
    margin: 0 0 10px 8px;
  }

  .project-pin > span::before {
    margin-top: 34px;
  }

  .project-pin p {
    max-width: 252px;
    margin-left: 0;
  }

  .pin-filepilot {
    left: 0;
    top: 0;
    transform: none;
  }

  .pin-vision {
    left: 26px;
    top: 88px;
    transform: none;
  }

  .pin-voice {
    left: 8px;
    top: 176px;
    transform: none;
  }
}

@media (max-width: 520px) {
  .menu-button {
    width: 38px;
    height: 38px;
  }

  .copy-hero {
    top: 58vh;
  }

  .copy-about {
    top: 18vh;
  }

  .copy-projects {
    top: 12vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-sign i {
    animation: none;
  }
}
