/* Clean, report-like portfolio: white page, black type, thin rules, one restrained accent. */
:root {
  --bg: #ffffff;
  --soft: #f5f5f3;
  --text: #121212;
  --muted: #5f6368;
  --line: #e2e2df;
  --rule: #121212;
  --accent: #b3261e;
  --dark: #0b0b0b;
  --max: 1080px;
  --col: 760px;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.7 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* nav */
nav { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
nav .wrap { display: flex; justify-content: space-between; align-items: center; height: 56px; }
nav .brand { font-weight: 600; text-decoration: none; }
nav .links a { text-decoration: none; color: var(--muted); margin-left: 24px; font-size: 15px; }
nav .links a:hover { color: var(--text); }

/* home header */
.hero { padding: 88px 0 56px; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.hero h1 { font-size: clamp(40px, 6.5vw, 64px); font-weight: 600; line-height: 1.05; letter-spacing: -.025em; margin: 0 0 20px; }
.hero .lead { font-size: 20px; color: var(--text); max-width: 640px; margin: 0 0 16px; }
.hero .skills { font: 500 14px/1.6 var(--mono); color: var(--muted); margin: 0; }

/* section heading with a strong rule, like a report chapter */
.section-title { display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px solid var(--rule); padding-top: 14px; margin: 0; }
.section-title h2 { margin: 0; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.section-title span { font: 500 13px var(--mono); color: var(--muted); }

/* project list */
.plist { list-style: none; margin: 0 0 96px; padding: 0; }
.plist li { border-bottom: 1px solid var(--line); }
.prow { display: grid; grid-template-columns: 56px 1fr 280px; gap: 24px; align-items: start;
  padding: 28px 0; text-decoration: none; }
.pnum { font: 500 14px/28px var(--mono); color: var(--accent); }
.pbody h3 { margin: 0 0 6px; font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.ptags { margin: 0 0 10px; font: 500 13px/1.5 var(--mono); color: var(--muted); }
.pres { margin: 0; font-size: 15.5px; color: var(--text); max-width: 520px; }
.pthumb { aspect-ratio: 16 / 10; background: var(--dark); border: 1px solid var(--line); overflow: hidden; }
.pthumb.light { background: #fff; }
.pthumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s; }
a.prow:hover h3 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
a.prow:hover .pthumb img { transform: scale(1.03); }
.pthumb.hatch { display: grid; place-items: center; background: repeating-linear-gradient(135deg, #fff 0 9px, var(--soft) 9px 18px); }
.pthumb.hatch span { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  background: #fff; border: 1px solid var(--line); padding: 8px 12px; }
.prow.soon .pres { color: var(--muted); }

footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* project page header */
.p-hero { padding: 64px 0 32px; border-bottom: 2px solid var(--rule); margin-bottom: 40px; }
.p-hero h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 600; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 14px; max-width: 900px; }
.p-hero .sub { font: 500 14px/1.5 var(--mono); color: var(--muted); margin: 0; }
.cover { background: var(--dark); border: 1px solid var(--line); margin-bottom: 40px; }
.cover.light { background: #fff; }
.cover img { margin: 0 auto; max-height: 560px; object-fit: contain; }

/* key results strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 0 24px; }
.stat { padding: 20px 20px 18px 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.stat span { color: var(--muted); font-size: 14px; }

/* article: text in a readable column; figures, tables and comparisons can go wider */
.article { max-width: var(--max); margin: 0 auto; padding-bottom: 72px; counter-reset: sec; }
.article > :is(p, h2, h3, ul, .eq, .flow, .refs) {
  max-width: var(--col); margin-left: auto !important; margin-right: auto !important;
}
.article h2 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; margin: 56px 0 14px; }
.article h3 { font-size: 19px; font-weight: 600; margin: 36px 0 10px; }
.article > h2 { counter-increment: sec; counter-reset: sub; }
.article > h3 { counter-increment: sub; }
.article > h2::before { content: counter(sec); font: 500 .8em var(--mono); color: var(--accent); margin-right: 14px; }
.article > h3::before { content: counter(sec) "." counter(sub); font: 500 .8em var(--mono); color: var(--accent); margin-right: 12px; }
.article p { margin: 0 0 18px; }
.article ul { padding-left: 20px; }
.article li { margin-bottom: 6px; }
.eq { font: 15px/1.7 var(--mono); background: var(--soft); border-left: 2px solid var(--accent); padding: 12px 18px; margin: 0 0 18px; }

/* figures */
figure { margin: 28px auto; max-width: 900px; }
figure img { border: 1px solid var(--line); background: #fff; margin: 0 auto; }
figure.dark img { background: var(--dark); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; text-align: center; }
figure.wide { max-width: none; }

/* side-by-side images: identical boxes so pairs always line up */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.pair figure { margin: 0; max-width: none; display: flex; flex-direction: column; }
.pair figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; padding: 8px; }
.compare { margin: 28px 0; }
.compare .head { display: none; }
.compare .pair { margin: 0; }
.compare figure::before { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.compare figure:first-child::before { content: "Literature"; }
.compare figure:last-child::before { content: "CFD"; }
.compare .row-label { font-weight: 600; font-size: 15px; margin: 28px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.compare .row-label:first-of-type { border-top: 0; padding-top: 0; }

/* charts (rebuilt from the Word charts as inline SVG) */
.chart { --s1: #2a78d6; --s2: #eb6834; max-width: var(--col); border: 1px solid var(--line); padding: 20px 20px 14px; }
.chart-title { font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.chart-sub { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 0 4px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-scroll { overflow-x: auto; }
.chart svg { display: block; width: 100%; min-width: 460px; height: auto; font-family: "IBM Plex Sans", sans-serif; }
.chart-grid svg { min-width: 290px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .axl { fill: var(--muted); font-size: 13px; }
.chart .lbl { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart text.eq { fill: var(--text); font: 500 13px var(--mono); background: none; border: 0; padding: 0; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.thin { stroke-width: 1.5; opacity: .75; }
.chart .ln.s1 { stroke: var(--s1); } .chart .ln.s2 { stroke: var(--s2); }
.chart .dot { stroke: #fff; stroke-width: 2; cursor: default; }
.chart .dot.s1 { fill: var(--s1); } .chart .dot.s2 { fill: var(--s2); }
.chart .dot:hover { r: 6.5; }
.chart .ring { fill: none; stroke: var(--text); stroke-width: 1.5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend i.s1 { background: var(--s1); } .legend i.s2 { background: var(--s2); }
.legend i.line { width: 18px; height: 2px; border-radius: 1px; }

/* tables: booktabs style (heavy top/bottom rule, light row lines) */
.table-wrap { overflow-x: auto; margin: 8px auto 26px; max-width: var(--col);
  border-top: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule); }
.table-wrap.wide { max-width: none; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
th { white-space: normal; font-weight: 600; border-bottom: 1px solid var(--rule); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* workflow diagram: equal-width boxes stacked vertically with arrows between */
.flow { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 0 28px; }
.flow span { width: min(320px, 100%); padding: 10px 14px; border: 1px solid var(--rule); font-size: 15px; text-align: center; }
.flow i { color: var(--accent); font-style: normal; line-height: 1; }
.refs { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 8px; }
.refs p { font-size: 14px; color: var(--muted); }
.refs a { word-break: break-all; }

.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 2px solid var(--rule); padding: 24px 0 64px; }
.pager a { text-decoration: none; max-width: 48%; }
.pager a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.pager small { display: block; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.pager b { font-size: 17px; font-weight: 600; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding: 56px 0 40px; }
  .prow { grid-template-columns: 36px 1fr; gap: 10px 14px; padding: 22px 0; }
  .pthumb { grid-column: 2; }
  .pair, .chart-grid { grid-template-columns: 1fr; }
  .chart { padding: 16px 12px 12px; }
  .stat, .stat + .stat { padding: 14px 12px 12px 0; border-left: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  nav .links a { margin-left: 14px; }
}
