:root {
  color-scheme: dark;
  --ink: #17241f;
  --pine: #10251d;
  --pine-deep: #07110e;
  --paper: #f3efe4;
  --paper-muted: #d8d1c0;
  --brass: #d1a85f;
  --brass-soft: #ecd291;
  --cinnabar: #8b3026;
  --line-dark: rgba(247, 237, 211, 0.17);
  --line-light: rgba(22, 44, 35, 0.16);
  --serif: "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #e8ebe4;
  color: var(--ink);
  font-family: var(--sans);
}

button,
textarea {
  font: inherit;
}

button {
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-width: 320px;
  overflow: hidden;
}

.sanctuary {
  position: relative;
  min-height: 900px;
  overflow: hidden;
  isolation: isolate;
  background: var(--pine-deep);
  color: var(--paper);
}

.sanctuary::before {
  position: absolute;
  inset: 0;
  z-index: -5;
  content: "";
  background:
    linear-gradient(180deg, #0b1d17 0%, #10251d 55%, #06100d 100%);
}

.sanctuary::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2, 8, 6, 0.7), transparent 25%, transparent 75%, rgba(2, 8, 6, 0.7)),
    linear-gradient(180deg, transparent 52%, rgba(2, 8, 6, 0.82) 88%, #06100d 100%);
}

.site-header {
  display: flex;
  width: min(1160px, calc(100% - 40px));
  height: 86px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-seal {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(236, 210, 145, 0.65);
  background: var(--cinnabar);
  color: #f7dda0;
  font-family: var(--serif);
  font-size: 20px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.brand-copy small {
  color: rgba(243, 239, 228, 0.58);
  font-size: 11px;
}

.day-mark {
  color: rgba(243, 239, 228, 0.58);
  font-family: var(--serif);
  font-size: 13px;
}

.hero-copy {
  width: min(720px, calc(100% - 40px));
  margin: 36px auto 0;
  text-align: center;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.55);
}

.eyebrow,
.section-heading > p {
  margin: 0 0 12px;
  color: var(--brass-soft);
  font-size: 12px;
  font-weight: 700;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.28;
}

.hero-copy > p:last-child {
  max-width: 620px;
  margin: 18px auto 0;
  color: rgba(243, 239, 228, 0.72);
  font-size: 16px;
  line-height: 1.85;
}

.temple-scene {
  position: absolute;
  top: 250px;
  left: 50%;
  z-index: -2;
  width: min(960px, 92vw);
  height: 390px;
  transform: translateX(-50%);
  pointer-events: none;
}

.moon {
  position: absolute;
  top: 3px;
  left: 18%;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(247, 221, 160, 0.32);
  border-radius: 50%;
  background: #d2bd8f;
  box-shadow: 0 0 54px rgba(225, 196, 126, 0.18);
  opacity: 0.72;
}

.ridge {
  position: absolute;
  right: -10%;
  bottom: 52px;
  left: -10%;
  height: 190px;
  background: #18352b;
  clip-path: polygon(0 82%, 11% 48%, 21% 68%, 36% 18%, 50% 70%, 63% 34%, 76% 64%, 89% 28%, 100% 75%, 100% 100%, 0 100%);
}

.ridge-back {
  opacity: 0.7;
}

.ridge-front {
  bottom: 12px;
  height: 154px;
  background: #091a15;
  clip-path: polygon(0 69%, 13% 35%, 27% 75%, 42% 30%, 54% 73%, 69% 42%, 84% 70%, 95% 38%, 100% 50%, 100% 100%, 0 100%);
}

.temple {
  position: absolute;
  bottom: 36px;
  left: 50%;
  width: 440px;
  height: 242px;
  transform: translateX(-50%);
}

.hall {
  position: absolute;
  bottom: 34px;
  left: 50%;
  width: 304px;
  height: 132px;
  border: 1px solid rgba(208, 157, 76, 0.42);
  background: #39211c;
  box-shadow: inset 0 0 52px rgba(5, 13, 10, 0.72), 0 18px 44px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
}

.hall > i {
  position: absolute;
  top: -7px;
  bottom: -2px;
  width: 16px;
  border: 1px solid rgba(220, 164, 77, 0.48);
  background: #6a3225;
}

.hall > i:nth-child(1) {
  left: 12px;
}

.hall > i:nth-child(2) {
  left: 84px;
}

.hall > i:nth-child(3) {
  right: 84px;
}

.hall > i:nth-child(4) {
  right: 12px;
}

.door {
  position: absolute;
  bottom: 0;
  left: 50%;
  display: grid;
  width: 94px;
  height: 104px;
  place-items: center;
  border: 1px solid rgba(225, 183, 102, 0.35);
  background: #191511;
  color: rgba(232, 189, 104, 0.76);
  font-family: var(--serif);
  font-size: 27px;
  transform: translateX(-50%);
}

.roof {
  position: absolute;
  left: 50%;
  width: 300px;
  height: 40px;
  border-top: 24px solid #24201a;
  border-right: 74px solid transparent;
  border-left: 74px solid transparent;
  filter: drop-shadow(0 9px 7px rgba(0, 0, 0, 0.34));
  transform: translateX(-50%);
}

.roof::before,
.roof::after {
  position: absolute;
  top: -29px;
  width: 86px;
  height: 9px;
  border-top: 4px solid #9d5935;
  content: "";
}

.roof::before {
  right: calc(100% - 25px);
  transform: rotate(-7deg);
  transform-origin: right;
}

.roof::after {
  left: calc(100% - 25px);
  transform: rotate(7deg);
  transform-origin: left;
}

.roof-back {
  top: 34px;
  width: 235px;
  border-top-color: #1c1915;
}

.roof-front {
  top: 80px;
  z-index: 2;
  width: 334px;
}

.steps {
  position: absolute;
  bottom: 17px;
  left: 50%;
  width: 230px;
  height: 30px;
  border-top: 8px solid #473729;
  border-bottom: 8px solid #2d2820;
  background: #3a3025;
  transform: translateX(-50%);
}

.altar {
  position: absolute;
  bottom: 3px;
  left: 50%;
  z-index: 3;
  width: 112px;
  height: 126px;
  transform: translateX(-50%);
}

.burner {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 76px;
  height: 42px;
  border: 1px solid rgba(223, 177, 91, 0.62);
  border-radius: 3px 3px 24px 24px;
  background: #533225;
  box-shadow: inset 0 -12px 22px rgba(8, 16, 13, 0.55);
  transform: translateX(-50%);
}

.incense {
  position: absolute;
  bottom: 35px;
  width: 3px;
  height: 68px;
  background: #b27a43;
}

.incense-one {
  left: 42px;
}

.incense-two {
  left: 55px;
  height: 78px;
}

.incense-three {
  left: 68px;
}

.incense i,
.button-flame,
.offering-flame {
  position: absolute;
  display: block;
  background: #df6a39;
  box-shadow: 0 0 13px rgba(238, 134, 62, 0.68);
  transform: rotate(45deg);
}

.incense i {
  top: -7px;
  left: -2px;
  width: 7px;
  height: 7px;
  border-radius: 6px 6px 6px 1px;
}

.sanctuary.is-lit .incense::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 20px;
  height: 72px;
  border-left: 2px solid rgba(221, 226, 218, 0.26);
  border-radius: 50%;
  content: "";
  filter: blur(1px);
  animation: smoke-rise 2.8s ease-in-out infinite;
}

.sanctuary.is-lit .incense-two::before {
  animation-delay: -1s;
}

.sanctuary.is-lit .incense-three::before {
  animation-delay: -2s;
}

.ritual-console {
  position: relative;
  z-index: 4;
  width: min(760px, calc(100% - 40px));
  min-height: 330px;
  margin: 342px auto 64px;
  border: 1px solid var(--line-dark);
  border-top: 2px solid rgba(209, 168, 95, 0.5);
  background: rgba(8, 19, 15, 0.94);
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
}

.ritual-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line-dark);
  list-style: none;
}

.ritual-progress li {
  position: relative;
  display: flex;
  height: 64px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: rgba(243, 239, 228, 0.4);
}

.ritual-progress li + li::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 0;
  width: 1px;
  background: var(--line-dark);
  content: "";
}

.ritual-progress li span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(243, 239, 228, 0.18);
  color: inherit;
  font-size: 12px;
}

.ritual-progress li strong {
  font-size: 13px;
  font-weight: 600;
}

.ritual-progress li.is-active {
  color: var(--brass-soft);
}

.ritual-progress li.is-active span {
  border-color: rgba(236, 210, 145, 0.7);
  background: rgba(139, 48, 38, 0.44);
}

.ritual-body {
  padding: 30px;
}

.ritual-panel {
  animation: panel-in 280ms ease-out both;
}

.prepare-panel,
.offering-panel,
.result-panel {
  display: grid;
  gap: 24px;
}

.theme-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.theme-button {
  display: flex;
  min-height: 50px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(243, 239, 228, 0.65);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.theme-button:hover,
.theme-button.is-selected {
  border-color: rgba(236, 210, 145, 0.56);
  background: rgba(209, 168, 95, 0.09);
  color: var(--paper);
}

.theme-symbol {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(236, 210, 145, 0.34);
  color: var(--brass-soft);
  font-family: var(--serif);
  font-size: 13px;
}

.wish-entry {
  position: relative;
  display: grid;
  gap: 9px;
}

.wish-entry label {
  color: var(--brass-soft);
  font-family: var(--serif);
  font-size: 14px;
}

.wish-entry textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line-dark);
  border-radius: 0;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--paper);
  padding: 15px 44px 15px 15px;
  line-height: 1.65;
  transition: border-color 160ms ease, background 160ms ease;
}

.wish-entry textarea:focus {
  border-color: rgba(236, 210, 145, 0.68);
  background: rgba(255, 255, 255, 0.052);
}

.wish-entry textarea::placeholder {
  color: rgba(243, 239, 228, 0.32);
}

.wish-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(243, 239, 228, 0.32);
  font-size: 11px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 50px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.primary-button {
  background: var(--cinnabar);
  color: #fff4df;
}

.primary-button:hover:not(:disabled) {
  background: #a13c2e;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.secondary-button {
  border-color: var(--line-dark);
  background: transparent;
  color: rgba(243, 239, 228, 0.75);
}

.secondary-button:hover {
  border-color: rgba(236, 210, 145, 0.5);
  color: var(--paper);
}

.button-flame {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 8px 8px 8px 1px;
}

.stick-symbol {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 244, 223, 0.5);
  font-family: var(--serif);
  font-size: 11px;
}

.offering-state {
  display: flex;
  min-width: 0;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-left: 2px solid var(--brass);
  background: rgba(209, 168, 95, 0.07);
}

.offering-flame {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 18px 18px 18px 4px;
}

.offering-state p {
  margin: 0 0 5px;
  color: var(--brass-soft);
  font-size: 12px;
}

.offering-state strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
}

.quiet-copy {
  margin: -8px 0 0;
  color: rgba(243, 239, 228, 0.46);
  text-align: center;
  font-size: 13px;
}

.drawing-panel {
  display: flex;
  min-height: 205px;
  gap: 34px;
  align-items: center;
  justify-content: center;
}

.drawing-panel strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brass-soft);
  font-family: var(--serif);
  font-size: 22px;
}

.drawing-panel p {
  margin: 0;
  color: rgba(243, 239, 228, 0.52);
  font-size: 14px;
}

.fortune-cylinder {
  position: relative;
  width: 76px;
  height: 112px;
  border: 1px solid rgba(227, 181, 96, 0.56);
  background: #5c3022;
  box-shadow: inset 0 -20px 28px rgba(10, 18, 14, 0.45);
  animation: shake 170ms ease-in-out infinite alternate;
}

.fortune-cylinder::before {
  position: absolute;
  top: -8px;
  right: -7px;
  left: -7px;
  height: 12px;
  border: 1px solid rgba(227, 181, 96, 0.72);
  background: #37251d;
  content: "";
}

.fortune-cylinder span {
  position: absolute;
  inset: 30px 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 210, 145, 0.42);
  color: var(--brass-soft);
  font-family: var(--serif);
  font-size: 24px;
}

.fortune-cylinder i {
  position: absolute;
  top: -45px;
  width: 5px;
  height: 50px;
  background: #b97b40;
}

.fortune-cylinder i:nth-child(1) {
  left: 20px;
  transform: rotate(-6deg);
}

.fortune-cylinder i:nth-child(2) {
  left: 36px;
}

.fortune-cylinder i:nth-child(3) {
  right: 20px;
  transform: rotate(7deg);
}

.fortune-ticket {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border: 1px solid rgba(236, 210, 145, 0.35);
  background: #eee7d6;
  color: var(--ink);
}

.fortune-number {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(23, 36, 31, 0.15);
  background: #e3d8c2;
}

.fortune-number span {
  color: #786d5b;
  font-size: 11px;
}

.fortune-number strong {
  margin: 8px 0 2px;
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 60px;
  font-weight: 500;
  line-height: 1;
}

.fortune-number small {
  color: #6c332a;
  font-family: var(--serif);
  font-size: 15px;
}

.fortune-content {
  padding: 28px;
}

.result-kicker {
  margin: 0 0 5px;
  color: var(--cinnabar);
  font-size: 11px;
  font-weight: 700;
}

.fortune-content h2 {
  margin: 0;
  color: #213329;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}

.fortune-poem {
  margin: 18px 0;
  color: #665e50;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-line;
}

.fortune-reading {
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
}

.fortune-reading span {
  color: var(--cinnabar);
  font-size: 11px;
  font-weight: 700;
}

.fortune-reading p,
.fortune-guidance p {
  margin: 7px 0 0;
  color: #3d4d45;
  font-size: 13px;
  line-height: 1.75;
}

.fortune-guidance {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding: 12px;
  background: rgba(139, 48, 38, 0.07);
}

.fortune-guidance > span {
  color: var(--cinnabar);
}

.fortune-guidance p {
  margin: 0;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}

.practice-band {
  padding: 78px 20px 72px;
  background: #e8ebe4;
}

.practice-inner {
  width: min(1060px, 100%);
  margin: 0 auto;
}

.section-heading {
  max-width: 600px;
  margin-bottom: 34px;
}

.section-heading > p {
  color: var(--cinnabar);
}

.section-heading h2 {
  margin: 0;
  color: #1a2d25;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}

.practice-grid article {
  min-height: 190px;
  padding: 28px 28px 32px 0;
}

.practice-grid article + article {
  border-left: 1px solid var(--line-light);
  padding-left: 28px;
}

.practice-index {
  color: var(--cinnabar);
  font-size: 11px;
  font-weight: 700;
}

.practice-grid h3 {
  margin: 16px 0 10px;
  color: #1c3027;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.practice-grid p {
  margin: 0;
  color: #66716c;
  font-size: 13px;
  line-height: 1.8;
}

.disclaimer {
  margin: 20px 0 0;
  color: #818985;
  font-size: 11px;
  text-align: center;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brass-soft);
  outline-offset: 3px;
}

@keyframes smoke-rise {
  0% {
    opacity: 0;
    transform: translate(0, 8px) scaleX(0.8);
  }
  30% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    transform: translate(12px, -44px) scaleX(1.35);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  from {
    transform: rotate(-3deg) translateX(-2px);
  }
  to {
    transform: rotate(3deg) translateX(2px);
  }
}

@media (max-width: 700px) {
  .site-header {
    width: calc(100% - 28px);
    height: 74px;
  }

  .day-mark {
    display: none;
  }

  .hero-copy {
    width: calc(100% - 30px);
    margin-top: 28px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-copy > p:last-child {
    font-size: 14px;
  }

  .temple-scene {
    top: 278px;
    width: 860px;
    transform: translateX(-50%) scale(0.72);
    transform-origin: top center;
  }

  .ritual-console {
    width: calc(100% - 24px);
    min-height: 360px;
    margin-top: 355px;
  }

  .ritual-progress li {
    height: 58px;
  }

  .ritual-progress li span {
    display: none;
  }

  .ritual-body {
    padding: 20px;
  }

  .theme-selector {
    gap: 7px;
  }

  .theme-button {
    min-height: 54px;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
  }

  .theme-symbol {
    width: 21px;
    height: 21px;
    font-size: 11px;
  }

  .drawing-panel {
    min-height: 245px;
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .fortune-ticket {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .fortune-number {
    min-height: 360px;
  }

  .fortune-number strong {
    font-size: 45px;
  }

  .fortune-number span {
    writing-mode: vertical-rl;
  }

  .fortune-content {
    padding: 22px 18px;
  }

  .fortune-content h2 {
    font-size: 21px;
  }

  .fortune-poem {
    font-size: 14px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .practice-band {
    padding: 58px 20px;
  }

  .section-heading h2 {
    font-size: 27px;
  }

  .practice-grid {
    grid-template-columns: 1fr;
  }

  .practice-grid article {
    min-height: auto;
    padding: 24px 0;
  }

  .practice-grid article + article {
    border-top: 1px solid var(--line-light);
    border-left: 0;
    padding-left: 0;
  }
}

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

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