/* ============================================================
   «Белый кот старейшины Цунчжэ» — тест по персонажам
   Палитра: тушь/нефрит/киноварь. Шрифты: Yeseva One (заголовки),
   Marck Script (акценты-каллиграфия), PT Serif (текст).
   ============================================================ */

:root {
  --ink-950: #0c1210;
  --ink-900: #101a16;
  --ink-800: #16221d;
  --ink-700: #1e2f27;
  --jade-500: #6ea788;
  --jade-300: #9fc7ac;
  --jade-200: #c8e2d3;
  --cinnabar-600: #a3402c;
  --cinnabar-500: #c25438;
  --gold-500: #c9a35c;
  --gold-300: #e4c98a;
  --paper-100: #eee4cd;
  --paper-050: #f6efdc;
  --ink-text: #d9d2ba;
  --ink-text-dim: #a7a08c;

  --font-display: "Yeseva One", "Georgia", serif;
  --font-script: "Marck Script", cursive;
  --font-body: "PT Serif", Georgia, serif;

  --radius: 2px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-950);
  color: var(--ink-text);
  font-family: var(--font-body);
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 90% 60% at 15% 0%, rgba(110, 167, 136, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(163, 64, 44, 0.10), transparent 60%),
    linear-gradient(180deg, var(--ink-950), var(--ink-900) 40%, var(--ink-950));
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; }

/* -------- texture overlays -------- */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.vignette {
  position: fixed; inset: 0; z-index: 89; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* -------- layout scaffolding -------- */
#app { position: relative; min-height: 100vh; }

.screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(24px, 6vw, 72px) clamp(18px, 6vw, 40px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.5s ease;
}
.screen[data-state="active"] {
  position: relative;
  opacity: 1; visibility: visible; pointer-events: auto;
}

/* ============================================================
   INTRO
   ============================================================ */
.screen--intro { min-height: 100vh; }

.scroll-frame {
  max-width: 620px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.seal {
  width: 54px; height: 54px;
  margin: 0 auto 28px;
  border: 1.5px solid var(--cinnabar-500);
  color: var(--cinnabar-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  transform: rotate(-4deg);
  box-shadow: 0 0 0 1px rgba(163,64,44,0.15);
}

.kicker {
  font-family: var(--font-script);
  color: var(--jade-300);
  font-size: 22px;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
}

.title {
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.18;
  color: var(--paper-050);
  text-shadow: 0 0 40px rgba(110,167,136,0.15);
}
.title span {
  color: var(--jade-200);
  background: linear-gradient(90deg, var(--gold-300), var(--jade-200));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede {
  margin: 26px auto 0;
  max-width: 480px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-text-dim);
}
.lede em { color: var(--jade-300); font-style: italic; }

.meta {
  margin-top: 20px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-text-dim);
  opacity: 0.7;
}

.btn {
  font-family: var(--font-body);
  font-size: 16px;
  letter-spacing: 0.03em;
  border: none;
  cursor: pointer;
  padding: 15px 34px;
  border-radius: var(--radius);
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 34px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.2s ease;
}
.btn--gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  color: #1c1408;
  box-shadow: 0 8px 30px -8px rgba(201,163,92,0.55);
}
.btn--gold:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn--gold:active { transform: translateY(0); }
.btn--gold svg { transition: transform 0.25s ease; }
.btn--gold:hover svg { transform: translateX(3px); }

.brush {
  position: absolute; pointer-events: none; z-index: 1;
  opacity: 0.5; filter: blur(0.3px);
}
.brush--1 {
  top: 8%; left: -6%; width: 46vw; max-width: 420px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--jade-500), transparent);
  transform: rotate(-9deg);
}
.brush--2 {
  bottom: 10%; right: -8%; width: 40vw; max-width: 380px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cinnabar-500), transparent);
  transform: rotate(6deg);
}

/* ============================================================
   QUIZ
   ============================================================ */
.screen--quiz { align-items: flex-start; padding-top: clamp(40px, 8vh, 90px); }

.quiz-frame { width: 100%; max-width: 680px; margin: 0 auto; }

.quiz-head { margin-bottom: 34px; }

.progress-track {
  height: 3px; width: 100%;
  background: var(--ink-700);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.progress-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 12.5%;
  background: linear-gradient(90deg, var(--jade-500), var(--gold-500));
  transition: width 0.5s cubic-bezier(.65,0,.35,1);
}
.progress-label {
  margin: 10px 0 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-text-dim);
  font-variant-numeric: tabular-nums;
}

.question {
  animation: fadeSlide 0.5s ease both;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.question__eyebrow {
  font-family: var(--font-script);
  color: var(--cinnabar-500);
  font-size: 20px;
  margin: 0 0 10px;
}

.question__text {
  font-size: clamp(22px, 3.4vw, 30px);
  color: var(--paper-050);
  line-height: 1.35;
  margin-bottom: 30px;
}

.options { display: grid; gap: 12px; }

.option {
  text-align: left;
  background: rgba(238, 228, 205, 0.03);
  border: 1px solid rgba(238, 228, 205, 0.12);
  color: var(--ink-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding: 16px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.option::before {
  content: "";
  flex: 0 0 auto;
  width: 8px; height: 8px;
  margin-top: 7px;
  border: 1.5px solid var(--jade-500);
  border-radius: 50%;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.option:hover {
  border-color: var(--jade-500);
  background: rgba(110, 167, 136, 0.07);
  transform: translateX(3px);
}
.option:hover::before {
  background: var(--jade-500);
  box-shadow: 0 0 10px rgba(110,167,136,0.6);
}
.option:active { transform: translateX(1px) scale(0.995); }

/* ============================================================
   RESULT
   ============================================================ */
.screen--result { padding-top: clamp(30px, 6vh, 70px); padding-bottom: 60px; }

.result-frame { width: 100%; max-width: 720px; margin: 0 auto; }

.result-card {
  position: relative;
  animation: fadeSlide 0.6s ease both;
}

.result-eyebrow {
  font-family: var(--font-script);
  color: var(--jade-300);
  font-size: 22px;
  margin-bottom: 8px;
}

.result-name {
  font-size: clamp(30px, 5vw, 46px);
  color: var(--paper-050);
  line-height: 1.15;
}
.result-title {
  font-size: 16px;
  color: var(--gold-300);
  letter-spacing: 0.03em;
  margin-top: 10px;
  font-style: italic;
}

.sigil-wrap {
  width: 96px; height: 96px;
  margin: 22px 0 26px;
  border: 1px solid var(--gold-500);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(201,163,92,0.08), transparent 70%);
}
.sigil-wrap svg { width: 52px; height: 52px; }

.result-divider {
  width: 44px; height: 2px;
  background: var(--cinnabar-500);
  margin: 26px 0;
}

.result-quote {
  font-family: var(--font-script);
  font-size: 22px;
  color: var(--jade-200);
  margin: 0 0 22px;
  line-height: 1.5;
}

.result-desc {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink-text);
  margin: 0 0 16px;
}
.result-desc strong { color: var(--paper-050); font-weight: 700; }

.result-details {
  margin-top: 26px;
  display: grid;
  gap: 12px;
  padding: 20px 22px;
  border: 1px solid rgba(238,228,205,0.12);
  background: rgba(238,228,205,0.02);
  border-radius: var(--radius);
}
.result-details dt {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jade-300);
  margin: 0;
}
.result-details dd {
  font-size: 15px;
  color: var(--ink-text-dim);
  margin: 3px 0 0;
  line-height: 1.5;
}

.result-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--jade-500);
  color: var(--jade-200);
}
.btn--outline:hover {
  background: rgba(110,167,136,0.08);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-text-dim);
  border: 1px solid rgba(238,228,205,0.15);
  font-size: 14px;
  padding: 12px 22px;
}
.btn--ghost:hover { color: var(--ink-text); border-color: rgba(238,228,205,0.3); }

.share-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-text-dim);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.share-note.visible { opacity: 0.85; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .screen { padding-left: 18px; padding-right: 18px; }
  .result-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
