/* Keel Investment Research — house styles
   Kept deliberately plain. If you add something, add it at the bottom. */

:root {
  --paper: #faf8f3;
  --ink: #1b1b1b;
  --ink-soft: #4a4a48;
  --muted: #7a776f;
  --rule: #d9d4c7;
  --rule-dark: #1b1b1b;
  --accent: #8a2a1c;      /* oxblood, used sparingly */
  --navy: #1f3347;
  --tag-bg: #efe9dc;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

.sans { font-family: "Inter", "Helvetica Neue", Arial, sans-serif; }

/* ---------- top utility bar ---------- */
.utility {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}
.utility .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 7px; padding-bottom: 7px; }
.utility a { color: var(--ink-soft); }
.utility .right a + a { margin-left: 14px; }

/* ---------- masthead ---------- */
.masthead { text-align: center; padding: 26px 0 14px; }
.masthead .name {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: -0.5px;
  line-height: 1;
  margin: 0;
}
.masthead .tagline {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 15px;
  margin-top: 8px;
}
.masthead .edition {
  font-family: "Inter", Arial, sans-serif;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-top: 12px;
}

nav.sections {
  border-top: 3px double var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
  font-family: "Inter", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
}
nav.sections ul {
  list-style: none; margin: 0; padding: 9px 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px;
}
nav.sections a.on { color: var(--accent); }

/* ---------- breaking strip ---------- */
.strip {
  font-family: "Inter", Arial, sans-serif;
  font-size: 13.5px;
  border-bottom: 1px solid var(--rule);
  padding: 9px 0;
}
.strip b {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 1px;
  margin-right: 8px;
}

/* ---------- generic bits ---------- */
.kicker {
  font-family: "Inter", Arial, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}
.byline {
  font-family: "Inter", Arial, sans-serif;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}
.byline strong { color: var(--ink-soft); font-weight: 600; }

h1, h2, h3 { font-weight: 700; margin: 0; letter-spacing: -0.2px; }

.section-head {
  font-family: "Inter", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  border-top: 2px solid var(--rule-dark);
  padding-top: 8px;
  margin: 0 0 16px;
}

/* ---------- front page grid ---------- */
.front {
  display: grid;
  grid-template-columns: 1fr 2.1fr 1fr;
  gap: 0;
  padding: 26px 0 10px;
}
.front > * { padding: 0 22px; }
.front > *:first-child { padding-left: 0; }
.front > *:last-child { padding-right: 0; }
.front .col-left, .front .col-mid { border-right: 1px solid var(--rule); }

.lead h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.12;
}
.lead .dek { font-size: 19px; color: var(--ink-soft); margin: 12px 0 0; line-height: 1.45; }
.lead figure { margin: 18px 0 0; }
.lead figcaption, figure figcaption {
  font-family: "Inter", Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.story { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); }
.story:last-child { border-bottom: 0; }
.story h3 { font-size: 19px; line-height: 1.25; }
.story p { margin: 7px 0 0; font-size: 15.5px; color: var(--ink-soft); }

/* photo placeholders: drawn, not stock */
.plate {
  display: block;
  width: 100%;
  background: #d8d2c4;
  border: 1px solid #c9c2b2;
}

/* ---------- briefing list ---------- */
.briefs { list-style: none; padding: 0; margin: 0; }
.briefs li { padding: 10px 0; border-bottom: 1px dotted var(--rule); font-size: 15px; line-height: 1.4; }
.briefs li:first-child { padding-top: 0; }
.briefs time {
  font-family: "Inter", Arial, sans-serif;
  font-size: 11.5px;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}

/* ---------- key facts box ---------- */
.factbox {
  background: var(--tag-bg);
  padding: 14px 16px;
  margin-top: 22px;
  font-family: "Inter", Arial, sans-serif;
  font-size: 13px;
}
.factbox h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.factbox dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; }
.factbox dt { color: var(--muted); }
.factbox dd { margin: 0; }

/* ---------- second band ---------- */
.band { padding: 28px 0 8px; border-top: 1px solid var(--rule-dark); }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.three .story { border-bottom: 0; }

/* ---------- analysis band ---------- */
.analysis {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  padding: 28px 0;
  border-top: 1px solid var(--rule-dark);
}
.analysis blockquote {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 24px;
  line-height: 1.3;
  border-left: 3px solid var(--accent);
  padding-left: 18px;
}
.analysis .attrib { font-family: "Inter", Arial, sans-serif; font-size: 12.5px; color: var(--muted); margin-top: 10px; padding-left: 21px; }

table.tracker {
  width: 100%;
  border-collapse: collapse;
  font-family: "Inter", Arial, sans-serif;
  font-size: 13px;
}
table.tracker th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  border-bottom: 1px solid var(--rule-dark);
  padding: 6px 6px 6px 0;
}
table.tracker td { border-bottom: 1px solid var(--rule); padding: 8px 6px 8px 0; vertical-align: top; }
.status { font-weight: 600; white-space: nowrap; }
.status.go { color: #2f5d34; }
.status.wait { color: #8a6a12; }
.status.stop { color: var(--accent); }

/* ---------- newsletter ---------- */
.signup {
  border: 1px solid var(--rule-dark);
  padding: 22px;
  margin: 10px 0 34px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: center;
}
.signup h3 { font-family: "Playfair Display", Georgia, serif; font-size: 22px; }
.signup p { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; }
.signup form { display: flex; gap: 8px; }
.signup input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 9px 10px;
  border: 1px solid #9c978b;
  background: #fff;
}
.signup button {
  font-family: "Inter", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 0 16px;
  cursor: pointer;
}
.signup .note { font-family: "Inter", Arial, sans-serif; font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ---------- footer ---------- */
footer {
  border-top: 3px double var(--rule-dark);
  padding: 26px 0 40px;
  font-family: "Inter", Arial, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
}
footer .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 24px; }
footer h5 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink); }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 5px; }
footer .fine { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 11.5px; color: var(--muted); line-height: 1.6; }
footer .brand { font-family: "Playfair Display", Georgia, serif; font-size: 22px; color: var(--ink); font-weight: 700; }

/* ---------- article page ---------- */
.article { max-width: 700px; margin: 0 auto; padding: 34px 0 20px; }
.article h1 { font-family: "Playfair Display", Georgia, serif; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; }
.article .dek { font-size: 20px; color: var(--ink-soft); margin: 14px 0 0; line-height: 1.45; }
.article .meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 10px 0; margin: 20px 0 24px;
  font-family: "Inter", Arial, sans-serif; font-size: 12.5px; color: var(--muted);
}
.article .meta strong { color: var(--ink); }
.article figure { margin: 0 0 26px; }
.body p { margin: 0 0 18px; font-size: 18.5px; line-height: 1.65; }
.body > p:first-of-type::first-letter {
  font-family: "Playfair Display", Georgia, serif;
  float: left; font-size: 64px; line-height: .9; padding: 6px 8px 0 0; font-weight: 700;
}
.body h2 { font-size: 22px; margin: 32px 0 12px; }
.body .aside {
  float: right; width: 240px; margin: 4px 0 16px 24px;
  border-top: 2px solid var(--rule-dark); padding-top: 8px;
  font-family: "Inter", Arial, sans-serif; font-size: 13.5px; line-height: 1.5;
}
.body .aside h4 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; }
.body .aside ul { margin: 0; padding-left: 16px; }
.body .aside li { margin-bottom: 6px; }
.correction {
  font-family: "Inter", Arial, sans-serif; font-size: 13px; font-style: italic; color: var(--ink-soft);
  border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 30px;
}
.tags { margin-top: 18px; font-family: "Inter", Arial, sans-serif; font-size: 12px; }
.tags a { display: inline-block; background: var(--tag-bg); padding: 3px 8px; margin: 0 6px 6px 0; }
.related { max-width: 700px; margin: 0 auto 30px; }

/* ---------- stock bar + chart ---------- */
.quote {
  border-bottom: 1px solid var(--rule);
  font-family: "Inter", Arial, sans-serif;
  font-size: 13px;
  padding: 10px 0;
}
.quote .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; }
.quote .sym { font-weight: 700; letter-spacing: .5px; }
.quote .px { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.quote .dn { color: var(--accent); font-weight: 600; }
.quote .up { color: #2f5d34; font-weight: 600; }
.quote .asof { font-size: 11px; color: var(--muted); }
.quote .stat { color: var(--ink-soft); }
.quote .stat b { color: var(--ink); font-weight: 600; }

.chartbox { margin-top: 22px; }
.chartbox svg { width: 100%; height: auto; display: block; }
.chartbox .cap { font-family: "Inter", Arial, sans-serif; font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.src { font-family: "Inter", Arial, sans-serif; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.src a { text-decoration: underline; }
.body a { text-decoration: underline; }

/* ---------- portfolio page ---------- */
.sample-banner {
  background: #f3e3c8; border-bottom: 1px solid #d8c29a;
  font-family: "Inter", Arial, sans-serif; font-size: 13px; text-align: center; padding: 8px 16px;
}
.score {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--rule-dark); margin-top: 26px;
}
.score > div { padding: 4px 22px 22px; border-right: 1px solid var(--rule); }
.score > div:first-child { padding-left: 0; }
.score > div:last-child { border-right: 0; padding-right: 0; }
.score .label { font-family: "Inter", Arial, sans-serif; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.score .big { font-family: "Playfair Display", Georgia, serif; font-size: clamp(34px, 5vw, 50px); font-weight: 700; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.score .sub { font-family: "Inter", Arial, sans-serif; font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.pos { color: #2f5d34; }
.neg { color: var(--accent); }

.headline-verdict { font-family: "Playfair Display", Georgia, serif; font-size: clamp(24px, 3vw, 32px); line-height: 1.2; margin: 24px 0 6px; }

.perf { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; padding: 26px 0; }
.legend { font-family: "Inter", Arial, sans-serif; font-size: 12.5px; color: var(--ink-soft); display: flex; gap: 18px; margin-bottom: 6px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }

.alloc { display: flex; height: 22px; border: 1px solid var(--rule-dark); margin-bottom: 10px; }
.alloc span { display: block; height: 100%; border-right: 1px solid var(--paper); }
.alloc span:last-child { border-right: 0; }
.alloc-key { list-style: none; margin: 0; padding: 0; font-family: "Inter", Arial, sans-serif; font-size: 13px; }
.alloc-key li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dotted var(--rule); }
.alloc-key b { display: inline-block; width: 10px; height: 10px; margin-right: 8px; }

.holdings-wrap { overflow-x: auto; }
table.tracker td.num, table.tracker th.num { text-align: right; font-variant-numeric: tabular-nums; }

.journal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.score { grid-template-columns: repeat(4, 1fr); }
/* ---------- us vs. S&P chart (after Wealthsimple's comparison chart) ---------- */
.compare { padding: 6px 0 10px; }
.cmp-chart { position: relative; margin: 18px 0 6px; }
#chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.cmp-tip {
  position: absolute; top: 0; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font-family: "Inter", Arial, sans-serif; font-size: 12px;
  padding: 5px 8px; white-space: nowrap; pointer-events: none;
}
.cmp-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; border-top: 1px solid var(--rule); padding-top: 14px; }
.cmp-legend .who { font-family: "Inter", Arial, sans-serif; font-size: 13.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.cmp-legend .big { font-family: "Playfair Display", Georgia, serif; font-size: clamp(38px, 6vw, 56px); font-weight: 700; line-height: 1.05; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cmp-legend .sub { font-family: "Inter", Arial, sans-serif; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dash-key { display: inline-block; width: 18px; height: 0; border-top: 2px dashed #1f3347; flex: none; }
.cmp-note { margin-top: 12px; }

/* time-range dropdown, styled to read as text with a caret */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ranges { display: flex; font-family: "Inter", Arial, sans-serif; }
.cmp-range-row { border-top: 1px solid var(--rule); padding-top: 12px; }
.cmp-range-row + .cmp-legend { border-top: 0; padding-top: 4px; }
#donut-ranges { justify-content: center; margin: 4px 0 2px; }
.range-pick { position: relative; display: inline-block; }
table.tracker tr.total-row td { border-top: 1.5px solid var(--rule-dark); border-bottom: 0; }
.range-pick select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1.5px solid var(--ink);
  padding: 4px 22px 3px 0; cursor: pointer; border-radius: 0;
}
.range-pick::after {
  content: ""; position: absolute; right: 4px; top: 50%; margin-top: -4px;
  width: 6px; height: 6px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg); pointer-events: none;
}
.range-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.score.score3 { grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-top: 1px solid var(--rule-dark); }
.score3 > div { padding-top: 14px; }
#deposits { width: 100%; max-width: 300px; height: auto; display: block; margin-top: 10px; }

@media (max-width: 680px) {
  .cmp-legend { gap: 12px; }
  .score.score3 { grid-template-columns: 1fr; }
}

/* donut */
.donut-wrap { display: flex; flex-direction: column; align-items: center; padding: 10px 0 30px; }
.donut-box { position: relative; width: min(380px, 100%); }
.donut-box svg { width: 100%; height: auto; display: block; }
.donut-box path { cursor: pointer; transition: opacity .15s; }
.donut-wrap.hovering .donut-box path:not(.on) { opacity: .25; }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; padding: 0 26%;
}
.donut-center .dc-label { font-family: "Inter", Arial, sans-serif; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.donut-center .dc-big { font-family: "Inter", Arial, sans-serif; letter-spacing: -1.2px; font-size: clamp(30px, 8vw, 42px); font-weight: 700; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.donut-center .dc-sub { font-family: "Inter", Arial, sans-serif; font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.donut-key {
  list-style: none; margin: 22px 0 0; padding: 0; width: 100%; max-width: 860px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 18px;
  font-family: "Inter", Arial, sans-serif; font-size: 13px;
}
.donut-key li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px dotted var(--rule); cursor: pointer; }
.donut-key li b { width: 10px; height: 10px; flex: none; }
.donut-key li .w { margin-left: auto; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.donut-key li .r { width: 54px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.donut-key { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.donut-wrap.hovering .donut-key li:not(.on) { opacity: .35; }

.linkbtn { background: none; border: 0; padding: 10px 0 0; font-family: "Inter", Arial, sans-serif; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
a.more { font-family: "Inter", Arial, sans-serif; font-size: 12.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }

.about-grid { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }
.about-grid p { margin: 12px 0 0; max-width: 620px; }
img.founders { width: 100%; height: auto; display: block; border: 1px solid var(--rule); filter: saturate(.9); }

.research .body ul:not(.briefs) { padding-left: 20px; margin: 0 0 8px; }
.research .body ul:not(.briefs) li { font-size: 17.5px; line-height: 1.55; margin-bottom: 10px; }
.research .body > h2:first-of-type { margin-top: 0; }

/* ---------- smaller screens ---------- */
@media (max-width: 960px) {
  .front { grid-template-columns: 1fr 1fr; }
  .front .col-mid { grid-column: 1 / -1; order: -1; border-right: 0; padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--rule); }
  .front .col-left { padding-left: 0; }
  .front .col-right { padding-right: 0; }
  footer .cols { grid-template-columns: 1fr 1fr; }
  .score { grid-template-columns: 1fr 1fr; }
  .score > div:nth-child(2) { border-right: 0; padding-right: 0; }
  .score > div:nth-child(3) { padding-left: 0; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .utility .left { display: none; }
  .utility .wrap { justify-content: center; }
  .front { grid-template-columns: 1fr; }
  .front > * { padding: 0 !important; border-right: 0 !important; }
  .front .col-left { border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
  .three, .analysis, .signup, .perf, .journal { grid-template-columns: 1fr; }
  .score { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .score > div { padding: 4px 0 16px !important; border-right: 0; border-bottom: 1px solid var(--rule); }
  .score > div:last-child { border-bottom: 0; }
  .signup form { flex-direction: column; }
  .signup button { padding: 10px; }
  nav.sections ul { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; padding-left: 2px; }
  .body .aside { float: none; width: auto; margin: 0 0 20px; }
  .body p { font-size: 17.5px; }
}
