:root {
  --bg-deep: #2b0307;
  --bg-wine: #51090d;
  --bg-top: #180104;

  --text-soft: #d8cfca;
  --text-line: rgba(216, 207, 202, 0.42);
  --logo-shadow: rgba(0, 0, 0, 0.42);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

@font-face {
  font-family: "Cinzel";
  src: url("/fonts/Cinzel-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

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

html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  background: #140104;
}

body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-deep) 100%);
  color: var(--text-soft);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  position: relative;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -10;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-deep) 100%);
}

.landing {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 44% 36%, rgba(158, 27, 34, 0.18), transparent 24%),
    radial-gradient(circle at 52% 58%, rgba(132, 16, 24, 0.14), transparent 30%),
    linear-gradient(135deg, #5a0a0f 0%, #47070c 24%, #360408 58%, var(--bg-deep) 100%);
  transform-origin: 50% 50%;
  transition:
    transform 920ms cubic-bezier(0.2, 0.84, 0.24, 1),
    opacity 920ms ease,
    filter 920ms ease;
}

.landing.page-fadeout {
  animation: page-zoomfade 1.2s cubic-bezier(.3,1,.7,1) forwards;
}

@keyframes page-zoomfade {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  80% {
    opacity: 0.82;
    transform: scale(1.12);
    filter: blur(2px);
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
    filter: blur(8px);
  }
}

.landing__background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.landing__glow,
.landing__texture,
.landing__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.landing__glow--main {
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(215, 56, 62, 0.14), transparent 24%),
    radial-gradient(circle at 42% 28%, rgba(255, 233, 235, 0.04), transparent 12%);
  filter: blur(26px);
}

.landing__glow--upper {
  z-index: 1;
  background:
    radial-gradient(circle at 44% 31%, rgba(255, 245, 246, 0.035), transparent 11%);
  filter: blur(32px);
}

.landing__texture {
  z-index: 1;
  opacity: 0.1;
  background:
    radial-gradient(circle at 20% 78%, rgba(255, 255, 255, 0.03), transparent 10%),
    radial-gradient(circle at 68% 34%, rgba(255, 255, 255, 0.022), transparent 12%),
    radial-gradient(circle at 52% 62%, rgba(255, 255, 255, 0.02), transparent 16%);
  filter: blur(34px) saturate(92%);
  transform: scale(1.08);
}

.landing__vignette {
  z-index: 2;
  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 46%, rgba(0, 0, 0, 0.16) 84%, rgba(0, 0, 0, 0.26) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0%, transparent 18%, transparent 82%, rgba(0, 0, 0, 0.12) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, transparent 14%, transparent 82%, rgba(0, 0, 0, 0.1) 100%);
}

.landing__web,
.landing__rose {
  position: absolute;
  display: block;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.entry-spider {
  position: absolute;
  top: calc(18vh - 112px);
  left: 31%;
  width: 86px;
  height: 240px;
  object-fit: contain;
  object-position: center top;
  transform: translateX(-50%) translateY(-180px);
  opacity: 0;
  z-index: 8;
  pointer-events: none;
  user-select: none;
  transition: opacity .2s ease;
}

.entry-spider.spider-visible {
  opacity: 1;
}

.entry-spider.spider-drop {
  animation: spider-drop 1.3s cubic-bezier(.38,2.3,.6,1) forwards;
}

@keyframes spider-drop {
  0% {
    transform: translateX(-50%) translateY(-180px);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  78% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  95% {
    transform: translateX(-50%) translateY(0);
  }
  100% {
    transform: translateX(-50%) translateY(2px);
    opacity: 1;
  }
}

/* 桌面端：更大更贴边 */
.landing__web {
  position: absolute;
  top: calc(-6% + var(--safe-top));
  right: calc(-8% + var(--safe-right));
  width: min(46vw, 680px);
  min-width: 420px;
  max-width: none;
  height: auto;
  max-height: none;
  opacity: 0.95;
  z-index: 4;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.05));
}
.landing__rose {
  left: calc(-5% + var(--safe-left));
  bottom: calc(-6% + var(--safe-bottom));
  width: clamp(380px, 40vw, 620px);
  height: auto;
  opacity: 0.9;
  z-index: 5;
}

.hero {
  position: relative;
  z-index: 6;
  width: min(75vw, 840px);
  padding: calc(18px + var(--safe-top)) 0 calc(66px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 1.8vh, 1.4rem);
  text-align: center;
  transform: translateY(1.5vh);
}

.hero__subtitle {
  margin: 0 0 0.15em;
  max-width: 75%;
  font-size: clamp(1.45rem, 1.7vw, 2.05rem);
  line-height: 1.08;
  font-family: "Cinzel", "Times New Roman", serif;
  font-style: italic;
  letter-spacing: 0.01em;
  color: #d9d0cc;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.34);

}

.hero__logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(-5vh);
}

.hero__logo-frame {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: min(78vw, 820px);
  min-height: clamp(140px, 18vw, 220px);
}

.hero__logo-link[data-missing="true"] .hero__logo-frame {
  display: inline-flex;
}

.hero__logo-shell {
  position: relative;
  display: inline-block;
  line-height: 0;
  isolation: isolate;
}

.hero__logo-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  z-index: 3;

  /* 关键：伪元素本身不移动，只移动内部渐变 */
  background-image: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0) 32%,
    rgba(255, 255, 255, 0.08) 43%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.12) 57%,
    rgba(255, 255, 255, 0) 68%
  );
  background-repeat: no-repeat;
  background-size: 240% 100%;
  background-position: 150% 0;

  /* 关键：只裁切在 logo 图案区域 */
  -webkit-mask-image: url("../image/logo.png");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 100% 100%;
  mask-image: url("../image/logo.png");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 100% 100%;

  opacity: 0.9;
  animation: logoMetalShine 3.5s ease-in-out infinite;
}

.hero__logo {
  width: min(48vw, 470px);
  height: auto;
  display: block;
  mix-blend-mode: normal;
  transform: translateY(0);
  filter: drop-shadow(0 8px 18px var(--logo-shadow));
}

@keyframes logoMetalShine {
  0%,
  48%,
  100% {
    background-position: 150% 0;
    opacity: 0;
  }

  54% {
    opacity: 0.42;
  }

  78% {
    background-position: -60% 0;
    opacity: 0.9;
  }

  84% {
    background-position: -60% 0;
    opacity: 0;
  }
}

.hero__fallback {
  font-size: clamp(4rem, 10vw, 7.8rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #080606;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.hero__hint {
  position: absolute;
  left: 50%;
  bottom: calc(30px + var(--safe-bottom));
  transform: translateX(-50%);
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.95rem;
  white-space: nowrap;
  font-size: clamp(1.16rem, 1.7vw, 1.8rem);
  line-height: 1.1;
  font-family: "Cinzel", "Times New Roman", serif;
  font-style: italic;
  color: #ddd2cd;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.34);
  opacity: 0.6;
  animation: hintFadeOut 1.2s ease 3s forwards;
  will-change: opacity;
  z-index: 7;
}

.hero__hint span {
  width: clamp(3rem, 7vw, 5rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--text-line), transparent);
  flex: 0 0 auto;
}

@keyframes hintFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* 平板 */
@media (max-width: 1024px) {
  .landing__web {
    top: calc(-5% + var(--safe-top));
    right: calc(-6% + var(--safe-right));
    width: min(52vw, 560px);
    min-width: 360px;
  }

  .landing__rose {
    left: calc(-7% + var(--safe-left));
    bottom: calc(-5% + var(--safe-bottom));
    width: clamp(320px, 46vw, 520px);
  }

  .hero {
    width: min(88vw, 760px);
    gap: 0.75rem;
    transform: translateY(1.2vh);
  }

  .hero__subtitle {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
  }

  .hero__logo {
    width: min(50vw, 410px);
  }
}

/* 手机端：重点修正 */
@media (max-width: 640px) {
  html,
  body {
    overflow: hidden;
  }

  .landing {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
  }

  .landing__background {
    object-position: 48% center;
  }

  /* 右上蛛网：展开显示，避免被边缘裁切 */
  .landing__web {
    top: calc(-3% + var(--safe-top));
    right: calc(-3% + var(--safe-right));
    width: clamp(320px, 88vw, 470px);
    min-width: 0;
    max-width: none;
    height: auto;
    max-height: none;
    opacity: 0.96;
  }
  /* 左下玫瑰必须更大，更吃进画面 */
  .landing__rose {
    left: calc(-12% + var(--safe-left));
    bottom: calc(-6% + var(--safe-bottom));
    width: clamp(290px, 72vw, 430px);
    opacity: 0.92;
  }

  .entry-spider {
    top: calc(18vh - 104px);
    left: 31%;
    width: 72px;
    height: 220px;
  }

  .hero {
    width: min(90vw, 520px);
    gap: 0.5rem;
    padding-top: calc(18px + var(--safe-top));
    padding-bottom: calc(72px + var(--safe-bottom));
    transform: translateY(1.8vh);
  }

  /* 副标题更贴近 logo */
  .hero__subtitle {
    max-width: 88%;
    margin-bottom: -0.1rem;
    font-size: clamp(1.28rem, 4.3vw, 1.7rem);
    line-height: 1.08;
  }

  /* logo 更大 */
  .hero__logo {
    width: min(54vw, 290px);
    transform: translateY(0);
  }

  /* hint 永远单行，不许断 */
  .hero__hint {
    bottom: calc(28px + var(--safe-bottom));
    gap: 0.6rem;
    font-size: clamp(0.92rem, 3.7vw, 1.15rem);
    white-space: nowrap;
    text-align: center;
  }

  .hero__hint span {
    width: clamp(1.4rem, 10vw, 2.6rem);
  }
}

/* 很窄手机 */
@media (max-width: 430px) {
  .landing__web {
    top: calc(-2% + var(--safe-top));
    right: calc(-4% + var(--safe-right));
    width: clamp(310px, 94vw, 460px);
    min-width: 0;
  }
  .landing__rose {
    left: calc(-15% + var(--safe-left));
    bottom: calc(-5% + var(--safe-bottom));
    width: clamp(280px, 78vw, 410px);
  }

  .entry-spider {
    top: calc(18vh - 96px);
    left: 30%;
    width: 64px;
    height: 200px;
  }

  .hero {
    transform: translateY(2vh);
  }

  .hero__subtitle {
    font-size: clamp(1.2rem, 4.8vw, 1.55rem);
  }

  .hero__logo {
    width: min(55vw, 240px);
    transform: translateY(0);
  }

  .hero__logo-shell::after {
    background-image: linear-gradient(
      118deg,
      rgba(255, 255, 255, 0) 34%,
      rgba(255, 255, 255, 0.06) 44%,
      rgba(255, 255, 255, 0.42) 50%,
      rgba(255, 255, 255, 0.1) 56%,
      rgba(255, 255, 255, 0) 66%
    );
    background-size: 250% 100%;
  }
  
  .hero__hint {
    bottom: calc(24px + var(--safe-bottom));
    font-size: clamp(0.88rem, 3.8vw, 1.02rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing__web,
  .landing__rose,
  .hero,
  .hero__logo,
  .hero__logo-shell::after,
  .hero__hint,
  .entry-spider,
  .landing {
    animation: none !important;
    transition: none !important;
  }

  .hero__logo-shell::after {
    animation: none !important;
    background-position: 50% 0;
    opacity: 0.08;
  }}
