/* Layout concept: the page is a bill on a desk. The quiz is a paper form with
   tick boxes, the results print out like a receipt, and a highlighter and red
   pen mark the things worth checking. Left-aligned, two columns on desktop. */

@font-face { font-family: "Archivo"; src: url("/fonts/archivo-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/fonts/archivo-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/fonts/public-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/fonts/public-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/fonts/public-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/fonts/public-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --desk: #e9ebe6;      /* page background, a grey-green desk */
  --paper: #ffffff;     /* the bill / form */
  --ink: #16181b;
  --muted: #5b6066;
  --rule: #d6d8d2;
  --hl: #ffe44d;        /* highlighter */
  --pen: #cf3a2d;       /* red pen */
  --money: #1b7a45;

  --display: "Archivo", "Arial Black", Arial, sans-serif;
  --body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}
a { color: var(--ink); text-underline-offset: 3px; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Header ---------- */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}
.brand svg { width: 26px; height: 30px; flex: none; }
.wordmark { font-family: var(--display); font-weight: 900; font-size: 21px; letter-spacing: -0.02em; }
.wordmark b { font-weight: 900; color: var(--pen); }
.header-link { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* ---------- Hero ---------- */
.hero .wrap {
  display: grid;
  gap: 28px;
  padding-block: 12px 48px;
}
.hero-copy { min-width: 0; }
.label {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
h1 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(36px, 8.5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.mark {
  background: linear-gradient(transparent 12%, var(--hl) 12%, var(--hl) 88%, transparent 88%);
  padding: 0 0.08em;
  margin: 0 -0.04em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.lede { margin: 0; max-width: 36ch; font-size: 18px; color: var(--muted); }
.lede strong { color: var(--ink); font-weight: 600; }

/* Mini example bill (phones only) */
.mini-bill {
  margin-top: 18px;
  max-width: 340px;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px 14px 8px;
  font-family: var(--mono);
  font-size: 13px;
  transform: rotate(-1deg);
  box-shadow: 0 10px 20px -16px rgba(22, 24, 27, 0.35);
}
.mini-row { display: flex; gap: 8px; align-items: baseline; }
.mini-row .dots { flex: 1; border-bottom: 1px dotted #b8bbb4; transform: translateY(-4px); }
.mini-row .amt { font-variant-numeric: tabular-nums; }
.mini-bill .flag { background: var(--hl); padding: 0 2px; }
.mini-bill .pen { display: block; margin: 0 0 4px; color: var(--pen); font-size: 12px; font-style: italic; }
.mini-bill .pen:last-child { margin-bottom: 0; }

/* Example statement (desktop only) */
.statement {
  display: none;
  margin-top: 32px;
  max-width: 400px;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 18px 20px 16px;
  font-family: var(--mono);
  font-size: 13.5px;
  transform: rotate(-1.2deg);
  box-shadow: 0 1px 0 var(--rule), 0 12px 24px -16px rgba(22, 24, 27, 0.35);
}
.statement-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--rule);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.statement ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.statement li { display: flex; gap: 8px; align-items: baseline; }
.statement li .dots { flex: 1; border-bottom: 1px dotted #b8bbb4; transform: translateY(-4px); }
.statement li .amt { font-variant-numeric: tabular-nums; }
.statement .flag { background: var(--hl); padding: 0 2px; }
.statement .struck { text-decoration: line-through; text-decoration-color: var(--pen); text-decoration-thickness: 2px; }
.statement .pen { display: block; margin: -2px 0 2px 0; color: var(--pen); font-size: 12px; font-style: italic; }
.statement-total {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--ink);
  font-weight: 600;
}

/* ---------- The form (quiz) ---------- */
.sheet {
  position: relative;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 40px -24px rgba(22, 24, 27, 0.45);
  padding: 0 20px 34px;
  /* torn / perforated bottom edge */
  -webkit-mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) bottom / 18px 100% repeat-x;
  mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) bottom / 18px 100% repeat-x;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px 22px;
  padding: 12px 20px;
  border-bottom: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sheet-head[hidden] { display: none; }
.back {
  background: none;
  border: 0;
  padding: 4px 0;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.back:hover { color: var(--ink); }
.back[hidden] { display: none; }
.step-count { margin: 0 0 0 auto; }
.progress { height: 3px; margin: -22px -20px 22px; background: var(--rule); }
.progress[hidden] { display: none; }
.progress-bar { height: 100%; width: 10%; background: var(--ink); transition: width 0.3s ease; }

.step { display: none; }
.step.is-active { display: block; }
.step h2 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
  outline: none;
}
.hint { margin: -10px 0 14px; color: var(--muted); font-size: 14.5px; }

.choices { display: grid; gap: 8px; margin: 0 0 18px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  font-size: 16.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.choice::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper) no-repeat center / 14px 14px;
}
@media (hover: hover) { .choice:hover { border-color: var(--ink); } }
.choice[aria-pressed="true"] { border-color: var(--ink); background: #fbfaf0; }
.choice[aria-pressed="true"]::before {
  background-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.why {
  margin: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.why::before { content: "* "; color: var(--pen); font-weight: 600; }

.sheet-foot {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Results (the receipt) ---------- */
.receipt-head { margin-bottom: 6px; }
.receipt-head h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  outline: none;
}
.receipt-head p { margin: 0; color: var(--muted); }
.receipt-meta {
  display: flex;
  justify-content: space-between;
  margin: 16px 0 0;
  padding: 8px 0;
  border-block: 1px dashed var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.results-list { margin: 0 0 18px; }
.result-card { padding: 20px 0; border-bottom: 1px dashed var(--rule); }
.result-card .tag {
  display: inline-block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pen);
}
.result-card.free .tag { background: var(--hl); color: var(--ink); padding: 0 4px; }
.result-card h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.22;
  letter-spacing: -0.015em;
}
.result-card p { margin: 0; max-width: 60ch; }
.result-card .note { margin-top: 6px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.result-card .btn { margin-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 20px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 3px;
  font-family: var(--body);
  font-size: 16.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #000; color: #fff; }
.sponsored-note { margin: 0 0 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.sponsored-note a { color: var(--muted); }
.fine { margin: 0; }
.linkish { background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Lower sections ---------- */
.band { background: var(--paper); border-top: 1px solid var(--rule); }
.band .wrap { padding-block: 56px; }
.band + .band { border-top: 1px solid var(--rule); }
.band.plain { background: transparent; }
h2.section-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(26px, 5vw, 36px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
}
.section-lede { margin: 0 0 28px; max-width: 58ch; color: var(--muted); font-size: 17px; }

.ledger { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ledger li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.ledger strong { font-weight: 700; }
.ledger span { color: var(--muted); }

.qa { display: grid; gap: 22px; margin: 0; }
.qa dt { font-weight: 700; margin: 0 0 4px; }
.qa dd { margin: 0; color: var(--muted); max-width: 62ch; }

.fineprint {
  margin: 0;
  max-width: 90ch;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.fineprint strong { color: var(--ink); font-family: var(--body); font-size: 13px; display: block; margin-bottom: 4px; }

.site-footer { background: var(--ink); color: #b9bdc2; }
.site-footer .wrap { padding-block: 30px 40px; font-size: 13.5px; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer .wordmark b { color: #ff7d6e; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 12px; padding: 0; list-style: none; }
.footer-links a { color: #fff; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.site-footer p { margin: 0 0 6px; max-width: 70ch; }

/* ---------- Legal pages ---------- */
.legal .wrap { max-width: 760px; padding-block: 16px 64px; }
.legal h1 { font-size: clamp(32px, 6vw, 44px); margin: 8px 0 8px; }
.legal h2 { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.01em; margin: 30px 0 8px; }
.legal p, .legal li { color: #2c3035; }
.legal ul { padding-left: 22px; }
.updated { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }
.legal-sheet { background: var(--paper); border: 1px solid var(--rule); padding: 8px 22px 28px; }

/* ---------- Wider screens ---------- */
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: start; padding-block: 28px 72px; }
  .hero-copy { padding-top: 18px; }
  .statement { display: block; }
  .mini-bill { display: none; }
  .sheet { padding: 0 28px 38px; }
  .sheet-head { margin: 0 -28px 22px; padding: 12px 28px; }
  .progress { margin: -22px -28px 24px; }
  .ledger li { grid-template-columns: 240px 1fr; align-items: baseline; }
  .qa { grid-template-columns: 1fr 1fr; gap: 28px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
.back:not([hidden]) + .sheet-title { display: none; }
.statement li.pen-row { display: block; margin-top: -5px; }
#results { padding-top: 26px; }

/* ---------- Phones: get to the first question faster ---------- */
@media (max-width: 899px) {
  .site-header .wrap { padding-block: 14px; }
  .hero .wrap { gap: 22px; padding-block: 4px 40px; }
  .label { margin-bottom: 10px; font-size: 11.5px; }
  h1 { font-size: clamp(34px, 10vw, 52px); margin-bottom: 12px; }
  .lede { font-size: 16.5px; line-height: 1.5; }
}

/* Results: lead card + "more" divider */
.result-card.top { position: relative; }
.start-here {
  display: block;
  width: fit-content;
  margin: 0 0 10px;
  padding: 2px 8px;
  border: 2px solid var(--pen);
  color: var(--pen);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}
.more-head {
  margin: 26px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
