:root {
  --ink: #17211f;
  --muted: #62675f;
  --paper: #eee6d6;
  --paper-soft: rgba(239, 231, 216, 0.82);
  --line: rgba(23, 33, 31, 0.18);
  --forest: #1f332d;
  --moss: #646f5b;
  --wine: #6f3f43;
  --night: #101817;
  --crystal: #d8ded0;
  --shadow: 0 28px 90px rgba(14, 20, 19, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 6%, rgba(96, 74, 60, 0.18), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(71, 91, 77, 0.2), transparent 34%),
    linear-gradient(135deg, #111917 0%, #2f3a34 42%, #d6cebd 100%);
  font-family: "Noto Sans TC", system-ui, sans-serif;
}

body.has-dialog {
  overflow: hidden;
}

body:not(.has-entered) {
  overflow: hidden;
}

body:not(.has-entered) .site-header,
body:not(.has-entered) main,
body:not(.has-entered) footer {
  pointer-events: none;
  visibility: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(22px);
  opacity: 0.38;
  pointer-events: none;
}

body::before {
  width: 34vw;
  height: 34vw;
  min-width: 280px;
  min-height: 280px;
  left: -12vw;
  top: 18vh;
  background: rgba(95, 113, 89, 0.36);
  animation: slow-drift 34s ease-in-out infinite alternate;
}

body::after {
  width: 28vw;
  height: 28vw;
  min-width: 220px;
  min-height: 220px;
  right: -10vw;
  bottom: 8vh;
  background: rgba(111, 63, 67, 0.24);
  animation: slow-drift 30s ease-in-out infinite alternate-reverse;
}

#atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.entry-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  color: #f3eadb;
  background:
    radial-gradient(circle at 50% 42%, rgba(96, 74, 60, 0.24), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(244, 238, 225, 0.08), transparent 42%),
    linear-gradient(180deg, #070b0a 0%, #13201c 52%, #080b0a 100%);
  transition:
    opacity 680ms ease,
    visibility 680ms ease,
    transform 680ms ease;
}

body.has-entered .entry-screen {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
}

.entry-noise {
  position: absolute;
  inset: -20%;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(238, 230, 214, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 230, 214, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: rotate(-8deg);
  animation: entry-drift 16s ease-in-out infinite alternate;
}

.entry-orbit {
  position: absolute;
  width: min(74vmin, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(238, 230, 214, 0.16);
  border-radius: 50%;
  animation: slow-spin 26s linear infinite;
}

.entry-orbit::before,
.entry-orbit::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(111, 63, 67, 0.38);
  border-radius: 50%;
}

.entry-orbit::after {
  inset: 26%;
  border-color: rgba(100, 111, 91, 0.42);
}

.entry-orbit span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #efe7d8;
  box-shadow: 0 0 28px rgba(238, 230, 214, 0.68);
}

.entry-orbit span:nth-child(1) {
  top: 8%;
  left: 50%;
}

.entry-orbit span:nth-child(2) {
  right: 12%;
  bottom: 24%;
  background: #8a4a50;
}

.entry-orbit span:nth-child(3) {
  left: 17%;
  bottom: 19%;
  background: #768268;
}

.entry-copy {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  text-align: center;
  animation: entry-rise 900ms ease both;
}

.entry-prelude,
.entry-touch,
.entry-note {
  margin: 0;
  color: rgba(243, 234, 219, 0.72);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.entry-prelude {
  font-size: clamp(16px, 4vw, 22px);
}

.entry-touch {
  margin-top: 8px;
  color: rgba(243, 234, 219, 0.5);
  font-size: 14px;
}

.entry-copy h1 {
  margin: 52px 0 20px;
  color: #fff7e8;
  font-size: clamp(50px, 14vw, 100px);
  text-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
}

.entry-line {
  margin: 0 auto 34px;
  color: #efe7d8;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 700;
  line-height: 1.6;
}

.entry-button {
  min-height: 58px;
  border: 1px solid rgba(238, 230, 214, 0.45);
  border-radius: 999px;
  padding: 14px 34px;
  color: #101817;
  background: #efe7d8;
  box-shadow:
    0 0 0 8px rgba(238, 230, 214, 0.06),
    0 26px 70px rgba(0, 0, 0, 0.34);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease;
}

.entry-button:hover {
  transform: translateY(-3px);
  background: #fff7e8;
  box-shadow:
    0 0 0 10px rgba(238, 230, 214, 0.08),
    0 30px 80px rgba(0, 0, 0, 0.4);
}

.entry-note {
  max-width: 420px;
  margin: 22px auto 0;
  color: rgba(243, 234, 219, 0.55);
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: 0;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(23, 33, 31, 0.09);
  background: rgba(18, 27, 25, 0.84);
  backdrop-filter: blur(18px);
}

.brand,
nav a,
nav button,
.primary-link,
.secondary-link,
.paper-actions a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Noto Serif TC", serif;
  font-weight: 700;
  white-space: nowrap;
  color: #f2eadc;
}

.brand-mark {
  width: 12px;
  height: 24px;
  border: 1px solid var(--forest);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--forest), var(--moss));
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(242, 234, 220, 0.74);
  font-size: 14px;
}

nav button {
  border: 1px solid rgba(238, 230, 214, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  color: #f2eadc;
  background: rgba(244, 238, 225, 0.08);
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
.option-button:focus-visible {
  outline: 2px solid #efe7d8;
  outline-offset: 4px;
}

main {
  width: 100%;
  margin: 0 auto;
}

.hero {
  width: min(1080px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: clamp(28px, 7vw, 92px);
  padding: 112px 0 88px;
  color: #f4eadb;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #b88a75;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Noto Serif TC", serif;
  letter-spacing: 0;
}

h1 {
  position: relative;
  max-width: 820px;
  margin: 0;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 1.15;
  color: #f4eadb;
  text-shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
}

h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -14px;
  width: min(260px, 64%);
  height: 2px;
  background: linear-gradient(90deg, var(--wine), transparent);
  transform-origin: left;
  animation: ink-line 1.3s ease 320ms both;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 700px;
  margin: 28px 0 0;
  color: rgba(244, 234, 219, 0.76);
  font-size: 18px;
  line-height: 2;
}

.hero-intro,
.hero-copy > p.hero-intro {
  max-width: 680px;
  margin: 28px 0 0;
  color: rgba(244, 234, 219, 0.78);
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 2;
  letter-spacing: 0;
}

.hero-actions,
.paper-actions,
.test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.trust-row span {
  border: 1px solid rgba(244, 234, 219, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  color: rgba(244, 234, 219, 0.76);
  background: rgba(244, 238, 225, 0.07);
  font-size: 13px;
  font-weight: 700;
}

.primary-link,
.secondary-link,
.paper-actions a,
.test-actions button,
#restart-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.primary-link:hover,
.secondary-link:hover,
.paper-actions a:hover,
.test-actions button:hover,
#restart-button:hover,
nav button:hover {
  transform: translateY(-2px);
}

.primary-link,
#next-button {
  color: #fff;
  background: var(--night);
  box-shadow: 0 14px 32px rgba(17, 25, 24, 0.24);
}

.secondary-link,
.paper-actions a,
#back-button,
#restart-button {
  color: var(--forest);
  border-color: rgba(31, 51, 45, 0.28);
  background: rgba(246, 241, 230, 0.5);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.intake-note {
  border-left: 1px solid rgba(244, 234, 219, 0.22);
  padding: 26px 0 26px 28px;
}

.intake-note span {
  display: block;
  margin-bottom: 12px;
  color: rgba(244, 234, 219, 0.62);
  font-size: 13px;
  font-weight: 700;
}

.intake-note strong {
  display: block;
  font-family: "Noto Serif TC", serif;
  font-size: 28px;
}

.intake-note p {
  color: rgba(244, 234, 219, 0.66);
  line-height: 1.85;
}

section {
  width: min(1080px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  padding: 112px 0 88px;
  scroll-margin-top: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.quiz-section,
.result-section {
  border-top: 1px solid rgba(244, 234, 219, 0.12);
}

.section-heading {
  max-width: 740px;
  margin-bottom: 28px;
}

.quiz-section .section-heading {
  display: none;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  color: #f4eadb;
}

.section-heading p:not(.eyebrow) {
  margin: 14px 0 0;
  color: rgba(244, 234, 219, 0.64);
  line-height: 1.9;
}

.test-card,
.result-paper {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(238, 230, 214, 0.18);
  border-radius: 18px;
  background: rgba(238, 230, 214, 0.9);
  box-shadow: var(--shadow);
}

.test-card {
  max-width: 880px;
  padding: clamp(22px, 5vw, 44px);
  color: #f4eadb;
  background:
    linear-gradient(rgba(13, 21, 19, 0.95), rgba(13, 21, 19, 0.95)),
    repeating-linear-gradient(0deg, transparent 0, transparent 38px, rgba(238, 230, 214, 0.04) 39px);
  box-shadow:
    0 32px 100px rgba(5, 9, 8, 0.38),
    inset 0 0 0 1px rgba(238, 230, 214, 0.08);
}

.test-topline,
.paper-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

#progress-text {
  color: rgba(244, 234, 219, 0.72);
  font-weight: 700;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  margin: 18px 0 34px;
  background: rgba(238, 230, 214, 0.12);
}

#progress-bar {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), var(--wine));
  transition: width 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

.question-kicker {
  margin: 0 0 12px;
  color: #cda08e;
  font-size: 14px;
  font-weight: 700;
}

.selection-status {
  min-height: 24px;
  margin: -8px 0 18px;
  color: rgba(244, 234, 219, 0.62);
  font-size: 13px;
  font-weight: 700;
}

#question-title {
  max-width: 740px;
  margin: 0 0 24px;
  font-size: clamp(27px, 4vw, 41px);
  line-height: 1.45;
  animation: question-rise 520ms ease both;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-button {
  position: relative;
  min-height: 122px;
  border: 1px solid rgba(238, 230, 214, 0.17);
  border-radius: 14px;
  padding: 18px;
  color: #f4eadb;
  background: rgba(244, 238, 225, 0.07);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transform: translateY(0);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease,
    filter 220ms ease;
}

.option-button:hover {
  transform: translateY(-4px);
  border-color: rgba(238, 230, 214, 0.4);
  background: rgba(244, 238, 225, 0.12);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.option-button.is-selected {
  color: #101817;
  border-color: #efe7d8;
  background: #efe7d8;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  animation: selected-pulse 520ms ease both;
}

.option-button.is-selected::after {
  content: "已選";
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid rgba(16, 24, 23, 0.18);
  border-radius: 999px;
  padding: 4px 8px;
  color: #101817;
  background: rgba(255, 255, 255, 0.28);
  font-size: 12px;
  font-weight: 700;
}

.option-button span {
  display: block;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.65;
}

.option-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.option-letter {
  flex: 0 0 auto;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  opacity: 0.8;
}

.option-button small {
  display: block;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(238, 230, 214, 0.1);
  color: inherit;
  opacity: 0.74;
  font-size: 13.5px;
  line-height: 1.75;
  font-weight: 500;
}

.option-button small b {
  display: block;
  margin-bottom: 4px;
  color: currentColor;
  font-size: 12px;
  letter-spacing: 0;
  opacity: 0.84;
}

.option-button.is-selected small {
  border-top-color: rgba(16, 24, 23, 0.14);
  opacity: 0.78;
}

.test-card #back-button,
.test-card #skip-button,
.test-card #restart-button {
  color: #efe7d8;
  border-color: rgba(238, 230, 214, 0.28);
  background: rgba(238, 230, 214, 0.06);
}

.test-actions {
  justify-content: space-between;
}

.test-actions #skip-button {
  margin-inline: auto;
}

.result-paper {
  padding: clamp(24px, 5vw, 46px);
  background:
    linear-gradient(rgba(238, 230, 214, 0.95), rgba(238, 230, 214, 0.95)),
    repeating-linear-gradient(0deg, transparent 0, transparent 38px, rgba(31, 51, 45, 0.075) 39px);
}

.paper-header {
  border-bottom: 1px solid rgba(23, 33, 31, 0.18);
  padding-bottom: 20px;
}

.paper-header h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
}

#result-category {
  align-self: start;
  border: 1px solid rgba(31, 51, 45, 0.22);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--forest);
  background: rgba(246, 241, 230, 0.6);
  font-weight: 700;
}

.result-summary {
  margin: 28px 0 18px;
  border-left: 4px solid var(--wine);
  padding-left: 18px;
}

.result-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-weight: 700;
}

#result-symptom {
  display: block;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(42px, 8vw, 78px);
  line-height: 1.2;
}

#result-summary-text {
  max-width: 720px;
  margin: 10px 0 0;
  color: #34413d;
  font-size: 18px;
  line-height: 1.9;
}

.result-explain {
  margin-top: 28px;
  border-top: 1px solid rgba(23, 33, 31, 0.16);
  padding-top: 24px;
}

.result-explain h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.result-explain p {
  color: #34413d;
  line-height: 1.85;
  white-space: pre-line;
}

.result-note {
  margin: 14px 0 0;
  border-left: 3px solid rgba(111, 63, 67, 0.42);
  padding-left: 12px;
  color: var(--muted);
  font-size: 14px;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.result-metrics div,
.clue-box {
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 10px;
  background: rgba(244, 238, 225, 0.62);
  padding: 16px;
  animation: reveal-soft 620ms ease both;
}

.result-metrics div:nth-child(2) {
  animation-delay: 80ms;
}

.result-metrics div:nth-child(3) {
  animation-delay: 120ms;
}

.clue-box {
  animation-delay: 160ms;
}

.result-metrics span,
.clue-box p {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.result-metrics strong {
  font-family: "Noto Serif TC", serif;
  font-size: 26px;
}

.clue-box ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #34413d;
  line-height: 1.7;
}

.score-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  border-top: 1px solid rgba(23, 33, 31, 0.12);
  padding-top: 20px;
}

.score-note {
  display: grid;
  gap: 4px;
}

.score-note span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

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

.score-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.deep-reading {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.deep-reading article {
  border: 1px solid rgba(23, 33, 31, 0.12);
  border-radius: 12px;
  padding: 16px;
  background: rgba(244, 238, 225, 0.62);
}

.deep-reading h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 16px;
}

.deep-reading p {
  margin: 0;
  color: #34413d;
  line-height: 1.85;
}

.score-card {
  position: relative;
  overflow: hidden;
  min-height: 124px;
  border: 1px solid rgba(23, 33, 31, 0.12);
  border-radius: 12px;
  padding: 14px;
  background: rgba(244, 238, 225, 0.58);
  animation: reveal-soft 620ms ease both;
}

.score-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--score-color);
}

.score-card span,
.score-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.score-card strong {
  display: block;
  margin: 12px 0 10px;
  color: var(--ink);
  font-family: "Noto Serif TC", serif;
  font-size: 22px;
  line-height: 1.35;
}

.result-save {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1fr);
  gap: 22px;
  margin-top: 28px;
  border-top: 1px solid rgba(23, 33, 31, 0.16);
  padding-top: 24px;
}

.result-save h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

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

.save-controls {
  display: grid;
  gap: 10px;
}

.save-controls label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.save-controls input {
  min-height: 46px;
  border: 1px solid rgba(23, 33, 31, 0.18);
  border-radius: 999px;
  padding: 10px 15px;
  color: var(--ink);
  background: rgba(246, 241, 230, 0.72);
  font: inherit;
}

.save-controls button {
  min-height: 46px;
  border: 1px solid rgba(31, 51, 45, 0.28);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--forest);
  background: rgba(246, 241, 230, 0.58);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.save-controls button:hover {
  transform: translateY(-2px);
  background: rgba(246, 241, 230, 0.86);
}

#download-result-button {
  color: #fff;
  border-color: var(--night);
  background: var(--night);
}

.save-status {
  min-height: 22px;
  font-size: 13px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 26px clamp(20px, 4vw, 56px);
  color: var(--muted);
  font-size: 13px;
}

footer a {
  color: var(--forest);
  text-underline-offset: 3px;
}

.site-credit {
  flex-basis: 100%;
  margin-top: -6px;
  color: color-mix(in srgb, var(--muted) 58%, transparent);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: right;
}

.image-dialog[hidden] {
  display: none;
}

.image-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 23, 0.62);
  backdrop-filter: blur(10px);
}

.image-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88vh, 940px);
  overflow: auto;
  border: 1px solid rgba(238, 230, 214, 0.3);
  border-radius: 18px;
  padding: 22px;
  background: rgba(238, 230, 214, 0.96);
  box-shadow: 0 30px 100px rgba(14, 20, 19, 0.38);
}

.image-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.image-dialog-heading h2 {
  margin: 0;
  font-size: 28px;
}

.icon-close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(31, 51, 45, 0.26);
  border-radius: 50%;
  color: var(--forest);
  background: rgba(246, 241, 230, 0.62);
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}

.image-dialog-help {
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.75;
}

#result-image-preview {
  display: block;
  width: 100%;
  max-height: 64vh;
  object-fit: contain;
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 12px;
  background: #efe7d8;
}

.image-dialog-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.image-dialog-actions button,
.image-dialog-actions a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(31, 51, 45, 0.28);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--forest);
  background: rgba(246, 241, 230, 0.72);
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

#save-image-button {
  color: #fff;
  border-color: var(--night);
  background: var(--night);
}

.reveal {
  animation: fade-up 820ms ease both;
}

.option-button {
  animation: option-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result-paper.is-ready {
  animation: result-settle 900ms ease both;
}

.test-card.is-changing {
  animation: card-turn 620ms ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slow-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(42px, -36px, 0) scale(1.12);
  }
}

@keyframes ink-line {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes question-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes option-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes selected-pulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.025);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes card-turn {
  from {
    opacity: 0.92;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-soft {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes score-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes result-settle {
  0% {
    opacity: 0.92;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes entry-rise {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes entry-drift {
  from {
    transform: translate3d(-16px, -10px, 0) rotate(-8deg);
  }
  to {
    transform: translate3d(18px, 12px, 0) rotate(-8deg);
  }
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 100svh;
    padding-top: 102px;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  html {
    scroll-snap-type: none;
  }

  body {
    background:
      radial-gradient(circle at 50% 0%, rgba(111, 63, 67, 0.22), transparent 36%),
      linear-gradient(160deg, #17211f 0%, #3b473f 52%, #d7d0c1 100%);
  }

  .entry-screen {
    min-height: 100svh;
    padding: 24px 18px;
  }

  .entry-orbit {
    width: 92vmin;
  }

  .entry-copy h1 {
    margin-top: 44px;
    font-size: clamp(48px, 16vw, 74px);
  }

  .entry-line {
    margin-bottom: 28px;
    font-size: clamp(22px, 7vw, 30px);
  }

  .entry-button {
    width: min(100%, 320px);
    min-height: 56px;
  }

  .entry-note {
    font-size: 12px;
  }

  main {
    width: 100%;
  }

  .site-header {
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
  }

  .brand {
    gap: 8px;
    font-size: 18px;
  }

  .brand-mark {
    width: 10px;
    height: 22px;
  }

  nav {
    width: auto;
    margin-left: auto;
    gap: 8px;
    font-size: 12px;
  }

  nav a {
    display: none;
  }

  nav button {
    padding: 9px 12px;
    white-space: nowrap;
  }

  h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .hero-copy > p:not(.eyebrow),
  #result-summary-text {
    font-size: 16px;
    line-height: 1.9;
  }

  .intake-note {
    border-left: 0;
    border-top: 1px solid rgba(23, 33, 31, 0.18);
    padding: 22px 0 0;
  }

  section {
    width: 100%;
    min-height: 100svh;
    padding: 92px 0 38px;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  .hero {
    width: calc(100% - 28px);
    min-height: 100svh;
    padding: 92px 0 38px;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  .test-card,
  .result-paper {
    width: calc(100% - 28px);
    margin: 0 auto;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 18px 60px rgba(14, 20, 19, 0.16);
  }

  .test-card {
    box-shadow: 0 22px 70px rgba(5, 9, 8, 0.32);
  }

  .paper-header {
    flex-direction: column;
  }

  .test-topline {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  #progress-text {
    font-size: 14px;
  }

  #restart-button {
    min-height: 42px;
    margin-left: auto;
    padding: 9px 14px;
    font-size: 14px;
  }

  .progress-track {
    height: 8px;
    margin: 18px 0 28px;
  }

  .question-kicker {
    font-size: 13px;
    line-height: 1.5;
  }

  #question-title {
    margin-bottom: 20px;
    font-size: clamp(24px, 7.2vw, 31px);
    line-height: 1.5;
  }

  .option-grid {
    gap: 12px;
  }

  .option-button {
    min-height: 0;
    border-radius: 12px;
    padding: 16px;
  }

  .option-button span {
    font-size: 17px;
    line-height: 1.55;
  }

  .option-letter {
    width: 28px;
    height: 28px;
  }

  .option-button small {
    margin-top: 10px;
    font-size: 12px;
  }

  .test-actions {
    position: sticky;
    bottom: 10px;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr;
    margin: 22px 0 0;
    padding: 10px;
    border: 1px solid rgba(238, 230, 214, 0.12);
    border-radius: 18px;
    background: rgba(13, 21, 19, 0.88);
    backdrop-filter: blur(14px);
  }

  .test-actions #skip-button {
    margin-inline: 0;
  }

  .test-actions button {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    font-size: 15px;
  }

  .result-summary {
    padding-left: 14px;
  }

  #result-symptom {
    font-size: clamp(38px, 11vw, 58px);
  }

  .result-metrics,
  .result-save,
  .score-card-grid {
    grid-template-columns: 1fr;
  }

  .email-row {
    grid-template-columns: 1fr;
  }

  .result-save {
    gap: 16px;
    margin-top: 24px;
    padding-top: 22px;
  }

  .save-controls input,
  .save-controls button {
    width: 100%;
    border-radius: 14px;
  }

  .image-dialog {
    align-items: end;
    padding: 10px;
  }

  .image-dialog-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 10px 10px;
    padding: 18px;
  }

  .image-dialog-heading h2 {
    font-size: 24px;
  }

  #result-image-preview {
    max-height: 62vh;
  }

  .image-dialog-actions {
    grid-template-columns: 1fr;
  }

  .image-dialog-actions button,
  .image-dialog-actions a {
    border-radius: 14px;
  }

  footer {
    padding: 24px 16px 36px;
  }
}

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