/* ==========================================================================
   LunaCloud — modern stylesheet
   Native CSS only: custom properties, flexbox, GPU transforms, no framework.
   Visual output intentionally matches the legacy site 1:1.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts (subset + WOFF2, WOFF fallback)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Comic Sans MS";
  src: url("../font/ComicNeue-Light.woff2") format("woff2"),
       url("../font/ComicNeue-Light.woff") format("woff");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Comic Sans MS";
  src: url("../font/ComicNeue-Regular.woff2") format("woff2"),
       url("../font/ComicNeue-Regular.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --color-link: #5f5f5f;
  --color-main-bg: #060606;
  --color-intro-bg: #1e1f21;
  --color-card-muted: #93979e;
  --font-comic: "Comic Sans MS", "Helvetica Neue", "Microsoft Yahei", -apple-system, sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --grid-line: rgba(255, 255, 255, 0.048);
  --grid-size: 40px;
  --grid-line-width: 2px;
  --grid-duration: 13.3333s;

  --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out-sine: cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: 20px;
  overflow: hidden;
  background: var(--color-main-bg);
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: #000;
  font-family: var(--font-comic);
  cursor: url("../assets/cursors/default.png") 3 2, auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-touch-callout: none;
}

img {
  border: 0;
  vertical-align: middle;
}

a,
button,
img {
  cursor: url("../assets/cursors/pointer.png") 10 2, auto;
}

a {
  color: var(--color-link);
  text-decoration: none;
  outline: 0;
}

::selection {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.site {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.content {
  position: relative;
  width: 100%;
  height: 100vh;
}

.content-intro {
  z-index: 100;
  height: 200vh;
}

.content-inner {
  position: relative;
  width: 100%;
  height: 100vh;
  isolation: isolate;
  background: var(--color-intro-bg);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

/* CSS-only fallback when WebGL is unavailable. */
.content-intro.no-webgl .fluid {
  display: none;
}

.content-intro.no-webgl .content-inner {
  background:
    radial-gradient(45% 55% at 18% 26%, rgba(0, 190, 255, 0.2), transparent 70%),
    radial-gradient(40% 50% at 82% 30%, rgba(0, 255, 200, 0.14), transparent 72%),
    radial-gradient(45% 45% at 70% 78%, rgba(255, 0, 180, 0.16), transparent 70%),
    radial-gradient(40% 40% at 25% 85%, rgba(90, 120, 255, 0.14), transparent 72%),
    var(--color-intro-bg);
}

.fluid {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fluid.is-ready {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Intro
   -------------------------------------------------------------------------- */
.wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  text-align: center;
  animation: intro-rise 1s ease both;
}

@keyframes intro-rise {
  from {
    opacity: 0;
    transform: translateY(200px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.content-title {
  margin-top: 0.8em;
  margin-bottom: 0.3em;
  color: #fff;
  font-family: var(--font-comic);
  font-size: 4.7rem;
  font-weight: 200;
  line-height: 1;
  text-shadow:
    #452d2d 0 0 1px,
    #fffffb 0 0 1px,
    #fffffb 0 0 2px;
  animation: white-shadow 1.5s ease-in-out infinite alternate;
}

@keyframes white-shadow {
  0% {
    text-shadow:
      0 0 1px #fff,
      0 0 2px #fff,
      0 0 3px #fff,
      0 0 5px #333,
      0 0 8px #333,
      0 0 9px #333,
      0 0 10px #333,
      0 0 15px #333;
  }
  100% {
    text-shadow:
      0 0 0.5px #fff,
      0 0 1px #fff,
      0 0 1.5px #fff,
      0 0 2px #333,
      0 0 4px #333,
      0 0 5px #333,
      0 0 6px #333,
      0 0 8px #333;
  }
}

.content-subtitle {
  margin: 1em 0 2em;
  color: #fff;
  font-family: var(--font-comic);
  font-size: 1.2rem;
  font-weight: 200;
  text-shadow: 0 0 4px #fff;
}

.content-subtitle span {
  /* The 270ms delay reproduces the original JS-driven insertion timing. */
  animation: letter-glow 0.7s ease both;
  animation-delay: calc(320ms + var(--i) * 50ms);
}

@keyframes letter-glow {
  0% {
    opacity: 0;
    text-shadow: 0 0 1px hsla(0, 0%, 100%, 0.1);
  }
  66% {
    opacity: 1;
    text-shadow: 0 0 20px hsla(0, 0%, 100%, 0.9);
  }
  77% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
    text-shadow: 0 0 20px hsla(0, 0%, 100%, 0.2);
  }
}

.enter {
  position: relative;
  z-index: 999;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 3px;
  line-height: normal;
  white-space: pre;
  pointer-events: auto;
  background: linear-gradient(90deg, transparent, hsla(0, 0%, 100%, 0.7), transparent);
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px hsla(0, 0%, 100%, 0.3);
  animation: shimmer 2s linear infinite;
  transition: color 0.4s ease;
  cursor: url("../assets/cursors/pointer.png") 10 2, pointer;
}

.enter:hover,
.enter:focus {
  color: #5f5f5f;
}

.enter:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 6px;
  border-radius: 2px;
}

@keyframes shimmer {
  0% {
    background-position: 200%;
    text-shadow: 0 0 10px hsla(0, 0%, 100%, 0.3);
  }
  50% {
    text-shadow: 0 0 20px hsla(0, 0%, 100%, 0.6);
  }
  100% {
    background-position: -200%;
    text-shadow: 0 0 10px hsla(0, 0%, 100%, 0.3);
  }
}

.arrow {
  position: absolute;
  top: 92%;
  left: 49.5%;
  transform: translate3d(-50%, 0, 0);
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.arrow-1 {
  animation: arrow-movement 2s ease-in-out infinite;
}

.arrow-2 {
  animation: arrow-movement 2s 1s ease-in-out infinite;
}

.arrow::before,
.arrow::after {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 13px;
  height: 3px;
  background: #fff;
  box-shadow: 1px 1px 20px 0 #fff;
  content: "";
}

.arrow::before {
  transform: rotate(45deg) translateX(-10%);
  transform-origin: top left;
}

.arrow::after {
  transform: rotate(-45deg) translateX(10%);
  transform-origin: top right;
}

@keyframes arrow-movement {
  0% {
    opacity: 0;
    transform: translate3d(-50%, 0, 0);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, 3vh, 0);
  }
}

/* --------------------------------------------------------------------------
   Shape wipe
   -------------------------------------------------------------------------- */
.shape-wrap {
  position: relative;
  z-index: 0;
  margin: -5px 0 0;
  background: transparent;
}

.shape {
  display: block;
  width: 100%;
  height: 100vh;
  background: transparent;
  transform-origin: 50% 0%;
}

.shape path {
  fill: var(--color-intro-bg);
}

/* --------------------------------------------------------------------------
   Main page
   -------------------------------------------------------------------------- */
.content-main {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 0;
  background: var(--color-main-bg);
}

.grid {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--color-main-bg);
  opacity: 0;
  pointer-events: none;
}

.grid.is-active {
  opacity: 1;
}

.grid__tiles {
  position: absolute;
  top: -80px;
  right: -80px;
  bottom: -80px;
  left: -80px;
  inset: -80px;
  background-color: var(--color-main-bg);
  background-image:
    linear-gradient(
      to right,
      var(--grid-line) 0,
      var(--grid-line) var(--grid-line-width),
      transparent var(--grid-line-width),
      transparent 100%
    ),
    linear-gradient(
      to bottom,
      var(--grid-line) 0,
      var(--grid-line) var(--grid-line-width),
      transparent var(--grid-line-width),
      transparent 100%
    );
  background-size: var(--grid-size) var(--grid-size);
  animation: grid-drift var(--grid-duration) linear infinite;
  animation-play-state: paused;
  will-change: transform;
}

.grid.is-active .grid__tiles {
  animation-play-state: running;
}

@keyframes grid-drift {
  to {
    transform: translate3d(calc(-1 * var(--grid-size)), calc(-1 * var(--grid-size)), 0);
  }
}

/* Canvas-equivalent vignette: transparent center -> #060606 at farthest corner. */
.grid::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    circle farthest-corner at 50% 50%,
    rgba(6, 6, 6, 0) 0%,
    #060606 100%
  );
  content: "";
  pointer-events: none;
}

#card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  color: var(--color-card-muted);
  text-align: center;
}

.card-inner {
  width: 35%;
  padding: 0;
  border: 0;
  opacity: 0;
  transform: translateY(200px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 1s ease,
    transform 1s ease,
    visibility 0s linear 1s;
}

.card-inner.in {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 1s ease,
    transform 1s ease,
    visibility 0s linear 0s;
}

.card-inner header {
  margin-bottom: 40px;
}

.card-inner header img {
  width: 150px;
  height: 150px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: 0.4s ease-in-out;
}

.brand-name {
  position: relative;
  z-index: 2;
  margin: 15px 15px 0;
  color: #fff;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.2em;
}

.signature {
  position: relative;
  z-index: 2;
  margin: 1em 0;
  color: #ccc;
  font-size: 0.8rem;
  font-weight: lighter;
  letter-spacing: 3px;
}

.button-group {
  position: relative;
  z-index: 999;
  display: flex;
  justify-content: center;
  margin-top: 30px;
  pointer-events: auto;
}

/* Margin instead of flex gap: identical spacing and works on older Safari. */
.button-group .btn-rect + .btn-rect {
  margin-left: 20px;
}

.btn-rect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 46px;
  padding: 12px 34px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 10px 30px rgba(0, 0, 0, 0.18);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease;
}

.btn-rect:hover {
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(255, 255, 255, 0.22);
  color: #1e1f21;
  transform: translateY(-2px);
}

.btn-rect:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 4px;
}

.btn-rect:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Responsive — breakpoints kept identical to the legacy stylesheet
   -------------------------------------------------------------------------- */
@media screen and (max-width: 50em) {
  .content-title {
    font-size: 2rem;
  }
}

@media screen and (max-width: 1024px) {
  .content-subtitle {
    font-size: 1rem;
  }

  .card-inner {
    width: 45%;
  }
}

@media screen and (max-width: 768px) {
  .card-inner {
    width: 50%;
  }
}

@media screen and (max-width: 540px) {
  .card-inner {
    width: 60%;
  }

  .brand-name {
    font-size: 1rem;
  }

  .signature {
    font-size: 0.8rem;
  }
}

@media screen and (max-width: 480px) {
  .card-inner {
    width: 90%;
  }
}

@media screen and (max-width: 360px) {
  .card-inner {
    width: 100%;
  }

  .button-group .btn-rect + .btn-rect {
    margin-left: 14px;
  }

  .btn-rect {
    min-width: 112px;
    padding: 12px 26px;
  }
}

/* Retina/high-DPI desktop: a single device-pixel line is the visual match. */
@media screen and (min-resolution: 1.5dppx) {
  :root {
    --grid-line: rgba(255, 255, 255, 0.1);
    --grid-line-width: 1px;
  }
}

@media screen and (pointer: coarse) and (hover: none) {
  :root {
    --grid-line: rgba(255, 255, 255, 0.2);
    --grid-size: 50px;
    --grid-line-width: 1px;
    --grid-duration: 41.6667s;
  }
}

/* --------------------------------------------------------------------------
   Accessibility / graceful degradation
   -------------------------------------------------------------------------- */

/* Low-power devices: keep the look but stop the large text-shadow repaint. */
.perf-low .content-title {
  animation: none;
  text-shadow:
    0 0 1px #fff,
    0 0 2px #fff,
    0 0 2.5px #fff,
    0 0 4px #333,
    0 0 6px #333,
    0 0 7px #333,
    0 0 8px #333,
    0 0 11px #333;
}

@media (prefers-reduced-motion: reduce) {
  .wrap {
    animation: none;
  }

  .content-title {
    animation: none;
    text-shadow:
      0 0 1px #fff,
      0 0 2px #fff,
      0 0 3px #fff,
      0 0 5px #333,
      0 0 8px #333,
      0 0 9px #333,
      0 0 10px #333,
      0 0 15px #333;
  }

  .content-subtitle span {
    animation: none;
    opacity: 0.7;
    text-shadow: 0 0 20px hsla(0, 0%, 100%, 0.2);
  }

  .enter {
    animation: none;
    background: none;
    -webkit-text-fill-color: #fff;
    color: #fff;
  }

  .arrow {
    animation: none;
    opacity: 0.7;
  }

  .grid__tiles {
    animation: none;
  }

  .card-inner,
  .card-inner.in {
    transition:
      opacity 0.01ms linear,
      transform 0.01ms linear,
      visibility 0s linear 0s;
  }
}

