/* 5Bazi — Guochao / ritual atmosphere (Chinese mystery layer) */

.sky-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.sky-layer .cloud {
  position: absolute;
  opacity: 0.14;
  color: var(--vermillion);
  animation: cloudDrift 28s linear infinite;
}
.sky-layer .cloud-a { top: 8%; left: -8%; width: min(420px, 55vw); animation-duration: 34s; }
.sky-layer .cloud-b { top: 58%; right: -10%; width: min(380px, 50vw); color: var(--jade); animation-duration: 40s; animation-direction: reverse; opacity: 0.11; }
.sky-layer .cloud-c { bottom: 6%; left: 18%; width: min(300px, 40vw); opacity: 0.08; animation-duration: 46s; }
@keyframes cloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(6%); }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.brand-seal {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--vermillion);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--font-zh), "Noto Serif SC", serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--vermillion);
  letter-spacing: 0.05em;
  transform: rotate(-8deg);
  background: rgba(194, 58, 43, 0.06);
  box-shadow: inset 0 0 0 1px rgba(194, 58, 43, 0.15);
}
.brand-text { display: flex; align-items: baseline; gap: 0.08rem; }

.today-bar {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(194,58,43,0.08), transparent 28%, transparent 72%, rgba(47,107,90,0.08)),
    rgba(255, 252, 248, 0.72);
  backdrop-filter: blur(10px);
}
.today-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  flex-wrap: wrap;
}
.today-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 140px;
}
.today-meta .label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--jade);
  font-weight: 650;
}
.today-meta .when {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}
.today-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(56px, 1fr));
  gap: 0.45rem;
  flex: 1;
  max-width: 420px;
}
.today-pillars .tp {
  text-align: center;
  padding: 0.35rem 0.25rem;
  border-radius: 10px;
  background: rgba(26, 21, 18, 0.04);
  border: 1px solid rgba(184, 137, 58, 0.25);
}
.today-pillars .tp b {
  display: block;
  font-family: var(--font-zh), "Noto Serif SC", serif;
  font-size: 1.05rem;
  color: var(--vermillion);
  font-weight: 700;
  line-height: 1.2;
}
.today-pillars .tp small {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Ritual split stage — Chinese mystery composition */
.ritual-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  min-height: calc(100vh - 140px);
  margin: 0;
}
.ritual-ink {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 400px at 20% 10%, rgba(255,255,255,0.08), transparent 50%),
    linear-gradient(160deg, #6e1f18 0%, #9a2c21 42%, #4a1814 100%);
  color: #fff7f2;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.4rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}
.ritual-ink::before {
  content: "八字";
  position: absolute;
  right: -0.15em;
  bottom: -0.15em;
  font-family: "Ma Shan Zheng", var(--font-zh), cursive;
  font-size: clamp(7rem, 22vw, 14rem);
  line-height: 0.8;
  opacity: 0.12;
  pointer-events: none;
  color: #fff;
}
.ritual-ink::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(232, 197, 120, 0.35);
  pointer-events: none;
}
.ritual-ink .crumb a { color: rgba(255,247,242,0.75); }
.ritual-ink .crumb { color: rgba(255,247,242,0.55); margin: 0 0 0.8rem; }
.ritual-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e8c578;
  font-weight: 650;
  margin-bottom: 0.85rem;
}
.ritual-kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: #e8c578;
}
.ritual-ink h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 0.85rem;
  max-width: 10ch;
  position: relative;
  z-index: 1;
}
.ritual-ink .lead {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255,247,242,0.82);
  max-width: 28rem;
  font-size: 1.05rem;
}
.ritual-ink .ritual-note {
  position: relative;
  z-index: 1;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: rgba(255,247,242,0.65);
  border-top: 1px solid rgba(232,197,120,0.25);
  padding-top: 1rem;
  max-width: 26rem;
}
.ritual-form {
  background:
    radial-gradient(500px 300px at 90% 0%, rgba(194,58,43,0.06), transparent 50%),
    rgba(247, 243, 238, 0.55);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}
.ritual-form .brush-x {
  position: absolute;
  right: 4%;
  top: 8%;
  width: min(280px, 48%);
  opacity: 0.07;
  pointer-events: none;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 14rem;
  line-height: 0.8;
  color: var(--ink);
  transform: rotate(-12deg);
}
.ritual-form .panel {
  background: rgba(255,252,248,0.92);
}
.ritual-form .panel::after { opacity: 0.7; }

/* Tablet pillars — 牌位感 */
.pillar {
  background:
    linear-gradient(180deg, #fffdf9 0%, #f3ebe1 100%);
  border: 1px solid rgba(184, 137, 58, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.65),
    0 8px 18px rgba(26,21,18,0.05);
  position: relative;
}
.pillar::before {
  content: "";
  position: absolute;
  left: 8px; right: 8px; top: 6px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(194,58,43,0.35), transparent);
}
.pillar .zh {
  font-family: var(--font-zh), "Noto Serif SC", serif;
  writing-mode: horizontal-tb;
}

.hero.guochao {
  min-height: calc(100vh - 120px);
  align-items: center;
  padding: 3.5rem 0 3rem;
}
.hero.guochao .hero-inner {
  max-width: 760px;
}
.hero.guochao .hero-mark {
  font-family: "Ma Shan Zheng", var(--font-zh), cursive;
  font-size: clamp(4.5rem, 14vw, 8rem);
  color: var(--vermillion);
  opacity: 0.14;
  line-height: 0.85;
  margin: 0 0 0.5rem;
  position: absolute;
  right: 4%;
  top: 12%;
  pointer-events: none;
  z-index: 0;
}
.hero.guochao .hero-inner { z-index: 1; }
.hero.guochao h1 {
  font-size: clamp(3.1rem, 9vw, 5.4rem);
  max-width: 11ch;
}

/* Cinematic homepage hero */
.hero-cinematic {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: calc(100vh - 118px);
  display: grid;
  align-items: center;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
  animation: heroKen 28s ease-in-out infinite alternate;
  filter: saturate(1.05) contrast(1.04);
}
.hero-media-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(247,243,238,0.88) 0%, rgba(247,243,238,0.72) 38%, rgba(247,243,238,0.28) 68%, rgba(26,21,18,0.18) 100%),
    radial-gradient(700px 420px at 70% 40%, rgba(194,58,43,0.12), transparent 60%);
}
@keyframes heroKen {
  from { transform: scale(1.05) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, 1%, 0); }
}
.hero-bagua {
  position: absolute;
  right: max(2%, 1rem);
  top: 50%;
  width: min(340px, 42vw);
  aspect-ratio: 1;
  transform: translateY(-50%);
  color: rgba(194, 58, 43, 0.55);
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
}
.hero-bagua svg {
  width: 100%;
  height: 100%;
  animation: baguaSpin 60s linear infinite;
}
@keyframes baguaSpin {
  to { transform: rotate(360deg); }
}
.hero-sparks {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.hero-sparks i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(232, 197, 120, 0.85);
  box-shadow: 0 0 0 1px rgba(194,58,43,0.15);
  animation: sparkFloat linear infinite;
  opacity: 0;
}
@keyframes sparkFloat {
  0% { transform: translateY(20px) scale(0.6); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(-110vh) scale(1); opacity: 0; }
}
.hero-mark-rise {
  animation: markDrift 9s ease-in-out infinite alternate;
}
@keyframes markDrift {
  from { transform: translateY(0) rotate(-2deg); opacity: 0.12; }
  to { transform: translateY(-12px) rotate(2deg); opacity: 0.2; }
}
.seal-breathe {
  animation: sealBreathe 3.6s ease-in-out infinite;
}
@keyframes sealBreathe {
  0%, 100% { transform: rotate(-9deg) scale(1); }
  50% { transform: rotate(-7deg) scale(1.04); }
}
.hero-rise > * {
  opacity: 0;
  transform: translateY(22px);
  animation: heroRise 0.9s var(--ease) forwards;
}
.hero-rise > *:nth-child(1) { animation-delay: 0.05s; }
.hero-rise > *:nth-child(2) { animation-delay: 0.15s; }
.hero-rise > *:nth-child(3) { animation-delay: 0.28s; }
.hero-rise > *:nth-child(4) { animation-delay: 0.4s; }
.hero-rise > *:nth-child(5) { animation-delay: 0.52s; }
.hero-rise > *:nth-child(6) { animation-delay: 0.64s; }
@keyframes heroRise {
  to { opacity: 1; transform: none; }
}
.hero-cinematic .hero-inner {
  position: relative;
  z-index: 2;
}
.hero-cinematic .btn-ghost {
  background: rgba(255,252,248,0.75);
  backdrop-filter: blur(6px);
}

.hero-ornament {
  display: flex;
  gap: 0.65rem;
  margin: 1.25rem 0 0;
  flex-wrap: wrap;
}
.hero-ornament span {
  font-family: var(--font-zh), "Noto Serif SC", serif;
  font-size: 0.95rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(194,58,43,0.25);
  color: var(--vermillion);
  background: rgba(255,252,248,0.65);
  border-radius: 999px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(4px);
}

@media (prefers-reduced-motion: reduce) {
  .hero-media img,
  .hero-bagua svg,
  .hero-mark-rise,
  .seal-breathe,
  .hero-rise > *,
  .hero-sparks i {
    animation: none !important;
  }
  .hero-rise > * { opacity: 1; transform: none; }
  .hero-media img { transform: none; }
}

.page-hero.mystic .wrap::after {
  content: "运";
  font-family: "Ma Shan Zheng", var(--font-zh), cursive;
  opacity: 0.09;
  font-size: clamp(6rem, 20vw, 11rem);
  right: 0;
  top: -1.4rem;
}

.seal-float {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid var(--vermillion);
  color: var(--vermillion);
  font-family: var(--font-zh), "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 1.1rem;
  transform: rotate(-9deg);
  background: rgba(255,247,242,0.9);
  box-shadow: 0 8px 20px rgba(194,58,43,0.12);
  margin-bottom: 1rem;
}

.preview-empty .ghost-pillars span {
  border-color: rgba(194, 58, 43, 0.28);
  background:
    linear-gradient(180deg, rgba(255,253,248,0.9), rgba(194,58,43,0.06));
}
.preview-empty .zh-hint {
  font-family: "Ma Shan Zheng", cursive;
  font-size: 2rem;
  color: var(--vermillion);
  opacity: 0.35;
}

.site-footer {
  background:
    linear-gradient(180deg, transparent, rgba(194,58,43,0.04));
  position: relative;
  z-index: 1;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-brand::before {
  content: "命";
  width: 28px;
  height: 28px;
  border: 1px solid var(--vermillion);
  display: grid;
  place-items: center;
  font-family: var(--font-zh), serif;
  font-size: 0.85rem;
  color: var(--vermillion);
  transform: rotate(-8deg);
}

@media (max-width: 900px) {
  .ritual-stage { grid-template-columns: 1fr; min-height: auto; }
  .ritual-ink { min-height: 320px; }
  .today-bar-inner { justify-content: center; text-align: center; }
  .today-meta { align-items: center; width: 100%; }
  .today-pillars { width: 100%; max-width: none; }
  .hero.guochao .hero-mark { right: 2%; top: 6%; opacity: 0.1; }
  .hero-bagua { width: min(220px, 56vw); top: 18%; transform: none; opacity: 0.45; }
  .hero-media-veil {
    background:
      linear-gradient(180deg, rgba(247,243,238,0.9) 0%, rgba(247,243,238,0.75) 55%, rgba(247,243,238,0.55) 100%);
  }
}
