:root {
  --paper: #f3eee4;
  --paper-deep: #e9e0d0;
  --ink: #17222c;
  --blue: #005f73;
  --blue-bright: #0a8899;
  --orange: #f05a28;
  --acid: #e6f044;
  --red: #c7352d;
  --line: rgba(23, 34, 44, .23);
  --shadow: 8px 10px 0 rgba(23, 34, 44, .12);
  --display: "STSong", "Songti SC", "Noto Serif SC", serif;
  --sans: "Avenir Next Condensed", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --hand: "Kaiti SC", "STKaiti", serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #d8d0c4; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255,255,255,.34) 1px, transparent 1px) 0 0 / 27px 27px,
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.app-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 60px rgba(23,34,44,.14);
}

.masthead {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 20px 12px;
  border-bottom: 1px solid var(--ink);
}

.wordmark { color: inherit; text-decoration: none; }
.wordmark span { display: block; color: var(--orange); font-size: 10px; font-weight: 900; letter-spacing: .2em; }
.wordmark strong { display: block; margin-top: 2px; font-family: var(--display); font-size: 15px; letter-spacing: .08em; }
.issue { text-align: right; font-size: 9px; font-weight: 800; line-height: 1.25; letter-spacing: .12em; }

.screen { position: relative; min-height: calc(100svh - 67px); }
.screen[hidden] { display: none !important; }
.screen.is-active { animation: page-in .58s cubic-bezier(.2,.8,.2,1) both; }
body[data-screen="quiz"] .masthead { display: none; }
body[data-screen="quiz"] .quiz-screen { min-height: 100svh; padding-top: calc(16px + env(safe-area-inset-top)); }

.home-screen {
  display: flex;
  flex-direction: column;
  padding: 28px 20px max(22px, env(safe-area-inset-bottom));
}

.hero-art {
  position: absolute;
  top: 24px;
  right: -42px;
  width: 57%;
  height: 47%;
  transform: rotate(3deg);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  background: #c9d2cb;
  overflow: visible;
}

.hero-art picture { display: block; width: 100%; height: 100%; }
.hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: saturate(.82) contrast(1.04); }
.hero-art::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 8px rgba(243,238,228,.38); pointer-events: none; }
.tape { position: absolute; z-index: 2; width: 68px; height: 20px; background: rgba(230,240,68,.72); border: 1px solid rgba(23,34,44,.25); }
.tape-a { left: -24px; top: 18px; transform: rotate(-18deg); }
.tape-b { right: -14px; bottom: 38px; transform: rotate(74deg); }
.stamp { position: absolute; z-index: 3; right: 12px; bottom: 11px; padding: 5px 7px; color: var(--red); border: 2px solid var(--red); font-size: 8px; font-weight: 900; line-height: 1.05; letter-spacing: .12em; transform: rotate(-7deg); background: rgba(243,238,228,.75); }
.ai-label { position: absolute; z-index: 3; left: 7px; bottom: 7px; padding: 3px 5px; color: rgba(23,34,44,.7); background: rgba(243,238,228,.72); font-size: 7px; font-weight: 800; letter-spacing: .08em; }

.home-copy { position: relative; z-index: 4; margin-top: min(32vh, 265px); }
.eyebrow { margin: 0 0 11px; color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .17em; }
.home-copy h1 { margin: 0; max-width: 450px; font-family: var(--display); font-size: clamp(43px, 13vw, 67px); font-weight: 900; line-height: .98; letter-spacing: -.055em; }
.home-copy h1 em { position: relative; color: var(--orange); font-style: normal; white-space: nowrap; }
.home-copy h1 em::after { content: ""; position: absolute; right: -4px; bottom: 2px; left: 2px; z-index: -1; height: 12px; transform: rotate(-1.5deg); background: var(--acid); }
.dek { margin: 22px 0 18px; font-family: var(--display); font-size: 17px; line-height: 1.7; }

.trip-meta { display: flex; gap: 8px; margin-bottom: 16px; }
.trip-meta span { display: flex; align-items: baseline; gap: 3px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.3); font-size: 10px; font-weight: 700; }
.trip-meta b { font-size: 14px; color: var(--blue); }

.primary-cta {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--blue);
  box-shadow: 5px 6px 0 var(--ink);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .04em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primary-cta b { font-size: 25px; line-height: 1; }
.primary-cta:active { transform: translate(4px, 5px); box-shadow: 1px 1px 0 var(--ink); }
.primary-cta:hover { background: var(--blue-bright); }
.resume-btn, .text-btn, .restart-btn { display: block; margin: 17px auto 0; padding: 4px 2px; border: 0; border-bottom: 1px solid currentColor; background: none; cursor: pointer; font-size: 12px; font-weight: 700; }
.privacy-note { margin: 17px 0 0; text-align: center; color: rgba(23,34,44,.68); font-size: 10px; }
.privacy-note span { color: #4f8e62; }
.unofficial-note { margin: 7px auto 0; max-width: 330px; text-align: center; color: rgba(23,34,44,.45); font-size: 8px; line-height: 1.45; }
.scribble { position: absolute; z-index: 5; font-family: var(--hand); color: var(--red); font-size: 12px; line-height: 1.35; transform: rotate(-7deg); }
.scribble-home { left: 22px; top: 27%; }

.quiz-screen { padding: 18px 20px 30px; }
.quiz-toolbar { display: grid; grid-template-columns: 36px 1fr 36px; gap: 12px; align-items: center; }
.icon-btn { width: 36px; height: 36px; padding: 0; border: 1px solid var(--ink); border-radius: 50%; background: transparent; cursor: pointer; font-size: 21px; line-height: 1; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.progress-track { height: 7px; border: 1px solid var(--ink); background: var(--paper-deep); overflow: hidden; }
.progress-track span { display: block; width: 7.14%; height: 100%; background: var(--orange); transition: width .38s cubic-bezier(.2,.8,.2,1); }

.question-sheet {
  position: relative;
  margin-top: clamp(26px, 7vh, 62px);
  padding: 15px 16px 18px;
  border: 1px solid var(--ink);
  background: rgba(255,255,255,.34);
  box-shadow: var(--shadow);
}
.question-sheet::before { content: ""; position: absolute; top: -12px; left: 26%; width: 104px; height: 23px; transform: rotate(-3deg); background: rgba(230,240,68,.68); border: 1px solid rgba(23,34,44,.18); }
.question-topline { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px dashed var(--line); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.question-topline span:first-child { color: var(--orange); }
.question-kicker { margin: 24px 0 8px; color: var(--blue); font-family: var(--hand); font-size: 13px; font-weight: 700; transform: rotate(-1deg); transform-origin: left; }
.question-sheet h2 { min-height: 3.1em; margin: 0 0 23px; font-family: var(--display); font-size: clamp(25px, 7vw, 34px); line-height: 1.35; letter-spacing: -.025em; }
.answers { display: grid; gap: 10px; }
.answer-btn { position: relative; width: 100%; min-height: 60px; padding: 12px 13px 12px 50px; text-align: left; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); cursor: pointer; font-size: 14px; line-height: 1.45; transition: background .16s ease, transform .16s ease, color .16s ease; }
.answer-btn::before { content: attr(data-key); position: absolute; top: 50%; left: 12px; display: grid; width: 25px; height: 25px; place-items: center; transform: translateY(-50%); border: 1px solid var(--ink); border-radius: 50%; font-size: 10px; font-weight: 900; }
.answer-btn:hover, .answer-btn:focus-visible { transform: translateX(4px); background: var(--acid); }
.answer-btn.is-picked { color: #fff; background: var(--blue); }
.answer-btn.is-picked::before { border-color: #fff; }
.keyboard-tip { margin: 16px 0 0; text-align: center; color: rgba(23,34,44,.55); font-size: 9px; }
kbd { padding: 1px 4px; border: 1px solid currentColor; border-radius: 2px; font: inherit; }
.baggage-tag { position: absolute; right: -9px; bottom: 8px; padding: 8px 18px 8px 8px; transform: rotate(-90deg); transform-origin: right bottom; color: rgba(23,34,44,.48); border: 1px dashed currentColor; font-size: 8px; line-height: 1.2; letter-spacing: .1em; }

.result-screen { padding: 22px 20px max(38px, env(safe-area-inset-bottom)); }
.result-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.result-heading .eyebrow { margin: 0; max-width: 220px; }
.claim-status { display: flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 800; }
.claim-status i { width: 7px; height: 7px; border-radius: 50%; background: #559367; box-shadow: 0 0 0 3px rgba(85,147,103,.18); }

.result-ticket { position: relative; padding: 18px 18px 20px; overflow: hidden; border: 1px solid var(--ink); background: rgba(255,255,255,.36); box-shadow: var(--shadow); }
.result-ticket::before { content: ""; position: absolute; top: -58px; right: -48px; width: 156px; height: 156px; border: 30px solid var(--result-accent, var(--orange)); border-radius: 50%; opacity: .16; }
.result-index { display: flex; align-items: flex-start; justify-content: space-between; height: 68px; border-bottom: 1px dashed var(--line); }
.result-index span { padding-top: 5px; color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.result-index strong { position: relative; z-index: 1; color: var(--result-accent, var(--orange)); font-family: var(--display); font-size: 64px; line-height: .8; }
.result-identity { display: grid; grid-template-columns: minmax(0, 1fr) 126px; gap: 9px; align-items: start; }
.result-prefix { margin: 22px 0 4px; font-family: var(--hand); font-size: 13px; }
.result-ticket h1 { margin: 0; color: var(--result-accent, var(--orange)); font-family: var(--display); font-size: clamp(40px, 11vw, 55px); line-height: 1.08; letter-spacing: -.045em; }
.result-archetype { display: inline-block; margin: 7px 0 0; padding: 3px 7px; color: var(--paper); background: var(--ink); font-size: 9px; font-weight: 900; letter-spacing: .08em; transform: rotate(-1deg); }
.result-one-liner { margin: 11px 0 14px; font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.55; }
.result-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 21px; }
.result-tags span { padding: 5px 8px; color: var(--ink); border: 1px solid var(--ink); border-radius: 999px; background: var(--acid); font-size: 10px; font-weight: 800; }
.result-secondary { margin: -9px 0 18px; padding: 9px 10px; color: var(--blue); border-left: 3px solid var(--result-accent, var(--orange)); background: rgba(255,255,255,.32); font-family: var(--display); font-size: 11px; font-weight: 750; line-height: 1.65; }
.archetype-portrait { position: relative; align-self: stretch; min-height: 350px; margin: -3px -7px 12px 0; overflow: hidden; border-left: 1px dashed var(--line); }
.archetype-portrait canvas { display: block; position: absolute; right: -2px; bottom: 0; width: 126px; height: auto; filter: saturate(.92) contrast(1.03); }
.archetype-portrait figcaption { position: absolute; z-index: 2; top: 16px; right: 2px; padding: 4px 5px; color: var(--result-accent, var(--orange)); border: 1px solid currentColor; background: rgba(243,238,228,.82); font-size: 7px; font-weight: 900; line-height: 1.08; letter-spacing: .12em; transform: rotate(4deg); }
.result-manifest { display: grid; gap: 11px; }
.result-manifest > div { padding: 12px; border-top: 1px solid var(--ink); background: rgba(255,255,255,.25); }
.result-manifest .contrast-box { border: 1px dashed var(--result-accent, var(--orange)); background: color-mix(in srgb, var(--result-accent, var(--orange)) 8%, transparent); }
.manifest-label { display: block; margin-bottom: 5px; color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.result-manifest p { margin: 0; font-size: 13px; line-height: 1.7; }
.result-quote { margin: 18px 4px 10px; color: var(--red); font-family: var(--hand); font-size: 14px; font-weight: 700; line-height: 1.5; transform: rotate(-1deg); }
.barcode { display: flex; align-items: flex-end; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--ink); }
.barcode span { display: block; width: 55%; height: 27px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px); }
.barcode small { font-size: 8px; font-weight: 900; letter-spacing: .09em; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.result-actions .primary-cta { grid-column: 1 / -1; }
.secondary-btn { min-height: 42px; border: 1px solid var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; font-size: 12px; font-weight: 800; }
.result-actions .text-btn { margin: 0; align-self: center; justify-self: center; }
.restart-btn { margin-top: 25px; }
.result-disclaimer { margin: 24px auto 0; max-width: 410px; text-align: center; color: rgba(23,34,44,.5); font-size: 9px; line-height: 1.65; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); max-width: calc(100% - 40px); padding: 10px 15px; transform: translate(-50%, 20px); color: #fff; border: 1px solid var(--ink); background: var(--ink); box-shadow: 3px 3px 0 var(--orange); opacity: 0; pointer-events: none; font-size: 12px; transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

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

@keyframes question-in {
  from { opacity: 0; transform: translateX(18px) rotate(.3deg); }
  to { opacity: 1; transform: translateX(0) rotate(0); }
}

.question-sheet.is-changing { animation: question-in .34s cubic-bezier(.2,.8,.2,1) both; }

@media (min-width: 700px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100vh - 48px); min-height: calc(100svh - 48px); border: 1px solid rgba(23,34,44,.15); }
  .screen { min-height: calc(100svh - 116px); }
}

@media (max-height: 700px) {
  .hero-art { height: 42%; }
  .home-copy { margin-top: min(27vh, 190px); }
  .home-copy h1 { font-size: 42px; }
  .dek { margin: 14px 0; font-size: 15px; }
  .question-sheet { margin-top: 20px; }
  .question-sheet h2 { min-height: 0; margin-bottom: 15px; font-size: 25px; }
  .answer-btn { min-height: 51px; padding-top: 9px; padding-bottom: 9px; }
}

@media (max-width: 370px) {
  .result-identity { grid-template-columns: minmax(0, 1fr) 94px; }
  .archetype-portrait { min-height: 295px; }
  .archetype-portrait canvas { width: 102px; }
  .result-ticket h1 { font-size: 35px; }
  .result-one-liner { font-size: 16px; }
}

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