/* Marco Gandolfo – personal site, v2
   Palette: the original site's circles (oxide, lagoon, ochre, moss) lifted for a dark night ground.
   Type: Syne (the name) + Instrument Sans (titles, menus) + Newsreader (text) + JetBrains Mono (code), self-hosted. */

/* ---------- fonts ---------- */
@font-face { font-family: "Syne"; font-style: normal; font-display: swap; font-weight: 400 800;
  src: url(fonts/syne-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Syne"; font-style: normal; font-display: swap; font-weight: 400 800;
  src: url(fonts/syne-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-display: swap; font-weight: 400 700; font-stretch: 75% 100%;
  src: url(fonts/instrument-sans-latin-standard-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-display: swap; font-weight: 400 700; font-stretch: 75% 100%;
  src: url(fonts/instrument-sans-latin-ext-standard-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/newsreader-latin-standard-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/newsreader-latin-ext-standard-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: italic; font-display: swap; font-weight: 200 800;
  src: url(fonts/newsreader-latin-standard-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: italic; font-display: swap; font-weight: 200 800;
  src: url(fonts/newsreader-latin-ext-standard-italic.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(fonts/jetbrains-mono-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------- tokens ---------- */
:root {
  --night: #1b1e2a;
  --night-2: #262a3a;
  --fog: #eceee9;
  --paper: #f7f8f5;
  --ink: #1d2030;
  --slate: #596070;
  --rule: #d3d7ce;
  --oxide: #b5483b;
  --oxide-deep: #93362b;
  --lagoon: #2e7470;
  --ochre: #cc9b3c;
  --moss: #73875f;
  --bone: #efe8d8;

  --name: "Syne", "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  --display: "Instrument Sans", "Helvetica Neue", system-ui, sans-serif;
  --text: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 6vw, 5.5rem);
  --wide: 1240px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.15rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--oxide-deep); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--oxide); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); line-height: 1.1; letter-spacing: -.012em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 200; background: var(--paper); padding: .5rem 1rem; }

/* ---------- announcement ---------- */
.announce { background: var(--night); border-bottom: 1px solid rgba(239,232,216,.08); }
.announce a {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .3rem .9rem;
  max-width: var(--wide); margin: 0 auto; padding: .5rem var(--gutter);
  color: rgba(239,232,216,.82); text-decoration: none;
  font-family: var(--display); font-size: .88rem; text-align: center;
}
.announce-btn {
  background: var(--ochre); color: var(--night);
  font-weight: 650; padding: .12rem .75rem; border-radius: 999px; font-size: .82rem;
}
.announce a:hover .announce-text { color: var(--bone); text-decoration: underline; text-underline-offset: .2em; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(236,238,233,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.is-home .nav { background: var(--night); border-bottom-color: rgba(239,232,216,.06); }
.nav-inner { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); font-family: var(--name); font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; }
.brand img, .foot-brand img { image-rendering: pixelated; border-radius: 50%; background: var(--bone); padding: 3px; box-shadow: 0 0 0 1px rgba(29,32,48,.08); }
.brand img { width: 36px; height: 36px; }
.is-home .brand { color: var(--bone); }
.brand:hover { color: inherit; text-decoration: none; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .15rem; }
.menu a {
  display: block; position: relative;
  font-family: var(--display); font-size: .98rem; font-weight: 500;
  color: var(--slate); text-decoration: none; padding: .5rem .75rem; border-radius: 8px;
}
.menu > li > a:hover { color: var(--ink); background: rgba(29,32,48,.06); }
.menu > li > a.is-current { color: var(--ink); }
.menu > li > a.is-current::before {
  content: ""; position: absolute; left: 50%; bottom: .08rem; width: 6px; height: 6px; margin-left: -3px;
  border-radius: 50%; background: var(--oxide);
}
.is-home .menu > li > a { color: rgba(239,232,216,.7); }
.is-home .menu > li > a:hover, .is-home .menu > li > a.is-current { color: var(--bone); background: rgba(239,232,216,.07); }
.has-sub { position: relative; }
.sub {
  display: none; position: absolute; top: calc(100% + 4px); left: -.5rem; min-width: 290px;
  list-style: none; margin: 0; padding: .5rem; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(27,30,42,.35);
}
.has-sub:hover > .sub, .has-sub:focus-within > .sub { display: block; }
.sub a { color: var(--ink); font-size: .94rem; padding: .38rem .75rem; border-radius: 8px; }
.sub a:hover { background: var(--fog); color: var(--oxide-deep); }
.sub .lvl2 a { padding-left: 1.6rem; color: var(--slate); font-size: .9rem; }
.sub a[aria-current="page"] { color: var(--oxide-deep); font-weight: 650; }
.menu-btn { display: none; }

@media (max-width: 1000px) {
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 1px solid var(--rule); border-radius: 50%; background: transparent; cursor: pointer;
  }
  .is-home .menu-btn { border-color: rgba(239,232,216,.25); }
  .menu-icon, .menu-icon::before { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; transition: transform .2s; }
  .menu-icon::before { content: ""; position: absolute; top: 6px; }
  .is-home .menu-icon, .is-home .menu-icon::before { background: var(--bone); }
  .menu-btn[aria-expanded="true"] .menu-icon { transform: translateY(3px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] .menu-icon::before { transform: translateY(-6px) rotate(-90deg); }
  .nav-inner { flex-wrap: wrap; }
  #menu { display: none; width: 100%; padding: .25rem 0 1.25rem; max-height: calc(100vh - 110px); overflow-y: auto; }
  .nav.open #menu { display: block; }
  .menu { flex-direction: column; align-items: stretch; }
  .menu > li > a.is-current::before { left: 0; top: 50%; bottom: auto; margin: -3px 0 0 0; }
  .sub { display: block; position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 .3rem; min-width: 0; }
  .sub a { color: var(--slate); padding-left: 1.6rem; }
  .sub .lvl2 a { padding-left: 2.6rem; }
  .is-home .sub a { color: rgba(239,232,216,.6); }
  .is-home .sub a:hover { background: rgba(239,232,216,.07); color: var(--bone); }
}

/* ---------- discs (shared motif) ---------- */
.disc {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--s); aspect-ratio: 1; border-radius: 50%;
  background: var(--c); transform: translate(-50%, -50%);
  filter: blur(var(--b, 0px));
  will-change: filter;
}

/* ---------- home: hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--night); color: var(--bone);
  min-height: calc(100svh - 104px);
  display: flex; align-items: flex-end;
}
.bokeh { position: absolute; inset: 0; z-index: -2; }
.bokeh .disc { opacity: .92; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(27,30,42,.94) 0%, rgba(27,30,42,.78) 34%, rgba(27,30,42,.1) 66%, rgba(27,30,42,0) 100%),
    linear-gradient(0deg, rgba(27,30,42,.55) 0%, rgba(27,30,42,0) 35%);
}
.hero-inner { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 14vh var(--gutter) clamp(3rem, 10vh, 7rem); }
.hero h1 {
  margin: 0 0 1.6rem; max-width: 8ch; color: var(--bone);
  font-family: var(--name); font-size: clamp(2.7rem, 7.2vw, 6.4rem); font-weight: 800;
  line-height: .92; letter-spacing: -.03em;
}
.hero h1 .phd {
  font-family: var(--display); font-weight: 600; font-size: .2em; letter-spacing: .01em;
  vertical-align: top; position: relative; top: .55em; margin-left: .45em; color: var(--ochre);
  white-space: nowrap;
}
.hero .role { margin: 0 0 .5rem; font-family: var(--display); font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 560; color: var(--ochre); letter-spacing: -.005em; }
.hero .affil { margin: 0; max-width: 36ch; font-style: italic; font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: rgba(239,232,216,.78); }

/* ---------- home: interests + teasers ---------- */
.interests, .teasers { max-width: var(--wide); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.interests {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 1rem 4rem;
  padding-top: clamp(4rem, 9vw, 7rem); padding-bottom: clamp(3rem, 7vw, 5rem);
}
.interests h2 { margin: .7rem 0 0; font-size: 1.1rem; font-weight: 600; color: var(--slate); letter-spacing: 0; }
.interests ul { list-style: none; margin: 0; padding: 0; }
.interests li {
  display: flex; align-items: center; gap: .55em;
  font-family: var(--display); font-weight: 650; font-stretch: 88%;
  font-size: clamp(1.7rem, 4.4vw, 3.4rem); line-height: 1.05; letter-spacing: -.025em;
  padding: .45em 0; border-top: 1px solid var(--rule);
}
.interests li:last-child { border-bottom: 1px solid var(--rule); }
.dot { flex: none; width: .5em; height: .5em; border-radius: 50%; background: var(--c); }

.teasers { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem clamp(2rem, 6vw, 6rem); padding-bottom: 6rem; }
.teaser h2 { font-size: 2rem; font-weight: 700; font-stretch: 85%; margin: 0 0 1.2rem; }
.teaser h2 a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .4em; }
.teaser h2 a::after { content: ""; width: .32em; height: .32em; border-radius: 50%; background: var(--oxide); transition: transform .2s ease; }
.teaser h2 a:hover::after { transform: scale(1.6); }
.teaser .news-item { padding: 1rem 0; border-top: 1px solid var(--rule); font-size: 1.02rem; }
.teaser .news-item h3 { font-size: .98rem; margin: 0 0 .3rem; color: var(--oxide-deep); }
.teaser .news-item p { margin: .25rem 0; }
.teaser .pub { border-top: 1px solid var(--rule); }

/* ---------- inner pages ---------- */
.page-head { position: relative; overflow: hidden; max-width: var(--wide); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(2rem, 4vw, 3rem); }
.page-head-inner { position: relative; z-index: 1; max-width: calc(100% - 330px); }
.page-head h1 {
  margin: 0; max-width: 16ch; font-size: clamp(2.5rem, 6.4vw, 5.2rem); font-weight: 700; font-stretch: 88%;
  line-height: .98; letter-spacing: -.025em;
}
.page-head h1 { text-wrap: balance; }
.crumbs { margin: 0 0 1rem; font-family: var(--display); font-size: .95rem; color: var(--slate); }
.crumbs a { color: var(--slate); text-decoration: none; }
.crumbs a:hover { color: var(--oxide-deep); text-decoration: underline; }
.mini-bokeh { position: absolute; right: var(--gutter); top: 50%; width: 300px; height: 220px; transform: translateY(-46%); }
.mini-bokeh .disc { opacity: .9; }

.layout { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) 6rem; }
.layout > * { min-width: 0; }
.prose a { overflow-wrap: anywhere; }
.layout.has-rail { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); }
.prose { max-width: 70ch; border-top: 1px solid var(--rule); padding-top: 2rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.85rem; font-weight: 700; font-stretch: 88%; margin: 2.6rem 0 .8rem; }
.prose h3 { font-size: 1.35rem; font-weight: 650; margin: 2.2rem 0 .6rem; }
.prose p { margin: .6rem 0; }
.prose hr { border: 0; height: 0; margin: 1.3rem 0; border-top: 1px dashed var(--rule); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }

/* rail */
.rail { position: sticky; top: 96px; align-self: start; padding-top: 2rem; font-family: var(--display); }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail a { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--slate); padding: .22rem 0; font-size: .95rem; line-height: 1.3; }
.rail a::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--rule); transition: background .2s, transform .2s; }
.rail a:hover { color: var(--ink); }
.rail a:hover::before { background: var(--ochre); }
.rail a.is-active, .rail a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.rail a.is-active::before, .rail a[aria-current="page"]::before { background: var(--oxide); transform: scale(1.35); }
.rail-years a { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.rail-section .lvl2 a { padding-left: 1.1rem; font-size: .88rem; }

/* years (news + publications) */
.year { padding-top: .4rem; margin-bottom: 1.5rem; }
.year + .year { border-top: 1px solid var(--rule); margin-top: 2rem; padding-top: 1.6rem; }
.prose .year-num {
  margin: 0 0 .2rem; font-size: clamp(3rem, 6vw, 4.6rem); font-weight: 300; font-stretch: 75%;
  letter-spacing: -.04em; line-height: 1; color: var(--lagoon); font-variant-numeric: tabular-nums;
}
.prose > .year:first-child { margin-top: 0; }
.news-item { margin: 0 0 2.2rem; }
.news-item > h3:first-child { margin: 0 0 .45rem; font-size: 1.12rem; font-weight: 650; color: var(--oxide-deep); letter-spacing: -.005em; }

figure { margin: 1.4rem 0; }
figure img, .media-row img, .stim-block img { border-radius: 10px; }
figcaption { font-size: 1rem; color: var(--slate); margin-top: .7rem; }
figcaption h4 { margin: 0 0 .3rem; font-size: 1.08rem; color: var(--ink); }
.figure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin: 1.4rem 0; }
.figure-grid figure { margin: 0; }
.media-row { display: grid; grid-template-columns: minmax(0, 280px) 1fr; gap: 1.6rem; align-items: start; }

blockquote.twitter-tweet { margin: 1rem 0; padding: .8rem 1.1rem; border-left: 3px solid var(--lagoon); background: var(--paper); border-radius: 0 10px 10px 0; font-size: 1rem; color: var(--slate); }

/* publications */
.legend { font-family: var(--display); font-size: .95rem; color: var(--slate); margin-bottom: 2rem !important; }
.prose > h2:first-child + .legend { margin-top: -.2rem; }
.pub { padding: 1.05rem 0; border-bottom: 1px solid var(--rule); }
.year-items .pub:last-child { border-bottom: 0; }
.pub p { margin: 0; }
.pub .title > a:first-child { font-family: var(--display); font-weight: 650; font-size: 1.12rem; line-height: 1.25; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.pub .title > a:first-child:hover { color: var(--oxide-deep); text-decoration: underline; }
.pub .title { line-height: 1.5; }
.pub .authors { margin-top: .3rem; font-size: 1rem; color: var(--slate); }
.pub .me { color: var(--ink); font-weight: 600; }

/* index lists: resources, R, online experiments */
.prose .link-cards { list-style: none; margin: 0; padding: 0; }
.link-cards li { border-bottom: 1px solid var(--rule); }
.link-cards a {
  display: flex; align-items: center; gap: 1.1rem; padding: 1.1rem 0;
  font-family: var(--display); font-size: clamp(1.45rem, 3.4vw, 2.3rem); font-weight: 650; font-stretch: 85%;
  letter-spacing: -.025em; color: var(--ink); text-decoration: none; line-height: 1.1;
}
.link-cards a::before {
  content: ""; flex: none; width: 1.05em; height: 1.05em; border-radius: 50%; background: var(--c, var(--oxide));
  filter: blur(5px); opacity: .85; transition: filter .35s ease, opacity .35s ease, transform .35s ease;
}
.link-cards a:hover, .link-cards a:focus-visible { color: var(--oxide-deep); }
.link-cards a:hover::before, .link-cards a:focus-visible::before { filter: blur(0); opacity: 1; transform: scale(1.08); }
.link-cards li:nth-child(4n+1) a { --c: var(--oxide); }
.link-cards li:nth-child(4n+2) a { --c: var(--lagoon); }
.link-cards li:nth-child(4n+3) a { --c: var(--ochre); }
.link-cards li:nth-child(4n+4) a { --c: var(--moss); }

/* contact */
.ico {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 13%, var(--paper));
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.ico svg { width: 1.25rem; height: 1.25rem; display: block; }
.emails p { display: flex; align-items: center; gap: .9rem; font-size: 1.1rem; margin: .4rem 0 .9rem; }
.emails a { font-family: var(--display); font-weight: 650; font-size: clamp(1.2rem, 2.4vw, 1.6rem); letter-spacing: -.02em; color: var(--ink); text-decoration-color: var(--oxide); }
.prose .contact-list { list-style: none; padding: 0; margin: 2.2rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1.2rem; }
.contact-list li { margin: 0; }
.contact-list a {
  display: flex; align-items: center; gap: .85rem; padding: .6rem .9rem .6rem .6rem;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper);
  font-family: var(--display); font-size: 1.08rem; font-weight: 600; color: var(--ink); text-decoration: none;
  transition: border-color .2s ease;
}
.contact-list a:hover, .contact-list a:focus-visible { border-color: var(--brand); color: var(--ink); }
.contact-list a:hover .ico, .contact-list a:focus-visible .ico { background: var(--brand); color: #fff; transform: scale(1.06); }

/* TMS card, stimuli, embeds */
.slide-card {
  display: grid; grid-template-columns: 240px 1fr; gap: 1.4rem; align-items: center;
  padding: 1rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--paper);
  color: var(--ink); text-decoration: none; font-size: 1.02rem;
}
.slide-card img { border-radius: 8px; }
.slide-card strong { display: block; margin-bottom: .35rem; font-family: var(--display); font-size: 1.1rem; color: var(--ink); word-break: break-word; }
.slide-card:hover { border-color: var(--oxide); color: var(--ink); }
.stim-block { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 1.6rem; align-items: start; padding: 1.8rem 0; border-bottom: 1px solid var(--rule); }
.stim-block:first-child { padding-top: 0; }
.stim-block:last-child { border-bottom: 0; }
.stim-block p { margin: 0 0 .55rem; }
.embed { width: 100%; border: 1px solid var(--rule); border-radius: 12px; background: #fff; margin: 1rem 0 2.2rem; }
.embed-tall { height: 640px; }
.embed-doc { height: 1000px; }

/* code */
code { font-family: var(--mono); font-size: .84em; background: #e0e3db; padding: .08em .35em; border-radius: 5px; }
pre {
  background: var(--night); color: #e6e2d6; border-radius: 12px;
  padding: 1.15rem 1.35rem; margin: 1.2rem 0 1.6rem; overflow-x: auto;
  font-size: .95rem; line-height: 1.55; tab-size: 2;
}
pre code { background: none; padding: 0; color: inherit; font-size: .82rem; white-space: pre; }
pre::-webkit-scrollbar { height: 8px; }
pre::-webkit-scrollbar-thumb { background: rgba(239,232,216,.2); border-radius: 8px; }

/* ---------- footer ---------- */
.foot { background: var(--night); color: var(--bone); }
.foot-inner { max-width: var(--wide); margin: 0 auto; padding: 3rem var(--gutter) 3.5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.foot-brand { display: inline-flex; align-items: center; gap: .8rem; color: var(--bone); text-decoration: none; font-family: var(--name); font-weight: 700; font-size: 1.35rem; letter-spacing: -.015em; }
.foot-brand img { width: 48px; height: 48px; padding: 4px; }
.foot-brand:hover { color: var(--bone); }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; }
.foot-links a { font-family: var(--display); font-size: .95rem; color: rgba(239,232,216,.72); text-decoration: none; }
.foot-links a:hover { color: var(--ochre); text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .layout.has-rail { grid-template-columns: 1fr; gap: 0; }
  .rail { position: static; padding-top: 0; margin-bottom: 1.2rem; }
  .rail-years ul { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
  .rail-section { display: none; }
  .mini-bokeh { opacity: .35; right: -60px; }
  .page-head-inner { max-width: none; }
  .interests { grid-template-columns: 1fr; }
  .teasers { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 1.08rem; }
  .figure-grid, .media-row, .stim-block, .slide-card { grid-template-columns: 1fr; }
  .prose .contact-list { grid-template-columns: 1fr; }
  .hero { min-height: 88svh; }
  .hero::after { background: linear-gradient(0deg, rgba(27,30,42,.95) 0%, rgba(27,30,42,.75) 45%, rgba(27,30,42,.15) 80%); }
  .embed-tall { height: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- CV page ---------- */
.page-cv .prose { max-width: 74ch; }
.cv-id {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 2rem;
  background: var(--night); color: var(--bone); border-radius: 20px; padding: clamp(1.6rem, 4vw, 2.6rem);
  margin: 0 0 3rem;
}
.cv-id::before, .cv-id::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; }
.cv-id::before { width: 260px; height: 260px; right: -60px; top: -90px; background: var(--oxide); filter: blur(28px); opacity: .55; }
.cv-id::after { width: 140px; height: 140px; right: 150px; bottom: -70px; background: var(--lagoon); filter: blur(10px); opacity: .7; }
.cv-id p { margin: 0; }
.cv-name { font-family: var(--name); font-weight: 800; font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1; letter-spacing: -.03em; color: var(--bone); }
.cv-name .phd { font-family: var(--display); font-weight: 600; font-size: .32em; letter-spacing: .01em; color: var(--ochre); vertical-align: top; position: relative; top: .35em; margin-left: .5em; }
.cv-role { margin-top: .7rem !important; font-family: var(--display); font-weight: 600; font-size: 1.12rem; color: var(--ochre); }
.cv-affil { font-style: italic; color: rgba(239,232,216,.75); max-width: 40ch; }
.cv-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; }
.cv-mail { font-family: var(--display); font-weight: 600; color: var(--bone); text-decoration-color: rgba(239,232,216,.4); }
.cv-mail:hover { color: var(--ochre); }
.btn-print {
  font: 600 .95rem var(--display); cursor: pointer; border: 0; border-radius: 999px;
  padding: .55rem 1.2rem; background: var(--bone); color: var(--night);
}
.btn-print:hover { background: var(--ochre); }

.cv-sec { padding: 0 0 2.6rem; margin: 0 0 2.6rem; border-bottom: 1px solid var(--rule); }
.cv-sec:last-child { border-bottom: 0; }
.prose .cv-sec > h2 { margin-top: 0; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.prose .cv-sec h3 { font-size: 1.15rem; margin: 0 0 .25rem; }
.lead { font-size: 1.24rem; line-height: 1.6; }
.muted { color: var(--slate); }
.note { color: var(--slate); font-family: var(--display); font-size: .95rem; }

/* timeline */
.prose .timeline { list-style: none; margin: 1.6rem 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 10.25rem; top: .5rem; bottom: 1.5rem; width: 2px; background: var(--rule); }
.prose .tl { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0 2.6rem; margin: 0; padding: 0 0 1.7rem; position: relative; }
.tl::before {
  content: ""; position: absolute; left: calc(10.25rem - 6px); top: .42rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--oxide); box-shadow: 0 0 0 4px var(--fog);
}
.tl.is-degree::before { background: var(--lagoon); }
.tl.is-ra::before { background: var(--ochre); }
.tl.is-now::before { width: 18px; height: 18px; left: calc(10.25rem - 8px); top: .3rem; box-shadow: 0 0 0 4px var(--fog), 0 0 0 10px rgba(181,72,59,.18); }
.prose .tl-when { margin: .12rem 0 0; text-align: right; white-space: nowrap; font-family: var(--display); font-weight: 600; font-size: .95rem; color: var(--slate); font-variant-numeric: tabular-nums; }
.tl.is-now .tl-when { color: var(--oxide-deep); }
.prose .tl-body h3 { font-size: 1.28rem; margin: 0 0 .25rem; }
.tl-body p { margin: .15rem 0; }
.prose .tl-where { color: var(--slate); font-size: 1rem; }

/* selected papers */
.paper { position: relative; padding: 1.4rem 0 1.4rem 2.2rem; border-top: 1px solid var(--rule); }
.paper:first-of-type { border-top: 0; }
.paper::before { content: ""; position: absolute; left: 0; top: 1.75rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--c); }
.prose .paper h3 { font-size: 1.3rem; line-height: 1.25; margin: 0 0 .4rem; }
.paper h3 a { color: var(--ink); text-decoration: none; }
.paper h3 a:hover { color: var(--oxide-deep); text-decoration: underline; }
.prose .paper-ref { color: var(--slate); font-size: 1rem; margin-bottom: .8rem; }
.paper-ref b { color: var(--ink); }

/* full list */
.prose .pub-list { padding-left: 2.2rem; margin: 1.2rem 0 2rem; }
.pub-list > li { padding: .7rem 0 .8rem .4rem; border-bottom: 1px solid var(--rule); margin: 0; }
.pub-list > li::marker { font-family: var(--display); font-weight: 600; color: var(--lagoon); font-size: .95rem; }
.pub-list p { margin: 0; }
.pl-title { line-height: 1.45; }
.prose .pl-authors { color: var(--slate); font-size: 1rem; margin-top: .2rem; }
.pl-authors b, .talk-list b, .plain-list b { color: var(--ink); font-weight: 600; }
.prose .sub-h { font-size: 1.15rem; margin-top: 1.6rem; }
.prose .plain-list, .prose .talk-list, .prose .dash-list, .prose .award-list, .prose .impact-list, .prose .tag-list { list-style: none; padding: 0; }
.plain-list li { padding: .45rem 0; border-bottom: 1px dashed var(--rule); margin: 0; font-size: 1.02rem; }

/* lists with disc markers */
.dash-list li, .talk-list li { position: relative; padding-left: 1.3rem; }
.dash-list li::before, .talk-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--ochre); }
.talk-list li { font-size: 1.02rem; margin: 0 0 .6rem; }

.block { margin: 0 0 1.8rem; }
.block h3 .when { font-family: var(--display); font-weight: 500; font-size: .9rem; color: var(--slate); margin-left: .5rem; }
.sup-grid { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: .5rem 1.4rem; margin: 1rem 0 1.2rem; padding: 1rem 1.2rem; background: var(--paper); border-radius: 14px; }
.sup-grid dt { font-family: var(--display); font-weight: 600; font-size: .98rem; }
.sup-grid dd { margin: 0; font-size: 1rem; }

/* grants */
.award-list li { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.award-list li:last-child { border-bottom: 0; }
.award-list .yr { font-family: var(--display); font-weight: 600; color: var(--lagoon); font-variant-numeric: tabular-nums; padding-top: .1rem; }
.prose .award-list h3 { font-size: 1.1rem; }
.award-list p { margin: 0; color: var(--slate); font-size: 1.02rem; }
.award-list li.is-key { background: var(--night); border-radius: 14px; padding: 1.1rem 1.2rem; margin: .6rem 0; border: 0; }
.award-list li.is-key .yr { color: var(--ochre); }
.prose .award-list li.is-key h3 { color: var(--bone); font-size: 1.3rem; }
.award-list li.is-key p { color: rgba(239,232,216,.8); }
.award-list li.is-key a { color: var(--ochre); }

/* societal impact */
.impact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.impact-list li { margin: 0; padding: 1.1rem 1.2rem; background: var(--paper); border-radius: 14px; border: 1px solid var(--rule); }
.prose .impact-list h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.impact-list p { margin: .2rem 0; font-size: 1rem; }
.impact-list .muted { font-size: .95rem; }

/* skills */
.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 0; }
.skill-grid > div { padding: 1rem 1.2rem; border-radius: 14px; background: var(--paper); border: 1px solid var(--rule); }
.skill-grid dt { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--lagoon); margin-bottom: .25rem; }
.skill-grid dd { margin: 0; font-size: 1rem; }

/* reviewer */
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-list li { margin: 0; font-family: var(--display); font-size: .92rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); }

/* section index next to the CV */
.rail-toc a { font-size: .9rem; align-items: flex-start; }
.rail-toc a::before { margin-top: .4em; }

@media (max-width: 900px) {
  .rail-toc { display: none; }
}
@media (max-width: 640px) {
  .timeline::before { left: 6px; }
  .prose .tl { grid-template-columns: 1fr; padding-left: 2rem; }
  .tl::before { left: 0; }
  .tl.is-now::before { left: -2px; }
  .prose .tl-when { text-align: left; margin-bottom: .1rem; white-space: normal; }
  .cv-id { border-radius: 16px; }
  .impact-list, .skill-grid, .sup-grid { grid-template-columns: 1fr; }
  .sup-grid dd { margin-bottom: .5rem; }
  .award-list li { grid-template-columns: 3.4rem minmax(0, 1fr); }
}

/* ---------- print (Save as PDF) ---------- */
@media print {
  @page { margin: 16mm 15mm; }
  body { background: #fff; font-size: 10.5pt; color: #111; }
  .announce, .nav, .foot, .rail, .mini-bokeh, .btn-print, .skip { display: none !important; }
  .page-head { padding: 0 0 6mm; }
  .page-head h1 { font-size: 22pt; }
  .layout, .layout.has-rail { display: block; padding: 0; max-width: none; }
  .prose { max-width: none; border: 0; padding: 0; }
  .cv-id { background: #fff; color: #111; border: 1px solid #ccc; padding: 6mm; margin-bottom: 8mm; }
  .cv-id::before, .cv-id::after { display: none; }
  .cv-name, .cv-mail, .cv-affil { color: #111; }
  .cv-role, .cv-name .phd { color: var(--oxide-deep); }
  .tl::before, .timeline::before { box-shadow: none; }
  .tl.is-now::before { box-shadow: none; }
  .award-list li.is-key { background: #fff; border: 1px solid #ccc; }
  .prose .award-list li.is-key h3, .award-list li.is-key p { color: #111; }
  .impact-list li, .skill-grid > div, .sup-grid, .tag-list li { background: #fff; }
  .cv-sec { break-inside: auto; }
  .tl, .paper, .pub-list > li, .award-list li, .impact-list li, .skill-grid > div, .talk-list li { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  a { color: inherit; }
}
