@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: Bricolage;
  src: url("/assets/fonts/Bricolage-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Bricolage;
  src: url("/assets/fonts/Bricolage-vi.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  color-scheme: light;
  --paper: #faf0dc;
  --ink: #251a20;
  --muted: #554535;
  --red: #c82e1d;
  --line: #a4896e;
  --lavender: #dcbce8;
  --yellow: #fae59b;
  --display: Bricolage, "DM Sans", system-ui, sans-serif;
  font: 16px/1.47 "DM Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
html[lang="vi"] { font-family: var(--display); }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--lavender); }
:focus-visible { outline: 3px solid #71338b; outline-offset: 4px; }
a { color: inherit; }
button, select, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
h1, h2, p { margin: 0; }
h1, h2 { font: 800 2.65rem/1 var(--display); letter-spacing: -.03em; }
p { text-wrap: pretty; }
img { display: block; max-width: 100%; }
.frame { width: min(1440px, calc(100% - 88px)); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: clamp(15px, 3vw, 45px);
  min-height: 70px;
  border-bottom: 2px solid var(--ink);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  text-decoration: none;
  white-space: nowrap;
  text-transform: uppercase;
  font: 800 clamp(1.31rem, 3.1vw, 2.9rem)/1 var(--display);
  letter-spacing: -.035em;
}
.wordmark img { width: clamp(29px, 4.2vw, 56px); height: 1.1em; object-fit: contain; }
.site-nav, .languages { display: flex; align-items: center; }
.site-nav { gap: clamp(15px, 2.8vw, 42px); font-weight: 710; }
.site-nav a, .languages a { text-decoration: none; }
.site-nav a { display: inline-flex; min-height: 44px; align-items: center; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.languages {
  border: 2px solid var(--ink);
  border-radius: 50px;
  overflow: hidden;
  font-size: .87rem;
  font-weight: 780;
}
.languages a { min-width: 43px; min-height: 44px; display: grid; place-items: center; }
.languages a[aria-current] { color: var(--paper); background: var(--ink); }
.languages a:focus-visible { outline-offset: -5px; outline-color: #8b49a1; }

.hero {
  display: grid;
  grid-template-columns: .98fr 1.02fr;
  gap: clamp(19px, 2.8vw, 48px);
  align-items: start;
  padding: 19px 0 24px;
}
.hero-content { min-width: 0; }
.hero h1 { font-size: clamp(3.86rem, 8.28vw, 8.1rem); line-height: .83; letter-spacing: -.042em; }
.hero h1 span { display: block; color: var(--red); }
html[lang="vi"] .hero h1 { font-size: clamp(3.35rem, 6.5vw, 6.7rem); line-height: 1.04; }
.intro { max-width: 64ch; margin-top: 15px; font-size: clamp(.98rem, 1.45vw, 1.22rem); line-height: 1.39; }
.fact-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: fit-content;
  gap: 0 8px;
  margin-top: 10px;
  padding: 6px 11px;
  background: var(--yellow);
  border-radius: 7px;
  font-weight: 765;
  font-size: clamp(.78rem, 1.3vw, 1.03rem);
}
.fact-row span { white-space: nowrap; }
.fact-row span + span::before { content: "·"; margin-right: 8px; }
.inviter { margin-top: 12px; font-weight: 690; }
.hero-deck { margin: 13px 0 0; min-width: 0; }
.deck-cards { position: relative; height: clamp(320px, 37vw, 547px); }
.deck-card {
  position: absolute;
  top: 3%;
  left: 28%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  width: 45%;
  height: 93%;
  padding: 6.5% 3.8% 4.5%;
  border: 2px solid var(--ink);
  border-radius: 5.8% 4.5% 5% 4% / 4% 4% 3% 3%;
  background: var(--accent);
  box-shadow: 1px 6px 12px #633f2f22;
  text-align: center;
}
.deck-card::before {
  content: "";
  position: absolute;
  inset: 2.2% 3%;
  border: 1px solid var(--ink);
  border-radius: 5%;
  pointer-events: none;
}
.deck-card img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.deck-card span {
  font: 800 clamp(1.5rem, 4.4vw, 4.65rem)/.98 var(--display);
  letter-spacing: -.04em;
  text-transform: uppercase;
  overflow-wrap: normal;
}
.deck-wrath { left: 7%; top: 14%; transform: rotate(-13deg); height: 79%; }
.deck-sloth { left: 49%; top: 14%; transform: rotate(12deg); height: 79%; }
.deck-envy { left: 27%; transform: rotate(1deg); }
.hero-deck figcaption { text-align: center; font-weight: 760; margin-top: 6px; }
#question-region { border-top: 2px solid var(--ink); margin-top: 17px; padding-top: 8px; }
.quiz-progress > span { display: block; font-size: .91rem; font-weight: 760; line-height: 1.2; }
progress {
  display: block;
  appearance: none;
  width: 100%;
  height: 10px;
  margin: 7px 0 11px;
  border: 1px solid var(--red);
  border-radius: 50px;
  overflow: hidden;
  background: transparent;
}
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--red); border-radius: 20px; }
progress::-moz-progress-bar { background: var(--red); border-radius: 20px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.question-copy, .question-reserve { display: grid; }
.question-copy { margin-bottom: 13px; }
.question-reserve { visibility: hidden; }
.question-copy > *, .question-reserve > * { grid-area: 1 / 1; }
.question-line {
  font: 790 clamp(1.53rem, 2.52vw, 2.43rem)/1.08 var(--display);
  letter-spacing: -.026em;
  text-wrap: pretty;
}
#question-title:focus { outline: 0; }
.options {
  --choice-size: clamp(44px, 6vw, 74px);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
.options::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline: 10%;
  top: calc(var(--choice-size) / 2);
  border-top: 1px solid var(--line);
}
.option {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-width: 0;
  text-align: center;
  cursor: pointer;
}
.option-number {
  display: grid;
  place-items: center;
  width: min(100%, var(--choice-size));
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font: 800 clamp(1.2rem, 2.8vw, 2.5rem)/1 var(--display);
  transition: background-color 125ms ease-out, box-shadow 125ms ease-out, transform 115ms ease-out;
}
.option-label { font-size: clamp(.72rem, 1.14vw, .9rem); line-height: 1.15; font-weight: 690; text-wrap: balance; }
.option input { position: absolute; width: 1px; height: 1px; margin: 0; clip-path: inset(50%); }
@media (hover: hover) {
  .option:hover .option-number { background: #f8e5c6; }
}
.option:active .option-number { transform: scale(.96); }
.option:has(input:checked) .option-number { background: var(--lavender); box-shadow: inset 0 0 0 1px var(--ink); }
.option:has(input:focus-visible) .option-number { outline: 3px solid #71338b; outline-offset: 3px; }
.quiz-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; }
#quiz-back { flex: 0 0 auto; white-space: nowrap; }
#quiz-back:disabled { visibility: hidden; }
#auto-advance { color: var(--muted); font-size: .85rem; font-weight: 600; text-align: right; }
.quiz-status:not(:empty) { margin-top: 10px; color: var(--red); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 775;
  text-decoration: none;
  line-height: 1.22;
}
.primary { color: var(--paper); background: var(--ink); }
.primary:hover:not(:disabled) { background: #483039; }
.primary:disabled { color: #fef0d9; background: #79686c; }
.secondary { color: var(--ink); background: #fdf5e6; border-color: var(--line); }
.secondary:hover:not(:disabled) { background: var(--yellow); }
.subtle { color: var(--ink); background: transparent; border-color: var(--line); }

.section { border-top: 2px solid var(--ink); padding: 13px 0 31px; }
.section-title { margin-bottom: 8px; }
.sin-gallery { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.sin-tile summary {
  position: relative;
  min-height: 112px;
  padding: 3px 5px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  border-radius: 9px;
}
.sin-tile summary:hover, .sin-tile[open] summary { background: var(--accent); }
.sin-tile summary img { width: 100%; height: clamp(74px, 9.9vw, 150px); object-fit: contain; }
.tile-name { font: 800 clamp(1.12rem, 2.45vw, 2.35rem)/1.03 var(--display); letter-spacing: -.037em; }
.disclosure { width: 8px; height: 8px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); flex: 0 0 auto; }
details[open] > summary .disclosure { transform: rotate(225deg); }
.sin-tile .disclosure { position: absolute; top: 11px; right: 12px; }
.tile-detail { padding: 9px 9px 13px; font-size: .89rem; }
.tile-detail p + p { margin-top: 7px; }
.reading { display: grid; grid-template-columns: .82fr 1.18fr; gap: 45px; padding-block: 24px 40px; }
.reading h2 { margin-bottom: 14px; font-size: 2.25rem; }
.reading p + p { margin-top: 13px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 45px; padding: 10px 3px; font-weight: 680; }
.faq-list details p { padding: 0 14px 13px 3px; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0; font-size: .82rem; }
.footer-inner .wordmark { font-size: 1.24rem; }
.footer-inner .wordmark img { width: 28px; }

.result-main { max-width: 1090px; padding-top: 28px; }
.profile-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 23px clamp(20px, 5vw, 60px); margin-bottom: 28px; }
.profile-text { grid-row: span 2; }
.profile-kicker { font-weight: 670; margin-bottom: 3px; }
.profile-text h1 { color: var(--red); font-size: clamp(4.1rem, 9.2vw, 8rem); line-height: .9; margin-bottom: 15px; }
.profile-art {
  display: grid;
  place-items: center;
  height: clamp(180px, 29vw, 318px);
  padding: 7px 12px;
  border-radius: 11px;
  background: var(--accent);
  overflow: hidden;
}
.profile-art img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.profile-tagline { margin: 10px 0 12px; font-weight: 625; font-style: italic; text-align: center; }
.quick-share .primary { width: 100%; font-size: 1.12rem; }
.quick-share-links { display: flex; justify-content: center; flex-wrap: wrap; }
.quick-share-links button { background: transparent; border: 0; color: var(--ink); min-height: 44px; padding: 6px 13px; text-decoration: underline; text-underline-offset: 3px; }
.quick-share-links button:disabled { color: var(--muted); }
#quick-status:not(:empty) { text-align: center; font-size: .81rem; }
.compare-note, #tie-note { margin-top: 10px; font-size: .91rem; }
.profile-reading { border-top: 1px solid var(--line); padding-top: 12px; }
.profile-detail { color: var(--muted); }
.virtue-chip { margin-top: 10px; font-size: .92rem; }
.virtue-chip span { margin-right: 7px; }
.challenge { padding: 20px; border: 1px solid var(--line); border-radius: 9px; }
.challenge h2, .score-panel h2, .share-panel h2 { font-size: clamp(1.66rem, 3.2vw, 2.7rem); margin-bottom: 10px; }
.challenge p { margin-bottom: 12px; }
.score-panel { padding-top: 5px; }
.score-panel ul { list-style: none; margin: 0; padding: 0; }
.score-panel li { display: grid; grid-template-columns: minmax(88px, .86fr) 1.4fr 42px; align-items: center; gap: 7px; padding: 5px 0; }
.score-name { font-weight: 745; }
.score-name small { display: block; color: var(--muted); font-size: .73rem; font-weight: 470; }
.score-points { text-align: right; font-size: .86rem; font-variant-numeric: tabular-nums; font-weight: 680; }
meter { width: 100%; height: 14px; appearance: none; }
meter::-webkit-meter-bar { background: #fef7e8; border: 1px solid #6a4c3b; }
meter::-webkit-meter-optimum-value { background: var(--meter-color); }
meter::-moz-meter-bar { background: var(--meter-color); border-radius: 20px; }
.share-panel {
  display: grid;
  grid-template-columns: minmax(165px, 245px) minmax(0, 1fr);
  gap: 26px;
  padding: 20px;
  margin-bottom: 24px;
  background: #fdf7e8;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.share-preview { display: flex; flex-direction: column; gap: 7px; }
.share-preview select { width: 100%; padding: 6px 7px; min-height: 44px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
#card-preview { display: block; width: 100%; height: auto; border-radius: 5px; }
.share-content > p { color: var(--muted); max-width: 66ch; }
.share-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.share-actions.featured { margin-top: 12px; }
.share-actions .button { font-size: .87rem; }
.share-privacy { margin-top: 12px; font-size: .82rem; }
.include-scores { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: .89rem; cursor: pointer; }
.include-scores input { accent-color: #71338b; width: 17px; height: 17px; margin: 0; flex: 0 0 auto; }
#share-status:not(:empty) { margin-top: 9px; font-size: .84rem; }
#manual-copy { width: 100%; min-height: 70px; margin: 8px 0; background: white; color: var(--ink); }
.retake { display: inline-flex; align-items: center; min-height: 44px; margin-top: 5px; color: var(--red); text-underline-offset: 3px; }
.not-found { padding: 72px 0; }
.not-found p { margin: 15px 0; }

@media (max-width: 950px) {
  .frame { width: calc(100% - 54px); }
  .hero { gap: 22px; }
  .deck-cards { height: clamp(300px, 42vw, 425px); }
  .sin-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 695px) {
  .frame { width: calc(100% - 34px); }
  .header-inner { min-height: 56px; grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .wordmark { font-size: clamp(1.35rem, 5.3vw, 2.12rem); }
  .wordmark img { width: 33px; height: 33px; }
  .languages a { min-width: 40px; }
  .hero { display: flex; flex-direction: column; gap: 13px; padding: 15px 0 18px; }
  .hero-content { width: 100%; }
  .hero h1 { font-size: clamp(3.7rem, 12.2vw, 6.1rem); }
  html[lang="vi"] .hero h1 { font-size: clamp(2.83rem, 10.4vw, 5.4rem); }
  .intro { max-width: 46ch; margin-top: 9px; }
  .fact-row { margin-top: 7px; gap: 0 6px; padding: 3px 0; background: transparent; }
  .fact-row span + span::before { margin-right: 6px; }
  #question-region { margin-top: 10px; padding-top: 9px; }
  .quiz-progress { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
  .quiz-progress > span { white-space: nowrap; }
  .quiz-progress progress { max-width: 51%; margin: 0; height: 10px; }
  .question-copy { margin: 10px 0 12px; }
  .question-line { font-size: clamp(1.42rem, 5vw, 2rem); line-height: 1.1; }
  .options { --choice-size: clamp(44px, 14vw, 59px); }
  .option-number { font-size: clamp(1.4rem, 6vw, 2rem); }
  .quiz-actions { margin-top: 12px; }
  .hero-deck { width: 100%; margin: 0; }
  .deck-cards { height: min(77vw, 365px); }
  .deck-card span { font-size: clamp(1.35rem, 6vw, 2.7rem); }
  .hero-deck figcaption { margin-top: 1px; font-size: .78rem; }
  .section { padding: 12px 0 22px; }
  .section-title h2 { font-size: 2.08rem; }
  .sin-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .sin-tile summary { min-height: 90px; padding: 3px 3px 8px; }
  .sin-tile .disclosure { right: 6px; top: 6px; width: 6px; height: 6px; }
  .tile-detail { padding: 7px 3px; font-size: .8rem; }
  .reading { grid-template-columns: 1fr; gap: 23px; }
  .footer-inner { display: grid; gap: 9px; }
  .footer-inner > span { display: none; }
  .result-main { padding-top: 15px; }
  .profile-layout { grid-template-columns: 1fr; gap: 14px; margin-bottom: 21px; }
  .profile-text { grid-row: auto; }
  .profile-kicker { font-size: .96rem; }
  .profile-text h1 { font-size: clamp(3.7rem, 13vw, 5.25rem); margin-bottom: 11px; }
  .profile-art { height: clamp(160px, 55vw, 250px); }
  .profile-tagline { margin: 9px 0; }
  .quick-share .primary { min-height: 48px; }
  .quick-share-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-panel { border-top: 2px solid var(--ink); padding-top: 10px; }
  .share-panel { display: flex; flex-direction: column-reverse; gap: 12px; padding: 13px; }
  .share-preview { width: min(100%, 225px); align-self: center; }
  .share-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .share-actions #share-image, .share-actions #share-link { grid-column: 1 / -1; }
  .share-actions .button { text-align: center; padding-inline: 8px; }
}
@media (max-width: 420px) {
  .hero { padding-top: 12px; }
  .hero h1 { font-size: clamp(3.05rem, 12vw, 4rem); }
  html[lang="vi"] .hero h1 { font-size: clamp(2.4rem, 10.5vw, 3.1rem); }
  .intro { font-size: .94rem; line-height: 1.35; }
}
@media (max-width: 340px) {
  .frame { width: calc(100% - 24px); }
  .options { gap: 3px; }
  .question-line { font-size: 1.26rem; }
  .option { gap: 5px; }
  .wordmark { gap: 5px; font-size: 1.22rem; }
  .languages a { min-width: 35px; }
}
@media (prefers-reduced-motion: reduce) {
  .option-number { transition: none; }
  .option:active .option-number { transform: none; }
}
