:root {
  --sumi: #0a0908;
  --surface: #12110f;
  --surface-2: #1b1916;
  --paper: #e4e0cf;
  --paper-strong: #f2efdf;
  --muted: #9b978c;
  --amber: #c1914a;
  --amber-bright: #e8c17d;
  --violet: #625e91;
  --line: rgba(228, 224, 207, 0.14);
  --line-strong: rgba(232, 193, 125, 0.42);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--sumi);
  scroll-behavior: smooth;
}

body {
  display: block;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background:
    radial-gradient(95vw 68vh at 0% 12%, rgba(98, 94, 145, .18), transparent 72%),
    radial-gradient(85vw 62vh at 100% 88%, rgba(193, 145, 74, .2), transparent 74%),
    var(--sumi);
  color: var(--paper);
  font-family: "Yu Gothic", "YuGothic", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

body::after {
  content: "";
  position: fixed;
  inset: auto -12vw -28vh;
  height: 70vh;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(193, 145, 74, .26), transparent 70%);
  filter: blur(28px);
}

button,
a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--sumi);
  background: var(--paper-strong);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.ambient {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  top: -45vh;
  width: 24vw;
  height: 160vh;
  filter: blur(36px);
  opacity: .5;
  will-change: transform, opacity;
}

.ambient::before {
  left: 20%;
  background: linear-gradient(90deg, transparent, rgba(228, 224, 207, .055), rgba(193, 145, 74, .09), transparent);
  transform: rotate(16deg);
  animation: beam-sway-left 14s ease-in-out infinite alternate;
}

.ambient::after {
  right: 10%;
  background: linear-gradient(90deg, transparent, rgba(98, 94, 145, .10), transparent);
  transform: rotate(-13deg);
  animation: beam-sway-right 19s ease-in-out -6s infinite alternate;
}

@keyframes beam-sway-left {
  from { transform: translate3d(-3vw, -2vh, 0) rotate(13deg) scaleX(.9); opacity: .34; }
  to { transform: translate3d(4vw, 2vh, 0) rotate(19deg) scaleX(1.12); opacity: .62; }
}

@keyframes beam-sway-right {
  from { transform: translate3d(3vw, 2vh, 0) rotate(-17deg) scaleX(1.08); opacity: .3; }
  to { transform: translate3d(-4vw, -1vh, 0) rotate(-10deg) scaleX(.88); opacity: .56; }
}

.ambient .halo {
  position: absolute;
  left: var(--x);
  bottom: -24vh;
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(255, 246, 207, .82) 0 2%,
      rgba(232, 193, 125, .34) 8%,
      rgba(193, 145, 74, .14) 28%,
      rgba(193, 145, 74, .04) 54%,
      transparent 72%);
  box-shadow:
    0 0 calc(var(--size) * .42) rgba(232, 193, 125, .13),
    0 0 calc(var(--size) * .86) rgba(193, 145, 74, .06);
  contain: layout paint;
  will-change: transform, opacity;
  animation: halo-rise var(--duration) linear var(--delay) infinite;
}

.ambient .halo::after {
  content: "";
  position: absolute;
  inset: 43%;
  border-radius: 50%;
  background: rgba(255, 248, 219, .9);
  box-shadow: 0 0 12px rgba(232, 193, 125, .62);
}

@keyframes halo-rise {
  0% { transform: translate3d(0, 10vh, 0) scale(.52); opacity: 0; }
  12% { opacity: var(--peak); }
  62% { opacity: var(--peak); }
  100% { transform: translate3d(var(--drift), -138vh, 0) scale(1.18); opacity: 0; }
}

.site-head {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1440px, 100%);
  min-height: 82px;
  margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  color: var(--paper);
  text-decoration: none;
}

.brand span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
}

.brand strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .22em;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 2px;
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

.about-link span { color: var(--amber-bright); }

.experience {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(440px, .96fr);
  width: min(1440px, calc(100% - clamp(24px, 4vw, 64px)));
  min-height: calc(100svh - 112px);
  margin: 0 auto 30px;
  overflow: hidden;
  background: rgba(13, 12, 11, .94);
  border: 1px solid var(--line);
  border-radius: clamp(18px, 2vw, 30px);
}

body.is-diagnosing .experience {
  grid-template-columns: minmax(0, 1fr);
  width: min(960px, calc(100% - clamp(24px, 4vw, 64px)));
}

body.is-diagnosing .story-pane { display: none; }

.story-pane {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  background: #090908;
}

.story-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10, 9, 8, .24), rgba(10, 9, 8, .04) 38%, rgba(10, 9, 8, .9) 92%),
    linear-gradient(90deg, transparent 62%, rgba(10, 9, 8, .72));
  pointer-events: none;
}

.portrait-stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  background: #080807;
}

.portrait {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.portrait:first-child { grid-row: 1 / 3; }

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.72) contrast(1.02) brightness(.7);
  transform: scale(1.01);
}

.portrait:first-child img { object-position: 52% 50%; }
.portrait:nth-child(2) img { object-position: 50% 38%; }
.portrait:nth-child(3) img { object-position: 50% 32%; }

.story-copy {
  position: absolute;
  inset: auto clamp(24px, 4vw, 58px) clamp(28px, 5vw, 64px);
  z-index: 2;
  max-width: 690px;
}

.story-kicker {
  margin: 0 0 14px;
  color: var(--amber-bright);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
}

.story-copy h1 {
  max-width: 11em;
  margin: 0;
  color: var(--paper-strong);
  font-size: clamp(36px, 5.2vw, 76px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -.035em;
}

.story-copy h1 span { color: var(--amber-bright); }

.story-lead {
  max-width: 35em;
  margin: 18px 0 0;
  color: rgba(242, 239, 223, .74);
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.9;
}

.class-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

.class-key li {
  padding: 6px 10px;
  color: rgba(242, 239, 223, .84);
  font-size: 11px;
  font-weight: 700;
  background: rgba(10, 9, 8, .56);
  border: 1px solid rgba(242, 239, 223, .18);
  border-radius: 99px;
  backdrop-filter: blur(8px);
}

.diagnosis-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 760px;
  padding: clamp(22px, 3.7vw, 54px);
  background: rgba(18, 17, 15, .92);
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  border-bottom: 1px solid var(--line);
}

.panel-top strong {
  color: var(--paper);
  font-size: 12px;
  letter-spacing: .18em;
}

.screen {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-height: 620px;
  padding: clamp(32px, 5vh, 64px) 0;
}

.screen.hidden { display: none; }

.screen-kicker,
.qnum,
.result-kicker {
  margin: 0 0 12px;
  color: var(--amber-bright);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
}

.start-title {
  max-width: 15em;
  margin: 0;
  color: var(--paper-strong);
  font-size: clamp(28px, 3.2vw, 45px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.025em;
}

.lore {
  max-width: 39em;
  margin: 24px 0 0;
  color: #c4c0b4;
  font-size: 14px;
  line-height: 2;
}

.lore b { color: var(--paper-strong); }

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.quick-facts li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--line);
}

.quick-facts strong {
  color: var(--paper);
  font-size: 14px;
}

.start-btn,
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px 10px 22px;
  color: var(--sumi);
  background: var(--paper-strong);
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  transition: background .25s, transform .25s;
}

.start-btn::after,
.cta::after {
  content: "→";
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--paper-strong);
  background: var(--sumi);
  border-radius: 50%;
  transition: transform .25s var(--ease);
}

.start-btn:hover,
.cta:hover { background: var(--amber-bright); }

.start-btn:hover::after,
.cta:hover::after { transform: translateX(3px); }

.start-btn:focus-visible,
.cta:focus-visible,
.opt:focus-visible,
.share-btn:focus-visible,
.again-btn:focus-visible,
.avatar-back:focus-visible,
.gender-tabs button:focus-visible,
.avatar-card:focus-visible,
.about-link:focus-visible {
  outline: 3px solid var(--amber-bright);
  outline-offset: 4px;
}

.question-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.question-hint {
  color: var(--muted);
  font-size: 11px;
}

.progress-track {
  width: 100%;
  height: 3px;
  margin-bottom: clamp(34px, 5vh, 58px);
  overflow: hidden;
  background: rgba(228, 224, 207, .11);
}

.progress-bar {
  display: block;
  width: 10%;
  height: 100%;
  background: var(--amber-bright);
  transition: width .45s var(--ease);
}

.lanterns { display: none; }

.qtext {
  max-width: 20em;
  margin: 0 0 clamp(28px, 4vh, 42px);
  color: var(--paper-strong);
  font-size: clamp(25px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.025em;
  text-align: left;
}

.opts {
  display: grid;
  gap: 10px;
}

.opt {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(228, 224, 207, .18);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
  transition: border-color .18s, background .18s, transform .18s;
}

.opt::after {
  content: "→";
  color: var(--muted);
  text-align: right;
}

.opt-key {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.opt:hover {
  background: rgba(228, 224, 207, .055);
  border-color: var(--line-strong);
  transform: translateX(3px);
}

.opt:hover .opt-key {
  color: var(--sumi);
  background: var(--amber-bright);
  border-color: var(--amber-bright);
}

.opt:disabled { pointer-events: none; opacity: .5; }

#scr-r.screen {
  justify-content: flex-start;
  padding-top: clamp(28px, 4vh, 48px);
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(140px, .72fr) minmax(220px, 1.28fr);
  gap: clamp(22px, 3vw, 34px);
  align-items: end;
  margin-bottom: 30px;
}

.result-portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #0b0a09;
  border-radius: 2px 2px 54px 2px;
}

.result-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(10, 9, 8, .62));
  pointer-events: none;
}

.result-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.r-emoji {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 1;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin: 0;
  font-size: 24px;
  background: rgba(10, 9, 8, .82);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  filter: none;
  animation: none;
}

.r-role {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: left;
}

.r-nick {
  margin: 0 0 18px;
  color: var(--paper-strong);
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.04em;
  text-align: left;
  text-shadow: none;
}

.r-skill {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  text-align: left;
}

.r-skill .lbl {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--amber-bright);
  background: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.r-skill .nm {
  color: var(--paper);
  font-size: 18px;
  font-weight: 700;
}

.r-quote {
  margin: 0 0 26px;
  padding: 20px 0;
  color: var(--amber-bright);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.7;
  text-align: left;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.r-quote::before,
.r-quote::after { content: none; }

.result-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.r-box {
  min-width: 0;
  margin: 0;
  padding: 18px;
  color: #c8c4b8;
  background: var(--surface-2);
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.9;
}

.r-box:first-child { grid-column: 1 / 3; }

.r-box .h {
  display: block;
  margin-bottom: 8px;
  color: var(--amber-bright);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.r-sub {
  margin: 22px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: left;
}

#r-bars { margin-bottom: 24px; }

.bar-row {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 7px 0;
  font-size: 11px;
}

.bar-row .nm {
  width: auto;
  color: var(--muted);
}

.bar-out {
  height: 4px;
  overflow: hidden;
  background: rgba(228, 224, 207, .1);
  border-radius: 0;
}

.bar-in {
  height: 100%;
  background: var(--amber-bright);
  border-radius: 0;
  transition: width .8s var(--ease);
}

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

#scr-avatar.screen {
  justify-content: flex-start;
  padding-top: clamp(28px, 4vh, 48px);
}

.avatar-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.avatar-title {
  max-width: 16em;
  margin: 0;
  color: var(--paper-strong);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.035em;
}

.avatar-back {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(228, 224, 207, .18);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.gender-field {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.gender-field legend {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.gender-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gender-tabs button {
  min-height: 54px;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(228, 224, 207, .2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: color .18s, background .18s, border-color .18s;
}

.gender-tabs button:hover,
.gender-tabs button.is-selected {
  color: var(--sumi);
  background: var(--amber-bright);
  border-color: var(--amber-bright);
}

.avatar-guide {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.avatar-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--paper);
  background: #0b0a09;
  border: 1px solid rgba(228, 224, 207, .14);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .18s, transform .18s;
}

.avatar-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.avatar-card.is-selected {
  border-color: var(--amber-bright);
  box-shadow: 0 0 0 2px rgba(232, 193, 125, .28);
}

.avatar-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  image-rendering: auto;
}

.avatar-card span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  place-items: center;
  color: var(--paper-strong);
  background: rgba(10, 9, 8, .84);
  border: 1px solid rgba(228, 224, 207, .22);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.avatar-choice {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(260px, 1.2fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.avatar-choice.hidden,
.avatar-confirm.hidden,
.avatar-picker.hidden { display: none; }

.avatar-choice-portrait,
.avatar-confirm-portrait {
  margin: 0;
  overflow: hidden;
  background: #0b0a09;
  border: 1px solid var(--line);
  border-radius: 4px 4px 54px 4px;
}

.avatar-choice-portrait img,
.avatar-confirm-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.avatar-choice-label,
.avatar-confirm-job {
  margin: 0 0 8px;
  color: var(--amber-bright);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.avatar-choice-copy h3,
.avatar-confirm-title {
  margin: 0;
  color: var(--paper-strong);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.3;
}

.avatar-choice-copy > p:not(.avatar-choice-label),
.avatar-confirm-note {
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.avatar-confirm-layout {
  display: grid;
  grid-template-columns: minmax(240px, .82fr) minmax(260px, 1.18fr);
  gap: clamp(26px, 4vw, 48px);
  align-items: center;
  margin-bottom: 30px;
}

.job-rule-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.discord-status {
  margin-top: 18px;
  padding: 20px;
  background: rgba(228, 224, 207, .045);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.discord-status.is-success { border-color: rgba(151, 201, 157, .46); }
.discord-status.is-warning { border-color: var(--line-strong); }

.discord-status-label {
  margin: 0 0 7px;
  color: var(--amber-bright);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.discord-status h3 {
  margin: 0;
  color: var(--paper-strong);
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.45;
}

.discord-status > p:last-child {
  margin: 10px 0 0;
  color: var(--paper);
  font-size: 13px;
  line-height: 1.9;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 0;
}

.share-btn,
.again-btn {
  min-height: 48px;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(228, 224, 207, .18);
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.share-btn:hover,
.again-btn:hover {
  color: var(--amber-bright);
  border-color: var(--line-strong);
}

.again-btn {
  width: 100%;
  margin-top: 10px;
}

.privacy-note {
  max-width: 38em;
  margin: 26px auto 0;
  color: #77736b;
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  padding: 10px 16px;
  color: var(--sumi);
  background: var(--paper-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .25s, transform .25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fade { animation: reveal-screen .5s var(--ease); }

@keyframes reveal-screen {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .experience {
    grid-template-columns: 1fr;
    width: min(820px, calc(100% - 24px));
  }

  .story-pane { min-height: 430px; }

  .portrait-stage {
    grid-template-columns: 1.2fr .8fr .8fr;
    grid-template-rows: 1fr;
  }

  .portrait:first-child { grid-row: auto; }

  .story-pane::before {
    background: linear-gradient(180deg, rgba(10, 9, 8, .14), rgba(10, 9, 8, .9) 90%);
  }

  .story-copy h1 { max-width: 13em; }
  .story-lead { display: none; }
  .class-key { margin-top: 16px; }

  .diagnosis-pane {
    min-height: auto;
    padding: clamp(22px, 6vw, 48px);
  }

  .screen { min-height: 600px; }

  body.is-diagnosing .experience {
    width: min(820px, calc(100% - 24px));
  }
}

@media (max-width: 620px) {
  .ambient .halo:nth-child(n+9) { display: none; }
  .ambient .halo { --peak: .09 !important; }

  .site-head { min-height: 68px; padding: 12px 18px; }
  .brand span { display: none; }
  .brand strong { font-size: 13px; }
  .about-link { font-size: 11px; }

  .experience {
    width: calc(100% - 16px);
    margin-bottom: 12px;
    border-radius: 16px;
  }

  .story-pane { min-height: 330px; }

  .portrait-stage {
    grid-template-columns: 1.4fr .8fr;
    grid-template-rows: 1fr 1fr;
  }

  .portrait:first-child { grid-row: 1 / 3; }
  .portrait:nth-child(3) { display: block; }

  .story-copy { inset: auto 20px 20px; }
  .story-kicker { margin-bottom: 8px; font-size: 10px; }
  .story-copy h1 { max-width: 10em; font-size: clamp(30px, 10vw, 42px); }
  .class-key { gap: 5px; margin-top: 12px; }
  .class-key li { padding: 4px 7px; font-size: 9px; }

  .diagnosis-pane { min-height: auto; padding: 20px; }
  .panel-top { padding-bottom: 14px; }
  .panel-top span { display: none; }

  .screen {
    justify-content: flex-start;
    min-height: 560px;
    padding: 30px 0 18px;
  }

  .start-title { font-size: 29px; }
  .lore { margin-top: 18px; font-size: 13px; line-height: 1.9; }
  .quick-facts { gap: 8px; margin: 22px 0; }
  .quick-facts strong { font-size: 12px; }

  .qtext { margin-bottom: 26px; font-size: 25px; }
  .progress-track { margin-bottom: 30px; }
  .opt { min-height: 62px; padding: 10px 12px; font-size: 13px; }

  .result-hero {
    grid-template-columns: 124px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
  }

  .r-nick { font-size: 29px; }
  .r-skill .nm { font-size: 15px; }
  .result-sections { grid-template-columns: 1fr; }
  .r-box:first-child { grid-column: auto; }
  .share-row { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 7.7em minmax(0, 1fr); }

  body.is-diagnosing .experience { width: calc(100% - 16px); }

  .avatar-head { align-items: flex-start; gap: 12px; }
  .avatar-title { font-size: 29px; }
  .avatar-back { padding: 0 12px; }
  .gender-tabs button { min-height: 50px; font-size: 13px; }
  .avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .avatar-choice,
  .avatar-confirm-layout { grid-template-columns: 1fr; gap: 20px; }
  .avatar-choice-portrait,
  .avatar-confirm-portrait { width: min(100%, 420px); margin-inline: auto; }
}

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

  .ambient::before,
  .ambient::after {
    animation: none !important;
    opacity: .38;
  }

  .ambient .halo {
    bottom: var(--static-y);
    opacity: .055;
    transform: none;
    animation: none !important;
  }
}
