:root {
  color-scheme: dark;
  --bg: #090b0e;
  --surface-1: #10141a;
  --surface-2: #161c23;
  --line: #2a323d;
  --text: #f2f4f7;
  --muted: #9099a6;
  --faint: #626c78;
  --signal-cyan: #55d6e8;
  --signal-violet: #9c7cff;
  --signal-magenta: #e05bd8;
  --warning: #f0b35e;
  --danger: #e46e76;
  --content: 520px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 4%, rgba(156, 124, 255, 0.08), transparent 30rem),
    linear-gradient(rgba(42, 50, 61, 0.06) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 100% 72px, auto;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--signal-cyan);
  outline-offset: 3px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: min(100%, calc(var(--content) + 40px));
  margin: 0 auto;
  padding: 0 20px env(safe-area-inset-bottom);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid rgba(42, 50, 61, 0.55);
}

.brand-button,
.text-button,
.danger-text-button,
.icon-button {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
}

.brand-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.brand-mark {
  position: relative;
  display: block;
  width: 24px;
  height: 14px;
  border-top: 1px solid var(--signal-cyan);
  border-bottom: 1px solid var(--signal-violet);
  transform: skewY(-16deg);
}

.brand-mark::after {
  position: absolute;
  top: 5px;
  left: 6px;
  width: 13px;
  border-top: 1px solid var(--signal-magenta);
  content: "";
  transform: skewY(28deg);
}

.prototype-badge {
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

main {
  flex: 1;
  width: 100%;
}

.screen {
  width: 100%;
  padding: 58px 0 52px;
  animation: screen-in 280ms ease both;
}

.eyebrow,
.section-kicker {
  color: var(--signal-cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(36px, 10vw, 52px);
  font-weight: 580;
  letter-spacing: -0.05em;
  line-height: 1.16;
}

h2 {
  margin-bottom: 14px;
  font-size: 25px;
  font-weight: 580;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.start-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 140px);
  padding-top: 42px;
}

.start-screen h1 {
  margin-top: 22px;
  font-size: clamp(48px, 14vw, 72px);
}

.lead {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 19px;
  letter-spacing: 0.03em;
}

.hero-signal {
  width: 100%;
  min-height: 160px;
  margin: 18px 0 20px;
  overflow: hidden;
}

.hero-signal canvas,
.quiz-signal canvas,
.result-signal canvas {
  display: block;
  max-width: 100%;
}

.button-stack {
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 20px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 650;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
  border: 1px solid rgba(85, 214, 232, 0.4);
  background: linear-gradient(110deg, rgba(85, 214, 232, 0.96), rgba(156, 124, 255, 0.9));
  box-shadow: 0 14px 44px rgba(85, 214, 232, 0.12);
  color: #071014;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(16, 20, 26, 0.92);
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button:hover {
  border-color: var(--faint);
}

.text-button,
.danger-text-button {
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.text-button:hover {
  color: var(--text);
  text-decoration-color: var(--faint);
}

.danger-text-button {
  color: var(--danger);
}

.text-button.wide,
.danger-text-button {
  width: 100%;
  min-height: 46px;
}

.notice {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(240, 179, 94, 0.25);
  border-radius: 12px;
  background: rgba(240, 179, 94, 0.07);
  color: #e8c796;
  font-size: 13px;
}

.boundary-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
}

.boundary-note p {
  margin: -2px 0 0;
}

.boundary-note span:not(.boundary-icon) {
  color: var(--faint);
}

.boundary-icon {
  display: inline-grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--signal-cyan);
  font-size: 11px;
  font-style: normal;
}

.site-footer {
  display: flex;
  gap: 18px;
  justify-content: center;
  min-height: 68px;
  border-top: 1px solid rgba(42, 50, 61, 0.4);
}

.intro-screen h1,
.info-screen h1,
.share-screen h1 {
  margin-top: 20px;
}

.intro-list {
  display: grid;
  gap: 1px;
  margin: 38px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
}

.intro-actions {
  margin-top: 18px;
}

.intro-list article {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 20px;
  background: var(--surface-1);
}

.intro-list article > span {
  color: var(--signal-cyan);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.intro-list h2 {
  margin-bottom: 4px;
  font-size: 17px;
}

.intro-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.quiz-screen {
  min-height: calc(100vh - 140px);
  padding-top: 30px;
}

.quiz-topbar,
.quiz-footer,
.dimension-label,
.mask-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-topbar > div {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.quiz-topbar strong {
  font-size: 14px;
  letter-spacing: 0.06em;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 23px;
  line-height: 1;
}

.progress-track,
.dimension-track {
  position: relative;
  overflow: hidden;
  background: var(--line);
}

.progress-track {
  height: 2px;
  margin-top: 18px;
}

.progress-track span,
.dimension-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--signal-cyan), var(--signal-violet), var(--signal-magenta));
  transition: width 300ms ease;
}

.quiz-signal {
  height: 70px;
  margin: 18px 0 14px;
  opacity: 0.72;
  overflow: hidden;
}

.question-context {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.question-title {
  min-height: 3.6em;
  margin-bottom: 28px;
  font-size: clamp(24px, 7vw, 31px);
  letter-spacing: -0.035em;
  line-height: 1.42;
}

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

.option-button {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16, 20, 26, 0.8);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  line-height: 1.45;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.option-button:focus {
  outline: none;
}

.option-button:focus-visible {
  outline: 2px solid var(--signal-cyan);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .option-button:hover:not(:disabled) {
    border-color: var(--faint);
    background: var(--surface-2);
    transform: translateX(2px);
  }

  .suppress-option-hover .option-button:hover:not(:disabled) {
    border-color: var(--line);
    background: rgba(16, 20, 26, 0.8);
    transform: none;
  }
}

.option-button.is-selected {
  border-color: var(--signal-cyan);
  background: rgba(85, 214, 232, 0.09);
}

.option-button.is-previous {
  border-color: rgba(156, 124, 255, 0.38);
}

.option-key {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--faint);
  font-size: 11px;
}

.quiz-footer {
  margin-top: 20px;
  color: var(--faint);
  font-size: 11px;
}

.quiz-footer button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.analyzing-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  text-align: center;
}

.scanner {
  position: relative;
  width: min(70vw, 310px);
  height: min(70vw, 310px);
  margin-bottom: 36px;
  overflow: hidden;
  border: 1px solid rgba(85, 214, 232, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(85, 214, 232, 0.08), transparent 66%);
}

.scanner::before,
.scanner::after {
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid rgba(156, 124, 255, 0.25);
  content: "";
}

.scanner::after {
  inset: 0 auto 0 50%;
  border-top: 0;
  border-left: 1px solid rgba(156, 124, 255, 0.25);
}

.scanner span {
  position: absolute;
  inset: 12%;
  border-top: 2px solid var(--signal-cyan);
  border-radius: 50%;
  filter: drop-shadow(0 0 12px var(--signal-cyan));
  animation: scan 1.2s linear infinite;
}

.analyzing-screen h1 {
  margin-bottom: 12px;
  font-size: 31px;
}

.analysis-copy {
  color: var(--muted);
  font-size: 13px;
}

.analysis-copy p {
  margin: 2px 0;
  animation: analysis-pulse 1.4s ease infinite alternate;
}

.analysis-copy p:nth-child(2) { animation-delay: 180ms; }
.analysis-copy p:nth-child(3) { animation-delay: 360ms; }

.result-screen {
  padding-top: 28px;
}

.result-hero {
  min-height: 620px;
  padding-top: 22px;
}

.score-line {
  display: flex;
  align-items: baseline;
  margin-top: 18px;
}

.score-line strong {
  font-size: clamp(86px, 27vw, 134px);
  font-weight: 680;
  letter-spacing: -0.075em;
  line-height: 1;
}

.score-line span {
  margin-left: 12px;
  color: var(--faint);
  font-size: 15px;
}

.result-hero h1 {
  margin: 12px 0;
  font-size: clamp(34px, 10vw, 48px);
}

.result-summary {
  max-width: 44ch;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 15px;
}

.result-signal {
  min-height: 150px;
  margin: 16px 0 8px;
  overflow: hidden;
}

.compact-boundary {
  margin: 0;
  padding: 12px 14px;
  border-left: 2px solid var(--signal-cyan);
  background: rgba(85, 214, 232, 0.045);
  color: var(--muted);
  font-size: 12px;
}

.result-section {
  margin-top: 18px;
  padding: 30px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(16, 20, 26, 0.72);
}

.result-section h2 {
  margin-top: 14px;
}

.result-section h2 span {
  color: var(--signal-cyan);
}

.section-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.secondary-signal {
  margin: -4px 0 16px;
  color: var(--signal-violet);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.radar-moment {
  background: linear-gradient(140deg, rgba(16, 20, 26, 0.8), rgba(85, 214, 232, 0.055));
}

.tension-card {
  background: linear-gradient(140deg, rgba(16, 20, 26, 0.8), rgba(156, 124, 255, 0.07));
}

.mask-section {
  background: linear-gradient(140deg, rgba(16, 20, 26, 0.8), rgba(224, 91, 216, 0.06));
}

.mask-heading {
  gap: 18px;
}

.mask-heading h2 {
  margin-bottom: 0;
}

.mask-heading > strong {
  color: var(--signal-violet);
  font-size: 64px;
  letter-spacing: -0.06em;
}

.fine-print {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 11px;
}

.dimension-list {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}

.dimension-row p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dimension-label {
  gap: 14px;
  margin-bottom: 8px;
  font-size: 13px;
}

.dimension-label strong {
  color: var(--signal-cyan);
  font-size: 16px;
}

.dimension-track {
  height: 5px;
  border-radius: 99px;
}

.stability-card {
  border-color: rgba(85, 214, 232, 0.18);
}

.result-actions {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.prototype-warning {
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid rgba(240, 179, 94, 0.24);
  border-radius: 14px;
  background: rgba(240, 179, 94, 0.045);
  color: #d7bd98;
  font-size: 12px;
}

.prototype-warning strong {
  color: var(--warning);
}

.prototype-warning p {
  margin: 4px 0 0;
}

.share-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 30px 0 20px;
}

.share-level {
  min-height: 80px;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-1);
  cursor: pointer;
  text-align: left;
}

.share-level strong,
.share-level span {
  display: block;
}

.share-level strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.share-level span {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.4;
}

.share-level.is-active {
  border-color: var(--signal-cyan);
  background: rgba(85, 214, 232, 0.08);
}

.share-preview-frame {
  display: grid;
  min-height: 360px;
  margin-bottom: 22px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-1);
}

.share-preview-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.lead-copy {
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 16px;
}

.info-card {
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-1);
}

.info-card h2 {
  font-size: 19px;
}

.info-card p,
.info-card li {
  color: var(--muted);
  font-size: 14px;
}

.info-card p {
  margin-bottom: 0;
}

.info-card ul {
  margin: 0;
  padding-left: 19px;
}

noscript {
  display: block;
  max-width: var(--content);
  margin: 40px auto;
  padding: 20px;
  color: var(--warning);
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scan {
  to { transform: rotate(360deg); }
}

@keyframes analysis-pulse {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

@media (max-width: 380px) {
  .app-shell { padding-right: 16px; padding-left: 16px; }
  .screen { padding-top: 42px; }
  .quiz-screen { padding-top: 24px; }
  .option-button { min-height: 56px; padding: 11px 13px; font-size: 14px; }
  .result-section { padding: 26px 20px; }
  .prototype-badge { display: none; }
}

@media (min-width: 760px) {
  .app-shell { width: min(100%, calc(var(--content) + 64px)); padding-right: 32px; padding-left: 32px; }
  .screen { padding-top: 72px; }
  .site-header { min-height: 80px; }
}

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

/* Mobile first-screen fit: keep the intro CTA and all five quiz choices visible on common phones. */
@supports (min-height: 100dvh) {
  body,
  .app-shell {
    min-height: 100dvh;
  }
}

@media (max-width: 600px) {
  body {
    line-height: 1.5;
    background-size: auto, 100% 56px, auto;
  }

  .app-shell {
    min-height: 100dvh;
    padding-right: 16px;
    padding-left: 16px;
  }

  .site-header {
    min-height: 52px;
  }

  .brand-button {
    padding: 7px 0;
    font-size: 12px;
  }

  .brand-mark {
    width: 21px;
  }

  .screen {
    padding: 20px 0 24px;
  }

  .start-screen {
    min-height: calc(100dvh - 52px);
    justify-content: center;
    padding-top: 14px;
    padding-bottom: 18px;
  }

  .start-screen h1 {
    margin: 12px 0 10px;
    font-size: clamp(38px, 12vw, 54px);
    line-height: 1.08;
  }

  .lead {
    margin-bottom: 2px;
    font-size: 15px;
    line-height: 1.5;
  }

  .hero-signal {
    min-height: 86px;
    height: 86px;
    margin: 8px 0 12px;
  }

  .primary-button,
  .secondary-button {
    min-height: 48px;
    padding: 9px 16px;
    border-radius: 12px;
    font-size: 15px;
  }

  .intro-screen {
    min-height: calc(100dvh - 52px);
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .intro-screen h1 {
    margin: 9px 0 0;
    font-size: 29px;
    line-height: 1.2;
  }

  .intro-list {
    gap: 1px;
    margin: 14px 0 10px;
    border-radius: 14px;
  }

  .intro-list article {
    grid-template-columns: 28px 1fr;
    gap: 8px;
    padding: 9px 12px;
  }

  .intro-list article > span {
    font-size: 10px;
  }

  .intro-list h2 {
    margin-bottom: 1px;
    font-size: 14px;
    line-height: 1.25;
  }

  .intro-list p {
    font-size: 11px;
    line-height: 1.4;
  }

  .compact-boundary {
    padding: 8px 10px;
    font-size: 10px;
    line-height: 1.45;
  }

  .intro-actions {
    margin-top: 10px;
  }

  .text-button.wide {
    min-height: 34px;
  }

  .quiz-screen {
    min-height: calc(100dvh - 52px);
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .quiz-topbar strong {
    font-size: 12px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .progress-track {
    margin-top: 9px;
  }

  .quiz-signal {
    height: 38px;
    margin: 7px 0 7px;
  }

  .question-title {
    min-height: 2.75em;
    margin-bottom: 11px;
    font-size: clamp(20px, 5.8vw, 25px);
    line-height: 1.32;
  }

  .options {
    gap: 6px;
  }

  .option-button {
    grid-template-columns: 24px 1fr;
    gap: 9px;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.35;
  }

  .option-key {
    width: 21px;
    height: 21px;
    border-radius: 6px;
    font-size: 10px;
  }

  .quiz-footer {
    min-height: 24px;
    margin-top: 7px;
    font-size: 10px;
  }

  .quiz-footer .text-button {
    padding: 3px 0;
    font-size: 11px;
  }
}

@media (max-width: 600px) and (max-height: 700px) {
  .prototype-badge,
  .quiz-footer > span {
    display: none;
  }

  .site-header {
    min-height: 48px;
  }

  .start-screen,
  .intro-screen,
  .quiz-screen {
    min-height: calc(100dvh - 48px);
  }

  .start-screen h1 {
    font-size: clamp(35px, 11vw, 48px);
  }

  .hero-signal {
    min-height: 70px;
    height: 70px;
  }

  .intro-screen h1 {
    font-size: 26px;
  }

  .intro-list {
    margin-top: 10px;
  }

  .intro-list article {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .quiz-screen {
    padding-top: 7px;
  }

  .quiz-signal {
    height: 32px;
    margin: 5px 0;
  }

  .question-title {
    min-height: 2.55em;
    margin-bottom: 8px;
    font-size: 19px;
  }

  .option-button {
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 12px;
  }

  .quiz-footer {
    margin-top: 4px;
  }
}
