/* THE SUCCESS EQUATION — letterpress poster system, after the HBR Press cover */

:root {
  --paper: #f4ecd8;
  --paper-deep: #eadfc2;
  --ink: #1d1a16;
  --ink-soft: #57503f;
  --rule: #cfc3a2;
  --red: #c1272d;
  --red-deep: #9c1b20;
  --gold: #d9a404;
  /* marble series — validated on --paper (CVD ΔE 17 worst adjacent pair) */
  --m-red: #c0392b;
  --m-black: #2b2620;
  --m-yellow: #d9a404;
  --m-green: #12813f;
  --m-blue: #2563a8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Libre Franklin", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: .45;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.display { font-family: "Ultra", serif; font-weight: 400; }
.caps { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: .12em; }

a { color: var(--red-deep); }
a:hover { color: var(--red); }

/* ---------- masthead ---------- */
.top-strip {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .3em;
  font-size: .6rem;
  padding: .45em 1em .4em;
}

.masthead {
  border-bottom: 4px double var(--ink);
  background: var(--paper);
}
.masthead-inner {
  width: min(1060px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.1rem 0 .9rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.brand {
  font-family: "Ultra", serif;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand .dollar { color: var(--red); }
.brand:hover { color: var(--ink); }

nav.site {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .72rem;
}
nav.site a { color: var(--ink-soft); text-decoration: none; padding-bottom: .1em; }
nav.site a:hover { color: var(--red-deep); }
nav.site a.here { color: var(--red-deep); border-bottom: 2px solid var(--red); }

/* ---------- page scaffold ---------- */
main {
  width: min(1060px, calc(100% - 2.5rem));
  margin: 0 auto;
  flex: 1;
  padding: 2.6rem 0 4rem;
}

.page-head { margin-bottom: 2rem; max-width: 46em; }
.eyebrow {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .68rem;
  color: var(--red-deep);
  margin-bottom: .5rem;
}
h1.page-title {
  font-family: "Ultra", serif;
  font-weight: 400;
  font-size: clamp(2rem, 5.4vw, 3.1rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}
.lede { color: var(--ink-soft); max-width: 42em; }
.lede + .lede { margin-top: .8em; }
.lede a { color: var(--red-deep); }

/* ---------- panels / cards ---------- */
.panel {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(29,26,22,.18);
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 2px solid var(--ink);
  padding: .55rem 1rem;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .66rem;
  color: var(--ink-soft);
  background: var(--paper-deep);
}
.panel-body { padding: 1.3rem 1rem; }

/* ---------- controls ---------- */
label.field {
  display: block;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .66rem;
  color: var(--ink-soft);
  margin-bottom: .9rem;
}
label.field input {
  display: block;
  width: 100%;
  margin-top: .35em;
  font-family: "Libre Franklin", sans-serif;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  padding: .45em .6em;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fbf6e9;
  color: var(--ink);
}
label.field input:focus { outline: 2px solid var(--red); outline-offset: 1px; }

.btn {
  display: inline-block;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  background: var(--red);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: .7em 1.6em;
  cursor: pointer;
  text-decoration: none;
  transition: transform .07s ease, box-shadow .07s ease, background .15s ease;
}
.btn:hover { background: var(--red-deep); color: var(--paper); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.ghost:hover { background: var(--paper-deep); }

.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  font-family: "Oswald", sans-serif;
  font-size: .78rem;
  letter-spacing: .1em;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: .35em .85em;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.chip.on { background: var(--ink); color: var(--paper); }
.chip:hover:not(.on) { background: var(--paper-deep); }

/* ---------- stat tiles ---------- */
.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat {
  flex: 1 1 8rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: .8rem .9rem .7rem;
  box-shadow: 4px 4px 0 rgba(29,26,22,.15);
}
.stat .k {
  display: block;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .6rem;
  color: var(--ink-soft);
}
.stat .v {
  display: block;
  font-family: "Ultra", serif;
  font-size: 1.9rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat.hero { background: var(--red); border-color: var(--ink); }
.stat.hero .k { color: rgba(244,236,216,.8); }
.stat.hero .v { color: var(--paper); }

/* ---------- tables ---------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
table.data th, table.data td { padding: .45em .7em; text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .62rem;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  font-weight: 500;
}
table.data td { border-bottom: 1px solid var(--rule); }
table.data tr.above td { font-weight: 700; }

/* swatch dot used in legends and tables */
.dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  margin-right: .45em;
  vertical-align: -1px;
  border: 1px solid rgba(29,26,22,.35);
}

.legend {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--ink-soft);
  margin: .6rem 0 .2rem;
}

/* ---------- chart svg ---------- */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  font-size: .72rem;
  line-height: 1.5;
  padding: .5em .7em;
  border: 1px solid var(--paper-deep);
  box-shadow: 3px 3px 0 rgba(29,26,22,.3);
  white-space: nowrap;
  z-index: 10;
  display: none;
  font-variant-numeric: tabular-nums;
}

/* ---------- footer ---------- */
footer.site {
  border-top: 4px double var(--ink);
  background: var(--paper-deep);
}
.footer-inner {
  width: min(1060px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.4rem 0 1.6rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: .72rem;
  color: var(--ink-soft);
}
footer.site a { color: var(--ink-soft); }
footer.site a:hover { color: var(--red-deep); }

/* ---------- helpers ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(15rem, 20rem) 1fr; gap: 1.6rem; align-items: start; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.note { font-size: .78rem; color: var(--ink-soft); margin-top: .9rem; }
.note em { color: var(--red-deep); font-style: normal; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
