/**
 * Ketryn — all site styles (ported 1:1 from the Astro site).
 * Sections: tokens · base · shared classes · components (parts/) · pages (templates/).
 * Each component/page block is scoped under its own root class.
 */

/* ================================================================ tokens */
:root {
  --ink: #20014b; /* text, buttons */
  --accent: #30fd96; /* hover / active */
  --bg: #ffffff;
  --grey-dark: #616161; /* secondary text */
  --line: rgba(32, 1, 75, 0.12); /* hairlines */
  --soft: #f6f5f9; /* image placeholders */

  --ff: 'Montserrat', system-ui, sans-serif;
  --gutter: clamp(16px, 2.2vw, 32px);
  --max: 1440px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Lenis (smooth scroll) takes over when active */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.55 var(--ff);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; }
button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ======================================================== shared classes */
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: clamp(72px, 10vw, 140px); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: clamp(28px, 4vw, 48px);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.label { font-size: 12px; font-weight: 500; letter-spacing: 0.1em; line-height: 1.4; text-transform: uppercase; color: var(--grey-dark); }
.label--ink { color: var(--ink); }
.display { font-size: clamp(40px, 6vw, 88px); font-weight: 800; letter-spacing: -0.04em; line-height: 0.92; }
.statement { max-width: 22ch; font-size: clamp(20px, 2.2vw, 30px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.12; }
.body-lg { max-width: 60ch; font-size: 15px; color: var(--grey-dark); }
.muted { color: var(--grey-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn:hover { background: var(--accent); color: var(--ink); }
.btn:active { transform: scale(0.97); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.25s var(--ease), gap 0.3s var(--ease);
}
.link-arrow:hover { color: var(--accent); gap: 14px; }

/* Hidden only when JS runs (assets/js/site.js adds .is-in); --d staggers items. */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Image box with a fixed aspect ratio (set it on the element). */
.ratio { position: relative; overflow: hidden; background: var(--soft); }
.ratio > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Responsive video embed (used inside imported texts). */
.embed { position: relative; aspect-ratio: 16 / 9; margin: 2em 0; background: var(--soft); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Long-form text (editor content). */
.prose { max-width: 68ch; font-size: 16px; line-height: 1.7; color: #2b2340; }
.prose > * + * { margin-top: 1.1em; }
.prose :is(h1, h2, h3, h4) { margin-top: 2em; line-height: 1.15; color: var(--ink); }
.prose h1 { font-size: 1.9em; }
.prose h2 { font-size: 1.55em; }
.prose h3 { font-size: 1.25em; }
.prose h4 { font-size: 1.05em; }
.prose strong { color: var(--ink); }
.prose a {
  color: var(--ink);
  text-decoration: underline 2px var(--accent);
  text-underline-offset: 3px;
  transition: background-color 0.2s;
}
.prose a:hover { background: var(--accent); }
.prose img { width: 100%; height: auto; margin: 2em 0; }
.prose blockquote { margin: 1.6em 0; padding-left: 1.2em; border-left: 3px solid var(--accent); color: var(--grey-dark); }
.prose :is(ul, ol) { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line); }
.prose iframe:not(.embed iframe) { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }
.prose audio { width: 100%; }
/* WordPress editor extras */
.prose .aligncenter { margin-inline: auto; }
.prose .wp-caption { max-width: 100%; }
.prose .wp-caption-text { margin-top: 0.5em; font-size: 13px; color: var(--grey-dark); }

/* ============================================================= nav (parts/nav.php) */
.nav {
  position: fixed;
  inset: 16px var(--gutter) auto;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.admin-bar .nav { top: calc(16px + var(--wp-admin--admin-bar--height, 32px)); }
.nav > * { pointer-events: auto; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 0 0 1px var(--line), 0 6px 24px -12px rgba(32, 1, 75, 0.25);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.pill--logo {
  justify-self: start;
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
  text-transform: uppercase;
  box-shadow: none;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.pill--logo:hover { background: var(--accent); color: var(--ink); }

.pill--links { padding: 0 6px; gap: 2px; }
.pill--links a {
  position: relative;
  padding: 8px 12px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.pill--links a:hover,
.pill--links a.active { color: var(--accent); }
.pill--links a.active::after {
  content: '';
  position: absolute;
  left: calc(50% - 2px);
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-right { justify-self: end; display: flex; gap: 8px; }
.pill--lang { padding: 0 14px; gap: 6px; color: var(--grey-dark); }
.pill--lang a { transition: color 0.2s; }
.pill--lang a:hover { color: var(--accent); }
.pill--lang a.on { color: var(--ink); }

.pill--status { padding: 0 16px; gap: 8px; text-transform: uppercase; white-space: nowrap; transition: color 0.25s; }
.pill--status:hover { color: var(--grey-dark); }
.pill--status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: ping 2.2s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(48, 253, 150, 0.7); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(48, 253, 150, 0); }
}

.pill--burger { display: none; width: 40px; flex-direction: column; justify-content: center; gap: 5px; }
.pill--burger b { width: 14px; height: 1.5px; margin-inline: auto; background: var(--ink); transition: transform 0.35s var(--ease); }
.pill--burger[aria-expanded='true'] b:first-of-type { transform: translateY(3.25px) rotate(45deg); }
.pill--burger[aria-expanded='true'] b:last-of-type { transform: translateY(-3.25px) rotate(-45deg); }

/* full-screen menu (small screens) */
.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  padding-bottom: 48px;
  background: #fff;
}
.menu[hidden] { display: none; }
.menu-links { display: flex; flex-direction: column; }
.menu-links a {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(20px, 5.4vw, 28px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(16px);
  animation: menuIn 0.6s var(--ease) forwards;
  animation-delay: calc(var(--i) * 40ms);
  transition: color 0.2s, padding-left 0.35s var(--ease);
}
.menu-links a:hover,
.menu-links a.active { color: var(--accent); padding-left: 10px; }
@keyframes menuIn { to { opacity: 1; transform: none; } }

/* 7 links need ~790px: hide the status pill first, then switch to the burger menu */
@media (max-width: 1500px) {
  .pill--status { display: none; }
}
@media (max-width: 1100px) {
  .nav { grid-template-columns: 1fr auto; }
  .pill--links { display: none; }
  .pill--burger { display: inline-flex; }
}

/* ======================================================= footer (parts/footer.php) */
.site-footer { border-top: 1px solid var(--line); }

.site-footer .cols { display: grid; grid-template-columns: 3fr 1fr; gap: 32px; padding-block: 64px 48px; }
.site-footer .col { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.site-footer .col .label { margin-bottom: 10px; }
.site-footer .col a { width: fit-content; transition: color 0.2s; }
.site-footer .col a:hover { color: var(--accent); }
.site-footer .col--id .muted { max-width: 30ch; }

.site-footer .strip { overflow: hidden; padding-block: 8px; }
.site-footer .strip-track { display: flex; gap: 8px; width: max-content; animation: strip 60s linear infinite; }
.site-footer .strip:hover .strip-track { animation-play-state: paused; }
.site-footer .strip img { height: 120px; width: auto; aspect-ratio: 4 / 3; object-fit: cover; filter: grayscale(1); transition: filter 0.4s; }
.site-footer .strip img:hover { filter: none; }
@keyframes strip { to { transform: translateX(-50%); } }

.site-footer .bottom { display: flex; justify-content: space-between; align-items: center; padding-block: 24px 32px; }

@media (max-width: 860px) {
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .site-footer .col--id { grid-column: 1 / -1; }
  .site-footer .strip img { height: 84px; }
}

/* =========================================================== hero (parts/hero.php) */
.hero { position: relative; height: 100svh; min-height: 640px; overflow: hidden; isolation: isolate; }
.hero .field { position: absolute; inset: 0; }

.hero .card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z);
  width: calc(var(--w) * 1vw);
  aspect-ratio: var(--ratio);
  will-change: transform;
  opacity: 0;
  animation: cardIn 1.1s var(--ease) forwards;
  animation-delay: calc(0.15s + var(--i) * 70ms);
}
@keyframes cardIn {
  from { opacity: 0; scale: 0.86; }
  to { opacity: 1; scale: 1; }
}
.hero .card-inner {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--soft);
  transform: rotate(var(--tilt));
  box-shadow: 0 24px 50px -28px rgba(32, 1, 75, 0.45);
  transition: transform 0.6s var(--ease), opacity 0.5s var(--ease), filter 0.5s var(--ease), box-shadow 0.6s var(--ease);
}
.hero .card img { width: 100%; height: 100%; object-fit: cover; user-select: none; transition: transform 0.8s var(--ease); }

/* hovering one card dims the others */
.hero .field.has-hover .card-inner { opacity: 0.28; filter: grayscale(0.9); }
.hero .field.has-hover .card.is-hover { z-index: 20; }
.hero .field.has-hover .card.is-hover .card-inner {
  opacity: 1;
  filter: none;
  transform: rotate(0deg) scale(1.06);
  box-shadow: 0 0 0 3px var(--accent), 0 40px 80px -30px rgba(32, 1, 75, 0.55);
}
.hero .card.is-hover img { transform: scale(1.06); }

/* white gradient behind the name */
.hero .fade {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 25;
  height: 46%;
  pointer-events: none;
  background: linear-gradient(to top, #fff 18%, rgba(255, 255, 255, 0.85) 45%, rgba(255, 255, 255, 0));
}

.hero .copy {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  max-width: none;
  padding-bottom: clamp(28px, 4vw, 48px);
  pointer-events: none;
}
.hero .name { margin: 14px 0 18px; }
.hero .lead { font-size: 14px; color: var(--grey-dark); }
.hero .hover-title {
  min-height: 1.4em;
  text-align: right;
  color: var(--ink);
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.hero .hover-title.on { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .hero .card { width: calc(var(--w) * 1.9vw); }
  .hero .card:nth-child(n + 8) { display: none; }
  .hero .copy { flex-direction: column; align-items: flex-start; }
  .hero .hover-title { text-align: left; }
}

/* =================================================== work list (parts/work-list.php) */
.worklist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.worklist li { border-bottom: 1px solid var(--line); }
.worklist .row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 70px 36px;
  align-items: center;
  gap: 16px;
  padding: clamp(18px, 2.2vw, 28px) 0;
  transition: transform 0.55s var(--ease);
}
.worklist .title { font-size: clamp(18px, 2vw, 28px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.worklist .year { text-align: right; }
.worklist .arrow { display: grid; place-items: center; transform: rotate(-45deg); transition: color 0.3s var(--ease), transform 0.55s var(--ease); }
.worklist .row:hover { transform: translateX(clamp(10px, 1.6vw, 24px)); }
.worklist .row:hover .arrow { color: var(--accent); transform: rotate(0deg) translateX(-4px); }

.worklist-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 45;
  width: 280px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  scale: 0.85;
  box-shadow: 0 30px 60px -30px rgba(32, 1, 75, 0.5);
  transition: opacity 0.35s var(--ease), scale 0.45s var(--ease);
}
.worklist-preview.on { opacity: 1; scale: 1; }
.worklist-preview img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 760px) {
  .worklist .row { grid-template-columns: 1fr 28px; row-gap: 4px; }
  .worklist .meta { grid-column: 1; grid-row: 2; }
  .worklist .year { display: none; }
  .worklist .arrow { grid-column: 2; grid-row: 1 / span 2; }
  .worklist-preview { display: none; }
}

/* ================================================= page header (parts/page-header.php) */
.page-header {
  /* the fixed nav covers the first 56px; this keeps a tight gap below it */
  padding-top: clamp(84px, calc(14px + 9vw), 124px);
  padding-bottom: clamp(48px, 6vw, 88px);
  display: grid;
  gap: 22px;
}
.page-header .display { font-size: clamp(34px, 4.8vw, 72px); max-width: 14ch; }
.page-header .intro { display: grid; gap: 14px; }
.page-header .intro.wide .body-lg { max-width: none; }

/* ================================================== next link (parts/next-link.php) */
.next {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px 24px;
  padding-block: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--line);
}
.next .label { grid-column: 1 / -1; }
.next .next-title { font-size: clamp(26px, 3.4vw, 48px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; transition: transform 0.55s var(--ease); }
.next .next-arrow { font-size: clamp(24px, 3vw, 40px); transition: color 0.3s, transform 0.55s var(--ease); }
.next:hover .next-title { transform: translateX(16px); }
.next:hover .next-arrow { color: var(--accent); transform: translateX(8px); }

.next.compact { max-width: 860px; padding-block: 56px 72px; }
.next.compact .next-title { font-size: clamp(22px, 2.4vw, 32px); letter-spacing: -0.03em; line-height: 1.05; }
.next.compact .next-arrow { font-size: 36px; }
.next.compact:hover .next-title { transform: translateX(12px); }
.next.compact:hover .next-arrow { transform: translateX(6px); }

/* ======================================= academic events (parts/publication-list.php) */
.pubs { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.pubs li { border-bottom: 1px solid var(--line); }
.pubs .pub {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: clamp(18px, 2.2vw, 26px) 0;
  transition: transform 0.55s var(--ease);
}
/* same type as the info line (.label), bold and in ink */
.pubs .title { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; line-height: 1.4; text-transform: uppercase; }
.pubs .download { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; transition: color 0.3s var(--ease); }
.pubs a.pub:hover { transform: translateX(clamp(10px, 1.6vw, 24px)); }
.pubs a.pub:hover .download { color: var(--accent); }

@media (max-width: 860px) {
  .pubs .pub { grid-template-columns: 1fr auto; row-gap: 4px; }
  .pubs .info { grid-column: 1; grid-row: 2; }
  .pubs .download { grid-column: 2; grid-row: 1 / span 2; }
}

/* ===================================================== post card (parts/post-card.php) */
.post-card { display: grid; gap: 12px; align-content: start; }
.post-card .media { aspect-ratio: 4 / 3; margin-bottom: 6px; }
.post-card .media img { transition: transform 1s var(--ease); }
.post-card:hover .media img { transform: scale(1.05); }
.post-card h3 { font-size: 18px; letter-spacing: -0.02em; line-height: 1.15; transition: color 0.25s; }
.post-card:hover h3 { color: var(--accent); }
.post-card .excerpt { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================ home (templates/home.php) */
/* ticker: the words are rendered twice so the loop is seamless */
.ticker { overflow: hidden; padding-block: 18px; border-block: 1px solid var(--line); white-space: nowrap; }
.ticker-track { display: inline-flex; animation: ticker 40s linear infinite; }
.ticker span { display: inline-flex; align-items: center; gap: 28px; padding-right: 28px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.ticker i { font-style: normal; font-size: 14px; color: var(--accent); }
@keyframes ticker { to { transform: translateX(-50%); } }

.home-intro .intro-grid { display: grid; grid-template-columns: 1.5fr 1fr; align-items: end; gap: clamp(32px, 6vw, 96px); }
.home-intro .statement { max-width: 24ch; }
.home-intro .intro-body { display: grid; justify-items: start; gap: 16px; }
.home-intro .intro-text p + p { margin-top: 16px; }

.home-work { padding-top: 0; }

.home-practice .practice-grid { display: grid; grid-template-columns: 1fr 1.3fr; align-items: start; gap: clamp(32px, 6vw, 96px); }
.home-practice .portrait { position: sticky; top: 96px; aspect-ratio: 4 / 5; }
.home-practice .practice-list { margin: 0; padding: 0; list-style: none; }
.home-practice .practice-list li { display: grid; justify-items: start; gap: 12px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.home-practice .practice-list li:first-child { padding-top: 0; }
.home-practice .practice-list h3 { font-size: clamp(20px, 2vw, 28px); letter-spacing: -0.03em; }
.home-practice .practice-list p { max-width: 48ch; }

.home-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

@media (max-width: 860px) {
  .home-intro .intro-grid, .home-practice .practice-grid { grid-template-columns: 1fr; }
  .home-practice .portrait { position: static; }
  .home-posts { grid-template-columns: 1fr; }
}

/* ===================================================== category (templates/category.php) */
.listing { padding-bottom: clamp(72px, 10vw, 140px); }
.listing .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(36px, 4vw, 56px) clamp(14px, 1.6vw, 24px); }

.listing .media { aspect-ratio: 4 / 3; }
.listing .media img { transition: transform 1.1s var(--ease); }
.listing .card:hover .media img { transform: scale(1.04); }

.listing .caption { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px; margin-top: 16px; }
.listing h2 { margin-bottom: 6px; font-size: clamp(18px, 1.6vw, 24px); letter-spacing: -0.025em; }
.listing .arrow { font-size: 22px; transition: transform 0.45s var(--ease), color 0.3s; }
.listing .card:hover .arrow { color: var(--accent); transform: translateX(6px); }

.listing .note { max-width: 70ch; margin-top: clamp(56px, 7vw, 96px); }
.listing .note a { color: var(--ink); text-decoration: underline var(--accent); text-underline-offset: 3px; }

@media (max-width: 1024px) {
  .listing .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .listing .grid { grid-template-columns: 1fr; }
}

/* ======================================================= project (templates/project.php) */
.project .head { display: grid; gap: 24px; padding-top: clamp(79px, calc(14px + 8vw), 114px); padding-bottom: clamp(40px, 5vw, 64px); }
.project .back { width: fit-content; }
.project .display { max-width: 16ch; font-size: clamp(34px, 4.6vw, 68px); }
.project .meta { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 24px; margin: 12px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.project .meta dd { margin: 6px 0 0; font-weight: 800; }

.project .cover { width: 100%; max-height: 86vh; object-fit: cover; }

.project .body { display: grid; justify-items: center; padding-block: clamp(56px, 8vw, 112px); }
.project .body .prose { width: 100%; }
.project .notice { width: 100%; max-width: 68ch; margin: 0 auto 18px; }

@media (max-width: 640px) {
  .project .meta { grid-template-columns: 1fr 1fr; }
}

/* ===================================================== article (templates/article.php) */
.article .narrow { max-width: 860px; }
.article .head { display: grid; gap: 22px; padding-top: clamp(79px, calc(14px + 8vw), 114px); padding-bottom: 40px; }
.article .head .link-arrow { width: fit-content; }
.article h1 { font-size: clamp(28px, 3.6vw, 48px); letter-spacing: -0.035em; line-height: 1.02; }
.article .cover { width: 100%; max-height: 70vh; object-fit: cover; }
.article .body { padding-block: clamp(48px, 6vw, 88px); }
.article .notice { margin-bottom: 18px; }

/* =================================================== research (templates/research.php) */
.research-intro { display: grid; grid-template-columns: 1.4fr 1fr; align-items: start; gap: clamp(32px, 6vw, 96px); }
.research-intro .statement { max-width: 26ch; }
.research-intro .side { display: grid; gap: 18px; }
.research-intro .text p + p { margin-top: 18px; }

/* name + academic profile links, above the facts */
.research-intro .person { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.research-intro .name { font-weight: 800; }
.research-intro .profiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.research-intro .profiles a {
  display: inline-flex;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  transition: color 0.25s, box-shadow 0.25s;
}
.research-intro .profiles a:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.research-intro .facts { display: grid; gap: 18px; margin: 16px 0 0; }
.research-intro .person + .facts { margin-top: 0; }
.research-intro .facts > div { padding-top: 14px; border-top: 1px solid var(--line); }
.research-intro .facts dd { margin: 8px 0 0; font-weight: 800; }
.research-intro .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.research-intro .chips li { padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; }

/* the posts section sits closer to the academic events list (half the usual gap) */
.research-pubs + .section { padding-top: 0; }
.research-empty { font-size: 15px; }

@media (max-width: 860px) {
  .research-intro { grid-template-columns: 1fr; }
}

/* ============================================================ blog (templates/blog.php) */
.latest { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) {
  .latest { grid-template-columns: 1fr; }
}

/* ========================================================== about (templates/about.php) */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(32px, 6vw, 112px);
  padding-top: clamp(74px, calc(14px + 7vw), 104px);
  padding-bottom: clamp(72px, 10vw, 140px);
}

.about .aside { position: sticky; top: 90px; align-self: start; display: grid; gap: 28px; }
.about .portrait { aspect-ratio: 2 / 3; }
.about .contact-card { display: grid; gap: 8px; }
.about .mail { width: fit-content; margin-bottom: 14px; font-size: 20px; font-weight: 800; transition: color 0.2s; }
.about .mail:hover { color: var(--accent); }
.about .socials { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; }
.about .socials a { font-size: 14px; text-decoration: underline var(--line); text-underline-offset: 4px; transition: color 0.2s; }
.about .socials a:hover { color: var(--accent); }

.about .text { display: grid; align-content: start; gap: 26px; }
.about .display { max-width: 12ch; font-size: clamp(34px, 4.4vw, 64px); }
.about .statement { max-width: 26ch; }
/* section titles inside the text */
.about .text .prose h2 { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); font-size: clamp(22px, 2.2vw, 30px); }
.about .btn { width: fit-content; }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about .aside { position: static; order: 2; }
  .about .portrait { aspect-ratio: 4 / 5; }
}

/* ======================================================= contact (templates/contact.php) */
.contact { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(40px, 7vw, 120px); padding-bottom: clamp(72px, 10vw, 140px); scroll-margin-top: 90px; }

.contact .form { display: grid; gap: 28px; }
.contact .honeypot { position: absolute; left: -9999px; }
.contact .row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.contact .field { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.contact input,
.contact textarea {
  padding: 8px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  resize: vertical;
  transition: border-color 0.25s;
}
.contact input:focus,
.contact textarea:focus { outline: none; border-color: var(--ink); }

.contact .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.contact .chip input { position: absolute; opacity: 0; pointer-events: none; }
.contact .chip span {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.25s, box-shadow 0.25s, color 0.25s;
}
.contact .chip span:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.contact .chip input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.contact .chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.contact .btn { justify-self: start; }
.contact .thanks { padding: 14px 18px; background: var(--accent); font-weight: 800; }
.contact .thanks.is-error { background: var(--soft); box-shadow: inset 3px 0 0 var(--ink); }

.contact .direct { display: grid; align-content: start; gap: 18px; }
.contact .mail { font-size: clamp(18px, 1.8vw, 24px); font-weight: 800; letter-spacing: -0.02em; transition: color 0.2s; }
.contact .mail:hover { color: var(--accent); }
.contact .direct ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.contact .direct li a {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  transition: padding-left 0.4s var(--ease), color 0.25s;
}
.contact .direct li a:hover { padding-left: 10px; color: var(--accent); }

@media (max-width: 860px) {
  .contact,
  .contact .row { grid-template-columns: 1fr; }
}

/* ============================================= other pages, 404 (templates/page.php, 404.php) */
.page-text { padding-bottom: clamp(72px, 10vw, 140px); }
.not-found { display: grid; justify-items: start; align-content: center; gap: 22px; min-height: 80vh; padding-top: 120px; }

/* ======================================================== reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
