/* Ascend. Ledger paper, evergreen ink, Caslon for anything a banker would print. */
:root {
  --paper: #eef1ec;
  --sheet: #ffffff;
  --ink: #13201a;
  --green: #1e4a38;
  --green-hover: #173b2c;
  --rule: #c7d0c8;
  --field: #75827b; /* outlines of things you type in or pick: 3.5:1 on paper */
  --muted: #56655d;
  --sprout: #d9e6c3;
  --warn: #9a3b22;
  --serif: "Libre Caslon Text", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", -apple-system, "Segoe UI", sans-serif;
  /* Type scale: 14 / 16 / 18 / 22 / 28 / 44 */
  --t-sm: 0.875rem; --t-md: 1rem; --t-lg: 1.125rem; --t-xl: 1.375rem; --t-2xl: 1.75rem; --t-3xl: clamp(2.125rem, 5.2vw, 2.75rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 400 var(--t-md)/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--green); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.bar { display: flex; justify-content: space-between; align-items: center; padding: 20px clamp(20px, 5vw, 56px); }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 400 var(--t-xl) var(--serif); }
.logo svg { color: var(--green); }
.link { background: none; border: 0; padding: 8px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px clamp(20px, 5vw, 56px) 64px; }

/* Buttons */
.primary {
  background: var(--green); color: #fff; border: 0; border-radius: 6px;
  padding: 14px 24px; font-weight: 600; letter-spacing: 0.01em;
  transition: background-color .15s ease, transform .1s ease;
}
.primary:hover { background: var(--green-hover); }
.primary:active { transform: translateY(1px); }
.ghost { background: transparent; border: 1px solid var(--rule); border-radius: 6px; padding: 13px 20px; color: var(--ink); }
.ghost:hover { border-color: var(--muted); }
.ghost:disabled { opacity: .4; cursor: default; }

/* Intro */
.intro { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; padding-top: clamp(8px, 4vw, 48px); }
.intro h1 { font-size: var(--t-3xl); line-height: 1.12; max-width: 14em; margin-bottom: 20px; }
.lede { font-size: var(--t-lg); color: var(--muted); max-width: 34em; margin: 0 0 28px; }
.facts { margin: 40px 0 24px; display: grid; gap: 0; max-width: 34em; }
.facts div { padding: 14px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 11em 1fr; gap: 16px; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }
.fine { color: var(--muted); font-size: var(--t-sm); margin: 0; }

/* The tombstone: a printed deal announcement, framed with a double rule. */
.tombstone {
  margin: 0; background: var(--sheet); border: 4px double var(--ink);
  text-align: center; font-family: var(--serif);
}
.hero-stone { padding: clamp(36px, 5vw, 56px) 28px; box-shadow: 10px 10px 0 var(--sprout); }
.ts-name { font-size: var(--t-2xl); line-height: 1.2; margin: 0 0 18px; }
.ts-verb { font-style: italic; color: var(--muted); margin: 0 0 22px; }
.ts-blank { width: 70%; height: 2.2em; margin: 0 auto 26px; border-bottom: 2px solid var(--ink); }
.ts-foot { font: 400 var(--t-sm) var(--sans); color: var(--muted); margin: 0; }

/* Questionnaire */
.quiz { max-width: 640px; margin: 0 auto; }
.progress { height: 3px; background: var(--rule); margin: 8px 0 20px; }
.progress span { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s ease; }
.step { color: var(--muted); font-size: var(--t-sm); margin: 0 0 10px; }
.q-label { font-size: var(--t-2xl); line-height: 1.25; margin: 0 0 10px; }
.q-label label { cursor: default; }
.help { color: var(--muted); margin: 0 0 20px; max-width: 36em; }
.help:empty { display: none; }
.error { color: var(--warn); min-height: 1.5em; margin: 10px 0 0; }
.nav { display: flex; justify-content: space-between; margin-top: 20px; }

input[type=text], input[type=number], input[type=search], input[type=email], input[type=password] {
  width: 100%; background: var(--sheet); color: var(--ink);
  border: 1px solid var(--field); border-radius: 6px; padding: 14px 16px;
  font: 400 var(--t-xl) var(--sans); -webkit-appearance: none; appearance: none;
}
input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--sprout); }
input::placeholder { color: #5f6d66; }
input.search { font-size: var(--t-lg); margin-bottom: 14px; }
.money { position: relative; }
.money::before, .money::after { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: var(--t-xl); pointer-events: none; }
.money::before { content: "$"; left: 16px; }
.money::after { content: "million"; right: 16px; font-size: var(--t-md); }
.money input { padding-left: 34px; padding-right: 88px; }

/* Answers are rows on a sheet, each with a radio or checkbox mark. */
.choices { background: var(--sheet); border: 1px solid var(--field); border-radius: 6px; overflow: hidden; }
.choices.grid { display: grid; grid-template-columns: 1fr 1fr; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid var(--rule);
  padding: 14px 16px; min-height: 52px;
}
.choices.grid .choice:nth-child(odd) { border-right: 1px solid var(--rule); }
.choice:last-child { border-bottom: 0; }
.choice:hover { background: #f6f8f4; }
.choice::before {
  content: ""; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--muted); border-radius: 50%;
  background: var(--sheet);
}
.choice.multi::before { border-radius: 3px; }
.choice[aria-pressed=true] { background: var(--sprout); }
.choice.single[aria-pressed=true]::before { border-color: var(--green); background: radial-gradient(circle, var(--green) 0 4.5px, var(--sheet) 5.5px); }
.choice.multi[aria-pressed=true]::before { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center/14px no-repeat; }
.choice.only { box-shadow: inset 3px 0 0 var(--green); background: #f3f7ee; }
.choice .hint { margin-left: auto; font-size: var(--t-sm); color: var(--green); }
.no-match { margin: 0 0 14px; }

/* Results */
.results { max-width: 900px; margin: 0 auto; }
.results-head h1:focus { outline: none; }
.results-head h1 { font-size: var(--t-3xl); line-height: 1.1; margin-bottom: 6px; }
.results-head p { color: var(--muted); margin: 0; }
.figures { display: grid; grid-template-columns: 1.5fr 1fr; margin: 32px 0 40px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.figure { padding: 20px 24px 22px 0; }
.figure + .figure { border-left: 1px solid var(--rule); padding-left: 24px; }
.figure dt { font-weight: 600; margin-bottom: 4px; }
.figure dd { margin: 0; }
.figure .num { font: 400 clamp(1.75rem, 4vw, 2.5rem)/1.1 var(--serif); margin: 4px 0 10px; font-variant-numeric: lining-nums; }
.figure .num small { font-size: 0.5em; color: var(--muted); }
.figure p { margin: 0; color: var(--muted); font-size: var(--t-sm); max-width: 36em; }
.meter { height: 6px; background: var(--rule); margin: 0 0 10px; }
.meter span { display: block; height: 100%; background: var(--green); }

.tabs { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; padding: 3px; background: var(--sheet); margin-bottom: 28px; }
.tab { background: none; border: 0; border-radius: 4px; padding: 9px 16px; color: var(--muted); font-weight: 500; }
.tab[aria-selected=true] { background: var(--ink); color: #fff; }

.tier { margin-bottom: 40px; }
.tier-head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.tier-head h2 { font-size: var(--t-2xl); }
.tier-head p { margin: 0; color: var(--muted); }
.empty { color: var(--muted); padding: 18px 0; border-bottom: 1px solid var(--rule); margin: 0; }

.buyer { border-bottom: 1px solid var(--rule); }
.buyer summary {
  list-style: none; cursor: pointer; padding: 18px 0;
  display: grid; grid-template-columns: 1fr 120px 20px; gap: 4px 20px; align-items: center;
}
.buyer summary::-webkit-details-marker { display: none; }
.buyer summary:hover h3 { color: var(--green); }
.buyer h3 { font-size: var(--t-xl); }
.buyer .sub { color: var(--muted); font-size: var(--t-sm); grid-column: 1; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--sprout); color: var(--green); font: 500 0.75rem/1.6 var(--sans); vertical-align: 2px; }
.fit { grid-row: 1 / span 2; grid-column: 2; font-size: var(--t-sm); color: var(--muted); }
.fit b { display: block; font: 400 var(--t-xl) var(--serif); color: var(--ink); }
.fit i { display: block; height: 4px; background: var(--rule); margin-top: 4px; }
.fit i span { display: block; height: 100%; background: var(--green); }
.chev { grid-row: 1 / span 2; grid-column: 3; width: 10px; height: 10px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease; }
.buyer[open] .chev { transform: rotate(225deg); }

.body { padding: 0 0 28px; max-width: 760px; }
.body > p:first-child { margin-top: 0; }
.body h4 { font: 600 var(--t-md) var(--sans); margin: 22px 0 8px; }
.body ul { margin: 0; padding-left: 20px; }
.body li { margin: 4px 0; }
.caution li::marker { color: var(--warn); }
.links { margin-top: 18px; font-size: var(--t-sm); display: flex; gap: 18px; }

.stones { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stone { padding: 18px 14px 16px; border-width: 3px; display: flex; flex-direction: column; justify-content: center; min-height: 150px; }
.stone .ts-name { font-size: var(--t-lg); margin: 0 0 6px; }
.stone .ts-verb { font-size: var(--t-sm); margin: 0 0 6px; }
.stone .by { margin: 0 0 8px; font-size: var(--t-md); }
.stone .note { font: 400 0.8125rem/1.4 var(--sans); color: var(--muted); margin: 0; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.foot { color: var(--muted); font-size: var(--t-sm); padding: 28px clamp(20px, 5vw, 56px); max-width: 1080px; margin: 0 auto; width: 100%; border-top: 1px solid var(--rule); }

@media (max-width: 820px) {
  .intro { grid-template-columns: 1fr; }
  .hero-stone { box-shadow: 6px 6px 0 var(--sprout); }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 600px) {
  .choices.grid { grid-template-columns: 1fr; }
  .choices.grid .choice:nth-child(odd) { border-right: 0; }
  .figures { grid-template-columns: 1fr; }
  .figure + .figure { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; }
  .buyer summary { grid-template-columns: 1fr 64px 14px; gap: 4px 12px; }
  .fit i { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  body { background: #fff; } .bar, .tabs, .actions, .foot, .chev { display: none; }
  [data-panel] { display: block !important; }
  .buyer, .stone { break-inside: avoid; }
}
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Live search */
.searching { padding: 48px 0; max-width: 60ch; }
.searching .step::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .searching .step::after { animation: none; content: "…"; } }
.notice { font-size: var(--t-sm); color: var(--muted); border-left: 3px solid var(--sprout); padding: 6px 0 6px 12px; margin: 0 0 24px; max-width: 75ch; }
.notice .link { font-size: inherit; }
.stone .ts-name a { color: inherit; }
.sources { margin: 24px 0; font-size: var(--t-sm); }
.sources summary { cursor: pointer; color: var(--green); }
.sources ul { padding-left: 1.2em; columns: 2 280px; }
.tag.warn { background: #f6e3dc; color: var(--warn); }

/* Accounts and saved lists */
.account { display: flex; gap: 20px; align-items: center; }
.auth { max-width: 440px; margin: 0 auto; }
.auth h1 { font-size: var(--t-2xl); margin-bottom: 6px; }
.auth h1:focus { outline: none; }
.auth label { display: block; font-weight: 500; margin: 18px 0 6px; }
.auth input { font-size: var(--t-lg); }
.auth .primary { margin-top: 12px; width: 100%; }
.auth .switch { margin-top: 18px; color: var(--muted); }
.lists { max-width: 900px; margin: 0 auto; }
.lists-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.lists-head h1 { font-size: var(--t-3xl); line-height: 1.1; margin: 0; }
.lists-head h1:focus { outline: none; }
.lists h2 { font-size: var(--t-xl); margin: 32px 0 4px; }
.saved { list-style: none; padding: 0; margin: 0; }
.saved li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.saved .open { font: 400 var(--t-xl) var(--serif); color: var(--ink); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
.saved .open:hover { text-decoration-color: var(--ink); }
.saved .meta { grid-column: 1; color: var(--muted); font-size: var(--t-sm); margin: 0; }
.saved .row-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 14px; }
.pin[aria-pressed="true"] { color: var(--green); font-weight: 600; }
.results-tools { display: flex; gap: 18px; margin-top: 10px; }
@media (max-width: 560px) { .saved li { grid-template-columns: 1fr; } .saved .row-actions { grid-column: 1; grid-row: auto; } .account { gap: 14px; } }
