:root {
  --night-0: #12161e;
  --night-1: #1a2130;
  --night-2: #243044;
  --paper: #f7f3ea;
  --cream: #ece6d9;
  --cream-deep: #e3dccb;
  --gold: #c5ab85;
  --gold-deep: #b8976d;
  --gold-soft: rgba(197, 171, 133, 0.65);
  --ink: #2c323f;
  --ink-soft: rgba(44, 50, 63, 0.66);
  --ink-muted: rgba(44, 50, 63, 0.44);
  --clay: #c88f7a;
  --line-light: rgba(44, 50, 63, 0.08);
  --line-night: rgba(236, 230, 217, 0.1);
  --shadow-soft: 0 22px 52px rgba(20, 24, 32, 0.07);
  --shadow-deep: 0 28px 68px rgba(8, 12, 18, 0.42);

  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --container: 1120px;
  --radius-lg: 24px;
  --radius-md: 16px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--night-0);
  color: var(--ink);
}

body {
  font-family: var(--font-serif);
  background-color: var(--cream);
  color: var(--ink);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.xy-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 36px;
}

/* —— Top Header —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 76px;
  display: flex;
  align-items: center;
  transition: background-color 0.4s ease, border-color 0.4s ease;
  background: rgba(18, 22, 30, 0.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(236, 230, 217, 0.06);
}

.site-header.is-scrolled {
  background: rgba(18, 22, 30, 0.9);
  border-bottom-color: rgba(197, 171, 133, 0.16);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 36px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.xy-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #f7f1e5;
  font-size: 13px;
  font-family: var(--font-serif);
  background: linear-gradient(145deg, #d0b790, #b8976d);
  box-shadow: 0 4px 12px rgba(184, 151, 109, 0.32);
  flex-shrink: 0;
}

.xy-seal--clay {
  background: linear-gradient(145deg, #d29c88, #b67c68);
  box-shadow: 0 4px 12px rgba(182, 124, 104, 0.28);
}

.xy-seal--night {
  background: linear-gradient(145deg, #2d384c, #1c2330);
  border: 1px solid rgba(197, 171, 133, 0.35);
  color: var(--gold);
}

.brand-mark__text {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-mark__title {
  color: #f7f1e5;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.18em;
}

.brand-mark__sub {
  color: rgba(236, 230, 217, 0.42);
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 38px;
}

.site-nav__link {
  color: rgba(243, 239, 230, 0.72);
  font-size: 14px;
  letter-spacing: 0.1em;
  transition: color 0.25s ease;
  position: relative;
  padding: 4px 0;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.site-nav__link:hover {
  color: #f7f1e5;
}

.site-nav__link:hover::after {
  width: 100%;
}

.lang-switch {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(236, 230, 217, 0.18);
  color: rgba(243, 239, 230, 0.8);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: all 0.25s ease;
}

.lang-switch:hover {
  border-color: var(--gold);
  color: #f7f1e5;
}

/* —— Hero Section (Grand Night Sanctuary) —— */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 156px 0 110px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 75% 20%, rgba(120, 140, 180, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 20% 72%, rgba(90, 100, 130, 0.14), transparent 60%),
    linear-gradient(180deg, #12161e 0%, #1a2130 58%, #243044 100%);
  color: #f3efe6;
  cursor: crosshair;
}

.hero__haze {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(circle at 72% 24%, rgba(210, 190, 150, 0.08), transparent 32%),
    radial-gradient(circle at 26% 62%, rgba(160, 175, 210, 0.07), transparent 38%);
  animation: haze-drift 18s ease-in-out infinite alternate;
}

.hero__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.sky-star {
  position: absolute;
  border-radius: 50%;
  background: rgba(245, 240, 230, 0.88);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.24);
  animation: star-twinkle 3.2s ease-in-out infinite alternate;
}

.sky-star.is-warm {
  background: rgba(220, 190, 140, 0.92);
  box-shadow: 0 0 8px rgba(197, 171, 133, 0.42);
}

.sky-star.is-born {
  animation: star-born 0.65s ease-out both, star-twinkle 2.4s ease-in-out 0.65s infinite alternate;
}

.sky-ripple {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 1px solid rgba(236, 230, 217, 0.45);
  border-radius: 50%;
  pointer-events: none;
  animation: ripple-expand 0.95s ease-out forwards;
}

.shooting-star {
  position: absolute;
  z-index: 2;
  width: 140px;
  height: 1.5px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.92), #c5ab85);
  border-radius: 2px;
  opacity: 0;
  transform: rotate(-26deg);
}

.shooting-star.is-active {
  animation: shoot-across 1.25s ease-out forwards;
}

.hero__layout {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 64px;
  align-items: center;
  cursor: default;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.32em;
}

.hero__eyebrow-line {
  width: 36px;
  height: 1px;
  background: rgba(197, 171, 133, 0.55);
}

.hero__title {
  color: #f7f1e5;
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 62px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.12em;
  margin-bottom: 28px;
  text-shadow: 0 0 36px rgba(197, 171, 133, 0.18);
  white-space: pre-line;
}

.hero__lead {
  max-width: 580px;
  color: rgba(243, 239, 230, 0.78);
  font-size: 17.5px;
  line-height: 2;
  letter-spacing: 0.05em;
  margin-bottom: 42px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-bottom: 56px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  border-radius: 999px;
  background: linear-gradient(145deg, #d4bc96, #b8976d);
  color: #161a22;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
  box-shadow: 0 12px 28px rgba(184, 151, 109, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(184, 151, 109, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(236, 230, 217, 0.22);
  color: #f3efe6;
  font-size: 14.5px;
  letter-spacing: 0.1em;
  transition: all 0.25s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--gold);
}

.hero__pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-top: 30px;
  border-top: 1px solid rgba(236, 230, 217, 0.12);
}

.hero__pillar-label {
  display: block;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.16em;
  margin-bottom: 5px;
}

.hero__pillar-val {
  color: rgba(243, 239, 230, 0.64);
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* —— Celestial Emblem in Hero Right Column —— */
.celestial-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.celestial-emblem {
  position: relative;
  width: 340px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.45s ease-out;
}

.celestial-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(236, 230, 217, 0.14);
}

.celestial-ring--1 {
  inset: 0;
  border-color: rgba(197, 171, 133, 0.18);
  animation: ring-pulse 8s ease-in-out infinite;
}

.celestial-ring--2 {
  inset: 34px;
  border-style: dashed;
  border-color: rgba(236, 230, 217, 0.14);
  animation: slow-spin 64s linear infinite;
}

.celestial-ring--3 {
  inset: 72px;
  border-color: rgba(197, 171, 133, 0.26);
  animation: ring-pulse 6.5s ease-in-out 1.2s infinite;
}

.celestial-glow {
  position: absolute;
  inset: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 230, 217, 0.18), rgba(197, 171, 133, 0.06) 52%, transparent 72%);
}

.celestial-moon {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  box-shadow: inset -28px -4px 0 0 #ece6d9;
  transform: rotate(-18deg);
  filter: drop-shadow(0 0 24px rgba(236, 230, 217, 0.22));
}

.celestial-star-node {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.celestial-star-node--n { top: -3.5px; left: 50%; transform: translateX(-50%); }
.celestial-star-node--s { bottom: -3.5px; left: 50%; transform: translateX(-50%); }
.celestial-star-node--e { right: -3.5px; top: 50%; transform: translateY(-50%); }
.celestial-star-node--w { left: -3.5px; top: 50%; transform: translateY(-50%); }

.celestial-caption {
  margin-top: 28px;
  text-align: center;
}

.celestial-caption__verse {
  font-family: var(--font-display);
  font-size: 17px;
  color: rgba(247, 241, 229, 0.88);
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}

/* —— Shared Section Headings —— */
.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 68px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-deep);
  font-size: 12.5px;
  letter-spacing: 0.28em;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.12em;
  line-height: 1.32;
  margin-bottom: 18px;
}

.section-desc {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

/* —— Philosophy Section (Warm Rice Paper) —— */
.philosophy {
  padding: 112px 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line-light);
}

.philosophy__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.philosophy-card {
  padding: 42px 36px;
  background: linear-gradient(180deg, #faf7f0 0%, var(--cream) 100%);
  border: 1px solid rgba(44, 50, 63, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s ease;
}

.philosophy-card:hover {
  transform: translateY(-4px);
}

.philosophy-card__num {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gold-deep);
  letter-spacing: 0.22em;
  margin-bottom: 18px;
  display: block;
}

.philosophy-card__title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.philosophy-card__body {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.9;
  letter-spacing: 0.03em;
}

/* —— Four Realms Section (Warm Cream) —— */
.realms {
  padding: 116px 0;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
}

.realms__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.realm-card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.realm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 56px rgba(20, 24, 32, 0.11);
}

.realm-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.realm-card__tag {
  font-size: 12px;
  color: var(--gold-deep);
  letter-spacing: 0.22em;
}

.realm-card__title {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.realm-card__desc {
  font-size: 15.5px;
  color: var(--ink-soft);
  line-height: 1.9;
  margin-bottom: 28px;
}

.realm-card__verse {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  border-left: 2px solid var(--gold);
}

.realm-verse-text {
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.75;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.realm-verse-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.realm-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid rgba(44, 50, 63, 0.08);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

/* —— Night Letters Section (Lamplight Notes) —— */
.letters {
  padding: 116px 0;
  background:
    radial-gradient(ellipse 75% 55% at 80% 18%, rgba(120, 140, 180, 0.14), transparent 55%),
    linear-gradient(180deg, #141820 0%, #1c2330 60%, #141820 100%);
  color: #f3efe6;
}

.letters .section-title {
  color: #f7f1e5;
}

.letters .section-desc {
  color: rgba(243, 239, 230, 0.7);
}

.letters__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.letter-card {
  background: rgba(28, 35, 48, 0.72);
  border: 1px solid rgba(236, 230, 217, 0.12);
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-deep);
}

.letter-card__occasion {
  display: inline-block;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.22em;
  margin-bottom: 20px;
}

.letter-card__quote {
  font-size: 16px;
  color: rgba(247, 241, 229, 0.9);
  line-height: 1.95;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}

.letter-card__sign {
  padding-top: 16px;
  border-top: 1px solid rgba(236, 230, 217, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: rgba(236, 230, 217, 0.5);
  letter-spacing: 0.12em;
}

/* —— Covenant & Coming Soon Section —— */
.covenant {
  padding: 112px 0;
  background: var(--paper);
}

.covenant-box {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
  border: 1px solid rgba(44, 50, 63, 0.08);
  border-radius: var(--radius-lg);
  padding: 56px 52px;
  box-shadow: var(--shadow-soft);
}

.covenant__principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(44, 50, 63, 0.1);
  margin-bottom: 48px;
}

.covenant-item__title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.covenant-item__desc {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.85;
}

.covenant__epilogue {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.covenant__status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid rgba(184, 151, 109, 0.35);
  color: var(--gold-deep);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  margin-bottom: 20px;
}

.covenant__epilogue-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--ink);
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.covenant__epilogue-sub {
  font-size: 15.5px;
  color: var(--ink-soft);
  line-height: 1.85;
}

/* —— Footer —— */
.site-footer {
  padding: 68px 0 52px;
  background: #12161e;
  color: rgba(243, 239, 230, 0.65);
  border-top: 1px solid rgba(236, 230, 217, 0.08);
}

.site-footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(236, 230, 217, 0.08);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer__motto {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 0.18em;
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: rgba(243, 239, 230, 0.42);
  flex-wrap: wrap;
  gap: 16px;
}

/* —— Toast Notification —— */
.sky-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(20, 24, 32, 0.92);
  border: 1px solid rgba(197, 171, 133, 0.35);
  color: #f7f1e5;
  font-size: 13px;
  letter-spacing: 0.08em;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sky-toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —— Keyframes —— */
@keyframes star-twinkle {
  0% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}

@keyframes star-born {
  0% { opacity: 0; transform: scale(0.2); }
  60% { opacity: 1; transform: scale(1.5); }
  100% { opacity: 0.95; transform: scale(1); }
}

@keyframes ripple-expand {
  0% { opacity: 0.75; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(2.8); }
}

@keyframes ring-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.98); }
  50% { opacity: 0.95; transform: scale(1.03); }
}

@keyframes slow-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shoot-across {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-26deg); }
  20% { opacity: 0.95; }
  100% { opacity: 0; transform: translate3d(280px, 140px, 0) rotate(-26deg); }
}

@keyframes haze-drift {
  0% { transform: translate3d(-1.5%, 0, 0) scale(1); }
  100% { transform: translate3d(1.5%, -1%, 0) scale(1.04); }
}

/* —— Responsive —— */
@media (max-width: 960px) {
  .hero__layout,
  .philosophy__grid,
  .realms__grid,
  .letters__grid,
  .covenant__principles {
    grid-template-columns: 1fr;
  }
  .site-nav {
    display: none;
  }
  .hero__pillars {
    grid-template-columns: repeat(2, 1fr);
  }
  .covenant-box {
    padding: 36px 26px;
  }
  .celestial-emblem {
    width: 260px;
    height: 260px;
  }
}
