@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --color-primary: #007acc;
  --color-primary-dark: #005f99;
  --bg-page: #f4f4f9;
  --bg-muted: #fafafa;
  --text: #333;
  --muted-text: #666;
  --footer-bg: #222;
  --footer-text: #ccc;
  --radius: 8px;
  --gap-lg: 40px;
  --breakpoint-md: 900px;
  /* Centralised font stacks */
  --font-ui: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Monaco, 'Roboto Mono', monospace;
}

/* General */
html, body {
  margin: 0;
  padding: 0;
  /* Use Inter for UI/body text (modern, software-friendly) */
  font-family: var(--font-ui);
  background: #fdfdfd;
  color: var(--text);
  line-height: 1.6;
}

/* Layout: sticky footer on short pages */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* Headings & subtitles: uppercase, monospace for a software aesthetic */
h1, h2, h3, h4, h5, h6 {
  /* Headings use the central heading stack */
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-top: 0;
}

/* Lede/subtitle class used across pages - keep Inter */
.lede {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--muted-text);
}

/* Base link appearance: remove underlines and provide a subtle animated underline on hover/focus.
   More specific rules (e.g. .nav-links a, #site-links a) will continue to override these defaults. */
a {
  text-decoration: none;
  color: var(--color-primary);
  position: relative;
  transition: color 180ms ease;
  outline-offset: 3px;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 260ms cubic-bezier(.2,.9,.2,1);
  border-radius: 2px;
  pointer-events: none;
}

a:hover::after,
a:focus::after {
  transform: scaleX(1);
}

a:hover,
a:focus {
  color: color-mix(in srgb, var(--color-primary) 70%, black 30%);
  text-decoration: none;
}

/* Disable animated underline on navigation links and on button-styled links
   (keep the animated underline for regular inline text links). */
.navbar a::after,
.nav-links a::after,
.nav-logo::after,
.navbar .dropbtn::after,
.nav-links li > a::after,
.btn::after,
a.btn::after,
button.btn::after,
.btn-primary::after {
  display: none !important;
  content: none !important;
}

/* Also disable the animated underline for the index bottom site-links */
#site-links a::after,
#site-links .dropbtn::after,
#site-links .dropdown > a::after {
  display: none !important;
  content: none !important;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  margin-top: auto; /* push footer to bottom on short pages */
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: 0.9rem;
}

:root {
  --color-primary: #007acc;
  --color-primary-dark: #005f99;
  --bg-page: #f4f4f9;
  --bg-muted: #fafafa;
  --text: #333;
  --muted-text: #666;
  --footer-bg: #222;
  --footer-text: #ccc;
  --radius: 8px;
  --gap-lg: 40px;
  --breakpoint-md: 900px;
}

/* Navbar container */
.navbar {
  background: var(--color-primary);
  padding: 15px 30px;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo */
.nav-logo {
  color: #fff;
  font-size: 1.5em;
  font-weight: bold;
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  position: relative;
}

.nav-links li {
  position: relative;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  transition: background 0.3s;
  display: inline-block;
}

/* Navbar typography: use JetBrains Mono like headings for a consistent software aesthetic */
.nav-logo,
.nav-links,
.nav-links li a,
.dropbtn,
.dropdown > a {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.nav-links li a:hover,
.nav-links li a.active {
  background: var(--color-primary-dark);
  border-radius: 6px;
}

/* Auto-highlight the current page's navbar item using the body page- class.
   This keeps highlighting consistent without needing the HTML to set .active.
   Research pages (including subpages) should highlight the Research tab. */
.page-about .nav-links a[href$="about.html"],
.page-cv .nav-links a[href$="cv.html"],
.page-contact .nav-links a[href$="contact.html"],
.page-links .nav-links a[href$="links.html"],
.page-research .nav-links .dropbtn,
.page-research .nav-links a[href$="research.html"] {
  background: var(--color-primary-dark);
  border-radius: 6px;
}

@media (max-width: var(--breakpoint-md)) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-links {
    flex-direction: column;
    gap: 10px;
  }
}
:root {
  --color-primary: #007acc;
  --color-primary-dark: #005f99;
  --bg-page: #f4f4f9;
  --bg-muted: #fafafa;
  --text: #333;
  --muted-text: #666;
  --footer-bg: #222;
  --footer-text: #ccc;
  --radius: 8px;
  --gap-lg: 40px;
  --breakpoint-md: 900px;
}

/* Dropdown component used in navbar and homepage */
.dropdown {
  position: relative;
}

.dropdown > a {
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-primary);
  min-width: 180px;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
  z-index: 1000;
  flex-direction: column;
  white-space: nowrap;
  transition: opacity 160ms ease, transform 160ms ease;
}

/* Reset list defaults on dropdown content so items align correctly */
.dropdown-content {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-content a {
  display: block;
  padding: 10px 16px;
  color: white;
  text-decoration: none;
}

.dropdown-content a:hover {
  background: var(--color-primary-dark);
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  display: block;
}

/* Keep menu open when hovering the content itself (prevents accidental closure while moving mouse) */
.dropdown-content:hover { display: block; }

/* Homepage drop-up (site-links) specific overrides */
#site-links .dropdown .dropdown-content {
  /* Move the drop-up further away from the trigger to avoid overlapping adjacent tabs */
  bottom: calc(100% + 12px);
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  /* fully rounded corners for a softer look */
  border-radius: var(--radius);
  padding: 10px 0 8px;
  min-width: 200px;
  overflow: hidden;
}

/* Hide the connector so the menu no longer overlaps neighbouring items */
#site-links .dropdown .dropdown-content::before { display: none; }

/* Ensure dropdown links inside the site-links drop-up are stacked vertically and animate on open */
/* keep the drop-up hidden by default; show as flex when opened via hover/focus */
#site-links .dropdown .dropdown-content {
  /* Keep layout (flex) but hide visually by default so display-changing rules elsewhere
     can't accidentally leave the menu visible. We animate opacity/transform on open. */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 12px 8px;

  /* Hidden state: keep element in the flow (absolute) but visually hidden via
     opacity and a small vertical offset. We rely on transitions so the hide
     animation is the inverse of the reveal. */
  opacity: 0;
  /* preserve the horizontal centering translate while offsetting vertically when hidden */
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(.2,.9,.2,1), transform 180ms cubic-bezier(.2,.9,.2,1);
}

/* Reveal the drop-up on hover/focus or when hovering the content itself */
/* Hover/focus and JS-driven .open state all reveal the popup */
#site-links .dropdown:hover .dropdown-content,
#site-links .dropdown:focus-within .dropdown-content,
#site-links .dropdown.open .dropdown-content,
#site-links .dropdown .dropdown-content:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* While closing (JS adds .closing) keep pointer-events on so the user can re-enter
   during the exit animation; pointer-events will be fully disabled after transition. */
#site-links .dropdown.closing .dropdown-content,
.navbar .dropdown.closing .dropdown-content {
  pointer-events: auto;
}

/* Force anchors inside the drop-up to be block-level so they stack (overrides broader nav rules) */
#site-links .dropdown .dropdown-content a {
  display: block !important;
  padding: 10px 18px;
  border-radius: 6px;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 260ms cubic-bezier(.2,.9,.2,1), opacity 200ms ease;
}

/* Staggered roll-out when the drop-up opens */
#site-links .dropdown:hover .dropdown-content a,
#site-links .dropdown:focus-within .dropdown-content a,
#site-links .dropdown.open .dropdown-content a {
  transform: translateY(0);
  opacity: 1;
}
#site-links .dropdown .dropdown-content a:nth-child(1) { transition-delay: 0ms; }
#site-links .dropdown .dropdown-content a:nth-child(2) { transition-delay: 40ms; }
#site-links .dropdown .dropdown-content a:nth-child(3) { transition-delay: 80ms; }
#site-links .dropdown .dropdown-content a:nth-child(4) { transition-delay: 120ms; }
#site-links .dropdown .dropdown-content a:nth-child(5) { transition-delay: 160ms; }

/* Make the homepage site-links use the same JetBrains Mono navbar typography */
#site-links,
#site-links a,
#site-links .dropbtn,
#site-links .dropdown .dropbtn {
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Monaco, 'Roboto Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* Navbar dropdown (main nav) — mirror the stacked, animated style used on the
   index site-links, but drop DOWN instead of up. This targets the Research menu. */
.navbar .dropdown .dropdown-content {
  /* position below the trigger and center horizontally */
  top: calc(100% + 12px);
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  /* inset the content so submenu items don't touch the rounded edges */
  padding: 10px 0 8px;
  border-radius: var(--radius);
  overflow: hidden;

  /* keep layout (flex) but hide visually by default via opacity/transform */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;

  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(.2,.9,.2,1), transform 180ms cubic-bezier(.2,.9,.2,1);
}

/* Reveal the navbar dropdown on hover/focus or when JS adds .open */
.navbar .dropdown:hover .dropdown-content,
.navbar .dropdown:focus-within .dropdown-content,
.navbar .dropdown.open .dropdown-content,
.navbar .dropdown .dropdown-content:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Make anchors inside navbar dropdown stack and animate like the site-links version */
.navbar .dropdown .dropdown-content a {
  display: block !important;
  /* include padding in width calculations and leave horizontal margin so hover bg is inset */
  box-sizing: border-box;
  width: calc(100% - 16px);
  margin: 0 8px;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: center;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 260ms cubic-bezier(.2,.9,.2,1), opacity 200ms ease;
}
.navbar .dropdown:hover .dropdown-content a,
.navbar .dropdown:focus-within .dropdown-content a,
.navbar .dropdown.open .dropdown-content a {
  transform: translateY(0);
  opacity: 1;
}
.navbar .dropdown .dropdown-content a:nth-child(1) { transition-delay: 0ms; }
.navbar .dropdown .dropdown-content a:nth-child(2) { transition-delay: 40ms; }
.navbar .dropdown .dropdown-content a:nth-child(3) { transition-delay: 80ms; }
.navbar .dropdown .dropdown-content a:nth-child(4) { transition-delay: 120ms; }
.navbar .dropdown .dropdown-content a:nth-child(5) { transition-delay: 160ms; }

/* Utility helpers */
.u-hidden {
  display: none !important;
}

.u-center {
  text-align: center !important;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Wordcloud canvas background */
/* Canvas restricted to hero area */
.hero { position: relative; overflow: hidden; }
#wordcloud-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.9;
}

/* p5 container: ensure it fills the hero and sits behind content */
#wordcloud-container {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Ensure hero content sits above the canvas */
.hero > * { position: relative; z-index: 1; }

.page-index {
  /* Full-page hero */
}
.page-index .hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: var(--bg-page);
  text-align: center;
  position: relative;
}
.page-index .hero img {
  width: 230px;
  height: 275px;
  border-radius: 50px; /* rounded rectangle */
  object-fit: cover;
  margin-bottom: 22px;
}
.page-index .hero h1 {
  font-size: 3em;
  margin: 0;
}
.page-index .hero p {
  font-size: 1.2em;
  margin-top: 10px;
}
.page-index .scroll-down {
  margin-top: 6px; /* moved slightly closer to the paragraph */
  font-size: 2.4em; /* slightly bigger */
  cursor: pointer;
  animation: bounce 2s infinite;
  position: relative; /* allow subtle vertical nudge */
  top: -4px; /* move the arrow up a few pixels */
}

.page-index .scroll-down img {
  width: 1.3em;
  height: 1.3em;
  display: inline-block;
  vertical-align: middle;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(10px);
  }
  60% {
    transform: translateY(5px);
  }
}
.page-index #site-links {
  padding: 60px 20px;
  background: #ffffff;
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  text-align: center;
}
.page-index #site-links a, .page-index #site-links .dropbtn {
  text-decoration: none;
  padding: 15px 25px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius);
  transition: background 0.3s;
  display: inline-block;
}
.page-index #site-links a:hover, .page-index #site-links .dropbtn:hover {
  background: var(--color-primary-dark);
}

/* Ensure homepage site-links use JetBrains Mono (override other rules) */
.page-index #site-links,
.page-index #site-links a,
.page-index #site-links .dropbtn,
.page-index #site-links .dropdown > a {
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Monaco, 'Roboto Mono', monospace !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  font-weight: 600 !important;
}

.page-about .intro {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 10%;
  gap: var(--gap-lg);
  background: var(--bg-page);
}
.page-about .intro-image img {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  object-fit: cover;
}

/* Flip-card for image panes: subtle 3D flip to reveal a short, secret-like note */
.flip-card {
  width: 100%;
  max-width: 100%;
  perspective: 1000px; /* enables 3D space */
  display: block; /* fill the section-image column */
}
.flip-card .flip-card-inner {
  position: relative;
  width: 100%;
  /* do not set a fixed height here; let the front image determine card height */
  transition: transform 640ms cubic-bezier(.2,.9,.2,1);
  transform-style: preserve-3d;
}
.flip-card .flip-card-front,
.flip-card .flip-card-back {
  position: relative;
  width: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}
.flip-card .flip-card-front img {
  display: block;
  width: 100%;
  height: auto;
}
.flip-card .flip-card-back {
  position: absolute; /* overlay the front when flipped */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transform: rotateY(180deg);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
}
.flip-card .flip-card-back-img {
  position: absolute;
  inset: 0;
  /* Ensure the faint backdrop always covers the card without stretching the aspect ratio.
     Use min-width to guarantee full horizontal coverage and center the image. */
  width: auto;
  min-width: 100%;
  height: 100%;
  object-fit: cover;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.06; /* even fainter */
  filter: saturate(0.35) blur(0.6px);
}
.flip-card .flip-card-back p {
  position: relative; /* sit above the faint image */
  margin: 0;
  font-style: italic;
  color: rgba(0,0,0,0.5); /* greyer / more transparent */
  text-align: center;
  line-height: 1.7; /* slightly more spaced */
  font-size: 0.95rem;
  opacity: 0.86; /* subtle */
  padding: 12px 10px;
  max-width: 88%;
  box-sizing: border-box;
  word-wrap: break-word;
}

/* Trigger flip on hover or focus (keyboard accessible) */
.flip-card:hover .flip-card-inner,
.flip-card:focus .flip-card-inner,
.flip-card:focus-within .flip-card-inner {
  transform: rotateY(180deg);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .flip-card .flip-card-inner { transition: none; }
  .flip-card:hover .flip-card-inner,
  .flip-card:focus .flip-card-inner { transform: none; }
  .flip-card .flip-card-back { transform: none; opacity: 0; }
  .flip-card:focus .flip-card-back, .flip-card:hover .flip-card-back { opacity: 1; }
}
.page-about .intro-text {
  flex: 2;
}
.page-about .intro-text h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
}
.page-about .section {
  display: flex;
  align-items: center;
  padding: 80px 10%;
  gap: 40px;
}
.page-about .section:nth-child(even) {
  flex-direction: row-reverse;
  background: var(--bg-muted);
}
.page-about .section-content {
  flex: 1.5;
}
.page-about .section-content h2 {
  font-size: 2em;
  margin-bottom: 20px;
}
.page-about .section-image {
  flex: 1;
}
.page-about .section-image img {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  object-fit: cover;
}
/* Slideshow inside flip-card-front for hobbies */
.page-about .section.hobbies .slideshow {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}
.page-about .section.hobbies .slideshow .slides {
  position: relative;
  width: 100%;
  height: 360px; /* fixed visual space for consistent slide size */
}
@media (max-width: 900px) {
  .page-about .section.hobbies .slideshow .slides { height: 260px; }
}
.page-about .section.hobbies .slideshow .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 500ms ease;
}
.page-about .section.hobbies .slideshow .slide.is-active { opacity: 1; }
.page-about .section.hobbies .slideshow .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  border: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  color: #fff;
}
.page-about .section.hobbies .slideshow .nav:hover { background: rgba(0,0,0,0.5); }
.page-about .section.hobbies .slideshow .nav img { filter: invert(1); width: 20px; height: 20px; }
.page-about .section.hobbies .slideshow .nav.prev { left: 10px; }
.page-about .section.hobbies .slideshow .nav.next { right: 10px; }
.page-about .section.hobbies .slideshow .dots {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  display: flex; gap: 6px; justify-content: center; align-items: center;
}
.page-about .section.hobbies .slideshow .dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  border: none; padding: 0; cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}
.page-about .section.hobbies .slideshow .dot.active { transform: scale(1.25); background: #fff; }

/* Ensure the flip back covers the same vertical space by matching the slideshow height */
.page-about .section.hobbies .flip-card .flip-card-back { min-height: 360px; }
@media (max-width: 900px){ .page-about .section.hobbies .flip-card .flip-card-back { min-height: 260px; } }

/* Preserve flip animation overall but allow slideshow interaction in hobbies:
  disable hover-triggered flip only in this section so arrows/dots remain usable */
.page-about .section.hobbies .flip-card:hover .flip-card-inner { transform: none; }

/* Center hover-to-flip zone so edges (with arrows) don't trigger flips */
.page-about .section.hobbies .flip-card { position: relative; }
.page-about .section.hobbies .flip-hover-zone {
  position: absolute;
  inset: 0;
  left: 56px; /* buffer for left arrow */
  right: 56px; /* buffer for right arrow */
  z-index: 1; /* below controls but above background */
}
/* When hovering the central zone, flip the inner panel (hover only; no focus to avoid sticky states) */
.page-about .section.hobbies .flip-hover-zone:hover + .flip-card-inner { transform: rotateY(180deg); }

/* Neutralise global focus/focus-within flipping on this card to prevent arrows/dots focus from flipping */
.page-about .section.hobbies .flip-card:focus .flip-card-inner,
.page-about .section.hobbies .flip-card:focus-within .flip-card-inner,
.page-about .section.hobbies .flip-hover-zone:focus + .flip-card-inner { transform: none !important; }

/* Class-driven flip state to avoid hover/focus edge cases */
.page-about .section.hobbies .flip-card.is-flipped .flip-card-inner { transform: rotateY(180deg) !important; }
.page-about .section.hobbies .flip-card.is-flipped .slideshow .nav,
.page-about .section.hobbies .flip-card.is-flipped .slideshow .dots { opacity: 0; pointer-events: none; transition: opacity 200ms ease; }

/* Keep controls above the hover zone */
.page-about .section.hobbies .slideshow .nav,
.page-about .section.hobbies .slideshow .dots { position: absolute; z-index: 2; }

/* Hide controls when hovering the center zone to reduce visual distraction during flip */
.page-about .section.hobbies .flip-hover-zone:hover ~ .flip-card-inner .slideshow .nav,
.page-about .section.hobbies .flip-hover-zone:hover ~ .flip-card-inner .slideshow .dots { 
  opacity: 0; 
  pointer-events: none; 
  transition: opacity 200ms ease; 
}
.page-about section {
  transition: background 0.5s ease, transform 0.3s ease;
}
@media (max-width: var(--breakpoint-md)) {
  .page-about .intro, .page-about .section {
    flex-direction: column;
    text-align: center;
  }
  .page-about .section:nth-child(even) {
    flex-direction: column;
  }
}

/* Shared page hero used by CV / Contact / Quick Links */
.page-hero {
  max-width: 1100px;
  margin: 40px auto 10px;
  padding: 0 20px;
}
.page-hero .hero-inner {
  background: var(--bg-page);
  padding: 26px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}
.page-hero .hero-inner h1 { margin: 0 0 8px; font-size: 2rem; }
.page-hero .hero-inner .lede { color: var(--muted-text); margin-bottom: 12px; }

.content { max-width: 1100px; margin: 18px auto 60px; padding: 0 20px; }

/* Buttons used across site */
.btn {
  display: inline-block;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  font-weight: 600;
}
.btn:not(.btn-primary):hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}
.btn:active { transform: translateY(-1px) scale(0.995); }
.btn-primary {
  background: linear-gradient(180deg, var(--color-primary) 0%, color-mix(in srgb, var(--color-primary) 80%, black 20%) 100%);
  color: #fff;
  border: none;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}
.btn-primary:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12); }

/* Download icon inside buttons: hidden by default, revealed on hover/focus */
.cv-actions .btn { padding-right: 44px; position: relative; }

/* Place the download icon absolutely at the right edge of the button, slightly lower than text baseline. */
.cv-actions .btn .btn-icon {
  width: 22px;
  height: 22px;
  position: absolute;
  right: 15px; /* padding from right edge */
  /* place at the vertical center, then nudge up by 4px */
  top: calc(50% - 4px);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  filter: brightness(0) invert(1); /* render icon white */
}
.cv-actions .btn:hover .btn-icon, .cv-actions .btn:focus .btn-icon, .cv-actions .btn:focus-within .btn-icon {
  opacity: 1;
  /* maintain same vertical placement on reveal so it doesn't jump */
  top: calc(50% - 4px);
  transform: translateY(-50%);
}

.links-grid ul { list-style: none; display: flex; gap: 12px; flex-wrap: wrap; padding: 0; margin: 0; justify-content: center; }
.links-grid ul li { margin: 0; }
.contact-card { background: var(--bg-muted); padding: 20px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04); text-align: center; max-width: 720px; margin: 20px auto; }

/* CV hero two-column layout (enhanced) */
.cv-hero {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  align-items: stretch; /* make both columns match height */
  padding: 6px;
}
.cv-actions {
  padding: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-muted) 85%, white 15%), var(--bg-muted));
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center download block */
  box-shadow: 0 8px 28px rgba(0,0,0,0.04);
  box-sizing: border-box;
  overflow: hidden; /* prevent children from overflowing the card */
}
.cv-actions h1 { margin: 0 0 8px; font-size: 1.6rem; color: var(--color-primary); }
.cv-actions .lede { margin-bottom: 12px; color: var(--muted-text); }
.cv-actions .btn { width: 100%; max-width: 100%; box-sizing: border-box; text-align: center; padding: 12px 14px; font-size: 1rem; white-space: normal; display: inline-flex; justify-content: center; }

.cv-summary {
  background: white;
  padding: 20px;
  border-radius: 12px;
  min-height: 48vh; /* take up more vertical space so more content is visible */
  max-height: 72vh;
  overflow: auto;
  box-shadow: 0 10px 36px rgba(0,0,0,0.06);
  padding-bottom: 10vh; /* extra scroll buffer so last section can be comfortably scrolled into view */
}
.cv-summary h2 { margin-top: 0; font-size: 1.2rem; color: var(--color-primary); }
.cv-summary p { margin: 0 0 12px; color: var(--muted-text); }

@media (max-width: 1100px) {
  .cv-hero { grid-template-columns: 320px 1fr; }
}
@media (max-width: 820px) {
  .cv-hero { grid-template-columns: 1fr; }
  .cv-summary { min-height: 36vh; max-height: 56vh; padding-bottom: 12vh; }
}

/* Two-column lists inside CV summary (more impactful) */
.cv-summary .cv-section { margin-bottom: 12px; }
.cv-summary .cv-section h3 { margin: 0 0 8px; font-size: 1.02rem; color: color-mix(in srgb, var(--color-primary) 60%, black 40%); }
.cv-summary .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Technical skills: main label and smaller muted meta on the next line */
.cv-section.skills .skill-main {
  font-weight: 700;
  color: #0b3b6f;
  font-size: 0.98rem;
  line-height: 1.2;
}
.cv-section.skills .skill-meta {
  font-size: 0.86rem;
  color: var(--muted-text);
  margin-top: 4px;
  margin-left: 2px;
}
/* Soft-skill items that only contain .skill-main need extra bottom padding so
   they visually match the height of technical skills which have a secondary line. */
.cv-section.skills li > .skill-main:only-child {
  display: block;
  padding-bottom: 30px; /* nudge to match the extra line used by technical skills */
}
.cv-summary ul { margin: 0; padding: 0; color: var(--muted-text); list-style: none; }
.cv-summary li {
  margin: 0 0 6px 0;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: transparent;
  border-radius: 6px;
}
.cv-summary li:last-child { border-bottom: none; margin-bottom: 0; }

/* cv entry structure */
.cv-entry { display: block; }
.cv-entry .entry-head { display: flex; align-items: center; gap: 10px; }
.cv-entry .logo-wrap { flex: 0 0 56px; display: inline-flex; align-items: center; justify-content: center; }
.cv-entry .org-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: rgba(0,0,0,0.03); }
.cv-entry .role { flex: 1 1 auto; font-weight: 700; color: #0b3b6f; font-size: 1.02rem; }
.cv-entry .org { margin-top: 8px; font-size: 0.92rem; color: color-mix(in srgb, var(--muted-text) 70%, black 30%); opacity: 0; transform: translateY(-6px); transition: opacity 200ms ease, transform 200ms ease; }
.cv-entry .period { font-size: 0.9rem; color: var(--muted-text); text-align: center; opacity: 0; transform: translateY(-6px); transition: opacity 180ms ease, transform 180ms ease; }
.cv-entry .entry-details { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 260ms ease, opacity 200ms ease, transform 220ms ease; transform: translateY(-6px); }
.cv-entry .entry-details .desc { margin: 6px 0 8px; color: var(--muted-text); }
.cv-entry .entry-actions { display: flex; gap: 6px; align-items: center; justify-content: center; }
.cv-entry .link-more { color: var(--color-primary); text-decoration: underline; font-weight: 600; }

/* Small badges used in Conferences & Talks to indicate involvement type */
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1;
}
.badge.attended { background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.7); }
.badge.talk { background: linear-gradient(180deg, rgba(0,122,204,0.12), rgba(0,92,153,0.12)); color: var(--color-primary-dark); }
.badge.poster { background: linear-gradient(180deg, rgba(0,0,0,0.06), rgba(0,0,0,0.04)); color: rgba(0,0,0,0.7); }

/* Compact presentation for Conferences & Talks to reduce vertical spacing */
.cv-section.conferences {
  margin-top: 6px;
}
.cv-section.conferences ul { padding: 0; margin: 0; }
.cv-section.conferences li { margin: 4px 0; }
.cv-section.conferences .cv-entry {
  display: grid;
  /* give the date column a little more room and push it rightwards */
  grid-template-columns: 1fr 180px 64px; /* meta | date | classification (fixed narrow icon column) */
  align-items: center;
  gap: 6px;
  /* slightly reduced vertical padding for a more compact list */
  padding: 4px 2px;
}
.cv-section.conferences .meta-left {
  display: flex;
  flex-direction: row;
  gap: 8px;
  /* center items so the icon lines up with the middle of the role/org block */
  align-items: center;
  min-width: 0; /* allow truncation */
  justify-self: start; /* keep the meta column left-aligned inside the grid */
  text-align: left; /* override any inherited centering */
}
.cv-section.conferences .meta-left .role { font-size: 0.95rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.cv-section.conferences .meta-left .org { font-size: 0.84rem; color: var(--muted-text); margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; text-align: left; line-height: 1.1; }
.cv-section.conferences .period { font-size: 0.85rem; color: var(--muted-text); text-align: right; }
.cv-section.conferences .entry-details { text-align: right; }

@media (max-width: 800px) {
  .cv-section.conferences .cv-entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .cv-section.conferences .entry-details { text-align: left; }
  /* On narrow screens, allow the meta to stack again to avoid excessive truncation */
  .cv-section.conferences .meta-left { flex-direction: column; align-items: flex-start; gap: 2px; }
}
.cv-section.conferences .entry-details { display: flex; align-items: center; justify-content: center; margin-left: 12px; padding: 0; max-height: none; opacity: 1; transform: none; justify-self: end; }
.cv-section.conferences .entry-details .desc { display: inline-block; font-size: 0.86rem; color: var(--muted-text); margin: 0; }
.cv-section.conferences .entry-head, .cv-section.conferences .org, .cv-section.conferences .period { display: inline-block; }

/* Attendance icon (permanent) with hidden label revealed on hover */
.cv-section.conferences .entry-details { align-self: center; justify-self: end; padding-right: 10px; }

/* Attendance container: fill the cell and center its contents for consistent alignment */
.cv-section.conferences .attendance {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%; /* ensure the container spans the grid row for reliable centering */
  width: 64px; /* match the grid column width so it cannot grow from the label */
  box-sizing: border-box;
}
.cv-section.conferences .attendance .attendance-icon {
  width: 22px;
  height: 22px;
  display: block;
  margin: 0 auto; /* center horizontally inside the fixed column */
  transform: translateY(10px); /* subtle downward nudge to visually align with text */
}
.cv-section.conferences .attendance .attendance-text {
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-section.conferences .attendance .attendance-text {
  font-size: 0.78rem;
  color: var(--muted-text);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 200ms ease;
  white-space: nowrap;
}

/* Position the attendance column on the right of the conference entry */
.cv-section.conferences .entry-details { display: flex; align-items: center; justify-content: flex-end; }

/* Reveal attendance text on hover/focus of the whole entry */
.cv-entry:hover .attendance .attendance-text,
.cv-entry:focus .attendance .attendance-text,
.cv-entry:focus-within .attendance .attendance-text {
  opacity: 1;
  transform: translateY(0);
}

/* Hover ring effect for clickable conference entries */
.cv-section.conferences .cv-entry {
  position: relative;
  display: grid; /* maintain internal layout when anchor is used */
  grid-template-columns: 1fr 180px 64px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  transition: transform 180ms cubic-bezier(.2,.9,.2,1), box-shadow 180ms cubic-bezier(.2,.9,.2,1), background-color 160ms ease;
  text-decoration: none; /* anchors should not show underline */
  color: inherit; /* preserve surrounding text color */
}
.cv-section.conferences .cv-entry:hover,
.cv-section.conferences .cv-entry:focus,
.cv-section.conferences .cv-entry:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
  background: linear-gradient(180deg, rgba(234,246,255,0.6), rgba(250,250,255,0.4));
}

/* Make the whole conference entry act like a link if data-href is present */
.cv-entry[data-href] { cursor: pointer; }

/* Hidden badges become visible on hover or keyboard focus of each entry */
.cv-section.conferences .badge-hidden {
  display: inline-block; /* always visible */
  font-weight: 700;
  margin-left: 8px;
  color: var(--muted-text);
  font-size: 0.78rem; /* smaller so labels fit on one line */
  line-height: 1;
  white-space: nowrap; /* prevent wrapping */
  vertical-align: middle;
}

/* Override global .cv-entry hiding behaviour: show org and period permanently in conferences.
   Conference dates should be visible but not bold when hovered. */
.cv-section.conferences .org {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
.cv-section.conferences .period {
  /* make conference dates visible by default */
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  /* ensure they remain normal weight even if hovered */
  font-weight: 400 !important;
}

/* Make institution names visible by default in the Education section too (periods remain hover-only) */
.cv-section.education .org {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* For Experience entries, keep only the org visible by default; dates (.period)
   will remain hidden until hover to match the user's preference. */
.cv-section.experience .org {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Align job titles to the top of the logo in Work & Volunteering entries */
.cv-section.experience .entry-head {
  align-items: flex-start;
}

.cv-section.experience .meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0; /* allow truncation inside */
  flex: 1 1 auto; /* take the remaining horizontal space beside the logo */
  text-align: left; /* align role/org consistently with other entries */
}
.cv-section.experience .meta .role {
  font-size: 0.98rem; /* slightly reduced for compactness */
  font-weight: 700;
  color: #0b3b6f;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-section.experience .meta .org {
  font-size: 0.84rem; /* match conferences */
  /* slightly larger gap from the title above */
  margin-top: 6px;
  /* tighter line spacing for multi-line institution names */
  line-height: 1.02;
  color: var(--muted-text);
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Reduce horizontal padding inside Work & Volunteering entries so long titles
   have a few extra characters of room. Keep vertical padding comfortable. */
.cv-section.experience .cv-entry {
  padding: 4px 6px;
}

@media (max-width: 520px) {
  /* Stack meta on small screens and allow wrapping */
  .cv-section.experience .entry-head { flex-direction: column; align-items: flex-start; }
  .cv-section.experience .meta .role { white-space: normal; font-size: 1.02rem; }
  .cv-section.experience .meta .org { text-align: left; }
}
.cv-section.conferences .entry-actions { margin: 0 0 0 12px; }

@media (max-width: 900px) {
  .cv-section.conferences .cv-entry { flex-direction: column; align-items: flex-start; }
  .cv-section.conferences .entry-details { margin-left: 0; }
}

/* Reveal period and details on hover or keyboard focus */
.cv-entry:hover .org, .cv-entry:focus .org, .cv-entry:focus-within .org { opacity: 1; transform: translateY(0); }
.cv-entry:hover .period, .cv-entry:focus .period, .cv-entry:focus-within .period { opacity: 1; transform: translateY(0); transition-delay: 80ms; font-weight: 700; }
/* reveal details after a short delay so org and period appear first */
.cv-entry:hover .entry-details, .cv-entry:focus .entry-details, .cv-entry:focus-within .entry-details { max-height: 400px; opacity: 1; transform: translateY(0); transition-delay: 200ms; }

/* Make action buttons inline and smaller for the summary */
.cv-entry .entry-actions .btn { padding: 8px 12px; font-size: 0.9rem; }

@media (max-width: 520px) {
  .cv-entry .entry-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cv-entry .period { order: 2; }
}
.cv-summary .two-col > div { background: color-mix(in srgb, var(--bg-muted) 88%, white 12%); padding: 10px; border-radius: 8px; }

@media (max-width: 520px) {
  .cv-summary .two-col { grid-template-columns: 1fr; }
}

/* Education box: mirror the two-column card look for the single-column education area */
.cv-section.education > div {
  background: color-mix(in srgb, var(--bg-muted) 88%, white 12%);
  padding: 12px;
  border-radius: 8px;
}

.cv-section.education .cv-entry { margin: 6px 0; padding: 6px; background: transparent; border-radius: 6px; }

/* Put the Conferences & Talks list into the same muted card as Education */
.cv-section.conferences > div {
  background: color-mix(in srgb, var(--bg-muted) 88%, white 12%);
  padding: 8px;
  border-radius: 8px;
}

.cv-section.conferences .cv-entry { background: transparent; border-radius: 6px; padding: 4px 2px; }

.page-research .blog-hero {
  max-width: 1100px;
  margin: 40px auto 20px;
  padding: 0 20px;
}
.page-research .blog-controls {
  display: flex;
  gap: 12px;
  margin: 18px 0 24px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center; /* center the search */
}

  /* search and simple inputs */
.page-research .blog-controls input[type=search] {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #ddd;
  width: 540px; /* wider centered search */
  max-width: calc(100% - 200px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

  /* Buttons: Clear (search), Read more (per-post), and Show more (pagination) */
.page-research .blog-controls button#clearFilters {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease;
  font-weight: 600;
}
.page-research .blog-controls button#clearFilters:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}
.page-research .blog-controls button#clearFilters:focus {
  outline: 3px solid rgba(0, 0, 0, 0.06);
}
.page-research .post-footer .toggle-expand {
  background: var(--color-primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  font-weight: 600;
}
.page-research .post-footer .toggle-expand:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}
.page-research .post.expanded .toggle-expand {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
/* Match Projects page expanded state to Blog's Show less styling */
.page-research .project.expanded .toggle-expand {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.page-research .load-more-wrap #loadMoreBtn {
  display: inline-block;
  background: linear-gradient(180deg, var(--color-primary) 0%, color-mix(in srgb, var(--color-primary) 80%, black 20%) 100%);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
  transition: transform 180ms cubic-bezier(0.2, 0.9, 0.2, 1), box-shadow 180ms ease, opacity 160ms ease;
}
.page-research .load-more-wrap #loadMoreBtn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.14);
}
.page-research .load-more-wrap #loadMoreBtn:active {
  transform: translateY(-1px) scale(0.995);
}
.page-research {
  /* timeline/range UI removed for simplified pagination */
}
.page-research .blog-list {
  max-width: 1100px;
  margin: 0 auto 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 20px 40px;
}
.page-research .post {
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  gap: 0;
  align-items: stretch;
  position: relative;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.page-research .post:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}
.page-research .post-media {
  flex: 0 0 260px;
  min-height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.page-research .post-body {
  padding: 20px 24px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.page-research .post-title {
  font-size: 1.2rem;
  margin: 0;
}
.page-research .post-meta {
  color: var(--muted-text);
  font-size: 0.9rem;
}
.page-research {
  /* hide legacy image overlay excerpt; use body-hover excerpt instead */
}
.page-research .excerpt {
  display: none;
}
.page-research {
  /* hover excerpt that appears under the title */
}
.page-research .hover-excerpt {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 180ms ease, max-height 240ms ease, transform 180ms ease;
  transform: translateY(6px);
  color: var(--muted-text);
  font-size: 0.95rem;
  margin-top: 6px;
}
.page-research {
  /* Expose short excerpt when .exposed is set on the post (managed by JS). This avoids
     browser-specific :focus-within/:hover quirks. */
}
.page-research .post.exposed:not(.expanded) .hover-excerpt {
  opacity: 1;
  transform: translateY(0);
  max-height: 400px;
}
.page-research {
  /* Force-hide state used to guard against browser quirks: when present the excerpt is hidden
     regardless of hover/focus. JS adds this on collapse and removes it on next intentional hover/focus. */
}
.page-research .post.excerpt-hidden .hover-excerpt {
  opacity: 0 !important;
  max-height: 0 !important;
  transform: translateY(6px) !important;
}
.page-research {
  /* date badge */
}
.page-research .date-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
.page-research {
  /* collapsed/expanded content */
}
.page-research .full-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}
.page-research .post.expanded .full-content {
  max-height: 2000px; /* large enough to show content */
}
.page-research .post-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
@media (max-width: 900px) {
  .page-research .post {
    flex-direction: column;
  }
  .page-research .post-media {
    width: 100%;
    flex: 0 0 220px;
  }
  .page-research .timeline-sidebar {
    display: none;
  }
}

.page-research .projects-hero {
  max-width: 1100px;
  margin: 40px auto 10px;
  padding: 0 20px;
}
.page-research .projects-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 14px 0 22px;
  flex-wrap: wrap;
}
.page-research .projects-controls input[type=search] {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  min-width: 240px;
}
.page-research .projects-controls select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
}
.page-research .projects-list {
  max-width: 1100px;
  margin: 0 auto 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 20px 40px;
}
.page-research .project {
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  gap: 0;
  /* keep the media pinned to the top so the body can expand without stretching the image */
  align-items: flex-start;
  position: relative;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.page-research .project:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}
.page-research .project-media {
  flex: 0 0 260px;
  width: 260px;
  /* slightly reduced default height so entries are less tall */
  height: 200px;
  max-height: 300px;
  min-height: 140px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  align-self: flex-start;
}
/* Left column wrapper containing the main media and the reveal logo underneath */
.page-research .project-left {
  flex: 0 0 260px;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}
.page-research .project-body {
  padding: 16px 20px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* small logo revealed under the main project image on hover/expand */
.page-research .project-below-media {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  overflow: hidden;
  transition: height 300ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease;
  opacity: 0;
  padding: 0 6px;
}
.page-research .project .inst-logo {
  width: 100%;
  max-width: 260px; /* match the left-column width */
  height: auto;
  display: block;
  object-fit: contain;
}
.page-research .project:hover .project-below-media,
.page-research .project.expanded .project-below-media,
.page-research .project:focus-within .project-below-media {
  height: 120px; /* larger reveal so logo is prominent and matches image width */
  opacity: 1;
}
.page-research .project-title {
  font-size: 1.2rem;
  margin: 0;
}
.page-research .status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
.page-research .status-completed {
  background: #2ecc71;
  color: white;
}
.page-research .status-ongoing {
  background: #f39c12;
  color: white;
}
.page-research {
  /* Links appear on hover, then description under them */
}
.page-research .project-links {
  display: flex;
  gap: 12px;
  align-items: center;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 220ms ease, max-height 360ms ease;
}
.page-research .project:hover .project-links, .page-research .project:focus-within .project-links, .page-research .project.expanded .project-links {
  opacity: 1;
  /* allow links region to expand higher if needed */
  max-height: 600px;
}
.page-research .hover-excerpt {
  color: var(--muted-text);
  font-size: 0.95rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 220ms ease, max-height 360ms ease;
}
.page-research .project:hover .hover-excerpt, .page-research .project:focus-within .hover-excerpt, .page-research .project.expanded .hover-excerpt {
  opacity: 1;
  /* allow the hover excerpt to expand to show longer descriptions */
  max-height: 800px;
}
.page-research .full-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 420ms ease;
}
.page-research .project.expanded .full-content {
  /* allow very large expansion when project is fully opened */
  max-height: 8000px;
}
.page-research {
  /* Icon-only buttons that expand on hover to reveal a label */
}
.page-research .project-links {
  display: flex;
  gap: 12px;
  align-items: center;
}
.page-research .project-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 8px;
  background: #f4f4f9;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  width: 40px;
  overflow: hidden;
  white-space: nowrap;
  transition: width 200ms ease, background 150ms ease, transform 120ms ease;
}
.page-research .project-links a .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
}
.page-research .project-links a .link-label {
  opacity: 0;
  transition: opacity 180ms ease;
  font-size: 0.95rem;
}
.page-research .project-links a.protected {
  background: #f6f6f8;
  color: var(--muted-text);
  border: 1px dashed rgba(0,0,0,0.06);
}
.page-research .project-links a.protected .icon {
  filter: grayscale(100%) brightness(0.9);
}
.page-research .project-links .protected {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #f6f6f8;
  color: var(--muted-text);
  border-radius: 8px;
  font-weight: 600;
  width: 120px; /* keep same visible width as expanded buttons */
  pointer-events: none; /* non-interactive */
}
.page-research .project-links .protected .icon {
  width: 18px;
  height: 18px;
  filter: grayscale(100%) brightness(0.9);
}
.page-research .project-links .protected .link-label { opacity: 1; }
.page-research .project-links a:hover {
  transform: translateY(-2px);
  background: #eaf4ff;
}
.page-research .project:hover .project-links a, .page-research .project:focus-within .project-links a, .page-research .project.expanded .project-links a {
  width: 120px;
}
.page-research .project:hover .project-links a .link-label, .page-research .project:focus-within .project-links a .link-label, .page-research .project.expanded .project-links a .link-label {
  opacity: 1;
}
@media (max-width: 900px) {
  .page-research .project {
    flex-direction: column;
  }
  .page-research .project-media {
    width: 100%;
    flex: 0 0 220px;
    height: 220px;
  }
  .page-research .project-left {
    width: 100%;
    flex: 0 0 auto;
  }
  .page-research .project-below-media {
    height: 48px;
  }
}

/*# sourceMappingURL=main.css.map */
