/* ═══════════════════════════════════════════
   Reframe Destiny — Visual System
   Dunhuang × Dune × Cosmos × AI
   ═══════════════════════════════════════════ */

:root {
  --bg-deep: #050810;
  --bg-cosmos: #0a0e1a;
  --bg-purple: #12101f;
  --gold: #c9a962;
  --gold-light: #e8d5a3;
  --gold-dim: rgba(201, 169, 98, 0.35);
  --jade: #5a8a7a;
  --jade-dim: rgba(90, 138, 122, 0.25);
  --text: #f5f0e8;
  --text-dim: rgba(245, 240, 232, 0.65);
  --glass: rgba(12, 16, 28, 0.55);
  --glass-border: rgba(201, 169, 98, 0.12);
  --font-serif: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  --font-sc: 'Noto Serif SC', serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sc);
  background:
    radial-gradient(circle at 50% -10%, rgba(201,169,98,0.12), transparent 34rem),
    radial-gradient(circle at 10% 20%, rgba(90,138,122,0.12), transparent 28rem),
    var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

/* ── Canvas layers ── */
#bg-canvas, #sand-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
#sand-canvas { z-index: 1; mix-blend-mode: screen; opacity: 0.95; }

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: breathe 8s ease-in-out infinite;
}
.glow-orb--1 {
  width: 40vw; height: 40vw;
  top: -10%; left: -10%;
  background: radial-gradient(circle, rgba(201,169,98,0.08), transparent 70%);
}
.glow-orb--2 {
  width: 50vw; height: 50vw;
  bottom: -20%; right: -15%;
  background: radial-gradient(circle, rgba(90,138,122,0.06), transparent 70%);
  animation-delay: -4s;
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* ── Intro ── */
.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #030508;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}
.intro.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  filter: brightness(0.88) saturate(1.2);
}
.intro-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 0%, rgba(3, 5, 8, 0.55) 100%);
  pointer-events: none;
}
.intro-text {
  position: relative;
  z-index: 2;
  text-align: center;
  opacity: 0;
  animation: introFade 1s var(--ease-out) 1.2s forwards;
}
@keyframes introFade { to { opacity: 1; } }
.intro-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.35em;
  color: var(--gold-light);
  text-shadow: 0 0 40px var(--gold-dim);
}
.intro-subtitle-cn {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text-dim);
  margin-top: 0.5rem;
  letter-spacing: 0.5em;
}
.intro-tagline, .intro-tagline-cn {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--jade);
  margin-top: 2rem;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  letter-spacing: 0.15em;
}
.intro-tagline-cn { font-style: normal; font-family: var(--font-sc); margin-top: 0.5rem; color: var(--text-dim); }
.intro-skip {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: 3;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  transition: color 0.3s, border-color 0.3s;
}
.consent-skip {
  position: static;
  margin-top: 1rem;
  width: 100%;
  text-align: center;
}
.intro-skip:hover { color: var(--gold-light); border-color: var(--gold-dim); }

/* Embedded in React shell: React cover already showed consent — hide game duplicate */
html.embedded-boot #consent-gate,
html.embedded-boot #intro,
html.embedded-boot #intro-skip {
  display: none !important;
}

/* ── Informed consent gate ── */
.consent-gate {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
}

.consent-gate__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18);
  filter: brightness(0.95) saturate(1.5) contrast(1.15);
}

.consent-gate__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 58% at 50% 44%, transparent 0%, rgba(2, 4, 12, 0.22) 50%, rgba(1, 2, 8, 0.55) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.consent-gate__card {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  padding: 2rem 1.75rem;
  text-align: left;
  border: 1px solid rgba(201, 169, 98, 0.22);
  box-shadow: 0 0 60px rgba(201, 169, 98, 0.12), 0 24px 80px rgba(0, 0, 0, 0.45);
}

.consent-gate__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 0.75rem;
}

.consent-gate__title {
  font-family: var(--font-sc);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.consent-gate__lead {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.consent-gate__list {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.consent-gate__list li {
  font-size: 0.92rem;
  line-height: 1.6;
  padding-left: 0.75rem;
  border-left: 2px solid var(--gold-dim);
}

.consent-gate__list strong {
  color: var(--gold);
  font-weight: 600;
}

.consent-gate__card .btn-primary {
  width: 100%;
}

.consent-gate__decline {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

/* ── Pre/post survey ── */
.survey-gate {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  background: rgba(5, 8, 16, 0.94);
  backdrop-filter: blur(12px);
}

.survey-gate__card {
  width: min(100%, 560px);
  margin: 2rem auto 3rem;
  padding: 2rem 1.75rem;
}

.survey-gate__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--jade);
  margin-bottom: 0.75rem;
}

.survey-gate__title {
  font-size: 1.5rem;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.survey-gate__lead,
.survey-gate__scale-note {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.survey-questions {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.survey-item {
  border: none;
  padding: 0;
  margin: 0;
}

.survey-item__label {
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.survey-scale {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.survey-scale__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  cursor: pointer;
  min-width: 2.6rem;
}

.survey-scale__option input {
  accent-color: var(--gold);
}

.survey-scale__num {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.survey-scale__hint {
  font-size: 0.62rem;
  color: var(--text-dim);
  max-width: 3.5rem;
  text-align: center;
  line-height: 1.2;
  min-height: 1.4em;
}

.survey-gate__error {
  color: #e8a598;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.survey-gate__card .btn-primary {
  width: 100%;
}

/* ── App shell ── */
.app { position: relative; z-index: 10; min-height: 100vh; }
.hidden { display: none !important; }

/* ── Topbar ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: linear-gradient(to bottom, rgba(5,8,16,0.95), transparent);
  backdrop-filter: blur(12px);
  z-index: 100;
  border-bottom: 1px solid var(--glass-border);
}
.logo-btn {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}
.logo-mark { font-size: 1.2rem; opacity: 0.8; }

.nav { display: flex; gap: 0.25rem; }
.nav-link {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim);
  font-family: var(--font-sc);
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
  border-radius: 4px;
  transition: color 0.3s, background 0.3s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--gold-light);
  background: rgba(201,169,98,0.08);
}

.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  font-size: 0.8rem;
  display: flex; align-items: center; gap: 0.35rem;
  transition: border-color 0.3s, color 0.3s;
}
.icon-btn:hover { border-color: var(--gold-dim); color: var(--gold-light); }

.nav-toggle {
  display: none;
  background: none; border: none;
  color: var(--text); font-size: 1.4rem; cursor: pointer;
}

/* ── Wanderer ── */
.wanderer {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  max-width: 320px;
  opacity: 0;
  transform: translateY(20px);
  animation: wandererIn 1s var(--ease-out) 0.5s forwards;
}
@keyframes wandererIn { to { opacity: 1; transform: none; } }
.lotus-guide-video-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(201, 169, 98, 0.35);
  box-shadow: 0 0 24px rgba(201, 169, 98, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.4);
}
.lotus-guide-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.35);
  filter: brightness(0.85) saturate(1.15);
}
.lotus-guide-icon {
  display: none;
}
#wanderer-canvas {
  display: none;
  flex-shrink: 0;
  opacity: 1;
  width: 72px;
  height: 108px;
  filter: drop-shadow(0 0 18px rgba(232,213,163,0.42));
}
.wanderer-bubble {
  background:
    radial-gradient(circle at top left, rgba(201,169,98,0.13), transparent 8rem),
    var(--glass);
  border: 1px solid rgba(201,169,98,0.2);
  border-radius: 12px 12px 12px 4px;
  padding: 0.75rem 1rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 28px rgba(201,169,98,0.1);
}
.wanderer-name {
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.wanderer-text { font-size: 0.85rem; color: rgba(245,240,232,0.78); line-height: 1.5; }

/* ── Lotus chat panel ── */
.lotus-chat-panel {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 96;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.lotus-chat-panel.hidden { display: none; }
.lotus-guide.lotus-guide--chat-open {
  bottom: auto;
  position: fixed;
  left: 1rem;
  bottom: calc(min(70vh, 520px) + 1.5rem);
  max-width: 380px;
}
.lotus-chat-panel__inner {
  padding: 1rem 1.15rem;
  border: 1px solid rgba(201, 169, 98, 0.32);
  box-shadow: 0 0 48px rgba(201, 169, 98, 0.18);
}
.lotus-chat-compose {
  padding: 0.85rem 1rem 1rem;
  border: 1px solid rgba(201, 169, 98, 0.35);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.lotus-chat-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.lotus-chat-panel__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jade);
}
.lotus-chat-panel__title {
  font-size: 1.15rem;
  color: var(--gold-light);
  margin-top: 0.15rem;
}
.lotus-chat-panel__close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}
.lotus-chat-hint {
  font-size: 0.9rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  line-height: 1.55;
}
.lotus-chat-messages {
  min-height: 100px;
  max-height: min(28vh, 200px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(201, 169, 98, 0.12);
}
.lotus-chat-msg {
  max-width: 94%;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.6;
}
.lotus-chat-msg--user {
  align-self: flex-end;
  background: rgba(90, 138, 122, 0.24);
  border: 1px solid rgba(90, 138, 122, 0.38);
}
.lotus-chat-msg--assistant {
  align-self: flex-start;
  background: rgba(201, 169, 98, 0.14);
  border: 1px solid rgba(201, 169, 98, 0.24);
}
.lotus-chat-msg--thinking { opacity: 0.65; font-style: italic; }
.lotus-chat-compose {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.lotus-chat-input {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(201, 169, 98, 0.35);
  color: #f5f0e8;
  padding: 1rem 1.05rem;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.08rem;
  line-height: 1.65;
}
.lotus-chat-input:focus {
  outline: none;
  border-color: rgba(201, 169, 98, 0.55);
  box-shadow: 0 0 0 2px rgba(201, 169, 98, 0.15);
}

/* ── Charts ── */
.chart-mount { margin-bottom: 1.25rem; }
.bazi-chart { text-align: center; }
.chart-caption {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--jade);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}
.bazi-pillars {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.bazi-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 4.5rem;
}
.bazi-pillar__label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}
.bazi-cell {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 10px;
  font-size: 1.35rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
}
.bazi-cell small { font-size: 0.55rem; opacity: 0.7; }
.bazi-cell--stem { background: color-mix(in srgb, var(--el) 28%, transparent); color: var(--el); }
.bazi-cell--branch { background: rgba(255, 255, 255, 0.06); color: var(--gold-light); }
.bazi-legend {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.bazi-legend i {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.astro-wheel {
  display: block;
  margin: 0 auto 1.25rem;
  max-width: 100%;
  height: auto;
}

/* ── Why lotus ── */
.lotus-why {
  margin: 2rem auto 1.75rem;
  max-width: 640px;
  text-align: left;
  padding: 1.25rem 1.35rem;
}
.lotus-why--compact { margin: 0 0 1.5rem; max-width: none; }
.lotus-why__label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.lotus-why__text {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-dim);
}
.research-ref-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.research-ref-list em { color: var(--gold-light); font-style: normal; }

/* ── Main views ── */
.main { padding-top: var(--nav-h); min-height: 100vh; }
.view {
  display: none;
  padding: 2rem 1.5rem 6rem;
  max-width: 1100px;
  margin: 0 auto;
  animation: viewIn 0.6s var(--ease-out);
}
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ── Hero ── */
.hero {
  position: relative;
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 50% auto;
  width: min(90vw, 820px);
  height: min(55vh, 420px);
  transform: translateX(-50%);
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(201,169,98,0.14), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 80%, rgba(90,138,122,0.08), transparent 65%);
  filter: blur(8px);
  opacity: 0.85;
  animation: heroPulse 8s ease-in-out infinite;
}
@keyframes heroPulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(0.98); }
  50% { opacity: 0.9; transform: translateX(-50%) scale(1.02); }
}
.hero-icon { display: none; }
.hero-pitch {
  text-align: left;
  max-width: 520px;
  margin: 1.75rem auto 1.5rem;
  padding: 1.25rem 1.5rem;
}
.pitch-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.pitch-what {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.pitch-steps {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.pitch-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.pitch-emoji { color: var(--gold); flex-shrink: 0; }
.pitch-who {
  font-size: 0.8rem;
  color: var(--jade);
  border-top: 1px solid var(--glass-border);
  padding-top: 0.75rem;
}
.btn-primary--large {
  font-size: 1.05rem;
  padding: 0.85rem 2rem;
}
.hero-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.journey-intro {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0.35rem 0 0.75rem;
  max-width: 36rem;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}
.hero-title .gold {
  color: var(--gold-light);
  text-shadow: 0 0 18px rgba(232,213,163,0.36), 0 0 70px rgba(201,169,98,0.36);
}
.hero-desc {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  color: var(--text-dim);
  font-size: 1.05rem;
}

/* ── Buttons ── */
.btn-primary, .btn-secondary {
  cursor: pointer;
  font-family: var(--font-sc);
  font-size: 0.95rem;
  padding: 0.85rem 2rem;
  border-radius: 2px;
  letter-spacing: 0.08em;
  transition: all 0.35s var(--ease-out);
}
.btn-primary {
  background: linear-gradient(135deg, rgba(201,169,98,0.25), rgba(201,169,98,0.08));
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
  box-shadow: 0 0 0 rgba(201,169,98,0);
}
.btn-primary:hover {
  background: rgba(201,169,98,0.3);
  box-shadow: 0 0 34px rgba(201,169,98,0.32);
  transform: translateY(-2px);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
}
.btn-secondary:hover { border-color: var(--gold-dim); color: var(--text); }
.btn-secondary:disabled { opacity: 0.3; cursor: not-allowed; }
.text-btn {
  background: none; border: none; cursor: pointer;
  color: var(--jade); font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Glass card ── */
.glass-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01)),
    var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 1.75rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

/* ── Daily reflection ── */
.daily-reflection { margin-top: 2rem; }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.card-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}
.quote-original {
  font-family: var(--font-sc);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}
.quote-en {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}
.quote-practice {
  border-top: 1px solid var(--glass-border);
  padding-top: 1rem;
  margin-bottom: 1rem;
}
.quote-practice span {
  font-size: 0.75rem;
  color: var(--jade);
  letter-spacing: 0.1em;
}
.quote-practice p { margin-top: 0.5rem; color: var(--text-dim); font-size: 0.95rem; }

/* ── Journey ── */
.journey-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
}
.journey-header h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--gold-light);
}
.step-indicator { color: var(--text-dim); font-size: 0.9rem; }

.journey-step { display: none; animation: viewIn 0.5s var(--ease-out); }
.journey-step.active { display: block; }
.journey-step h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }

.system-card, .lens-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 2rem 1.5rem;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  transition: all 0.4s var(--ease-out);
  color: var(--text);
  font-family: var(--font-sc);
}
.system-card:hover, .lens-card:hover,
.system-card.selected, .lens-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 40px var(--gold-dim);
  transform: translateY(-4px);
}
.card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 80%, rgba(201,169,98,0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}
.system-card:hover .card-glow, .system-card.selected .card-glow { opacity: 1; }
.card-icon { display: block; font-size: 2rem; margin-bottom: 0.75rem; color: var(--gold); }
.card-title { display: block; font-size: 1.3rem; margin-bottom: 0.5rem; }
.card-desc { display: block; font-size: 0.85rem; color: var(--text-dim); }
.lens-card { font-size: 1rem; padding: 1.5rem 1rem; }

.birth-form { display: flex; flex-direction: column; gap: 1.25rem; max-width: 480px; }
.birth-form label { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; color: var(--text-dim); }
.birth-form input {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font-sc);
  font-size: 1rem;
}
.birth-form input:focus { outline: none; border-color: var(--gold-dim); }
.form-note { font-size: 0.8rem; color: var(--text-dim); opacity: 0.7; }

.reading-card { font-size: 1.05rem; line-height: 1.9; color: var(--text-dim); }
.reading-card .reading-source {
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* Scanner */
.scanner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}
#radar-canvas { max-width: 100%; height: auto; }
.reading-body p { margin-bottom: 1rem; line-height: 1.75; }
.reading-body p:last-child { margin-bottom: 0; }
.reading-body .reading-section {
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.reading-body .reading-highlight {
  color: #ffd89a;
  font-weight: 600;
  padding: 0 0.12em;
  border-bottom: 1px solid rgba(255, 216, 154, 0.35);
}
.reading-body .reading-warn {
  color: #ffb4a2;
  font-weight: 600;
}
.reading-body .reading-emoji {
  margin-right: 0.35em;
}
.reframe-text .reading-highlight { color: #b8e8d4; border-bottom-color: rgba(184, 232, 212, 0.35); }
.reframe-text .reading-warn { color: #ffd0a8; }
.journey-step-hint {
  font-size: 0.88rem;
  color: var(--gold);
  margin: -0.25rem 0 1rem;
  line-height: 1.55;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .compare-grid { grid-template-columns: 1fr; }
}
.reframe-text--compact { font-size: 0.88rem; line-height: 1.65; max-height: 280px; overflow-y: auto; }
.scanner-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.2);
  border-left: 2px solid var(--gold-dim);
  font-size: 0.9rem;
}
.scanner-bar {
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.scanner-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--jade), var(--gold));
  border-radius: 2px;
  transition: width 1s var(--ease-out);
}

/* Court */
.court-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.court-panel h4 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.court-panel p, .court-panel textarea {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
}
.court-panel--center { border-color: rgba(201,169,98,0.25); }
.court-panel textarea {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  padding: 0.75rem;
  color: var(--text);
  font-family: var(--font-sc);
  resize: vertical;
}

/* Reframe */
.reframe-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.25rem;
  align-items: start;
}
.reframe-col h4 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.reframe-text { font-size: 1rem; line-height: 1.85; color: var(--text-dim); }
.reframe-divider {
  font-size: 1.5rem;
  color: var(--gold-dim);
  padding-top: 3rem;
}
.reframe-text--animated .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px) rotateX(40deg);
  animation: wordIn 0.5s var(--ease-out) forwards;
}
@keyframes wordIn { to { opacity: 1; transform: none; } }

.fragments-found {
  margin-top: 2rem;
  padding: 1.25rem;
  background:
    radial-gradient(circle at top left, rgba(232,213,163,0.16), transparent 12rem),
    rgba(201,169,98,0.06);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  box-shadow: 0 0 32px rgba(201,169,98,0.12);
}
.fragments-found h4 { color: var(--gold); font-size: 0.85rem; margin-bottom: 0.75rem; }
.fragment-tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  margin: 0.25rem;
  background: rgba(201,169,98,0.12);
  border: 1px solid var(--gold-dim);
  font-size: 0.8rem;
  color: var(--gold-light);
  animation: fragmentGlow 2s ease-in-out infinite;
}
@keyframes fragmentGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(201,169,98,0.08); }
  50% { box-shadow: 0 0 22px rgba(232,213,163,0.45); }
}

.journey-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
}

/* Collection */
.collection-header { text-align: center; margin-bottom: 2rem; }
.collection-header h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
}
.collection-header p { color: var(--text-dim); max-width: 560px; margin: 0 auto 1rem; }
.collection-progress { color: var(--jade); font-size: 0.9rem; }
.constellation-wrap {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto 2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 0 48px rgba(201,169,98,0.12);
}
#constellation-canvas { width: 100%; height: 100%; }
.constellation-tooltip {
  position: absolute;
  background: var(--glass);
  border: 1px solid var(--gold-dim);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  pointer-events: none;
  backdrop-filter: blur(12px);
  max-width: 220px;
  z-index: 10;
}
.collection-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.collection-item {
  padding: 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.3s;
}
.collection-item.locked { opacity: 0.28; filter: grayscale(0.9); }
.collection-item.unlocked {
  border-color: rgba(232,213,163,0.65);
  box-shadow: 0 0 22px rgba(201,169,98,0.28), inset 0 0 24px rgba(201,169,98,0.06);
  background:
    radial-gradient(circle at top left, rgba(232,213,163,0.12), transparent 7rem),
    var(--glass);
}

/* Archive */
.archive-note { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 1.5rem; }
.archive-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card { text-align: center; padding: 1.5rem; }
.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-label { font-size: 0.8rem; color: var(--text-dim); letter-spacing: 0.08em; }
.archive-sections { display: flex; flex-direction: column; gap: 1.25rem; }
.archive-sections h3 {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 1rem;
}
.archive-list { list-style: none; }
.archive-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.9rem;
  color: var(--text-dim);
}
#reflection-input {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  padding: 0.75rem;
  color: var(--text);
  font-family: var(--font-sc);
  margin-bottom: 0.75rem;
  resize: vertical;
}
.badge-wall { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.badge {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  font-size: 0.8rem;
  color: var(--gold-light);
  background: rgba(201,169,98,0.08);
}
.badge.locked { opacity: 0.25; border-style: dashed; }

/* About poster */
.poster { max-width: 920px; margin: 0 auto; }
.poster-header { text-align: center; margin-bottom: 2.5rem; }
.poster-tag {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 0.75rem;
}
.poster-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 300;
  color: var(--gold-light);
  text-shadow: 0 0 42px rgba(201,169,98,0.22);
}
.poster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.poster-block {
  position: relative;
  overflow: hidden;
}
.poster-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(201,169,98,0.08), transparent 38%);
  opacity: 0.65;
  pointer-events: none;
}
.poster-block h3 {
  position: relative;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.poster-block p, .poster-list, .ref-list {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.75;
}
.poster-list { padding-left: 1.25rem; }
.poster-list li { margin-bottom: 0.4rem; }
.poster-block--wide { grid-column: 1 / -1; }
.bias-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.bias-tags li {
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(201,169,98,0.22);
  color: var(--gold-light);
  background: rgba(201,169,98,0.08);
  font-size: 0.8rem;
  border-radius: 2px;
}
.ref-list { list-style: none; }
.ref-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--glass-border); }
.poster-footer {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ── Research panel ── */
.research-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  animation: viewIn 0.35s var(--ease-out);
}
.research-panel.hidden { display: none !important; }
.research-panel__inner {
  width: 100%;
  max-width: 560px;
  max-height: min(85vh, 640px);
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.5rem;
}
.research-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
}
.research-panel__header h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--gold-light);
}
.research-panel__close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.research-panel__close:hover { color: var(--gold-light); }
.research-panel__body section { margin-bottom: 1.25rem; }
.research-panel__body h3 {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.research-panel__body p {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.65;
}

/* Parallax helper */
.parallax { will-change: transform; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    background: rgba(5,8,16,0.98);
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
  }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .card-grid, .card-grid--3 { grid-template-columns: 1fr; }
  .scanner-layout, .court-grid, .reframe-layout, .poster-grid, .archive-stats {
    grid-template-columns: 1fr;
  }
  .reframe-divider { display: none; }
  .wanderer { max-width: 260px; left: 0.75rem; bottom: 0.75rem; }
  .hero { padding: 2rem 0; }
  .hero-pitch { margin-left: 0; margin-right: 0; }
  #lang-label { display: none; }
  #research-toggle span:last-child { display: none; }
  .research-panel { align-items: stretch; padding: 0; }
  .research-panel__inner { max-height: 100vh; border-radius: 0; }
}

@media (max-width: 480px) {
  .view { padding: 1.25rem 1rem 5rem; }
  .intro-title { letter-spacing: 0.15em; }
}
