/* ============================================================
   Benedetta Perrone — portfolio
   Palette: warm paper + forest green. Display: Fraunces. Text: Inter.
   ============================================================ */

:root{
  --ink:#12241d;
  --green:#1f5c46;
  --green-deep:#0e3b2e;
  --sage:#8ea08e;
  --paper:#faf8f3;
  --paper-2:#f2efe7;
  --rule:#ddd8cc;
  --muted:#5f6b64;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;font-size:103%}
body{background:var(--paper);color:var(--ink);font-family:Inter,sans-serif;-webkit-font-smoothing:antialiased}
.wrap{width:min(1180px,90%);margin:0 auto}
a{color:inherit}
img{max-width:100%}
.label{font-size:.74rem;font-weight:500;letter-spacing:.18em;text-transform:uppercase}

.skip-link{position:absolute;left:-9999px;top:0;background:var(--green);color:var(--paper);
  padding:.65rem 1rem;z-index:100;text-decoration:none}
.skip-link:focus{left:0}
a:focus-visible,button:focus-visible{outline:2px solid var(--green);outline-offset:3px}

/* ---------- header ---------- */
header{position:sticky;top:0;z-index:20;background:rgba(250,248,243,.9);backdrop-filter:blur(10px);border-bottom:1px solid var(--rule)}
.nav{display:flex;align-items:center;gap:1.8rem;height:70px}
/* Green rather than ink: the name is the one piece of branding in the header,
   and it now answers the green h1 in the hero below it. */
.mark{font-family:Fraunces,serif;font-weight:500;font-size:1.05rem;letter-spacing:-.01em;text-decoration:none;margin-right:auto;color:var(--green)}
.navmenu{display:flex;align-items:center;gap:1.55rem}
.navgroup{display:flex;gap:1.55rem;list-style:none}
.navsplit{width:1px;height:20px;background:var(--rule)}
/* The underline (.on) marks the page you are on, and only that: every item in
   the menu is a separate page, so the menu never tracks the scroll. */
.navgroup a{text-decoration:none;font-size:.79rem;font-weight:500;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);padding-bottom:4px;border-bottom:1px solid transparent;transition:.16s}
.navgroup.pages a{color:var(--green)}
.navgroup a:hover,.navgroup a.on{color:var(--green);border-color:var(--green)}
.socials{display:flex;gap:.5rem;padding-left:1.5rem;border-left:1px solid var(--rule)}
.socials a{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;color:var(--muted);transition:.16s}
.socials a:hover{background:var(--green);color:#fff}
.socials svg{width:15px;height:15px;fill:currentColor}

.navtoggle{display:none;flex-direction:column;justify-content:center;gap:5px;width:38px;height:38px;
  border:1px solid var(--rule);border-radius:2px;background:transparent;cursor:pointer}
.navtoggle span{display:block;height:1.5px;width:16px;margin:0 auto;background:var(--ink);transition:.2s}
.navtoggle[aria-expanded="true"] span:nth-child(1){transform:translateY(6.5px) rotate(45deg)}
.navtoggle[aria-expanded="true"] span:nth-child(2){opacity:0}
.navtoggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-6.5px) rotate(-45deg)}

/* ---------- hero: identity left, portrait right ---------- */
/* Third track is an empty spacer: it pulls the portrait in off the right edge
   without shrinking it, and the mobile query drops back to one column so it
   disappears on its own. */
.hero{display:grid;grid-template-columns:1fr 270px 2.5rem;gap:4rem;align-items:center;padding:2.5rem 0 3.5rem}
.hero h1{font-family:Fraunces,Georgia,serif;font-weight:400;font-size:clamp(2.9rem,6.9vw,5.4rem);line-height:.98;letter-spacing:-.035em;color:var(--green);margin-bottom:1.2rem}
.role{font-size:1.12rem;color:var(--ink);font-weight:500;margin-bottom:.2rem}
.role2{font-size:1.02rem;color:var(--green);font-weight:400;margin-bottom:.75rem}
.affil{font-size:.95rem;color:var(--muted);line-height:1.65;max-width:50ch}
/* height:auto is required — without it the img's height attribute wins and
   aspect-ratio is ignored, which stretches the portrait into a strip. */
/* Framed rather than outlined: a paper gap, then a solid green rule around it.
   The gap is what makes it read as a mount inside a frame instead of a border
   drawn on the photograph. */
.portrait img{width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;object-position:50% 25%;display:block;border-radius:3px;
  box-shadow:0 0 0 8px var(--paper),0 0 0 10px var(--green),0 24px 50px -16px rgba(31,92,70,.45)}
.herosoc{display:flex;gap:.6rem;margin-top:2.2rem;flex-wrap:wrap}
.herosoc a{display:grid;place-items:center;width:42px;height:42px;border:1px solid var(--rule);border-radius:2px;color:var(--muted);transition:.16s}
.herosoc a:hover{background:var(--green);border-color:var(--green);color:var(--paper)}
.herosoc svg{width:18px;height:18px;fill:currentColor}

/* ---------- sub-page header ---------- */
.pagehead{padding:4.5rem 0 3rem;border-bottom:1px solid var(--rule)}
.pagehead .label{color:var(--sage);display:block;margin-bottom:1.1rem}
.pagehead h1{font-family:Fraunces,Georgia,serif;font-weight:400;font-size:clamp(2.2rem,4.6vw,3.6rem);line-height:1.04;letter-spacing:-.03em;color:var(--green);margin-bottom:1.2rem}
.pagehead p{font-size:1.02rem;line-height:1.75;color:var(--muted);max-width:62ch}

/* ---------- about ---------- */
.bioblock{columns:2;column-gap:4rem;margin-top:2.2rem}
/* In About the block is the first thing in the column: no heading above it to
   clear, so the top margin would only push it out of line with the side label. */
.bioblock:first-child{margin-top:0}
.bio{font-size:.93rem;line-height:1.75;color:var(--muted);margin-bottom:1.05rem}
.bio a{color:var(--green);text-decoration:underline;text-decoration-color:var(--sage);text-underline-offset:3px}
.acts{display:flex;gap:.7rem;flex-wrap:wrap;margin-top:2.4rem}
.btn{font-size:.87rem;font-weight:500;padding:.7rem 1.3rem;border-radius:2px;text-decoration:none;border:1px solid var(--green);transition:.16s}
.btn.solid{background:var(--green);color:var(--paper)}
.btn.solid:hover{background:var(--green-deep);border-color:var(--green-deep)}
.btn.line{color:var(--green)}
.btn.line:hover{background:var(--paper-2)}

/* ---------- facts strip ---------- */
/* auto-fit rather than a fixed count: the strip has to stay balanced whether it
   carries two facts or three. */
.strip{border-top:1px solid var(--rule);border-bottom:1px solid var(--rule);
  display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.strip div{padding:1.5rem 0}
.strip div + div{border-left:1px solid var(--rule);padding-left:2.2rem}
.strip dt{color:var(--sage);margin-bottom:.45rem}
.strip dd{font-size:.95rem;line-height:1.5}
/* The same strip reused inside a section (Background summary on the home
   page), where it sits under a heading instead of under the hero. */
.sec .strip{margin-top:2.2rem}

/* ---------- section shell ---------- */
section{padding:5.5rem 0;scroll-margin-top:88px}
/* Hairline between consecutive sections. Skipped when the next block brings its
   own background (.pubs, .beyond), which already reads as a separation. */
section + section > .wrap{position:relative}
section + section > .wrap::before{content:"";position:absolute;top:-2.75rem;left:0;right:0;height:1px;background:var(--rule)}
/* .pubs and .beyond carry their own background, which already separates them,
   both from the block above and the block below. */
.pubs + section > .wrap::before,
.beyond + section > .wrap::before,
section.pubs > .wrap::before,
section.beyond > .wrap::before{display:none}
/* .contact draws its own border-top, so it never needs the hairline. */
.beyond + .contact{border-top:none}
.sec{display:grid;grid-template-columns:190px 1fr;gap:4rem}
/* Without a side label the 190px track would just be a hole in the layout. */
.sec.nolabel{grid-template-columns:1fr;gap:0}
.sec > .label{color:var(--sage);padding-top:.5rem}
.page-beyond .pagehead p{font-size:1.08rem}
.page-beyond .bio{font-size:.98rem;line-height:1.8}
.page-beyond .lead{font-size:clamp(1.7rem,2.8vw,2.35rem)}
.lead{font-family:Fraunces,Georgia,serif;font-weight:300;font-size:clamp(1.55rem,2.6vw,2.2rem);line-height:1.24;letter-spacing:-.022em;max-width:24ch}

/* ---------- publications ---------- */
.pubs{background:var(--paper-2);padding:6.5rem 0}
.pubs .head{display:grid;grid-template-columns:190px 1fr;gap:4rem;margin-bottom:3rem}
.pubs .head > .label{color:var(--sage);padding-top:.5rem}
.pubs .head .note{color:var(--muted);font-size:.96rem;line-height:1.7;max-width:48ch;margin-top:1.1rem}
.plist{border-top:1px solid var(--rule)}
.pitem{display:grid;grid-template-columns:190px 1fr;gap:4rem;padding:3rem 0;border-bottom:1px solid var(--rule);transition:transform .18s ease,background .18s ease}
.pside .pnum{font-family:Fraunces,serif;font-weight:300;font-size:2.9rem;line-height:1;color:var(--green);opacity:.34;display:block;margin-bottom:.9rem}
.pside .pyear{font-size:.72rem;font-weight:500;letter-spacing:.15em;text-transform:uppercase;color:var(--green);display:block}
.pside .pven{font-size:.82rem;color:var(--muted);margin-top:.35rem;display:block;line-height:1.45}
/* Figure column is wider than the text needs, deliberately: these are dense
   pipeline diagrams, and shrinking them to a thumbnail makes them unreadable. */
.pbody{display:grid;grid-template-columns:1fr 420px;gap:2.4rem;align-items:center}
.pbody.nofig{grid-template-columns:1fr}
.pitem h3{font-family:Fraunces,Georgia,serif;font-weight:400;font-size:clamp(1.12rem,1.6vw,1.36rem);line-height:1.28;letter-spacing:-.018em;margin-bottom:.6rem}
.pitem:hover{transform:translateY(-2px);background:rgba(255,255,255,.35)}
.pitem h3 a{text-decoration:none}
.pitem h3 a:hover{color:var(--green)}
.pauth{font-size:.84rem;color:var(--muted);margin-bottom:.8rem}
.pauth b{color:var(--ink);font-weight:600}
.pwhy{font-family:Fraunces,Georgia,serif;font-style:italic;font-weight:300;font-size:.94rem;line-height:1.6;color:var(--green);margin-bottom:1.2rem;padding-left:1rem;border-left:2px solid var(--sage)}
.chips{display:flex;gap:.45rem;flex-wrap:wrap}
.chip{font-size:.72rem;font-weight:500;letter-spacing:.09em;text-transform:uppercase;padding:.5rem .95rem;border:1px solid var(--rule);text-decoration:none;color:var(--muted);border-radius:2px;background:rgba(255,255,255,.55);transition:.16s}
.chip:hover{border-color:var(--green);color:var(--green);background:#fff}
.chip.k{background:var(--green);border-color:var(--green);color:var(--paper)}
.chip.k:hover{background:var(--green-deep);border-color:var(--green-deep);color:#fff}
/* BibTeX chip. A <button> among the <a> chips, so it needs the font and the
   line-height reset that the anchor gets for free. */
.chip.bibchip,.chip.fchip{font-family:inherit;line-height:1;cursor:pointer}
.chip.ok{background:var(--green);border-color:var(--green);color:var(--paper)}
/* Only shown when the clipboard refuses, so the entry can still be copied by
   hand. Scrolls rather than wraps: a broken line in a BibTeX entry is a bug in
   whatever gets pasted. */
.bibout{margin-top:.9rem;padding:.85rem 1rem;background:#fff;border:1px solid var(--rule);border-radius:2px;
  font-family:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;font-size:.74rem;line-height:1.6;
  color:var(--ink);overflow-x:auto;white-space:pre}
.bibout:focus-visible{outline:2px solid var(--green);outline-offset:2px}

/* ---------- publication filters ---------- */
/* Injected by site.js into the page header, from the items themselves. Sits
   under the h1 rather than above the first section, so it reads as part of the
   page title block instead of a toolbar bolted onto the list. */
.pfilter{display:flex;flex-wrap:wrap;align-items:stretch;gap:.45rem;margin-top:1.8rem}
.pfilter .fsep{width:1px;background:var(--rule);margin:0 .35rem}
.pfilter-status{margin-top:.9rem;font-size:.78rem;color:var(--sage);min-height:1.2em}

.pfig{background:#fff;border:1px solid var(--rule);padding:.9rem;transition:border-color .16s;display:flex;align-items:center;justify-content:center;min-height:220px}
.pfig img{display:block;width:100%;height:auto}
/* The figures are still small at this width. Each links to its source file, which
   site.js upgrades into the lightbox below; without JS the link still opens the
   image on its own. */
.pfig a{display:block;position:relative;cursor:zoom-in}
.pfig a::after{content:"Enlarge";position:absolute;right:.5rem;bottom:.5rem;
  font-size:.62rem;font-weight:500;letter-spacing:.1em;text-transform:uppercase;
  background:rgba(31,92,70,.92);color:var(--paper);padding:.35rem .6rem;border-radius:2px;
  opacity:0;transition:opacity .18s}
.pfig a:hover::after,.pfig a:focus-visible::after{opacity:1}
.pfig:has(a:hover),.pfig:has(a:focus-visible){border-color:var(--green)}

/* ---------- figure lightbox ---------- */
/* Tinted rather than dark: the point is to keep the page visible but out of
   focus behind the figure, not to black it out. */
.lbox{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:clamp(1rem,4vw,3rem);
  background:rgba(242,239,231,.72);backdrop-filter:blur(16px) saturate(.9);-webkit-backdrop-filter:blur(16px) saturate(.9);
  opacity:0;transition:opacity .22s}
.lbox.on{opacity:1}
.lbox figure{margin:0;max-width:min(1100px,100%);background:#fff;border:1px solid var(--rule);
  border-radius:3px;padding:1rem;box-shadow:0 30px 70px -24px rgba(18,36,29,.5);
  transform:scale(.97);transition:transform .22s}
.lbox.on figure{transform:none}
.lbox img{display:block;width:100%;height:auto;max-height:76vh;object-fit:contain}
.lbox figcaption{margin-top:.8rem;font-size:.72rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--sage);line-height:1.6}
.lbox .lclose{position:absolute;top:clamp(.8rem,2.5vw,1.6rem);right:clamp(.8rem,2.5vw,1.6rem);
  width:42px;height:42px;display:grid;place-items:center;border:1px solid var(--rule);border-radius:50%;
  background:rgba(250,248,243,.92);color:var(--green);cursor:pointer;transition:.16s}
.lbox .lclose:hover{background:var(--green);border-color:var(--green);color:var(--paper)}
.lbox .lclose svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
body.lboxopen{overflow:hidden}
/* ---------- email panel ---------- */
/* Shares the lightbox backdrop so the two modals read as one mechanism.
   Opened by site.js from any mailto: link: a bare mailto does nothing at all
   on a machine with no mail client registered, which is most of them. */
.mbox{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:clamp(1rem,4vw,3rem);
  background:rgba(242,239,231,.72);backdrop-filter:blur(16px) saturate(.9);-webkit-backdrop-filter:blur(16px) saturate(.9);
  opacity:0;transition:opacity .22s}
.mbox.on{opacity:1}
.mpanel{position:relative;width:min(460px,100%);background:#fff;border:1px solid var(--rule);border-radius:3px;
  padding:2.1rem 2.1rem 1.9rem;box-shadow:0 30px 70px -24px rgba(18,36,29,.5);
  transform:translateY(10px) scale(.98);transition:transform .22s}
.mbox.on .mpanel{transform:none}
.mpanel > .label{color:var(--sage);display:block;margin-bottom:.9rem}
.mpanel h2{font-family:Fraunces,Georgia,serif;font-weight:400;font-size:1.5rem;letter-spacing:-.02em;
  line-height:1.2;color:var(--green);margin-bottom:.6rem}
.mpanel .mnote{font-size:.87rem;line-height:1.6;color:var(--muted);margin-bottom:1.5rem}
/* The address is the point of the panel, so it gets a field of its own rather
   than sitting inline in the paragraph above. */
.maddr{display:flex;align-items:stretch;border:1px solid var(--rule);border-radius:2px;background:var(--paper);
  margin-bottom:1.4rem;overflow:hidden}
.maddr span{flex:1;min-width:0;padding:.7rem .85rem;font-size:.83rem;line-height:1.5;color:var(--ink);
  align-self:center;word-break:break-all;-webkit-user-select:all;user-select:all}
.mcopy{flex-shrink:0;border:none;border-left:1px solid var(--rule);background:transparent;cursor:pointer;
  font-family:inherit;font-size:.7rem;font-weight:500;letter-spacing:.1em;text-transform:uppercase;
  color:var(--green);padding:0 1rem;transition:.16s}
.mcopy:hover{background:var(--green);color:var(--paper)}
.mcopy.ok{background:var(--green);color:var(--paper)}
.mopts{display:flex;flex-direction:column;gap:.55rem}
.mopts .btn{text-align:center}
.mbox .lclose{position:absolute;top:.7rem;right:.7rem;width:34px;height:34px;display:grid;place-items:center;
  border:1px solid transparent;border-radius:50%;background:transparent;color:var(--sage);cursor:pointer;transition:.16s}
.mbox .lclose:hover{background:var(--paper-2);border-color:var(--rule);color:var(--green)}
.mbox .lclose svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
@media(max-width:560px){
  .mpanel{padding:1.8rem 1.4rem 1.5rem}
}

.pfig .slot{aspect-ratio:4/3;background:repeating-linear-gradient(45deg,#f6f4ee,#f6f4ee 9px,#f0ede4 9px,#f0ede4 18px);display:grid;place-items:center;text-align:center;padding:1rem}
.pfig .slot span{font-size:.7rem;letter-spacing:.1em;text-transform:uppercase;color:var(--sage);line-height:1.8}
.figcap{margin-top:.65rem;font-size:.68rem;letter-spacing:.08em;text-transform:uppercase;color:var(--sage);line-height:1.6}
/* Closes the home Publications band with a real button to the full page,
   lined up under the item text rather than under the side column. */
.pmore{display:grid;grid-template-columns:190px 1fr;gap:4rem;margin-top:2.6rem}

/* ---------- projects ---------- */
.pgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:1.4rem;margin-top:2.6rem}
.pcard{background:#fff;border:1px solid var(--rule);border-radius:2px;padding:1.35rem 1.4rem;display:flex;flex-direction:column;text-decoration:none;transition:.16s}
.pcard:hover{border-color:var(--green)}
.pcard .repo{font-family:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;font-size:.7rem;color:var(--sage);margin-bottom:.8rem;display:flex;align-items:center;gap:.45rem;word-break:break-all}
.pcard .repo svg{width:12px;height:12px;fill:currentColor;flex-shrink:0}
.pcard h3{font-family:Fraunces,Georgia,serif;font-weight:400;font-size:1.06rem;line-height:1.3;letter-spacing:-.015em;margin-bottom:.5rem}
.pcard p{font-size:.85rem;line-height:1.62;color:var(--muted);margin-bottom:auto}
.ptags{display:flex;gap:.35rem;flex-wrap:wrap;margin-top:1.1rem}
.ptags span{font-size:.65rem;letter-spacing:.08em;text-transform:uppercase;color:var(--green);background:var(--paper-2);border:1px solid var(--rule);padding:.26rem .55rem;border-radius:2px}
.pcard .go{margin-top:1rem;font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;color:var(--green)}
.secmore{margin-top:2.6rem}
.secmore a{font-size:.9rem;color:var(--green);text-decoration:none;border-bottom:1px solid var(--sage);padding-bottom:3px}
.secmore a:hover{border-color:var(--green)}

/* ---------- timeline (education / experience / leadership / honors) ---------- */
/* The spine is green, not neutral: it is the one line that runs the whole
   length of a section, so it carries the colour further down the page than any
   single accent could. */
.tl{margin-top:2.4rem;position:relative;padding-left:1.6rem;border-left:1px solid rgba(31,92,70,.22)}
.tl .card{background:#fff;border:1px solid var(--rule);border-radius:3px;padding:1.15rem 1.3rem;margin-bottom:1rem;position:relative;transition:.16s}
.tl .card:hover{border-color:var(--sage)}
.tl .card::before{content:"";position:absolute;top:1.5rem;left:-2.12rem;width:9px;height:9px;border-radius:50%;background:var(--green);border:2px solid var(--paper)}
.tl .card h3{font-size:1.03rem;font-weight:600;letter-spacing:-.01em;margin-bottom:.3rem}
.tl .card .meta{font-size:.85rem;color:var(--sage);margin-bottom:.5rem}
.tl .card p{font-size:.92rem;line-height:1.6;color:var(--muted)}
.subh{font-family:Fraunces,serif;font-weight:400;font-size:1.25rem;letter-spacing:-.015em;margin-top:3rem}
.subh:first-of-type{margin-top:0}

/* ---------- institution logos in timeline cards ---------- */
/* Only cards that carry a logo get the two-column layout: Leadership and Awards
   on the CV page have no logo file and keep the plain single-column card.
   multiply drops the white box the Trinity JPEG carries onto the card. */
.tl .card:has(.cardlogo){display:grid;grid-template-columns:84px 1fr;gap:1.15rem;align-items:center}
.cardlogo{width:100%;height:auto;max-height:40px;object-fit:contain;object-position:left center;
  margin-top:.2rem;mix-blend-mode:multiply;filter:grayscale(1);opacity:.55;
  transition:filter .25s,opacity .25s}
.tl .card:hover .cardlogo{filter:none;opacity:1}

/* ---------- collapsible block (CV: education, experience) ---------- */
.fold summary{list-style:none;cursor:pointer;display:flex;align-items:baseline;gap:1rem;justify-content:space-between}
.fold summary::-webkit-details-marker{display:none}
.fold summary .lead{transition:color .16s}
.fold summary:hover .lead{color:var(--green)}
.foldhint{flex-shrink:0;font-size:.72rem;font-weight:500;letter-spacing:.14em;text-transform:uppercase;color:var(--sage);
  border:1px solid var(--rule);border-radius:2px;padding:.42rem .8rem;transition:.16s}
.fold summary:hover .foldhint{border-color:var(--green);color:var(--green)}
.fold[open] .foldhint::after{content:" \2212"}
.fold:not([open]) .foldhint::after{content:" +"}
.fold[open] .foldhint{font-size:0}
.fold[open] .foldhint::before{content:"Hide";font-size:.72rem}
.fold[open] .foldhint::after{font-size:.72rem}
.fold:not([open]) .foldhint{font-size:0}
.fold:not([open]) .foldhint::before{content:"Show";font-size:.72rem}

/* ---------- tag pills (skills, languages) ---------- */
.tags{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1.4rem}
.tags span{font-size:.84rem;color:var(--green);background:#fff;border:1px solid var(--rule);padding:.4rem .85rem;border-radius:2px}

/* ---------- beyond ---------- */
/* Deliberately tighter than the light sections: a dark full-bleed band reads
   heavier than its height, so it gets less padding, not the standard 5.5rem. */
.beyond{background:var(--green-deep);color:var(--paper);padding:2.4rem 0}
.beyond .sec{align-items:baseline}
.beyond .sec > .label{color:rgba(250,248,243,.45)}
.beyond .lead{color:var(--paper);font-size:clamp(1.15rem,1.6vw,1.34rem)}
.beyond .sub{color:rgba(250,248,243,.6);font-size:.84rem;line-height:1.6;max-width:46ch;margin-top:.5rem}
/* auto-fit, not repeat(3,1fr): cards get commented out while their pages are
   unwritten, and a fixed three-column track would leave lit empty cells behind.
   A lone card is capped so it does not stretch across the whole band. */
.bgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1px;
  background:rgba(250,248,243,.16);border:1px solid rgba(250,248,243,.16);margin-top:1.4rem}
.bgrid:has(.bcard:only-child){max-width:420px}
.bcard{background:var(--green-deep);padding:1.1rem 1.15rem;text-decoration:none;display:flex;flex-direction:column;transition:.2s}
.bcard:hover{background:#0a2c22}
.bcard svg{width:16px;height:16px;min-width:16px;max-width:16px;min-height:16px;max-height:16px;stroke:var(--sage);fill:none;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;flex:0 0 16px}
.bcard h3{font-family:Fraunces,serif;font-weight:400;font-size:.98rem;margin:.7rem 0 .3rem}
.bcard p{font-size:.78rem;line-height:1.55;color:rgba(250,248,243,.55);margin-bottom:auto}

/* ---------- photo gallery (beyond page) ---------- */
.gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;margin-top:2.4rem}
.gallery figure{margin:0}
.gallery img{width:100%;aspect-ratio:3/4;object-fit:cover;display:block;border-radius:2px}
.gallery .slot{aspect-ratio:3/4;background:repeating-linear-gradient(45deg,#f6f4ee,#f6f4ee 9px,#f0ede4 9px,#f0ede4 18px);
  border:1px solid var(--rule);display:grid;place-items:center;text-align:center;padding:1rem;border-radius:2px}
.gallery .slot span{font-size:.7rem;letter-spacing:.1em;text-transform:uppercase;color:var(--sage);line-height:1.9}
.gallery figcaption{margin-top:.7rem;font-size:.78rem;color:var(--muted)}

/* ---------- contact + footer ---------- */
/* Contact and footer share one tone so they read as a single closing block.
   Without it the contact strip lands straight onto the dark Beyond band and
   looks like a leftover row rather than the end of the page.
   scroll-margin-top: .contact is not a <section>, so it does not inherit the
   section offset. */
.contact{padding:3.6rem 0 2.6rem;background:var(--paper-2);border-top:1px solid var(--rule);scroll-margin-top:88px}
.contact .wrap{display:grid;grid-template-columns:190px 1fr;gap:4rem;align-items:start}
.contact > .wrap > .label{color:var(--sage);padding-top:.15rem}
.clist{list-style:none;display:flex;gap:3.5rem;flex-wrap:wrap}
.clist li{display:flex;gap:.7rem;align-items:flex-start;font-size:.89rem;line-height:1.65;color:var(--muted)}
.clist svg{width:15px;height:15px;flex-shrink:0;margin-top:.28rem;fill:none;stroke:var(--sage);
  stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:stroke .16s}
.clist li:hover svg{stroke:var(--green)}
.clist a{color:var(--green);text-decoration:none;border-bottom:1px solid var(--rule);padding-bottom:1px;transition:.16s;word-break:break-word}
.clist a:hover{border-color:var(--green)}
/* Contact page: the same list, one item per line, slightly larger. */
.clist.stack{flex-direction:column;gap:1.1rem}
.clist.stack li{font-size:.98rem}
/* Brand icons (Scholar, ORCID, LinkedIn, GitHub) are drawn as filled shapes,
   not outlines, so they take the colour on fill rather than stroke. */
.clist svg.fill{fill:var(--sage);stroke:none;transition:fill .16s}
.clist li:hover svg.fill{fill:var(--green)}
/* Rule sits on .wrap, not on <footer>: inset to the content column it reads as a
   divider inside the footer block rather than a second full-bleed edge. */
footer{background:var(--paper-2)}
footer .wrap{display:flex;justify-content:space-between;gap:1rem;padding:1.5rem 0 1.8rem;
  border-top:1px solid var(--rule);font-size:.78rem;color:var(--sage)}

/* ---------- back to top ---------- */
/* Injected by site.js, so it is absent when JS is off, which is correct: it is
   an affordance that only exists once the page has been scrolled. */
.totop{position:fixed;right:1.7rem;bottom:1.7rem;z-index:30;width:44px;height:44px;
  display:grid;place-items:center;border:1px solid var(--rule);border-radius:50%;
  background:rgba(250,248,243,.94);backdrop-filter:blur(8px);color:var(--green);cursor:pointer;
  box-shadow:0 8px 24px -10px rgba(18,36,29,.45);
  opacity:0;visibility:hidden;transform:translateY(10px);transition:opacity .24s,transform .24s,visibility .24s,background .16s,color .16s}
.totop.show{opacity:1;visibility:visible;transform:none}
.totop:hover{background:var(--green);border-color:var(--green);color:var(--paper)}
.totop svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* ---------- reveal on scroll ---------- */
/* The .rv class is added by site.js, never written in the HTML: with JS off
   nothing is ever hidden, so the page cannot get stuck blank. Blocks are
   revealed whole rather than staggered item by item, which keeps the movement
   in service of the reading order instead of decorating it. */
.rv{opacity:0;transform:translateY(16px);
  transition:opacity .65s ease,transform .65s cubic-bezier(.22,.61,.36,1)}
.rv.in{opacity:1;transform:none}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .totop{transition:opacity .2s,visibility .2s;transform:none}
  /* Belt and braces: site.js already skips the observer under this setting, so
     nothing gets .rv at all. This covers a preference changed mid-session. */
  .rv{opacity:1;transform:none;transition:none}
}

/* ---------- responsive ---------- */
@media(max-width:960px){
  .hero,.sec,.strip,.pubs .head,.pitem,.pbody,.pmore,.pgrid,.bgrid,.gallery,.contact .wrap{grid-template-columns:1fr;gap:2rem}
  .bioblock{columns:1}
  .hero{gap:2.5rem;padding:3rem 0}
  .portrait{max-width:220px}
  .strip div + div{border-left:none;border-top:1px solid var(--rule);padding-left:0}
  section{padding:4rem 0}
  .pubs{padding:4rem 0}
  .clist{flex-direction:column;gap:1rem}
  /* The empty first cell of .pmore only lines the button up with the text
     column; once everything is one column it would just add a gap. */
  .pmore > span{display:none}
  /* The filter row wraps at this width, and a rule between two groups means
     nothing once they no longer sit on one line. */
  .pfilter .fsep{display:none}
  .navtoggle{display:flex}
  .socials{padding-left:0;border-left:none;margin-left:auto}
  .nav{gap:.9rem}
  .mark{white-space:nowrap;font-size:.98rem}

  .navmenu{position:absolute;top:100%;left:0;right:0;display:none;flex-direction:column;
    align-items:stretch;gap:0;background:var(--paper);border-bottom:1px solid var(--rule);padding:.4rem 0}
  .navmenu.open{display:flex}
  .navgroup{flex-direction:column;gap:0}
  .navgroup.pages{border-top:1px solid var(--rule);margin-top:.4rem;padding-top:.4rem}
  .navgroup li{width:100%}
  .navgroup a{display:block;padding:.85rem 5%;border-bottom:none}
  .navgroup a:hover,.navgroup a.on{background:var(--paper-2);border-bottom:none}
  .navsplit{display:none}
}

@media(max-width:560px){
  .gallery{grid-template-columns:1fr}
  footer .wrap{flex-direction:column;gap:.4rem}
  .logos{gap:1.4rem 2.2rem}
  .logos .l-ku{height:46px}
  .logos .l-polito{height:26px}
  .logos .l-tcd{height:40px}
  .totop{right:1rem;bottom:1rem;width:40px;height:40px}
  /* 76px is a third of a 375px card: too much of the row for a decorative mark. */
  .tl .card:has(.cardlogo){grid-template-columns:60px 1fr;gap:.9rem}
  .cardlogo{max-height:32px}
}

@media(max-width:440px){
  /* No room for name + burger + 5 icons. The icons live in the hero and on the
     Contact page too, so drop the header copy rather than cramping the row. */
  header .socials{display:none}
}
