:root {
  color-scheme: light;
  --paper: #f5f0e6;
  --paper-deep: #eee4d2;
  --ink: #3e3a34;
  --ink-soft: rgba(62, 58, 52, 0.7);
  --muted: #8b8982;
  --bamboo: #8fa094;
  --gold: #b99a55;
  --seal: #9e3f2f;
  --shadow: rgba(54, 45, 34, 0.16);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html {
  width: 100%;
  height: 100%;
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--paper-deep);
  overflow: hidden;
}

body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(190, 168, 118, 0.12), transparent 22%, transparent 78%, rgba(143, 160, 148, 0.14)),
    var(--paper-deep);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
}

.h5-page {
  position: relative;
  width: min(100%, 430px);
  height: 100svh;
  min-height: 100svh;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scroll-padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(245, 240, 230, 0.12), rgba(245, 240, 230, 0.28)),
    url("../assets/backgrounds/h5-background.png");
  background-position: center top;
  background-size: 100% auto;
  background-repeat: repeat-y;
  box-shadow: 0 0 36px rgba(62, 58, 52, 0.08);
  isolation: isolate;
}

.h5-page::-webkit-scrollbar {
  display: none;
}

.hero-section,
.story-section,
.collection-section {
  height: 100svh;
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.page-dots {
  position: fixed;
  z-index: 20;
  top: 50%;
  right: max(10px, calc((100vw - min(100vw, 430px)) / 2 + 10px));
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.page-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid rgba(62, 58, 52, 0.28);
  border-radius: 999px;
  background: rgba(245, 240, 230, 0.58);
  box-shadow: 0 2px 8px rgba(54, 45, 34, 0.08);
  cursor: pointer;
  transition: height 0.28s ease, background-color 0.28s ease, border-color 0.28s ease, transform 0.28s ease;
}

.page-dot.is-active {
  height: 24px;
  border-color: rgba(158, 63, 47, 0.5);
  background: rgba(158, 63, 47, 0.72);
}

.swipe-hint {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(62, 58, 52, 0.46);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.12em;
  transform: translateX(-50%);
  pointer-events: none;
}

.swipe-hint::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1px solid rgba(158, 63, 47, 0.62);
  border-bottom: 1px solid rgba(158, 63, 47, 0.62);
  transform: rotate(45deg) translateY(-2px);
  animation: swipeHint 1.8s ease-in-out infinite;
}

.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.mist-layer,
.section-mist {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.mist {
  position: absolute;
  left: -22%;
  width: 144%;
  height: 120px;
  background:
    radial-gradient(ellipse at 20% 48%, rgba(143, 160, 148, 0.5), transparent 34%),
    radial-gradient(ellipse at 52% 52%, rgba(118, 132, 122, 0.4), transparent 38%),
    radial-gradient(ellipse at 82% 44%, rgba(185, 154, 85, 0.22), transparent 28%),
    linear-gradient(90deg, transparent 0%, rgba(143, 160, 148, 0.24) 24%, rgba(143, 160, 148, 0.3) 52%, transparent 100%);
  filter: url("#ink-diffusion") blur(15px);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  opacity: 0.11;
  transform: translate3d(0, 0, 0);
}

.mist-far-a {
  top: 10svh;
  animation: farMistDrift 26s ease-in-out infinite alternate;
}

.mist-far-b {
  top: 52svh;
  opacity: 0.08;
  transform: translateX(-10%);
  animation: farMistDriftReverse 30s ease-in-out infinite alternate;
}

.section-mist::before {
  content: "";
  position: absolute;
  left: -15%;
  top: 0;
  width: 130%;
  height: 86px;
  background:
    radial-gradient(ellipse at center, rgba(62, 58, 52, 0.18), transparent 54%),
    linear-gradient(90deg, transparent, rgba(143, 160, 148, 0.3), transparent);
  filter: url("#ink-diffusion") blur(13px);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  opacity: 0.15;
  animation: transitionMist 18s ease-in-out infinite alternate;
}

.mist-transition-b::before,
.mist-transition-d::before {
  animation-duration: 22s;
  animation-direction: alternate-reverse;
}

.hero-section,
.story-section,
.collection-section {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  z-index: 1;
}

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(30px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
}

.hero-card-stage {
  position: relative;
  z-index: 3;
  width: min(76vw, 318px);
  max-width: 78%;
  perspective: 1200px;
  margin-top: 2svh;
}

.hero-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 1573;
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  filter: drop-shadow(0 18px 22px rgba(54, 45, 34, 0.18));
}

.hero-card.is-ready {
  animation: cardRise 0.72s ease-out forwards;
}

.hero-card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 1.2s ease-in-out;
}

.hero-card.is-flipped .hero-card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 7.8% / 5%;
}

.card-front {
  transform: rotateY(180deg);
}

.hero-copy {
  position: relative;
  z-index: 4;
  width: min(82vw, 350px);
  margin: 20px auto 0;
  text-align: left;
}

.hero-kicker,
.collection-kicker {
  margin: 0 0 10px;
  color: rgba(62, 58, 52, 0.62);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0;
}

.hero-title,
.section-title,
.collection-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0;
}

.hero-title {
  font-size: 34px;
  line-height: 1.22;
}

.hero-text {
  margin: 18px 0 0;
  color: rgba(62, 58, 52, 0.78);
  font-size: 16px;
  line-height: 1.9;
}

.start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  min-width: 152px;
  margin-top: 24px;
  padding: 0 24px;
  border: 1px solid rgba(185, 154, 85, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.82), rgba(233, 219, 188, 0.68)),
    rgba(245, 240, 230, 0.92);
  color: var(--ink);
  box-shadow: 0 9px 18px rgba(62, 58, 52, 0.11);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.start-button:active {
  transform: translateY(2px) scale(0.985);
  box-shadow: 0 5px 12px rgba(62, 58, 52, 0.1);
}

.start-button:focus-visible {
  outline: 2px solid rgba(158, 63, 47, 0.6);
  outline-offset: 4px;
}

.hero-ending {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(185, 154, 85, 0.28);
  color: rgba(72, 69, 62, 0.5);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.9;
}

.reveal-after-flip {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
}

.intro-complete .reveal-after-flip {
  animation: copyReveal 0.72s ease forwards;
}

.intro-complete .hero-kicker {
  animation-delay: 0.04s;
}

.intro-complete .hero-title {
  animation-delay: 0.2s;
}

.intro-complete .hero-text {
  animation-delay: 0.36s;
}

.intro-complete .start-button {
  animation-delay: 0.54s;
}

.intro-complete .hero-ending {
  animation-delay: 0.68s;
}

.story-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8svh 0;
}

.story-content {
  position: relative;
  z-index: 4;
  width: min(82vw, 350px);
  margin: 0 auto;
  text-align: left;
}

.story-content,
.story-content * {
  text-align: left;
}

.story-main {
  width: 100%;
}

.date-line {
  margin: 0 0 8px;
  color: rgba(62, 58, 52, 0.78);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.45;
}

.season-line {
  margin: 0 0 32px;
  color: rgba(62, 58, 52, 0.56);
  font-size: 14px;
  line-height: 1.7;
}

.section-title {
  font-size: 30px;
  line-height: 1.28;
}

.vermilion-line {
  display: block;
  width: 42px;
  height: 2px;
  margin: 17px 0 28px;
  background: linear-gradient(90deg, var(--seal), rgba(158, 63, 47, 0.16));
  border-radius: 2px;
}

.ritual-list {
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ritual-list li,
.body-copy,
.small-heading {
  color: rgba(62, 58, 52, 0.78);
  font-size: 18px;
  line-height: 1.85;
}

.ritual-list li {
  position: relative;
  padding-left: 18px;
}

.ritual-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.82em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(185, 154, 85, 0.78);
}

.body-copy {
  margin: 0 0 18px;
}

.small-heading {
  margin: 0 0 16px;
  color: rgba(158, 63, 47, 0.82);
  font-family: var(--serif);
  font-size: 18px;
}

.story-ending {
  width: 100%;
  margin: 48px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(185, 154, 85, 0.25);
  color: rgba(72, 69, 62, 0.52);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
}

.ink-illustration,
.decor,
.hero-bamboo,
.collection-seal {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.bamboo {
  opacity: 0.32;
  transform-origin: center;
  will-change: transform;
}

.hero-bamboo {
  inset: 0;
  z-index: 2;
}

.bamboo-one {
  position: absolute;
  width: min(40vw, 168px);
  top: 2svh;
  right: -15%;
  animation: bambooFloatA 12s ease-in-out infinite alternate;
}

.bamboo-two {
  position: absolute;
  width: min(36vw, 152px);
  left: -14%;
  bottom: 10svh;
  animation: bambooFloatB 15s ease-in-out infinite alternate;
}

.decor {
  z-index: 2;
  width: min(34vw, 146px);
}

.decor-right-top {
  right: -16%;
  top: 11svh;
  animation: bambooFloatB 14s ease-in-out infinite alternate;
}

.decor-left-mid {
  left: -15%;
  top: 28svh;
  animation: bambooFloatA 16s ease-in-out infinite alternate-reverse;
}

.decor-right-low {
  right: -18%;
  bottom: 13svh;
  animation: bambooFloatA 13s ease-in-out infinite alternate;
}

.decor-left-low {
  left: -17%;
  bottom: 11svh;
  animation: bambooFloatB 18s ease-in-out infinite alternate-reverse;
}

.ink-illustration {
  z-index: 2;
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.horse-illustration {
  width: min(46vw, 198px);
  right: -5%;
  bottom: 4svh;
  opacity: 0;
}

.panda-illustration {
  width: min(39vw, 168px);
  right: 0;
  bottom: 5svh;
}

.reveal.is-visible .horse-illustration {
  opacity: 0.19;
  transform: translate3d(0, 0, 0);
}

.reveal.is-visible .panda-illustration {
  opacity: 0.31;
  transform: translate3d(0, 0, 0);
}

.collection-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8svh 0 7svh;
}

.collection-content {
  position: relative;
  z-index: 4;
  width: min(82vw, 350px);
}

.collection-title {
  font-size: 30px;
  line-height: 1.28;
}

.collection-card-wrap {
  width: min(50vw, 214px);
  margin: 26px 0 28px;
  filter: drop-shadow(0 13px 18px rgba(54, 45, 34, 0.15));
}

.collection-card {
  border-radius: 7.8% / 5%;
}

.collection-fields {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(185, 154, 85, 0.28);
  border-bottom: 1px solid rgba(185, 154, 85, 0.28);
}

.collection-fields div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(185, 154, 85, 0.15);
}

.collection-fields div:last-child {
  border-bottom: 0;
}

.collection-fields dt,
.collection-fields dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
}

.collection-fields dt {
  color: rgba(62, 58, 52, 0.54);
}

.collection-fields dd {
  color: rgba(62, 58, 52, 0.82);
  word-break: break-word;
}

.collection-seal {
  z-index: 2;
  width: 88px;
  right: 9%;
  top: 11svh;
  opacity: 0.23;
}

.collection-ending {
  margin-top: 34px;
}

.page-footer {
  position: relative;
  z-index: 3;
  width: min(82vw, 350px);
  margin: 0 auto;
  padding: 0 0 max(34px, env(safe-area-inset-bottom));
  color: rgba(62, 58, 52, 0.56);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.9;
}

.page-footer p {
  margin: 0 0 12px;
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.68s ease, transform 0.68s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes swipeHint {
  0%, 100% {
    opacity: 0.38;
    transform: rotate(45deg) translate3d(0, -2px, 0);
  }
  50% {
    opacity: 0.9;
    transform: rotate(45deg) translate3d(4px, 2px, 0);
  }
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, -8px, 0);
  }
}

@keyframes copyReveal {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes farMistDrift {
  from {
    transform: translate3d(-8%, 0, 0);
  }
  to {
    transform: translate3d(8%, 0, 0);
  }
}

@keyframes farMistDriftReverse {
  from {
    transform: translate3d(9%, 0, 0);
  }
  to {
    transform: translate3d(-9%, 0, 0);
  }
}

@keyframes transitionMist {
  from {
    opacity: 0.12;
    transform: translate3d(-8%, 0, 0);
  }
  to {
    opacity: 0.19;
    transform: translate3d(8%, 0, 0);
  }
}

@keyframes bambooFloatA {
  from {
    transform: translate3d(0, -4px, 0) rotate(-2deg);
  }
  to {
    transform: translate3d(6px, 5px, 0) rotate(2deg);
  }
}

@keyframes bambooFloatB {
  from {
    transform: translate3d(-3px, 4px, 0) rotate(2deg);
  }
  to {
    transform: translate3d(4px, -5px, 0) rotate(-2deg);
  }
}

@media (max-width: 360px) {
  .page-dots {
    right: 7px;
    gap: 8px;
  }

  .hero-section {
    padding-left: 22px;
    padding-right: 22px;
  }

  .hero-title {
    font-size: 31px;
  }

  .section-title,
  .collection-title {
    font-size: 28px;
  }

  .ritual-list li,
  .body-copy,
  .small-heading {
    font-size: 17px;
  }

  .collection-fields div {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
  }
}

@media (min-width: 431px) {
  body {
    padding: 0;
  }

  .h5-page {
    min-height: 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .swipe-hint::after {
    animation: none;
  }

  .hero-card {
    opacity: 1;
    transform: none;
  }

  .hero-card-inner {
    transform: rotateY(180deg);
  }

  .reveal-after-flip,
  .reveal,
  .ink-illustration {
    opacity: 1;
    transform: none;
  }

  .horse-illustration {
    opacity: 0.16;
  }

  .panda-illustration {
    opacity: 0.26;
  }
}
