:root {
  --bg: #0a0a0a;
  --fg: #faf4e6;
  --accent: #c9a96e;
  --transition-page: 450ms;
  --fg-soft: #e2d4bc;
  --fg-dim: #a49784;
  --line: rgba(244, 235, 219, 0.22);
  --line-soft: rgba(244, 235, 219, 0.09);
}

* { box-sizing: border-box; }
[hidden] {
  display: none !important;
}
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
}

.app, .hero { width: 100%; height: 100%; }
.hero { position: relative; }

#ripple-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url("./assets/rill-water-bg.png") center top / cover no-repeat;
  z-index: 1;
}

.hero-content {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1440px;
  height: 1024px;
  transform-origin: top center;
  z-index: 4;
}

.hero-logo-ribbon {
  position: absolute;
  width: 246.5px;
  height: 984px;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

/* "此镜" — Chinese signature below the RiLL logo. CN-only.
   Hidden via [hidden] attr when not on home default; further hidden via
   CSS when UI lang isn't Chinese. */
.hero-logo-subtitle {
  display: none;
}
:lang(zh) .hero-logo-subtitle:not([hidden]) {
  display: block;
  position: absolute;
  top: 143px;
  left: 50%;
  transform: translateX(calc(-50% - 28px));
  margin: 0;
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", serif;
  font-size: 25px;
  font-weight: 400;
  color: #faf4e6;
  letter-spacing: 0.17em;
  opacity: 0.3;
  text-align: center;
  pointer-events: none;
}

.home-hit {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 120px;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 50;
}

.top-link {
  position: absolute;
  top: 40px;
  background: transparent;
  border: 0;
  padding: 0;
  color: #faf4e6;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  line-height: 30px;
  letter-spacing: 0.2px;
}
.top-link-left { left: 60px; }
.top-link-right { right: 60px; }

.lang-toggle {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0;
}

.lang-opt {
  background: transparent;
  border: 0;
  padding: 0;
  color: #faf4e6;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  line-height: 30px;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lang-opt:hover { color: var(--accent); }

.lang-opt.is-active {
  color: var(--accent);
}

.lang-sep {
  color: #faf4e6;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  line-height: 30px;
}

.back-arrow {
  position: absolute;
  top: 228px;
  left: 60px;
  z-index: 120;
  pointer-events: auto;
  border: 0;
  background: transparent;
  padding: 0;
  color: #faf4e6;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  transition: opacity var(--transition-page) ease, transform var(--transition-page) ease;
}

.back-arrow:hover {
  opacity: 0.82;
  transform: translateX(-3px);
}

.hero-quote,
.hero-philosophy,
.reflection-kicker,
.reflection-title {
  margin: 0;
  text-align: center;
  transition: opacity var(--transition-page) ease, transform var(--transition-page) ease;
}

.hero-quote {
  position: absolute;
  top: 400px;
  left: 50%;
  transform: translateX(-50%);
  width: 903px;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 56px;
  font-style: normal;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.128px;
  color: #faf4e6;
}

.hero-philosophy {
  position: absolute;
  top: 300px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 288px;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 24px;
  line-height: 36px;
  letter-spacing: 0.07px;
  text-align: left;
}

.hero-philosophy-more {
  position: absolute;
  top: 610px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  background: none;
  border: 0;
  padding: 6px 10px;
  font-family: "Satoshi Variable", -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: #c9a96e;
  cursor: pointer;
  transition: opacity 250ms ease;
}
.hero-philosophy-more:hover { opacity: 0.7; }
body.is-philosophy .hero-philosophy-more { display: inline-block; }
:lang(zh) .hero-philosophy-more {
  top: 580px;
  font-family: "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: none;
}

.reflection-kicker {
  position: absolute;
  top: 160px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  font-style: normal;
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: 0.2px;
  color: #faf4e6;
  white-space: nowrap;
  text-align: center;
}

.reflection-title {
  position: absolute;
  top: 400px;
  left: 50%;
  transform: translateX(-50%);
  width: 734px;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 34px;
  font-style: normal;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.128px;
  color: #faf4e6;
}

.enter-btn {
  position: absolute;
  top: 588px;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  width: 120px;
  height: 44px;
  border-radius: 50px;
  border: 1px solid #faf4e6;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  color: #faf4e6;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 15px;
  font-style: normal;
  font-weight: 500;
  line-height: 15px;
  letter-spacing: 0.8px;
  text-align: center;
  cursor: pointer;
  transition: opacity var(--transition-page) ease, transform var(--transition-page) ease, border-color var(--transition-page) ease, box-shadow var(--transition-page) ease;
}

.enter-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.35);
  opacity: 0.96;
  transform: translateX(-50%) translateY(-1px);
}

.mode-select {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% - 10px), -50%);
  width: auto;
  display: flex;
  justify-content: center;
  gap: 190px;
  align-items: center;
}

.mode-card {
  width: 199px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.mode-card-left {
  width: 196px;
}

.mode-icon {
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.mode-icon-tarot {
  width: 208px;
  height: 212px;
  aspect-ratio: 49 / 50;
}

.mode-icon-meihua {
  width: 211px;
  height: 212px;
  aspect-ratio: 199 / 200;
}

.mode-title {
  margin: 10px 0 0;
  color: #fff;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px;
  letter-spacing: -0.249px;
}

.mode-title-cn {
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.mode-subtext {
  margin: 10px 0 0;
  color: #8a8a8a;
  text-align: center;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.314px;
}

.mode-enter-btn {
  position: static;
  transform: none;
  margin-top: 32px;
}

.mode-enter-btn:hover {
  transform: translateY(-1px);
}

.mode-soon {
  margin: 32px 0 0;
  color: #8a8a8a;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 25.6px;
  letter-spacing: -0.312px;
}

.intent-select {
  position: absolute;
  top: 56%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 980px;
  display: flex;
  justify-content: center;
  gap: 130px;
  align-items: center;
}

.intent-card {
  position: relative;
  width: 240px;
  border: 0;
  background: transparent;
  color: #faf4e6;
  padding: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.intent-card::before {
  content: "";
  position: absolute;
  top: 180px;
  left: 50%;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(201, 169, 110, 0.42) 0%,
    rgba(201, 169, 110, 0.22) 32%,
    rgba(201, 169, 110, 0.08) 58%,
    transparent 78%);
  filter: blur(18px);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.5s ease;
  animation: intent-spotlight 4.2s ease-in-out infinite;
}

.intent-card:nth-child(1)::before { animation-delay: 0s; }
.intent-card:nth-child(2)::before { animation-delay: 0.7s; }
.intent-card:nth-child(3)::before { animation-delay: 1.4s; }

@keyframes intent-spotlight {
  0%, 100% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(0.95);
  }
  50% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.intent-card > * { position: relative; z-index: 1; }

.intent-card:hover {
  transform: translateY(-10px);
  opacity: 1;
}

.intent-card:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.18);
  background: radial-gradient(closest-side,
    rgba(255, 225, 170, 0.6) 0%,
    rgba(201, 169, 110, 0.32) 32%,
    rgba(201, 169, 110, 0.12) 58%,
    transparent 78%);
  animation: none;
}

.intent-card:active {
  transform: translateY(-4px);
}

.intent-image {
  display: block;
  width: 240px;
  height: 384px;
  object-fit: contain;
  margin: 0 auto;
  animation: intent-float 4.2s ease-in-out infinite;
  transition: filter 0.45s ease;
  will-change: transform;
}

.intent-card:nth-child(1) .intent-image { animation-delay: 0s; }
.intent-card:nth-child(2) .intent-image { animation-delay: 0.7s; }
.intent-card:nth-child(3) .intent-image { animation-delay: 1.4s; }

@keyframes intent-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.intent-card:hover .intent-image {
  filter: drop-shadow(0 10px 28px rgba(255, 220, 180, 0.28));
}

.intent-caption {
  position: relative;
  display: inline-block;
  margin-top: 20px;
  padding-bottom: 6px;
  color: #faf4e6;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 20px;
  line-height: 33px;
  letter-spacing: 1.089px;
  font-weight: 400;
  white-space: nowrap;
  transition: opacity var(--transition-page) ease, transform var(--transition-page) ease, font-weight var(--transition-page) ease;
}

.intent-caption::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 1px;
  background: rgba(250, 244, 230, 0.35);
  transform: translateX(-50%);
  transition: width 0.45s ease, background 0.45s ease, opacity 0.45s ease;
  animation: intent-underline-pulse 2.6s ease-in-out infinite;
}

@keyframes intent-underline-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.intent-card:hover .intent-caption::after {
  width: 88%;
  background: var(--accent);
  opacity: 1;
  animation: none;
}

.intent-num {
  color: #faf4e6;
  transition: color var(--transition-page) ease;
}

.intent-card:hover .intent-num {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .intent-image,
  .intent-caption::after,
  .intent-card::before {
    animation: none;
  }
}

.intent-entry {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1440px;
  height: 1024px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.intent-entry-title {
  margin: 170px 0 0;
  width: 641px;
  color: #faf4e6;
  text-align: center;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 36px;
  font-style: normal;
  font-weight: 400;
  line-height: 46.8px;
  letter-spacing: 1.089px;
}

.intent-entry-copy {
  margin: 81px 0 0;
  width: 641px;
  color: #faf4e6;
  text-align: center;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 36px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.128px;
}

.intent-entry-hints {
  margin: 39px 0 0;
  color: #8a8a8a;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 25.6px;
  letter-spacing: -0.312px;
}

.intent-entry-input {
  margin-top: 47px;
  width: 560px;
  height: auto;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.2px;
  padding: 10px 4px;
  outline: none;
  text-align: center;
  transition: border-color var(--transition-page) ease;
}

.intent-entry-input::placeholder {
  color: var(--fg-dim);
  opacity: 0.7;
}

.intent-entry-input:focus {
  border-bottom-color: var(--accent);
}

.intent-entry-begin {
  position: static;
  transform: none;
  margin-top: 59px;
}

.intent-entry-begin:hover {
  transform: translateY(-1px);
}

.intent-animation-stage {
  margin-top: 20px;
  width: 560px;
  height: 120px;
  border-radius: 12px;
  border: 1px dashed rgba(250, 244, 230, 0.2);
}

.pre-stage {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1440px;
  height: 1024px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.pre-stage-title {
  margin: 170px 0 0;
  width: 641px;
  color: #faf4e6;
  text-align: center;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 1.089px;
}

.pre-stage-copy {
  position: absolute;
  top: 426px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: 800px;
  color: #faf4e6;
  text-align: center;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 48px;
  font-style: normal;
  font-weight: 400;
  line-height: 57.6px;
  letter-spacing: -0.128px;
  opacity: 0;
  transition: opacity 500ms ease;
  z-index: 2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.pre-stage.show-guide .pre-stage-copy {
  opacity: 1;
}

.pre-stage-pick-hint {
  position: absolute;
  top: 300px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(250, 244, 230, 0.85);
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px;
  letter-spacing: -0.249px;
  opacity: 0;
  transition: opacity 280ms ease;
  z-index: 2;
}

.pre-stage.show-deck .pre-stage-pick-hint {
  opacity: 1;
}

.pre-deck {
  position: absolute;
  top: 57%;
  left: 50%;
  width: calc(100% - 180px);
  max-width: 1220px;
  height: 620px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
  z-index: 2;
}

.pre-stage.show-deck .pre-deck {
  opacity: 1;
  pointer-events: auto;
}

.pre-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 158px;
  height: 258px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(0.9);
  transform-origin: center 148%;
  transition: transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 420ms ease;
  will-change: transform, opacity;
  opacity: 0;
}

.pre-stage.show-deck .pre-card {
  transform: translate(calc(-50% + (var(--i) - 10.5) * 39px), calc(-50% + var(--y, 0px))) rotate(calc((var(--i) - 10.5) * 3.6deg));
  opacity: 1;
}

.pre-stage.show-deck .pre-card:hover {
  transform: translate(calc(-50% + (var(--i) - 10.5) * 39px), calc(-50% + var(--y, 0px) - 11px)) rotate(calc((var(--i) - 10.5) * 3.6deg)) scale(1.03);
}

.pre-card:nth-child(1), .pre-card:nth-child(22) { --y: -86px; }
.pre-card:nth-child(2), .pre-card:nth-child(21) { --y: -72px; }
.pre-card:nth-child(3), .pre-card:nth-child(20) { --y: -60px; }
.pre-card:nth-child(4), .pre-card:nth-child(19) { --y: -49px; }
.pre-card:nth-child(5), .pre-card:nth-child(18) { --y: -39px; }
.pre-card:nth-child(6), .pre-card:nth-child(17) { --y: -30px; }
.pre-card:nth-child(7), .pre-card:nth-child(16) { --y: -22px; }
.pre-card:nth-child(8), .pre-card:nth-child(15) { --y: -16px; }
.pre-card:nth-child(9), .pre-card:nth-child(14) { --y: -10px; }
.pre-card:nth-child(10), .pre-card:nth-child(13) { --y: -5px; }
.pre-card:nth-child(11), .pre-card:nth-child(12) { --y: 0px; }

.pre-card.is-faded {
  opacity: 0;
}

.pre-card.is-selected {
  z-index: 6;
  transform: translate(-50%, -50%) rotate(0deg) scale(1.08) !important;
}

.pre-card-inner {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pre-card.is-revealed .pre-card-inner {
  transform: rotateY(180deg);
}

.pre-card-face {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 8px;
  backface-visibility: hidden;
}

.pre-card-back {
  border: 1.6px solid rgba(250, 244, 230, 0.52);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, rgba(255, 255, 255, 0) 1px 7px),
    radial-gradient(circle at 26% 18%, rgba(250, 244, 230, 0.2), transparent 44%),
    radial-gradient(circle at 72% 78%, rgba(201, 169, 110, 0.18), transparent 52%),
    linear-gradient(145deg, rgba(16, 17, 22, 0.97), rgba(6, 7, 10, 0.98));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.pre-card-front {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: rgba(12, 12, 16, 0.92);
  transform: rotateY(180deg);
  border: 1.4px solid rgba(250, 244, 230, 0.38);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.pre-card-front.is-reversed {
  transform: rotateY(180deg) rotate(180deg);
}

.reading-result,
.guidance-result {
  --rill-reading-primary: #f5ecd8;
  --rill-reading-secondary: #e2d8c4;
  --rill-reading-soft: rgba(226, 216, 196, 0.92);
}

.guidance-result,
.guidance-result * {
  font-family: "Satoshi Variable", sans-serif;
}

.reading-result {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 1160px;
}

.guidance-result {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 1160px;
}

.reading-title {
  margin: 0;
  color: var(--rill-reading-primary);
  text-align: center;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 26px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.07px;
}

.reading-layout {
  margin-top: 44px;
  display: flex;
  gap: 64px;
  align-items: flex-start;
}

.reading-left {
  width: 320px;
  margin-top: -32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reading-card-image {
  display: block;
  flex-shrink: 0;
  width: min(210px, 100%);
  max-width: 100%;
  height: auto;
  max-height: min(420px, 70vh);
  object-fit: contain;
  object-position: center;
  border: 1px solid rgba(250, 244, 230, 0.35);
  background: rgba(12, 12, 16, 0.5);
}

.reading-card-image.is-reversed {
  transform: rotate(180deg);
}

.reading-card-name {
  margin: 24px 0 0;
  color: var(--rill-reading-primary);
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px;
  letter-spacing: -0.249px;
  text-align: center;
}

.reading-card-keywords {
  margin: 20px 0 0;
  color: var(--fg-dim);
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  text-align: center;
}

.reading-card-summary {
  margin: 24px 0 0;
  color: #faf4e6;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: 30px;
  letter-spacing: 0.2px;
  text-align: center;
}

.reading-right {
  width: 776px;
}

.reading-main-flow {
  position: relative;
}

.reading-core {
  margin: 0 0 32px;
  color: var(--fg-soft);
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 30px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  max-width: 640px;
  transition: opacity 0.35s ease;
}

.reading-result.is-reading-loading .reading-core.is-reading-loading,
.reading-scroll.is-reading-loading .reading-core.is-reading-loading {
  animation: reading-pulse 2.4s ease-in-out infinite;
}

@keyframes reading-pulse {
  0%,
  100% {
    opacity: 0.42;
  }

  50% {
    opacity: 1;
  }
}

.reading-body {
  margin-top: 8px;
}

.reading-error-wrap {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 24px;
  text-align: center;
}

.reading-error-msg {
  margin: 0;
  color: var(--rill-reading-secondary);
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 18px;
  line-height: 1.5;
}

.advice-loading.is-reading-loading {
  animation: reading-pulse 2.4s ease-in-out infinite;
  margin: 0;
  color: var(--rill-reading-secondary);
  font-size: 18px;
  text-align: center;
}

/* Advice Card — Layer 2 opening (italic serif, matches .reading-core so the
 * first sentence of every reading is visually unified) */
.advice-closing {
  margin: 0 0 32px 0;
  color: var(--fg-soft);
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 30px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  max-width: 640px;
}
.advice-closing:empty {
  display: none;
}

/* Advice Card — Layer 3 body paragraphs */
.advice-body {
  margin: 0 0 30px 0;
  max-width: 640px;
}

.advice-body .advice-block p {
  margin: 0 0 10px;
  color: var(--fg-soft);
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
}

.advice-body .advice-block p:last-child {
  margin-bottom: 0;
}

/* Advice Card — Layer 4 takeaway (action) with gold left bar */
.advice-action {
  margin: 0;
  padding: 4px 0 4px 18px;
  border-left: 1px solid var(--accent);
  color: var(--fg);
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.1px;
  max-width: 640px;
}
.advice-action:empty {
  display: none;
}

.guidance-inline-action {
  margin-top: 50px;
  display: flex;
  justify-content: center;
}

#session-end-quote:empty::before {
  content: "";
  display: block;
  min-height: 2.8em;
}

.reading-scroll.is-scroll-locked,
.reading-scroll.is-reading-loading,
.reading-scroll.is-advice-loading {
  scroll-snap-type: none;
  scroll-behavior: auto;
  overflow: hidden;
}

.reading-scroll {
  position: relative;
  height: 620px;
  overflow-y: auto;
  padding-right: 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 169, 110, 0) rgba(255, 255, 255, 0);
  transition: scrollbar-color 220ms ease;
}

.reading-result .reading-scroll::after {
  content: "";
  position: sticky;
  display: block;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  margin-top: -72px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 3;
}

.guidance-result .reading-scroll {
  overflow: hidden;
  scroll-snap-type: none;
  scrollbar-width: none;
  padding-right: 0;
}

.guidance-result .reading-scroll::-webkit-scrollbar {
  display: none;
}

.guidance-result .reading-main-flow {
  min-height: 620px;
}

.guidance-result .reading-screen {
  min-height: 620px;
}

.guidance-result .reading-screen-main {
  display: flex;
  flex-direction: column;
}

.guidance-result .guidance-inline-action {
  width: 100%;
  max-width: 640px;
  justify-content: center;
}

.reading-screen {
  min-height: 0;
}

.reading-point + .reading-point {
  margin-top: 32px;
}

.reading-point::before {
  content: "◇";
  display: block;
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: 0;
}

.reading-point h4 {
  margin: 0;
  color: var(--rill-reading-primary);
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 19px;
  font-style: normal;
  font-weight: 500;
  line-height: 27px;
  letter-spacing: -0.1px;
}

.reading-point p {
  margin: 10px 0 0;
  color: var(--fg);
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: -0.1px;
}

.reading-hook {
  margin: 28px 0 0;
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--accent);
}
.reading-hook:empty {
  display: none;
}

.reading-point strong {
  color: var(--rill-reading-primary);
  font-weight: 600;
}

/* Angle titles arrive wrapped in **bold** markdown — keep the h4's own weight */
.reading-point h4 strong {
  font-weight: inherit;
  color: inherit;
}

.reading-core strong {
  font-weight: 600;
}

.takeaway-title strong {
  font-weight: 600;
}

.reading-next {
  margin-top: 14px;
}

.reading-result .reading-screen-takeaway {
  display: block;
  min-height: 0;
  margin-top: 36px;
  padding-bottom: 90px;
}

.guidance-result .reading-screen-takeaway {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 620px;
  margin-top: 0;
  padding-bottom: 10px;
}

.takeaway-panel {
  width: 100%;
  padding: 0;
}

.takeaway-title {
  margin: 0;
  padding: 6px 0 6px 20px;
  border-left: 2px solid var(--accent);
  color: var(--fg);
  text-align: left;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 28px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2px;
  max-width: 640px;
}

.takeaway-actions {
  margin-top: 68px;
  display: flex;
  justify-content: center;
  gap: 36px;
}

.takeaway-btn {
  width: 210px;
  height: 48px;
  border-radius: 50px;
  border: 1px solid #faf4e6;
  background: rgba(0, 0, 0, 0.25);
  color: #faf4e6;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity var(--transition-page) ease, transform var(--transition-page) ease, border-color var(--transition-page) ease;
}

.takeaway-btn-wide {
  width: 240px;
}

.takeaway-btn:hover {
  border-color: var(--accent);
  opacity: 0.96;
  transform: translateY(-1px);
}

.takeaway-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a120a;
  font-weight: 500;
  letter-spacing: 1.2px;
}

.takeaway-btn.is-primary:hover {
  filter: brightness(1.08);
  opacity: 1;
  border-color: var(--accent);
}

.takeaway-btn.is-ghost {
  opacity: 0.5;
  border-color: rgba(250, 244, 230, 0.2);
}

.takeaway-btn.is-ghost:hover {
  opacity: 0.78;
  border-color: rgba(250, 244, 230, 0.45);
}

.round-dots {
  margin: 0 0 26px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.round-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(250, 244, 230, 0.22);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.round-dots .dot.done {
  background: rgba(250, 244, 230, 0.45);
}

.round-dots .dot.active {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}

.ending-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 56px;
}

.ending-title {
  margin: 0;
  color: #faf4e6;
  text-align: center;
  font-family: "Satoshi Variable", "Noto Sans SC", system-ui, sans-serif;
  font-size: 40px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.guidance-farewell-screen .guidance-farewell-text {
  margin: 0;
  max-width: 820px;
  padding: 0 28px;
  color: #f5ecd8;
  text-align: center;
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.ending-return-btn {
  position: static;
  transform: none;
  width: 100px;
  border: 1px solid #faf4e6;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.ending-return-btn:hover {
  transform: translateY(-1px);
}

.reading-scroll::-webkit-scrollbar {
  width: 8px;
}

.reading-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0);
  border-radius: 10px;
  transition: background 220ms ease;
}

.reading-scroll::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0);
  border-radius: 10px;
  transition: background 220ms ease;
}

.reading-scroll:hover {
  scrollbar-color: rgba(201, 169, 110, 0.65) rgba(255, 255, 255, 0.08);
}

.reading-scroll:hover::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

.reading-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0.65);
}

.reading-scroll:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 169, 110, 0.9);
}


.chapter-row {
  position: absolute;
  top: 680px;
  left: 50%;
  transform: translateX(-50%);
  width: 628px;
  display: flex;
  justify-content: space-between;
}

.chapter-index {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0 0 8px;
  color: #faf4e6;
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 20px;
  line-height: 46.8px;
  letter-spacing: 1.089px;
  font-weight: 400;
  cursor: pointer;
  transition: transform 0.45s ease, opacity 0.45s ease, font-weight var(--transition-page) ease;
}

.chapter-index::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 1px;
  background: rgba(250, 244, 230, 0.35);
  transform: translateX(-50%);
  transition: width 0.45s ease, background 0.45s ease, opacity 0.45s ease;
  animation: chapter-underline-pulse 2.6s ease-in-out infinite;
}

.chapter-row .chapter-index:nth-child(1)::after { animation-delay: 0s; }
.chapter-row .chapter-index:nth-child(2)::after { animation-delay: 0.7s; }
.chapter-row .chapter-index:nth-child(3)::after { animation-delay: 1.4s; }

@keyframes chapter-underline-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.chapter-index:hover {
  transform: translateY(-6px);
  opacity: 1;
}

.chapter-index:active {
  transform: translateY(-2px);
}

.chapter-index:hover::after {
  width: 92%;
  background: var(--accent);
  opacity: 1;
  animation: none;
}

.chapter-index:hover .chapter-num {
  color: var(--accent);
}

.chapter-num { color: #faf4e6; transition: color var(--transition-page) ease; }
.chapter-label { color: #faf4e6; }

.chapter-index.is-active .chapter-num { color: var(--accent); }
.chapter-index.is-active::after {
  width: 100%;
  background: var(--accent);
  opacity: 1;
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .chapter-index::after { animation: none; }
}

.hero-proverb {
  position: absolute;
  top: 934px;
  left: 50%;
  transform: translateX(-50%);
  width: 334px;
  margin: 0;
  text-align: center;
  color: #faf4e6;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 30px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.hero-proverb.is-small-note {
  font-family: "Satoshi Variable", "Cormorant Garamond", serif;
  font-size: 15px;
  font-style: normal;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: 0.3px;
  color: #a49784;
}

.home-flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  transition: none;
}
.home-flash.is-on {
  opacity: 0;
  visibility: hidden;
  transition: none;
}

/* ==========================================================================
   Daily Anchor — postcard version (Design Library §8, §9 example B)
   Accessed via homepage chapter-03 click.
   ========================================================================== */

.daily-anchor {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 980px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.postcard {
  position: relative;
  width: 980px;
  padding: 54px 60px 54px 54px;
  border: 1px solid var(--line-soft);
  background: #17110e;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  box-sizing: border-box;
  z-index: 1;
}

body.is-daily .hero-logo-ribbon {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.postcard::before,
.postcard::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.postcard::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.postcard::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.postcard-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.postcard-card-frame {
  position: relative;
  width: 240px;
  height: 400px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #000;
}
.postcard-card-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  pointer-events: none;
}
.postcard-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.postcard-card-image.is-reversed {
  transform: rotate(180deg);
}

.postcard-date-stamp {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stamp-line-top {
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.stamp-line-bot {
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--fg-dim);
  opacity: 0.85;
}

.postcard-right {
  display: block;
}

/*
 * ═══════════════════════════════════════════════════════════════════
 * DAILY ANCHOR POSTCARD — DESIGN LIBRARY (canonical hierarchy)
 * ═══════════════════════════════════════════════════════════════════
 * Reading order (right column, top → bottom):
 *   ① Card name + orientation  → .postcard-name
 *   ② 3 keywords (UPPERCASE)    → .postcard-keywords
 *   ③ Takeaway / core proverb   → .postcard-core      (italic serif, opens the card)
 *   ④ Color / Object / Moment   → .postcard-anchors   (3-column anchor grid)
 *   ⑤ Final takeaway (gold bar) → .postcard-takeaway  (closing CTA sentence)
 *
 * Also applied to the reading-result page in parallel:
 *   .reading-core        ≈ ③ (Cormorant italic, serves same role)
 *   .takeaway-title      ≈ ⑤ (gold left bar, closing sentence)
 * Keep these two sets in visual parity whenever the spec moves.
 */

/* ① Card name — Satoshi 20/500, --fg */
.postcard-name {
  margin: 0 0 20px 0;
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--fg);
}

/* ② Keywords — Satoshi 14/400, UPPERCASE, letter-spacing 1.8, --fg-dim */
.postcard-keywords {
  margin: 0 0 32px 0;
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* ③ Takeaway / core proverb — Cormorant Italic 29/400/1.4, --fg-soft, max-width 560 */
.postcard-core {
  margin: 0 0 44px 0;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-style: italic;
  font-size: 29px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--fg-soft);
  max-width: 560px;
}
.postcard-core:empty {
  display: none;
}

/* ④ Color / Object / Moment — 3-column anchor grid.
 *    Spec note: Color value may optionally be +1 size step (16 → 17/18)
 *    for quick scanning. Not currently applied. */
.postcard-anchors {
  border-top: 1px solid var(--line-soft);
  padding-top: 24px;
  padding-bottom: 6px;
  margin: 0 0 48px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.anchor-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.anchor-key {
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.anchor-val {
  margin: 0;
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--fg-soft);
}

/* ⑤ Final takeaway — Satoshi 22/500/1.45, 1px gold left bar, --fg, max-width 580.
 *    Always one line, never split into paragraphs; closing sentence of the card. */
.postcard-takeaway {
  margin: 0;
  padding: 4px 0 4px 18px;
  border-left: 1px solid var(--accent);
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.1px;
  color: var(--fg);
  max-width: 580px;
}
.postcard-takeaway:empty {
  display: none;
}

/* Got it button — pill style via .takeaway-btn, only override margin for layout */
.daily-got-it {
  margin-top: 36px;
}

/* "Already opened today" reminder */
.daily-come-back {
  margin: 14px 0 0 0;
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 300;
  color: var(--fg-dim);
  opacity: 0.6;
  letter-spacing: 0.2px;
  text-align: center;
}

/* Chinese-only font rules. EN UI is intentionally untouched.
   Excludes top-left lang toggle and top-right Menu (always EN). */
:lang(zh) .hero-quote,
:lang(zh) .reflection-kicker,
:lang(zh) .reflection-title,
:lang(zh) .hero-proverb,
:lang(zh) .pre-stage-title,
:lang(zh) .pre-stage-copy,
:lang(zh) .intent-entry-title,
:lang(zh) .intent-entry-copy {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", serif;
}

:lang(zh) .hero-philosophy,
:lang(zh) .intent-entry-hints,
:lang(zh) .intent-entry-input,
:lang(zh) .pre-stage-pick-hint {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* Buttons: CN sans (黑体 / 苹方), never serif. Weight inherits from each
   button's own rule (typically 500). */
:lang(zh) .enter-btn,
:lang(zh) .mode-enter-btn,
:lang(zh) .intent-entry-begin,
:lang(zh) .takeaway-btn,
:lang(zh) .daily-got-it,
:lang(zh) .ending-return-btn,
:lang(zh) #guidance-back-btn,
:lang(zh) #guidance-farewell-home-btn,
:lang(zh) .mode-title,
:lang(zh) .mode-subtext,
:lang(zh) .mode-soon {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* No italic in CN — applies to <em> from inline markdown AND elements that
   default to italic (reading-core, advice-closing, postcard-core). */
:lang(zh) em,
:lang(zh) .reading-core,
:lang(zh) .advice-closing,
:lang(zh) .postcard-core {
  font-style: normal;
}

/* Session-end / closing lines use 宋体 in CN.
   .advice-closing  — last line in advice card body
   .ending-title    — final takeaway after a normal session ends
   .guidance-farewell-text — final closing line after advice card flow */
:lang(zh) .advice-closing,
:lang(zh) .ending-title,
:lang(zh) .guidance-farewell-text {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", serif;
}

/* Chapter labels (01/02/03 序·照见·当下) feel small in CN; bump up. */
:lang(zh) .chapter-index {
  font-size: 24px;
}

/* ============================================================
   Menu (overlay + panel with internal nav ↔ detail switching)
   Lives OUTSIDE design-canvas → uses raw viewport units.
   Detail views (Traces / Archive / Taya) render INSIDE the panel
   on the same pearl background; Back returns to nav, Close closes
   the whole menu.
   ============================================================ */

body.menu-open {
  overflow: hidden;
}

/* Overlay covers the full viewport but fades in from transparent (top)
   to 0.20 dark, so the top-bar stays untouched and the boundary is a
   soft gradient instead of a hard horizontal line. */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 80px,
    rgba(0, 0, 0, 0.20) 220px,
    rgba(0, 0, 0, 0.20) 100%
  );
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}
.menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.menu-panel {
  position: fixed;
  top: 130px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  /* Pearl image, with a heavier dark layer on top so the panel fully
     obscures any homepage text behind it and reads moodier. */
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
    url('./assets/menu-bg-pearl.png') center center / cover no-repeat,
    #2a2a2a;
  /* Soft diffuse shadow outward — softens the hard rectangle edge into
     the surrounding overlay so the panel doesn't read as a cut-out box. */
  box-shadow: 0 0 120px 40px rgba(0, 0, 0, 0.55);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 450ms ease;
  overflow: hidden;
}
.menu-panel.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Back button (only visible when a detail view is active).
   Minimal text + underline accent — no pill background. */
.menu-back {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: #faf4e6;
  font-family: "Satoshi Variable", -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  padding: 4px 6px 6px;
  cursor: pointer;
  transition: opacity var(--transition-page) ease, transform var(--transition-page) ease;
  z-index: 4;
  opacity: 0.7;
}
.menu-back::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 1px;
  background: #faf4e6;
  opacity: 0.18;
}
.menu-back:hover {
  opacity: 1;
}
.menu-back-label { line-height: 1; }

/* ----------------------------------------
   Nav state (3 items, vertically distributed below header)
---------------------------------------- */
.menu-items {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 80px 0 60px;
  box-sizing: border-box;
}
.menu-item {
  display: block;
  border: 0;
  background: transparent;
  color: #faf4e6;
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.2px;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  padding: 12px 24px;
  transition: opacity 250ms ease;
}
.menu-item:hover {
  opacity: 1;
}
/* Only dim siblings when an item is actually hovered (not when hovering
   the panel's empty space). Uses :has() — modern browsers only. */
.menu-items:has(.menu-item:hover) .menu-item:not(:hover) {
  opacity: 0.35;
}

/* ----------------------------------------
   Detail views (rendered inside the panel, scrollable)
---------------------------------------- */
.menu-detail {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 80px 60px 60px;
  box-sizing: border-box;
  color: #faf4e6;
}
/* Native scrollbar hidden — we render our own moon indicator instead. */
.menu-detail { scrollbar-width: none; }
.menu-detail::-webkit-scrollbar { width: 0; display: none; }

/* Moon phase scroll indicator — drifts down the right edge and waxes
   from new moon to full as you scroll. Only shown when content overflows. */
.menu-moon {
  position: absolute;
  top: 80px;
  right: 22px;
  width: 34px;
  height: 34px;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 280ms ease;
  will-change: transform;
}
.menu-moon.is-visible { opacity: 1; }
.menu-moon-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 0 6px rgba(201, 169, 110, 0.25));
}
.menu-moon-dark {
  fill: rgba(250, 244, 230, 0.1);
  stroke: rgba(250, 244, 230, 0.25);
  stroke-width: 1.2;
}
.menu-moon-lit {
  fill: #f4e6c4;
}

/* Traces article */
.trace-content {
  max-width: 560px;
  margin: 0 auto;
}
.trace-date {
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.trace-title {
  font-family: "Satoshi Variable", -apple-system, system-ui, sans-serif;
  font-size: 32px;
  font-weight: 300;
  color: #faf4e6;
  margin: 0 0 56px;
  letter-spacing: -0.2px;
  line-height: 1.25;
}
.trace-body p {
  font-family: "Satoshi Variable", -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: #faf4e6;
  margin: 0 0 22px;
}
:lang(zh) .trace-body p {
  font-family: "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
}
.trace-body-zh { display: none; }
:lang(zh) .trace-body-zh { display: block; }
:lang(zh) .trace-body-en { display: none; }

/* Archive (Coming Soon) */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 0 20px;
  gap: 32px;
}
.cs-title {
  font-family: "Cormorant Garamond", "Satoshi Variable", serif;
  font-size: 56px;
  font-weight: 500;
  color: #faf4e6;
  margin: 0;
  letter-spacing: -0.5px;
}
.cs-body {
  font-family: "Satoshi Variable", -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  color: #a89a82;
  margin: 0;
  max-width: 380px;
}
:lang(zh) .cs-body {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", serif;
}
.cs-zh { display: none; }
:lang(zh) .cs-zh { display: block; }
:lang(zh) .cs-en { display: none; }

/* Taya */
.taya-page {
  display: flex;
  justify-content: center;
}
.taya-body {
  max-width: 560px;
  width: 100%;
}
.taya-prose-zh { display: none; }
:lang(zh) .taya-prose-en { display: none; }
:lang(zh) .taya-prose-zh { display: block; }
.taya-section {
  font-family: "Satoshi Variable", -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #c9a96e;
  margin: 56px 0 22px;
}
.taya-prose > .taya-section:first-child { margin-top: 0; }
:lang(zh) .taya-section {
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: none;
}
.taya-prose p {
  font-family: "Satoshi Variable", -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  color: #faf4e6;
  margin: 0 0 20px;
}
:lang(zh) .taya-prose p {
  font-family: "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  line-height: 1.75;
  margin-bottom: 6px;
}
.taya-quote {
  margin: 0 0 20px;
  padding-left: 18px;
  border-left: 1px solid rgba(201, 169, 110, 0.5);
  color: rgba(250, 244, 230, 0.78);
}
.taya-quote p { margin: 0 0 8px; font-size: 16px; }
.taya-quote p:last-child { margin-bottom: 0; }
.taya-sign {
  margin-top: 32px !important;
  color: rgba(250, 244, 230, 0.7);
  font-size: 15px !important;
}
.taya-contact {
  list-style: none;
  padding: 32px 0 0;
  margin: 64px 0 0;
  border-top: 1px solid rgba(250, 244, 230, 0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.taya-contact li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
  align-items: baseline;
}
.taya-contact-label {
  font-family: "Satoshi Variable", -apple-system, sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(250, 244, 230, 0.45);
}
.taya-contact-label-zh { display: none; }
:lang(zh) .taya-contact-label-en { display: none; }
:lang(zh) .taya-contact-label-zh { display: inline; }
:lang(zh) .taya-contact-label {
  font-family: "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  letter-spacing: 1px;
  text-transform: none;
  font-size: 12px;
}
.taya-contact-value {
  font-family: "Satoshi Variable", -apple-system, sans-serif;
  font-size: 14px;
  color: #faf4e6;
  text-decoration: none;
  transition: color 250ms ease;
}
.taya-contact-value:hover { color: #c9a96e; }
