/* =====================================================================
   DELTA website – single stylesheet
   ---------------------------------------------------------------------
   1. Design tokens (colours, sizes)  – change the look of the whole site here
   2. Base + top bar
   3. Shared layout & components (page, title, cards, chips, pills, buttons)
   4. Pages: home, team, research, software, publications, news, contact
   5. Footer, lightbox, responsive rules
   ===================================================================== */

/* 1. TOKENS ---------------------------------------------------------- */
:root {
  --ink: #20313d;            /* headings, dark buttons */
  --ink-2: #293e4e;          /* nav underline */
  --text: rgba(47, 47, 47, .88);
  --muted: rgba(47, 47, 47, .64);
  --faint: rgba(47, 47, 47, .42);
  --line: rgba(32, 49, 61, .12);
  --line-strong: rgba(32, 49, 61, .3);
  --accent: #2c85a5;
  --accent-ink: #1f6a86;
  --warm: #b84d50;
  --bg: #ffffff;
  --soft: #f5f7f9;
  --radius: 12px;
  --container: 1100px;       /* the one content width used by every page */
  --nav-h: 76px;
  --font: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* 2. BASE + TOP BAR -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  background: #fff;
  border-top: 2px solid var(--ink-2);
  display: flex; align-items: center;
}
.topbar-inner {
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1rem;
  display: flex; align-items: center; justify-content: flex-start; gap: 2.2rem;
  overflow-x: auto; scrollbar-width: none;
}
.topbar-inner > .brand { margin-left: auto; }          /* auto margins centre the menu when it fits,  */
.topbar-inner > nav { margin-right: auto; }            /* and let it scroll from the start when it does not */
.topbar-inner::-webkit-scrollbar { display: none; }
.brand { flex: 0 0 auto; display: block; margin-right: 1.2rem; }
.brand img { display: block; height: 56px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.1rem; flex: 0 0 auto; margin: 0; padding: 0; list-style: none; }
.nav a {
  position: relative; display: block; white-space: nowrap;
  padding: .55em .5em .6em;
  font-size: .82rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
  color: rgba(74, 74, 74, .85);
  transition: color .25s;
}
.nav a::after {                     /* the dark underline bar */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px;
  background: var(--ink-2); transition: opacity .25s, transform .25s;
}
.nav a:hover { color: rgba(76, 76, 76, .55); }
.nav a[aria-current="page"] { color: #000; }
.nav a[aria-current="page"]::after { opacity: 0; transform: scaleX(.4); }

main { padding-top: var(--nav-h); min-height: calc(100vh - 140px); }
.tab { display: none; }
.tab.is-active { display: block; animation: tab-in .3s ease both; }
@keyframes tab-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 3. SHARED LAYOUT + COMPONENTS ------------------------------------- */
.page { width: min(100% - 2rem, var(--container)); margin: 0 auto; padding: 2.4rem 0 4rem; }
.page-title { text-align: center; font-size: 2.1rem; margin: 0 0 .3rem; }
.page-lead { text-align: center; color: var(--muted); max-width: 62ch; margin: 0 auto 2rem; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 2rem 0; text-align: center; }

/* links inside running text */
.prose a, .link {
  color: var(--accent-ink);
  border-bottom: 1px solid rgba(44, 133, 165, .35);
  transition: border-color .2s, color .2s;
}
.prose a:hover, .link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.prose strong { color: #000; }

.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }

.pill {
  display: inline-block; padding: 0 .65rem; border-radius: 999px;
  background: rgba(32, 49, 61, .07); color: var(--ink);
  font-size: .78rem; line-height: 1.8; white-space: nowrap;
}
.pill.warn { background: rgba(184, 77, 80, .12); color: #963c3e; }
a.pill:hover { background: rgba(44, 133, 165, .16); color: var(--accent-ink); }

.btn {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .28rem .85rem; border-radius: 8px;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  font-size: .82rem; line-height: 1.6; font-weight: 600; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.alt { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.alt:hover { background: rgba(32, 49, 61, .07); color: var(--ink); border-color: var(--line-strong); }
.btn.big { padding: .55rem 1.3rem; font-size: .95rem; border-radius: 999px; letter-spacing: .02em; }
.btn .note { font-weight: 400; opacity: .8; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3em;
  padding: .12rem .8rem; border-radius: 999px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--ink);
  font-size: .8rem; line-height: 1.7;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { background: rgba(32, 49, 61, .06); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { opacity: .6; }
.chips .label { align-self: center; margin-right: .3rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }

.group-title {                       /* year headings, team groups, ... */
  display: flex; align-items: baseline; gap: .7rem;
  margin: 2.2rem 0 .6rem; padding-bottom: .3rem;
  border-bottom: 2px solid var(--ink); font-size: 1.55rem;
}
.group-title .n { font-size: .85rem; font-weight: 600; color: var(--muted); }
.group-title:first-child { margin-top: 0; }

.toolbar-sticky {                    /* search + filters that stay visible */
  position: sticky; top: var(--nav-h); z-index: 5;
  background: var(--bg); padding: .7rem 0 .75rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.field {
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
  padding: .42rem .8rem; font-size: .85rem; line-height: 1.4; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44, 133, 165, .18); }
.field::placeholder { color: var(--faint); }
input.field { flex: 1 1 240px; min-width: 0; }
select.field {
  flex: 0 1 260px; min-width: 0; appearance: none; -webkit-appearance: none; padding-right: 2rem; text-overflow: ellipsis;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2320313d' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right .8rem center;
}
.count { margin-left: auto; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.toolbar-sticky .chips { margin-top: .6rem; }
.toolbar-sticky .chips + .chips { margin-top: .4rem; }

/* 4a. HOME ----------------------------------------------------------- */
.hero { text-align: center; padding-top: 4.5rem; }
.hero h1 { font-size: 2.7rem; margin-bottom: .35rem; color: #4a4a4a; }
.hero .tagline { font-size: 1.15rem; font-weight: 600; color: var(--muted); margin: 0 auto 1rem; max-width: 60ch; text-wrap: balance; }
.hero .mission { max-width: 62ch; margin: 0 auto 1.5rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-bottom: 2.4rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 720px; margin: 0 auto 2.6rem; }
.stat { text-align: center; padding: 1rem .5rem; border-radius: var(--radius); background: var(--soft); }
.stat b { display: block; font-size: 2rem; line-height: 1.1; color: var(--ink); }
.stat span { font-size: .85rem; color: var(--muted); }
.section-title { text-align: center; font-size: 1.4rem; margin: 0 0 1rem; }
.news-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.news-card { text-align: left; display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, transform .2s; }
.news-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.news-card .meta { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); }
.news-card h3 { font-size: 1.02rem; margin: 0; }
.more-link { text-align: center; margin-top: 1.2rem; }

/* 4b. TEAM ----------------------------------------------------------- */
.team-photo { display: block; width: 100%; max-width: 900px; margin: 0 auto 1rem; border-radius: var(--radius); }
.members { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem 1.6rem; padding-top: .8rem; }
.member { width: 190px; text-align: center; }
.avatar { width: 150px; height: 150px; margin: 0 auto .7rem; border-radius: 14px; overflow: hidden; background: var(--soft); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member h3 { font-size: 1.02rem; margin: 0; }
.member .role { font-size: .88rem; color: var(--text); line-height: 1.35; }
.member .dates { font-size: .8rem; color: var(--muted); }
.icons { display: flex; justify-content: center; gap: .4rem; margin-top: .55rem; }
.icons a {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line-strong); color: var(--ink); font-size: .8rem;
  transition: background .2s, color .2s, border-color .2s;
}
.icons a:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.alumni { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .1rem 2rem; }
.alumni li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.alumni b { color: var(--ink); }
.alumni span { color: var(--muted); font-size: .9rem; }

/* 4c. RESEARCH ------------------------------------------------------- */
.themes { display: grid; gap: 1.6rem; }
.theme { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; align-items: start; }
.theme-img { background: var(--soft); border-radius: var(--radius); padding: .8rem; display: flex; align-items: center; justify-content: center; min-height: 260px; }
.theme-img img { width: 100%; max-height: 300px; object-fit: contain; }
.theme h2 { font-size: 1.4rem; margin-bottom: .3rem; }
.theme .summary { color: var(--accent-ink); font-weight: 600; margin-bottom: .8rem; }
.checks { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .35rem; font-size: .93rem; }
.checks li { position: relative; padding-left: 1.5rem; }
.checks li::before { content: "\f00c"; font-family: "Font Awesome 5 Free"; font-weight: 900; position: absolute; left: 0; top: .1em; color: var(--accent); font-size: .78rem; }
.theme .body { max-width: 72ch; }
.theme .body p { font-size: .96rem; }
.theme .tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .6rem; }
.theme .tools .label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-right: .2rem; }

/* 4d. SOFTWARE ------------------------------------------------------- */
.tools-list { display: grid; gap: 1.1rem; }
.tool { display: grid; grid-template-columns: 240px 1fr; gap: 1.6rem; align-items: center; }
.tool-img { height: 160px; background: var(--soft); border-radius: 10px; padding: .6rem; display: flex; align-items: center; justify-content: center; }
.tool-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tool h2 { font-size: 1.35rem; margin-bottom: .2rem; }
.tool .tagline { margin-bottom: .6rem; }
.tool .pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }
.tool .links { display: flex; flex-wrap: wrap; gap: .45rem; }

/* 4e. PUBLICATIONS --------------------------------------------------- */
.pub-items { list-style: none; margin: 0; padding: 0; }
.pub { display: flex; gap: 1rem; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub-num { flex: 0 0 2.4rem; text-align: right; font-size: .82rem; line-height: 2; color: var(--faint); font-variant-numeric: tabular-nums; }
.pub-body { flex: 1; min-width: 0; }
.pub-title { margin: 0 0 .25rem; font-size: 1.03rem; font-weight: 700; line-height: 1.4; color: var(--ink); }
.pub-title a:hover { color: var(--accent); }
.pub-authors { margin: 0 0 .4rem; font-size: .88rem; line-height: 1.5; color: var(--text); }
.pub-authors strong { color: #000; }
.pub-authors .toggle { color: var(--accent-ink); cursor: pointer; white-space: nowrap; }
.pub-authors .toggle:hover { text-decoration: underline; }
.pub-authors .more[hidden] { display: none; }
.pub-info { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; font-size: .84rem; color: var(--muted); }
.pub-info .venue { font-style: italic; color: var(--ink); }

/* 4f. NEWS ----------------------------------------------------------- */
.year-block { margin-bottom: .5rem; }
.news-item { display: grid; grid-template-columns: 110px 1fr; gap: 1.2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-date { font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: .2rem; }
.news-body h3 { font-size: 1.12rem; margin: 0 0 .35rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.news-body p { margin: 0 0 .6rem; max-width: 76ch; }
.thumbs { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }
.thumb { padding: 0; border: 0; background: var(--soft); border-radius: 10px; overflow: hidden; cursor: zoom-in; height: 130px; }
.thumb img { height: 100%; width: auto; max-width: 240px; object-fit: cover; display: block; transition: transform .25s; }
.thumb:hover img { transform: scale(1.04); }

/* 4g. CONTACT -------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1.4rem; }
.card h2 { font-size: 1.2rem; display: flex; align-items: center; gap: .55rem; }
.card h2 i { color: var(--accent); font-size: 1rem; }
.person-mail { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.person-mail:last-child { border-bottom: 0; }
.positions { list-style: none; margin: 0; padding: 0; }
.positions li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.positions li:last-child { border-bottom: 0; }
.positions b { color: var(--ink); }
.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin: .6rem 0 1.2rem; }
.map-wrap iframe { display: block; width: 100%; height: 340px; border: 0; }
.how { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.address { font-style: normal; }

/* 5. FOOTER, LIGHTBOX, RESPONSIVE ----------------------------------- */
.site-footer { border-top: 1px solid var(--line); text-align: center; padding: 1.6rem 1rem 1.4rem; background: #fff; }
.site-footer h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: .9rem; }
.logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.2rem 1.8rem; margin-bottom: .8rem; }
.logos img { height: 38px; width: auto; max-width: 170px; object-fit: contain; }
.copyright { font-size: .82rem; color: var(--muted); margin: 0; }
.copyright a { border-bottom: 1px dotted var(--faint); }

.lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 2rem; background: rgba(15, 22, 28, .86); cursor: zoom-out; }
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }

@media (max-width: 1000px) {            /* tighter menu so it still fits on tablets */
  .topbar-inner { gap: 1rem; }
  .brand { margin-right: .2rem; }
  .brand img { height: 46px; }
  .nav { gap: .2rem; }
  .nav a { letter-spacing: .14em; font-size: .75rem; padding: .55em .4em .6em; }
}
@media (max-width: 900px) {
  .news-cards { grid-template-columns: 1fr; }
  .theme { grid-template-columns: 1fr; gap: 1rem; }
  .theme-img { min-height: 0; }
  .contact-grid, .how { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --nav-h: 64px; }
  body { font-size: 16px; }
  .brand img { height: 42px; }
  .nav a { letter-spacing: .16em; }
  .page-title { font-size: 1.75rem; }
  .hero { padding-top: 2.5rem; }
  .hero h1 { font-size: 2rem; }
    .stats { gap: .6rem; }
  .stat b { font-size: 1.5rem; }
  .tool { grid-template-columns: 1fr; gap: 1rem; }
  .tool-img { height: 150px; }
  .news-item { grid-template-columns: 1fr; gap: .2rem; }
  .pub-num { display: none; }
  .toolbar-sticky { position: static; }
  .toolbar-sticky .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .toolbar-sticky .chips::-webkit-scrollbar { display: none; }
  .toolbar-sticky .chip, .toolbar-sticky .chips .label { flex: 0 0 auto; white-space: nowrap; }
  .count { margin-left: 0; flex-basis: 100%; }
  select.field { flex: 1 1 100%; }
  .member { width: calc(50% - 1rem); }
  .avatar { width: 130px; height: 130px; }
  .thumb { width: calc(50% - .3rem); height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tab.is-active { animation: none; }
  * { transition: none !important; }
}
