:root {
  --ink: #20201d;
  --paper: #f5f1e8;
  --red: #ff5b45;
  --yellow: #f5c843;
  --mint: #9ad9c2;
  --blue: #8ab8e8;
  --line: rgba(32, 32, 29, .2);
  --shadow: 7px 7px 0 var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "SUIT", "Pretendard", sans-serif;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: .19;
  pointer-events: none;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

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

.site-header {
  width: min(1120px, calc(100% - 40px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--red);
  border: 1.5px solid var(--ink);
  border-radius: 50% 45% 48% 42%;
  transform: rotate(-8deg);
}

.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a, footer a { color: inherit; text-decoration: none; font-size: 13px; font-weight: 700; }
.site-nav a:hover, footer a:hover { text-decoration: underline; text-underline-offset: 4px; }

.shell {
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100vh - 158px);
  margin: 0 auto;
}

.screen { display: none; }
.screen.active { display: block; animation: appear .45s ease both; }

@keyframes appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#intro {
  position: relative;
  padding: 76px 0 90px;
  grid-template-columns: 1.16fr .84fr;
  align-items: center;
  gap: 80px;
}

#intro.active { display: grid; }
.eyebrow { margin: 0 0 18px; font-size: 12px; font-weight: 800; letter-spacing: .18em; }

h1 {
  margin: 0;
  font-size: clamp(52px, 6.2vw, 88px);
  line-height: .98;
  letter-spacing: -.07em;
}

h1 em {
  position: relative;
  z-index: 0;
  font-style: normal;
}

h1 em::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -2%; right: -6%; bottom: 5%;
  height: 28%;
  background: var(--yellow);
  transform: rotate(-1.5deg);
}

.lead { margin: 30px 0 0; line-height: 1.75; font-size: 17px; color: #575750; }

.mbti-card {
  position: relative;
  padding: 35px;
  background: #fffdf7;
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow);
}

.card-number {
  position: absolute;
  right: 26px;
  top: 22px;
  color: var(--red);
  font-weight: 800;
  font-size: 34px;
}

.card-label { margin: 0 0 7px; font-weight: 800; font-size: 19px; }
.card-help { margin: 0; font-size: 13px; color: #77766f; }

.select-wrap { position: relative; margin: 28px 0 16px; }
.select-wrap select {
  width: 100%;
  padding: 17px 50px 17px 17px;
  appearance: none;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  font-weight: 700;
  cursor: pointer;
}
.select-wrap span { position: absolute; right: 18px; top: 17px; pointer-events: none; }

.primary-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border: 1.5px solid var(--ink);
  background: var(--red);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.primary-btn:not(:disabled):hover { transform: translate(-3px, -3px); box-shadow: 4px 4px 0 var(--ink); }
.primary-btn:disabled { background: #c9c6bd; cursor: not-allowed; }

.floating-note {
  position: absolute;
  padding: 13px 16px;
  font: 14px/1.35 "Gowun Dodum", sans-serif;
  text-align: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}
.note-two { right: -30px; bottom: 50px; background: var(--yellow); transform: rotate(8deg); }

.content-guide { grid-column: 1 / -1; display: grid; grid-template-columns: .75fr 1.25fr; gap: 40px 70px; margin-top: 40px; padding-top: 72px; border-top: 1px solid var(--ink); scroll-margin-top: 25px; }
.guide-heading h2 { margin: 0; font-size: clamp(34px, 4.5vw, 58px); line-height: 1.05; letter-spacing: -.055em; }
.guide-copy { font-size: 16px; line-height: 1.85; color: #55534c; }
.guide-copy p:first-child { margin-top: 0; }
.value-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--ink); }
.value-grid article { min-height: 210px; padding: 27px; background: #fffdf7; border-right: 1px solid var(--ink); }
.value-grid article:last-child { border-right: 0; }
.value-grid span { color: var(--red); font-weight: 800; }
.value-grid h3 { margin: 30px 0 10px; font-size: 20px; }
.value-grid p { margin: 0; color: #66645d; font-size: 14px; line-height: 1.7; }
.faq { grid-column: 1 / -1; max-width: 820px; margin: 30px auto 0; width: 100%; scroll-margin-top: 25px; }
.faq h2 { margin: 0 0 22px; text-align: center; font-size: 30px; letter-spacing: -.04em; }
.faq details { border-top: 1px solid var(--ink); }
.faq details:last-child { border-bottom: 1px solid var(--ink); }
.faq summary { padding: 19px 4px; cursor: pointer; font-weight: 800; }
.faq details p { margin: -5px 4px 20px; color: #5c5a53; line-height: 1.7; }

.ad-placement { grid-column: 1 / -1; display: none; width: 100%; min-height: 100px; margin: 22px 0; overflow: hidden; text-align: center; }
.ad-placement.ready { display: block; }
.ad-label { margin: 0 0 8px; color: #8b887f; font-size: 10px; letter-spacing: .1em; }

#quiz { padding: 48px 0 80px; }
.quiz-top { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 18px; margin-bottom: 36px; }
.icon-btn { width: 44px; height: 44px; border: 1.5px solid var(--ink); background: transparent; cursor: pointer; }
.progress-track { height: 8px; background: #dcd7cc; overflow: hidden; }
#progress-bar { height: 100%; width: 33%; background: var(--red); transition: width .35s ease; }
#progress-text { font-size: 13px; font-weight: 800; }

.question-card {
  min-height: 570px;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  background: #fffdf7;
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow);
}

.situation-visual {
  display: grid;
  place-items: center;
  font-size: clamp(90px, 14vw, 160px);
  background: var(--yellow);
  border-right: 1.5px solid var(--ink);
  transition: background .3s;
}
.question-content { padding: clamp(35px, 6vw, 70px); }
.question-content h2 { margin: 0; font-size: clamp(28px, 3.5vw, 45px); line-height: 1.25; letter-spacing: -.045em; }
.question-desc { margin: 16px 0 30px; color: #66645d; line-height: 1.65; }
.choices { display: grid; gap: 10px; }
.choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: .18s ease;
}
.choice:hover { border-color: var(--ink); background: var(--paper); transform: translateX(5px); }
.choice-letter { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font-size: 12px; font-weight: 800; }

#result { padding: 58px 0 90px; }
.result-heading { text-align: center; max-width: 760px; margin: 0 auto 42px; }
.mbti-chip { display: inline-block; margin: 0 0 16px; padding: 7px 13px; background: var(--yellow); border: 1px solid var(--ink); font-size: 13px; font-weight: 800; transform: rotate(-2deg); }
.result-heading h2 { margin: 0; font-size: clamp(38px, 5.5vw, 66px); letter-spacing: -.06em; }
.result-subtitle { font: 18px "Gowun Dodum", sans-serif; color: #5d5b54; }
.result-grid { display: grid; grid-template-columns: 1fr; border: 1.5px solid var(--ink); box-shadow: var(--shadow); }
.result-main { padding: 45px; background: #fffdf7; }
.result-main > p { font-size: 17px; line-height: 1.85; }
.character-stage { width: 100%; min-height: 280px; display: grid; place-items: center; margin-bottom: 26px; overflow: hidden; background: var(--mint); border: 1.5px solid var(--ink); }
.character-stage img { display: block; width: min(100%, 390px); max-height: 360px; object-fit: contain; mix-blend-mode: multiply; }
.keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.keyword { padding: 8px 12px; border: 1px solid var(--ink); font-size: 13px; font-weight: 700; }
.result-actions { max-width: 420px; margin: 36px auto 0; text-align: center; }
.text-btn { margin-top: 19px; padding: 5px; background: none; border: 0; border-bottom: 1px solid var(--ink); cursor: pointer; font-weight: 700; }

.ai-report { margin-top: 42px; padding: clamp(26px, 5vw, 48px); background: #fffdf7; border: 1.5px solid var(--ink); box-shadow: var(--shadow); }
.ai-report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.ai-report-head .eyebrow { margin-bottom: 9px; }
.ai-report-head h3 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
.ai-badge { flex: 0 0 auto; padding: 7px 11px; color: white; background: var(--red); border: 1px solid var(--ink); font-size: 12px; font-weight: 800; transform: rotate(2deg); }
.ai-report-content { padding-top: 27px; }
.report-loading { min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; color: #6b6961; }
.loading-dot { width: 22px; height: 22px; border: 3px solid #ddd6c9; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.report-intro { margin: 0 0 28px; font: 19px/1.75 "Gowun Dodum", sans-serif; }
.report-sections { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.report-block { padding: 22px; background: var(--paper); border: 1px solid var(--line); }
.report-block h4 { margin: 0 0 10px; font-size: 16px; }
.report-block p { margin: 0; color: #55534d; font-size: 14px; line-height: 1.75; }
.report-block.full { grid-column: 1 / -1; background: #e8f3ed; }
.report-disclaimer { margin: 24px 0 0; padding-top: 17px; border-top: 1px solid var(--line); color: #817e75; font-size: 12px; line-height: 1.6; }
.report-error { padding: 20px; background: #fff0ed; border: 1px solid var(--red); line-height: 1.6; }
.retry-btn { margin-top: 13px; padding: 10px 14px; background: transparent; border: 1px solid var(--ink); cursor: pointer; font-weight: 700; }

footer { padding: 25px; display: flex; align-items: center; justify-content: center; gap: 28px; text-align: center; border-top: 1px solid var(--line); color: #77746b; font-size: 12px; }
footer p { margin: 0; }
footer nav { display: flex; gap: 15px; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 30px); padding: 13px 20px; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.legal-page { width: min(780px, calc(100% - 40px)); min-height: calc(100vh - 160px); margin: 0 auto; padding: 70px 0 90px; }
.legal-page h1 { font-size: clamp(42px, 7vw, 72px); }
.legal-date { margin: 20px 0 50px; color: #77746b; }
.legal-page section { padding: 25px 0; border-top: 1px solid var(--line); }
.legal-page section h2 { margin: 0 0 12px; font-size: 20px; }
.legal-page section p { margin: 0; color: #55534c; line-height: 1.85; }
.legal-page a { color: inherit; text-underline-offset: 3px; }
.legal-note { padding: 18px; background: #fff0d0; border: 1px solid var(--ink); font-size: 13px; line-height: 1.65; }
.back-home { display: inline-block; margin-top: 35px; font-weight: 800; }

@media (max-width: 780px) {
  .site-header, .shell { width: min(100% - 28px, 1120px); }
  .site-header { height: 70px; }
  .site-nav a:not(:last-child) { display: none; }
  .site-nav { gap: 0; }
  #intro { padding: 55px 0 70px; grid-template-columns: 1fr; gap: 46px; }
  h1 { font-size: clamp(48px, 14vw, 70px); }
  .floating-note { display: none; }
  .content-guide { grid-template-columns: 1fr; gap: 28px; margin-top: 15px; padding-top: 50px; }
  .value-grid { grid-template-columns: 1fr; }
  .value-grid article { min-height: auto; border-right: 0; border-bottom: 1px solid var(--ink); }
  .value-grid article:last-child { border-bottom: 0; }
  .mbti-card { padding: 27px 22px; box-shadow: 5px 5px 0 var(--ink); }
  .question-card { grid-template-columns: 1fr; box-shadow: 5px 5px 0 var(--ink); }
  .situation-visual { min-height: 190px; border-right: 0; border-bottom: 1.5px solid var(--ink); font-size: 95px; }
  .question-content { padding: 30px 22px 35px; }
  .choice { padding: 14px 13px; }
  .result-grid { grid-template-columns: 1fr; box-shadow: 5px 5px 0 var(--ink); }
  .result-main { padding: 30px 24px; }
  .report-sections { grid-template-columns: 1fr; }
  .report-block.full { grid-column: auto; }
  footer { flex-direction: column; gap: 10px; }
}

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