:root {
  color-scheme: dark;
  --ink: #f8efe2;
  --muted: #c5b8a2;
  --line: rgba(220, 184, 109, 0.24);
  --paper: #0d1114;
  --surface: rgba(25, 28, 30, 0.86);
  --accent: #c83d32;
  --accent-dark: #8d231f;
  --gold: #e3b766;
  --jade: #4ea88b;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 16% 0%, rgba(200, 61, 50, 0.18), transparent 34%),
    radial-gradient(circle at 90% 18%, rgba(227, 183, 102, 0.12), transparent 32%),
    var(--paper);
  color: var(--ink);
  margin: 0;
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(13, 17, 20, 0.8);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 6vw;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--gold);
  font-weight: 780;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
}

nav a,
.footer a {
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
}

.hero {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(13, 17, 20, 0.92), rgba(13, 17, 20, 0.38)),
    url("./assets/hero-bagua-bg.png") center/cover;
  color: #fff;
  display: grid;
  min-height: 82vh;
  overflow: hidden;
  padding: 10vh 6vw 14vh;
  position: relative;
}

.hero::after {
  animation: auraPulse 6s ease-in-out infinite, veilShift 12s ease-in-out infinite;
  background:
    linear-gradient(115deg, transparent 18%, rgba(227, 183, 102, 0.12), transparent 46%),
    linear-gradient(35deg, transparent 22%, rgba(200, 61, 50, 0.1), transparent 58%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.hero::before {
  animation: starBreath 8s ease-in-out infinite;
  background-image:
    radial-gradient(circle at 18% 24%, rgba(227, 183, 102, 0.42) 0 1px, transparent 2px),
    radial-gradient(circle at 38% 62%, rgba(248, 239, 226, 0.34) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 38%, rgba(227, 183, 102, 0.3) 0 1px, transparent 2px),
    radial-gradient(circle at 86% 72%, rgba(200, 61, 50, 0.34) 0 1px, transparent 2px);
  content: "";
  inset: 0;
  opacity: 0.48;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

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

.mystic-field span {
  animation: driftLine 9s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(227, 183, 102, 0.28), transparent);
  height: 1px;
  left: 8%;
  position: absolute;
  width: 42%;
}

.mystic-field span:nth-child(1) {
  top: 28%;
}

.mystic-field span:nth-child(2) {
  animation-delay: -3s;
  left: 22%;
  top: 52%;
  width: 34%;
}

.mystic-field span:nth-child(3) {
  animation-delay: -6s;
  left: 4%;
  top: 72%;
  width: 48%;
}

.energy-rings {
  height: min(64vw, 620px);
  pointer-events: none;
  position: absolute;
  right: -7vw;
  top: 4vh;
  width: min(64vw, 620px);
  z-index: 1;
}

.energy-rings span {
  animation: ringPulse 8s ease-in-out infinite;
  border: 1px solid rgba(227, 183, 102, 0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(227, 183, 102, 0.04);
  inset: 0;
  position: absolute;
}

.energy-rings span:nth-child(2) {
  animation-delay: -4s;
  inset: 18%;
}

.hero__content {
  animation: heroRise 900ms ease-out both;
  max-width: 760px;
  position: relative;
  z-index: 3;
}

.cosmic-map {
  animation: slowSpin 42s linear infinite;
  aspect-ratio: 1;
  border: 1px solid rgba(227, 183, 102, 0.34);
  border-radius: 50%;
  box-shadow:
    0 0 80px rgba(227, 183, 102, 0.16),
    inset 0 0 80px rgba(227, 183, 102, 0.08);
  display: grid;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 4vw, 3.6rem);
  height: min(58vw, 520px);
  opacity: 0.54;
  place-items: center;
  position: absolute;
  right: -8vw;
  top: 12vh;
  width: min(58vw, 520px);
}

.cosmic-map::before,
.cosmic-map::after {
  border: 1px solid rgba(227, 183, 102, 0.24);
  border-radius: 50%;
  content: "";
  inset: 12%;
  position: absolute;
}

.cosmic-map::after {
  inset: 28%;
}

.cosmic-map span {
  animation: symbolFloat 4.8s ease-in-out infinite;
  color: rgba(248, 239, 226, 0.82);
  position: absolute;
}

.cosmic-map span:nth-child(1) {
  top: 8%;
}

.cosmic-map span:nth-child(2) {
  animation-delay: -0.8s;
  right: 12%;
  top: 34%;
}

.cosmic-map span:nth-child(3) {
  animation-delay: -1.6s;
  bottom: 12%;
}

.cosmic-map span:nth-child(4) {
  animation-delay: -2.4s;
  left: 12%;
  top: 34%;
}

.cosmic-map span:nth-child(5) {
  animation-delay: -3.2s;
  color: var(--gold);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.75rem, 6vw, 5.8rem);
  line-height: 1.02;
  max-width: 980px;
}

h2 {
  font-size: clamp(1.9rem, 3vw, 3.4rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.18rem;
}

h4 {
  font-size: 1.08rem;
  margin: 0;
}

.hero__copy {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 670px;
}

.hero__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 26px;
  max-width: 680px;
}

.hero__facts span {
  animation: chipGlow 6s ease-in-out infinite;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(220, 184, 109, 0.2);
  border-radius: 999px;
  color: rgba(248, 239, 226, 0.9);
  font-size: 0.9rem;
  padding: 8px 11px;
}

.hero__facts span:nth-child(2) {
  animation-delay: -1.5s;
}

.hero__facts span:nth-child(3) {
  animation-delay: -3s;
}

.hero__facts span:nth-child(4) {
  animation-delay: -4.5s;
}

.privacy-note,
.form-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.button {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 720;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  text-decoration: none;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  animation: ctaPulse 5.5s ease-in-out infinite;
  box-shadow: 0 0 24px rgba(200, 61, 50, 0.24);
}

.section {
  padding: 84px 6vw;
}

.section--compact {
  padding-top: 32px;
}

.section__heading {
  max-width: 760px;
}

.section__heading p {
  color: var(--muted);
  line-height: 1.7;
}

.tool {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(280px, 420px) minmax(300px, 1fr);
  margin-top: 34px;
}

.form,
.result,
.grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.28);
}

.form,
.result {
  animation: panelGlow 7s ease-in-out infinite;
}

.form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

label {
  color: var(--gold);
  display: grid;
  font-size: 0.92rem;
  gap: 8px;
}

.date-picker,
.time-picker {
  border: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 0.8fr 1fr;
  margin: 0;
  padding: 0;
}

.date-picker legend,
.time-picker legend {
  color: var(--gold);
  font-size: 0.92rem;
  margin-bottom: 8px;
  padding: 0;
}

input,
select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(220, 184, 109, 0.22);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

select option {
  background: #15191b;
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--gold);
  outline: 3px solid rgba(227, 183, 102, 0.16);
}

.result {
  min-height: 360px;
  padding: 28px;
}

.result__empty {
  align-content: center;
  color: var(--muted);
  display: grid;
  min-height: 300px;
  text-align: center;
}

.hidden {
  display: none;
}

dl {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

dl div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
  grid-template-columns: 150px 1fr;
  padding-bottom: 12px;
}

dt {
  color: var(--muted);
  font-size: 0.9rem;
}

dd {
  font-weight: 720;
  margin: 0;
}

.mini-tiles {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.mini-tiles span {
  border: 1px solid rgba(220, 184, 109, 0.2);
  border-radius: 8px;
  color: var(--gold);
  font-size: 0.82rem;
  padding: 9px 6px;
  text-align: center;
}

.chart-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 22px;
  overflow: hidden;
}

.stars-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 18px;
  overflow: hidden;
}

.stats-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 18px;
  overflow: hidden;
}

.chart-panel__header {
  align-items: center;
  background: rgba(227, 183, 102, 0.08);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 16px;
}

.chart-panel__header .eyebrow {
  margin-bottom: 4px;
}

.chart-panel__header span {
  border: 1px solid rgba(220, 184, 109, 0.22);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  padding: 6px 9px;
  white-space: nowrap;
}

.chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bazi-table {
  border-collapse: collapse;
  min-width: 640px;
  width: 100%;
}

.bazi-table th,
.bazi-table td {
  border-bottom: 1px solid rgba(220, 184, 109, 0.16);
  border-right: 1px solid rgba(220, 184, 109, 0.12);
  font-size: 0.86rem;
  line-height: 1.35;
  padding: 12px 10px;
  text-align: center;
  vertical-align: middle;
}

.bazi-table thead th {
  background: rgba(0, 0, 0, 0.22);
  color: var(--gold);
  font-weight: 760;
}

.bazi-table tbody th {
  color: var(--muted);
  font-weight: 680;
  text-align: left;
  width: 118px;
}

.bazi-table td {
  color: var(--ink);
  font-weight: 650;
}

.chart-note {
  border-top: 1px solid rgba(220, 184, 109, 0.16);
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
  padding: 12px 16px;
}

.star-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
}

.stats-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(220, 184, 109, 0.16);
  border-radius: 8px;
  padding: 12px;
}

.stat-item__top {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.stat-item__top strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.stat-item__top span {
  color: var(--gold);
  font-weight: 800;
}

.stat-bar {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 8px;
  margin: 10px 0 8px;
  overflow: hidden;
}

.stat-bar span {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: inherit;
  display: block;
  height: 100%;
}

.stat-item p {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0;
}

.star-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(220, 184, 109, 0.22);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  min-height: 40px;
  padding: 8px 12px;
  text-align: left;
}

.star-chip:hover {
  border-color: var(--gold);
}

.modal {
  inset: 0;
  position: fixed;
  z-index: 40;
}

.modal__backdrop {
  background: rgba(0, 0, 0, 0.68);
  inset: 0;
  position: absolute;
}

.modal__panel {
  background: #15191b;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  left: 50%;
  max-width: min(520px, 90vw);
  padding: 24px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.modal__close {
  background: transparent;
  border: 1px solid rgba(220, 184, 109, 0.22);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 7px 10px;
  position: absolute;
  right: 16px;
  top: 16px;
}

.modal__panel p {
  color: var(--muted);
  line-height: 1.7;
}

.modal__locked {
  background: linear-gradient(135deg, rgba(200, 61, 50, 0.14), rgba(227, 183, 102, 0.1));
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 14px;
}

.modal__locked span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

@keyframes slowSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes symbolFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-8px) rotate(-6deg);
  }
}

@keyframes auraPulse {
  0%,
  100% {
    opacity: 0.52;
  }

  50% {
    opacity: 0.92;
  }
}

@keyframes veilShift {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(2.5%);
  }
}

@keyframes starBreath {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(1);
  }

  50% {
    opacity: 0.62;
    transform: scale(1.02);
  }
}

@keyframes ringPulse {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.04);
  }
}

@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chipGlow {
  0%,
  100% {
    border-color: rgba(220, 184, 109, 0.18);
    box-shadow: none;
  }

  50% {
    border-color: rgba(227, 183, 102, 0.36);
    box-shadow: 0 0 18px rgba(227, 183, 102, 0.08);
  }
}

@keyframes ctaPulse {
  0%,
  100% {
    box-shadow: 0 0 24px rgba(200, 61, 50, 0.22);
  }

  50% {
    box-shadow:
      0 0 28px rgba(200, 61, 50, 0.34),
      0 0 44px rgba(227, 183, 102, 0.12);
  }
}

@keyframes driftLine {
  0%,
  100% {
    opacity: 0.18;
    transform: translateX(-4%);
  }

  50% {
    opacity: 0.72;
    transform: translateX(10%);
  }
}

@keyframes panelGlow {
  0%,
  100% {
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.28);
  }

  50% {
    box-shadow:
      0 22px 80px rgba(0, 0, 0, 0.32),
      0 0 34px rgba(227, 183, 102, 0.1);
  }
}

@keyframes baguaGlow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.86;
    transform: scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

.upgrade {
  align-items: center;
  background: linear-gradient(135deg, rgba(200, 61, 50, 0.14), rgba(227, 183, 102, 0.1));
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 24px;
  padding: 18px;
}

.upgrade__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upgrade span {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 3px;
}

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

.grid article {
  padding: 22px;
}

.grid p,
.result p {
  color: var(--muted);
  line-height: 1.65;
}

.footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  justify-content: space-between;
  padding: 28px 6vw;
}

.footer p {
  margin: 0;
}

.legal {
  margin: 0 auto;
  max-width: 860px;
  padding: 72px 6vw;
}

.report {
  margin: 0 auto;
  max-width: 1180px;
  padding: 72px 6vw;
}

.report-hero {
  max-width: 760px;
}

.report-hero p {
  color: var(--muted);
  line-height: 1.75;
}

.report-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 34px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.24);
  padding: 24px;
}

.report-card--wide {
  grid-column: 1 / -1;
}

.report-card p,
.report-card li {
  color: var(--muted);
  line-height: 1.7;
}

.report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.report-tags span {
  border: 1px solid rgba(220, 184, 109, 0.18);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.86rem;
  padding: 8px 10px;
}

.report-stat {
  align-items: center;
  border-bottom: 1px solid rgba(220, 184, 109, 0.16);
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
}

.report-stat span {
  color: var(--muted);
}

.report-stat strong {
  color: var(--gold);
  font-size: 1.25rem;
}

.timeline-preview {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 20px 0;
}

.timeline-preview div {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(220, 184, 109, 0.16);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 14px;
}

.timeline-preview span {
  color: var(--gold);
  font-weight: 760;
}

.timeline-preview strong {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.35;
}

.report-note {
  font-size: 0.9rem;
}

.legal p,
.legal li {
  color: var(--muted);
  line-height: 1.75;
}

@media (max-width: 800px) {
  .topbar {
    align-items: center;
    gap: 12px;
    padding: 12px 5vw;
  }

  nav {
    gap: 8px;
    justify-content: center;
    width: 100%;
  }

  nav a {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(220, 184, 109, 0.14);
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 7px 10px;
  }

  .hero {
    background-position: center;
    min-height: 86vh;
    padding: 8vh 5vw 10vh;
  }

  .cosmic-map {
    height: 76vw;
    opacity: 0.46;
    right: -24vw;
    top: 15vh;
    width: 76vw;
  }

  .energy-rings {
    height: 110vw;
    opacity: 0.6;
    right: -46vw;
    top: 10vh;
    width: 110vw;
  }

  .mystic-field span {
    left: 4%;
    width: 58%;
  }

  .hero__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero__facts span {
    text-align: center;
  }

  .tool,
  .grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 54px 5vw;
  }

  .form,
  .result {
    padding: 18px;
  }

  .date-picker,
  .time-picker {
    grid-template-columns: 1fr;
  }

  input,
  select,
  .button {
    min-height: 50px;
  }

  .upgrade {
    align-items: stretch;
    flex-direction: column;
  }

  .upgrade__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  dl div {
    grid-template-columns: 1fr;
  }

  .mini-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-panel__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .bazi-table {
    min-width: 560px;
  }

  .bazi-table th,
  .bazi-table td {
    font-size: 0.8rem;
    padding: 10px 8px;
  }

  .star-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stats-list {
    grid-template-columns: 1fr;
  }

  .star-chip {
    width: 100%;
  }

  .modal__panel {
    bottom: 0;
    left: 0;
    max-width: none;
    padding: 24px 18px;
    top: auto;
    transform: none;
  }

  .report {
    padding: 52px 5vw;
  }

  .report-grid,
  .timeline-preview {
    grid-template-columns: 1fr;
  }
}
