/* Landing page. Loaded after public.css, which supplies the palette
   variables (--bg/--fg/--accent) and the .lang-switch button styles. */

body.landing-body {
  margin: 0;
  overflow: hidden;
}

main.landing {
  position: relative;
  max-width: none;
  margin: 0;
  padding: 0;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* The whole page is clickable (see landing.js), so say so. */
  cursor: pointer;
  /* Fallback when no background image resolves: a plain dark gradient,
     never a white page. */
  background:
    radial-gradient(120% 90% at 50% 0%, #1b1b22 0%, transparent 60%),
    linear-gradient(160deg, #0b0b0d 0%, #141419 55%, #0b0b0d 100%);
}

.landing-bg,
.landing-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.landing-bg img {
  display: block;
  object-fit: cover;
  object-position: center;
  /* Fades in slightly after the text so the page layers in instead of
     snapping. Opacity only: a transform here would slide the full-bleed
     image and expose the gradient along one edge. */
  animation: landing-fade-in 0.8s ease 0.2s both;
}

/* Opacity comes from landing_backdrop_opacity, injected as --veil-opacity
   so the fade can end on the configured value instead of overriding it. */
.veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--veil-opacity, 1);
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.35) 35%,
    rgba(0, 0, 0, 0.35) 65%,
    rgba(0, 0, 0, 0.9) 100%
  );
  animation: landing-veil-in 0.6s ease 0.1s both;
}

/* Button-less call to action: a hairline mouse outline plus one small line
   of copy, pinned near the bottom of the viewport. It is decoration only —
   pointer-events stay off so the click lands on the page handler. */
.enter-hint {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: landing-fade-in 0.5s ease 0.6s both;
}

.enter-hint svg {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0.6;
}

.enter-hint span {
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.lang {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 1;
}

/* 竖排，避免与底部 enter-hint 在窄屏上横向竞争 */
.lang .lang-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.lang .lang-switch button {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.72);
}

.lang .lang-switch button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.lang .lang-switch button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* @keyframes landing-fade removed: .hero no longer exists. Keep
   landing-fade-in (opacity only) for the full-bleed layers. */

/* Opacity-only variant for full-bleed layers (see .landing-bg img). */
@keyframes landing-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes landing-veil-in {
  from { opacity: 0; }
  to { opacity: var(--veil-opacity, 1); }
}

@media (max-width: 600px) {
  .lang { right: 12px; bottom: 12px; }
  .enter-hint { bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-bg img,
  .veil,
  .enter-hint { animation: none; }
}
