/* ==========================================================================
   CIR – Information Retrieval Research Group, TH Köln
   Site stylesheet. Visual language modelled on the HugoBlox "Academic CV"
   template (academic font pack, default theme pack, rounded cards, gradient
   mesh hero, light/dark mode) – implemented as plain CSS, no build step.

   To re-brand, change the tokens in :root (light) and [data-theme="dark"].
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL) -------------------------------- */
@font-face { font-family: "Lora"; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url("../fonts/lora-latin-wght-normal.woff2") format("woff2-variations");
  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: "Lora"; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url("../fonts/lora-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: "Lora"; font-style: italic; font-display: swap; font-weight: 400 700;
  src: url("../fonts/lora-latin-wght-italic.woff2") format("woff2-variations"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2-variations");
  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: "Source Serif 4"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url("../fonts/source-serif-4-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: "Source Serif 4"; font-style: italic; font-display: swap; font-weight: 200 900;
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2-variations");
  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: "Source Serif 4"; font-style: italic; font-display: swap; font-weight: 200 900;
  src: url("../fonts/source-serif-4-latin-ext-wght-italic.woff2") format("woff2-variations");
  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: normal; font-display: swap; font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  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-display: swap; font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  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; }

/* ---------- Design tokens ---------------------------------------------- */
:root {
  /* CIR logo colours: red #c72127 → orange #e75f26 → magenta #bb2f82.
     primary = red/orange scale (600 = logo red, 500 = logo orange),
     secondary = logo magenta. --*-rgb are used for translucent tints. */
  --cir-red: #c72127;
  --cir-orange: #e75f26;
  --cir-magenta: #bb2f82;
  --cir-gradient: linear-gradient(90deg, var(--cir-red), var(--cir-orange) 50%, var(--cir-magenta));
  --primary-50:  #fff5f0;
  --primary-100: #ffe6da;
  --primary-200: #fdc8b0;
  --primary-400: #f0844f;
  --primary-500: #e75f26;
  --primary-600: #c72127;
  --primary-700: #a51b20;
  --primary-800: #86171c;
  --primary-rgb: 199, 33, 39;
  --accent-rgb: 231, 95, 38;
  --secondary-400: #d1559d;
  --secondary-500: #bb2f82;
  --secondary-600: #9d2470;
  --secondary-rgb: 187, 47, 130;

  --bg: #ffffff;
  --fg: #1c1917;
  --muted: #57534e;          /* stone-600 */
  --subtle: #78716c;         /* stone-500 */
  --border: #e7e5e4;         /* stone-200 */
  --border-soft: #f5f5f4;    /* stone-100 */
  --surface: #ffffff;        /* cards */
  --surface-2: #faf7f5;      /* warm neutral – alt sections */
  --header-bg: rgba(255, 255, 255, .88);
  --header-fg: #1c1917;
  --footer-bg: #f5f2ef;
  --footer-fg: #1c1917;
  --link: var(--primary-600);
  --link-hover: var(--primary-700);
  --chip-bg: var(--primary-100);
  --chip-fg: var(--primary-700);
  --ring: rgba(24, 24, 27, .06);
  --shadow: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.08);

  --font-heading: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: .75rem;
  --radius-lg: 1rem;
  --container: 76rem;
  --container-narrow: 52rem;
  --header-h: 4.25rem;
  color-scheme: light;
}

[data-theme="dark"] {
  --primary-50:  #2a1110;
  --primary-100: rgba(231, 95, 38, .16);
  --primary-200: #7c2d12;
  --primary-400: #f59a6b;
  --primary-500: #f0844f;
  --primary-600: #f59a6b;
  --primary-700: #fbbf9a;
  --primary-800: #fed7bf;
  --primary-rgb: 240, 132, 79;
  --secondary-400: #e07ab6;
  --secondary-500: #d1559d;

  --bg: #14110f;
  --fg: #f8fafc;
  --muted: #a1a1aa;
  --subtle: #8b8b95;
  --border: #2e2925;
  --border-soft: #241f1c;
  --surface: rgba(32, 27, 24, .75);
  --surface-2: #1b1714;
  --header-bg: rgba(20, 17, 15, .85);
  --header-fg: #f8fafc;
  --footer-bg: #1b1714;
  --footer-fg: #e5e7eb;
  --chip-bg: rgba(231, 95, 38, .16);
  --chip-fg: #fbbf9a;
  --ring: rgba(255, 255, 255, .1);
  --shadow: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.3);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.5), 0 8px 10px -6px rgba(0,0,0,.4);
  color-scheme: dark;
}

/* ---------- Base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 1.125rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: flex; flex-direction: column; min-height: 100vh;
  transition: background-color .2s ease, color .2s ease;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); line-height: 1.2; font-weight: 600; margin: 2rem 0 .75rem; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1.1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
code, pre { font-family: var(--font-mono); font-size: .9em; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; overflow-x: auto; line-height: 1.5; }
:not(pre) > code { background: var(--border-soft); padding: .1em .35em; border-radius: .3rem; }
blockquote { margin: 1.5rem 0; padding: .25rem 1.25rem; border-left: 4px solid var(--primary-500); color: var(--muted); font-style: italic; }
::selection { background: var(--primary-200); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: .5rem; z-index: 100; background: var(--primary-600); color: #fff; padding: .5rem 1rem; border-radius: var(--radius); font-family: var(--font-ui); }
.skip-link:focus { left: 1rem; }
:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: var(--container-narrow); }
@media (min-width: 640px) { .container { padding: 0 2rem; } }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header / navbar -------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: var(--header-bg); color: var(--header-fg);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--header-fg); min-width: 0; }
.brand:hover { text-decoration: none; color: var(--header-fg); }
.brand-logo { height: 2.1rem; width: auto; flex-shrink: 0; display: block; }
.brand-text { padding-left: .75rem; border-left: 1px solid var(--border); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.nav { margin-left: auto; }
.nav-list { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; }
.nav-link { display: block; padding: .45rem .75rem; border-radius: .5rem; color: var(--header-fg); font-size: .925rem; font-weight: 500; white-space: nowrap; }
.nav-link:hover { text-decoration: none; color: var(--primary-600); background: rgba(var(--primary-rgb), .08); }
.nav-link.active { color: var(--primary-600); background: rgba(var(--primary-rgb), .12); }

.header-actions { display: flex; align-items: center; gap: .25rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: .6rem; border: 0; background: transparent; color: var(--header-fg); cursor: pointer; font-size: 1.15rem; }
.icon-btn:hover { background: rgba(var(--primary-rgb), .1); color: var(--primary-600); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline-block; }
.menu-toggle { display: none; }
.menu-toggle .icon-close { display: none; }
.nav-open .menu-toggle .icon-close { display: inline-block; }
.nav-open .menu-toggle .icon-open { display: none; }

@media (max-width: 1100px) {
  .menu-toggle { display: inline-flex; }
  .nav { position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: .75rem 1.25rem 1.25rem; display: none; }
  .nav-open .nav { display: block; }
  .nav-list { flex-direction: column; }
  .nav-link { padding: .7rem .75rem; font-size: 1rem; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 480px) { .brand-sub { display: none; } }

.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--cir-gradient); }

/* ---------- Gradient mesh (HugoBlox hero background) -------------------- */
.mesh { position: relative; isolation: isolate; overflow: hidden; }
.mesh::before {
  content: ""; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 12% 20%, rgba(199, 33, 39, .14), transparent 70%),
    radial-gradient(35% 45% at 50% 0%, rgba(231, 95, 38, .14), transparent 70%),
    radial-gradient(40% 50% at 88% 18%, rgba(187, 47, 130, .14), transparent 70%),
    radial-gradient(45% 50% at 70% 90%, rgba(231, 95, 38, .10), transparent 70%);
  filter: blur(10px);
}
[data-theme="dark"] .mesh::before { opacity: 1.4; }
.mesh-top::before { inset: -6rem -10% auto; height: 40rem; -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent); mask-image: linear-gradient(to bottom, #000 40%, transparent); }

/* ---------- Page header (inner pages) ---------------------------------- */
.page-header { padding: 3.5rem 0 2.75rem; border-bottom: 1px solid var(--border); }
.page-header h1 { margin: .35rem 0 .5rem; }
.page-header .lead { margin: 0; max-width: 48rem; }
.kicker { font-family: var(--font-ui); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--primary-600); }
.kicker::before { content: ""; display: inline-block; width: 1.5rem; height: 3px; border-radius: 2px; background: var(--cir-gradient); vertical-align: middle; margin: -2px .6rem 0 0; }
.lead { font-size: 1.25rem; color: var(--muted); line-height: 1.6; }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 .5rem; font-family: var(--font-ui); font-size: .82rem; color: var(--subtle); }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; opacity: .5; }
.breadcrumb a { color: var(--subtle); }
.breadcrumb a:hover { color: var(--primary-600); }

/* ---------- Sections --------------------------------------------------- */
.section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.section-alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.section-head h2 { margin: .25rem 0 0; }
.section-title { margin: 3rem 0 1.25rem; display: flex; align-items: center; gap: .75rem; }
.section-title:first-child { margin-top: 0; }
.section-title .count { font-family: var(--font-ui); font-size: .8rem; font-weight: 600; color: var(--subtle); background: var(--border-soft); border-radius: 999px; padding: .1rem .6rem; }

/* ---------- Grid ------------------------------------------------------- */
.grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Cards ------------------------------------------------------ */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px var(--ring), var(--shadow);
  overflow: hidden; transition: transform .3s ease, box-shadow .3s ease;
}
.card.hover:hover, a.card:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--ring), var(--shadow-lg), 0 10px 30px -10px rgba(var(--primary-rgb), .25); text-decoration: none; }
a.card { color: inherit; }
.card-body { padding: 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card-media { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--border-soft), var(--border)); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-title { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin: 0; color: var(--fg); }
.card-title a { color: inherit; }
.card:hover .card-title, .card-title a:hover { color: var(--primary-600); text-decoration: none; }
.card-text { color: var(--muted); font-size: 1rem; line-height: 1.6; margin: 0; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; font-family: var(--font-ui); font-size: .8rem; color: var(--subtle); }
.card-meta > span { display: inline-flex; align-items: center; gap: .35rem; }
.card-footer { padding: .9rem 1.6rem; border-top: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-family: var(--font-ui); font-size: .875rem; }
.stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.chip, .badge {
  display: inline-flex; align-items: center; gap: .3rem; font-family: var(--font-ui);
  font-size: .75rem; font-weight: 600; line-height: 1; padding: .4rem .7rem; border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-fg); white-space: nowrap;
}
a.chip { position: relative; z-index: 2; }
a.chip:hover { text-decoration: none; background: var(--primary-600); color: #fff; }
.badge { background: var(--border-soft); color: var(--muted); border-radius: .4rem; font-weight: 500; padding: .3rem .55rem; }
.badge-teal { background: rgba(var(--secondary-rgb), .12); color: var(--secondary-600); }
[data-theme="dark"] .badge-teal { color: #e07ab6; background: rgba(187, 47, 130, .2); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }

.more-link { display: inline-flex; align-items: center; gap: .35rem; font-family: var(--font-ui); font-weight: 600; font-size: .9rem; color: var(--primary-600); }
.more-link .icon { transition: transform .2s ease; }
.more-link:hover { text-decoration: none; }
.more-link:hover .icon, .card:hover .more-link .icon { transform: translateX(3px); }

/* ---------- Buttons ---------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-ui); font-weight: 600; font-size: .95rem; padding: .75rem 1.3rem; border-radius: .65rem; border: 1px solid transparent; cursor: pointer; transition: all .2s ease; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary-600); color: #fff; box-shadow: 0 8px 20px -8px rgba(var(--primary-rgb), .55); }
.btn-primary:hover { background: var(--primary-700); color: #fff; }
[data-theme="dark"] .btn-primary { background: #c72127; }
[data-theme="dark"] .btn-primary:hover { background: #d9362b; color: #fff; }
.btn-outline { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary-500); color: var(--primary-600); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Home hero -------------------------------------------------- */
.hero { padding: 4.5rem 0 4rem; }
@media (min-width: 1024px) { .hero { padding: 6rem 0 5.5rem; } }
.hero-grid { display: grid; gap: 3rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1fr 1fr; } }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); margin: .75rem 0 1rem; letter-spacing: -.02em; }
.hero h1 .accent { background: var(--cir-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { margin-bottom: 1.75rem; }
.hero-figure { position: relative; }
.hero-figure img { display: block; width: 100%; height: auto; border-radius: 1.5rem; box-shadow: var(--shadow-lg); border: 4px solid var(--bg); }
.interests { margin-top: 2rem; }
.interests-label { font-family: var(--font-ui); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); margin-bottom: .6rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 1rem 1.25rem; margin-top: 2.25rem; max-width: 40rem; }
.stat { font-family: var(--font-ui); }
.stat strong { display: block; font-size: 1.75rem; font-weight: 700; color: var(--fg); line-height: 1.1; }
.stat span { display: block; margin-top: .3rem; font-size: .8rem; line-height: 1.35; color: var(--subtle); }

/* Quick links ("Explore") */
.quick-link { flex-direction: row; align-items: center; gap: 1rem; padding: 1.25rem 1.4rem; }
.quick-link .ql-icon { width: 2.8rem; height: 2.8rem; border-radius: .75rem; display: inline-flex; align-items: center; justify-content: center; background: var(--chip-bg); color: var(--primary-600); font-size: 1.3rem; flex-shrink: 0; }
.quick-link .ql-title, .quick-link .ql-text, .resource .url { display: block; }
.quick-link .ql-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; color: var(--fg); line-height: 1.2; }
.quick-link .ql-text { font-size: .9rem; color: var(--muted); line-height: 1.45; margin-top: .2rem; }
.quick-link:hover .ql-title { color: var(--primary-600); }

/* ---------- Prose (markdown content) ----------------------------------- */
.prose { max-width: 48rem; }
.prose-wide { max-width: none; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.6rem; margin-top: 2.5rem; }
.prose h3 { font-size: 1.3rem; margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--primary-500); }
.prose a { text-decoration: underline; text-decoration-color: rgba(var(--primary-rgb), .35); text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose img { border-radius: var(--radius); }
.prose table { width: 100%; display: block; overflow-x: auto; }
.prose :not(pre) > code { overflow-wrap: anywhere; }

/* ---------- Tables ----------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: 0 0 0 1px var(--ring), var(--shadow); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
th { text-align: left; font-family: var(--font-ui); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); background: var(--surface-2); padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: .9rem 1.1rem; border-bottom: 1px solid var(--border-soft); vertical-align: top; line-height: 1.5; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(var(--primary-rgb), .04); }
td.nowrap, .nowrap { white-space: nowrap; }
td .muted { color: var(--subtle); font-size: .9rem; }

/* ---------- People ----------------------------------------------------- */
.person-card { align-items: center; text-align: center; }
.person-card .card-body { align-items: center; padding: 1.75rem 1.25rem 1.4rem; gap: .35rem; }
.avatar { border-radius: 50%; object-fit: cover; display: block; background: var(--border-soft); }
.person-card .avatar { width: 8.5rem; height: 8.5rem; border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--ring), var(--shadow); margin-bottom: .75rem; transition: transform .3s ease; }
.person-card:hover .avatar { transform: scale(1.04); }
.person-name { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: var(--fg); line-height: 1.25; }
.person-name a { color: inherit; }
.person-card:hover .person-name a { color: var(--primary-600); text-decoration: none; }
.person-role { font-family: var(--font-ui); font-size: .85rem; color: var(--muted); }
.person-card .chips { justify-content: center; margin-top: .5rem; }
.person-card .card-footer { justify-content: center; font-size: .8rem; color: var(--subtle); width: 100%; word-break: break-all; }
.person-card .card-footer a { color: var(--subtle); position: relative; z-index: 2; }
.person-card .card-footer a:hover { color: var(--primary-600); }

/* Profile (people/single) — modelled on HugoBlox resume-biography-3 */
.profile { display: grid; gap: 3rem; grid-template-columns: 1fr; padding: 3.5rem 0 4rem; }
@media (min-width: 900px) { .profile { grid-template-columns: 19rem 1fr; } }
.profile-aside { text-align: center; }
@media (min-width: 900px) { .profile-aside { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; } }
.profile-aside .avatar { width: 13rem; height: 13rem; margin: 0 auto 1.5rem; border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--ring), var(--shadow-lg); }
.profile-aside h1 { font-size: 1.9rem; margin: .5rem 0 .3rem; }
.profile-aside .person-role { font-size: .95rem; }
.contact-list { list-style: none; padding: 0; margin: 1.5rem 0 0; text-align: left; font-family: var(--font-ui); font-size: .9rem; display: grid; gap: .55rem; }
.contact-list li { display: flex; align-items: center; gap: .65rem; color: var(--muted); word-break: break-word; }
.contact-list .icon { color: var(--primary-600); font-size: 1rem; }
.profile-main h2:first-child { margin-top: 0; }

/* ---------- Project / detail pages ------------------------------------- */
.detail { display: grid; gap: 3rem; grid-template-columns: 1fr; padding: 3rem 0 4rem; }
@media (min-width: 960px) { .detail { grid-template-columns: minmax(0, 1fr) 20rem; } }
.detail-aside .card-body { gap: 1.1rem; }
@media (min-width: 960px) { .detail-aside { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; } }
.facts { margin: 0; display: grid; gap: 1.1rem; }
.facts dt { font-family: var(--font-ui); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); margin-bottom: .25rem; }
.facts dd { margin: 0; font-size: 1rem; line-height: 1.5; }
.facts dd a .icon { font-size: .8em; margin-left: .15rem; }
.sponsor-logos { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.sponsor-logos img { max-height: 3.25rem; width: auto; background: #fff; padding: .4rem .6rem; border-radius: .5rem; box-shadow: 0 0 0 1px var(--ring); }
.people-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .people-list { grid-template-columns: repeat(2, 1fr); } }
.people-list li { display: flex; flex-direction: column; padding: .85rem 1.1rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-soft); line-height: 1.35; }
.people-list .from { font-family: var(--font-ui); font-size: .8rem; color: var(--subtle); margin-top: .2rem; }
.resource { flex-direction: row; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.4rem; }
.resource .ql-icon { width: 2.6rem; height: 2.6rem; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; background: var(--chip-bg); color: var(--primary-600); font-size: 1.2rem; flex-shrink: 0; }
.resource .url { font-family: var(--font-ui); font-size: .82rem; color: var(--subtle); word-break: break-all; }

/* Project list card */
.project-card .card-body { gap: .8rem; }
.project-card .sponsor-logos img { max-height: 2.4rem; }
.project-sub { font-family: var(--font-ui); font-size: .9rem; color: var(--muted); margin-top: -.3rem; }

/* ---------- News ------------------------------------------------------- */
.news-year { margin: 3rem 0 1.25rem; font-size: 1.5rem; color: var(--subtle); display: flex; align-items: center; gap: 1rem; }
.news-year::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.news-year:first-child { margin-top: 0; }
.news-list { display: grid; gap: 1.25rem; }
.news-item { display: grid; grid-template-columns: 1fr; gap: 1.25rem; padding: 1.4rem; }
@media (min-width: 720px) { .news-item { grid-template-columns: 9rem 1fr; padding: 1.5rem 1.75rem; } }
.news-item .thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .75rem; background: var(--border-soft); display: none; }
@media (min-width: 720px) { .news-item .thumb { display: block; } }
.news-item h3 { margin: .35rem 0 .5rem; font-size: 1.3rem; }
.news-item .content { font-size: 1.02rem; color: var(--muted); }
.news-item .content p:last-child { margin-bottom: 0; }
.news-card .card-media { aspect-ratio: 2 / 1; }
.news-card .card-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Teaching --------------------------------------------------- */
.term-head { display: flex; align-items: center; gap: .75rem; }
.course-card .card-body { gap: .75rem; }
.course-card .facts { grid-template-columns: 1fr 1fr; gap: .9rem 1.25rem; margin-top: .4rem; }
.course-card .facts dd { font-size: .95rem; }

/* ---------- Publications (bibsonomy-jekyll) ----------------------------- */
.bib-list > h3 {
  position: sticky; top: var(--header-h); z-index: 5; margin: 2.5rem 0 1rem; padding: .6rem 0;
  font-size: 1.5rem; color: var(--subtle); background: var(--bg); display: flex; align-items: center; gap: 1rem;
}
.bib-list > h3::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.bib-list > h3:first-child { margin-top: 0; }
.bib-list ul { list-style: none; margin: 0; padding: 0; }
.bib-list li {
  margin: 0 0 1rem; padding: 1.1rem 1.4rem; border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 0 0 1px var(--ring); font-size: 1rem; line-height: 1.55; color: var(--muted);
  transition: box-shadow .2s ease;
}
.bib-list li:hover { box-shadow: 0 0 0 1px var(--ring), var(--shadow); }
.bib-list li i, .bib-list li em { color: var(--fg); }
.bib-list .opt { display: block; margin-top: .55rem; font-family: var(--font-ui); font-size: .78rem; color: var(--subtle); }
.bib-list .opt a { font-weight: 600; }
.bib-list .altmetric-embed { margin-top: .5rem; }
.pub-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 2rem; }
.pub-search { flex: 1 1 18rem; position: relative; }
.pub-search input { width: 100%; font: inherit; font-family: var(--font-ui); font-size: .95rem; padding: .7rem 1rem .7rem 2.6rem; border-radius: .65rem; border: 1px solid var(--border); background: var(--surface); color: var(--fg); }
.pub-search input:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .2); }
.pub-search .icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--subtle); }
.pub-count { font-family: var(--font-ui); font-size: .85rem; color: var(--subtle); }
.year-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.5rem; }
.year-nav a { font-family: var(--font-ui); font-size: .8rem; font-weight: 500; padding: .3rem .6rem; border-radius: .4rem; background: var(--border-soft); color: var(--muted); }
.year-nav a:hover { background: var(--primary-600); color: #fff; text-decoration: none; }

/* ---------- Footer ----------------------------------------------------- */
.site-footer { background: var(--footer-bg); color: var(--footer-fg); border-top: 1px solid var(--border); margin-top: 2rem; font-family: var(--font-ui); font-size: .9rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; padding: 3rem 0 2rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-grid h4 { font-family: var(--font-ui); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); margin: 0 0 .9rem; font-weight: 600; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-grid a { color: var(--footer-fg); opacity: .8; }
.footer-grid a:hover { opacity: 1; color: var(--primary-600); text-decoration: none; }
.footer-grid > * { min-width: 0; }
.footer-brand .brand-name { white-space: normal; }
.footer-brand p { color: var(--muted); margin: .9rem 0 0; max-width: 28rem; line-height: 1.6; }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.25rem 0 1.75rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center; color: var(--subtle); font-size: .82rem; }
.footer-bottom a { color: var(--subtle); }
.th-logo { height: 2.25rem; width: auto; opacity: .9; }
[data-theme="dark"] .th-logo { filter: invert(1) hue-rotate(180deg); opacity: .8; }

/* Callout card (e.g. thesis advice) */
.callout { flex-direction: row; gap: 1.25rem; align-items: flex-start; padding: 1.5rem 1.6rem; margin-bottom: 2.5rem; }
.callout .ql-icon { width: 2.8rem; height: 2.8rem; border-radius: .75rem; display: inline-flex; align-items: center; justify-content: center; background: var(--chip-bg); color: var(--primary-600); font-size: 1.3rem; flex-shrink: 0; }
.callout .prose > :first-child { margin-top: .3rem; }
.callout .prose > :last-child { margin-bottom: 0; }
.callout h2 { font-size: 1.35rem; }
.narrow-col { max-width: 56rem; }

/* ---------- Utilities -------------------------------------------------- */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.empty { color: var(--subtle); font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .theme-toggle, .pub-toolbar, .year-nav { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

.is-home .site-footer { margin-top: 0; }
