﻿@font-face {
  font-family: "GlowSansTC";
  src: url("../font/GlowSansTC-Normal-Medium.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "WhoAsksSatan";
  src: url("../font/who%20asks%20satan.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #080b12;
  --text: #f8f3ec;
  --muted: #d9cdc1;
  --accent: #e63946;
  --accent-soft: #ffb703;
  --impact: #ffe58e;
  --shadow: rgb(0 0 0 / 54%);
  --font-base: "GlowSansTC", "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-display: "WhoAsksSatan", "GlowSansTC", sans-serif;
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-base);
  color: var(--text);
  line-height: 1.45;
  background: var(--bg);
  font-size: clamp(12px, 0.78vw, 15px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, .brand, .impact-strip, .tag, .novel-title {
  font-family: var(--font-display);
  font-weight: normal;
}

html[lang="zh-Hant"] h1,
html[lang="zh-Hant"] .brand,
html[lang="zh-Hant"] .impact-strip,
html[lang="zh-Hant"] .tag,
html[lang="zh-Hant"] .novel-title {
  font-family: var(--font-base);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 14% 18%, rgb(230 57 70 / 35%), transparent 30%),
    radial-gradient(circle at 82% 10%, rgb(255 183 3 / 24%), transparent 28%),
    linear-gradient(180deg, rgb(2 4 8 / 46%), rgb(1 2 5 / 78%)),
    url("./bg.jpg") center / cover no-repeat;
  transform: scale(1.04);
  will-change: transform;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: rgb(8 8 14 / 20%);
  backdrop-filter: blur(8px) saturate(118%);
  -webkit-backdrop-filter: blur(8px) saturate(118%);
  will-change: backdrop-filter;
}

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  pointer-events: none;
  background-image: repeating-radial-gradient(circle at 0 0, transparent 0, transparent 1px, rgb(255 255 255 / 9%) 1px, transparent 2px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
  animation: drift 20s linear infinite;
  will-change: transform;
}

.page-shell {
  width: min(1260px, 94vw);
  height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.6rem;
  padding: 0.7rem 0 0.75rem;
  overflow: hidden;
  position: relative;
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0.38rem 0.82rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.lang-btn.is-active {
  color: #200d08;
  background: linear-gradient(120deg, var(--accent), var(--accent-soft));
}

.lang-btn:focus-visible,
.cta:focus-visible,
.audio-toggle:focus-visible,
.novel-badge:focus-visible,
.novel-float:focus-visible,
#steam-buy-link:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
  border-color: var(--accent-soft);
}

.stage {
  grid-row: 1;
  align-self: center;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  min-height: 0;
  width: 100%;
  margin: 0 auto;
  align-content: center;
}

.hero-section,
.trailer-block,
.social-zone {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  width: 100%;
  margin-inline: auto;
}

.hero-section {
  text-align: center;
  margin-bottom: 0.3rem;
}

.eyebrow {
  margin: 0 0 0.62rem;
  color: #f8d5cc;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

h1 {
  margin: 0.7rem 0 0.7rem;
  line-height: 0.9;
  letter-spacing: 0.03em;
  font-size: clamp(1.8rem, 5.8vw, 4.6rem);
  text-shadow: 0 10px 28px rgb(0 0 0 / 45%);
  text-wrap: balance;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.35rem 0 0.5rem;
}

.tag {
  padding: 0.28rem 0.68rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--text);
  text-transform: uppercase;
  background: rgb(0 0 0 / 35%);
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 20%);
}

.sublead {
  margin: 0.12rem auto 0;
  max-width: 46ch;
  color: var(--text);
  font-size: clamp(0.92rem, 1.45vw, 1.08rem);
  line-height: 1.34;
  text-wrap: pretty;
  word-break: keep-all;
  text-shadow: 0 4px 16px rgb(0 0 0 / 42%);
}

html[lang="zh-Hant"] .sublead[data-i18n="sublead2"] {
  white-space: nowrap;
  font-size: clamp(0.76rem, 1.06vw, 0.9rem);
}

.impact-strip {
  margin-top: 0.48rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.34rem 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: #281907;
  background: linear-gradient(120deg, var(--accent-soft), #fff4bf);
  clip-path: polygon(0 0, 100% 0, 95% 100%, 0 100%);
  text-decoration: none;
}

.steam-buy-label {
  line-height: 1.1;
}

.steam-discount-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: #8a0016;
  color: #fff6ec;
  border: 1px solid rgb(255 214 170 / 80%);
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  box-shadow: 0 0 0 1px rgb(255 245 214 / 18%), 0 0 20px rgb(230 57 70 / 40%);
  animation: discountPulse 1.8s ease-in-out infinite;
}

.steam-discount-chip.is-hidden {
  display: none;
}

@keyframes discountPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 1px rgb(255 245 214 / 18%), 0 0 14px rgb(230 57 70 / 35%); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 1px rgb(255 245 214 / 28%), 0 0 24px rgb(230 57 70 / 52%); }
  100% { transform: scale(1); box-shadow: 0 0 0 1px rgb(255 245 214 / 18%), 0 0 14px rgb(230 57 70 / 35%); }
}

.trailer-block {
  text-align: center;
}

.trailer-frame {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 22%);
  background: rgb(0 0 0 / 42%);
  aspect-ratio: 16 / 9;
  width: min(840px, 100%);
  margin: 0 auto;
  box-shadow: 0 24px 42px var(--shadow);
}

.trailer-frame video {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.novel-stack {
  position: fixed;
  right: clamp(0.8rem, 2vw, 1.8rem);
  bottom: clamp(0.8rem, 2vh, 1.4rem);
  width: 330px;
  display: grid;
  gap: 0.58rem;
  z-index: 51;
}

.novel-badge,
.novel-float {
  display: flex;
  background: rgb(0 0 0 / 56%);
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.novel-badge {
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
}

.novel-float {
  position: static;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem;
  max-width: 100%;
}

.novel-badge-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}

.novel-badge-text {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.novel-badge:hover {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
  box-shadow: 0 12px 26px rgb(0 0 0 / 42%);
}

.novel-float:hover {
  transform: translateY(-3px);
  border-color: var(--accent-soft);
  box-shadow: 0 14px 30px rgb(0 0 0 / 44%);
}

.novel-cover {
  width: 58px;
  height: 82px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 22%);
  flex-shrink: 0;
}

.novel-content {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.novel-title {
  margin: 0;
  font-size: 0.94rem;
  color: var(--accent-soft);
  letter-spacing: 0.08em;
}

.novel-desc {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.5;
  text-wrap: pretty;
  word-break: keep-all;
  letter-spacing: 0.04em;
}

.social-zone {
  margin-top: 0.15rem;
}

.cta-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.52rem;
}

.cta {
  text-decoration: none;
  color: inherit;
  border-radius: 9px;
  border: 1px solid rgb(255 255 255 / 22%);
  padding: 0.45rem 0.72rem;
  background: rgb(0 0 0 / 35%);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.cta:hover {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
  box-shadow: 0 8px 18px rgb(0 0 0 / 34%);
}

.cta-title {
  font-size: 0.74rem;
  letter-spacing: 0.05em;
}

.footer {
  grid-row: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  position: relative;
  z-index: 120;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.audio-toggle {
  background: rgb(0 0 0 / 38%);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  color: var(--text);
}

.lang-dock {
  position: fixed;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 140;
  display: inline-flex;
  gap: 0.32rem;
  padding: 0.22rem;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 999px;
  background: rgb(0 0 0 / 34%);
  backdrop-filter: blur(6px) saturate(115%);
  -webkit-backdrop-filter: blur(6px) saturate(115%);
}

.lang-dock .lang-btn {
  padding: 0.34rem 0.72rem;
  font-size: 0.77rem;
  letter-spacing: 0.03em;
}

html[lang="en"] .sublead {
  max-width: 60ch;
  letter-spacing: 0.01em;
}

html[lang="en"] .tag {
  letter-spacing: 0.05em;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.7s ease-out;
}

.intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-text {
  color: var(--text);
  font-size: clamp(1rem, 3vw, 1.9rem);
  text-align: center;
  line-height: 1.5;
  letter-spacing: 0.08em;
  position: relative;
  width: min(92vw, 980px);
  height: 4em;
  text-wrap: pretty;
  word-break: keep-all;
}

.intro-text span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  animation: fadeInOutCenter 1.8s ease-in-out forwards;
}

@keyframes fadeInOutCenter {
  0% { opacity: 0; transform: scale(0.92); }
  18% { opacity: 1; transform: scale(1); }
  82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.07); }
}

.flashlight-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    transparent 0%,
    transparent var(--light-core, 140px),
    rgba(8, 8, 12, 0.34) var(--light-edge, 440px),
    rgba(2, 2, 4, 0.82) 100%
  );
}

.edge-glow {
  position: fixed;
  inset: 0;
  z-index: 98;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mouse-x, 50%) 0, rgba(230, 57, 70, 0.2) 0%, transparent 18%),
    radial-gradient(circle at var(--mouse-x, 50%) 100%, rgba(230, 57, 70, 0.2) 0%, transparent 18%),
    radial-gradient(circle at 0 var(--mouse-y, 50%), rgba(230, 57, 70, 0.2) 0%, transparent 18%),
    radial-gradient(circle at 100% var(--mouse-y, 50%), rgba(230, 57, 70, 0.2) 0%, transparent 18%);
}

.horror-entity {
  position: fixed;
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  color: #a71828;
  font-family: serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 4rem);
  text-shadow: 0 0 12px rgba(255, 0, 0, 0.58);
  filter: blur(1.3px) contrast(1.2);
  transition: opacity 0.05s ease-out;
  transform: translate(-50%, -50%);
  will-change: opacity, transform, left, top;
}

.horror-entity.is-visible {
  opacity: 0.86;
  transition: none;
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
    height: auto;
    min-height: 100%;
  }

  .page-shell {
    width: min(1260px, 95vw);
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    grid-template-rows: auto auto;
    padding: 0.95rem 0 1rem;
  }

  .stage {
    align-self: start;
    align-content: start;
    gap: 0.75rem;
  }

  .hero-section {
    margin-bottom: 0.1rem;
  }

  h1 {
    margin: 0.5rem 0 0.55rem;
    font-size: clamp(1.7rem, 9vw, 3.4rem);
  }

  .tags-list {
    gap: 0.34rem;
    margin: 0.3rem 0 0.42rem;
  }

  .tag {
    padding: 0.24rem 0.58rem;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }

  .sublead {
    max-width: 44ch;
    line-height: 1.42;
  }

  .impact-strip {
    padding: 0.42rem 0.72rem;
    gap: 0.35rem;
    letter-spacing: 0.12em;
  }

  .trailer-frame {
    width: min(920px, 100%);
  }

  .novel-stack {
    position: relative;
    right: auto;
    bottom: auto;
    margin: 0.15rem auto 0.5rem;
    width: min(420px, 100%);
  }

  .novel-badge {
    position: static;
    width: 100%;
  }

  .novel-float {
    position: relative;
    right: auto;
    bottom: auto;
    max-width: 100%;
    margin: 0;
  }

  .footer {
    margin-top: 0.35rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    flex-wrap: wrap;
    text-align: center;
    gap: 0.45rem;
  }
}

@media (max-width: 760px) {
  body::after {
    backdrop-filter: blur(6px) saturate(105%);
    -webkit-backdrop-filter: blur(6px) saturate(105%);
  }

  .page-shell {
    width: min(1260px, 96vw);
    padding: 0.82rem 0 0.95rem;
    gap: 0.7rem;
  }

  .stage {
    gap: 0.68rem;
  }

  .eyebrow {
    margin-bottom: 0.46rem;
    font-size: 0.72rem;
    letter-spacing: 0.11em;
  }

  h1 {
    line-height: 0.94;
  }

  .impact-strip {
    width: min(100%, 330px);
    margin-inline: auto;
    text-align: center;
  }

  .steam-discount-chip {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }

  .novel-stack {
    width: 100%;
  }

  .novel-badge,
  .novel-float {
    border-radius: 11px;
  }

  .cta-list {
    gap: 0.42rem;
  }

  .cta {
    padding: 0.42rem 0.64rem;
  }

  .cta-title {
    font-size: 0.7rem;
  }

  .sublead {
    font-size: clamp(0.84rem, 3.6vw, 1rem);
  }

  html[lang="zh-Hant"] .sublead[data-i18n="sublead2"] {
    white-space: normal;
    font-size: clamp(0.8rem, 3.4vw, 0.94rem);
  }

  .lang-dock {
    left: 50%;
    transform: translateX(-50%);
    bottom: 0.5rem;
    max-width: calc(100vw - 1rem);
  }

  .lang-dock .lang-btn {
    padding: 0.3rem 0.58rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 460px) {
  .page-shell {
    width: min(1260px, 97vw);
    padding-top: 0.75rem;
  }

  h1 {
    font-size: clamp(1.55rem, 10.6vw, 2.5rem);
  }

  .tag {
    font-size: 0.64rem;
    padding: 0.2rem 0.5rem;
  }

  .sublead {
    max-width: 30ch;
    font-size: clamp(0.78rem, 4vw, 0.92rem);
  }

  .novel-float {
    gap: 0.72rem;
    padding: 0.74rem;
  }

  .novel-cover {
    width: 50px;
    height: 72px;
  }

  .novel-title {
    font-size: 0.84rem;
  }

  .novel-desc {
    font-size: 0.76rem;
    line-height: 1.38;
  }
}

@media (prefers-reduced-motion: reduce) {
  .noise-layer,
  .cta,
  .novel-badge,
  .novel-float,
  .steam-discount-chip {
    animation: none;
    transition: none;
  }

  .flashlight-overlay {
    background: rgba(4, 4, 6, 0.28);
  }

  .horror-entity,
  .edge-glow {
    display: none;
  }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-12px, 8px, 0); }
}

/* Utility: visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
