:root { --ink: #111; --muted: #6b6b6b; --line: #e6e6e6; --bg: #fff; --pad: clamp(16px, 6vw, 72px); --bar: 64px; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 400 18px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar with contact, always visible */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px; height: var(--bar); padding: 0 var(--pad); background: #fff; border-bottom: 1px solid var(--line); }
.topbar .who { font-weight: 600; font-size: 17px; text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 20px; }
.navlink { font-weight: 600; font-size: 16px; text-decoration: none; }
.navlink:hover { text-decoration: underline; }
.topbar .contact { background: #0a66c2; color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; padding: 10px 18px; border-radius: 6px; white-space: nowrap; }

/* Home hero: masonry collage, each photo spans rows by its own shape. The portrait is two columns wide. */
.hero { position: relative; background: #000; container-type: inline-size; }
.collage { --cols: 6; --gap: 4px; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-auto-rows: calc((100cqw - var(--gap) * (var(--cols) + 1)) / var(--cols) / 10); grid-auto-flow: dense; column-gap: var(--gap); padding: var(--gap) var(--gap) 0; overflow: hidden; }
.collage img { display: block; width: 100%; height: calc(100% - var(--gap)); object-fit: cover; }
.collage .portrait { grid-column: span 2; }
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.25); pointer-events: none; z-index: 1; }
.name-track { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.name { position: sticky; top: var(--bar); height: calc(100svh - var(--bar)); display: flex; align-items: flex-end; padding: var(--pad); background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0) 45%); }
.name h1 { color: #fff; font-size: clamp(52px, 10vw, 136px); font-weight: 600; line-height: 0.95; letter-spacing: -0.03em; }

/* Home body */
main { max-width: 900px; margin: 0 auto; padding: 96px var(--pad); }
.intro { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.45; padding-bottom: 56px; margin-bottom: 56px; border-bottom: 1px solid var(--ink); }
.intro p + p { margin-top: 16px; }
.titles { list-style: none; }
.titles li { font-size: clamp(28px, 4.4vw, 52px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; padding: 28px 0; border-top: 1px solid var(--line); }
.titles li:first-child { border-top: 0; padding-top: 0; }
.titles a { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; text-decoration: none; }
.titles a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.titles .arrow { color: #b5b5b5; font-weight: 400; flex: none; }

/* Posts */
.post { max-width: 760px; padding-top: 56px; }
.crumbs { color: var(--muted); font-size: 15px; margin-bottom: 32px; }
.post h1 { font-size: clamp(36px, 6vw, 64px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.byline { margin-top: 16px; color: var(--muted); font-size: 16px; }
.body { margin-top: 40px; }
.body p, .body ul { margin-top: 20px; }
.body ul { padding-left: 1.2em; }
.body li + li { margin-top: 6px; }
.body h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-top: 56px; }
.photo { margin: 32px 0 0; }
.photo img { display: block; width: 100%; border-radius: 4px; }
figcaption { margin-top: 10px; color: var(--muted); font-size: 15px; }
.paper-card { margin-top: 32px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; }
.paper-card p:first-child { margin-top: 0; }
.paper { font-size: clamp(19px, 2.2vw, 22px); line-height: 1.4; font-weight: 500; }
.meta { margin-top: 8px !important; color: var(--muted); font-size: 16px; }
.links { display: flex; flex-wrap: wrap; gap: 12px 28px; font-weight: 600; }
.equation { margin: 40px 0 0; padding: 32px 20px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.equation img { width: 100%; max-width: 600px; }
.equation figcaption { text-align: left; }
.pages { margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pages figure { margin: 0; }
.pages img { display: block; width: 100%; border: 1px solid var(--line); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.related { margin-top: 80px; padding-top: 32px; border-top: 1px solid var(--ink); }
.related h2 { font-size: 22px; font-weight: 600; }
.related ul { list-style: none; margin-top: 12px; }
.related li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 20px; font-weight: 600; line-height: 1.3; }
.related li:first-child { border-top: 0; }
.related a { text-decoration: none; }
.related a:hover { text-decoration: underline; }
.prevnext { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.prevnext a { text-decoration: none; font-weight: 600; line-height: 1.3; }
.prevnext a:hover { text-decoration: underline; }
.prevnext span { display: block; color: var(--muted); font-weight: 400; font-size: 14px; margin-bottom: 4px; }
.prevnext .next { grid-column: 2; text-align: right; }
.blog-list { list-style: none; margin-top: 40px; }
.blog-list li { padding: 28px 0; border-top: 1px solid var(--line); }
.blog-list a { text-decoration: none; }
.blog-list h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.blog-list a:hover h2 { text-decoration: underline; }
.blog-list p { margin-top: 8px; color: var(--muted); }

.site-footer { max-width: 900px; margin: 0 auto; padding: 0 var(--pad) 72px; color: var(--muted); font-size: 15px; }

@media (max-width: 1000px) { .collage { --cols: 4; } }
@media (max-width: 600px) {
  .topbar .who { display: none; }
  .topbar { justify-content: flex-end; }
  .collage { --cols: 3; --gap: 3px; }
  .pages, .prevnext { grid-template-columns: 1fr; }
  .prevnext .next { grid-column: 1; text-align: left; }
}
