/* ==========================================================================
   Zhengqian Jin — site stylesheet
   A quiet, centred, single-column reading surface.
   Hand-written; replaces the Minimal Mistakes layout entirely.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Typefaces — self-hosted.
   Google Fonts is not reachable from mainland China, so the files ship with
   the site. Variable fonts; latin loads first, latin-ext only when needed.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/newsreader-latin.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-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/newsreader-latin-ext.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-weight: 200 700;
  font-display: swap;
  src: url("/assets/fonts/newsreader-latin-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: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.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: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-ext.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: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/plex-mono-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/plex-mono-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Surface */
  --bg:            #F0EEE6;
  --bg-raised:     #F7F5EF;
  --bg-sunken:     #E8E5DA;

  /* Ink */
  --ink:           #191919;
  --ink-soft:      #56524A;
  --ink-faint:     #6E6A5F;

  /* Line */
  --rule:          #DCD7C9;
  --rule-strong:   #C4BDAB;

  /* Accent — sky blue (Manchester City family) */
  --accent:        #1F6FA8;   /* text-safe link blue                       */
  --accent-sky:    #6CABDD;   /* the sky blue itself — rules and marks only */
  --accent-strong: #15588A;   /* hover / pressed text                       */
  --accent-wash:   #DEEAF3;   /* tinted fill                                */

  /* Newspaper grain */
  --grain-opacity: .95;

  /* Type */
  --font-serif:  "Newsreader", "Iowan Old Style", "Source Serif 4", Georgia, "Songti SC", serif;
  --font-sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  --font-mono:   "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Measure */
  --measure:       47.5rem; /* 760px — prose column; figures match it exactly */
  --measure-wide:  60rem;   /* ~960px — masthead and the journal wall only */
  --gutter:        1.5rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg:            #1B1A18;
  --bg-raised:     #232120;
  --bg-sunken:     #141312;

  --ink:           #EDEAE1;
  --ink-soft:      #B5AFA3;
  --ink-faint:     #9A9488;

  --rule:          #34312C;
  --rule-strong:   #4A4640;

  --accent:        #8CC2E8;
  --accent-sky:    #6CABDD;
  --accent-strong: #B7DAF4;
  --accent-wash:   #1E2C36;

  --grain-opacity: .55;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ol, ul, pre {
  margin: 0;
  padding: 0;
}

ol, ul { list-style: none; }

img, svg, video, iframe {
  display: block;
  max-width: 100%;
}
img { height: auto; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

table { border-collapse: collapse; border-spacing: 0; }

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;         /* 17px */
  line-height: 1.7;
  font-feature-settings: "kern", "liga", "cv05";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

::selection {
  background: var(--accent-wash);
  color: var(--ink);
}

/* Newsprint grain — a fixed speckle veil over the whole page.
   Purely decorative; never intercepts pointer events.                       */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)' opacity='0.38'/%3E%3C/svg%3E");
  background-size: 260px 260px;
}
[data-theme="dark"] body::after { mix-blend-mode: screen; }

/* A second, coarser fleck layer — the odd dark speck you get in newsprint. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 199;
  pointer-events: none;
  opacity: calc(var(--grain-opacity) * .55);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.28' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 0 0 0 0 0 0 0 0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='420' height='420' filter='url(%23c)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 420px 420px;
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: calc(var(--grain-opacity) * .35); }

@media print { body::before, body::after { display: none; } }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
a:hover { color: var(--accent-strong); text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   4. Layout shell
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--wide { max-width: var(--measure-wide); }

.site-main {
  flex: 1 0 auto;
  padding-block: 4rem 6rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: .6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* --------------------------------------------------------------------------
   5. Masthead
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  max-width: var(--measure-wide);
  margin-inline: auto;
  padding: 1.05rem var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
}

.site-header__brand {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--ink);
}
.site-header__brand:hover { color: var(--ink); text-decoration: none; opacity: .7; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .25rem 1.5rem;
}

.site-nav a {
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-block: .15rem;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover {
  color: var(--ink);
  text-decoration: none;
  border-bottom-color: var(--accent);
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--rule-strong);
}

.theme-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: .875rem;
  line-height: 1;
  padding: .35rem;
  border-radius: 999px;
}
.theme-toggle:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   6. Typography — headings
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}

.page-title {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 2.85rem);
  text-align: center;
  margin-bottom: .75rem;
}

.page-lede {
  text-align: center;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 34rem;
  margin: 0 auto 3.5rem;
}

.page-header--centred { margin-bottom: 3.25rem; }

/* --------------------------------------------------------------------------
   7. Prose
   -------------------------------------------------------------------------- */

.prose { font-size: 1.0625rem; }

.prose > * + * { margin-top: 1.35em; }

.prose h2 {
  font-size: 1.6rem;
  margin-top: 3.5rem;
  margin-bottom: 1.1rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--rule);
}

.prose h3 {
  font-size: 1.24rem;
  margin-top: 2.5rem;
  margin-bottom: .7rem;
}

.prose h4 {
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 2rem;
  margin-bottom: .5rem;
}

.prose p { color: var(--ink); }

.prose a {
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.prose a:hover {
  text-decoration: none;
  border-bottom-color: var(--accent);
}

.prose strong { font-weight: 600; }

.prose ul, .prose ol {
  padding-left: 1.35em;
  margin-top: 1.1em;
}
.prose ul { list-style: none; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .45em; }
.prose ul > li { position: relative; }
.prose ul > li::before {
  content: "";
  position: absolute;
  left: -1em;
  top: .78em;
  width: .3em;
  height: 1px;
  background: var(--rule-strong);
}
.prose ol::marker, .prose li::marker { color: var(--ink-faint); }

.prose blockquote {
  border-left: 2px solid var(--accent-sky);
  padding-left: 1.25rem;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin-block: 3rem;
}

.prose img { margin-inline: auto; }

.prose figure { margin-block: 2.5rem; }
.prose figcaption,
figcaption {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--ink-faint);
  text-align: center;
  margin-top: .85rem;
}

/* Code */
.prose code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .1em .35em;
}
.prose pre {
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

/* Tables */
.prose table {
  width: 100%;
  font-size: .9375rem;
  margin-block: 2rem;
}
.prose thead th {
  text-align: left;
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule-strong);
  padding: .5rem .7rem;
}
.prose tbody td {
  border-bottom: 1px solid var(--rule);
  padding: .6rem .7rem;
  vertical-align: top;
}
.prose tbody tr:last-child td { border-bottom: 0; }
/* Borderless tables (e.g. the education block) opt out */
.prose table.plain, .prose table.plain td, .prose table.plain th {
  border: 0 !important;
}

/* --------------------------------------------------------------------------
   8. Home — hero
   -------------------------------------------------------------------------- */

.hero {
  text-align: center;
  padding-bottom: 3rem;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--rule);
}

.hero__avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 1px solid var(--rule);
  filter: saturate(.95);
}

.hero__name {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: .4rem;
}

.hero__role {
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
}

.hero__motto {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 30rem;
  margin: 0 auto 1.75rem;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8125rem;
  letter-spacing: .02em;
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: .3rem .9rem;
  background: transparent;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-wash);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   9. Definition-style rows (education, positions)
   -------------------------------------------------------------------------- */

.entry-list { margin-top: 1.5rem; }

.entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: .35rem 1.5rem;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.entry:last-child { border-bottom: 0; }

/* two-column variant: body on the left, date flush right */
.entry--dated { grid-template-columns: 1fr auto; }
.entry--dated .entry__date {
  grid-column: 2;
  grid-row: 1;
  margin-top: .3rem;
  text-align: right;
  white-space: nowrap;
}

.entry__title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: .15rem;
}
.entry__meta {
  font-size: .9375rem;
  color: var(--ink-soft);
  line-height: 1.55;
}
.entry__date {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .04em;
  color: var(--ink-faint);
  margin-top: .3rem;
}

/* --------------------------------------------------------------------------
   10. Publication list
   -------------------------------------------------------------------------- */

.pub-note {
  font-size: .8125rem;
  color: var(--ink-faint);
  text-align: center;
  margin-bottom: 2.5rem;
}

.pub-list { margin-top: 1rem; }

.pub {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 1.75rem;
  padding-block: 2rem;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.pub:first-child { padding-top: 0; }
.pub:last-child { border-bottom: 0; }
.pub--no-thumb { grid-template-columns: 1fr; }

.pub__thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 16px -10px rgba(0,0,0,.35);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease),
              transform .25s var(--ease);
}
[data-theme="dark"] .pub__thumb { background: #f3f1ee; }
.pub:hover .pub__thumb {
  border-color: var(--rule-strong);
  box-shadow: 0 2px 4px rgba(0,0,0,.07), 0 14px 30px -14px rgba(0,0,0,.45);
  transform: translateY(-2px);
}

.pub__index {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--ink-faint);
}
.pub__index::after {
  content: "";
  display: inline-block;
  width: 1.1rem;
  height: 1px;
  background: var(--rule-strong);
  vertical-align: .28em;
  margin: 0 .1rem 0 .45rem;
}

.pub__year {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--ink-faint);
  display: block;
  margin-bottom: .4rem;
}

.pub__title {
  font-family: var(--font-serif);
  font-size: 1.16rem;
  line-height: 1.35;
  margin-bottom: .5rem;
}
.pub__title a { color: var(--ink); }
.pub__title a:hover { color: var(--accent); text-decoration: none; }

.pub__authors {
  font-size: .9rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: .35rem;
}
.pub__authors b, .pub__authors strong { color: var(--ink); font-weight: 600; }

.pub__venue {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .9375rem;
  color: var(--ink-soft);
}

.pub__excerpt {
  font-size: .9375rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-top: .5rem;
}
.pub__excerpt p + p { margin-top: .8em; }
.pub__excerpt img {
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: none !important;
  margin-block: 1.25rem;
}

.pub__actions {
  margin-top: .7rem;
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.pub__actions a {
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   11. Post / archive list
   -------------------------------------------------------------------------- */

.year-heading {
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--ink-faint);
  margin-top: 3.25rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
}
.year-heading:first-of-type { margin-top: 0; }

.post-item {
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--rule);
}
.post-item:last-child { border-bottom: 0; }

.post-item__meta {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .05em;
  color: var(--ink-faint);
  margin-bottom: .35rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-item__title {
  font-size: 1.2rem;
  line-height: 1.35;
  margin-bottom: .35rem;
}
.post-item__title a { color: var(--ink); }
.post-item__title a:hover { color: var(--accent); text-decoration: none; }

.post-item__excerpt {
  font-size: .9375rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 2px;
  padding: .05rem .4rem;
  line-height: 1.5;
}

/* Article header (single post) */
.article-header {
  text-align: center;
  padding-bottom: 2.25rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}
.article-header .page-title { margin-bottom: 1rem; }
.article-header__meta {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--ink-faint);
  display: flex;
  justify-content: center;
  gap: .9rem;
  flex-wrap: wrap;
}
.article-header__authors {
  font-size: .9375rem;
  color: var(--ink-soft);
  margin-bottom: .6rem;
}

/* --------------------------------------------------------------------------
   12. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: .6rem 1.15rem;
  cursor: pointer;
}
.btn:hover {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
  text-decoration: none;
}
.btn--accent { border-color: var(--accent); color: var(--accent); }
.btn--accent:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.btn-row {
  display: flex;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-block: 2rem;
}

/* --------------------------------------------------------------------------
   13. Card grid (toolkit)
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.4rem;
  background: var(--bg-raised);
  color: inherit;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.card:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
  text-decoration: none;
}

.card__shot {
  width: calc(100% + 2.8rem);
  margin: -1.4rem -1.4rem 1.15rem;
  height: 9.5rem;
  object-fit: cover;
  object-position: top center;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-sunken);
  filter: grayscale(.55) contrast(.95);
  transition: filter .3s var(--ease);
}
.card:hover .card__shot { filter: none; }

.card__eyebrow {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .6rem;
}
.card__title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: .4rem;
}
.card__desc {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--ink-soft);
  flex: 1;
}
.card__cta {
  margin-top: 1rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   14. Gallery
   -------------------------------------------------------------------------- */

.gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.5rem;
  margin-block: 3rem;
  /* figures sit flush with the prose column — one measure for the whole page */
  width: 100%;
}

.gallery figure {
  width: 100%;
  margin: 0;
  text-align: center;
}

.gallery img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg-raised);
  transition: border-color .3s var(--ease);
}
.gallery a:hover img { border-color: var(--accent); }

.gallery figcaption { max-width: 40rem; margin-inline: auto; }
.gallery figcaption .src {
  display: block;
  margin-top: .5rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .03em;
}

/* --------------------------------------------------------------------------
   14b. Journal wall — scattered masthead names, not a single bitmap
   -------------------------------------------------------------------------- */

.journal-wall {
  max-width: var(--measure-wide);
  margin: 2.5rem auto 0;
  padding: 2.75rem 1rem 3rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: .7rem 1.7rem;
  position: relative;
}

/* faint halftone tint behind the wall, so it reads as a printed panel */
.journal-wall::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: radial-gradient(var(--rule) .5px, transparent .5px);
  background-size: 7px 7px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 25%, transparent 78%);
}

.journal-wall > * {
  position: relative;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink-soft);
  white-space: nowrap;
  letter-spacing: -0.005em;
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.journal-wall a:hover {
  color: var(--accent-strong);
  text-decoration: none;
  transform: translateY(-2px);
}

/* size tiers */
.jw-xl { font-size: 1.9rem; }
.jw-l  { font-size: 1.45rem; }
.jw-m  { font-size: 1.15rem; }
.jw-s  { font-size: .95rem; }
.jw-xs { font-size: .8rem; color: var(--ink-faint); }

/* voice tiers — a few set in the grotesque, a few italic, so the block
   reads like a rack of different mastheads rather than one typeface       */
.jw-sans   { font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.02em; }
.jw-italic { font-style: italic; }
.jw-caps   { font-family: var(--font-sans); font-weight: 700; text-transform: uppercase;
             letter-spacing: .02em; font-size: .9em; }
.jw-light  { font-weight: 300; }
.jw-sky    { color: var(--accent); }

/* scatter — nudge every few items off the baseline */
.journal-wall > *:nth-child(3n)   { transform: translateY(-.28em); }
.journal-wall > *:nth-child(4n)   { transform: translateY(.24em); }
.journal-wall > *:nth-child(7n)   { transform: translateY(-.5em) rotate(-1.1deg); }
.journal-wall > *:nth-child(11n)  { transform: translateY(.42em) rotate(1.3deg); }
.journal-wall a:nth-child(3n):hover,
.journal-wall a:nth-child(4n):hover,
.journal-wall a:nth-child(7n):hover,
.journal-wall a:nth-child(11n):hover { transform: translateY(-.6em); }

.journal-wall__note {
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 1.75rem;
}

@media (max-width: 40rem) {
  .journal-wall { gap: .5rem 1.1rem; padding: 2rem .5rem 2.25rem; }
  .jw-xl { font-size: 1.4rem; }
  .jw-l  { font-size: 1.15rem; }
  .jw-m  { font-size: 1rem; }
  .jw-s  { font-size: .875rem; }
  .jw-xs { font-size: .75rem; }
}

/* --------------------------------------------------------------------------
   15. Embedded documents
   -------------------------------------------------------------------------- */

.doc-embed {
  width: 100%;
  height: min(85vh, 60rem);
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg-raised);
  margin-block: 2rem;
}

.notice {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent-sky);
  background: var(--bg-raised);
  border-radius: 0 3px 3px 0;
  padding: 1rem 1.25rem;
  font-size: .9375rem;
  color: var(--ink-soft);
  margin-block: 2rem;
}
.notice strong { color: var(--ink); }

/* Affiliation footnote block under an article header */
.affiliation {
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--ink-faint);
  text-align: center;
  max-width: 38rem;
  margin-inline: auto;
}

/* Numbered CV list */
.cv-list {
  counter-reset: cv;
  margin-top: 1.25rem;
  font-size: .9375rem;
  line-height: 1.6;
}
.cv-list li {
  position: relative;
  padding-left: 2.4rem;
  padding-block: .85rem;
  border-bottom: 1px solid var(--rule);
}
.cv-list li:last-child { border-bottom: 0; }
.cv-list li::before {
  counter-increment: cv;
  content: counter(cv);
  position: absolute;
  left: 0;
  top: .95rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--ink-faint);
}
.cv-list li::marker { content: none; }
.cv-list a { color: var(--ink); font-family: var(--font-serif); font-size: 1.05rem; }
.cv-list a:hover { color: var(--accent); text-decoration: none; }
.cv-list__authors,
.cv-list__venue { display: block; color: var(--ink-soft); font-size: .875rem; }
.cv-list__authors { margin-bottom: .15rem; }
.cv-list__venue  { font-family: var(--font-serif); font-style: italic; margin-top: .15rem; }
.cv-list b, .cv-list strong { color: var(--ink); font-weight: 600; }

/* Reference list at the end of an article */
.references {
  margin-top: 1.5rem;
  font-size: .875rem;
  line-height: 1.65;
  color: var(--ink-soft);
  counter-reset: ref;
}
.references li {
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: .7rem;
}
.references li::before {
  counter-increment: ref;
  content: counter(ref) ".";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--ink-faint);
}
.references li::marker { content: none; }

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3rem;
  text-align: center;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.site-footer__links a {
  font-size: .8125rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.site-footer__links a:hover { color: var(--accent); text-decoration: none; }

.site-footer__fine {
  font-size: .75rem;
  line-height: 1.7;
  color: var(--ink-faint);
}
.site-footer__fine a { color: var(--ink-faint); text-decoration: underline; }
.site-footer__fine a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   17. Utilities
   -------------------------------------------------------------------------- */

.centred { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.stack-lg > * + * { margin-top: 3.5rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .site-main { padding-block: 2.5rem 4rem; }
  .pub { grid-template-columns: 1fr; gap: 1rem; }
  .pub__thumb { max-width: 18rem; aspect-ratio: 16 / 10; }
  .entry--dated { grid-template-columns: 1fr; }
  .entry--dated .entry__date { grid-column: 1; grid-row: auto; text-align: left; }
  .gallery { gap: 2.5rem; }
  .site-nav { gap: .25rem 1rem; }
  .site-nav a { font-size: .75rem; letter-spacing: .05em; }
  .doc-embed { height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   19. Print
   -------------------------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .btn-row, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
}

/* --------------------------------------------------------------------------
   19. Lightbox — click a figure to enlarge, click again (or Esc) to close
   -------------------------------------------------------------------------- */

.zoomable { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg-sunken) 92%, #000);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), visibility .22s var(--ease);
}
.lightbox[data-open="true"] { opacity: 1; visibility: visible; }

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 3px;
  padding: 8px;
  box-shadow: 0 24px 70px -20px rgba(0,0,0,.6);
  transform: scale(.97);
  transition: transform .22s var(--ease);
}
.lightbox[data-open="true"] .lightbox__img { transform: scale(1); }

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.lightbox__close:hover { background: var(--ink); color: var(--bg); }

.lightbox__cap {
  position: absolute;
  left: 0; right: 0; bottom: 1.1rem;
  margin-inline: auto;
  max-width: 44rem;
  padding-inline: 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .03em;
  color: var(--ink-faint);
}

@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox__img { transition: none; }
}

/* --------------------------------------------------------------------------
   20. Journal wall — official marks where they exist, wordmarks where not
   -------------------------------------------------------------------------- */

.journal-wall--logos {
  align-items: center;
  gap: 1.4rem 2.1rem;
}
/* the scattered/rotated treatment suits type, not logo cards — flatten it */
.journal-wall--logos > *,
.journal-wall--logos > *:nth-child(3n),
.journal-wall--logos > *:nth-child(4n),
.journal-wall--logos > *:nth-child(7n),
.journal-wall--logos > *:nth-child(11n) { transform: none; }
.journal-wall--logos a:hover,
.journal-wall--logos a:nth-child(3n):hover,
.journal-wall--logos a:nth-child(4n):hover,
.journal-wall--logos a:nth-child(7n):hover,
.journal-wall--logos a:nth-child(11n):hover { transform: translateY(-3px); }

.jw-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem .7rem;
  border-radius: 3px;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              border-color .2s var(--ease);
}
.jw-logo img {
  display: block;
  height: var(--jw-h, 2.4rem);
  width: auto;
  max-width: 12rem;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: none;
}
.jw-logo:hover {
  transform: translateY(-3px);
  border-color: var(--rule-strong);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.4);
  text-decoration: none;
}

/* journals with no obtainable mark fall back to type, sized the same */
.jw-word {
  display: inline-flex;
  align-items: center;
  padding: .55rem .85rem;
  min-height: var(--jw-h, 2.4rem);
  border-radius: 3px;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  font-family: var(--font-sans);
  font-weight: 650;
  font-size: .9rem;
  letter-spacing: -0.015em;
  color: #2a2724;
  white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              border-color .2s var(--ease);
}
.jw-word:hover {
  transform: translateY(-3px);
  border-color: var(--rule-strong);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.4);
  text-decoration: none;
  color: #2a2724;
}

/* papers-published weighting — more papers, bigger mark */
.jw-w3 { --jw-h: 3.1rem; font-size: 1.05rem; }
.jw-w2 { --jw-h: 2.6rem; font-size: .95rem; }
.jw-w1 { --jw-h: 2.1rem; font-size: .85rem; }

.jw-count {
  margin-left: .5rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: .04em;
}

@media (max-width: 40rem) {
  .journal-wall--logos { gap: 1rem 1.2rem; padding: 2rem .5rem 2.25rem; }
  .jw-w3 { --jw-h: 2.3rem; font-size: .9rem; }
  .jw-w2 { --jw-h: 2rem;   font-size: .82rem; }
  .jw-w1 { --jw-h: 1.75rem; font-size: .76rem; }
  .jw-logo img { max-width: 8.5rem; }
}

/* --------------------------------------------------------------------------
   21. Education & Position — institution crests
   -------------------------------------------------------------------------- */

.entry--crest {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 1.1rem;
  align-items: start;
}
/* .entry--dated pins the date to column 2; with a crest it belongs in 3 */
.entry--crest .entry__date { grid-column: 3; grid-row: 1; }
.entry__crest {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 0;
  background: none;
  border-radius: 0;
}
@media (max-width: 40rem) {
  .entry--crest { grid-template-columns: 44px 1fr; gap: .9rem; }
  .entry--crest .entry__date { grid-column: 2; }
  .entry__crest { width: 44px; height: 44px; }
}

/* Writing archive — closing note */
.archive-tail {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: .9375rem;
  color: var(--ink-faint);
}

/* Figures respond to the zoom affordance even without a wrapping link */
.gallery img.zoomable { transition: border-color .3s var(--ease), transform .3s var(--ease); }
.gallery img.zoomable:hover { border-color: var(--accent); transform: translateY(-2px); }

@media (max-width: 40rem) {
  .pub__thumb { max-width: 18rem; }
}
