:root {
  --ink: #121212;
  --muted: #656565;
  --line: #dfdfdf;
  --soft: #f6f6f6;
  --red: #ed1c24;
  --red-dark: #c81018;
  --white: #fff;
  color-scheme: light;
  font-family: Pretendard, "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
}

button, summary { font: inherit; }
button { color: inherit; }

.site-header {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 22px clamp(20px, 5vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -.04em;
  text-decoration: none;
}

.brand span { color: var(--red); margin-left: 4px; }
.header-label { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }

.app-shell { width: min(100%, 760px); margin: 0 auto; outline: none; }
.screen { width: min(calc(100% - 28px), 520px); margin: 0 auto; padding: 28px 20px 34px; text-align: center; }
.eyebrow { display: inline-flex; margin: 0 0 15px; padding: 6px 12px; border: 1px solid var(--red); border-radius: 999px; color: var(--red); font-size: .82rem; font-weight: 800; }
h1 { margin: 0; font-size: clamp(2.3rem, 11vw, 3.65rem); line-height: 1.04; letter-spacing: -.065em; }
h1 em { color: var(--red); font-style: normal; }
.title-line { display: block; word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }
h1, h2, .lead, .result-tagline { word-break: keep-all; text-wrap: balance; }
.lead { margin: 18px 0 6px; color: #3d3d3d; font-size: 1.03rem; font-weight: 650; }
.portrait-window { overflow: hidden; width: min(100%, 350px); height: 280px; margin: 18px auto 22px; position: relative; }
.cover-illustration, .result-illustration { display: block; width: 100%; height: auto; position: absolute; top: -12px; left: 0; }
.result-window { width: min(100%, 360px); height: 290px; }

.primary-button, .secondary-button, .answer-button, .back-button {
  border: 0;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.primary-button, .secondary-button {
  min-height: 58px;
  border-radius: 16px;
  font-weight: 850;
}

.primary-button { width: 100%; background: var(--red); color: var(--white); box-shadow: 0 8px 24px rgb(237 28 36 / .2); }
.primary-button:hover { background: var(--red-dark); transform: translateY(-1px); }
.secondary-button { width: 100%; border: 1.5px solid var(--ink); background: var(--white); }
.meta { margin: 12px 0 0; color: var(--muted); font-size: .84rem; }

.intro-copy { width: min(calc(100% - 40px), 640px); margin: 8px auto 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.intro-copy h2 { margin: 0 0 10px; font-size: 1.35rem; letter-spacing: -.035em; }
.intro-copy > p { color: #444; }
.intro-copy details { padding: 16px 0; border-bottom: 1px solid var(--line); }
.intro-copy summary { cursor: pointer; font-weight: 780; }
.intro-copy details p { color: var(--muted); }

.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; letter-spacing: .06em; }
.progress-copy span { color: var(--red); font-weight: 900; }
.progress-track { height: 6px; margin: 10px 0 62px; overflow: hidden; border-radius: 99px; background: #ececec; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--red); transition: width .25s ease; }
.question-screen h1 { min-height: 170px; font-size: clamp(1.5rem, 6.1vw, 2.15rem); line-height: 1.4; display: flex; flex-direction: column; justify-content: center; }
.answer-list { display: grid; gap: 12px; margin-top: 28px; }
.answer-button { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; min-height: 82px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--white); text-align: left; font-weight: 720; }
.answer-button:hover { border-color: var(--red); box-shadow: 0 8px 20px rgb(0 0 0 / .06); transform: translateY(-1px); }
.answer-index { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--soft); color: var(--red); font-size: .8rem; font-weight: 900; }
.back-button { margin-top: 24px; padding: 10px; background: transparent; color: var(--muted); font-size: .9rem; }
.back-button:disabled { cursor: default; opacity: .28; }

.result-screen h1 { font-size: clamp(1.55rem, 6.4vw, 2.3rem); line-height: 1.35; }
.result-screen h1 .title-line:first-child { font-size: .72em; margin-bottom: 8px; color: #444; }
.question-screen h1 .title-line:first-child,
.result-screen h1 .title-line:last-child { color: var(--red); }
.result-tagline { margin: 16px auto 4px; max-width: 430px; color: #444; font-weight: 650; }
.trait-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; padding: 0; list-style: none; }
.trait-list li { padding: 7px 10px; border-radius: 999px; background: #fff1f1; color: var(--red-dark); font-size: .78rem; font-weight: 800; }
.result-summary { margin: 24px 0; font-size: 1.02rem; font-weight: 620; }
.result-grid { display: grid; gap: 10px; text-align: left; }
.result-grid article { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.result-grid article > span { display: grid; float: left; width: 30px; height: 30px; margin-right: 10px; place-items: center; border-radius: 50%; background: var(--red); color: var(--white); font-weight: 900; }
.result-grid h2 { margin: 2px 0 10px; font-size: 1rem; }
.result-grid p { clear: both; margin: 0; color: #4c4c4c; font-size: .91rem; }
.tip { margin: 14px 0 22px; padding: 18px; border-left: 4px solid var(--red); background: var(--soft); text-align: left; }
.tip p { margin: 5px 0 0; color: #444; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-status { min-height: 24px; color: var(--red-dark); font-size: .84rem; font-weight: 700; }
.share-dialog { width: min(90vw, 400px); border: 0; border-radius: 22px; padding: 26px; text-align: center; color: var(--ink); }
.share-dialog::backdrop { background: rgb(0 0 0 / .45); }
.share-dialog h2 { margin: 0 0 22px; }
.share-dialog p { font-size: .9rem; word-break: keep-all; }
.dialog-status { color: var(--red-dark); }
.share-url { width: 100%; padding: 12px; }

.site-footer { width: min(calc(100% - 40px), 640px); margin: 20px auto 0; padding: 30px 0 46px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .78rem; }
.site-footer a { color: var(--ink); font-weight: 700; }

button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #ff9ca0; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 700px) {
  body { background: linear-gradient(90deg, #fafafa 0, #fafafa calc(50% - 340px), #fff calc(50% - 340px), #fff calc(50% + 340px), #fafafa calc(50% + 340px)); }
  .screen { padding-top: 20px; }
  .cover-window { height: 250px; }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  .result-grid article { padding: 16px; }
}

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