:root {
  color-scheme: dark;
  --bg: #130e1c;
  --bg-soft: #21182b;
  --panel: rgba(30, 21, 39, 0.88);
  --panel-strong: #291e34;
  --text: #f6efe4;
  --muted: #c6b9c9;
  --soft: #a799ad;
  --gold: #e1c48e;
  --teal: #c9b1d7;
  --rose: #efb4bd;
  --line: rgba(225, 196, 142, 0.18);
  --radius: 24px;
  --shadow: 0 18px 48px rgba(7, 3, 12, 0.24);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: clip; scroll-padding-top: 24px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  isolation: isolate;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  background: var(--bg);
  line-height: 1.7;
}
/* A fixed painted layer avoids mobile background-attachment jumps. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(19, 12, 29, 0.52), rgba(19, 12, 29, 0.78) 55%, #130e1cf2),
    linear-gradient(90deg, #1c102957, transparent 50%, #1c102957),
    url("assets/journey.webp") center top / cover no-repeat;
}
.jojoti-aura {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 18%, #b28cbd17, transparent 65%);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where(button, a, input, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 3px solid #f6dba6;
  outline-offset: 4px;
}
/* Programmatically focused headings keep screen-reader navigation without a native outline. */
.app-shell [tabindex="-1"]:focus { outline: none; }
::selection { color: #160e21; background: var(--gold); }
[hidden] { display: none !important; }

.app-shell {
  position: relative;
  width: min(calc(100% - 32px), 520px);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding-block: max(16px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-shell > *, .brand-copy, .result-copy, .near-card > div { min-width: 0; }
.panel, .hero-panel, .question-card, .result-panel, .result-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body > .site-header, body > .site-footer {
  width: min(calc(100% - 32px), 520px);
  margin-inline: auto;
}
body > .site-header { padding-top: max(20px, env(safe-area-inset-top)); }
.brand-home { display: inline-flex; align-items: center; gap: 11px; padding: 0; border: 0; background: transparent; color: inherit; text-decoration: none; text-align: left; }
.brand-badge {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #e1c48e42;
  border-radius: 12px;
  background: #e1c48e0b;
  color: var(--gold);
  font-size: 23px;
}
.brand-copy { line-height: 1.3; font-weight: 700; letter-spacing: 0.12em; }
.brand-copy > span { color: var(--gold); }
.brand-copy h1 { margin: 0; font-size: 24px; letter-spacing: 0.05em; }
.brand-copy h1 span { color: var(--gold); }
.brand-copy small { color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: 0.22em; }
.brand-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.site-header > .brand-copy { flex: 1; }
.header-edition { color: var(--soft); font-size: 10px; letter-spacing: 0.14em; text-align: right; }
.eyebrow { margin: 0 0 12px; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.muted, .question-tone { color: var(--muted); }

.landing { display: grid; gap: 16px; }
.landing-stage { padding: 32px 24px 24px; text-align: center; }
.hero-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  margin: 2px auto 26px;
  color: var(--gold);
  font-size: 54px;
  line-height: 1;
  text-shadow: 0 0 32px #e1c48e33;
}
.hero-emblem::before, .hero-emblem::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #e1c48e42;
  border-radius: 50%;
  transform: rotate(-28deg) scaleX(1.18) scaleY(0.66);
  pointer-events: none;
}
.hero-emblem::after { inset: 0; transform: rotate(42deg) scaleX(0.76); border-color: #e1c48e20; }
.landing-copy h2, .question-head h2, .result-copy h2, .section-heading h2, .analyzing h2 {
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-weight: 600;
  text-wrap: balance;
}
.landing-copy h2 { font-size: clamp(30px, 8vw, 42px); line-height: 1.35; letter-spacing: -0.035em; }
.landing-copy h2 em { color: var(--gold); font-style: normal; }
.landing-copy p { margin: 20px auto 0; max-width: 34ch; color: var(--muted); font-size: 13px; line-height: 1.95; }
.landing-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 28px 0 24px; padding: 18px 0; border-block: 1px solid var(--line); }
.landing-stats > div + div { border-left: 1px solid var(--line); }
.landing-stats strong { display: block; color: var(--gold); font-family: "Cormorant Garamond", serif; font-size: 28px; line-height: 1.2; }
.landing-stats strong span { font-family: "Noto Sans SC", sans-serif; font-size: 11px; }
.landing-stats small { display: block; margin-top: 6px; color: var(--soft); font-size: 10px; }
.landing-disclaimer { margin: 14px 0 0; color: var(--soft); font-size: 10px; line-height: 1.8; }
.landing-aside, .landing-points { display: grid; gap: 12px; }
.landing-aside { padding: 20px; }
.point-card { padding: 14px 0; border-bottom: 1px solid var(--line); }
.point-card:last-child { border-bottom: 0; }
.point-card strong { font-size: 13px; }
.point-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.button-primary, .button-secondary, .button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.button-primary { width: 100%; background: var(--gold); color: #24172a; box-shadow: 0 6px 24px #e1c48e14; }
.button-secondary { color: var(--text); border-color: #e1c48e42; background: #e1c48e09; }
.button-ghost { min-height: 44px; padding-inline: 12px; color: var(--muted); background: transparent; border-color: var(--line); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.action-row, .floating-actions, .result-actions { position: static; display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

.question-card { padding: 22px; }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.progress-row strong { color: var(--gold); font-size: 11px; font-variant-numeric: tabular-nums; }
.question-tone { font-size: 11px; }
.progress-track, .summary-bar { height: 4px; overflow: hidden; border-radius: 99px; background: #e1c48e15; }
.progress-track { margin-bottom: 30px; }
.progress-track span, .summary-bar-fill { display: block; max-width: 100%; height: 100%; border-radius: inherit; background: var(--gold); }
.question-head { margin: 28px 0 24px; }
.question-head h2 { font-size: clamp(22px, 5.5vw, 28px); line-height: 1.6; }
.options-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.option-card { display: flex; align-items: center; gap: 13px; width: 100%; min-width: 0; min-height: 72px; padding: 15px; border: 1px solid #c9b1d726; border-radius: 14px; background: #ffffff04; color: var(--text); text-align: left; font-size: 13px; line-height: 1.75; transition: border-color 160ms ease, background-color 160ms ease; }
.option-card > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.option-marker { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); color: var(--gold); font-size: 11px; font-weight: 700; }
.option-card.is-selected, .option-card[aria-pressed="true"] { border-color: var(--gold); background: #e1c48e10; }
.option-card.is-selected .option-marker, .option-card[aria-pressed="true"] .option-marker { background: var(--gold); color: #24172a; }
.question-footer { margin-top: 22px; color: var(--soft); text-align: center; font-size: 11px; }

.result-hero { display: flex; flex-direction: column; gap: 24px; padding: 22px; text-align: center; }
.result-image-wrap { width: 100%; height: 240px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(ellipse at center bottom, #57406066, #160f20); }
.result-image-wrap img, .result-image { width: 100%; height: 240px; object-fit: contain; object-position: center; }
.result-copy h2 { font-size: clamp(28px, 7vw, 38px); line-height: 1.35; }
.result-copy p { color: var(--muted); font-size: 13px; line-height: 1.85; }
.result-copy .result-meta { margin: 10px 0 0; color: var(--soft); font-size: 11px; }
.result-copy .role-line { margin: 16px 0 0; color: var(--text); }
.tag-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 18px; }
.metric-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--gold); background: #e1c48e08; font-size: 10px; }
.hero-quote { margin: 24px 0 0; padding: 18px 4px 0; border-top: 1px solid var(--line); color: var(--gold); font-family: "Cormorant Garamond", "Noto Serif SC", serif; font-size: 17px; line-height: 1.8; }
.match-badge { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin-top: 16px; padding: 6px 14px; border: 1px solid #e1c48e45; border-radius: 99px; background: #e1c48e0d; color: var(--gold); font-size: 12px; font-variant-numeric: tabular-nums; }
.result-panel { padding: 22px; }
.section-heading { margin-bottom: 20px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.section-heading h2 { font-size: 22px; line-height: 1.45; }
.section-heading p { color: var(--muted); font-size: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.summary-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff03; }
.summary-card .muted { font-size: 10px; }
.summary-card strong { display: block; margin: 5px 0 10px; color: var(--gold); font-family: "Cormorant Garamond", serif; font-size: 32px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.result-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.summary-card .result-note { margin-top: 10px; font-size: 10px; }
.near-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.near-card { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.near-card img { width: 64px; height: 86px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #1b1325; }
.near-card strong { display: block; color: var(--text); font-size: 13px; line-height: 1.6; }
.near-card span { display: block; color: var(--soft); font-size: 10px; }
.near-card p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.near-card .near-score { color: var(--gold); font-size: 11px; font-variant-numeric: tabular-nums; }
.near-card > .near-score { grid-column: 2; margin-top: -8px; }
.export-error { margin: 14px 0 0; color: var(--rose); font-size: 12px; overflow-wrap: anywhere; }

.analyzing, .loader, .empty-state { padding: 52px 22px; text-align: center; }
.analyzing h2 { font-size: 26px; }
.analyzing p, .loader p, .empty-state p { color: var(--muted); font-size: 12px; }
.loader strong, .empty-state strong { display: block; font-size: 16px; }
.analysis-orbit { position: relative; width: 76px; height: 76px; margin: 0 auto 28px; border: 1px solid #e1c48e33; border-radius: 50%; color: var(--gold); display: grid; place-items: center; font-size: 30px; }
.analysis-orbit::after { content: ""; position: absolute; inset: -1px; border: 2px solid transparent; border-top-color: var(--gold); border-radius: inherit; animation: stardust-orbit 2.4s linear infinite; }
@keyframes stardust-orbit { to { transform: rotate(360deg); } }
.site-footer { padding: 20px 0 max(20px, env(safe-area-inset-bottom)); color: var(--soft); text-align: center; font-size: 10px; line-height: 1.9; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--muted); }

/* Ads stay in document flow, outside the result surfaces. */
.ad-slot-shell, .top-ad {
  position: relative;
  display: flex;
  justify-content: center;
  width: min(calc(100% - 32px), 520px);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}
.ad-slot-shell:not(:empty) { margin-block: 16px max(16px, env(safe-area-inset-bottom)); }
.ad-slot-shell:empty, .top-ad:empty { display: none; margin: 0; padding: 0; min-height: 0; }
.ad-slot-shell iframe, .ad-slot-shell img { max-width: 100%; border: 0; }
.top-ad { flex-direction: column; align-items: center; }
.top-ad .ad-slot-shell { width: 100%; margin-block: 12px 0; }
.top-ad:not(:has(.ad-slot-shell:not(:empty), iframe, img)) { display: none; }

@media (hover: hover) {
  .button-primary:not(:disabled):hover { background: #eed5a8; transform: translateY(-1px); }
  .button-secondary:not(:disabled):hover, .button-ghost:not(:disabled):hover { background: #e1c48e14; border-color: #e1c48e70; }
  .option-card:not(:disabled):hover { border-color: #e1c48e80; background: #e1c48e0d; }
}
@media (max-width: 360px) {
  .landing-stage, .question-card, .result-hero, .result-panel { padding-inline: 16px; }
  .header-edition { max-width: 80px; font-size: 9px; }
  .summary-grid { gap: 8px; }
  .summary-card { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
