:root {
  --black: #050403;
  --ink: #12100c;
  --surface: #11100d;
  --surface-soft: #19160f;
  --paper: #f7f0df;
  --gold: #d9b35a;
  --gold-bright: #f1d58a;
  --red: #a52720;
  --red-bright: #d84b3f;
  --muted: #b8ab8e;
  --line: rgba(217, 179, 90, 0.24);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--paper);
  background:
    linear-gradient(180deg, rgba(5, 4, 3, 0.55), rgba(5, 4, 3, 0.96)),
    radial-gradient(circle at 82% 20%, rgba(165, 39, 32, 0.22), transparent 28rem),
    radial-gradient(circle at 16% 18%, rgba(217, 179, 90, 0.22), transparent 26rem),
    #050403;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(217, 179, 90, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(217, 179, 90, 0.04) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 78%);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

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

.site-shell {
  position: relative;
  width: min(100%, 1440px);
  margin: 0 auto;
  overflow: hidden;
}

.hero {
  min-height: 92vh;
  padding: 28px clamp(20px, 5vw, 72px) 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-bright);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--black);
  border: 1px solid rgba(241, 213, 138, 0.62);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 0 28px rgba(217, 179, 90, 0.24);
}

.language-toggle {
  min-width: 86px;
  min-height: 40px;
  padding: 0 16px;
  color: var(--gold-bright);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 16, 13, 0.72);
  backdrop-filter: blur(18px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.72fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  min-height: calc(92vh - 76px);
  padding-top: 42px;
}

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

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: clamp(48px, 7.4vw, 108px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-text {
  max-width: 640px;
  margin-bottom: 34px;
  color: rgba(247, 240, 223, 0.76);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}

.primary-link,
.submit-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  color: #140f08;
  font-weight: 800;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 18px 40px rgba(217, 179, 90, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.primary-link:hover,
.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(217, 179, 90, 0.28);
}

.secondary-button {
  color: var(--gold-bright);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

.secondary-button:hover {
  background: rgba(217, 179, 90, 0.08);
  box-shadow: 0 0 28px rgba(217, 179, 90, 0.12);
}

.hero-actions span {
  font-size: 14px;
}

.mystic-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    rgba(17, 16, 13, 0.78);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mystic-panel::before,
.mystic-panel::after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(217, 179, 90, 0.18);
  border-radius: 50%;
}

.mystic-panel::after {
  inset: 72px;
  border-color: rgba(165, 39, 32, 0.32);
  transform: rotate(28deg);
}

.oracle-disc {
  position: relative;
  width: min(72vw, 380px);
  aspect-ratio: 1;
  border: 1px solid rgba(241, 213, 138, 0.58);
  border-radius: 50%;
  background:
    conic-gradient(from 10deg, rgba(217, 179, 90, 0.1), rgba(165, 39, 32, 0.18), rgba(217, 179, 90, 0.1)),
    radial-gradient(circle, rgba(241, 213, 138, 0.18), rgba(5, 4, 3, 0.04) 48%, rgba(5, 4, 3, 0.74) 72%);
  box-shadow: inset 0 0 42px rgba(217, 179, 90, 0.18), 0 0 80px rgba(165, 39, 32, 0.16);
}

.oracle-disc span {
  position: absolute;
  inset: 13%;
  border: 1px solid rgba(217, 179, 90, 0.32);
  border-radius: 50%;
}

.oracle-disc span:nth-child(2) {
  inset: 28%;
  border-style: dashed;
}

.oracle-disc span:nth-child(3) {
  inset: 43%;
  background: linear-gradient(135deg, var(--red), #53120f);
  border: 0;
  box-shadow: 0 0 28px rgba(216, 75, 63, 0.38);
}

.pillar-row {
  position: absolute;
  bottom: 92px;
  display: grid;
  grid-template-columns: repeat(4, 54px);
  gap: 10px;
}

.pillar-row span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 72px;
  color: var(--gold-bright);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 30px;
  border: 1px solid rgba(241, 213, 138, 0.36);
  border-radius: 8px;
  background: rgba(5, 4, 3, 0.76);
}

.mystic-panel p {
  position: absolute;
  right: 34px;
  bottom: 32px;
  left: 34px;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.content-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  padding: 0 clamp(20px, 5vw, 72px) 72px;
}

.intake-card,
.summary-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(17, 16, 13, 0.82);
  box-shadow: var(--shadow);
}

.intake-card {
  padding: clamp(24px, 4vw, 44px);
}

.form-head {
  max-width: 680px;
  margin-bottom: 32px;
}

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

.field {
  display: grid;
  gap: 10px;
}

.field span,
.consent span {
  color: rgba(247, 240, 223, 0.82);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  color: var(--paper);
  border: 1px solid rgba(217, 179, 90, 0.25);
  border-radius: 16px;
  outline: 0;
  background: rgba(5, 4, 3, 0.7);
}

.field input:focus,
.field select:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 4px rgba(217, 179, 90, 0.14);
}

.field input::placeholder {
  color: rgba(184, 171, 142, 0.78);
}

.date-parts,
.time-parts {
  display: flex;
  gap: 10px;
}

.date-parts input {
  flex: 1;
  min-width: 0;
}

.time-parts input {
  flex: 0 1 90px;
  min-width: 0;
}

.time-parts .pill-toggle {
  flex: 0 0 auto;
}

.pill-toggle {
  --options: 2;
  --index: 0;
  position: relative;
  display: inline-flex;
  width: 130px;
  height: 44px;
  padding: 3px;
  border: 1px solid rgba(217, 179, 90, 0.25);
  border-radius: 999px;
  background: rgba(5, 4, 3, 0.7);
  overflow: hidden;
}

.pill-toggle[data-options="3"] {
  --options: 3;
  width: 180px;
}

.pill-toggle button {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s;
}

.pill-toggle button.active {
  color: var(--black);
}

.pill-toggle .pill-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc((100% - 6px) / var(--options, 2));
  height: calc(100% - 6px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  transition: transform 0.25s ease;
  transform: translateX(calc(100% * var(--index, 0)));
  z-index: 1;
}

.pill-toggle.field-error {
  border-color: var(--red-bright);
}

.field select:invalid {
  color: var(--muted);
}

.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  display: none;
}

.field input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.field input.field-error,
.field select.field-error {
  border-color: var(--red-bright);
}

.field-error-msg {
  color: var(--red-bright);
  font-size: 12px;
  margin-top: 4px;
}

.support-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) 1fr;
  gap: 18px;
  align-items: end;
  margin-top: 18px;
}

.consent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 15px 16px;
  border: 1px solid rgba(217, 179, 90, 0.18);
  border-radius: 16px;
  background: rgba(5, 4, 3, 0.44);
}

.consent input {
  width: 18px;
  height: 18px;
  accent-color: var(--red-bright);
  flex: 0 0 auto;
}

.submit-button {
  width: 100%;
  margin-top: 26px;
  font-size: 16px;
}

.form-note {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.summary-card {
  align-self: start;
  padding: 28px;
}

.summary-card h2 {
  font-size: 34px;
}

.summary-card dl {
  display: grid;
  gap: 14px;
  margin: 28px 0;
}

.summary-card dl div {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(217, 179, 90, 0.16);
}

.summary-card dt {
  color: var(--muted);
  font-size: 13px;
}

.summary-card dd {
  min-width: 0;
  margin: 0;
  color: var(--paper);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.element-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.element-strip span {
  display: grid;
  place-items: center;
  min-height: 44px;
  color: var(--gold-bright);
  font-size: 11px;
  border: 1px solid rgba(217, 179, 90, 0.2);
  border-radius: 999px;
  background: rgba(5, 4, 3, 0.52);
}

.element-strip span:nth-child(2) {
  color: #ff938b;
}

.result-band {
  padding: 0 clamp(20px, 5vw, 72px) 72px;
}

.result-band.hidden {
  display: none;
}

.result-card {
  padding: clamp(24px, 4vw, 44px);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.result-header h2 {
  margin-bottom: 0;
}

.loading {
  text-align: center;
  padding: 48px 0;
  color: var(--muted);
}

.loading-note {
  font-size: 13px;
  color: var(--gold-bright);
  margin-top: 8px;
}

.loading.hidden {
  display: none;
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border: 3px solid rgba(217, 179, 90, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-content {
  line-height: 1.85;
  color: rgba(247, 240, 223, 0.92);
}

.result-content h1,
.result-content h2,
.result-content h3,
.result-content h4 {
  color: var(--gold-bright);
  margin-top: 28px;
  margin-bottom: 14px;
}

.result-content p {
  margin-bottom: 14px;
}

.result-content ul,
.result-content ol {
  padding-left: 24px;
  margin-bottom: 18px;
}

.result-content li {
  margin-bottom: 8px;
}

.result-content blockquote {
  border-left: 4px solid var(--gold);
  padding-left: 18px;
  margin-left: 0;
  color: var(--muted);
}

.result-content code {
  background: rgba(217, 179, 90, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.error-message {
  padding: 16px 20px;
  background: rgba(165, 39, 32, 0.16);
  border: 1px solid rgba(216, 75, 63, 0.35);
  border-radius: 16px;
  color: #ff938b;
  margin-top: 20px;
}

.error-message.hidden {
  display: none;
}

.global-error {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  max-width: min(600px, calc(100vw - 32px));
  padding: 16px 24px;
  background: rgba(165, 39, 32, 0.95);
  border: 1px solid rgba(216, 75, 63, 0.5);
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.global-error.hidden {
  display: none;
}

.site-footer {
  padding: 32px clamp(20px, 5vw, 72px) 48px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 4, 3, 0.92);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
    padding-bottom: 42px;
  }

  .hero-grid,
  .content-band {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
  }

  .mystic-panel {
    min-height: 460px;
  }

  .summary-card {
    order: -1;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  h1 {
    font-size: 46px;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .mystic-panel {
    min-height: 390px;
    padding: 22px;
    border-radius: 22px;
  }

  .pillar-row {
    bottom: 72px;
    grid-template-columns: repeat(4, 44px);
  }

  .pillar-row span {
    width: 44px;
    height: 60px;
    font-size: 24px;
  }

  .field-grid,
  .support-row {
    grid-template-columns: 1fr;
  }

  .intake-card,
  .summary-card,
  .result-card {
    border-radius: 22px;
  }

  .summary-card dl div {
    grid-template-columns: 92px 1fr;
  }

  .element-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
