/* Portfolio pages. Plain words, measured contrast (text on ground 7:1 or better in both themes), nothing behind text. */
:root {
  --bg: #fbfaf7; --panel: #ffffff; --fg: #1a1a1a; --muted: #474747; --line: #c9c6bd; --link: #0b4a8f; --mark: #7a3b00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121416; --panel: #1b1e21; --fg: #f1f0ea; --muted: #c6c5be; --line: #4a4e52; --link: #a5cdff; --mark: #ffc98a; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 18px/1.6 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 44rem; margin: 0 auto; padding: 2.5rem max(16px, env(safe-area-inset-right, 0px)) 4rem max(16px, env(safe-area-inset-left, 0px)); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 2.9rem); }
h2 { font-size: 1.5rem; margin-top: 2.75rem; padding-top: 1.25rem; border-top: 2px solid var(--fg); }
h3 { font-size: 1.15rem; margin-top: 1.5rem; }
p { margin: 0.8rem 0 0; }
.role { font-size: 1.15rem; color: var(--mark); font-weight: 600; margin-top: 0.4rem; }
.lede { font-size: 1.2rem; margin-top: 1.25rem; }
.muted { color: var(--muted); }
a { color: var(--link); text-underline-offset: 0.15em; }
a:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
ul, ol { margin: 0.8rem 0 0; padding-left: 1.3rem; }
li { margin-top: 0.45rem; }
.work { list-style: none; padding: 0; margin: 1rem 0 0; }
.work li { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem; margin-top: 0.9rem; }
.work h3 { margin-top: 0; }
.work .kind { font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.table { overflow-x: auto; margin-top: 1rem; }
table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
th { font-weight: 700; border-bottom: 2px solid var(--fg); }
td:first-child { white-space: nowrap; font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.9rem; margin-top: 1rem; }
.facts div { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 0.9rem; min-width: 0; }
.facts b { display: block; font-family: Georgia, serif; font-size: 1.5rem; line-height: 1.2; }
.back { display: inline-block; margin-bottom: 1.5rem; }
footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-bottom: 2rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); font-weight: 600; }
.flow { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.9rem; counter-reset: step; }
.flow li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--fg); border-radius: 6px; padding: 0.7rem 0.9rem; margin: 0; min-width: 0; font-size: 0.95rem; }
.flow b { display: block; font-family: Georgia, serif; font-size: 1.2rem; }
.flow b::before { content: counter(step) ". "; color: var(--mark); }
.tight li { margin-top: 0.25rem; }
.resume h2 { margin-top: 1.6rem; padding-top: 0.8rem; font-size: 1.25rem; }
.resume h3 { margin-top: 0.9rem; font-size: 1.05rem; }
.resume p { margin-top: 0.35rem; }
.chart { margin: 1.2rem 0 0; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.chart figcaption { font-weight: 700; margin-bottom: 0.5rem; }
.bar { display: grid; grid-template-columns: minmax(7rem, 13rem) 1fr auto; gap: 0.3rem 0.7rem; align-items: center; margin-top: 0.45rem; font-size: 0.92rem; }
.bar .track { height: 1.05rem; background: transparent; border-left: 2px solid var(--fg); min-width: 0; }
.bar i { display: block; height: 100%; background: var(--fg); border-radius: 0 3px 3px 0; }
.bar.was i { background: repeating-linear-gradient(135deg, var(--muted) 0 3px, transparent 3px 6px); outline: 1px solid var(--muted); outline-offset: -1px; }
.bar .val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4.2rem; text-align: right; }
.chart .note { font-size: 0.85rem; color: var(--muted); margin-top: 0.7rem; }
@media (max-width: 30rem) { .bar { grid-template-columns: 1fr auto; } .bar .lab { grid-column: 1 / -1; } }
.ph { margin: 1.2rem 0 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 0.3rem; padding: 1rem; max-width: 100%; border: 2px dashed var(--muted); border-radius: 6px; color: var(--muted); font-size: 0.95rem; }
.ph span { font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; color: var(--fg); }
.ph.tall { max-width: 15rem; }
.shot { margin: 1rem 0 0; max-width: 16rem; }
.shot.wide { max-width: 100%; }
.shot.mid { max-width: 22rem; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.shot figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }
.code { overflow-x: auto; margin-top: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.code pre { margin: 0; padding: 0.9rem 1rem; font: 0.8rem/1.5 Consolas, "Cascadia Mono", Menlo, monospace; }
.ba { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.ba > div { min-width: 0; }
.ba .kind { font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.4rem; font-weight: 700; }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem; margin-top: 0.6rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.pane b, .pane small { grid-column: 1 / -1; }
.pane small { color: var(--muted); font-size: 0.85rem; }
.tile { aspect-ratio: 4 / 3; background: var(--line); border-radius: 3px; position: relative; }
.tile.dl::after { content: "\2193"; position: absolute; right: 3px; bottom: 3px; width: 1.25rem; height: 1.25rem; line-height: 1.25rem; text-align: center; font-weight: 700; font-size: 0.85rem; background: var(--fg); color: var(--bg); border-radius: 3px; }
.row { grid-column: 1 / -1; height: 0.7rem; background: var(--line); border-radius: 3px; }
@media print {
  :root { --bg: #fff; --panel: #fff; --fg: #000; --muted: #222; --line: #888; --link: #000; --mark: #000; color-scheme: light; }
  @page { margin: 0.5in; }
  body { font-size: 9.6pt; line-height: 1.32; }
  .wrap { max-width: none; padding: 0; }
  .back, .nav { display: none; }
  a { text-decoration: none; }
  h1 { font-size: 20pt; }
  .role { font-size: 11pt; margin-top: 0; }
  .resume h2 { font-size: 11.5pt; margin-top: 8pt; padding-top: 4pt; border-top: 1pt solid #000; }
  .resume h3 { font-size: 10pt; margin-top: 5pt; }
  .resume p, .resume li { margin-top: 1.5pt; }
  .resume ul { margin-top: 2pt; }
  footer { margin-top: 8pt; padding-top: 4pt; font-size: 8.5pt; }
  h2, h3 { break-after: avoid; }
  .ph, .shot, .chart .note { display: none; }
  .bar i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
