/* Layout concept: an analyst's research note. Narrow reading column, wide exhibits,
   figures set in a monospaced face like a terminal readout. */
:root {
  --ink: #12202f;
  --ink-soft: #4a5a6b;
  --paper: #fbfcfd;
  --panel: #f1f4f7;
  --rule: #d9e0e7;
  --blue: #3f6c9b;
  --gold: #c9a227;
  --gold-soft: #f6efd6;
  --focus: #3f6c9b;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --font-data: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 68ch;
  --wide: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6ecf2;
    --ink-soft: #a3b1bf;
    --paper: #0e1620;
    --panel: #16212d;
    --rule: #263443;
    --blue: #8fb3d9;
    --gold: #e3c45a;
    --gold-soft: #2a2614;
    --focus: #8fb3d9;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img, svg, iframe { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Header */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-block: 18px;
}
.brand { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--ink-soft); font-weight: 400; }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { border-bottom: 2px solid var(--gold); padding-bottom: 2px; }

/* Type */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; font-family: var(--font-body); letter-spacing: 0; }
p { margin: 0; max-width: var(--measure); }
.eyebrow { font-family: var(--font-data); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.lede { font-size: 1.2rem; color: var(--ink-soft); }
.stack > * + * { margin-top: 1rem; }

section { padding-block: 56px; }
section + section { border-top: 1px solid var(--rule); }

/* Hero */
.hero { padding-block: 72px 56px; }
.hero .stack > * + * { margin-top: 1.25rem; }
.links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.75rem; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 1px solid var(--rule); border-radius: 6px;
  color: var(--ink); text-decoration: none; font-size: 0.95rem; background: var(--paper);
}
.btn:hover { border-color: var(--ink-soft); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Ticker of headline figures */
.ticker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; margin-top: 40px; }
.ticker div { background: var(--paper); padding: 16px 18px; }
.ticker b { display: block; font-family: var(--font-data); font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.ticker span { font-size: 0.85rem; color: var(--ink-soft); }
@media (max-width: 720px) { .ticker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--rule); border-radius: 10px; padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card .tool { font-family: var(--font-data); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.card .tool.tableau { color: var(--blue); }
.card .tool.pbi { color: var(--gold); }
.card p { color: var(--ink-soft); }
.card .finding { border-left: 3px solid var(--gold); padding-left: 12px; color: var(--ink); }
.card .more { margin-top: auto; font-weight: 600; }

/* Project page */
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.25rem; }
.chip { font-family: var(--font-data); font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; background: var(--panel); color: var(--ink-soft); }
.grid-2 { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; gap: 10px; } }
.grid-2 + .grid-2 { margin-top: 40px; }
.label { font-family: var(--font-data); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); padding-top: 6px; }
.body ul, .body ol { margin: 0; padding-left: 1.2rem; max-width: var(--measure); }
.body li + li { margin-top: 0.5rem; }
.findings { list-style: none; padding: 0 !important; counter-reset: f; }
.findings li { counter-increment: f; position: relative; padding-left: 2.4rem; }
.findings li::before { content: counter(f); position: absolute; left: 0; top: 0; font-family: var(--font-data); font-size: 0.85rem; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); color: var(--ink); }
.findings li + li { margin-top: 1rem !important; }
.note { background: var(--panel); border-radius: 8px; padding: 16px 18px; max-width: var(--measure); }

/* Embed */
.embed { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--panel); }
.embed iframe { display: block; width: 100%; border: 0; }
.embed.pbi iframe { aspect-ratio: 16 / 10.4; height: auto; min-height: 420px; }
.embed.tableau { overflow-x: auto; }
.embed-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 0.9rem; color: var(--ink-soft); }

/* Tables and code */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th { font-family: var(--font-data); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; background: var(--panel); }
td.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
.ok { color: #2f7d4f; font-weight: 600; }
@media (prefers-color-scheme: dark) { .ok { color: #7fd1a0; } }
pre { margin: 0; overflow-x: auto; background: var(--panel); border-radius: 8px; padding: 16px 18px; font-family: var(--font-data); font-size: 0.86rem; line-height: 1.55; }
code { font-family: var(--font-data); font-size: 0.9em; }
.measure-name { color: var(--blue); }

/* Diagram */
.diagram { border: 1px solid var(--rule); border-radius: 10px; padding: 16px; overflow-x: auto; }
.diagram svg { display: block; min-width: 640px; width: 100%; height: auto; }
.diagram .box { fill: var(--paper); stroke: var(--ink-soft); stroke-width: 1.2; }
.diagram .box.fact { stroke: var(--gold); stroke-width: 2; }
.diagram .hdr { fill: var(--panel); }
.diagram text { fill: var(--ink); font-family: var(--font-data); font-size: 12px; }
.diagram .t { font-family: var(--font-body); font-weight: 700; font-size: 14px; }
.diagram .k { fill: var(--blue); }
.diagram .link { stroke: var(--ink-soft); stroke-width: 1.4; fill: none; }
.diagram .card-lbl { fill: var(--ink-soft); font-size: 11px; }

/* About */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
@media (max-width: 820px) { .facts { grid-template-columns: 1fr; } }
.fact { border-top: 2px solid var(--ink); padding-top: 12px; }
.fact h3 { margin-bottom: 6px; }
.fact p { color: var(--ink-soft); font-size: 0.97rem; }
.contact-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.copy { font: inherit; font-size: 0.85rem; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); cursor: pointer; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: 0.9rem; }
.site-foot .wrap { padding-block: 28px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .card { transition: border-color 0.15s ease, transform 0.15s ease; }
  .card:hover { border-color: var(--ink-soft); transform: translateY(-2px); }
}
