/* The apartment, in the logo's colours: mauve striped wallpaper up front, the green ledger paper where the
   money is, the night outside for the wire. Same colours the memes use. */
@font-face { font-family: 'Bowlby One'; src: url('fonts/BowlbyOne.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('fonts/CourierPrime.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('fonts/CourierPrime-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --ink: #16151B;
  --wall: #8A6B76;
  --wall-stripe: #7D606B;
  --ledger: #DDE8D3;
  --ledger-rule: #9DBBA6;
  --navy: #1B2440;
  --paper: #F4F1E8;
  --gold: #FFB8CC;
  --red: #C2325A;
  --display: 'Bowlby One', Impact, 'Arial Black', sans-serif;
  --type: 'Courier Prime', 'Courier New', Courier, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 400 1.0625rem/1.6 var(--type); color: var(--ink); background: var(--paper); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.04; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5.2vw, 4.25rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(2.25rem, 5vw, 4rem); }
h3 { font-size: 1.375rem; line-height: 1.2; }
p { margin: 0; max-width: 62ch; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
code { font-family: var(--type); word-break: break-all; }

.skip { position: absolute; left: -999px; top: 0; background: var(--gold); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
main > section { scroll-margin-top: 3.5rem; padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-lede { margin-top: 1rem; }

.btn { display: inline-block; font: 700 1.0625rem/1 var(--type); padding: 1rem 1.375rem; background: var(--gold); color: var(--ink); border: 3px solid var(--ink); border-radius: 0; text-decoration: none; cursor: pointer; box-shadow: 5px 5px 0 var(--ink); }
.btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(5px, 5px); box-shadow: none; }
.btn.quiet { background: var(--paper); }

/* ---- top bar and hero: black, so the painted Don sits in his own dark ------ */
.bar { background: #000; color: #fff; position: sticky; top: 0; z-index: 5; border-bottom: 2px solid #2A2228; }
.top { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; align-items: center; max-width: 72rem; margin: 0 auto; padding: .625rem 1.5rem; }
.top a { text-decoration: none; font-weight: 700; padding: .375rem 0; }
.top a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.top .mark { font-family: var(--display); font-weight: 400; font-size: 1.375rem; margin-right: auto; display: inline-flex; align-items: center; gap: .625rem; }
.top .mark img { border-radius: 50%; }

.hero { background: #000; color: #fff; }
.hero-inner { max-width: 72rem; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 1.5rem clamp(2.5rem, 5vw, 4rem); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2.5rem; align-items: center; }
.lede { margin-top: 1.25rem; font-size: 1.1875rem; max-width: 46ch; }
.promises { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 1.75rem 0 0; padding: 0; font-weight: 700; color: var(--gold); }
.promises li::before { content: '✓ '; }
.portrait { margin: 0; position: relative; }
.portrait img { display: block; width: 100%; height: auto; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.portrait figcaption { position: relative; margin: -3rem 1.5rem 0 0; background: var(--paper); color: var(--ink); border: 3px solid var(--gold); padding: 1rem 1.125rem .875rem; transform: rotate(-1.5deg); }
.portrait figcaption p { font-weight: 700; line-height: 1.4; }
.portrait figcaption span { display: block; margin-top: .5rem; font-size: .875rem; opacity: .7; }

.hero .lookup { margin-top: 2rem; }
.hero .lookup input { border-color: var(--gold); }
.hero .btn { box-shadow: 5px 5px 0 #5A4650; border-color: #000; }
.hero .btn:hover { box-shadow: 3px 3px 0 #5A4650; }
.linkish { margin-top: .875rem; padding: 0; background: none; border: 0; color: var(--gold); font: 700 1rem/1.4 var(--type); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* ---- the wall: the Don's own section -------------------------------------- */
.wall { color: #fff; background: var(--wall) repeating-linear-gradient(90deg, transparent 0 84px, var(--wall-stripe) 84px 128px); }
.don-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 3rem; align-items: center; }
.don-grid img { display: block; width: 100%; height: auto; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); transform: rotate(-1.5deg); }
.wall h2 { text-shadow: 4px 4px 0 var(--ink); }
.cast { margin: 2rem 0 0; display: grid; gap: 0; border-top: 2px solid rgba(255,255,255,.5); }
.cast > div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .625rem 0; border-bottom: 2px solid rgba(255,255,255,.25); }
.cast dt { font-weight: 700; color: var(--gold); }
.cast dd { margin: 0; }

/* ---- tiers, in the chart's own colours --------------------------------------- */
.tiers { background: #4E4446; color: #fff; }
.tiers-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3rem; align-items: start; }
.tiers-grid img { display: block; width: 100%; height: auto; border: 3px solid #2E2729; }
.tier-list { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 2px solid #E2BCC6; }
.tier-list li { display: grid; grid-template-columns: 8rem 1fr auto auto; gap: 1rem; align-items: baseline; padding: .75rem .875rem; border-bottom: 2px solid #6A5D60; }
.tier-list strong { font: 400 1.25rem/1.2 var(--display); color: #E2BCC6; }
.tier-list li.you { background: #E2BCC6; color: var(--ink); border-bottom-color: #E2BCC6; }
.tier-list li.you strong { color: var(--ink); }
.tier-list em { font-style: normal; font-weight: 700; }

/* ---- the books ----------------------------------------------------------- */
.books { background: var(--ledger); color: var(--navy); }
.fresh { font-weight: 700; }
.family { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 2.5rem 0 0; border-top: 4px solid var(--navy); border-bottom: 2px solid var(--navy); }
.family > div { padding: 1.125rem 1rem 1.25rem 0; }
.family > div + div { border-left: 2px solid var(--red); padding-left: 1rem; }
.family dt { font-size: .9375rem; }
.family dd { margin: .375rem 0 0; font: 400 clamp(1.5rem, 3vw, 2.25rem)/1.1 var(--display); color: var(--ink); }
.family dd.words { font: 700 1.0625rem/1.35 var(--type); padding-top: .25rem; }

.lookup { margin-top: 2.5rem; }
.placeholder { border: 3px dashed var(--navy); padding: 1.5rem; font-weight: 700; max-width: none; }
.books-title { margin-top: 4rem; }
.summary { font-size: 1.1875rem; font-weight: 700; color: var(--ink); margin-bottom: 1rem; max-width: 60ch; }
.lookup label { display: block; font-weight: 700; margin-bottom: .5rem; }
.lookup-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.lookup input { flex: 1 1 22rem; min-width: 0; font: 400 1.0625rem/1 var(--type); padding: 1rem; border: 3px solid var(--navy); background: #fff; color: var(--ink); border-radius: 0; }
.hint { margin-top: .75rem; font-size: .9375rem; }
.hint.bad { color: var(--red); font-weight: 700; }

.sheet { margin-top: 0; scroll-margin-top: 5rem; background: #EEF4E8; border: 3px solid var(--navy); padding: 1.75rem clamp(1rem, 3vw, 2rem) 1.5rem; box-shadow: 8px 8px 0 var(--navy); }
.sheet h3 { margin-top: 2rem; color: var(--ink); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.sheet-rank { font: 400 clamp(2rem, 5vw, 3.25rem)/1 var(--display); color: var(--ink); }
.sheet-addr { margin-top: .5rem; font-size: .9375rem; word-break: break-all; }
.sheet-note { margin-top: .25rem; font-size: .9375rem; }
.stamp { width: 4.5rem; flex: none; transform: rotate(12deg); }

.ledger { width: 100%; border-collapse: collapse; margin-top: .75rem; }
.ledger th, .ledger td { border-bottom: 1.5px solid var(--ledger-rule); padding: .625rem 0; text-align: left; font-weight: 400; vertical-align: baseline; }
.ledger td { text-align: right; font-weight: 700; color: var(--ink); padding-left: 1rem; border-left: 0; }
.ledger td small { display: block; font-weight: 400; font-size: .875rem; color: var(--navy); }
.ledger td.empty { text-align: left; font-weight: 400; color: var(--navy); }
.ledger .gain { color: var(--red); }
.deals td:first-child, .deals th { text-align: left; }
.fine { margin-top: 1rem; font-size: .9375rem; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; margin-top: 3.5rem; }
.two h3 { color: var(--ink); }

/* ---- how the cut works ----------------------------------------------------- */
.cut { background: var(--paper); }
.steps { list-style: none; counter-reset: step; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.steps li { counter-increment: step; border-top: 4px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); font: 400 3.5rem/1 var(--display); color: var(--red); display: block; margin-bottom: .5rem; }
.steps p { margin-top: .5rem; }
.aside { margin-top: 2.5rem; padding-left: 1.25rem; border-left: 4px solid var(--red); }

/* ---- the coin right now ------------------------------------------------------------ */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 2rem 0 0; border-top: 4px solid var(--ink); }
.tiles > div { padding: 1.125rem 1rem 1.25rem 0; border-bottom: 2px solid #CFCABB; }
.tiles > div:not(:nth-child(3n + 1)) { padding-left: 1rem; border-left: 2px solid #CFCABB; }
.tiles dt { font-size: .9375rem; }
.tiles dd { margin: .375rem 0 0; font: 400 clamp(1.5rem, 3vw, 2.125rem)/1.1 var(--display); color: var(--ink); }
.tiles dd.words { font: 700 1.0625rem/1.35 var(--type); padding-top: .25rem; }
.tiles p { margin-top: .375rem; font-size: .875rem; color: #5B5560; }
.sources { margin-top: 1.5rem; max-width: 52rem; }
.sources summary { cursor: pointer; font-weight: 700; padding: .5rem 0; }
.sources .plain { margin-top: .5rem; }
.facts-title { margin-top: 3rem; font-size: 1.75rem; }
.tier-list .count { justify-self: end; font-weight: 700; }

/* ---- questions ------------------------------------------------------------------ */
.faq-title { margin-top: 3.5rem; font-size: 1.75rem; }
.faq { margin-top: 1rem; border-top: 3px solid var(--ink); max-width: 48rem; }
.faq details { border-bottom: 2px solid var(--ink); }
.faq summary { cursor: pointer; font-weight: 700; padding: 1rem 2rem 1rem 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: .25rem; top: .75rem; font: 400 1.5rem/1 var(--display); color: var(--red); }
.faq details[open] summary::after { content: '–'; }
.faq details p { padding: 0 0 1.25rem; }

/* ---- the wire ---------------------------------------------------------------- */
.wire { background: var(--navy); color: var(--paper); }
.feed { margin-top: 2.5rem; columns: 3 18rem; column-gap: 1.5rem; }
.post { break-inside: avoid; margin: 0 0 1.5rem; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); }
.post img { display: block; width: 100%; height: auto; border-bottom: 3px solid var(--ink); }
.post p { padding: 1rem 1rem 0; font-weight: 700; line-height: 1.45; }
.post time { display: block; padding: .5rem 1rem 1rem; font-size: .875rem; opacity: .7; }
.feed .empty { font-style: italic; }
.follow { margin-top: 1rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.follow a { font-weight: 700; }

/* ---- the facts ------------------------------------------------------------------ */
.facts { background: var(--paper); border-top: 14px solid var(--ink); }
.plain { width: 100%; border-collapse: collapse; margin-top: 2rem; }
.plain th, .plain td { text-align: left; vertical-align: top; padding: .875rem 0; border-bottom: 1.5px solid #CFCABB; }
.plain th { width: 11rem; padding-right: 1rem; }
.plain td { font-weight: 400; }
.copy { font: 700 .875rem/1 var(--type); padding: .375rem .625rem; margin-left: .5rem; border: 2px solid var(--ink); background: var(--gold); cursor: pointer; }
.links { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem 2rem; max-width: none; }
.links a { font-weight: 700; }
.straight { margin-top: 3rem; border: 3px solid var(--ink); padding: 1.5rem; background: #fff; max-width: 46rem; }
.straight p { margin-top: .75rem; }

.foot { background: #000; color: var(--paper); padding: 0 1.5rem 2.5rem; text-align: center; }
.foot img { display: block; width: 100%; max-width: 40rem; height: auto; margin: 0 auto; }
.foot p { margin: 0 auto; }

@media (max-width: 56rem) {
  .hero-inner, .don-grid, .tiers-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 24rem; margin: 0 auto; }
  .portrait figcaption { margin-right: 0; }
  .don-grid img { max-width: 22rem; margin: 0 auto; }
  .family { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .family > div:nth-child(n+3) { border-top: 2px solid var(--navy); }
  .two, .steps { grid-template-columns: 1fr; }
  .plain th { width: 7.5rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles > div:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .tiles > div:nth-child(2n) { padding-left: 1rem; border-left: 2px solid #CFCABB; }
}
@media (max-width: 30rem) {
  .bar { position: static; }
  .top .mark { flex-basis: 100%; }
  .portrait { max-width: 15rem; }
  .tier-list li { grid-template-columns: 6rem 1fr auto; gap: .5rem; padding: .75rem .5rem; }
  .tier-list span:not(.count) { font-size: .875rem; }
  .tier-list strong { font-size: 1.0625rem; }
  .tier-list em { grid-column: 1 / -1; }
  .cast > div { grid-template-columns: 1fr; gap: 0; }
  .lookup-row .btn { width: 100%; }
  .top a:not(.mark) { font-size: .9375rem; }
  .ledger th, .ledger td { display: block; text-align: left; padding-left: 0; }
  .ledger th { border-bottom: 0; padding-bottom: 0; }
  .plain th, .plain td { display: block; width: auto; }
  .plain th { border-bottom: 0; padding-bottom: 0; font-weight: 700; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .btn:active { transform: none; }
}
