:root {
  --ink: #33251e;
  --muted: #756d66;
  --paper: #f6f0e7;
  --line: #d9c8b6;
  --red: #c96f60;
  --blue: #718da1;
  --yellow: #d0aa61;
  --green: #839d7c;
  --shadow: 0 24px 58px rgba(37, 22, 13, .16);
}

body {
  color: #fff9ee;
  background: radial-gradient(ellipse at 53% -12%, #c7a979 0%, #a17c56 30%, #714d35 68%, #493228 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .13;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 248, 230, .07) 4px 5px);
}

.ambient-one {
  background: radial-gradient(circle, rgba(236, 200, 140, .22), transparent 70%);
}

.ambient-two {
  background: radial-gradient(circle, rgba(42, 27, 20, .12), transparent 70%);
}

.site-header,
.site-footer {
  border-color: rgba(255, 242, 218, .24);
}

.brand,
.brand-dot {
  color: #fff9ee;
}

.brand {
  letter-spacing: .035em;
  font-weight: 650;
}

.brand-mark {
  transform: rotate(-12deg);
  gap: 2px;
}

.brand-mark i:nth-child(1),
.brand-mark i:nth-child(2),
.brand-mark i:nth-child(3),
.brand-mark i:nth-child(4) {
  background: #efe0c7;
}

.header-note,
.site-footer {
  color: rgba(255, 247, 231, .7);
}

.intro-view {
  position: relative;
  isolation: isolate;
  min-height: 690px;
  gap: 46px;
}

.brush-watermark {
  position: absolute;
  z-index: -1;
  left: 7%;
  top: 0;
  font-family: "STKaiti", "Kaiti SC", "KaiTi", serif;
  font-size: clamp(320px, 45vw, 580px);
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 235, 198, .08);
  transform: rotate(-13deg);
  pointer-events: none;
}

.intro-copy {
  grid-column: 2;
  grid-row: 1;
  padding: 0 10px 0 0;
}

.intro-art {
  grid-column: 1;
  grid-row: 1;
}

.eyebrow,
.section-label {
  color: #f0d5aa;
}

.intro-copy h1,
.result-heading h1 {
  color: #fffaf0;
  font-weight: 760;
  text-shadow: 0 8px 26px rgba(45, 24, 13, .12);
}

.intro-copy h1 {
  font-size: clamp(46px, 4.8vw, 64px);
  letter-spacing: -.055em;
}

.title-accent {
  color: #f4d19f;
}

.title-accent::after {
  background: rgba(240, 207, 153, .16);
}

.intro-lead {
  color: rgba(255, 247, 232, .86);
}

.intro-note {
  color: rgba(255, 245, 226, .82);
  border-color: rgba(255, 238, 210, .24);
  background: rgba(52, 32, 23, .18);
  backdrop-filter: blur(12px);
}

.intro-note p span {
  color: #fff8eb;
}

.note-spark,
.art-star {
  color: #ebc78d;
}

.privacy-note,
.result-footnote {
  color: rgba(255, 244, 222, .6);
}

.primary-button {
  color: #473125;
  border-color: #edd5ad;
  background: #f4dcba;
  box-shadow: 0 12px 30px rgba(33, 20, 11, .2);
}

.primary-button:hover {
  background: #ffebcd;
  box-shadow: 0 18px 36px rgba(33, 20, 11, .26);
}

.secondary-button {
  color: #fff7e8;
  border-color: rgba(255, 241, 216, .52);
  background: rgba(255, 247, 232, .07);
}

.secondary-button:hover {
  color: #493126;
  background: #f6e8d1;
}

.orbit {
  border-color: rgba(255, 240, 212, .28);
}

.orbit-outer {
  border-style: solid;
}

.orbit-inner {
  opacity: .45;
}

.color-disc {
  box-shadow: inset 0 4px 24px rgba(255, 239, 213, .25), 0 24px 50px rgba(39, 22, 13, .25);
}

.disc-red { background: linear-gradient(140deg, #df9b7b, #a84d48); }
.disc-blue { background: linear-gradient(140deg, #9db0ad, #526f88); }
.disc-yellow { background: linear-gradient(140deg, #e4cb91, #b88943); }
.disc-green { background: linear-gradient(140deg, #a9baa0, #607d66); }

.center-disc {
  color: #fff8e9;
  background: rgba(73, 46, 31, .82);
  border: 1px solid rgba(255, 241, 218, .36);
  box-shadow: 0 22px 55px rgba(39, 22, 13, .24), inset 0 0 0 9px rgba(255, 244, 221, .05);
}

.text-button,
.progress-copy,
.progress-copy span:first-child,
.question-hint {
  color: rgba(255, 247, 232, .76);
}

.text-button:hover,
.question-panel h2 {
  color: #fff9ee;
}

.progress-track {
  background: rgba(255, 241, 215, .22);
}

.progress-track span {
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green), var(--blue));
}

.question-kicker {
  color: rgba(255, 226, 184, .64);
}

.option {
  color: #4a3b31;
  border-color: rgba(238, 219, 193, .85);
  background: #f4ecdf;
  box-shadow: 0 9px 20px rgba(40, 23, 13, .08);
}

.option:hover {
  border-color: #e6c699;
  background: #fff7e9;
}

.option.selected {
  color: #33251e;
  border-color: #eac384;
  background: #fff8ec;
  box-shadow: 0 0 0 2px rgba(234, 195, 132, .18), 0 15px 30px rgba(38, 21, 11, .18);
}

.option-letter {
  color: #715944;
  background: #e8d9c5;
}

.option.selected .option-letter {
  color: #fff9ed;
  background: #70503b;
}

.form-message {
  color: #ffdbb8;
}

.overview,
.score-panel {
  color: #3d2c23;
  border-color: #e6d6c1;
  background: #f6eee2;
  box-shadow: var(--shadow);
}

.question-number {
  color: #8f7e6e;
  border-color: #e2d2bf;
  background: #fff9ee;
}

.question-number.answered {
  color: #59745c;
  border-color: #c9d7c5;
  background: #e9efe4;
}

.question-number.current {
  color: #6b4934;
  border-color: #6b4934;
  box-shadow: inset 0 0 0 1px #6b4934;
}

.result-heading p:last-child,
.method {
  color: rgba(255, 247, 232, .82);
}

.donut-center {
  color: #fff8eb;
  background: #684932;
  box-shadow: inset 0 5px 18px rgba(26, 15, 10, .18);
}

.donut-center span {
  color: rgba(255, 246, 229, .72);
}

.result-explain {
  color: #85786c;
  border-color: #e5d7c6;
}

.score-bar {
  background: #e7dac8;
}

.method summary:hover {
  color: #fff;
}

/* Keep the landing screen clear and paper-like while preserving the warm theme in the test. */
body[data-view="intro"] {
  color: #4b3225;
  background: #fff;
  background-attachment: initial;
}

body[data-view="intro"]::before {
  display: none;
}

body[data-view="intro"] .site-header,
body[data-view="intro"] .site-footer {
  border-color: rgba(75, 50, 37, .14);
}

body[data-view="intro"] .brand {
  color: #4b3225;
}

body[data-view="intro"] .brand-dot {
  color: #c96f60;
}

body[data-view="intro"] .brand-mark i:nth-child(1) { background: #c96f60; }
body[data-view="intro"] .brand-mark i:nth-child(2) { background: #7895aa; }
body[data-view="intro"] .brand-mark i:nth-child(3) { background: #d9b15c; }
body[data-view="intro"] .brand-mark i:nth-child(4) { background: #86a181; }

body[data-view="intro"] .header-note,
body[data-view="intro"] .site-footer {
  color: rgba(75, 50, 37, .58);
}

body[data-view="intro"] .eyebrow {
  color: #9a684c;
}

body[data-view="intro"] .intro-copy h1 {
  color: #4b3225;
  text-shadow: none;
}

body[data-view="intro"] .title-accent {
  color: #b96956;
}

body[data-view="intro"] .title-accent::after {
  background: rgba(201, 111, 96, .15);
}

body[data-view="intro"] .intro-lead {
  color: #6e5a4c;
}

body[data-view="intro"] .intro-note {
  color: #756457;
  border-color: #e8dccd;
  background: #fbf6ef;
}

body[data-view="intro"] .intro-note p span {
  color: #4b3225;
}

body[data-view="intro"] .privacy-note {
  color: rgba(75, 50, 37, .55);
}

body[data-view="intro"] .primary-button {
  color: #fff8ee;
  border-color: #6a4934;
  background: #6a4934;
  box-shadow: 0 12px 30px rgba(75, 50, 37, .16);
}

body[data-view="intro"] .primary-button:hover {
  background: #4b3225;
}

@media (max-width: 900px) {
  .intro-copy,
  .intro-art {
    grid-column: auto;
    grid-row: auto;
  }

  .brush-watermark {
    top: 23%;
    left: 14%;
    font-size: 350px;
  }
}

@media (max-width: 640px) {
  body { background-attachment: scroll; }
  .shell { min-height: 100dvh; }
  .site-header { height: 64px; flex: 0 0 64px; }
  .site-footer { display: none; }
  .intro-view {
    min-height: calc(100dvh - 64px);
    padding: 18px 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
  }
  .intro-copy { padding: 0; }
  .intro-copy h1 { font-size: 39px; }
  .intro-copy .eyebrow { margin-bottom: 12px; }
  .intro-lead { margin: 15px auto 18px; font-size: 14px; line-height: 1.65; }
  .intro-note { padding: 11px 13px; }
  .intro-note p { font-size: 12px; line-height: 1.55; }
  .intro-copy > .primary-button { margin-top: 18px; }
  .privacy-note { margin-top: 9px; font-size: 11px; }
  .brush-watermark { top: 28%; left: -8%; font-size: 310px; }
  .intro-art {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 54px;
    margin: 21px auto 0;
  }
  .intro-art .orbit,
  .intro-art .center-disc,
  .intro-art .art-star { display: none; }
  .intro-art .color-disc {
    position: static;
    flex: 0 0 47px;
    width: 47px;
    height: 47px;
    font-size: 14px;
    transform: none;
    box-shadow: inset 0 3px 10px rgba(255, 239, 213, .18), 0 8px 18px rgba(39, 22, 13, .14);
  }
  .question-panel h2 { font-size: 28px; }
  .result-heading h1 { font-size: 35px; }
}

@media (max-width: 360px) {
  .intro-copy h1 { font-size: 34px; }
  .intro-lead { font-size: 13px; }
  .brush-watermark { left: 0; font-size: 250px; }
}

@media (max-width: 640px) and (max-height: 650px) {
  .intro-view { padding: 10px 0 14px; }
  .intro-copy .eyebrow { margin-bottom: 7px; }
  .intro-copy h1 { font-size: 34px; }
  .intro-lead { margin: 9px auto 10px; line-height: 1.5; }
  .intro-note { padding: 8px 11px; }
  .intro-copy > .primary-button { margin-top: 12px; }
  .privacy-note { margin-top: 6px; }
  .intro-art { height: 40px; margin-top: 10px; }
  .intro-art .color-disc { flex-basis: 39px; width: 39px; height: 39px; font-size: 12px; }
}

/* Mobile quiz: keep the complete question flow inside one viewport. */
@media (max-width: 640px) {
  .quiz-view {
    height: calc(100vh - 64px);
    height: calc(100svh - 64px);
    height: calc(100dvh - 64px);
    min-height: 0;
    padding: 14px 0 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .quiz-topline { flex: 0 0 auto; }
  .progress-copy { margin-top: 10px; }
  .progress-track { height: 4px; margin-top: 7px; }

  .quiz-grid {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 0;
    padding-top: 12px;
  }

  .question-panel {
    flex: 0 0 auto;
    padding-top: 0;
  }

  .question-kicker {
    margin-bottom: 7px;
    font-size: 12px;
  }

  .question-panel h2 {
    max-height: 70px;
    overflow: hidden;
    font-size: 22px;
    line-height: 1.28;
  }

  .question-hint {
    margin: 6px 0 10px;
    font-size: 11px;
    line-height: 1.35;
  }

  .answer-panel {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }

  .options {
    gap: 7px;
    min-height: 0;
  }

  .option {
    min-height: 0;
    padding: 8px 10px;
    gap: 10px;
    border-radius: 12px;
    line-height: 1.35;
  }

  .option-copy {
    font-size: 12px;
    line-height: 1.35;
  }

  .option-letter {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    border-radius: 8px;
    font-size: 12px;
  }

  .option-check { font-size: 14px; }

  .quiz-actions {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 20;
    width: min(calc(100% - 36px), 700px);
    transform: translateX(-50%);
    flex: 0 0 auto;
    gap: 8px;
    margin: 0;
    padding: 16px 0 max(10px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(91, 61, 43, 0), rgba(91, 61, 43, .97) 32%);
  }

  .quiz-actions .secondary-button,
  .quiz-actions .next-button {
    min-height: 42px;
    padding: 0 14px;
  }

  .quiz-actions .next-button { min-width: 138px; }

  .form-message {
    position: fixed;
    left: 50%;
    bottom: 58px;
    z-index: 21;
    width: min(calc(100% - 36px), 700px);
    transform: translateX(-50%);
    min-height: 16px;
    margin: 5px 0 0;
    font-size: 11px;
    line-height: 1.35;
  }
}

/* Extra compact layout for narrow phones: keep option copy readable without overflow. */
@media (max-width: 360px) {
  .quiz-view { padding: 10px 0 12px; }
  .quiz-grid { padding-top: 8px; }
  .question-kicker { margin-bottom: 4px; font-size: 11px; }
  .question-panel h2 {
    max-height: 44px;
    font-size: 18px;
    line-height: 1.2;
  }
  .question-hint { display: none; }
  .options {
    flex: 0 0 auto;
    gap: 5px;
  }
  .option {
    padding: 6px 8px;
    gap: 8px;
    border-radius: 10px;
  }
  .option-copy {
    font-size: 10px;
    line-height: 1.2;
  }
  .option-letter {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    border-radius: 7px;
    font-size: 10px;
  }
  .option-check { font-size: 12px; }
  .quiz-actions {
    gap: 6px;
    padding-top: 13px;
  }
  .quiz-actions .secondary-button,
  .quiz-actions .next-button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }
  .quiz-actions .next-button { min-width: 124px; }
  .form-message {
    min-height: 12px;
    margin: 3px 0 0;
    font-size: 10px;
    line-height: 1.2;
  }
}
