:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #222;
  --muted: #737373;
  --faint: #a0a0a0;
  --line: #eee;
  --line-strong: #222;
  --fill: #fafafa;
  --sans: "Helvetica Neue", Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  --content: 640px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
}
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.brand {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
}

main { flex: 1; }
.screen { display: none; animation: fade-in .24s ease both; }
.screen.active { display: block; }

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .04em;
}

.intro-screen.active { display: grid; }
.intro-content {
  width: min(var(--content), calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0 80px;
}
h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.5;
}
.lead {
  margin: 24px 0 40px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.primary-button,
.secondary-button,
.line-button {
  cursor: pointer;
  transition: opacity .15s ease, background .15s ease, border-color .15s ease;
}
.primary-button:hover,
.secondary-button:hover,
.line-button:hover { opacity: .72; }

.primary-button {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.microcopy,
.line-note {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.7;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--content), calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.progress-track {
  width: min(var(--content), calc(100% - 48px));
  height: 1px;
  margin: 0 auto;
  background: var(--line);
}
.progress-bar {
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width .25s ease;
}
.question-content {
  width: min(var(--content), calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 72px;
}
#question-text {
  margin: 0;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.5;
}
.question-scene {
  margin: 12px 0 36px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.choices { display: grid; gap: 10px; }
.choice-button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.choice-button:hover,
.choice-button.selected {
  border-color: var(--ink);
  background: var(--fill);
}
.choice-index {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.choice-copy strong,
.choice-copy small { display: block; }
.choice-copy strong { font-size: 15px; font-weight: 700; line-height: 1.6; }
.choice-copy small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; font-weight: 400; }
.choice-arrow { color: var(--faint); font-size: 14px; }
.text-button {
  margin-top: 28px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}
.text-button:hover { color: var(--ink); }

.loading-screen { padding: 20vh 24px 80px; text-align: center; }
.loading-screen h2 { margin: 0 0 12px; font-size: 22px; font-weight: 700; }
.loading-screen p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.spinner {
  width: 20px;
  height: 20px;
  margin: 0 auto 24px;
  border: 1px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.result-screen { padding: 0 0 64px; }
.result-hero {
  width: min(var(--content), calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}
.result-symbol {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.result-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
#result-title {
  margin: 0;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.4;
}
.result-teaser {
  margin: 20px 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.9;
}

.line-panel {
  width: min(var(--content), calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
}
.line-panel h3 { margin: 0 0 12px; font-size: 20px; font-weight: 700; }
.line-panel > p:not(.eyebrow, .line-note) {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.line-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  padding: 12px 20px;
  border-radius: 4px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.line-button.disabled { pointer-events: none; opacity: .35; }
.line-logo {
  padding: 1px 5px;
  border: 1px solid #fff;
  border-radius: 2px;
  font-size: 10px;
  letter-spacing: .04em;
}
.desktop-line-flow {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  align-items: start;
}
.qr-frame {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
}
.qr-frame img {
  display: block;
  width: 160px;
  height: 160px;
}
.qr-heading {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}
.qr-copy ol {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.qr-copy a {
  color: var(--ink);
  font-size: 13px;
  text-underline-offset: 3px;
}

.developer-panel {
  width: min(var(--content), calc(100% - 48px));
  margin: 28px auto 0;
  color: var(--muted);
  font-size: 12px;
}
.developer-panel summary { cursor: pointer; }
.secondary-button {
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}
#preview-output {
  display: none;
  margin: 14px 0 0;
  padding: 16px;
  overflow: auto;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--fill);
  white-space: pre-wrap;
  text-align: left;
  font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.restart { display: block; margin: 28px auto 0; }

.site-footer {
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}
.site-footer p { margin: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 700px) {
  .site-header { padding: 0 20px; }
  .intro-content { padding: 56px 0 64px; }
  .quiz-header,
  .progress-track,
  .question-content,
  .result-hero,
  .line-panel,
  .developer-panel {
    width: min(var(--content), calc(100% - 40px));
  }
  .question-content { padding-top: 36px; }
  .choice-button { grid-template-columns: 22px 1fr auto; gap: 10px; padding: 16px 14px; }
  .desktop-line-flow { grid-template-columns: 1fr; }
}
