/* Prerna Singh — shared styles. Colours and fonts are set once here. Newsreader for headings, Atkinson Hyperlegible Next for reading and labels. */
:root {
  /* Glacier: a cool white with a hint of blue, deep teal ink and accent. */
  --ground: #F1F5F5; --ground-2: #E5ECED; --ground-3: #D7E1E3;
  --ink: #13252D; --ink-2: #3C525B; --ink-3: #576A72;
  --rule: #D3DEE0;
  --accent: #136B78; --accent-soft: #DCEDEE;
  --water: #9CC3C9; --water-deep: #136B78; --silt: #D3DEE0; --earth: #13252D;
  --kind-pub: #136B78; --kind-blog: #4F7A3F; --kind-talk: #B5553F; --kind-feature: #A07A1E;
  --display: "Newsreader", "Iowan Old Style", Georgia, serif;   /* headings */
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;   /* reading */
  --mono: var(--body);   /* small labels: dates, tags, buttons */
  --page: 74rem; --measure: 38rem;
  --r: 4px; --r-sm: 3px;
  --fade: linear-gradient(90deg, transparent, var(--rule) 18%, var(--rule) 82%, transparent);
  --soft: 0 1px 0 rgba(19,37,45,.04), 0 10px 24px -18px rgba(19,37,45,.25);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; color: var(--ink);
  background: var(--ground) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2  0 0 0 0 .27  0 0 0 0 .3  0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 200px 200px;
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 20px; }
.eyebrow { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.small { font-size: 1rem; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(12px) saturate(1.2); }
.site-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--fade); }
.site-head .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem 1.5rem; padding-block: 0.8rem; }
.wordmark { font-size: 1.15rem; font-weight: 500; color: var(--ink); text-decoration: none; margin-right: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.25rem; font-family: var(--mono); font-size: 0.86rem; letter-spacing: 0.04em; }
.site-nav a { color: var(--ink-2); text-decoration: none; padding: 0.2rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }

/* Buttons and chips */
.btn { display: inline-block; font-family: var(--mono); font-size: 0.86rem; letter-spacing: 0.04em; padding: 0.7rem 1.1rem; border: 1px solid var(--ink); border-radius: 3px; color: var(--ink); text-decoration: none; background: transparent; cursor: pointer; }
.btn.primary { background: var(--ink); color: var(--ground); }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip { font-family: var(--mono); font-size: 0.8rem; padding: 0.4rem 0.8rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--ground); color: var(--ink-2); cursor: pointer; text-decoration: none; display: inline-block; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.03em; color: var(--ink-3); }

/* Sections */
section.block { padding: 4.5rem 0; position: relative; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 2rem; }
.block-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.block-head p { max-width: var(--measure); color: var(--ink-2); }

/* Hero */
.hero { padding: 4.5rem 0 4rem; position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero .wrap { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin: 0.6rem 0 1.2rem; }
.hero .line { font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.4; max-width: 34rem; }
.hero .line em { color: var(--accent); }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; }
.hero .portrait { aspect-ratio: 4/5; object-fit: cover; width: 100%; max-width: 360px; justify-self: end;
  border-radius: 2px; padding: 7px; background: var(--ground); border: 1px solid var(--rule); box-shadow: 0 14px 30px -26px rgba(19,37,45,.5); }
/* The portrait is set like an inset on a map, with its coordinates underneath. */
.portrait-fig { margin: 0; justify-self: end; width: 100%; max-width: 360px; }
.portrait-fig .portrait { max-width: none; }
.portrait-fig figcaption { display: flex; justify-content: space-between; margin-top: 0.55rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase; }

/* Direction cards */
.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.dir-card { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 0.8rem; padding: 1.7rem; background: color-mix(in srgb, var(--ground-2) 55%, var(--ground)); border-radius: var(--r); text-decoration: none; color: var(--ink); border: 1px solid var(--rule); transition: border-color .2s, transform .2s, box-shadow .2s; }
.dir-card:hover { border-color: var(--accent); }
.dir-card h3 { font-size: 1.45rem; }
.dir-card p { color: var(--ink-2); font-size: 1.02rem; }
.dir-card .go { margin-top: auto; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
/* Ways of working: open columns hung from one fine line, so they read apart from the direction cards. */
.ways { margin-top: 2.6rem; }
.ways-row { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem 2.4rem; padding-top: 2.6rem; margin-top: 0.4rem; }
.ways-row::before { content: ""; position: absolute; top: 1.3rem; left: 0; right: 0; height: 1px; background: var(--fade); }
.way { position: relative; display: block; color: var(--ink); text-decoration: none; padding-top: 0.9rem; }
.way i { position: absolute; top: -1.71rem; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--ground); box-shadow: inset 0 0 0 2.5px var(--water-deep); }
.way h3 { font-size: 1.3rem; font-style: italic; }
.way p { margin-top: 0.4rem; color: var(--ink-2); font-size: 1rem; max-width: 22rem; }
.way:hover h3 { color: var(--accent); }

/* Currently: leading on the first row, advising on the second */
.now-rows { display: grid; gap: 2.2rem; }
.now-list { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.now-list a { display: flex; flex-direction: column; gap: 0.35rem; height: 100%; padding: 1.25rem 1.35rem; border-radius: var(--r); color: var(--ink); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.now-list a:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.now-list a:hover .t { color: var(--accent); }
.now-list .o { font-size: 1rem; color: var(--ink-3); line-height: 1.4; }
.now-row.leading a { background: color-mix(in srgb, var(--ground-2) 70%, var(--ground)); box-shadow: inset 0 0 0 1px var(--rule); }
.now-row.leading .t { font-size: 1.22rem; line-height: 1.25; }
.now-row.advising a { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
.now-row.advising a:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.now-row.advising .t { font-size: 1.05rem; line-height: 1.3; }

/* Output cards (highlights + writing page) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.6rem 1.25rem; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.see-all { margin-top: 2rem; }
.ocard { display: flex; flex-direction: column; gap: 0.55rem; text-decoration: none; color: var(--ink); }
.ocard .img { aspect-ratio: 4/3; border-radius: var(--r-sm); overflow: hidden; background: var(--ground-3); position: relative; }
.ocard .img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(18,26,23,.06), inset 0 -40px 50px -30px rgba(18,26,23,.18); }
.ocard .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ocard:hover .img img { transform: scale(1.03); }
.ocard .ph { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 1rem; background: var(--ground-3); }
.ocard .ph span { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.ocard .ph b { font-weight: 400; font-size: 1.05rem; line-height: 1.25; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ocard .ph.talk { background: var(--accent-soft); }
.ocard .ph.feature { background: color-mix(in srgb, var(--kind-feature) 12%, var(--ground-2)); }
.ocard .t { font-size: 1.05rem; line-height: 1.3; }
.ocard:hover .t { color: var(--accent); }
.ocard .v { font-size: 0.94rem; color: var(--ink-3); }

/* Work map (home page): a framed teaser that opens full screen */
.approach { display: grid; grid-template-columns: 1fr 2.2fr; gap: 2.5rem; align-items: start; }
.approach .text p + p { margin-top: 1rem; }
.approach .text .hint { margin-top: 1.6rem; font-size: 1rem; color: var(--ink-2); }
.approach .wm-open { margin-top: 1.4rem; }
.wm-frame { position: relative; height: 540px; overflow: hidden; background: var(--ground); }
.wm-frame.full { background: #12181D; }
/* The teaser fades into the page at its edges, like a cut from a larger map. */
.wm-frame:not(.full) {
  --fade: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: var(--fade); -webkit-mask-composite: source-in; mask-image: var(--fade); mask-composite: intersect;
}
@media (max-width: 760px) {
  .wm-frame:not(.full) { --fade: linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent); -webkit-mask-composite: source-over; mask-composite: add; }
}
.wm-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.wm-frame.full { position: fixed; inset: 0; height: auto; border-radius: 0; z-index: 100; }
body.wm-on { overflow: hidden; }

/* Fingerprint (3 ways x 3 directions) */
.fp { display: grid; grid-template-columns: repeat(3, 9px); gap: 3px; flex: none; }
.fp i { width: 9px; height: 9px; border-radius: 50%; background: var(--ground-3); }
.fp i.on { background: var(--accent); }

/* Experience page */
.page-head { position: relative; padding-block: 3.5rem 1.5rem; }
.page-head > * { position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 0.8rem; }
.page-head h1 { max-width: 22ch; }
.page-head p { max-width: var(--measure); color: var(--ink-2); }
.page-head .stats { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; margin-top: 1.6rem; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--ink-3); }
.page-head .stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.8rem; letter-spacing: -0.01em; color: var(--ink); }
.lens { position: sticky; top: 57px; z-index: 20; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(10px); padding: 0.9rem 0; }
.lens::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--fade); }
.lens-hint { flex-basis: 100%; margin: 0; font-size: 0.94rem; color: var(--ink-3); }
.lens .wrap { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; align-items: center; }
.lens .row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.lens .row > .eyebrow { margin-right: 0.3rem; }
.lens .status { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); margin-left: auto; }
.group { position: relative; display: grid; grid-template-columns: 12rem 1fr; gap: 0 2.2rem; padding: 2.2rem 0 2.4rem; }
.group::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--rule); }
.g-side { position: sticky; top: calc(var(--lens-h, 180px) + 1.4rem); align-self: start; display: flex; flex-direction: column; gap: 0.45rem; }
.g-side b { font-family: var(--display); font-weight: 400; font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.05; letter-spacing: -0.02em; }
.g-side h2 { font-size: 1.15rem; line-height: 1.25; }
.g-side .gsum { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--ink-3); }
.g-main .gnote { color: var(--ink-2); max-width: var(--measure); font-size: 1rem; margin-bottom: 0.6rem; }
.g-roles { color: var(--ink-3); font-size: 1rem; max-width: 46rem; }
.group.open .g-roles { display: none; }
.group-head { all: unset; cursor: pointer; margin-top: 0.8rem; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
.group-head .go::before { content: "Open the roles ＋"; }
.group.open .group-head .go::before { content: "Close －"; }
.group-head:hover { text-decoration: underline; text-underline-offset: 3px; }
.group-body { display: none; padding-top: 0.6rem; }
.group.open .group-body { display: block; }
.group.open .group-head { margin-bottom: 0.4rem; }
.role { position: relative; padding: 1.5rem 0; display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 1.5rem; transition: opacity .2s; scroll-margin-top: 140px; }
.role::before, .fold::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--rule), var(--rule) 60%, transparent); }
.role h3 { font-size: 1.35rem; }
.role .org { color: var(--ink-3); font-size: 1rem; }
.role .blurb { grid-column: 1 / -1; margin-top: 0.5rem; max-width: 46rem; color: var(--ink-2); }
.role .side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; }
.role .counts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 0.7rem; font-family: var(--mono); font-size: 0.8rem; }
.role .counts a { color: var(--ink-2); }
.role .counts button { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.role .projects { grid-column: 1 / -1; list-style: none; padding: 0; margin: 0.8rem 0 0; display: none; }
.role.expanded .projects { display: block; }
.proj { position: relative; padding: 0.85rem 1rem 0.85rem 1.2rem; margin-top: 0.5rem; border-radius: 0 var(--r-sm) var(--r-sm) 0; transition: opacity .2s, background .3s; }
.proj::before { content: ""; position: absolute; left: 0; top: 0.7rem; bottom: 0.7rem; width: 3px; border-radius: 3px; background: var(--rule); transition: background .3s; }
.proj .pt { font-size: 1.08rem; }
.proj .pd { font-size: 1rem; color: var(--ink-2); margin-top: 0.2rem; max-width: 46rem; }
.proj .pm { margin-top: 0.35rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.proj .xlink { font-family: var(--mono); font-size: 0.8rem; }
body.lensing .proj.hit { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
body.lensing .proj.hit::before { background: var(--accent); }
body.lensing .role:not(.show-all) .proj:not(.hit) { display: none; }
body.lensing .role.show-all .proj:not(.hit) { opacity: 0.55; }
.more-proj { all: unset; cursor: pointer; grid-column: 1 / -1; margin-top: 0.6rem; font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.more-proj:hover { color: var(--accent); }
.role.flash, .proj.flash { animation: flash 1.6s ease; }

/* Lens on: roles without a match shrink to one line, and runs of them fold together */
body.lensing .role.miss { padding: 0.7rem 0; gap: 0 1rem; align-items: baseline; }
body.lensing .role.miss h3 { font-size: 1.05rem; color: var(--ink-3); }
body.lensing .role.miss .org { font-size: 0.94rem; }
body.lensing .role.miss :is(.blurb, .counts, .projects, .fp) { display: none; }
.role.folded { display: none; }
.fold { all: unset; position: relative; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1rem; padding: 0.75rem 0; color: var(--ink-3); font-size: 1rem; }
.fold .names { flex: 1; min-width: 12rem; font-size: 0.94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold .go { font-family: var(--mono); font-size: 0.8rem; text-decoration: underline; text-underline-offset: 3px; }
.fold:hover, .fold:hover .go { color: var(--accent); }
body.lensing .group.empty { padding: 1.2rem 0; }
body.lensing .group.empty .g-side b { font-size: 1.3rem; color: var(--ink-3); }
body.lensing .group.empty :is(.gnote, .g-roles) { display: none; }

/* Lens chips: combinations with no projects are dimmed */
.lens .chip[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.lens-clear { all: unset; cursor: pointer; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Results panel: every matching project at a glance */
.matches { margin: 1.8rem 0 0.5rem; padding: 1.6rem 1.7rem 1.7rem; background: color-mix(in srgb, var(--ground-2) 60%, var(--ground)); border: 1px solid var(--rule); border-radius: var(--r); }
.matches .m-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; }
.matches h2 { font-size: 1.5rem; }
.matches .m-line { color: var(--ink-2); font-size: 1rem; max-width: 46rem; margin-top: 0.4rem; }
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.7rem; margin-top: 1.1rem; }
.mcard { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.95rem 1.05rem; background: var(--ground); border: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); border-radius: var(--r-sm); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.mcard:hover { border-color: var(--accent); }
.mcard .t { font-size: 1.02rem; line-height: 1.3; }
.mcard .r { font-size: 0.94rem; color: var(--ink-3); line-height: 1.35; margin-top: auto; }
.mcard:hover .t { color: var(--accent); }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }

/* Writing page */
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
/* Writing page. Each year is a band, its year set large on the left like an elevation label
   on a survey map, staying in view while you scroll the band. Inside, work is packed as a collage:
   tiles are 6x6, 6x3 or 3x3 grid cells, so any mix fills the 12 columns without gaps. Every piece
   carries a dot in its kind's colour, as on the work map. */
.cluster { position: relative; display: grid; grid-template-columns: 8rem 1fr; gap: 0 1.8rem; padding: 2.2rem 0 2.6rem; }
.cluster::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--fade); }
.year-head { position: sticky; top: 5.2rem; align-self: start; display: flex; flex-direction: column; gap: 0.45rem; }
.year-head b { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 4vw, 3.3rem); line-height: 0.95; letter-spacing: -0.02em; }
.year-head span { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--ink-3); }
.cc, .ocard { --kc: var(--kind-pub); }
:is(.cc, .ocard).blog { --kc: var(--kind-blog); } :is(.cc, .ocard).talk { --kc: var(--kind-talk); } :is(.cc, .ocard).feature { --kc: var(--kind-feature); }
.cc .tag::before, .ocard .tag::before, .tabs .chip i { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--kc); margin-right: 0.45rem; vertical-align: 1px; }
.tabs .chip[data-k="all"] i { display: none; }
.tabs .chip[data-k="pub"] i { --kc: var(--kind-pub); } .tabs .chip[data-k="blog"] i { --kc: var(--kind-blog); }
.tabs .chip[data-k="talk"] i { --kc: var(--kind-talk); } .tabs .chip[data-k="feature"] i { --kc: var(--kind-feature); }
.collage { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 4.3rem; grid-auto-flow: dense; gap: 0.9rem; }
.cc { grid-column: span 3; grid-row: span 3; display: flex; flex-direction: column; min-height: 0; border-radius: var(--r-sm); overflow: hidden; text-decoration: none; color: var(--ink); background: var(--ground-2); position: relative; transition: transform .25s, box-shadow .25s; }
.cc:hover { box-shadow: 0 0 0 1px var(--accent); }
.cc.xl { grid-column: span 6; grid-row: span 6; }
.cc.wide { grid-column: span 6; grid-row: span 3; flex-direction: row; }
.cc.wide .pic { flex: 1.1; }
.cc.wide .txt { flex: 1; justify-content: flex-end; }
.cc .pic { flex: 1; min-height: 0; overflow: hidden; background: var(--ground-3); }
.cc .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cc:hover .pic img { transform: scale(1.03); }
.cc .txt { padding: 0.75rem 0.95rem 0.85rem; display: flex; flex-direction: column; gap: 0.25rem; }
.cc .tag { font-size: 0.78rem; color: var(--ink-2); }
.cc .t { font-size: 1rem; line-height: 1.28; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc.xl .t { font-size: 1.25rem; -webkit-line-clamp: 2; }
.cc .v { font-size: 0.86rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc:hover .t { color: var(--accent); }
.cc.sm { justify-content: space-between; padding: 0.95rem 1rem; background: color-mix(in srgb, var(--kc) 7%, var(--ground-2)); }
.cc.sm .txt { padding: 0; height: 100%; }
.cc.sm .t { -webkit-line-clamp: 3; font-size: 1.05rem; margin-top: 0.3rem; }
.cc.sm .v { margin-top: auto; }
@media (max-width: 820px) {
  .cluster { grid-template-columns: 1fr; padding-top: 1.6rem; }
  .year-head { position: static; flex-direction: row; align-items: baseline; gap: 0.8rem; margin-bottom: 1rem; }
  .year-head b { font-size: 2.2rem; }
  .collage { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; gap: 0.7rem; }
  .cc, .cc.sm, .cc.wide { grid-column: span 1; grid-row: auto; flex-direction: column; }
  .cc.wide .pic { flex: none; }
  .cc.xl { grid-column: span 2; grid-row: auto; }
  .cc .pic { flex: none; aspect-ratio: 4/3; }
  .cc.sm { min-height: 9.5rem; }
}
@media (max-width: 480px) { .collage { grid-template-columns: 1fr; } .cc.xl { grid-column: span 1; } }
.notice { font-size: 1rem; color: var(--ink-2); margin-bottom: 1rem; }

/* About */
.about { display: grid; grid-template-columns: 1fr 1.6fr; gap: 3rem; padding: 3.5rem 0; }
.about .prose p + p { margin-top: 1.1rem; }
.about .prose h2 { font-size: 1.5rem; margin: 2.4rem 0 0.8rem; }
.about figure { margin: 0; }
.about figure img { border-radius: var(--r); box-shadow: var(--soft); }
.about figcaption { font-size: 0.94rem; color: var(--ink-3); margin-top: 0.5rem; }

/* Footer */
.site-foot { position: relative; overflow: hidden; background: var(--earth); color: #DCE7EA; padding: 4rem 0 2.5rem; margin-top: 4rem; border-top: 1px solid var(--rule); }
.site-foot .wrap { position: relative; }
.site-foot .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-foot h2 { font-size: 1.8rem; color: #fff; margin-bottom: 0.6rem; }
.site-foot a { color: #fff; }
.site-foot .eyebrow { color: #8FA8B0; margin-bottom: 0.4rem; }
.site-foot p { font-size: 1rem; }

/* Phone */
@media (max-width: 820px) {
  .hero .wrap, .approach, .about, .now-grid { grid-template-columns: 1fr; }
  .portrait-fig { justify-self: start; max-width: 240px; order: -1; }
  .dir-grid, .now-list, .card-grid.three, .ways-row { grid-template-columns: 1fr; }
  .ways-row { padding-top: 0.4rem; }
  .ways-row::before { display: none; }
  .way { padding: 0 0 0 1.6rem; }
  .way i { top: 0.5rem; }
  .site-foot .wrap { grid-template-columns: 1fr; }
  .lens { position: static; }
  .role { grid-template-columns: 1fr; }
  .group { grid-template-columns: 1fr; }
  .g-side { position: static; margin-bottom: 0.8rem; }
  .role .side { align-items: flex-start; flex-direction: row; }
  .wm-frame { height: 440px; }
  section.block { padding: 3rem 0; }
}

/* The survey map: a rendered topographic map of a dendritic drainage basin (tools/drainage.py),
   in neutral greys: clear behind the hero, barely there behind everything else. Multiply lets the page colour tint it,
   so it suits any palette. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("images/basin-topo-grey.jpg") center / cover no-repeat; mix-blend-mode: multiply; opacity: .045; }
/* Stronger behind the hero only, fading out below it so text elsewhere stays easy to read.
   Fixed to the window like the layer above, so the two line up. */
.hero::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("images/basin-topo-grey.jpg") center / cover no-repeat fixed; mix-blend-mode: multiply; opacity: .085;
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
section.block::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: min(var(--page), calc(100% - 40px)); height: 1px; background: var(--fade); }
#groups { border-bottom: 1px solid var(--rule); }

/* Visually hidden text for screen readers. */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- CV page: the timeline, everything open ---------- */
.cv-page { --lens-h: 57px; }
.role .counts .kind::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--kc, var(--accent)); margin-right: 0.4rem; vertical-align: 1px; }
.counts .kind.pub { --kc: var(--kind-pub); } .counts .kind.blog { --kc: var(--kind-blog); }
.counts .kind.talk { --kc: var(--kind-talk); } .counts .kind.feature { --kc: var(--kind-feature); }
.role .counts button[aria-expanded="true"] { text-decoration-style: dotted; }
.proj button.xlink { all: unset; cursor: pointer; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.proj button.xlink:focus-visible, .role .counts button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cv-writing { margin-top: 2.4rem; }
.cv-download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin: 2.6rem 0 4rem; padding: 1.6rem 1.7rem; border: 1px solid var(--rule); border-radius: var(--r); background: color-mix(in srgb, var(--ground-2) 60%, var(--ground)); }
.cv-download h2 { font-size: 1.6rem; }
.cv-download p { color: var(--ink-2); }

/* References, the way a CV lists them */
.cites { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.2rem; }
.cite { padding: 0.75rem 0 0.8rem; border-top: 1px solid var(--rule); }
.cite:first-child { border-top: 0; }
.cite .tag::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--kc); margin-right: 0.45rem; vertical-align: 1px; }
.cite.pub { --kc: var(--kind-pub); } .cite.blog { --kc: var(--kind-blog); } .cite.talk { --kc: var(--kind-talk); } .cite.feature { --kc: var(--kind-feature); }
.cite p { font-size: 1.02rem; line-height: 1.45; margin-top: 0.2rem; }
.cite a { font-family: var(--mono); font-size: 0.8rem; display: inline-block; margin-top: 0.3rem; word-break: break-all; }

/* ---------- Side panel ---------- */
.panel-back { position: fixed; inset: 0; z-index: 90; background: rgba(19,37,45,.28); }
.side-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(34rem, 100%); background: var(--ground); border-left: 1px solid var(--rule); box-shadow: -20px 0 50px -30px rgba(19,37,45,.5); transform: translateX(16px); opacity: 0; transition: transform .2s ease, opacity .2s ease; display: flex; flex-direction: column; }
.side-panel.in { transform: none; opacity: 1; }
.side-panel[hidden] { display: none; }
.panel-x { position: absolute; top: 0.8rem; right: 0.9rem; z-index: 1; width: 40px; height: 40px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--ground); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.panel-x:hover { border-color: var(--ink-3); }
.panel-body { overflow-y: auto; padding: 1.6rem 1.8rem 2.5rem; outline: none; }
.panel-body > .eyebrow { padding-right: 3rem; }
.panel-body h2 { font-size: 1.6rem; margin: 0.5rem 3rem 0 0; }
.panel-body h3 { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin: 1.8rem 0 0.2rem; }
.panel-sub { color: var(--ink-2); font-size: 1rem; margin-top: 0.35rem; }
.panel-d { color: var(--ink-2); margin-top: 0.8rem; }
.panel-img { margin-top: 1rem; border-radius: var(--r-sm); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 1.1rem 0 0.8rem; font-size: 1rem; }
.facts dt { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); padding-top: 0.25rem; }
.facts dd { margin: 0; }
.panel-role { margin-top: 0.5rem; padding: 0.9rem 1rem; background: var(--ground-2); border-radius: var(--r-sm); display: grid; gap: 0.3rem; }
.panel-role .pr-t { font-size: 1.1rem; }
.panel-role .pr-o { color: var(--ink-2); font-size: 1rem; }
.panel-role p:not([class]) { font-size: 1rem; color: var(--ink-2); }
.panel-role a { font-family: var(--mono); font-size: 0.8rem; margin-top: 0.3rem; }
.plinks { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.4rem; }
.plink { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: 1rem; line-height: 1.4; }
.plink:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.panel-open { overflow: hidden; }

/* ---------- Experience page: project tiles ---------- */
.filters .row { min-width: 0; max-width: 100%; }
.filters .select { font-family: var(--mono); font-size: 0.8rem; padding: 0.4rem 0.6rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--ground); color: var(--ink); width: 22rem; max-width: 100%; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.7rem; margin-top: 1.1rem; }
.ptile { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 0.35rem; padding: 0.95rem 1.05rem 1rem; background: var(--ground); border: 1px solid var(--rule); border-radius: var(--r-sm); color: var(--ink); transition: border-color .15s, opacity .2s; }
.ptile:hover { border-color: var(--accent); }
.ptile:hover .t { color: var(--accent); }
.ptile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ptile .t { font-family: var(--display); font-size: 1.04rem; line-height: 1.3; }
.ptile .r { font-family: var(--body); font-size: 0.94rem; color: var(--ink-2); line-height: 1.35; }
.ptile .tag { color: var(--ink-2); }
.ptags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: auto; padding-top: 0.4rem; }
.ptags span { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; padding: 0.15rem 0.4rem; border-radius: 2px; background: var(--ground-2); color: var(--ink-2); }
/* Three kinds of tag, three colours: domain (teal), way of working (ochre), period (violet).
   The same colours mark the filter labels, so each tag can be traced to its filter. */
:root { --t-dir: #0F5762; --t-dir-bg: #D8ECEE; --t-way: #6B4A0A; --t-way-bg: #F4E6C8; --t-per: #46407A; --t-per-bg: #E5E3F4; }
.ptags .t-dir { background: var(--t-dir-bg); color: var(--t-dir); }
.ptags .t-way { background: var(--t-way-bg); color: var(--t-way); }
.ptags .t-per { background: var(--t-per-bg); color: var(--t-per); }
.ptags .n { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.filters .key::before { content: ""; display: inline-block; width: 0.7em; height: 0.7em; border-radius: 2px; margin-right: 0.45em; vertical-align: -0.05em; }
.filters .key.t-dir::before { background: var(--t-dir); } .filters .key.t-way::before { background: var(--t-way); } .filters .key.t-per::before { background: var(--t-per); }
.matches .tiles .ptile { background: var(--ground); }
.tiles-rest { padding: 2rem 0 4rem; }
.rest-h { font-size: 1.5rem; }
.tiles-rest.dimmed .rest-h { color: var(--ink-2); font-size: 1.2rem; }
/* Projects outside the filter stay readable but step back: no fill, lighter border, grey text. */
.tiles-rest.dimmed .ptile { background: transparent; border-style: dashed; }
.tiles-rest.dimmed .ptile :is(.t, .r, .tag) { color: var(--ink-2); }
.tiles-rest.dimmed .ptags span { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.tiles-rest.dimmed .ptile:hover { border-style: solid; }
@media (max-width: 820px) {
  .panel-body { padding: 1.3rem 1.2rem 2rem; }
  .filters .row:has(.select) { flex-wrap: nowrap; width: 100%; }
  .filters .select { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .side-panel, .ptile { transition: none; }
  .role.flash, .proj.flash { animation: none; }
}

/* Counts on the Writing filters: quieter than the label but still readable. */
.tabs .chip .n { color: var(--ink-2); margin-left: 0.15rem; }
.tabs .chip[aria-pressed="true"] .n { color: #fff; }

/* Larger text, switched on from the header: every size is in rem, so this scales the whole page. */
html.large-text { font-size: 118.75%; }
.text-size { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-2); background: var(--ground); border: 1px solid var(--rule); border-radius: 3px; padding: 0.3rem 0.6rem; cursor: pointer; display: inline-flex; align-items: baseline; gap: 0.4rem; }
.text-size span { font-family: var(--display); font-size: 0.9rem; letter-spacing: -0.02em; }
.text-size span b { font-weight: 400; font-size: 1.25em; }
.text-size:hover { border-color: var(--ink-3); color: var(--ink); }
.text-size[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.page-head p + p { margin-top: 0.8rem; }

/* Titles that are not headings in the markup still take the heading face. */
.wordmark, .proj .pt, .mcard .t, .ocard .t, .cc .t, .now-list .t, .panel-role .pr-t, .dir-card .t { font-family: var(--display); letter-spacing: -0.01em; }

/* Currently: Leading as a 2x2 block on the left, Advising stacked on the right */
.now-rows { grid-template-columns: 2fr 1fr; align-items: start; }
.now-row.leading .now-list { grid-template-columns: repeat(2, 1fr); }
.now-row.advising .now-list { grid-template-columns: 1fr; }
@media (max-width: 820px) {
  .now-rows { grid-template-columns: 1fr; }
  .now-row.leading .now-list { grid-template-columns: 1fr; }
}

/* Long single-line venues must not squeeze the photo out of wide cards */
.cc .txt { min-width: 0; }
.portrait-fig figcaption a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
