@font-face {
  font-family: "DM Sans";
  src: url("dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url("fraunces.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f3e9;
  --card: #fffdf8;
  --ink: #20392e;
  --body: #30423a;
  --muted: #5c695f;
  --green: #284b39;
  --soft-green: #e4ecdf;
  --line: #dcded1;
  --rust: #a3442c;
  --plum: #6c447c;
  --ochre: #9c661c;
  --opt-a: #284b39;
  --opt-b: #b35237;
  --opt-c: #794e8a;
  --opt-d: #b87c24;
  --theme-accent: var(--green);
  --theme-soft: var(--soft-green);
  --theme-border: #c9d8c7;
  --theme-stamp: #a83c28;
  --sans: "DM Sans", "PingFang SC", "Microsoft YaHei", "Microsoft JhengHei", system-ui, sans-serif;
  --display: Fraunces, Georgia, "Noto Serif CJK SC", "Songti SC", SimSun, serif;
}

html[lang="zh-Hant"] {
  --sans: "DM Sans", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --display: Fraunces, "Noto Serif CJK TC", "Songti TC", PMingLiU, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--body);
  background-color: var(--paper);
  background-image: radial-gradient(#223d3210 1px, transparent 1px);
  background-size: 22px 22px;
  font: 1rem/1.58 var(--sans);
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
p, h1, h2 { margin: 0; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 3px solid var(--rust); outline-offset: 4px; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

.skip {
  position: absolute;
  z-index: 1;
  top: .5rem;
  left: .5rem;
  transform: translateY(-200%);
  background: var(--card);
  padding: .65rem 1rem;
}

.skip:focus { transform: none; }
.shell { width: min(1140px, calc(100% - 3rem)); margin-inline: auto; }

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.languages {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbf8ef;
}

.languages a {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}

.languages a:hover { color: var(--ink); background: #ebe9dd; }
.languages a[aria-current] { color: var(--ink); background: var(--soft-green); }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, .96fr);
  align-items: start;
  gap: clamp(28px, 4.2vw, 60px);
  padding: 34px 0 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.accent-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rust); }

.display {
  color: var(--ink);
  font: 600 clamp(2.55rem, 4.8vw, 4.6rem)/1.06 var(--display);
  letter-spacing: -.05em;
  overflow-wrap: anywhere;
}

html:not([lang="en"]) .display { letter-spacing: -.02em; }
.intro .display { margin: 8px 0 8px; }
.intro .display span { color: var(--rust); }
html:not([lang="en"]) .intro .display span { display: none; }
.intro-line { color: var(--muted); font-size: clamp(.98rem, 1.45vw, 1.14rem); }

.art-side { position: sticky; top: 24px; min-width: 0; }

.office-art, .card-art {
  width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 18px 36px #253d2a18;
  border: 1px solid #d9dacb;
}

.office-art { background: #b6c0a5; }

.question-card {
  margin-top: 22px;
  padding: clamp(18px, 2.5vw, 30px);
  border: 1px solid #d7d9ca;
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 14px 36px #3f311b0d;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: .89rem;
  font-weight: 700;
}

.topic {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--green);
  background: var(--soft-green);
  font-size: .82rem;
  font-weight: 700;
}

.progress { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; margin: 12px 0 20px; }
.progress span { height: 6px; border-radius: 40px; background: #e8e7d9; transition: background-color .2s; }
.progress .past { background: #7f9d86; }
.progress .current { background: var(--rust); }

.question-card h2 {
  color: var(--ink);
  font: 600 clamp(1.26rem, 2.15vw, 1.72rem)/1.34 var(--display);
  scroll-margin-block: 20px;
}

.choose { margin-top: 8px; color: var(--muted); font-size: .9rem; }
.choices { display: grid; gap: 9px; margin-top: 16px; }

.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  text-align: start;
  min-height: 60px;
  gap: 12px;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: #fcfaf3;
  cursor: pointer;
  font-weight: 600;
  font-size: .96rem;
  line-height: 1.4;
  transition: transform .14s ease, background-color .15s, border-color .15s, opacity .18s, box-shadow .15s;
}

.letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #cddcc9;
  border-radius: 9px;
  background: var(--soft-green);
  color: var(--opt-a);
  font-weight: 750;
  font-size: .92rem;
  flex-shrink: 0;
  transition: background-color .15s, color .15s, border-color .15s;
}

.choice:nth-child(2) .letter { border-color: #ecd4c8; background: #f7e6de; color: var(--opt-b); }
.choice:nth-child(3) .letter { border-color: #dfd1e6; background: #f2e8f6; color: var(--opt-c); }
.choice:nth-child(4) .letter { border-color: #ebd9b4; background: #f8eed8; color: var(--opt-d); }

.choice:hover:not([aria-disabled="true"]) {
  transform: translateY(-1px);
  border-color: #879e89;
  background: #f3f5ec;
  box-shadow: 0 5px 14px #243b2a10;
}

.choice[aria-disabled="true"] { cursor: default; }
.choice.dimmed { opacity: .54; }
.choice[aria-pressed="true"] {
  border-color: var(--ink);
  background: #eef3ea;
  box-shadow: 0 6px 16px #20392e14;
}
.choice[aria-pressed="true"] .letter { color: #fff; background: var(--ink); border-color: var(--ink); }
.choice:disabled { cursor: default; }

.kbd-hint {
  margin-top: 12px;
  color: #7c877d;
  font-size: .8rem;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  display: grid;
  align-items: start;
  justify-items: start;
  gap: 12px;
  margin-top: 16px;
  animation: popIn .24s ease-out;
}

.reaction-box {
  width: 100%;
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid #e1dfd1;
  border-left: 4px solid var(--green);
  background: #faf6eb;
}

.reaction-box[data-trait="clash"] { border-left-color: var(--rust); background: #fbf1ec; border-color: #edd7cc; }
.reaction-box[data-trait="soft"] { border-left-color: var(--ochre); background: #fbf5e7; border-color: #ebdcb9; }
.reaction-box[data-trait="zen"] { border-left-color: var(--green); background: #eff5ec; border-color: #cfe0ca; }
.reaction-box[data-trait="chaos"] { border-left-color: var(--plum); background: #f6eef9; border-color: #e2d2e9; }

.reaction-text {
  color: var(--ink);
  font-weight: 650;
  font-size: .98rem;
  line-height: 1.5;
}

.vote-feedback {
  width: 100%;
  border-radius: 13px;
  background: #f1f4ea;
  border: 1px solid #d9e2d4;
  padding: 13px 15px;
  font-size: .9rem;
}

.vote-title { font-weight: 750; color: var(--ink); font-size: .96rem; line-height: 1.4; }
.vote-note { margin-top: 8px; font-size: .83rem; color: var(--muted); }

.vote-feedback svg {
  display: block;
  width: 100%;
  height: 10px;
  margin: 10px 0 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe4d7;
}

.vote-feedback rect[data-option="A"] { fill: var(--opt-a); }
.vote-feedback rect[data-option="B"] { fill: var(--opt-b); }
.vote-feedback rect[data-option="C"] { fill: var(--opt-c); }
.vote-feedback rect[data-option="D"] { fill: var(--opt-d); }

.vote-labels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.vote-chip {
  text-align: center;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  background: #ffffff9e;
  border: 1px solid #dce2d6;
}

.vote-chip[data-picked="true"] {
  color: #fff;
  border-color: transparent;
}
.vote-chip[data-picked="true"][data-option="A"] { background: var(--opt-a); }
.vote-chip[data-picked="true"][data-option="B"] { background: var(--opt-b); }
.vote-chip[data-picked="true"][data-option="C"] { background: var(--opt-c); }
.vote-chip[data-picked="true"][data-option="D"] { background: var(--opt-d); }

.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1.5px solid transparent;
  border-radius: 11px;
  padding: 9px 18px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform .12s ease, background-color .15s, border-color .15s;
}

.primary { border-color: var(--green); color: #fffdf2; background: var(--green); }
.primary:hover { background: #193b2a; transform: translateY(-1px); }
.secondary { border-color: #a8b2a4; color: var(--green); background: var(--card); }
.secondary:hover { background: #edf1e7; transform: translateY(-1px); }

/* Persona Diagnosis Themes */
.report[data-theme="clash"] {
  --theme-accent: #9c3822;
  --theme-soft: #f8e5de;
  --theme-border: #e5c3b6;
  --theme-stamp: #b2321b;
}
.report[data-theme="soft"] {
  --theme-accent: #8f5c18;
  --theme-soft: #f8ecd5;
  --theme-border: #e5cfa4;
  --theme-stamp: #a65e14;
}
.report[data-theme="zen"] {
  --theme-accent: #24503c;
  --theme-soft: #e1eee3;
  --theme-border: #bdd4c1;
  --theme-stamp: #24503c;
}
.report[data-theme="chaos"] {
  --theme-accent: #6c3b80;
  --theme-soft: #f1e3f6;
  --theme-border: #d9c0e3;
  --theme-stamp: #7b3696;
}

.report {
  padding: 10px 0 14px;
}

.report-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.emblem-badge {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--theme-soft);
  border: 1.5px solid var(--theme-border);
  color: var(--theme-accent);
  box-shadow: 0 6px 16px #20392e10;
}

.persona-emblem {
  width: 40px;
  height: 40px;
}

.stamp {
  display: inline-block;
  padding: 5px 13px;
  border: 2.5px solid var(--theme-stamp);
  border-radius: 8px;
  color: var(--theme-stamp);
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: rotate(-3.5deg);
  box-shadow: inset 0 0 0 2px var(--paper);
}

.report .eyebrow { color: var(--theme-accent); }
.report .accent-dot { background: var(--theme-accent); }
.report .display { margin: 8px 0 10px; font-size: clamp(2.3rem, 4.4vw, 3.8rem); }
.report-line { color: var(--ink); font-size: clamp(1.1rem, 1.9vw, 1.34rem); font-weight: 600; line-height: 1.42; }

.report-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.report-tag {
  color: var(--theme-accent);
  background: var(--theme-soft);
  border: 1px solid var(--theme-border);
}

.rebel-tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f5efe0;
  border: 1px solid #dfd7c2;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 700;
}

.status-pill {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.status-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.status-pill strong {
  color: var(--ink);
  font-size: .94rem;
}

.dna-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}

.panel-label {
  font-size: .82rem;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}

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

.dna-row { display: grid; gap: 5px; }
.dna-head {
  display: flex;
  justify-content: space-between;
  font-size: .86rem;
  color: var(--body);
}
.dna-head strong { color: var(--ink); }
.dna-row svg { display: block; width: 100%; height: 8px; }
.dna-track { fill: #e9e8dc; }
.dna-row rect[data-trait="clash"] { fill: var(--opt-b); }
.dna-row rect[data-trait="soft"] { fill: var(--opt-d); }
.dna-row rect[data-trait="zen"] { fill: var(--opt-a); }
.dna-row rect[data-trait="chaos"] { fill: var(--opt-c); }

.report-details { display: grid; gap: 10px; margin: 18px 0; font-size: .98rem; line-height: 1.65; }

.report-quote {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--theme-accent);
  border-radius: 0 12px 12px 0;
  background: var(--theme-soft);
}
.report-quote figcaption { color: var(--theme-accent); font-size: .84rem; font-weight: 750; }
.report-quote blockquote { margin: 5px 0 0; color: var(--ink); font-weight: 700; font-size: 1.02rem; }

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

.match-card {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  transition: border-color .15s, transform .12s;
}

.match-card:hover {
  border-color: var(--theme-accent);
  transform: translateY(-1px);
}

.match-label {
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.match-ally .match-label { color: var(--green); }
.match-nemesis .match-label { color: var(--rust); }
.match-card strong { color: var(--ink); font-size: .98rem; }
.match-line { color: var(--muted); font-size: .82rem; line-height: 1.38; }

.share-hint { margin: 0 0 12px; color: var(--muted); font-size: .94rem; }
.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 9px; }
.share-link { display: grid; flex-basis: 100%; gap: 4px; color: var(--muted); font-size: .9rem; }
.share-link input { width: 100%; border: 1px solid #a8b2a4; border-radius: 8px; background: var(--card); color: var(--ink); padding: 9px; }
.share-status { color: var(--green); font-size: .9rem; font-weight: 600; flex-basis: 100%; }
.share-status:empty { display: none; }
.text-button { margin-top: 12px; min-height: 44px; padding: 0; border: 0; color: var(--green); background: transparent; text-decoration: underline; cursor: pointer; font-weight: 600; }

.notes { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); }
.notes-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 16px; }
.notes-head h2 { color: var(--ink); font: 600 1.6rem/1.2 var(--display); }
.notes-head p { color: var(--muted); font-size: .925rem; }
.stories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.story-link { display: grid; align-content: start; gap: 5px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; text-decoration: none; background: #fbf8ef; transition: border-color .15s, background-color .15s; }
.story-link:hover { border-color: #9daa99; background: var(--card); }
.story-link strong { color: var(--ink); text-decoration: underline; text-decoration-color: #a6baaa; text-underline-offset: 3px; }
.story-link span { color: var(--muted); font-size: .9rem; }

.reading { max-width: 710px; min-height: 50vh; margin: 0 auto; padding: clamp(28px, 6vw, 65px) 0 22px; }
.reading .display { margin: 10px 0 16px; font-size: clamp(2.25rem, 5vw, 3.8rem); }
.reading > p:not(.eyebrow) { margin: 13px 0; }
.reading-lede { color: var(--muted); font-size: 1.15rem; }
.takeaway { margin: 24px 0; padding: 17px 20px; border-radius: 12px; background: var(--soft-green); }
.takeaway h2 { font-size: 1rem; }
.takeaway blockquote { margin: 8px 0 0; font-weight: 600; color: var(--ink); }
.reading .primary { margin-top: 10px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 38px;
  padding: 18px 0 25px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}

.footer div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 15px; }
.footer a { text-underline-offset: .2em; }

.consent {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 18px;
  margin-top: 16px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}
.consent h2 { color: var(--ink); font-size: 1rem; }
.consent p { color: var(--muted); font-size: .875rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-actions button { min-height: 44px; padding: 6px 12px; font-size: .875rem; }
.consent-actions [aria-pressed="true"] { background: var(--soft-green); }
.privacy-settings {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

@media (max-width: 820px) {
  .shell { width: calc(100% - 2rem); }
  .topbar { min-height: 64px; }
  .stage { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 22px; }
  .art-side { position: static; }
  .intro { position: relative; padding-right: 90px; min-height: 99px; }
  .intro::after {
    content: "";
    position: absolute;
    inset: 1px 0 auto auto;
    width: 78px;
    height: 92px;
    border-radius: 11px;
    background: #b6c0a5 url("office.webp") center 62% / cover;
  }
  .intro .display { font-size: clamp(2rem, 8vw, 3.1rem); }
  .intro-line { font-size: .925rem; }
  .office-art { display: none; }
  .stage:not(.finished):not(.result-stage) .art-side { display: none; }
  .card-art { max-width: 440px; margin-inline: auto; }
  .question-card { margin-top: 18px; }
  .kbd-hint { display: none; }
  .progress { margin-bottom: 16px; }
  .notes { margin-top: 29px; }
  .stories { grid-template-columns: 1fr; gap: 9px; }
  .report { padding: 8px 0 0; }
  .footer { margin-top: 28px; }
}

@media (max-width: 480px) {
  .shell { width: calc(100% - 1.5rem); }
  .wordmark { gap: 6px; font-size: .87rem; }
  .wordmark img { width: 29px; height: 29px; }
  .languages a { padding-inline: 7px; font-size: .78rem; }
  .languages { gap: 0; padding: 3px; }
  .question-card { padding: 15px; }
  .intro { padding-right: 78px; }
  .intro::after { width: 65px; height: 83px; }
  .vote-labels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dna-bars, .match-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .wordmark span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
