:root{
  /* Dark theme – higher contrast */
  --bg:#0a0c12;
  --bg-2:#0d1220;
  --glass:rgba(255,255,255,.05);

  --text:#f1f4f9;           /* brighter body text */
  --muted:#c4ceda;          /* lighter muted text for readability */
  --line:rgba(255,255,255,.28); /* stronger border for dark theme */
  --brand:#5cd2f3;          /* brighter cyan for links/buttons */
  --accent:#b79cff;         /* slightly brighter purple */
  --ok:#34d399;
  --hdr-bg: rgba(10,12,18,.92);       /* header background (dark) */
  --nav-link:#e6edf6;                 /* nav link color (dark) */
  --card-b:20px;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --tag-bg: rgba(183,156,255,.22);
  --tag-border: rgba(183,156,255,.45);
  --tag-text: #eef6ff;
}

/* Light mode – also boost contrast a bit */
@media (prefers-color-scheme: light){
  :root{
    --bg:#f6f9fc;
    --bg-2:#eef3f9;
    --glass:rgba(255,255,255,.9);

    --text:#0b172a;         /* darker text in light mode */
    --muted:#314559;        /* readable muted text in light mode */
    --line:rgba(0,0,0,.15);
    --brand:#0e99c5;        /* cyan shifted darker for light bg */
    --accent:#6c4fff;
    --hdr-bg: rgba(255,255,255,.85);  /* header background (light) */
    --nav-link:#0b172a;               /* nav link color (light) */
    --tag-bg: rgba(108,79,255,.10);
    --tag-border: rgba(108,79,255,.30);
    --tag-text: #2b2963;
  }
}

/* --- Manual theme overrides (take precedence over media queries) --- */
:root[data-theme="dark"]{
  --bg:#0a0c12;
  --bg-2:#0d1220;
  --glass:rgba(255,255,255,.05);
  --text:#f1f4f9;
  --muted:#c4ceda;
  --line:rgba(255,255,255,.28);   /* stronger border for dark theme */
  --brand:#5cd2f3;
  --accent:#b79cff;
  --ok:#34d399;
  --hdr-bg: rgba(10,12,18,.92);
  --nav-link:#e6edf6;
  --tag-bg: rgba(183,156,255,.22);
  --tag-border: rgba(183,156,255,.45);
  --tag-text: #eef6ff;
}
:root[data-theme="light"]{
  --bg:#f6f9fc;
  --bg-2:#eef3f9;
  --glass:rgba(255,255,255,.9);
  --text:#0b172a;
  --muted:#314559;
  --line:rgba(0,0,0,.15);
  --brand:#0e99c5;
  --accent:#6c4fff;
  --ok:#34d399;
  --hdr-bg: rgba(255,255,255,.85);
  --nav-link:#0b172a;
  --tag-bg: rgba(108,79,255,.10);
  --tag-border: rgba(108,79,255,.30);
  --tag-text: #2b2963;
}

*{ box-sizing:border-box }
html{ scroll-behavior:smooth }
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:linear-gradient(180deg,var(--bg),var(--bg) 40%,var(--bg-2) 100%);
  color:var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a{ color:var(--brand); text-decoration:none }
a:hover, a:focus{
  text-decoration:underline;
}
.container{ max-width:1120px; margin:0 auto; padding:24px }

/* Header */
.hdr{
  position:sticky;
  top:0;
  z-index:40;
  background: var(--hdr-bg);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom:1px solid var(--line);
}
.hdr-inner{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px clamp(12px, 3vw, 24px) }
.brand{ display:flex; align-items:center; gap:12px }
.brand strong{
  font-weight:800;
  color:var(--text);
}
.logo{ width:40px; height:40px; border-radius:12px; background:linear-gradient(135deg,var(--brand),var(--accent)); display:grid; place-items:center; color:#07121a; font-weight:900; box-shadow:var(--shadow); border:1px solid var(--line) }
.nav a{
  margin:0 10px;
  color:var(--nav-link);
  font-weight:600;
}

/* Nav: center items and allow graceful wrapping on tighter widths */
.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  white-space: normal;
}
.nav a { margin: 0 8px; }

/* Tighter nav on mid-sized screens (delay wrapping) */
@media (max-width: 1180px){
  .nav { gap: 8px; }
  .nav a { margin: 0 6px; font-size: 0.96rem; }
}
@media (max-width: 1060px){
  .nav { gap: 6px; }
  .nav a { margin: 0 4px; font-size: 0.92rem; }
}
.nav a.active,
.nav a:hover,
.nav a:focus{
  color:var(--text);
  text-decoration:underline;
  text-underline-offset:3px;
}
.lang{ display:flex; align-items:center; gap:8px }
.lang button{ padding:6px 10px; border-radius:10px; border:1px solid var(--line); background:transparent; color:var(--text); cursor:pointer }
.lang button.active{ background:linear-gradient(135deg,var(--brand),var(--accent)); color:#041018; font-weight:700 }

/* Make language active state persistent from initial load (no flash) */
html[data-lang="en"] #btn-en,
html[data-lang="gr"] #btn-gr{
  background:linear-gradient(135deg,var(--brand),var(--accent));
  color:#041018;
  font-weight:700;
}
.theme{ display:flex; align-items:center; }

/* Removed old .theme button styles */

.theme select{
  padding:6px 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--bg);
  color:var(--text);
  cursor:pointer;
}
.theme select:focus{
  outline:2px solid var(--brand);
  outline-offset:2px;
  border-radius:10px;
}

/* Hamburger button (hidden on desktop) */
.hamburger{
  display:none;
  width:42px; height:42px;
  border-radius:10px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  cursor:pointer;
  align-items:center; justify-content:center;
  gap:5px;
}
.hamburger:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }
.hamburger span{
  display:block;
  width:20px; height:2px;
  background:var(--text);
}

/* Hero */
@keyframes fadeUp{
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero{ display:grid; grid-template-columns:1.2fr .8fr; gap:28px; align-items:center; padding:36px 24px }
@media (max-width: 1200px){
  .hero{ gap:22px; padding:28px 20px; }
}
.card{
  background:linear-gradient(180deg,var(--glass),rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:var(--card-b);
  box-shadow:var(--shadow);
  overflow:hidden; /* prevent any child from overflowing outside */
}
.hero .card{ padding:28px; animation:fadeUp .6s ease both }
@media (max-width: 880px){
  .hero .card{ padding:22px; }
  .tile{ padding:16px; }
  .grid{ gap:18px; }
}
@media (max-width: 980px){
  .hero{ grid-template-columns:1fr; }
}
@media (max-width: 860px){
  .grid{ grid-template-columns:1fr; }
  .tile{ grid-column:span 12; }
}

/* Ensure comfortable layout before phone sizes */
@media (max-width: 720px){
  .container{ padding:16px; }
  .grid{ grid-template-columns: 1fr !important; gap:16px; }
  .tile{ grid-column: auto !important; }
  /* Soften hyphenation on small screens for readability */
  .card p,
  .card li,
  .tile p,
  .tile li{
    hyphens: none;
    -webkit-hyphens: none;
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.55;
  }
}
@media (max-width: 640px){
  /* unify card padding on phones */
  section{ padding:8px 16px; margin:28px 0; }
  .grid{ gap:14px; }
  .card{ padding:16px; }
  .stats{ grid-template-columns:repeat(2,1fr); gap:10px; }
}
@media (max-width: 640px){
  .section-title{ font-size:22px; margin:10px 0 12px; }
  section{ scroll-margin-top:72px; }
}
.hero h1{
  color: var(--text);           /* adapt to dark/light theme */
  font-weight:800;
  letter-spacing:-0.2px;
}
/* Revert to fixed desktop font size */
h1{ font-size:44px; line-height:1.15; margin:.4rem 0 }
.hero .sub{
  color: var(--muted);          /* adapt to dark/light theme */
}
/* Revert to fixed desktop subtitle font size */
.sub{ color:var(--muted); font-size:18px }
/* Wrap long words/links and improve readability */
.card h1,.card h2,.card h3,.card .sub,
.card p,.card li,.tile p,.tile li{
  overflow-wrap:anywhere;
  word-break:break-word;
  hyphens:auto;
  -webkit-hyphens:auto; /* iOS Safari */
  line-height:1.5;
}
code{ white-space:normal; word-break:break-word; }
pre{ white-space:pre-wrap; word-break:break-word; }

/* Restore base grid and tile structure */
.grid{ display:grid; grid-template-columns:repeat(12,1fr); gap:22px }
.tile{ grid-column:span 6; padding:18px; overflow:hidden }
.tile h3{ margin:0 0 8px; font-size:18px }

/* Project action links */
.actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top:10px }
.proj-link{ display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; background:linear-gradient(180deg,var(--glass),rgba(255,255,255,.02)); color:var(--text) }
.proj-link:hover{ text-decoration:none; transform: translateY(-1px); }

/* Contact styles */
.contact-card{
  padding:14px 16px;          /* was 18px */
  display:flex;
  align-items:flex-start;     /* tighter top alignment */
  gap:12px;                   /* was 16px */
}

.contact-avatar{
  width:48px;                 /* was 60px */
  height:48px;                /* was 60px */
  border-radius:50%;
  object-fit:cover;
  border:2px solid var(--brand);
  flex:0 0 auto;
}

/* Compact list spacing only inside the contact card */
.contact-card .list{
  display:grid;               /* override generic .list */
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  column-gap:16px;
  row-gap:6px;                /* was 8px */
  line-height:1.25;           /* was 1.4 */
}

/* Icon utilities */
.icon{
  width:16px;                 /* was 18px */
  height:16px;                /* was 18px */
  fill:currentColor;         /* inherits text/link color */
  vertical-align:middle;
  opacity:.95;
  flex:0 0 auto;
}

/* --- Utilities moved from inline styles --- */
.hero-aside{
  padding:16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.hero-caption{
  font-weight:700;
  text-align:center;
  margin-top:4px;
  color: var(--text);
}
.pad-18{ padding:18px; }
.mt-10{ margin-top:10px; }

/* Inline external-link icon (force small size) */
.ext-icon{ display:inline-block; width:.95em; height:.95em; max-width:14px; max-height:14px; vertical-align:-1px; fill:currentColor; flex:0 0 auto; }
.ext-icon path{ fill:currentColor; }

/* Checklist with checkmark icons */
.checklist{ list-style:none; padding-left:0; display:grid; gap:8px; }
.checklist li{ display:flex; align-items:flex-start; gap:8px; }
.icon-check{ width:16px; height:16px; color:var(--ok); flex:0 0 auto; margin-top:3px; }
.icon-check svg{ display:block; width:100%; height:100%; }

/* Align icon + text nicely inside contact items */
.contact-card .list li{
  display:flex;
  align-items:center;
  gap:6px;                    /* was 8px */
  font-size:14.5px;           /* a bit smaller */
}

/* Keep labels narrow and readable */
.contact-card .list li span[id^="lbl-"]{
  min-width:84px;             /* aligns columns */
  color:var(--muted);
}
/* Slightly brighten icons on hover to signal interactivity */
.contact-card a:hover .icon,
.contact-card a:focus .icon{
  opacity:1;
}

/* Mobile-friendly: stack avatar above details */
@media (max-width: 640px){
  .contact-card{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;                 /* was 12px */
    padding:14px;             /* tighter on mobile too */
  }
  .contact-avatar{
    width:52px;               /* a touch larger for touch */
    height:52px;
  }
  .contact-card .list{
    grid-template-columns: 1fr; /* single column on mobile */
    row-gap:8px;
  }
  .contact-card .list li{ font-size:15px; }
  .card li, .tile li{ line-height:1.55; }
}

/* Visible keyboard focus for header links */
.nav a:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
  border-radius:6px;
}
.btn:focus-visible,
.lang button:focus-visible,
.theme select:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
  border-radius:10px;
}

/* Skip link utility */
.sr-only-focusable{ position:absolute; left:-9999px; }
.sr-only-focusable:focus{ left:8px; top:8px; background:var(--bg); color:var(--text); padding:8px 10px; border-radius:8px; outline:2px solid var(--brand); }

/* Back to top button */
.back-to-top{
  position:fixed;
  right:16px; bottom:16px;
  width:40px; height:40px;
  border-radius:999px;
  border:1px solid var(--line);
  background:linear-gradient(180deg,var(--glass),rgba(255,255,255,.02));
  color:var(--text);
  box-shadow: var(--shadow);
  cursor:pointer;
  display:grid; place-items:center;
  opacity:0; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
  z-index:50;
}
.back-to-top.show{
  opacity:1; transform: translateY(0);
}
.back-to-top:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}

/* Added per instructions */
@media (max-width:980px){
  .hdr{ position:sticky; top:0; }

  /* Mobile nav: hidden by default, slides down when open */
  .hamburger{ display:inline-flex; }
  .nav{
    position:fixed;
    left:0; right:0; top:64px;
    background: var(--hdr-bg);
    backdrop-filter: blur(10px);
    display:flex; flex-direction:column;
    gap:12px;
    padding:16px 24px;
    transform: translateY(-130%);
    opacity:0;
    pointer-events:none;
    transition: transform .25s ease, opacity .25s ease;
    border-bottom:1px solid var(--line);
  }
  .nav.nav--open{ transform: translateY(0); opacity:1; pointer-events:auto; }
  .nav a{ padding:8px 0; margin:0; }
}

/* Adjust hero image scaling */
.hero .card img{
  max-width:180px;
  height:auto;
}

@media (hover: none){
  .card:hover{ transform:none; box-shadow:var(--shadow); }
  .btn:hover{ transform:none; }
}

/* Print styles */
@media print{
  /* Basic page setup */
  @page{ margin: 12mm; }
  html, body{ background:#fff !important; }
  body{ color:#000 !important; }

  /* Simplify components for print */
  .hdr, .hamburger, .theme, .lang, .back-to-top{ display:none !important; }
  .card, .tile{ box-shadow:none !important; background:#fff !important; border:1px solid #ccc !important; }
  .btn, .tag{ display:none !important; }

  /* Layout adjustments */
  .container{ max-width:100% !important; padding:0 !important; }
  section{ margin:12px 0 !important; padding:0 !important; }
  .grid{ gap:12px !important; grid-template-columns:1fr 1fr !important; }

  /* Typography tweaks for print clarity */
  h1{ font-size:28px !important; }
  h2{ font-size:20px !important; }
  h3{ font-size:16px !important; }
  .sub{ font-size:14px !important; color:#000 !important; }

  /* Images */
  img{ max-width:100% !important; height:auto !important; box-shadow:none !important; border:none !important; }

  /* Links show URL (optional; many browsers handle this via settings) */
  a{ color:#000 !important; text-decoration:none !important; }
}

/* Revert tag font size to fixed desktop size */
.tag{ display:inline-flex; gap:8px; align-items:center; padding:6px 12px; border-radius:999px; background:var(--tag-bg); border:1px solid var(--tag-border); color:var(--tag-text); font-weight:600; font-size:13px }


/* Make sure teaching badges sit nicely together */
#teaching .proj-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:.35rem 0 .5rem;
}

/* Bold label styling for Role / Ρόλος */
.role-label{ font-weight:700; }

/* --- Project meta & base project badge --- */
.proj-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:.25rem 0 .5rem;
}
.proj-badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  line-height:1;
  border:1px solid var(--line);
  background:transparent;   /* let color variants paint background */
  color:var(--text);
  text-decoration:none;
}


/* Small inline emoji icons for skills/badges */
.skill-ico{
  display:inline-block;
  font-size:1rem;
  line-height:1;
  margin-right:6px;
  transform: translateY(1px);
  opacity:.95;
}

/* Emoji inside publication badges */
.pub-badge .pub-emoji{
  display:inline-block;
  margin-right:6px;
  transform: translateY(1px);
  line-height:1;
}

/* — Tighten cards on smaller phones — */
@media (max-width: 600px){
  /* overall card padding */
  .card{ padding:14px; }

  /* project/portfolio tiles a bit tighter */
  .card.tile{
    padding:12px;
    margin-bottom:14px;
  }

  /* spacing around badges and lists */
  .card.tile .proj-meta{ margin:4px 0 6px; }
  .card.tile ul.list{ margin-top:6px; }

  /* make badges a touch more compact */
  .proj-badge{ padding:3px 8px; font-size:11.5px; }
}

/* --- Generic Button Styles --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--glass), rgba(255,255,255,.02));
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover,
.btn:focus {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border: none;
  color: #041018;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--brand);
  color: var(--brand);
}
.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 600px) {
  .btn {
    font-size: 13.5px;
    padding: 7px 14px;
  }
}

/* --- Publications: badges + DOI links --- */
.pub-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin:6px 0 8px;
}
.pub-badge{
  display:inline-block;
  padding:3px 7px;
  border-radius:6px;
  font-size:12px;
  font-weight:600;
  margin-right:6px;
  color:#fff;            /* ensure text readable on colored bg */
  border:1px solid var(--line);
}
.pub-badge.journal{ background:#1976d2; }
.pub-badge.book{    background:#6a1b9a; }

/* DOI link styling */
.doi-link{
  font-size:12.5px;
  color:var(--brand);
  text-decoration:none;
  border-bottom:1px dotted var(--brand);
  padding-bottom:1px;
}
.doi-link:hover,
.doi-link:focus{ text-decoration:underline; border-bottom-color:transparent; }

/* Tighten publication items on small screens */
@media (max-width: 600px){
  .pub-meta{ gap:6px; margin:4px 0 6px; }
  .pub-badge{ padding:2px 8px; font-size:11.5px; }
  .doi-link{ font-size:11.5px; }
  #publications .timeline-item h3{ font-size:16px; }
  #publications .timeline .muted{ font-size:13.5px; }
}

/* --- Badge color palette (Research & Teaching) --- */

/* Research program badges */
.badge-horizon { background:#0b66c3; color:#fff; border-color:rgba(0,0,0,.1); }
.badge-life    { background:#2e7d32; color:#fff; border-color:rgba(0,0,0,.1); }
.badge-espa    { background:#b23a48; color:#fff; border-color:rgba(0,0,0,.1); }

/* Portfolio/other badges */
.badge-web3      { background:#6a1b9a; color:#fff; border-color:rgba(0,0,0,.1); }
.badge-research  { background:#1565c0; color:#fff; border-color:rgba(0,0,0,.1); }
.badge-security  { background:#ef6c00; color:#fff; border-color:rgba(0,0,0,.1); }
.badge-resources { background:#455a64; color:#fff; border-color:rgba(0,0,0,.1); }
.badge-oss       { background:#263238; color:#fff; border-color:rgba(0,0,0,.1); }

/* Teaching badges */
.badge-msc   { background:#3949ab; color:#fff; border-color:rgba(0,0,0,.1); } /* common MSc label */
.badge-uniwa { background:#00695c; color:#fff; border-color:rgba(0,0,0,.1); }
.badge-uom   { background:#ad1457; color:#fff; border-color:rgba(0,0,0,.1); }

a.proj-badge:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* --- Teaching: Semester & Year badges --- */
.proj-badge.badge-semester{
  color:#fff;
  border:none;
}

/* Spring: purple */
.proj-badge.badge-semester[data-semester="spring"]{
  background:#7c3aed; /* purple 600 */
}

/* Fall: amber */
.proj-badge.badge-semester[data-semester="fall"]{
  background:#d97706; /* amber 600 */
}

/* Neutral year badge */
.proj-badge.badge-year{
  background: linear-gradient(180deg,var(--glass), rgba(255,255,255,.02));
  color: var(--text);
  border:1px solid var(--line);
}

/* --- Year badges for research projects --- */
.proj-year{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  line-height:1;
  background:#455a64;      /* unified slate badge color */
  color:#fff;
  border:1px solid rgba(0,0,0,.1);
}

#publications .card .pub-actions{ margin-top:16px; }
:root[data-theme="light"] .proj-year{ background:#37474f; color:#fff; }

.img-fluid{ display:block; max-width:100%; height:auto; }

/* Frame used for the hero portrait image (works on <img> inside <picture>) */
.hero-portrait{
  width: clamp(160px, 24vw, 220px);      /* flexible but bounded */
  aspect-ratio: 5 / 6;                   /* reserve space to reduce CLS */
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: transparent;
}

/* Optional image frame helpers */
.img-rounded{ border-radius:16px; overflow:hidden; }
.img-bordered{ border:1px solid var(--line); }
.img-shadow{ box-shadow: var(--shadow); }

/* Ensure images inside <picture> behave like .img-fluid by default */
picture img{ display:block; max-width:100%; height:auto; }

/* --- Affiliation logos (About + Footer) --- */
.affil-logos{
  display:flex;
  flex-wrap:wrap;
  gap:14px 18px;
  align-items:center;
  justify-content:center;
  margin-top:12px;
  padding-top:10px;
  border-top:1px dashed var(--line);
}
.affil-logo{
  height:38px;
  width:auto;
  max-width:140px;
  object-fit:contain;
  padding:6px 10px;                 /* add a light chip behind logos */
  border-radius:10px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06); /* visible on dark theme */
  filter:none;                        /* no grayscaling on dark */
  opacity:.95;
  transition: filter .2s ease, transform .2s ease, opacity .2s ease;
  mix-blend-mode: normal;
}
:root[data-theme="light"] .affil-logo{
  background: rgba(0,0,0,.04);
  /* keep logos readable on light theme */
  filter: grayscale(15%) opacity(.98) brightness(.96);
}
.affil-logo:hover,
.affil-logo:focus{
  filter: none;
  opacity:1;
  transform: translateY(-1px);
}

/* --- Per‑logo tuning for tricky marks --- */
/* Use on very light logos in LIGHT theme (e.g., INATBA, Frontiers) */
.affil-logo.logo--boost{
  filter: grayscale(0%) opacity(1) brightness(1) contrast(1.12) !important;
}
/* Add a subtle outline on light bg to keep faint logos visible */
:root[data-theme="light"] .affil-logo.logo--shadow{
  background:#fff;
  border-color:rgba(0,0,0,.12);
  filter: grayscale(0%) opacity(1) brightness(.98) contrast(1.2) drop-shadow(0 0 .5px rgba(0,0,0,.45)) !important;
}
/* For dark logos on DARK theme (e.g., LCIIS): invert to a light mark */
:root[data-theme="dark"] .affil-logo.logo--invert{
  filter: invert(1) hue-rotate(180deg) brightness(1.1) contrast(1.05) !important;
  background: rgba(255,255,255,.12);
}

/* Extra helpers for tricky marks */
/* Darken very light (white) logos on LIGHT theme — e.g., INATBA */
@media (prefers-color-scheme: light){
  .logo--onlight-darken{ filter: brightness(0) saturate(100%) invert(8%) contrast(112%); }
}
:root[data-theme="light"] .logo--onlight-darken{
  filter: brightness(0) saturate(100%) invert(8%) contrast(112%);
}

/* Small universal shadow to lift thin strokes on light bg */
.logo--tinyshadow{ filter: drop-shadow(0 0 0.6px rgba(0,0,0,.45)); }

/* Footer presentation */
.site-footer{
  margin-top:32px;
  padding:18px 0 26px;
  border-top:1px solid var(--line);
  text-align:center;
  background: linear-gradient(180deg, rgba(255,255,255,.00), rgba(255,255,255,.02));
}
.affil-logos--footer{
  border-top:none;
  margin-top:0;
  padding-top:0;
  gap:12px 16px;
}
.site-footer .footer-copy{
  margin-top:10px;
  font-size:14px;
  color:var(--muted);
}

/* Responsive logo sizing */
@media (max-width: 720px){
  .affil-logo{ height:32px; max-width:120px; }
}
@media (max-width: 480px){
  .affil-logo{ height:28px; max-width:100px; }
}