@font-face {
  font-family: "GaokaoSweiSerif";
  src: url("./font/SweiB2SerifCJKtc-Regular.ttf?v=2026060600") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GaokaoSweiSerif";
  src: url("./font/SweiB2SerifCJKtc-SemiBold.ttf?v=2026060600") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GaokaoSweiSerif";
  src: url("./font/SweiB2SerifCJKtc-SemiBold.ttf?v=2026060600") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --frame-width: min(100vw, 430px);
  --ink: #f8efe0;
  --muted: rgba(248, 239, 224, 0.68);
  --faint: rgba(248, 239, 224, 0.42);
  --gold: #f6d98b;
  --wine: #3b1012;
  --charcoal: #060606;
  --light-progress: 0;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family:
    "GaokaoSweiSerif", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overscroll-behavior: none;
  background:
    radial-gradient(circle at 50% calc(100% - 10%), rgba(196, 143, 68, 0.22), transparent 34rem),
    linear-gradient(180deg, #060606 0%, #11090a 48%, #050505 100%);
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior: none;
  background: transparent;
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.74) 0%,
      rgba(0, 0, 0, 0.08) calc((100vw - var(--frame-width)) / 2),
      rgba(0, 0, 0, 0.08) calc(100% - ((100vw - var(--frame-width)) / 2)),
      rgba(0, 0, 0, 0.74) 100%
    );
}

.site-frame {
  position: relative;
  z-index: 1;
  width: var(--frame-width);
  min-height: 100svh;
  margin: 0 auto;
  overflow: visible;
  background: #050505;
  isolation: isolate;
}

@media (min-width: 760px) {
  .site-frame {
    box-shadow:
      0 0 0 1px rgba(246, 217, 139, 0.12),
      0 30px 100px rgba(0, 0, 0, 0.62);
  }
}

.journey {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100svh;
  overflow: hidden;
}

.particle-canvas {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 6;
  width: var(--frame-width);
  height: 100svh;
  pointer-events: none;
  transform: translateX(-50%);
  mix-blend-mode: screen;
}

.scene-section {
  position: absolute;
  inset: 0;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  contain: paint;
}

.scene-section:first-child {
  visibility: visible;
  opacity: 1;
}

.scene-section::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(
      circle at 50% calc(88% - (var(--light-progress) * 20%)),
      rgba(var(--section-r), var(--section-g), var(--section-b), 0.18),
      transparent 42%
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.1) 38%, rgba(0, 0, 0, 0.64) 100%);
}

.bg-wrap,
.bg-wrap img,
.section-shade,
.line-layer {
  position: absolute;
  inset: 0;
}

.bg-wrap {
  z-index: 0;
  transform-origin: center;
}

.bg-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.section-shade {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.2) 42%, rgba(0, 0, 0, 0.72)),
    radial-gradient(circle at 50% 44%, transparent 0%, rgba(0, 0, 0, 0.46) 74%);
}

.line-layer {
  z-index: 4;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0.72;
}

.line-layer path,
.line-layer line,
.line-layer circle,
.line-layer polyline,
.line-layer rect {
  vector-effect: non-scaling-stroke;
}

.draw-line {
  fill: none;
  stroke: var(--line-color, rgba(246, 217, 139, 0.72));
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.draw-fill {
  fill: none;
  stroke: var(--line-soft, rgba(248, 239, 224, 0.22));
  stroke-width: 1;
}

.scene-content {
  position: relative;
  z-index: 7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: calc(46px + var(--safe-top)) 30px calc(80px + var(--safe-bottom));
}

.chapter {
  position: absolute;
  top: calc(30px + var(--safe-top));
  left: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.chapter::after {
  display: block;
  width: 52px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, rgba(246, 217, 139, 0.66), transparent);
}

.subject-title {
  margin: 0 0 30px;
  color: var(--ink);
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 30px rgba(246, 217, 139, 0.2);
}

.main-wish {
  max-width: 9.5em;
  margin: 0;
  color: #fff8e8;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.46;
  letter-spacing: 0;
}

.sub-wish {
  max-width: 18em;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.88;
  letter-spacing: 0;
}

.final-section .scene-content {
  justify-content: flex-start;
  padding-top: calc(212px + var(--safe-top));
  padding-bottom: calc(72px + var(--safe-bottom));
}

.final-section .main-wish {
  max-width: none;
  font-size: 24px;
  text-align: left;
  white-space: nowrap;
}

.final-mark {
  width: 80px;
  height: 1px;
  margin: 0 0 28px;
  background: linear-gradient(90deg, rgba(246, 217, 139, 0.92), transparent);
}

.progress-indicator {
  position: fixed;
  right: max(18px, calc((100vw - var(--frame-width)) / 2 + 18px));
  bottom: calc(32px + var(--safe-bottom));
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(248, 239, 224, 0.62);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  pointer-events: none;
}

.progress-indicator i {
  display: block;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, rgba(246, 217, 139, 0.78), rgba(248, 239, 224, 0.18));
}

.scroll-cue {
  position: fixed;
  left: 50%;
  bottom: calc(28px + var(--safe-bottom));
  z-index: 10;
  width: 1px;
  height: 42px;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-50%);
  background: rgba(248, 239, 224, 0.14);
}

.scroll-cue span {
  display: block;
  width: 1px;
  height: 16px;
  background: linear-gradient(180deg, transparent, rgba(246, 217, 139, 0.95));
  animation: cue-flow 1.8s ease-in-out infinite;
}

@keyframes cue-flow {
  0% {
    transform: translateY(-20px);
  }
  55%,
  100% {
    transform: translateY(46px);
  }
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 36px;
  background:
    radial-gradient(circle at 50% 62%, rgba(111, 53, 32, 0.32), transparent 42%),
    linear-gradient(180deg, #050505, #120909 58%, #050505);
}

.loading__mark {
  width: min(240px, 70vw);
  color: rgba(248, 239, 224, 0.78);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.loading__track {
  position: absolute;
  top: calc(50% + 28px);
  left: 50%;
  width: min(240px, 70vw);
  height: 1px;
  overflow: hidden;
  transform: translateX(-50%);
  background: rgba(248, 239, 224, 0.12);
}

.loading__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #7f4729, #f6d98b, #fff8e8);
}

@media (max-width: 380px) {
  .scene-content {
    padding-right: 26px;
    padding-left: 26px;
  }

  .subject-title {
    font-size: 42px;
  }

  .main-wish {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue span {
    animation: none;
    transform: translateY(8px);
  }
}
