:root {
  color-scheme: dark;
  --bg: #0d0d1a;
  --bg-strong: #080812;
  --surface: #151525;
  --surface-2: #1e1e33;
  --text: #f0eeff;
  --muted: #b4abce;
  --soft: #8b80b3;
  --border: rgba(196, 181, 253, 0.2);
  --purple: #8b5cf6;
  --purple-2: #c4b5fd;
  --teal: #6bbab5;
  --rose: #d4789a;
  --sun: #f4d35e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans TC",
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 18% 22%, rgba(107, 186, 181, 0.14), transparent 26%),
    radial-gradient(circle at 84% 14%, rgba(212, 120, 154, 0.12), transparent 24%);
  animation: breathGlow 12s ease-in-out infinite alternate;
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 56px);
  background: rgba(8, 8, 18, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

nav a:hover {
  color: var(--text);
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 120px clamp(20px, 5vw, 56px) 88px;
}

.hero-bg,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-bg {
  background-image: url("./assets/dreammap-bg.webp");
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  animation: slowDrift 22s ease-in-out infinite alternate;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(6, 6, 16, 0.9), rgba(9, 9, 20, 0.54) 48%, rgba(9, 9, 20, 0.18)),
    linear-gradient(0deg, var(--bg) 0%, rgba(13, 13, 26, 0.18) 40%, rgba(13, 13, 26, 0.28) 100%);
}

.hero-content {
  position: relative;
  width: min(720px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 700px;
  font-size: clamp(44px, 8vw, 88px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  width: min(600px, 100%);
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.8;
}

.hero-actions,
.quiz-controls,
.result-actions,
.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.button:focus-visible,
label:focus-within,
label:focus-visible,
.store-button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(107, 186, 181, 0.7);
  outline-offset: 3px;
}

.button.primary {
  background: var(--purple);
  color: white;
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.28);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 92px 0;
}

.story-band {
  width: min(var(--max), calc(100% - 40px));
  margin: -34px auto 0;
  padding: clamp(24px, 5vw, 42px) 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: end;
}

.story-band h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.12;
}

.story-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.section-heading {
  width: min(720px, 100%);
  margin-bottom: 28px;
}

.section-heading.compact {
  margin-bottom: 36px;
}

.section-heading h2,
.download-copy h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading p,
.download-copy p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.quiz-shell {
  position: relative;
  background:
    linear-gradient(135deg, rgba(21, 21, 37, 0.96), rgba(30, 30, 51, 0.9)),
    url("./assets/dashboard.webp");
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.quiz-ambient {
  position: absolute;
  inset: auto -18% -32% auto;
  width: 420px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107, 186, 181, 0.24), transparent 68%);
  filter: blur(12px);
  animation: pulseFloat 9s ease-in-out infinite alternate;
}

.quiz-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--teal), var(--purple-2), var(--rose));
  transition: width 220ms ease;
}

.quiz-form,
.quiz-result {
  position: relative;
  z-index: 1;
  padding: clamp(22px, 5vw, 48px);
}

.quiz-step {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.quiz-step.is-active {
  display: grid;
  gap: 14px;
}

legend,
.quiz-result h3 {
  width: 100%;
  margin: 0 0 12px;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 850;
  line-height: 1.2;
}

label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 58px;
  padding: 17px 18px;
  color: var(--muted);
  background: rgba(8, 8, 18, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
}

label:hover,
label:has(input:checked) {
  color: var(--text);
  border-color: rgba(196, 181, 253, 0.55);
  background: rgba(139, 92, 246, 0.16);
}

label:focus-visible {
  border-color: rgba(107, 186, 181, 0.72);
}

input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

.quiz-controls {
  justify-content: space-between;
  margin-top: 28px;
}

.quiz-result[hidden] {
  display: none;
}

.quiz-result {
  min-height: 300px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 8, 18, 0.46);
}

.quiz-result p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
}

.result-actions {
  margin-top: 28px;
}

.result-actions.is-muted .primary {
  display: none;
}

.ritual-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.ritual-list article {
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(30, 30, 51, 0.84), rgba(21, 21, 37, 0.84));
}

.ritual-list span {
  color: var(--teal);
  font-weight: 850;
}

.ritual-list h3 {
  margin: 40px 0 10px;
  font-size: 24px;
}

.ritual-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.faq-section {
  padding-top: 70px;
}

details {
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

details:last-child {
  border-bottom: 1px solid var(--border);
}

summary {
  cursor: pointer;
  color: var(--text);
  font-size: 18px;
  font-weight: 780;
}

details p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

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

.path-grid article {
  min-height: 360px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.path-grid img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  margin-bottom: 18px;
}

.path-grid article:nth-child(3) img {
  object-fit: cover;
  border-radius: 6px;
}

.path-grid h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.path-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.download-section {
  width: min(var(--max), calc(100% - 40px));
  margin: 24px auto 0;
  padding: clamp(28px, 6vw, 56px);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 32px;
  background:
    linear-gradient(135deg, rgba(13, 13, 26, 0.62), rgba(13, 13, 26, 0.92)),
    url("./assets/dashboard.webp");
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.store-actions {
  justify-content: flex-end;
}

.store-button {
  width: min(220px, 100%);
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  background: #f0eeff;
  color: #0d0d1a;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.store-button span {
  font-size: 12px;
  color: #504c68;
}

.store-button strong {
  font-size: 20px;
}

footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 44px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--soft);
  font-size: 14px;
}

footer a {
  color: var(--purple-2);
}

.legal-page {
  background:
    linear-gradient(180deg, rgba(13, 13, 26, 0.72), var(--bg) 420px),
    url("./assets/dreammap-bg.webp");
  background-size: cover;
  background-position: top center;
  background-attachment: fixed;
}

.legal-shell {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: 132px 0 60px;
}

.legal-shell h1 {
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1;
  margin-bottom: 12px;
}

.legal-updated {
  color: var(--soft);
  margin: 0 0 34px;
}

.legal-shell section {
  padding: 26px 0;
  border-top: 1px solid var(--border);
}

.privacy-map {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}

.privacy-map a {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(21, 21, 37, 0.62);
}

.privacy-map a:hover {
  color: var(--text);
  border-color: rgba(196, 181, 253, 0.55);
  text-decoration: none;
}

.legal-summary {
  padding-top: 0 !important;
  border-top: 0 !important;
}

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

.summary-grid article {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(21, 21, 37, 0.76);
}

.summary-grid h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.summary-grid p {
  margin: 0;
  font-size: 14px;
}

.legal-shell h2 {
  margin: 0 0 14px;
  color: var(--purple-2);
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.25;
}

.legal-shell p,
.legal-shell li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.legal-shell ul {
  margin: 0;
  padding-left: 22px;
}

.legal-shell li + li {
  margin-top: 8px;
}

.legal-shell strong {
  color: var(--text);
}

.legal-callout {
  margin: 16px 0;
  padding: 26px !important;
  background: rgba(21, 21, 37, 0.88);
  border: 1px solid rgba(196, 181, 253, 0.28) !important;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
  }

  nav {
    display: none;
  }

  .hero {
    min-height: 88vh;
    padding-bottom: 70px;
  }

  .story-band,
  .path-grid,
  .ritual-list,
  .summary-grid,
  .download-section {
    grid-template-columns: 1fr;
  }

  .path-grid article {
    min-height: auto;
  }

  .store-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .brand span {
    font-size: 14px;
  }

  .hero-actions,
  .quiz-controls,
  .result-actions,
  .store-actions {
    flex-direction: column;
  }

  .button,
  .store-button {
    width: 100%;
  }

  footer {
    flex-direction: column;
  }
}

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

@keyframes slowDrift {
  from {
    transform: scale(1.03) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-18px, 10px, 0);
  }
}

@keyframes pulseFloat {
  from {
    transform: translate3d(0, 0, 0) scale(0.92);
    opacity: 0.55;
  }
  to {
    transform: translate3d(-34px, -28px, 0) scale(1.08);
    opacity: 0.9;
  }
}

@keyframes breathGlow {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}
