/* The online personality quiz, one post, no site around it. */
:root {
  --ink: #222;
  --muted: #6b6b6b;
  --line: #e1e1e1;
  --band: #f2f2f2;
  --band-hover: #e6e6e6;
  --pick: #0f65ef;
  --pick-dark: #0b50c2;
  --qbg: #222;
  --col: 760px;
  --gap: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font: 400 17px/1.5 Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
img { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pick); outline-offset: 2px; }

.post { width: 100%; max-width: calc(var(--col) + 32px); margin: 0 auto; padding: 28px 16px 80px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* ---- the header */
.kicker { margin: 0 0 10px; }
.badge { display: inline-block; padding: 3px 10px 4px; border-radius: 4px; background: var(--pick); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.post-title { margin: 0 0 14px; font-size: clamp(28px, 4.6vw, 42px); line-height: 1.08; font-weight: 900; letter-spacing: -.015em; }
.byline { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 15px; color: var(--muted); }
.byline strong { color: var(--ink); font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #ffd8c2; color: #9a3d12; font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.cover { margin: 0 0 34px; }
.cover-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; background: #fff; border-radius: 6px; overflow: hidden; }
.cover-grid img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #111; }
.credit { margin-top: 6px; font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

/* ---- questions */
.quiz { list-style: none; margin: 0; padding: 0; display: grid; gap: 44px; }
body[data-mode="single"] .post-head, body[data-mode="single"] .quiz { display: none; }
.q { scroll-margin-top: 12px; }
.q-head { margin: 0 0 var(--gap); padding: 26px 22px; min-height: 104px; display: flex; align-items: center; justify-content: center; text-align: center; background: var(--qbg); color: #fff; border-radius: 6px 6px 0 0; font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; line-height: 1.15; }
.q-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.q-grid[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; margin: 0 auto; }
.tile {
  all: unset; box-sizing: border-box; display: flex; flex-direction: column; cursor: pointer; min-width: 0;
  background: var(--band); border-radius: 0 0 4px 4px; overflow: hidden; position: relative;
  transition: opacity .2s ease, transform .12s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tile:focus-visible { outline: 3px solid var(--pick); outline-offset: 2px; }
.tile .pic { position: relative; aspect-ratio: 1 / 1; background: #ddd; overflow: hidden; }
.tile .pic img { width: 100%; height: 100%; object-fit: cover; }
.tile .cap { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px 13px; font-weight: 700; font-size: 16px; line-height: 1.25; min-height: 50px; transition: background .15s ease, color .15s ease; }
.tile .box { flex: none; width: 20px; height: 20px; margin-top: 0; border-radius: 50%; border: 2px solid #9a9a9a; background: #fff; display: grid; place-items: center; transition: border-color .15s ease, background .15s ease; }
.tile .box svg { width: 12px; height: 12px; opacity: 0; transform: scale(.4); transition: opacity .15s ease, transform .18s cubic-bezier(.3, 1.6, .5, 1); }
@media (hover: hover) {
  .tile:hover .cap { background: var(--band-hover); }
  .tile:hover .box { border-color: var(--pick); }
}
.tile:active { transform: scale(.985); }
.q.answered .tile { opacity: .45; }
.q.answered .tile[aria-checked="true"] { opacity: 1; }
.tile[aria-checked="true"] { box-shadow: 0 0 0 3px var(--pick); }
.tile[aria-checked="true"] .cap { background: var(--pick); color: #fff; }
.tile[aria-checked="true"] .box { border-color: #fff; background: #fff; }
.tile[aria-checked="true"] .box svg { opacity: 1; transform: none; }
@media (hover: hover) { .q.answered .tile:hover { opacity: .85; } .tile[aria-checked="true"]:hover .cap { background: var(--pick-dark); } }
/* picture-only answers: the radio sits on the picture */
.tile.bare { border-radius: 4px; }
.tile.bare .cap, .tile.bare:hover .cap, .tile.bare[aria-checked="true"] .cap, .tile.bare[aria-checked="true"]:hover .cap { position: absolute; left: 10px; bottom: 10px; padding: 0; min-height: 0; background: none; }
.tile.bare .box { width: 26px; height: 26px; border-color: #fff; background: rgba(255, 255, 255, .9); box-shadow: 0 1px 5px rgba(0, 0, 0, .35); }
.tile.bare .box svg { width: 14px; height: 14px; }

/* ---- the result */
.result { margin-top: 52px; scroll-margin-top: 12px; }
body[data-mode="single"] .result { margin-top: 0; }
.result-card { border: 1px solid var(--line); border-radius: 8px; padding: 22px 22px 28px; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.result-kicker { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.result-kicker:empty { display: none; }
.result-title { margin: 0 0 16px; font-size: clamp(26px, 4.2vw, 38px); font-weight: 900; line-height: 1.1; letter-spacing: -.01em; outline: none; }
.result-title .got { font-weight: 600; }
.result-pic { margin: 0 0 18px; display: grid; place-items: center; background: #f4f4f4; border-radius: 4px; overflow: hidden; }
.result-pic img { width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: min(76vh, 720px); max-height: min(76svh, 720px); object-fit: contain; }
.result-line { margin: 0 0 12px; padding: 0 0 0 16px; border-left: 4px solid var(--pick); font-size: clamp(20px, 2.8vw, 24px); font-weight: 700; line-height: 1.3; }
.result-text { margin: 0 0 20px; font-size: 18px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 4px; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer; border: 2px solid var(--ink); background: #fff; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.btn-share { background: var(--pick); border-color: var(--pick); color: #fff; }
@media (hover: hover) { .btn:hover { background: var(--band); } .btn-share:hover { background: var(--pick-dark); border-color: var(--pick-dark); } }

/* the case study, under the result */
.case { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.case:empty { display: none; }
.case.ab-media { --ab-fg: var(--ink); --ab-muted: var(--muted); --ab-accent: var(--pick); --ab-chrome: 40px; gap: 30px; }
.case .ab-heading { font-size: 20px; font-weight: 800; line-height: 1.2; }
.case .ab-text { color: #444; }
.case .ab-credits { font-size: 14px; }
.case .ab-film figcaption, .case .ab-audio figcaption { font-weight: 700; color: var(--ink); font-size: 15px; }
.case .ab-audio { background: var(--band); border-radius: 6px; padding: 10px 12px 12px; }
.case .ab-audio figcaption { margin: 0 0 8px; }

/* ---- see all results */
.all { margin-top: 44px; display: grid; justify-items: center; gap: 18px; }
.btn-all { min-width: min(100%, 320px); }
.all-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 10px; }
.all-row { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 14px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: #fff; }
.all-row img { width: 128px; height: 72px; object-fit: contain; background: #111; border-radius: 3px; }
.all-row .nm { display: block; font-weight: 800; font-size: 19px; line-height: 1.2; }
.all-row .cl { display: block; margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.all-row .ln { display: block; margin-top: 4px; font-size: 15px; color: #444; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.all-row .mine { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 3px; background: var(--pick); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.all-row:focus-visible { outline: 3px solid var(--pick); outline-offset: 2px; }
.all-row[aria-current="true"] { border-color: var(--pick); box-shadow: 0 0 0 2px var(--pick); }
@media (hover: hover) { .all-row:hover { background: var(--band); } }

@media (max-width: 640px) {
  .post { padding-top: 18px; }
  .q-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-head { min-height: 84px; padding: 20px 16px; }
  .tile .cap { font-size: 15px; padding: 10px 10px 12px; gap: 8px; }
  .result-card { padding: 0; border: 0; box-shadow: none; }
  .result-pic { margin-left: -16px; margin-right: -16px; border-radius: 0; }
  .cover-grid { margin: 0 -16px; border-radius: 0; gap: 2px; }
  .all-row { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
  .all-row img { width: 112px; height: 63px; }
  .all-row .nm { font-size: 17px; }
  .result-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
